diff --git a/core/src/main/java/com/themecleanflex/models/DatalistModel.java b/core/src/main/java/com/themecleanflex/models/DatalistModel.java new file mode 100644 index 000000000..93a57437e --- /dev/null +++ b/core/src/main/java/com/themecleanflex/models/DatalistModel.java @@ -0,0 +1,545 @@ +package com.themecleanflex.models; + +import com.peregrine.nodetypes.models.AbstractComponent; +import com.peregrine.nodetypes.models.IComponent; +import com.peregrine.nodetypes.models.Container; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Named; + +/* + //GEN[:DATA + { + "definitions": { + "Datalist": { + "type": "object", + "x-type": "component", + "properties": { + "endpointurl": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form submit endpoint URL", + "x-form-type": "text", + "x-default": "" + }, + "loadFunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call to load data", + "x-form-hint": "Function must accept (name)", + "x-form-type": "text" + }, + "bgref": { + "x-form-type": "reference", + "type": "object", + "x-type": "component", + "properties": { + "anchorname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Anchor Name", + "x-form-type": "text" + }, + "extraclasses": { + "type": "string", + "x-source": "inject", + "x-form-label": "Additonal Classes", + "x-form-type": "text" + }, + "htmlelement": { + "type": "string", + "x-source": "inject", + "x-form-label": "Semantic Element", + "x-form-type": "materialselect", + "x-default": "section", + "properties": { + "section": { + "x-form-name": "section", + "x-form-value": "section" + }, + "article": { + "x-form-name": "article", + "x-form-value": "article" + }, + "main": { + "x-form-name": "main", + "x-form-value": "main" + }, + "div": { + "x-form-name": "div", + "x-form-value": "div" + }, + "header": { + "x-form-name": "header", + "x-form-value": "header" + }, + "nav": { + "x-form-name": "nav", + "x-form-value": "nav" + }, + "footer": { + "x-form-name": "footer", + "x-form-value": "footer" + } + } + }, + "colorscheme": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Color Scheme", + "x-form-type": "materialradio", + "x-default": "", + "properties": { + "none": { + "x-form-name": "None", + "x-form-value": "" + }, + "light": { + "x-form-name": "Light", + "x-form-value": "light" + }, + "dark": { + "x-form-name": "Dark", + "x-form-value": "dark" + } + } + }, + "custombackground": { + "type": "string", + "x-source": "inject", + "x-form-label": "Custom Background", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "backgroundtype": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Type", + "x-form-type": "materialradio", + "x-form-visible": "model.custombackground == 'true'", + "properties": { + "color": { + "x-form-name": "Color", + "x-form-value": "color" + }, + "gradient": { + "x-form-name": "Gradient", + "x-form-value": "gradient" + }, + "image": { + "x-form-name": "Image", + "x-form-value": "image" + }, + "video": { + "x-form-name": "Video", + "x-form-value": "video" + } + } + }, + "bgvideo": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Video", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x-default": "https://www.youtube.com/embed/Ju86mknumYM", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgimage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Image", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgxposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background X Position", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgyposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Y Position", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Size Style", + "x-form-type": "text", + "x-default": "cover" + }, + "overlay": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay", + "x-form-type": "materialswitch", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + "overlaycolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay Color", + "x-form-type": "color", + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "overlayopacity": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay opacity", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgcolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Color", + "x-form-type": "color", + "x-form-visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "color2": { + "type": "string", + "x-source": "inject", + "x-form-label": "Color 2", + "x-form-type": "color", + "x-form-visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x-default": "#c0c0c0" + }, + "blockwidth": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Width", + "x-form-type": "materialradio", + "x-default": "default", + "properties": { + "default": { + "x-form-name": "Default", + "x-form-value": "default" + }, + "full": { + "x-form-name": "Full Width", + "x-form-value": "full" + }, + "article": { + "x-form-name": "Article Width", + "x-form-value": "article" + } + } + }, + "fullheight": { + "type": "string", + "x-source": "inject", + "x-form-label": "Full Height", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "toppadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Top Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-visible": "model.fullheight != 'true'" + }, + "bottompadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Bottom Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-visible": "model.fullheight != 'true'" + }, + "contentname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Content Name", + "x-form-type": "text" + } + } + } + } + } + }, + "name": "Datalist", + "componentPath": "themecleanflex/components/datalist", + "package": "com.themecleanflex.models", + "modelName": "Datalist", + "classNameParent": "AbstractComponent" +} +//GEN] +*/ + +//GEN[:DEF +@Model( + adaptables = Resource.class, + resourceType = "themecleanflex/components/datalist", + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, + adapters = IComponent.class +) +@Exporter( + name = "jackson", + extensions = "json" +) + +//GEN] +public class DatalistModel extends AbstractComponent { + + public DatalistModel(Resource r) { super(r); } + + //GEN[:INJECT + /* {"type":"string","x-source":"inject","x-form-label":"Form submit endpoint URL","x-form-type":"text","x-default":""} */ + @Inject + @Default(values ="") + private String endpointurl; + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call to load data","x-form-hint":"Function must accept (name)","x-form-type":"text"} */ + @Inject + private String loadFunction; + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ + @Inject + private String anchorname; + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-type":"text"} */ + @Inject + private String extraclasses; + + /* {"type":"string","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + @Inject + @Default(values ="section") + private String htmlelement; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + @Inject + @Default(values ="") + private String colorscheme; + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String custombackground; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + @Inject + private String backgroundtype; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + @Default(values ="https://www.youtube.com/embed/Ju86mknumYM") + private String bgvideo; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + private String bgimage; + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgxposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgyposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-default":"cover"} */ + @Inject + @Default(values ="cover") + private String bgsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + @Inject + private String overlay; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String overlaycolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String overlayopacity; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String bgcolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + @Inject + @Default(values ="#c0c0c0") + private String color2; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + @Inject + @Default(values ="default") + private String blockwidth; + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String fullheight; + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String toppadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String bottompadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-type":"text"} */ + @Inject + private String contentname; + + +//GEN] + + //GEN[:GETTERS + /* {"type":"string","x-source":"inject","x-form-label":"Form submit endpoint URL","x-form-type":"text","x-default":""} */ + public String getEndpointurl() { + return endpointurl; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call to load data","x-form-hint":"Function must accept (name)","x-form-type":"text"} */ + public String getLoadFunction() { + return loadFunction; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ + public String getAnchorname() { + return anchorname; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-type":"text"} */ + public String getExtraclasses() { + return extraclasses; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + public String getHtmlelement() { + return htmlelement; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + public String getColorscheme() { + return colorscheme; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-type":"materialswitch","x-default":"false"} */ + public String getCustombackground() { + return custombackground; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + public String getBackgroundtype() { + return backgroundtype; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgvideo() { + return bgvideo; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgimage() { + return bgimage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgxposition() { + return bgxposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgyposition() { + return bgyposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-default":"cover"} */ + public String getBgsize() { + return bgsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + public String getOverlay() { + return overlay; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getOverlaycolor() { + return overlaycolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getOverlayopacity() { + return overlayopacity; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getBgcolor() { + return bgcolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + public String getColor2() { + return color2; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + public String getBlockwidth() { + return blockwidth; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-default":"false"} */ + public String getFullheight() { + return fullheight; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + public String getToppadding() { + return toppadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + public String getBottompadding() { + return bottompadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-type":"text"} */ + public String getContentname() { + return contentname; + } + + +//GEN] + + //GEN[:CUSTOMGETTERS + //GEN] + +} diff --git a/core/src/main/java/com/themecleanflex/models/FormModel.java b/core/src/main/java/com/themecleanflex/models/FormModel.java new file mode 100644 index 000000000..49d2e4843 --- /dev/null +++ b/core/src/main/java/com/themecleanflex/models/FormModel.java @@ -0,0 +1,680 @@ +package com.themecleanflex.models; + +import com.peregrine.nodetypes.models.AbstractComponent; +import com.peregrine.nodetypes.models.IComponent; +import com.peregrine.nodetypes.models.Container; +import org.apache.sling.api.resource.Resource; +import org.apache.sling.models.annotations.Default; +import org.apache.sling.models.annotations.DefaultInjectionStrategy; +import org.apache.sling.models.annotations.Exporter; +import org.apache.sling.models.annotations.Model; +import java.util.List; + +import javax.inject.Inject; +import javax.inject.Named; + +/* + //GEN[:DATA + { + "definitions": { + "Form": { + "type": "object", + "x-type": "component", + "properties": { + "schema": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form Model", + "x-form-type": "textarea", + "x-form-hint": "JSON description passed to vue-form-generator, see vue form generator fields documentation", + "x-form-max": "16000" + }, + "endpointurl": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form submit endpoint URL", + "x-form-type": "text", + "x-default": "" + }, + "submitfunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on submit", + "x-form-hint": "Function must accept (model, formdata)", + "x-form-type": "text", + "x-default": "" + }, + "submittext": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit Button Text", + "x-form-type": "text", + "x-default": "Submit" + }, + "submitsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button size", + "x-form-type": "materialselect", + "x-default": "normal", + "properties": { + "section": { + "x-form-name": "normal", + "x-form-value": "normal" + }, + "small": { + "x-form-name": "small", + "x-form-value": "small" + }, + "large": { + "x-form-name": "large", + "x-form-value": "large" + }, + "full": { + "x-form-name": "full width", + "x-form-value": "full" + } + } + }, + "submitalignment": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button alignment", + "x-form-type": "materialselect", + "x-default": "start", + "properties": { + "start": { + "x-form-name": "start", + "x-form-value": "start" + }, + "center": { + "x-form-name": "center", + "x-form-value": "center" + }, + "end": { + "x-form-name": "end", + "x-form-value": "end" + } + } + }, + "failmessage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Failure Message", + "x-form-type": "text", + "x-default": "Error processing form" + }, + "successpage": { + "type": "string", + "x-source": "inject", + "x-form-type": "pathbrowser", + "x-form-label": "Submit Success Page", + "x-form-browserRoot": "/content/themecleanflex/pages" + }, + "bgref": { + "x-form-type": "reference", + "type": "object", + "x-type": "component", + "properties": { + "anchorname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Anchor Name", + "x-form-type": "text" + }, + "extraclasses": { + "type": "string", + "x-source": "inject", + "x-form-label": "Additonal Classes", + "x-form-type": "text" + }, + "htmlelement": { + "type": "string", + "x-source": "inject", + "x-form-label": "Semantic Element", + "x-form-type": "materialselect", + "x-default": "section", + "properties": { + "section": { + "x-form-name": "section", + "x-form-value": "section" + }, + "article": { + "x-form-name": "article", + "x-form-value": "article" + }, + "main": { + "x-form-name": "main", + "x-form-value": "main" + }, + "div": { + "x-form-name": "div", + "x-form-value": "div" + }, + "header": { + "x-form-name": "header", + "x-form-value": "header" + }, + "nav": { + "x-form-name": "nav", + "x-form-value": "nav" + }, + "footer": { + "x-form-name": "footer", + "x-form-value": "footer" + } + } + }, + "colorscheme": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Color Scheme", + "x-form-type": "materialradio", + "x-default": "", + "properties": { + "none": { + "x-form-name": "None", + "x-form-value": "" + }, + "light": { + "x-form-name": "Light", + "x-form-value": "light" + }, + "dark": { + "x-form-name": "Dark", + "x-form-value": "dark" + } + } + }, + "custombackground": { + "type": "string", + "x-source": "inject", + "x-form-label": "Custom Background", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "backgroundtype": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Type", + "x-form-type": "materialradio", + "x-form-visible": "model.custombackground == 'true'", + "properties": { + "color": { + "x-form-name": "Color", + "x-form-value": "color" + }, + "gradient": { + "x-form-name": "Gradient", + "x-form-value": "gradient" + }, + "image": { + "x-form-name": "Image", + "x-form-value": "image" + }, + "video": { + "x-form-name": "Video", + "x-form-value": "video" + } + } + }, + "bgvideo": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Video", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'video' and model.custombackground == 'true'", + "x-default": "https://www.youtube.com/embed/Ju86mknumYM", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgimage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Image", + "x-form-type": "pathbrowser", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-form-browserRoot": "/content/themecleanflex/assets" + }, + "bgxposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background X Position", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgyposition": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Y Position", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Size Style", + "x-form-type": "text", + "x-default": "cover" + }, + "overlay": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay", + "x-form-type": "materialswitch", + "x-form-visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + "overlaycolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay Color", + "x-form-type": "color", + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "overlayopacity": { + "type": "string", + "x-source": "inject", + "x-form-label": "Overlay opacity", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 100, + "x-form-visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "x-default": "50" + }, + "bgcolor": { + "type": "string", + "x-source": "inject", + "x-form-label": "Background Color", + "x-form-type": "color", + "x-form-visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'", + "x-default": "#ffffff" + }, + "color2": { + "type": "string", + "x-source": "inject", + "x-form-label": "Color 2", + "x-form-type": "color", + "x-form-visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'", + "x-default": "#c0c0c0" + }, + "blockwidth": { + "type": "string", + "x-source": "inject", + "x-form-label": "Block Width", + "x-form-type": "materialradio", + "x-default": "default", + "properties": { + "default": { + "x-form-name": "Default", + "x-form-value": "default" + }, + "full": { + "x-form-name": "Full Width", + "x-form-value": "full" + }, + "article": { + "x-form-name": "Article Width", + "x-form-value": "article" + } + } + }, + "fullheight": { + "type": "string", + "x-source": "inject", + "x-form-label": "Full Height", + "x-form-type": "materialswitch", + "x-default": "false" + }, + "toppadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Top Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-visible": "model.fullheight != 'true'" + }, + "bottompadding": { + "type": "string", + "x-source": "inject", + "x-form-label": "Bottom Padding", + "x-form-type": "materialrange", + "x-form-min": 0, + "x-form-max": 300, + "x-form-visible": "model.fullheight != 'true'" + }, + "contentname": { + "type": "string", + "x-source": "inject", + "x-form-label": "Content Name", + "x-form-type": "text" + } + } + } + } + } + }, + "name": "Form", + "componentPath": "themecleanflex/components/form", + "package": "com.themecleanflex.models", + "modelName": "Form", + "classNameParent": "AbstractComponent" +} +//GEN] +*/ + +//GEN[:DEF +@Model( + adaptables = Resource.class, + resourceType = "themecleanflex/components/form", + defaultInjectionStrategy = DefaultInjectionStrategy.OPTIONAL, + adapters = IComponent.class +) +@Exporter( + name = "jackson", + extensions = "json" +) + +//GEN] +public class FormModel extends AbstractComponent { + + public FormModel(Resource r) { super(r); } + + //GEN[:INJECT + /* {"type":"string","x-source":"inject","x-form-label":"Form Model","x-form-type":"textarea","x-form-hint":"JSON description passed to vue-form-generator, see vue form generator fields documentation","x-form-max":"16000"} */ + @Inject + private String schema; + + /* {"type":"string","x-source":"inject","x-form-label":"Form submit endpoint URL","x-form-type":"text","x-default":""} */ + @Inject + @Default(values ="") + private String endpointurl; + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on submit","x-form-hint":"Function must accept (model, formdata)","x-form-type":"text","x-default":""} */ + @Inject + @Default(values ="") + private String submitfunction; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit Button Text","x-form-type":"text","x-default":"Submit"} */ + @Inject + @Default(values ="Submit") + private String submittext; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button size","x-form-type":"materialselect","x-default":"normal","properties":{"section":{"x-form-name":"normal","x-form-value":"normal"},"small":{"x-form-name":"small","x-form-value":"small"},"large":{"x-form-name":"large","x-form-value":"large"},"full":{"x-form-name":"full width","x-form-value":"full"}}} */ + @Inject + @Default(values ="normal") + private String submitsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button alignment","x-form-type":"materialselect","x-default":"start","properties":{"start":{"x-form-name":"start","x-form-value":"start"},"center":{"x-form-name":"center","x-form-value":"center"},"end":{"x-form-name":"end","x-form-value":"end"}}} */ + @Inject + @Default(values ="start") + private String submitalignment; + + /* {"type":"string","x-source":"inject","x-form-label":"Failure Message","x-form-type":"text","x-default":"Error processing form"} */ + @Inject + @Default(values ="Error processing form") + private String failmessage; + + /* {"type":"string","x-source":"inject","x-form-type":"pathbrowser","x-form-label":"Submit Success Page","x-form-browserRoot":"/content/themecleanflex/pages"} */ + @Inject + private String successpage; + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ + @Inject + private String anchorname; + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-type":"text"} */ + @Inject + private String extraclasses; + + /* {"type":"string","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + @Inject + @Default(values ="section") + private String htmlelement; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + @Inject + @Default(values ="") + private String colorscheme; + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String custombackground; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + @Inject + private String backgroundtype; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + @Default(values ="https://www.youtube.com/embed/Ju86mknumYM") + private String bgvideo; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + @Inject + private String bgimage; + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgxposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String bgyposition; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-default":"cover"} */ + @Inject + @Default(values ="cover") + private String bgsize; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + @Inject + private String overlay; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String overlaycolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + @Inject + @Default(values ="50") + private String overlayopacity; + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + @Inject + @Default(values ="#ffffff") + private String bgcolor; + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + @Inject + @Default(values ="#c0c0c0") + private String color2; + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + @Inject + @Default(values ="default") + private String blockwidth; + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-default":"false"} */ + @Inject + @Default(values ="false") + private String fullheight; + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String toppadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + @Inject + private String bottompadding; + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-type":"text"} */ + @Inject + private String contentname; + + +//GEN] + + //GEN[:GETTERS + /* {"type":"string","x-source":"inject","x-form-label":"Form Model","x-form-type":"textarea","x-form-hint":"JSON description passed to vue-form-generator, see vue form generator fields documentation","x-form-max":"16000"} */ + public String getSchema() { + return schema; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Form submit endpoint URL","x-form-type":"text","x-default":""} */ + public String getEndpointurl() { + return endpointurl; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Javascript function to call on submit","x-form-hint":"Function must accept (model, formdata)","x-form-type":"text","x-default":""} */ + public String getSubmitfunction() { + return submitfunction; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit Button Text","x-form-type":"text","x-default":"Submit"} */ + public String getSubmittext() { + return submittext; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button size","x-form-type":"materialselect","x-default":"normal","properties":{"section":{"x-form-name":"normal","x-form-value":"normal"},"small":{"x-form-name":"small","x-form-value":"small"},"large":{"x-form-name":"large","x-form-value":"large"},"full":{"x-form-name":"full width","x-form-value":"full"}}} */ + public String getSubmitsize() { + return submitsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Submit button alignment","x-form-type":"materialselect","x-default":"start","properties":{"start":{"x-form-name":"start","x-form-value":"start"},"center":{"x-form-name":"center","x-form-value":"center"},"end":{"x-form-name":"end","x-form-value":"end"}}} */ + public String getSubmitalignment() { + return submitalignment; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Failure Message","x-form-type":"text","x-default":"Error processing form"} */ + public String getFailmessage() { + return failmessage; + } + + /* {"type":"string","x-source":"inject","x-form-type":"pathbrowser","x-form-label":"Submit Success Page","x-form-browserRoot":"/content/themecleanflex/pages"} */ + public String getSuccesspage() { + return successpage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ + public String getAnchorname() { + return anchorname; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Additonal Classes","x-form-type":"text"} */ + public String getExtraclasses() { + return extraclasses; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Semantic Element","x-form-type":"materialselect","x-default":"section","properties":{"section":{"x-form-name":"section","x-form-value":"section"},"article":{"x-form-name":"article","x-form-value":"article"},"main":{"x-form-name":"main","x-form-value":"main"},"div":{"x-form-name":"div","x-form-value":"div"},"header":{"x-form-name":"header","x-form-value":"header"},"nav":{"x-form-name":"nav","x-form-value":"nav"},"footer":{"x-form-name":"footer","x-form-value":"footer"}}} */ + public String getHtmlelement() { + return htmlelement; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Color Scheme","x-form-type":"materialradio","x-default":"","properties":{"none":{"x-form-name":"None","x-form-value":""},"light":{"x-form-name":"Light","x-form-value":"light"},"dark":{"x-form-name":"Dark","x-form-value":"dark"}}} */ + public String getColorscheme() { + return colorscheme; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Custom Background","x-form-type":"materialswitch","x-default":"false"} */ + public String getCustombackground() { + return custombackground; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Type","x-form-type":"materialradio","x-form-visible":"model.custombackground == 'true'","properties":{"color":{"x-form-name":"Color","x-form-value":"color"},"gradient":{"x-form-name":"Gradient","x-form-value":"gradient"},"image":{"x-form-name":"Image","x-form-value":"image"},"video":{"x-form-name":"Video","x-form-value":"video"}}} */ + public String getBackgroundtype() { + return backgroundtype; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Video","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'video' and model.custombackground == 'true'","x-default":"https://www.youtube.com/embed/Ju86mknumYM","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgvideo() { + return bgvideo; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Image","x-form-type":"pathbrowser","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-form-browserRoot":"/content/themecleanflex/assets"} */ + public String getBgimage() { + return bgimage; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background X Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgxposition() { + return bgxposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Y Position","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getBgyposition() { + return bgyposition; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Size Style","x-form-type":"text","x-default":"cover"} */ + public String getBgsize() { + return bgsize; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay","x-form-type":"materialswitch","x-form-visible":"model.backgroundtype == 'image' and model.custombackground == 'true'"} */ + public String getOverlay() { + return overlay; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay Color","x-form-type":"color","x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getOverlaycolor() { + return overlaycolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Overlay opacity","x-form-type":"materialrange","x-form-min":0,"x-form-max":100,"x-form-visible":"model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'","x-default":"50"} */ + public String getOverlayopacity() { + return overlayopacity; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Background Color","x-form-type":"color","x-form-visible":"(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'","x-default":"#ffffff"} */ + public String getBgcolor() { + return bgcolor; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Color 2","x-form-type":"color","x-form-visible":"model.backgroundtype == 'gradient' and model.custombackground == 'true'","x-default":"#c0c0c0"} */ + public String getColor2() { + return color2; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Block Width","x-form-type":"materialradio","x-default":"default","properties":{"default":{"x-form-name":"Default","x-form-value":"default"},"full":{"x-form-name":"Full Width","x-form-value":"full"},"article":{"x-form-name":"Article Width","x-form-value":"article"}}} */ + public String getBlockwidth() { + return blockwidth; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Full Height","x-form-type":"materialswitch","x-default":"false"} */ + public String getFullheight() { + return fullheight; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Top Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + public String getToppadding() { + return toppadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Bottom Padding","x-form-type":"materialrange","x-form-min":0,"x-form-max":300,"x-form-visible":"model.fullheight != 'true'"} */ + public String getBottompadding() { + return bottompadding; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Content Name","x-form-type":"text"} */ + public String getContentname() { + return contentname; + } + + +//GEN] + + //GEN[:CUSTOMGETTERS + //GEN] + +} diff --git a/fragments/datalist/hatch.js b/fragments/datalist/hatch.js new file mode 100644 index 000000000..203a31262 --- /dev/null +++ b/fragments/datalist/hatch.js @@ -0,0 +1,7 @@ +module.exports = { + convert: function($, f) { + f.wrap($, 'themecleanflex-components-block') + f.bindAttribute($.parent(),'model','model') + f.mapField($, 'storageData') + } +} \ No newline at end of file diff --git a/fragments/datalist/model.json b/fragments/datalist/model.json new file mode 100644 index 000000000..8583a0020 --- /dev/null +++ b/fragments/datalist/model.json @@ -0,0 +1,28 @@ +{ + "definitions": { + "Datalist": { + "type": "object", + "x-type": "component", + "properties": { + "endpointurl": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form submit endpoint URL", + "x-form-type": "text", + "x-default": "" + }, + "loadFunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call to load data", + "x-form-hint": "Function must accept (name)", + "x-form-type": "text" + }, + "bgref": { + "$ref": "fragments/block/model.json#/definitions/Block", + "x-form-type": "reference" + } + } + } + } +} diff --git a/fragments/datalist/sample.json b/fragments/datalist/sample.json new file mode 100644 index 000000000..010210861 --- /dev/null +++ b/fragments/datalist/sample.json @@ -0,0 +1,7 @@ +{ + "title": "Datalist", + "group": "", + "model": { + "text": "example" + } +} \ No newline at end of file diff --git a/fragments/datalist/template.html b/fragments/datalist/template.html new file mode 100644 index 000000000..0253c4f07 --- /dev/null +++ b/fragments/datalist/template.html @@ -0,0 +1 @@ +
datalist
\ No newline at end of file diff --git a/fragments/datalist/template.vue b/fragments/datalist/template.vue new file mode 100644 index 000000000..ef2a5ef9e --- /dev/null +++ b/fragments/datalist/template.vue @@ -0,0 +1,23 @@ + + + diff --git a/fragments/form/hatch.js b/fragments/form/hatch.js new file mode 100644 index 000000000..2a4f91dfc --- /dev/null +++ b/fragments/form/hatch.js @@ -0,0 +1,45 @@ +module.exports = { + convert: function($, f) { + f.wrap($, 'themecleanflex-components-block') + f.bindAttribute($.parent(),'model','model') + + const failureP = $.find('p').eq(0) + f.mapField(failureP,'failureText',false) + f.addIf(failureP, "failureText"); + const schemaErrorP = $.find('p').eq(1) + f.mapField(schemaErrorP,'schemaError',false) + f.addIf(schemaErrorP, "schemaError"); + + const messageContainer = $.find('div').eq(0); + f.addIf(messageContainer, "( failureText || schemaError )"); + + const submit = $.find('input').first() + f.bindAttribute(submit,'value','model.submittext') + + const formContainer = $.find('form').eq(0); + let formContainerClasses = `{ + 'justify-button-start': model.submitalignment === 'start', + 'justify-button-center': model.submitalignment === 'center', + 'justify-button-end': model.submitalignment === 'end', + 'normal-button': model.submitsize === 'normal', + 'sm-button': model.submitsize === 'small', + 'lg-button': model.submitsize === 'large', + 'full-button': model.submitsize === 'full', + }` + f.bindAttribute(formContainer, 'class', formContainerClasses, false); + + const div2 = $.find('div').eq(1) + f.replace(div2, '') + + const formEl = $.find('form') + f.bindEvent(formEl,'submit.prevent.stop','onSubmit') + + const form = $.find('vue-form-generator').first() + f.bindAttribute(form,'class','`w-full`', false) + f.bindAttribute(form,'model','formModel') + f.bindAttribute(form,'schema','schema') + f.bindAttribute(form,'options','formOptions') + + f.bindPath($) + } +} \ No newline at end of file diff --git a/fragments/form/model.json b/fragments/form/model.json new file mode 100644 index 000000000..bb1fd7f4b --- /dev/null +++ b/fragments/form/model.json @@ -0,0 +1,104 @@ +{ + "definitions": { + "Form": { + "type": "object", + "x-type": "component", + "properties": { + "schema": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form Model", + "x-form-type": "textarea", + "x-form-hint": "JSON description passed to vue-form-generator, see vue form generator fields documentation", + "x-form-max": "16000" + }, + "endpointurl": { + "type": "string", + "x-source": "inject", + "x-form-label": "Form submit endpoint URL", + "x-form-type": "text", + "x-default": "" + }, + "submitfunction": { + "type": "string", + "x-source": "inject", + "x-form-label": "Javascript function to call on submit", + "x-form-hint": "Function must accept (model, formdata)", + "x-form-type": "text", + "x-default": "" + }, + "submittext": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit Button Text", + "x-form-type": "text", + "x-default": "Submit" + }, + "submitsize": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button size", + "x-form-type": "materialselect", + "x-default": "normal", + "properties":{ + "section": { + "x-form-name": "normal", + "x-form-value": "normal" + }, + "small": { + "x-form-name": "small", + "x-form-value": "small" + }, + "large": { + "x-form-name": "large", + "x-form-value": "large" + }, + "full": { + "x-form-name": "full width", + "x-form-value": "full" + } + } + }, + "submitalignment": { + "type": "string", + "x-source": "inject", + "x-form-label": "Submit button alignment", + "x-form-type": "materialselect", + "x-default": "start", + "properties":{ + "start": { + "x-form-name": "start", + "x-form-value": "start" + }, + "center": { + "x-form-name": "center", + "x-form-value": "center" + }, + "end": { + "x-form-name": "end", + "x-form-value": "end" + } + } + }, + "failmessage": { + "type": "string", + "x-source": "inject", + "x-form-label": "Failure Message", + "x-form-type": "text", + "x-default": "Error processing form" + }, + "successpage": { + "type": "string", + "x-source": "inject", + "x-form-type": "pathbrowser", + "x-form-label": "Submit Success Page", + "x-form-browserRoot": "/content/themecleanflex/pages" + }, + "bgref": { + "$ref": "fragments/block/model.json#/definitions/Block", + "x-form-type": "reference" + } + } + } + } +} diff --git a/fragments/form/sample-all.json b/fragments/form/sample-all.json new file mode 100644 index 000000000..21529522d --- /dev/null +++ b/fragments/form/sample-all.json @@ -0,0 +1,7 @@ +{ + "title": "Form - Input Types", + "group": "Features", + "model": { + "schema": "{\n\"groups\":[\n{\n\"legend\":\"Text Inputs\",\n\"fields\": [\n {\n \"type\": \"label\",\n \"label\": \"Label\",\n \"model\": \"label\"\n },{\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Text\",\n \"model\": \"text\",\n \"id\": \"text\",\n \"placeholder\": \"Text\"\n },{\n \"type\": \"textArea\",\n \"label\": \"Text Area\",\n \"model\": \"textarea\",\n \"id\": \"textarea\",\n \"rows\": 4,\n \"placeholder\": \"Enter text here\"\n }\n ]\n},\n{\n\"legend\":\"Other Inputs\",\n\"fields\": [\n {\n \"type\": \"radios\",\n \"label\": \"Radios\",\n \"model\": \"radios\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"checkbox\",\n \"label\": \"Checkbox\",\n \"model\": \"checkbox\",\n \"default\": true\n },{\n \"type\": \"checklist\",\n \"label\": \"Checklist\",\n \"model\": \"checklist\",\n \"listBox\": true,\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"select\",\n \"label\": \"Select\",\n \"model\": \"select\",\n \"values\": [\n \"Option 1\",\n \"Option 2\"\n ]\n },{\n \"type\": \"submit\",\n \"buttonText\": \"Submit Button\",\n \"validateBeforeSubmit\": false\n }\n]}]}" + } +} \ No newline at end of file diff --git a/fragments/form/sample-contact.json b/fragments/form/sample-contact.json new file mode 100644 index 000000000..40ba62b26 --- /dev/null +++ b/fragments/form/sample-contact.json @@ -0,0 +1,7 @@ +{ + "title": "Form - Contact", + "group": "Features", + "model": { + "schema": "{\n\"fields\": [\n {\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"First Name\",\n \"model\": \"first_name\",\n \"id\": \"first_name\",\n \"placeholder\": \"First Name\"\n },{\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Last Name\",\n \"model\": \"last_name\",\n \"id\": \"last_name\",\n \"placeholder\": \"Last Name\"\n },{\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Email\",\n \"model\": \"email\",\n \"id\": \"email\",\n \"placeholder\": \"Email\",\n \"featured\": true,\n \"required\": true\n },{\n \"type\": \"textArea\",\n \"label\": \"Text\",\n \"model\": \"text\",\n \"id\": \"text\",\n \"rows\": 4,\n \"placeholder\": \"Enter text here\",\n \"featured\": true,\n \"required\": true\n }\n]}" + } +} \ No newline at end of file diff --git a/fragments/form/sample.json b/fragments/form/sample.json new file mode 100644 index 000000000..b395deebf --- /dev/null +++ b/fragments/form/sample.json @@ -0,0 +1,7 @@ +{ + "title": "Form", + "group": "Features", + "model": { + "schema": "{\n\"fields\": [\n {\n \"type\": \"input\",\n \"inputType\": \"text\",\n \"label\": \"Name\",\n \"model\": \"name\",\n \"id\": \"user_name\",\n \"placeholder\": \"Your name\",\n \"featured\": true,\n \"required\": true\n }\n]}" + } +} \ No newline at end of file diff --git a/fragments/form/template.html b/fragments/form/template.html new file mode 100644 index 000000000..0a283a21c --- /dev/null +++ b/fragments/form/template.html @@ -0,0 +1,10 @@ +
+
+

+

+
+
+
+ +
+
\ No newline at end of file diff --git a/fragments/form/template.vue b/fragments/form/template.vue new file mode 100644 index 000000000..564f7ecf7 --- /dev/null +++ b/fragments/form/template.vue @@ -0,0 +1,94 @@ + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/.content.xml b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/.content.xml new file mode 100644 index 000000000..2bdd6a817 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/.content.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/dialog.json b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/dialog.json new file mode 100644 index 000000000..1f83c6ddb --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/dialog.json @@ -0,0 +1,264 @@ +{ + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "endpointurl", + "label": "Form submit endpoint URL", + "model": "endpointurl" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "loadFunction", + "label": "Javascript function to call to load data", + "model": "loadFunction", + "hint": "Function must accept (name)" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "anchorname", + "label": "Anchor Name", + "model": "anchorname" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "extraclasses", + "label": "Additonal Classes", + "model": "extraclasses" + }, + { + "type": "material-select", + "values": [ + { + "name": "section", + "value": "section" + }, + { + "name": "article", + "value": "article" + }, + { + "name": "main", + "value": "main" + }, + { + "name": "div", + "value": "div" + }, + { + "name": "header", + "value": "header" + }, + { + "name": "nav", + "value": "nav" + }, + { + "name": "footer", + "value": "footer" + } + ], + "placeholder": "htmlelement", + "label": "Semantic Element", + "model": "htmlelement" + }, + { + "type": "material-radios", + "values": [ + { + "name": "None", + "value": "" + }, + { + "name": "Light", + "value": "light" + }, + { + "name": "Dark", + "value": "dark" + } + ], + "placeholder": "colorscheme", + "label": "Block Color Scheme", + "model": "colorscheme" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "custombackground", + "label": "Custom Background", + "model": "custombackground" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Color", + "value": "color" + }, + { + "name": "Gradient", + "value": "gradient" + }, + { + "name": "Image", + "value": "image" + }, + { + "name": "Video", + "value": "video" + } + ], + "placeholder": "backgroundtype", + "label": "Background Type", + "model": "backgroundtype", + "visible": "model.custombackground == 'true'" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgvideo", + "label": "Background Video", + "model": "bgvideo", + "visible": "model.backgroundtype == 'video' and model.custombackground == 'true'" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgimage", + "label": "Background Image", + "model": "bgimage", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "material-range", + "placeholder": "bgxposition", + "label": "Background X Position", + "model": "bgxposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "material-range", + "placeholder": "bgyposition", + "label": "Background Y Position", + "model": "bgyposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "input", + "inputType": "text", + "placeholder": "bgsize", + "label": "Background Size Style", + "model": "bgsize" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "overlay", + "label": "Overlay", + "model": "overlay", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "overlaycolor", + "label": "Overlay Color", + "model": "overlaycolor", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "material-range", + "placeholder": "overlayopacity", + "label": "Overlay opacity", + "model": "overlayopacity", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "input", + "inputType": "color", + "placeholder": "bgcolor", + "label": "Background Color", + "model": "bgcolor", + "visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "color2", + "label": "Color 2", + "model": "color2", + "visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "Full Width", + "value": "full" + }, + { + "name": "Article Width", + "value": "article" + } + ], + "placeholder": "blockwidth", + "label": "Block Width", + "model": "blockwidth" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "fullheight", + "label": "Full Height", + "model": "fullheight" + }, + { + "type": "material-range", + "placeholder": "toppadding", + "label": "Top Padding", + "model": "toppadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300 + }, + { + "type": "material-range", + "placeholder": "bottompadding", + "label": "Bottom Padding", + "model": "bottompadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300 + }, + { + "type": "input", + "inputType": "text", + "placeholder": "contentname", + "label": "Content Name", + "model": "contentname" + } + ] +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue new file mode 100644 index 000000000..144a6b2ae --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/datalist/template.vue @@ -0,0 +1,24 @@ + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/.content.xml b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/.content.xml new file mode 100644 index 000000000..5dc3a7d97 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/.content.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/dialog.json b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/dialog.json new file mode 100644 index 000000000..b57d1f269 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/dialog.json @@ -0,0 +1,338 @@ +{ + "fields": [ + { + "type": "material-textarea", + "rows": 10, + "max": "16000", + "placeholder": "schema", + "label": "Form Model", + "model": "schema", + "hint": "JSON description passed to vue-form-generator, see vue form generator fields documentation" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "endpointurl", + "label": "Form submit endpoint URL", + "model": "endpointurl" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "submitfunction", + "label": "Javascript function to call on submit", + "model": "submitfunction", + "hint": "Function must accept (model, formdata)" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "submittext", + "label": "Submit Button Text", + "model": "submittext" + }, + { + "type": "material-select", + "values": [ + { + "name": "normal", + "value": "normal" + }, + { + "name": "small", + "value": "small" + }, + { + "name": "large", + "value": "large" + }, + { + "name": "full width", + "value": "full" + } + ], + "placeholder": "submitsize", + "label": "Submit button size", + "model": "submitsize" + }, + { + "type": "material-select", + "values": [ + { + "name": "start", + "value": "start" + }, + { + "name": "center", + "value": "center" + }, + { + "name": "end", + "value": "end" + } + ], + "placeholder": "submitalignment", + "label": "Submit button alignment", + "model": "submitalignment" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "failmessage", + "label": "Failure Message", + "model": "failmessage" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/pages", + "placeholder": "successpage", + "label": "Submit Success Page", + "model": "successpage" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "anchorname", + "label": "Anchor Name", + "model": "anchorname" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "extraclasses", + "label": "Additonal Classes", + "model": "extraclasses" + }, + { + "type": "material-select", + "values": [ + { + "name": "section", + "value": "section" + }, + { + "name": "article", + "value": "article" + }, + { + "name": "main", + "value": "main" + }, + { + "name": "div", + "value": "div" + }, + { + "name": "header", + "value": "header" + }, + { + "name": "nav", + "value": "nav" + }, + { + "name": "footer", + "value": "footer" + } + ], + "placeholder": "htmlelement", + "label": "Semantic Element", + "model": "htmlelement" + }, + { + "type": "material-radios", + "values": [ + { + "name": "None", + "value": "" + }, + { + "name": "Light", + "value": "light" + }, + { + "name": "Dark", + "value": "dark" + } + ], + "placeholder": "colorscheme", + "label": "Block Color Scheme", + "model": "colorscheme" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "custombackground", + "label": "Custom Background", + "model": "custombackground" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Color", + "value": "color" + }, + { + "name": "Gradient", + "value": "gradient" + }, + { + "name": "Image", + "value": "image" + }, + { + "name": "Video", + "value": "video" + } + ], + "placeholder": "backgroundtype", + "label": "Background Type", + "model": "backgroundtype", + "visible": "model.custombackground == 'true'" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgvideo", + "label": "Background Video", + "model": "bgvideo", + "visible": "model.backgroundtype == 'video' and model.custombackground == 'true'" + }, + { + "type": "pathbrowser", + "browserRoot": "/content/themecleanflex/assets", + "placeholder": "bgimage", + "label": "Background Image", + "model": "bgimage", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "material-range", + "placeholder": "bgxposition", + "label": "Background X Position", + "model": "bgxposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "material-range", + "placeholder": "bgyposition", + "label": "Background Y Position", + "model": "bgyposition", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "input", + "inputType": "text", + "placeholder": "bgsize", + "label": "Background Size Style", + "model": "bgsize" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "overlay", + "label": "Overlay", + "model": "overlay", + "visible": "model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "overlaycolor", + "label": "Overlay Color", + "model": "overlaycolor", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'" + }, + { + "type": "material-range", + "placeholder": "overlayopacity", + "label": "Overlay opacity", + "model": "overlayopacity", + "visible": "model.overlay == 'true' and model.backgroundtype == 'image' and model.custombackground == 'true'", + "min": 0, + "max": 100 + }, + { + "type": "input", + "inputType": "color", + "placeholder": "bgcolor", + "label": "Background Color", + "model": "bgcolor", + "visible": "(model.backgroundtype == 'color' or model.backgroundtype == 'gradient') and model.custombackground == 'true'" + }, + { + "type": "input", + "inputType": "color", + "placeholder": "color2", + "label": "Color 2", + "model": "color2", + "visible": "model.backgroundtype == 'gradient' and model.custombackground == 'true'" + }, + { + "type": "material-radios", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "Full Width", + "value": "full" + }, + { + "name": "Article Width", + "value": "article" + } + ], + "placeholder": "blockwidth", + "label": "Block Width", + "model": "blockwidth" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "fullheight", + "label": "Full Height", + "model": "fullheight" + }, + { + "type": "material-range", + "placeholder": "toppadding", + "label": "Top Padding", + "model": "toppadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300 + }, + { + "type": "material-range", + "placeholder": "bottompadding", + "label": "Bottom Padding", + "model": "bottompadding", + "visible": "model.fullheight != 'true'", + "min": 0, + "max": 300 + }, + { + "type": "input", + "inputType": "text", + "placeholder": "contentname", + "label": "Content Name", + "model": "contentname" + } + ] +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue new file mode 100644 index 000000000..564f7ecf7 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/form/template.vue @@ -0,0 +1,94 @@ + + + + diff --git a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/page/renderer.html b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/page/renderer.html index 769f5acbc..000567364 100644 --- a/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/page/renderer.html +++ b/ui.apps/src/main/content/jcr_root/apps/themecleanflex/components/page/renderer.html @@ -31,6 +31,10 @@ // } // } + if(window.VueFormGenerator) { + var VueFormGenerator = window.VueFormGenerator + Vue.component('vue-form-generator', VueFormGenerator.component) + } Vue.use(window.VLazyImage.VLazyImagePlugin) $peregrineApp.loadComponent('pagerendervue-components-placeholder') $peregrineApp.loadComponent('themecleanflex-components-block') diff --git a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palette.css b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palette.css index 46ec62178..c09392992 100644 --- a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palette.css +++ b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palette.css @@ -218,3 +218,20 @@ color: var(--btn-primary-color); background-color: var(--btn-primary-bg); } + +#peregrine-app [class$="-components-form"] input[type="submit"]{ + color: var(--btn-color) !important; + background: var(--btn-bg) !important; +} + +#peregrine-app [class$="-components-form"] input[type="submit"]:focus { + color: var(--btn-focus-color) !important; + background: var(--btn-focus-bg) !important; + box-shadow: 0 0 0 3px var(--btn-focus-border-color) !important; + outline: 2px solid transparent !important; /* Windows High Contrast Mode */ +} + +#peregrine-app [class$="-components-form"] input[type="submit"]:hover { + color: var(--btn-hover-color) !important; + background: var(--btn-hover-bg) !important; +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/dawn.css b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/dawn.css index f0d816201..9b67512e0 100644 --- a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/dawn.css +++ b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/dawn.css @@ -148,7 +148,15 @@ #peregrine-app [class$='components-quote'] { --border-primary-color: var(--color-accent-1-700); } - + + #peregrine-app .theme-dark[class$="-components-form"] input, + #peregrine-app .theme-dark[class$="-components-form"] textarea, + #peregrine-app .theme-dark[class$="-components-form"] .form-control, + #peregrine-app .theme-dark[class$="-components-form"] .form-control *{ + --text-primary-color: rgba(0,0,0,0.87); + --text-secondary-color: rgba(0,0,0,0.6); + } + #peregrine-app .theme-dark[class$="-components-navigation"] a:hover{ color: var(--color-accent-1-700); } \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/ocean.css b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/ocean.css index 748880faf..a0ae13cb8 100644 --- a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/ocean.css +++ b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/css/palettes/ocean.css @@ -133,6 +133,13 @@ --border-primary-color: var(--color-accent-1-700); } +#peregrine-app .theme-dark[class$="-components-form"] input, +#peregrine-app .theme-dark[class$="-components-form"] textarea, +#peregrine-app .theme-dark[class$="-components-form"] .form-control, +#peregrine-app .theme-dark[class$="-components-form"] .form-control *{ + --text-primary-color: rgba(0,0,0,0.87); + --text-secondary-color: rgba(0,0,0,0.6); +} #peregrine-app .theme-dark[class$="-components-navigation"] a:hover{ color: var(--color-accent-1-700); } \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/js/formsapp.js b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/js/formsapp.js new file mode 100644 index 000000000..9b6e327f8 --- /dev/null +++ b/ui.apps/src/main/content/jcr_root/content/themecleanflex/pages/js/formsapp.js @@ -0,0 +1,21 @@ +$formsapp = { + save(model, data) { + var records = localStorage.getItem(model.endpointurl); + if(!records) { + records = []; + } else { + records = JSON.parse(records); + } + records.push(data); + localStorage.setItem(model.endpointurl, JSON.stringify(records, true, 2)); + }, + + load(path) { + var records = localStorage.getItem(path); + if(!records) { + return []; + } else { + return JSON.parse(records); + } + } +} \ No newline at end of file diff --git a/ui.apps/src/main/content/jcr_root/content/themecleanflex/templates/.content.xml b/ui.apps/src/main/content/jcr_root/content/themecleanflex/templates/.content.xml index 5b6798665..11c6bf4ee 100644 --- a/ui.apps/src/main/content/jcr_root/content/themecleanflex/templates/.content.xml +++ b/ui.apps/src/main/content/jcr_root/content/themecleanflex/templates/.content.xml @@ -8,7 +8,8 @@ jcr:primaryType="per:PageContent" sling:resourceType="themecleanflex/components/page" jcr:title="themecleanflex root template" - siteCSS="[/content/themecleanflex/pages/css/commons.css,/content/themecleanflex/pages/css/palettes/default.css,/content/themecleanflex/pages/css/palette.css,/etc/felibs/themecleanflex.css,/content/themecleanflex/pages/css/custom.css,https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap]" + siteJS="[/etc/felibs/admin/dependencies/vfg.js,/content/themecleanflex/pages/js/formsapp.js]" + siteCSS="[/etc/felibs/admin/dependencies/vfg.css,/content/themecleanflex/pages/css/commons.css,/content/themecleanflex/pages/css/palettes/default.css,/content/themecleanflex/pages/css/palette.css,/etc/felibs/themecleanflex.css,/content/themecleanflex/pages/css/custom.css,https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap]" prefetchDNS="[https://www.youtube.com,https://s.ytimg.com,https://www.google.com,https://fonts.gstatic.com,https://www.youtube-nocookie.com]"/>