diff --git a/zero.Web.UI/App/components/forms/check-list.vue b/zero.Web.UI/App/components/forms/check-list.vue
index 112a0fd6..c7c0758f 100644
--- a/zero.Web.UI/App/components/forms/check-list.vue
+++ b/zero.Web.UI/App/components/forms/check-list.vue
@@ -3,7 +3,7 @@
@@ -32,13 +32,18 @@
type: Boolean,
default: false
},
- maxItems: {
+ limit: {
type: Number,
default: 100
},
- reverse: {
- type: Boolean,
- default: false
+ reverse: Boolean,
+ labelKey: {
+ type: String,
+ default: 'value'
+ },
+ idKey: {
+ type: String,
+ default: 'key'
}
},
@@ -81,18 +86,18 @@
isChecked(item)
{
- let index = this.value.indexOf(item.id);
+ let index = this.value.indexOf(item[this.idKey]);
return (!this.reverse && index > -1) || (this.reverse && index < 0);
},
onChange(item)
{
- let index = this.value.indexOf(item.id);
+ let index = this.value.indexOf(item[this.idKey]);
let value = JSON.parse(JSON.stringify(this.value));
if (index < 0)
{
- value.push(item.id);
+ value.push(item[this.idKey]);
}
else
{
diff --git a/zero.Web.UI/App/config/router.config.js b/zero.Web.UI/App/config/router.config.js
index b3697ca5..260a099a 100644
--- a/zero.Web.UI/App/config/router.config.js
+++ b/zero.Web.UI/App/config/router.config.js
@@ -67,7 +67,7 @@ export default {
base: __zero.path,
linkActiveClass: 'is-active',
linkExactActiveClass: 'is-active-exact',
- beforeEach: beforeEach,
+ //beforeEach: beforeEach,
scrollBehavior(to, from, savedPosition)
{
return savedPosition ? savedPosition : { x: 0, y: 0 };
diff --git a/zero.Web.UI/App/core/editor-field.js b/zero.Web.UI/App/core/editor-field.js
index ec1dc1f8..dcaa06e1 100644
--- a/zero.Web.UI/App/core/editor-field.js
+++ b/zero.Web.UI/App/core/editor-field.js
@@ -98,6 +98,17 @@ class EditorField
}
+ /**
+ * Conditionally render this field (this is an alternative method to the field options 'condition')
+ * @param {function} condition - function which returns a boolean and gets passed the current model
+ */
+ when(condition)
+ {
+ this.options.condition = condition;
+ return this;
+ }
+
+
/**
* Render a custom component
* @param {object} component - The custom vue component
@@ -220,13 +231,16 @@ class EditorField
/**
* Renders an input which generates an alias for a given name or an alternative custom alias
* @param {EditorSelectItem[]|function} items - Set items to choose from, either via an array or a promise which returns such array
- * @param {number} [limit=100] - Maximum items to be checked
- * @param {boolean} [reverse] - Reverse the checklist behaviour, so all items are checked by default and unchecking them adds them to the result list
+ * @param {object} [options] - Custom options
+ * @param {number} [options.limit=100] - Maximum items to be checked
+ * @param {boolean} [options.reverse=false] - Reverse the checklist behaviour, so all items are checked by default and unchecking them adds them to the result list
+ * @param {string} [options.labelKey=value] - Object key to get the label
+ * @param {string} [options.idKey=key] - Object key to get the id
* @returns {EditorField}
*/
- checkList(items, limit)
+ checkList(items, options)
{
- return this._setComponent(Checklist, { items, limit, reverse });
+ return this._setComponent(Checklist, { items, ...options });
}
diff --git a/zero.Web.UI/App/editor/editor-component.vue b/zero.Web.UI/App/editor/editor-component.vue
index a2b3f981..10584376 100644
--- a/zero.Web.UI/App/editor/editor-component.vue
+++ b/zero.Web.UI/App/editor/editor-component.vue
@@ -1,7 +1,7 @@
-
+
diff --git a/zero.Web.UI/App/editor/editor-overlay.vue b/zero.Web.UI/App/editor/editor-overlay.vue
index f51f7314..450be617 100644
--- a/zero.Web.UI/App/editor/editor-overlay.vue
+++ b/zero.Web.UI/App/editor/editor-overlay.vue
@@ -14,7 +14,7 @@
-
+
@@ -39,6 +39,7 @@
id: null,
loading: true,
state: 'default',
+ editor: null,
meta: {},
model: {}
}),
@@ -50,6 +51,7 @@
{
this.isAdd = this.config.create === true;
this.model = JSON.parse(JSON.stringify(this.config.model));
+ this.editor = this.config.editor;
this.loading = false;
},
diff --git a/zero.Web.UI/App/editor/editor.vue b/zero.Web.UI/App/editor/editor.vue
index 4fa661de..20b5af8d 100644
--- a/zero.Web.UI/App/editor/editor.vue
+++ b/zero.Web.UI/App/editor/editor.vue
@@ -13,7 +13,6 @@
\ No newline at end of file
diff --git a/zero.Web.UI/App/editor/fields/countrypicker.vue b/zero.Web.UI/App/editor/fields/countrypicker.vue
index 27a347e0..ce74b036 100644
--- a/zero.Web.UI/App/editor/fields/countrypicker.vue
+++ b/zero.Web.UI/App/editor/fields/countrypicker.vue
@@ -1,19 +1,17 @@
-
+
\ No newline at end of file
diff --git a/zero.Web.UI/App/editor/fields/currency.vue b/zero.Web.UI/App/editor/fields/currency.vue
index 4de742da..ff54fbd4 100644
--- a/zero.Web.UI/App/editor/fields/currency.vue
+++ b/zero.Web.UI/App/editor/fields/currency.vue
@@ -1,6 +1,6 @@