From 68970eed021a6b7d254296b85c9e3f8c661db683 Mon Sep 17 00:00:00 2001 From: Kyle Watson Date: Wed, 26 Aug 2020 11:24:39 -0700 Subject: [PATCH] #156 built out datalist dialog options --- .../themecleanflex/models/DatalistModel.java | 126 ++++++++++++++++++ fragments/datalist/model.json | 64 +++++++++ .../components/datalist/dialog.json | 87 ++++++++++++ 3 files changed, 277 insertions(+) diff --git a/core/src/main/java/com/themecleanflex/models/DatalistModel.java b/core/src/main/java/com/themecleanflex/models/DatalistModel.java index 93a57437e..ca1e7258e 100644 --- a/core/src/main/java/com/themecleanflex/models/DatalistModel.java +++ b/core/src/main/java/com/themecleanflex/models/DatalistModel.java @@ -35,6 +35,69 @@ "x-form-hint": "Function must accept (name)", "x-form-type": "text" }, + "columns": { + "type": "string", + "x-source": "inject", + "x-form-label": "Table Configuration", + "x-form-fieldLabel": "title", + "x-form-type": "collection", + "properties": { + "value": { + "type": "string", + "x-source": "inject", + "x-form-label": "Data Value", + "x-form-type": "text" + }, + "header": { + "type": "string", + "x-source": "inject", + "x-form-label": "Column Header", + "x-form-type": "text" + } + } + }, + "makesortable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Make Table Sortable", + "x-form-type": "materialswitch", + "x-default": false + }, + "stripedrows": { + "type": "string", + "x-source": "inject", + "x-form-label": "Striped Rows", + "x-form-type": "materialswitch", + "x-default": false + }, + "fixedheader": { + "type": "string", + "x-source": "inject", + "x-form-label": "Fixed Header", + "x-form-type": "materialswitch", + "x-default": false + }, + "densetable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Dense Table", + "x-form-type": "materialswitch", + "x-default": false + }, + "scrollabletable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Scrollable Table", + "x-form-type": "materialswitch", + "x-default": false + }, + "cellborders": { + "type": "string", + "x-source": "inject", + "x-form-label": "Add borders around individual cells", + "x-form-type": "materialswitch", + "x-default": false + }, "bgref": { "x-form-type": "reference", "type": "object", @@ -320,6 +383,34 @@ public class DatalistModel extends AbstractComponent { @Inject private String loadFunction; + /* {"type":"string","x-source":"inject","x-form-label":"Table Configuration","x-form-fieldLabel":"title","x-form-type":"collection","properties":{"value":{"type":"string","x-source":"inject","x-form-label":"Data Value","x-form-type":"text"},"header":{"type":"string","x-source":"inject","x-form-label":"Column Header","x-form-type":"text"}}} */ + @Inject + private List columns; + + /* {"type":"string","x-source":"inject","x-form-label":"Make Table Sortable","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String makesortable; + + /* {"type":"string","x-source":"inject","x-form-label":"Striped Rows","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String stripedrows; + + /* {"type":"string","x-source":"inject","x-form-label":"Fixed Header","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String fixedheader; + + /* {"type":"string","x-source":"inject","x-form-label":"Dense Table","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String densetable; + + /* {"type":"string","x-source":"inject","x-form-label":"Scrollable Table","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String scrollabletable; + + /* {"type":"string","x-source":"inject","x-form-label":"Add borders around individual cells","x-form-type":"materialswitch","x-default":false} */ + @Inject + private String cellborders; + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ @Inject private String anchorname; @@ -431,6 +522,41 @@ public String getLoadFunction() { return loadFunction; } + /* {"type":"string","x-source":"inject","x-form-label":"Table Configuration","x-form-fieldLabel":"title","x-form-type":"collection","properties":{"value":{"type":"string","x-source":"inject","x-form-label":"Data Value","x-form-type":"text"},"header":{"type":"string","x-source":"inject","x-form-label":"Column Header","x-form-type":"text"}}} */ + public List getColumns() { + return columns; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Make Table Sortable","x-form-type":"materialswitch","x-default":false} */ + public String getMakesortable() { + return makesortable; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Striped Rows","x-form-type":"materialswitch","x-default":false} */ + public String getStripedrows() { + return stripedrows; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Fixed Header","x-form-type":"materialswitch","x-default":false} */ + public String getFixedheader() { + return fixedheader; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Dense Table","x-form-type":"materialswitch","x-default":false} */ + public String getDensetable() { + return densetable; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Scrollable Table","x-form-type":"materialswitch","x-default":false} */ + public String getScrollabletable() { + return scrollabletable; + } + + /* {"type":"string","x-source":"inject","x-form-label":"Add borders around individual cells","x-form-type":"materialswitch","x-default":false} */ + public String getCellborders() { + return cellborders; + } + /* {"type":"string","x-source":"inject","x-form-label":"Anchor Name","x-form-type":"text"} */ public String getAnchorname() { return anchorname; diff --git a/fragments/datalist/model.json b/fragments/datalist/model.json index 8583a0020..4681ab696 100644 --- a/fragments/datalist/model.json +++ b/fragments/datalist/model.json @@ -18,6 +18,70 @@ "x-form-hint": "Function must accept (name)", "x-form-type": "text" }, + "columns": { + "type": "string", + "x-source": "inject", + "x-form-label": "Table Configuration", + "x-form-fieldLabel": "title", + "x-form-type": "collection", + "properties": { + + "value": { + "type": "string", + "x-source": "inject", + "x-form-label": "Data Value", + "x-form-type": "text" + }, + "header": { + "type": "string", + "x-source": "inject", + "x-form-label": "Column Header", + "x-form-type": "text" + } + } + }, + "makesortable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Make Table Sortable", + "x-form-type": "materialswitch", + "x-default": false + }, + "stripedrows": { + "type": "string", + "x-source": "inject", + "x-form-label": "Striped Rows", + "x-form-type": "materialswitch", + "x-default": false + }, + "fixedheader": { + "type": "string", + "x-source": "inject", + "x-form-label": "Fixed Header", + "x-form-type": "materialswitch", + "x-default": false + }, + "densetable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Dense Table", + "x-form-type": "materialswitch", + "x-default": false + }, + "scrollabletable": { + "type": "string", + "x-source": "inject", + "x-form-label": "Scrollable Table", + "x-form-type": "materialswitch", + "x-default": false + }, + "cellborders": { + "type": "string", + "x-source": "inject", + "x-form-label": "Add borders around individual cells", + "x-form-type": "materialswitch", + "x-default": false + }, "bgref": { "$ref": "fragments/block/model.json#/definitions/Block", "x-form-type": "reference" 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 index 1f83c6ddb..b0f38711e 100644 --- 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 @@ -15,6 +15,93 @@ "model": "loadFunction", "hint": "Function must accept (name)" }, + { + "type": "collection", + "multifield": true, + "fieldLabel": [ + "title", + "value" + ], + "fields": [ + { + "type": "input", + "inputType": "text", + "placeholder": "value", + "label": "Data Value", + "model": "value" + }, + { + "type": "input", + "inputType": "text", + "placeholder": "header", + "label": "Column Header", + "model": "header" + } + ], + "placeholder": "columns", + "label": "Table Configuration", + "model": "columns" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "makesortable", + "label": "Make Table Sortable", + "model": "makesortable" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "stripedrows", + "label": "Striped Rows", + "model": "stripedrows" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "fixedheader", + "label": "Fixed Header", + "model": "fixedheader" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "densetable", + "label": "Dense Table", + "model": "densetable" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "scrollabletable", + "label": "Scrollable Table", + "model": "scrollabletable" + }, + { + "type": "materialswitch", + "textOn": "yes", + "textOff": "no", + "valueOn": "true", + "valueOff": "false", + "placeholder": "cellborders", + "label": "Add borders around individual cells", + "model": "cellborders" + }, { "type": "input", "inputType": "text",