diff --git a/dist/jedi.js b/dist/jedi.js index f11b0975..45b3698a 100644 --- a/dist/jedi.js +++ b/dist/jedi.js @@ -181,7 +181,9 @@ class EditorArray extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { title: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), titleHidden: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'titleHidden'), id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) + description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'startCollapsed') }) } @@ -1133,14 +1135,14 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { addProperty = false } - let editableProperties = false + let enablePropertiesToggle = false - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.jedi.options.editableProperties)) { - editableProperties = this.instance.jedi.options.editableProperties + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.jedi.options.enablePropertiesToggle)) { + enablePropertiesToggle = this.instance.jedi.options.enablePropertiesToggle } - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaOptions.editableProperties)) { - editableProperties = schemaOptions.editableProperties + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaOptions.enablePropertiesToggle)) { + enablePropertiesToggle = schemaOptions.enablePropertiesToggle } this.control = this.theme.getObjectControl({ @@ -1148,8 +1150,10 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { titleHidden: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'titleHidden'), id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), - editableProperties: editableProperties, - addProperty: addProperty + enablePropertiesToggle: enablePropertiesToggle, + addProperty: addProperty, + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'startCollapsed') }) } @@ -1210,9 +1214,9 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } refreshPropertiesSlot () { - const schemaOptionEditableProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'editableProperties') + const schemaOptionEnablePropertiesToggle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enablePropertiesToggle') - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(this.instance.jedi.options.editableProperties, true) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(schemaOptionEditableProperties, true)) { + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(this.instance.jedi.options.enablePropertiesToggle, true) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(schemaOptionEnablePropertiesToggle, true)) { Object.keys(this.instance.properties).forEach((property) => { // refactor with isNotRequired const isRequired = this.instance.isRequired(property) @@ -3291,9 +3295,14 @@ class InstanceObject extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default" let musstCreateChild = true + const optionsDeactivateNonRequired = this.jedi.options.deactivateNonRequired const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') const schemaDeactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(schema, 'deactivateNonRequired') + if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(optionsDeactivateNonRequired) && optionsDeactivateNonRequired === true) { + musstCreateChild = false + } + if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { musstCreateChild = false } @@ -3361,7 +3370,7 @@ class InstanceObject extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default" this.children.push(instance) this.value[key] = instance.getValue() - const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') + const deactivateNonRequired = this.jedi.options.deactivateNonRequired || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { instance.deactivate() @@ -3554,7 +3563,10 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { this.options = Object.assign({ container: null, refParser: null, - editableProperties: false, + enablePropertiesToggle: false, + enableCollapseToggle: false, + startCollapsed: false, + deactivateNonRequired: false, schema: {}, showErrors: 'change', data: undefined, @@ -3705,6 +3717,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { if (this.refParser) { config.schema = this.refParser.expand(config.schema, config.path) } + const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaType)(config.schema) const schemaOneOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaOneOf)(config.schema) const schemaAnyOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaAnyOf)(config.schema) @@ -4013,6 +4026,24 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('in') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('panel') @@ -4257,6 +4288,24 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') @@ -4514,6 +4563,24 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-bs-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') @@ -4785,7 +4852,9 @@ const glyphicons = { delete: 'glyphicon glyphicon-trash', add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', - moveDown: 'glyphicon glyphicon-arrow-down' + moveDown: 'glyphicon glyphicon-arrow-down', + expand: 'glyphicon glyphicon-chevron-right', + collapse: 'glyphicon glyphicon-chevron-down' } /** @@ -4797,7 +4866,9 @@ const bootstrapIcons = { delete: 'bi bi-trash2', add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', - moveDown: 'bi bi-arrow-down' + moveDown: 'bi bi-arrow-down', + expand: 'bi bi-chevron-right', + collapse: 'bi bi-chevron-down' } /** @@ -4809,7 +4880,9 @@ const fontAwesome3 = { delete: 'icon-trash', add: 'icon-plus', moveUp: 'icon-arrow-up', - moveDown: 'icon-arrow-down' + moveDown: 'icon-arrow-down', + expand: 'icon-chevron-right', + collapse: 'icon-chevron-down' } /** @@ -4821,7 +4894,9 @@ const fontAwesome4 = { delete: 'fa fa-trash-o', add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', - moveDown: 'fa fa-arrow-down' + moveDown: 'fa fa-arrow-down', + expand: 'fa fa-chevron-right', + collapse: 'fa fa-chevron-down' } /** @@ -4833,7 +4908,9 @@ const fontAwesome5 = { delete: 'fas fa-trash', add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', - moveDown: 'fas fa-arrow-down' + moveDown: 'fas fa-arrow-down', + expand: 'fas fa-chevron-right', + collapse: 'fas fa-chevron-down' } /** @@ -4845,7 +4922,9 @@ const fontAwesome6 = { delete: 'fa-solid fa-trash', add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', - moveDown: 'fa-solid fa-arrow-down' + moveDown: 'fa-solid fa-arrow-down', + expand: 'fa-solid fa-chevron-right', + collapse: 'fa-solid fa-chevron-down' } @@ -5040,6 +5119,43 @@ class Theme { return toggle } + /** + * Container that will collapse and expand to show and hide it contents + * @private + */ + getCollapse (config) { + const collapse = document.createElement('div') + collapse.classList.add('jedi-collapse') + collapse.setAttribute('id', config.id) + + if (this.useToggleEvents && config.startCollapsed) { + collapse.style.display = 'none' + } + + return collapse + } + + /** + * Toggle button for collapse + * @private + */ + getCollapseToggle (config) { + const toggle = this.getButton(config) + toggle.classList.add('jedi-collapse-toggle') + + if (this.useToggleEvents) { + toggle.addEventListener('click', () => { + if (config.collapse.style.display === 'none') { + config.collapse.style.display = 'block' + } else { + config.collapse.style.display = 'none' + } + }) + } + + return toggle + } + /** * Container for properties editing elements like property activators * @private @@ -5252,6 +5368,21 @@ class Theme { propertiesContainer: propertiesContainer }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + const propertiesActivators = this.getPropertiesActivators() const addPropertyControl = this.getInputControl({ @@ -5271,13 +5402,14 @@ class Theme { addPropertyBtn.classList.add('jedi-object-add') container.appendChild(fieldset) + container.appendChild(propertiesContainer) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) actions.appendChild(arrayActions) - body.appendChild(propertiesContainer) body.appendChild(childrenSlot) if (config.addProperty) { @@ -5285,14 +5417,20 @@ class Theme { propertiesContainer.appendChild(addPropertyBtn) } - if (config.editableProperties) { + if (config.enablePropertiesToggle) { actions.appendChild(propertiesToggle) propertiesContainer.appendChild(ariaLive) propertiesContainer.appendChild(propertiesActivators) } + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapse, + collapseToggle, body, actions, messages, @@ -5332,9 +5470,25 @@ class Theme { id: config.id }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + container.appendChild(fieldset) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) @@ -5343,8 +5497,14 @@ class Theme { actions.appendChild(arrayActions) body.appendChild(childrenSlot) + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapseToggle, + collapse, body, actions, messages, @@ -5627,7 +5787,20 @@ class Theme { fieldset.appendChild(description) fieldset.appendChild(messages) - return { container, fieldset, legend, body, radios, labels, labelTexts, radioControls, description, messages, actions, arrayActions } + return { + container, + fieldset, + legend, + body, + radios, + labels, + labelTexts, + radioControls, + description, + messages, + actions, + arrayActions + } } /** @@ -8260,4 +8433,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWb0M7QUFDZ0Q7QUFDZDs7QUFFdEU7QUFDQTtBQUNBO0FBQ0E7QUFDQSw2QkFBNkIsaURBQVc7QUFDeEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7O0FBRUE7QUFDQTtBQUNBOztBQUVBLG9CQUFvQixtRUFBZTtBQUNuQyx1QkFBdUIsbUVBQWU7QUFDdEMsb0JBQW9CLG1FQUFlOztBQUVuQztBQUNBLGlCQUFpQix3REFBSztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsd0RBQUs7QUFDcEIsWUFBWSx3REFB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ldEVycm9ycygpXG4gICAgICB0aGlzLnNob3dWYWxpZGF0aW9uRXJyb3JzKGVycm9ycylcbiAgICB9KVxuXG4gICAgdGhpcy5pbnN0YW5jZS5vbignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgdGhpcy5yZWZyZXNoVUkoKVxuICAgICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnO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9iamVjdC5rZXlzKHBhdHRlcm5Qcm9wZXJ0aWVzKS5mb3JFYWNoKChwYXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICBjb25zdCByZWdleHAgPSBuZXcgUmVnRXhwKHBhdHRlcm4pXG4gICAgICAgICAgICBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSByZWdleHAudGVzdChwcm9wZXJ0eSlcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgYWRkaXRpb25hbFByb3BlcnRpZXMgPT09IGZhbHNlICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JBZGRpdGlvbmFsUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICdhZGRpdGlvbmFsUHJvcGVydGllcydcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgaXNPYmplY3QoYWRkaXRpb25hbFByb3BlcnRpZXMpICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgY29uc3QgZWRpdG9yID0gbmV3IEplZGkoe1xuICAgICAgICAgICAgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLFxuICAgICAgICAgICAgc2NoZW1hOiBhZGRpdGlvbmFsUHJvcGVydGllcyxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5XV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Sh7IHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlciwgc2NoZW1hOiBjb250YWlucywgZGF0YTogaXRlbSB9KVxuICAgICAgY29uc3QgY29udGFpbnNFcnJvcnMgPSBjb250YWluc0VkaXRvci5nZXRFcnJvcnMoKVxuXG4gICAgICBpZiAoY29udGFpbnNFcnJvcnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIGNvdW50ZXIrK1xuICAgICAgfVxuXG4gICAgICBjb250YWluc0VkaXRvci5kZXN0cm95KClcbiAgICB9KVxuXG4gICAgY29uc3QgY29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPT09IDApXG5cbiAgICBpZiAoaXNTZXQobWluQ29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtaW5Db250YWluc0ludmFsaWQgPSAoY291bnRlciA8IG1pbkNvbnRhaW5zKVxuXG4gICAgICBpZiAobWluQ29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgI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pbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMuaW5zdGFuY2UuamVkaS5vcHRpb25zLnRoZW1lKSB7XG4gICAgICBjYXNlICdib290c3RyYXAzJzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDMoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA0JzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDQoaWNvbnMpXG4gICAgICAgIGJyZ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udHJvbCh7XG4gICAgICAgICAgICBpZDogaWQsXG4gICAgICAgICAgICBsYWJlbDogbGFiZWwsXG4gICAgICAgICAgICB0aXRsZUhpZGRlbjogZmFsc2VcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgY2hlY2tib3ggPSBjaGVja2JveENvbnRyb2wuaW5wdXRcbiAgICAgICAgICB0aGlzLnByb3BlcnR5QWN0aXZhdG9yc1twcm9wZXJ0eV0gPSBjaGVja2JveFxuXG4gICAgICAgICAgY2hlY2tib3guYWRkRXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgICAgICAgYXJpYUxpdmUuaW5uZXJIVE1MID0gJydcbiAgICAgICAgICAgIGNvbnN0IGFyaWFMaXZlTWVzc2FnZSA9IHRoaXMudGhlbWUuZ2V0QXJpYUxpdmVNZXNzYWdlKClcblxuICAgICAgICAgICAgaWYgKGNoZWNrYm94LmNoZWNrZWQpIHtcbiAgICAgICAgICAgICAgY29uc3QgY2hpbGQgPSB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KVxuXG4gICAgICAgICAgICAgIGlmICghY2hpbGQpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmNyZWF0ZUNoaWxkKHNjaGVtYSwgcHJvcGVydHkpXG4gICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICB0aGlzLmluc3RhbmNlLmdldENoaWxkKHByb3BlcnR5KS5hY3RpdmF0ZSgpXG4gICAgICAgICAgICAgIGFyaWFMaXZlTWVzc2FnZS50ZXh0Q29udGVudCA9IGxhYmVsICsgJyBmaWVsZCB3YXMgYWRkZWQgdG8gdGhlIGZvcm0nXG4gICAgICAgICAgICAgIGFyaWFMaXZlLmFwcGVuZENoaWxkKGFyaWFMaXZlTWVzc2FnZSlcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgIHRoaXMuaW5zdGFuY2UuZ2V0Q2hpbGQocHJvcGVydHkpLmRlYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIHJlbW92ZWQgZnJvbSB0aGUgZm9ybSdcbiAgICAgICAgICAgICAgYXJpYUxpdmUuYXBwZW5kQ2hpbGQoYXJpYUxpdmVNZXNzYWdlKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBrZWVwcyBkaWFsb2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY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b3BlcnRpZXMgOiB7fVxuICAgIGNvbnN0IGFkZGl0aW9uYWxQcm9wZXJ0aWVzID0gc2NoZW1hQWRkaXRpb25hbFByb3BlcnRpZXNcbiAgICBjb25zdCBwYXR0ZXJuUHJvcGVydGllcyA9IHNjaGVtYVBhdHRlcm5Qcm9wZXJ0aWVzXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGFkZGl0aW9uYWxQcm9wZXJ0aWVzID09PSBmYWxzZSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yQWRkaXRpb25hbFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb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nMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWluQ29udGFpbnM6IG1pbkNvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtaW5Db250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtpMThuLmVycm9yQ29udGFpbnNdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnY29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGlzU2V0KG1heENvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWF4Q29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPiBtYXhDb250YWlucylcblxuICAgICAgaWYgKG1heENvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWF4Q29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWF4Q29udGFpbnM6IG1heENvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtYXhDb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVGVtcGxhdGUsIGhhc093biwgaXNPYmplY3QsIGlzU2V0IH0gZn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R0ZXJuUHJvcGVydGllcykpIHtcbiAgICBPYmplY3Qua2V5cyh2YWx1ZSkuZm9yRWFjaCgocHJvcGVydHlOYW1lKSA9PiB7XG4gICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICBjb25zdCByZWdleHAgPSBuZXcgUmVnRXhwKHBhdHRlcm4pXG4gICAgICAgIGlmIChyZWdleHAudGVzdChwcm9wZXJ0eU5hbWUpKSB7XG4gICAgICAgICAgY29uc3Qgc2NoZW1hID0gcGF0dGVyblByb3BlcnRpZXNbcGF0dGVybl1cblxuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogc2NoZW1hLFxuICAgICAgICAgICAgZGF0YTogdmFsdWVbcHJvcGVydHlOYW1lXVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCBlZGl0b3JFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgJy8nICsgcHJvcGVydHlOYW1lLFxuICAgICAgICAgICAgICBjb25zdHJhaW46ICdwYXR0ZXJuUHJvcGVydGllcydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgZXJyb3JzID0gWy4uLmVycm9ycywgLi4uZWRpdG9yRXJyb3JzXVxuXG4gICAgICAgICAgZWRpdG9yLmRlc3Ryb3koKVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVG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0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KHVuZXZhbHVhdGVkUHJvcGVydGllcykgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBjb25zdCBlZGl0b3I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BpbiBkZWZpbml0aW9uKSB7XG5cdFx0aWYoX193ZWJwYWNrX3JlcXVpcmVfXy5vKGRlZmluaXRpb24sIGtleSkgJiYgIV9fd2VicGFja19yZXF1aXJlX18ubyhleHBvcnRzLCBrZXkpKSB7XG5cdFx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywga2V5LCB7IGVudW1lcmFibGU6IHRydWUsIGdldDogZGVmaW5pdGlvbltrZXldIH0pO1xuXHRcdH1cblx0fVxufTsiLCJfX3dlYnBhY2tfcmVxdWlyZV9fLm8gPSAob2JqLCBwcm9wKSA9PiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkpIiwiLy8gZGVmaW5lIF9fZXNNb2R1bGUgb24gZXhwb3J0c1xuX193ZWJwYWNrX3JlcXVpcmVfXy5yID0gKGV4cG9ydHMpID0+IHtcblx0aWYodHlwZW9mIFN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcgJiYgU3ltYm9sLnRvU3RyaW5nVGFnKSB7XG5cdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFN5bWJvbC50b1N0cmluZ1RhZywgeyB2YWx1ZTogJ01vZHVsZScgfSk7XG5cdH1cblx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbn07IiwiaW1wb3J0IEplZGkgZnJvbSAnLi9qZWRpLmpzJ1xuaW1wb3J0IFJlZlBhcnNlciBmcm9tICcuL3JlZi1wYXJzZXIvcmVmLXBhcnNlci5qcydcblxuZXhwb3J0IGRlZmF1bHQge1xuICBKZWRpLFxuICBSZWZQYXJzZXJcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/docs/js/jedi.js b/docs/js/jedi.js index f11b0975..45b3698a 100644 --- a/docs/js/jedi.js +++ b/docs/js/jedi.js @@ -181,7 +181,9 @@ class EditorArray extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { title: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaTitle)(this.instance.schema) || this.instance.getKey(), titleHidden: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'titleHidden'), id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), - description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema) + description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'startCollapsed') }) } @@ -1133,14 +1135,14 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { addProperty = false } - let editableProperties = false + let enablePropertiesToggle = false - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.jedi.options.editableProperties)) { - editableProperties = this.instance.jedi.options.editableProperties + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(this.instance.jedi.options.enablePropertiesToggle)) { + enablePropertiesToggle = this.instance.jedi.options.enablePropertiesToggle } - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaOptions.editableProperties)) { - editableProperties = schemaOptions.editableProperties + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(schemaOptions.enablePropertiesToggle)) { + enablePropertiesToggle = schemaOptions.enablePropertiesToggle } this.control = this.theme.getObjectControl({ @@ -1148,8 +1150,10 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { titleHidden: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'titleHidden'), id: (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.pathToAttribute)(this.instance.path), description: (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaDescription)(this.instance.schema), - editableProperties: editableProperties, - addProperty: addProperty + enablePropertiesToggle: enablePropertiesToggle, + addProperty: addProperty, + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'startCollapsed') }) } @@ -1210,9 +1214,9 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } refreshPropertiesSlot () { - const schemaOptionEditableProperties = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'editableProperties') + const schemaOptionEnablePropertiesToggle = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaOption)(this.instance.schema, 'enablePropertiesToggle') - if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(this.instance.jedi.options.editableProperties, true) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(schemaOptionEditableProperties, true)) { + if ((0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(this.instance.jedi.options.enablePropertiesToggle, true) || (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.equal)(schemaOptionEnablePropertiesToggle, true)) { Object.keys(this.instance.properties).forEach((property) => { // refactor with isNotRequired const isRequired = this.instance.isRequired(property) @@ -3291,9 +3295,14 @@ class InstanceObject extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default" let musstCreateChild = true + const optionsDeactivateNonRequired = this.jedi.options.deactivateNonRequired const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') const schemaDeactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(schema, 'deactivateNonRequired') + if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(optionsDeactivateNonRequired) && optionsDeactivateNonRequired === true) { + musstCreateChild = false + } + if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { musstCreateChild = false } @@ -3361,7 +3370,7 @@ class InstanceObject extends _instance_js__WEBPACK_IMPORTED_MODULE_0__["default" this.children.push(instance) this.value[key] = instance.getValue() - const deactivateNonRequired = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') + const deactivateNonRequired = this.jedi.options.deactivateNonRequired || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_5__.getSchemaOption)(this.schema, 'deactivateNonRequired') if (this.isNotRequired(key) && (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isSet)(deactivateNonRequired) && deactivateNonRequired === true) { instance.deactivate() @@ -3554,7 +3563,10 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { this.options = Object.assign({ container: null, refParser: null, - editableProperties: false, + enablePropertiesToggle: false, + enableCollapseToggle: false, + startCollapsed: false, + deactivateNonRequired: false, schema: {}, showErrors: 'change', data: undefined, @@ -3705,6 +3717,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { if (this.refParser) { config.schema = this.refParser.expand(config.schema, config.path) } + const schemaType = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaType)(config.schema) const schemaOneOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaOneOf)(config.schema) const schemaAnyOf = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_11__.getSchemaAnyOf)(config.schema) @@ -4013,6 +4026,24 @@ class ThemeBootstrap3 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('in') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('panel') @@ -4257,6 +4288,24 @@ class ThemeBootstrap4 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') @@ -4514,6 +4563,24 @@ class ThemeBootstrap5 extends _theme_js__WEBPACK_IMPORTED_MODULE_0__["default"] this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-bs-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') @@ -4785,7 +4852,9 @@ const glyphicons = { delete: 'glyphicon glyphicon-trash', add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', - moveDown: 'glyphicon glyphicon-arrow-down' + moveDown: 'glyphicon glyphicon-arrow-down', + expand: 'glyphicon glyphicon-chevron-right', + collapse: 'glyphicon glyphicon-chevron-down' } /** @@ -4797,7 +4866,9 @@ const bootstrapIcons = { delete: 'bi bi-trash2', add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', - moveDown: 'bi bi-arrow-down' + moveDown: 'bi bi-arrow-down', + expand: 'bi bi-chevron-right', + collapse: 'bi bi-chevron-down' } /** @@ -4809,7 +4880,9 @@ const fontAwesome3 = { delete: 'icon-trash', add: 'icon-plus', moveUp: 'icon-arrow-up', - moveDown: 'icon-arrow-down' + moveDown: 'icon-arrow-down', + expand: 'icon-chevron-right', + collapse: 'icon-chevron-down' } /** @@ -4821,7 +4894,9 @@ const fontAwesome4 = { delete: 'fa fa-trash-o', add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', - moveDown: 'fa fa-arrow-down' + moveDown: 'fa fa-arrow-down', + expand: 'fa fa-chevron-right', + collapse: 'fa fa-chevron-down' } /** @@ -4833,7 +4908,9 @@ const fontAwesome5 = { delete: 'fas fa-trash', add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', - moveDown: 'fas fa-arrow-down' + moveDown: 'fas fa-arrow-down', + expand: 'fas fa-chevron-right', + collapse: 'fas fa-chevron-down' } /** @@ -4845,7 +4922,9 @@ const fontAwesome6 = { delete: 'fa-solid fa-trash', add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', - moveDown: 'fa-solid fa-arrow-down' + moveDown: 'fa-solid fa-arrow-down', + expand: 'fa-solid fa-chevron-right', + collapse: 'fa-solid fa-chevron-down' } @@ -5040,6 +5119,43 @@ class Theme { return toggle } + /** + * Container that will collapse and expand to show and hide it contents + * @private + */ + getCollapse (config) { + const collapse = document.createElement('div') + collapse.classList.add('jedi-collapse') + collapse.setAttribute('id', config.id) + + if (this.useToggleEvents && config.startCollapsed) { + collapse.style.display = 'none' + } + + return collapse + } + + /** + * Toggle button for collapse + * @private + */ + getCollapseToggle (config) { + const toggle = this.getButton(config) + toggle.classList.add('jedi-collapse-toggle') + + if (this.useToggleEvents) { + toggle.addEventListener('click', () => { + if (config.collapse.style.display === 'none') { + config.collapse.style.display = 'block' + } else { + config.collapse.style.display = 'none' + } + }) + } + + return toggle + } + /** * Container for properties editing elements like property activators * @private @@ -5252,6 +5368,21 @@ class Theme { propertiesContainer: propertiesContainer }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + const propertiesActivators = this.getPropertiesActivators() const addPropertyControl = this.getInputControl({ @@ -5271,13 +5402,14 @@ class Theme { addPropertyBtn.classList.add('jedi-object-add') container.appendChild(fieldset) + container.appendChild(propertiesContainer) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) actions.appendChild(arrayActions) - body.appendChild(propertiesContainer) body.appendChild(childrenSlot) if (config.addProperty) { @@ -5285,14 +5417,20 @@ class Theme { propertiesContainer.appendChild(addPropertyBtn) } - if (config.editableProperties) { + if (config.enablePropertiesToggle) { actions.appendChild(propertiesToggle) propertiesContainer.appendChild(ariaLive) propertiesContainer.appendChild(propertiesActivators) } + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapse, + collapseToggle, body, actions, messages, @@ -5332,9 +5470,25 @@ class Theme { id: config.id }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + container.appendChild(fieldset) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) @@ -5343,8 +5497,14 @@ class Theme { actions.appendChild(arrayActions) body.appendChild(childrenSlot) + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapseToggle, + collapse, body, actions, messages, @@ -5627,7 +5787,20 @@ class Theme { fieldset.appendChild(description) fieldset.appendChild(messages) - return { container, fieldset, legend, body, radios, labels, labelTexts, radioControls, description, messages, actions, arrayActions } + return { + container, + fieldset, + legend, + body, + radios, + labels, + labelTexts, + radioControls, + description, + messages, + actions, + arrayActions + } } /** @@ -8260,4 +8433,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNWb0M7QUFDZ0Q7QUFDZDs7QUFFdEU7QUFDQTtBQUNBO0FBQ0E7QUFDQSw2QkFBNkIsaURBQVc7QUFDeEM7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7O0FBRUE7QUFDQTtBQUNBOztBQUVBLG9CQUFvQixtRUFBZTtBQUNuQyx1QkFBdUIsbUVBQWU7QUFDdEMsb0JBQW9CLG1FQUFlOztBQUVuQztBQUNBLGlCQUFpQix3REFBSztBQUN0QjtBQUNBO0FBQ0E7QUFDQTtBQUNBLGVBQWUsd0RBQUs7QUFDcEIsWUFBWSx3REFBSztBQUNqQixLQUFLOztBQUVMO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0F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ycm9ycylcbiAgICB9KVxuXG4gICAgdGhpcy5pbnN0YW5jZS5vbignY2hhbmdlJywgKCkgPT4ge1xuICAgICAgdGhpcy5yZWZyZXNoVUkoKVxuICAgICAgY29uc3QgZXJyb3JzID0gdGhpcy5pbnN0YW5jZS5nZXRFcnJvcnMoKVxuICAgICAgdGhpcy5zaG93VmFsaWRhdGlvbkVycm9ycyhlcnJvcnMpXG4gICAgfSlcbiAgfVxuXG4gIC8qKlxuICAgKiBJbml0aWFsaXplcyB0aGUgZWRpdG9yXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBpbml0ICgpIHtcbiAgICBsZXQgaWNvbnMgPSBudWxsXG5cbiAgICBpZiAoaXNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJl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YXR0ZXJuKSA9PiB7XG4gICAgICAgICAgICBjb25zdCByZWdleHAgPSBuZXcgUmVnRXhwKHBhdHRlcm4pXG4gICAgICAgICAgICBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSByZWdleHAudGVzdChwcm9wZXJ0eSlcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgYWRkaXRpb25hbFByb3BlcnRpZXMgPT09IGZhbHNlICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JBZGRpdGlvbmFsUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICdhZGRpdGlvbmFsUHJvcGVydGllcydcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgaXNPYmplY3QoYWRkaXRpb25hbFByb3BlcnRpZXMpICYmICFoYXNPd24ocHJvcGVydGllcywgcHJvcGVydHkpKSB7XG4gICAgICAgICAgY29uc3QgZWRpdG9yID0gbmV3IEplZGkoe1xuICAgICAgICAgICAgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLFxuICAgICAgICAgICAgc2NoZW1hOiBhZGRpdGlvbmFsUHJvcGVydGllcyxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5XVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCBhZGRpdGlvbmFsUHJ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iBjb250YWlucywgZGF0YTogaXRlbSB9KVxuICAgICAgY29uc3QgY29udGFpbnNFcnJvcnMgPSBjb250YWluc0VkaXRvci5nZXRFcnJvcnMoKVxuXG4gICAgICBpZiAoY29udGFpbnNFcnJvcnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIGNvdW50ZXIrK1xuICAgICAgfVxuXG4gICAgICBjb250YWluc0VkaXRvci5kZXN0cm95KClcbiAgICB9KVxuXG4gICAgY29uc3QgY29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPT09IDApXG5cbiAgICBpZiAoaXNTZXQobWluQ29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtaW5Db250YWluc0ludmFsaWQgPSAoY291bnRlciA8IG1pbkNvbnRhaW5zKVxuXG4gICAgICBpZiAobWluQ29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaXNTZXQobWF4Q29udGFpbnMpKSB7XG4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XJcbiAqL1xuY2xhc3MgRWRpdG9yIHtcbiAgY29uc3RydWN0b3IgKGluc3RhbmNlKSB7XG4gICAgLyoqXG4gICAgICogQSByZWZlcmVuY2UgdG8gdGhlIEluc3RhbmNlIGJlaW5nIGNvbnRyb2xsZWQgYnkgdGhpcyBlZGl0b3IuXG4gICAgICogQHR5cGUge0luc3RhbmNlfVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5pbnN0YW5jZSA9IGluc3RhbmNlXG5cbiAgICAvKipcbiAgICAgKiBUaGVtZSBpbnN0YW5jZSB1c2VkIHRvIGJ1aWxkIHRoZSBFZGl0b3IgdXNlciBpbnRlcmZhY2UuXG4gICAgICogQHR5cGUge1RoZW1lfVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy50aGVtZSA9IG51bGxcblxuICAgIC8qKlxuICAgICAqIFRoZSB1c2VyIGludGVyZmFjZSBodG1sIGZvciB0aGlzIGVkaXRvclxuICAgICAqIEB0eXBlIHtIVE1MRWxlbWVudH1cbiAgICAgKiBAcHJvdGVjdGVkXG4gICAgICovXG4gICAgdGhpcy5jb250cm9sID0gbnVsbFxuXG4gICAgLyoqXG4gICAgICogRGlzYWJsZWQgc3RhdHVzIGZvciB0aGlzIGVkaXRvciB1c2VyIGludGVyZmFjZVxuICAgICAqIEB0eXBlIHtib29sZWFufVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5kaXNhYmxlZCA9IGZhbHNlXG5cbiAgICAvKipcbiAgICAgKiBSZWFkIG9ubHkgc3RhdHVzIGZvciB0aGlzIGVkaXRvciB1c2VyIGludGVyZmFjZVxuICAgICAqIEB0eXBlIHtib29sZWFufVxuICAgICAqIEBwcml2YXRlXG4gICAgICovXG4gICAgdGhpcy5yZWFkT25seSA9IHRoaXMuaW5zdGFuY2UuaXNSZWFkT25seSgpXG5cbiAgICB0aGlzLmluaXQoKVxuICAgIHRoaXMuYnVpbGQoKVxuICAgIH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XNTZXQodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikpIHtcbiAgICAgIHN3aXRjaCAodGhpcy5pbnN0YW5jZS5qZWRpLm9wdGlvbnMuaWNvbkxpYikge1xuICAgICAgICBjYXNlICdnbHlwaGljb25zJzpcbiAgICAgICAgICBpY29ucyA9IGdseXBoaWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdib290c3RyYXAtaWNvbnMnOlxuICAgICAgICAgIGljb25zID0gYm9vdHN0cmFwSWNvbnNcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTMnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWUzXG4gICAgICAgICAgYnJlYWtcbiAgICAgICAgY2FzZSAnZm9udGF3ZXNvbWU0JzpcbiAgICAgICAgICBpY29ucyA9IGZvbnRBd2Vzb21lNFxuICAgICAgICAgIGJyZWFrXG4gICAgICAgIGNhc2UgJ2ZvbnRhd2Vzb21lNSc6XG4gICAgICAgICAgaWNvbnMgPSBmb250QXdlc29tZTVcbiAgICAgICAgICBicmVha1xuICAgICAgICBjYXNlICdmb250YXdlc29tZTYnOlxuICAgICAgICAgIGljb25zID0gZm9udEF3ZXNvbWU2XG4gICAgICAgICAgYnJlYWtcbiAgICAgIH1cbiAgICB9XG5cbiAgICBzd2l0Y2ggKHRoaXMuaW5zdGFuY2UuamVkaS5vcHRpb25zLnRoZW1lKSB7XG4gICAgICBjYXNlICdib290c3RyYXAzJzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDMoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA0JzpcbiAgICAgICAgdGhpcy50aGVtZSA9IG5ldyBUaGVtZUJvb3RzdHJhcDQoaWNvbnMpXG4gICAgICAgIGJyZWFrXG4gICAgICBjYXNlICdib290c3RyYXA1JzpcbiAgICAgICAgdGhpcy50aGVt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2UudGV4dENvbnRlbnQgPSBsYWJlbCArICcgZmllbGQgd2FzIHJlbW92ZWQgZnJvbSB0aGUgZm9ybSdcbiAgICAgICAgICAgICAgYXJpYUxpdmUuYXBwZW5kQ2hpbGQoYXJpYUxpdmVNZXNzYWdlKVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBrZWVwcyBkaWFsb2cgb3BlblxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuY2xvc2UoKVxuICAgICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNDb250YWluZXIuc2hvd01vZGFsKClcbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgdGhpcy5jb250cm9sLnByb3BlcnRpZXNBY3RpdmF0b3JzLmFwcGVuZENoaWxkKGNoZWNrYm94Q29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBjb25zdCBjaGVja2JveCA9IHRoaXMucHJvcGVydHlBY3RpdmF0b3JzW3Byb3BlcnR5XVxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29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0aWVzID0gc2NoZW1hQWRkaXRpb25hbFByb3BlcnRpZXNcbiAgICBjb25zdCBwYXR0ZXJuUHJvcGVydGllcyA9IHNjaGVtYVBhdHRlcm5Qcm9wZXJ0aWVzXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGFkZGl0aW9uYWxQcm9wZXJ0aWVzID09PSBmYWxzZSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yQWRkaXRpb25hbFByb3BlcnRpZXMsIHtcbiAgICAgICAgICAgICAgICBwcm9wZXJ0eTogcHJvcGVydHlcbiAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgIF0sXG4gICAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgICAgY29uc3RyYWluOiAnYWRkaXRpb25hbFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICA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MgPSBbXVxuICBjb25zdCBjb250YWlucyA9IGdldFNjaGVtYUNvbnRhaW5zKHNjaGVtYSlcbiAgY29uc3QgbWluQ29udGFpbnMgPSBnZXRTY2hlbWFNaW5Db250YWlucyhzY2hlbWEpXG4gIGNvbnN0IG1heENvbnRhaW5zID0gZ2V0U2NoZW1hTWF4Q29udGFpbnMoc2NoZW1hKVxuXG4gIGlmIChpc0FycmF5KHZhbHVlKSAmJiBpc1NldChjb250YWlucykpIHtcbiAgICBsZXQgY291bnRlciA9IDBcblxuICAgIHZhbHVlLmZvckVhY2goKGl0ZW0pID0+IHtcbiAgICAgIGNvbnN0IGNvbnRhaW5zRWRpdG9yID0gbmV3IEplZGkoeyByZWZQYXJzZXI6IHZhbGlkYXRvci5yZWZQYXJzZXIsIHNjaGVtYTogY29udGFpbnMsIGRhdGE6IGl0ZW0gfSlcbiAgICAgIGNvbnN0IGNvbnRhaW5zRXJyb3JzID0gY29udGFpbnNFZGl0b3IuZ2V0RXJyb3JzKClcblxuICAgICAgaWYgKGNvbnRhaW5zRXJyb3JzLmxlbmd0aCA9PT0gMCkge1xuICAgICAgICBjb3VudGVyKytcbiAgICAgIH1cblxuICAgICAgY29udGFpbnNFZGl0b3IuZGVzdHJveSgpXG4gICAgfSlcblxuICAgIGNvbnN0IGNvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyID09PSAwKVxuXG4gICAgaWYgKGlzU2V0KG1pbkNvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWluQ29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPCBtaW5Db250YWlucylcblxuICAgICAgaWYgKG1pbkNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWluQ29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWluQ29udGFpbnM6IG1pbkNvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtaW5Db250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9IGVsc2Uge1xuICAgICAgaWYgKGNvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtpMThuLmVycm9yQ29udGFpbnNdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnY29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfVxuXG4gICAgaWYgKGlzU2V0KG1heENvbnRhaW5zKSkge1xuICAgICAgY29uc3QgbWF4Q29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPiBtYXhDb250YWlucylcblxuICAgICAgaWYgKG1heENvbnRhaW5zSW52YWxpZCkge1xuICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yTWF4Q29udGFpbnMsIHtcbiAgICAgICAgICAgICAgY291bnRlcjogY291bnRlcixcbiAgICAgICAgICAgICAgbWF4Q29udGFpbnM6IG1heENvbnRhaW5zXG4gICAgICAgICAgICB9KVxuICAgICAgICAgIF0sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdtYXhDb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVGVtcGxhdGUsIGhhc093biwgaXNPYmplY3QsIGlzU2V0IH0gZnJvbSAnLi4vLi4vaGVscGVycy91dGlscy5qcydcbmltcG9ydCB7IGdldFNjaGV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uZm9yRWFjaCgocHJvcGVydHlOYW1lKSA9PiB7XG4gICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICBjb25zdCByZWdleHAgPSBuZXcgUmVnRXhwKHBhdHRlcm4pXG4gICAgICAgIGlmIChyZWdleHAudGVzdChwcm9wZXJ0eU5hbWUpKSB7XG4gICAgICAgICAgY29uc3Qgc2NoZW1hID0gcGF0dGVyblByb3BlcnRpZXNbcGF0dGVybl1cblxuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogc2NoZW1hLFxuICAgICAgICAgICAgZGF0YTogdmFsdWVbcHJvcGVydHlOYW1lXVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCBlZGl0b3JFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgJy8nICsgcHJvcGVydHlOYW1lLFxuICAgICAgICAgICAgICBjb25zdHJhaW46ICdwYXR0ZXJuUHJvcGVydGllcydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgZXJyb3JzID0gWy4uLmVycm9ycywgLi4uZWRpdG9yRXJyb3JzXVxuXG4gICAgICAgICAgZWRpdG9yLmRlc3Ryb3koKVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVGVtcGxhdGUsIGlzQXJyYXksIGlzU2V0IH0gZnJvbSAnLi4vLi4vaGVscG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GxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KHVuZXZhbHVhdGVkUHJvcGVydGllcykgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBjb25zdCBlZGl0b3IgPSBuZXcgSmVkaSh7XG4gICAgICAgICAgICByZWZQYXJzZXI6IHZhbGlkYX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VfXy5vKGRlZmluaXRpb24sIGtleSkgJiYgIV9fd2VicGFja19yZXF1aXJlX18ubyhleHBvcnRzLCBrZXkpKSB7XG5cdFx0XHRPYmplY3QuZGVmaW5lUHJvcGVydHkoZXhwb3J0cywga2V5LCB7IGVudW1lcmFibGU6IHRydWUsIGdldDogZGVmaW5pdGlvbltrZXldIH0pO1xuXHRcdH1cblx0fVxufTsiLCJfX3dlYnBhY2tfcmVxdWlyZV9fLm8gPSAob2JqLCBwcm9wKSA9PiAoT2JqZWN0LnByb3RvdHlwZS5oYXNPd25Qcm9wZXJ0eS5jYWxsKG9iaiwgcHJvcCkpIiwiLy8gZGVmaW5lIF9fZXNNb2R1bGUgb24gZXhwb3J0c1xuX193ZWJwYWNrX3JlcXVpcmVfXy5yID0gKGV4cG9ydHMpID0+IHtcblx0aWYodHlwZW9mIFN5bWJvbCAhPT0gJ3VuZGVmaW5lZCcgJiYgU3ltYm9sLnRvU3RyaW5nVGFnKSB7XG5cdFx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsIFN5bWJvbC50b1N0cmluZ1RhZywgeyB2YWx1ZTogJ01vZHVsZScgfSk7XG5cdH1cblx0T2JqZWN0LmRlZmluZVByb3BlcnR5KGV4cG9ydHMsICdfX2VzTW9kdWxlJywgeyB2YWx1ZTogdHJ1ZSB9KTtcbn07IiwiaW1wb3J0IEplZGkgZnJvbSAnLi9qZWRpLmpzJ1xuaW1wb3J0IFJlZlBhcnNlciBmcm9tICcuL3JlZi1wYXJzZXIvcmVmLXBhcnNlci5qcydcblxuZXhwb3J0IGRlZmF1bHQge1xuICBKZWRpLFxuICBSZWZQYXJzZXJcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/docs/js/playground.js b/docs/js/playground.js index 8cf08c66..e50a3e3a 100644 --- a/docs/js/playground.js +++ b/docs/js/playground.js @@ -83,7 +83,9 @@ window.addEventListener('DOMContentLoaded', () => { 'change', 'always' ], - editableProperties: true, + enablePropertiesToggle: true, + enableCollapseToggle: true, + startCollapsed: false, schema: {}, editor: null, theme: 'barebones', @@ -179,7 +181,9 @@ window.addEventListener('DOMContentLoaded', () => { const options = { container: document.querySelector('#jedi-container'), - editableProperties: this.editableProperties, + enablePropertiesToggle: this.enablePropertiesToggle, + enableCollapseToggle: this.enableCollapseToggle, + startCollapsed: this.startCollapsed, iconLib: this.iconLib, showErrors: this.showErrors, validateFormat: this.validateFormat, @@ -189,6 +193,7 @@ window.addEventListener('DOMContentLoaded', () => { } this.editor = new Jedi.Jedi(options) + window.editor = this.editor this.editorChangeHandler() this.editor.on('change', this.editorChangeHandler) }, diff --git a/docs/json/examples/login.json b/docs/json/examples/login.json index d7190dcf..6c4fa026 100644 --- a/docs/json/examples/login.json +++ b/docs/json/examples/login.json @@ -8,7 +8,7 @@ "csfr" ], "options": { - "editableProperties": false + "enablePropertiesToggle": false }, "properties": { "email": { diff --git a/docs/json/validator/prefixItems.json b/docs/json/validator/prefixItems.json index 7d0a51e5..df6f5ee5 100644 --- a/docs/json/validator/prefixItems.json +++ b/docs/json/validator/prefixItems.json @@ -1,9 +1,28 @@ { "type": "array", "prefixItems": [ - { "type": "number" }, - { "type": "string" }, - { "enum": ["Street", "Avenue", "Boulevard"] }, - { "enum": ["NW", "NE", "SW", "SE"] } + { + "type": "number" + }, + { + "type": "string" + }, + { + "type": "string", + "enum": [ + "Street", + "Avenue", + "Boulevard" + ] + }, + { + "type": "string", + "enum": [ + "NW", + "NE", + "SW", + "SE" + ] + } ] } diff --git a/docs/views/playground.html b/docs/views/playground.html index 2e49ca1d..8c380bcf 100644 --- a/docs/views/playground.html +++ b/docs/views/playground.html @@ -76,8 +76,18 @@

Playground

- - + + +
+ +
+ + +
+ +
+ +
diff --git a/src/editors/array.js b/src/editors/array.js index 7b9fb7e4..8ed7f2b3 100644 --- a/src/editors/array.js +++ b/src/editors/array.js @@ -18,7 +18,9 @@ class EditorArray extends Editor { title: getSchemaTitle(this.instance.schema) || this.instance.getKey(), titleHidden: getSchemaOption(this.instance.schema, 'titleHidden'), id: pathToAttribute(this.instance.path), - description: getSchemaDescription(this.instance.schema) + description: getSchemaDescription(this.instance.schema), + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || getSchemaOption(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || getSchemaOption(this.instance.schema, 'startCollapsed') }) } diff --git a/src/editors/object.js b/src/editors/object.js index b0115428..13d80e12 100644 --- a/src/editors/object.js +++ b/src/editors/object.js @@ -28,14 +28,14 @@ class EditorObject extends Editor { addProperty = false } - let editableProperties = false + let enablePropertiesToggle = false - if (isSet(this.instance.jedi.options.editableProperties)) { - editableProperties = this.instance.jedi.options.editableProperties + if (isSet(this.instance.jedi.options.enablePropertiesToggle)) { + enablePropertiesToggle = this.instance.jedi.options.enablePropertiesToggle } - if (isSet(schemaOptions.editableProperties)) { - editableProperties = schemaOptions.editableProperties + if (isSet(schemaOptions.enablePropertiesToggle)) { + enablePropertiesToggle = schemaOptions.enablePropertiesToggle } this.control = this.theme.getObjectControl({ @@ -43,8 +43,10 @@ class EditorObject extends Editor { titleHidden: getSchemaOption(this.instance.schema, 'titleHidden'), id: pathToAttribute(this.instance.path), description: getSchemaDescription(this.instance.schema), - editableProperties: editableProperties, - addProperty: addProperty + enablePropertiesToggle: enablePropertiesToggle, + addProperty: addProperty, + enableCollapseToggle: this.instance.jedi.options.enableCollapseToggle || getSchemaOption(this.instance.schema, 'enableCollapseToggle'), + startCollapsed: this.instance.jedi.options.startCollapsed || getSchemaOption(this.instance.schema, 'startCollapsed') }) } @@ -105,9 +107,9 @@ class EditorObject extends Editor { } refreshPropertiesSlot () { - const schemaOptionEditableProperties = getSchemaOption(this.instance.schema, 'editableProperties') + const schemaOptionEnablePropertiesToggle = getSchemaOption(this.instance.schema, 'enablePropertiesToggle') - if (equal(this.instance.jedi.options.editableProperties, true) || equal(schemaOptionEditableProperties, true)) { + if (equal(this.instance.jedi.options.enablePropertiesToggle, true) || equal(schemaOptionEnablePropertiesToggle, true)) { Object.keys(this.instance.properties).forEach((property) => { // refactor with isNotRequired const isRequired = this.instance.isRequired(property) diff --git a/src/instances/object.js b/src/instances/object.js index 21792e1d..ac36b9ca 100644 --- a/src/instances/object.js +++ b/src/instances/object.js @@ -42,9 +42,14 @@ class InstanceObject extends Instance { let musstCreateChild = true + const optionsDeactivateNonRequired = this.jedi.options.deactivateNonRequired const deactivateNonRequired = getSchemaOption(this.schema, 'deactivateNonRequired') const schemaDeactivateNonRequired = getSchemaOption(schema, 'deactivateNonRequired') + if (this.isNotRequired(key) && isSet(optionsDeactivateNonRequired) && optionsDeactivateNonRequired === true) { + musstCreateChild = false + } + if (this.isNotRequired(key) && isSet(deactivateNonRequired) && deactivateNonRequired === true) { musstCreateChild = false } @@ -112,7 +117,7 @@ class InstanceObject extends Instance { this.children.push(instance) this.value[key] = instance.getValue() - const deactivateNonRequired = getSchemaOption(this.schema, 'deactivateNonRequired') + const deactivateNonRequired = this.jedi.options.deactivateNonRequired || getSchemaOption(this.schema, 'deactivateNonRequired') if (this.isNotRequired(key) && isSet(deactivateNonRequired) && deactivateNonRequired === true) { instance.deactivate() diff --git a/src/jedi.js b/src/jedi.js index 71075da2..adb35133 100644 --- a/src/jedi.js +++ b/src/jedi.js @@ -39,7 +39,10 @@ class Jedi extends EventEmitter { this.options = Object.assign({ container: null, refParser: null, - editableProperties: false, + enablePropertiesToggle: false, + enableCollapseToggle: false, + startCollapsed: false, + deactivateNonRequired: false, schema: {}, showErrors: 'change', data: undefined, @@ -190,6 +193,7 @@ class Jedi extends EventEmitter { if (this.refParser) { config.schema = this.refParser.expand(config.schema, config.path) } + const schemaType = getSchemaType(config.schema) const schemaOneOf = getSchemaOneOf(config.schema) const schemaAnyOf = getSchemaAnyOf(config.schema) diff --git a/src/themes/bootstrap3.js b/src/themes/bootstrap3.js index 3807b387..49f3b676 100644 --- a/src/themes/bootstrap3.js +++ b/src/themes/bootstrap3.js @@ -9,6 +9,24 @@ class ThemeBootstrap3 extends Theme { this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('in') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('panel') diff --git a/src/themes/bootstrap4.js b/src/themes/bootstrap4.js index adc84398..8bb4dbbf 100644 --- a/src/themes/bootstrap4.js +++ b/src/themes/bootstrap4.js @@ -9,6 +9,24 @@ class ThemeBootstrap4 extends Theme { this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') diff --git a/src/themes/bootstrap5.js b/src/themes/bootstrap5.js index ba517d38..c7b5a43b 100644 --- a/src/themes/bootstrap5.js +++ b/src/themes/bootstrap5.js @@ -9,6 +9,24 @@ class ThemeBootstrap5 extends Theme { this.useToggleEvents = false } + getCollapseToggle (config) { + const toggle = super.getCollapseToggle(config) + toggle.setAttribute('href', '#' + config.collapseId) + toggle.setAttribute('data-bs-toggle', 'collapse') + return toggle + } + + getCollapse (config) { + const collapse = super.getCollapse(config) + collapse.classList.add('collapse') + + if (!config.startCollapsed) { + collapse.classList.add('show') + } + + return collapse + } + getFieldset () { const fieldset = document.createElement('fieldset') fieldset.classList.add('card') diff --git a/src/themes/icons/icons.js b/src/themes/icons/icons.js index 54311aec..eb5173f1 100644 --- a/src/themes/icons/icons.js +++ b/src/themes/icons/icons.js @@ -12,7 +12,9 @@ export const glyphicons = { delete: 'glyphicon glyphicon-trash', add: 'glyphicon glyphicon-plus', moveUp: 'glyphicon glyphicon-arrow-up', - moveDown: 'glyphicon glyphicon-arrow-down' + moveDown: 'glyphicon glyphicon-arrow-down', + expand: 'glyphicon glyphicon-chevron-right', + collapse: 'glyphicon glyphicon-chevron-down' } /** @@ -24,7 +26,9 @@ export const bootstrapIcons = { delete: 'bi bi-trash2', add: 'bi bi-plus', moveUp: 'bi bi-arrow-up', - moveDown: 'bi bi-arrow-down' + moveDown: 'bi bi-arrow-down', + expand: 'bi bi-chevron-right', + collapse: 'bi bi-chevron-down' } /** @@ -36,7 +40,9 @@ export const fontAwesome3 = { delete: 'icon-trash', add: 'icon-plus', moveUp: 'icon-arrow-up', - moveDown: 'icon-arrow-down' + moveDown: 'icon-arrow-down', + expand: 'icon-chevron-right', + collapse: 'icon-chevron-down' } /** @@ -48,7 +54,9 @@ export const fontAwesome4 = { delete: 'fa fa-trash-o', add: 'fa fa-plus', moveUp: 'fa fa-arrow-up', - moveDown: 'fa fa-arrow-down' + moveDown: 'fa fa-arrow-down', + expand: 'fa fa-chevron-right', + collapse: 'fa fa-chevron-down' } /** @@ -60,7 +68,9 @@ export const fontAwesome5 = { delete: 'fas fa-trash', add: 'fas fa-plus', moveUp: 'fas fa-arrow-up', - moveDown: 'fas fa-arrow-down' + moveDown: 'fas fa-arrow-down', + expand: 'fas fa-chevron-right', + collapse: 'fas fa-chevron-down' } /** @@ -72,5 +82,7 @@ export const fontAwesome6 = { delete: 'fa-solid fa-trash', add: 'fa-solid fa-plus', moveUp: 'fa-solid fa-arrow-up', - moveDown: 'fa-solid fa-arrow-down' + moveDown: 'fa-solid fa-arrow-down', + expand: 'fa-solid fa-chevron-right', + collapse: 'fa-solid fa-chevron-down' } diff --git a/src/themes/theme.js b/src/themes/theme.js index 0fded906..7b5cd40c 100644 --- a/src/themes/theme.js +++ b/src/themes/theme.js @@ -177,6 +177,43 @@ class Theme { return toggle } + /** + * Container that will collapse and expand to show and hide it contents + * @private + */ + getCollapse (config) { + const collapse = document.createElement('div') + collapse.classList.add('jedi-collapse') + collapse.setAttribute('id', config.id) + + if (this.useToggleEvents && config.startCollapsed) { + collapse.style.display = 'none' + } + + return collapse + } + + /** + * Toggle button for collapse + * @private + */ + getCollapseToggle (config) { + const toggle = this.getButton(config) + toggle.classList.add('jedi-collapse-toggle') + + if (this.useToggleEvents) { + toggle.addEventListener('click', () => { + if (config.collapse.style.display === 'none') { + config.collapse.style.display = 'block' + } else { + config.collapse.style.display = 'none' + } + }) + } + + return toggle + } + /** * Container for properties editing elements like property activators * @private @@ -389,6 +426,21 @@ class Theme { propertiesContainer: propertiesContainer }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + const propertiesActivators = this.getPropertiesActivators() const addPropertyControl = this.getInputControl({ @@ -408,13 +460,14 @@ class Theme { addPropertyBtn.classList.add('jedi-object-add') container.appendChild(fieldset) + container.appendChild(propertiesContainer) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) actions.appendChild(arrayActions) - body.appendChild(propertiesContainer) body.appendChild(childrenSlot) if (config.addProperty) { @@ -422,14 +475,20 @@ class Theme { propertiesContainer.appendChild(addPropertyBtn) } - if (config.editableProperties) { + if (config.enablePropertiesToggle) { actions.appendChild(propertiesToggle) propertiesContainer.appendChild(ariaLive) propertiesContainer.appendChild(propertiesActivators) } + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapse, + collapseToggle, body, actions, messages, @@ -469,9 +528,25 @@ class Theme { id: config.id }) + const collapseId = 'collapse-' + config.id + + const collapse = this.getCollapse({ + id: collapseId, + startCollapsed: config.startCollapsed + }) + + const collapseToggle = this.getCollapseToggle({ + textContent: config.title + ' ' + 'properties', + id: 'collapse-toggle-' + config.id, + icon: 'collapse', + collapseId: collapseId, + collapse: collapse + }) + container.appendChild(fieldset) fieldset.appendChild(legend) - fieldset.appendChild(body) + fieldset.appendChild(collapse) + collapse.appendChild(body) body.appendChild(description) body.appendChild(messages) legend.appendChild(actions) @@ -480,8 +555,14 @@ class Theme { actions.appendChild(arrayActions) body.appendChild(childrenSlot) + if (config.enableCollapseToggle) { + actions.appendChild(collapseToggle) + } + return { container, + collapseToggle, + collapse, body, actions, messages, @@ -764,7 +845,20 @@ class Theme { fieldset.appendChild(description) fieldset.appendChild(messages) - return { container, fieldset, legend, body, radios, labels, labelTexts, radioControls, description, messages, actions, arrayActions } + return { + container, + fieldset, + legend, + body, + radios, + labels, + labelTexts, + radioControls, + description, + messages, + actions, + arrayActions + } } /** diff --git a/tests/e2e/tests/editor_test.cjs b/tests/e2e/tests/editor_test.cjs index 917fde74..2779d587 100644 --- a/tests/e2e/tests/editor_test.cjs +++ b/tests/e2e/tests/editor_test.cjs @@ -55,7 +55,7 @@ Scenario('@editor-disable Should disable and enable', ({ I }) => { I.amOnPage(`playground.html?theme=${theme}`) I.selectOption('#examples', '../json/editors/all.json') I._waitForElement('.jedi-ready') - I._checkOption('[id="editableProperties"]') + I._checkOption('[id="enablePropertiesToggle"]') I._waitForElement('.jedi-ready') I._waitForElement('#disable-editor') I._scrollTo('#disable-editor') diff --git a/tests/e2e/tests/editors/array_test.cjs b/tests/e2e/tests/editors/array_test.cjs index 89048b20..97044f8e 100644 --- a/tests/e2e/tests/editors/array_test.cjs +++ b/tests/e2e/tests/editors/array_test.cjs @@ -36,6 +36,16 @@ Scenario('@editor-array @prefixItems should validate against prefixItems', ({ I I._waitForElement('[data-path="#/prefixItems/3"][data-type="undefined"]') }) +Scenario('@array-object @enableCollapseToggle should collapse and expand contents', ({ I }) => { + I.amOnPage(`playground.html?theme=${theme}`) + I.selectOption('#examples', '../json/editors/array.json') + I._waitForElement('.jedi-ready') + I._click('.jedi-collapse-toggle') + I.waitForInvisible('.jedi-editor-card-body') + I._click('.jedi-collapse-toggle') + I.waitForVisible('.jedi-editor-card-body') +}) + Scenario('@editor-array @array-nav-pills', ({ I }) => { I.amOnPage(`playground.html?theme=${theme}`) I.selectOption('#examples', '../json/editors/array-nav-pills.json') diff --git a/tests/e2e/tests/editors/object_test.cjs b/tests/e2e/tests/editors/object_test.cjs index 306d531c..9a14a041 100644 --- a/tests/e2e/tests/editors/object_test.cjs +++ b/tests/e2e/tests/editors/object_test.cjs @@ -11,7 +11,7 @@ Scenario('@editor-object @description @title should have title and description', I._waitForText('Objects are the mapping type in JSON. They map “keys” to “values”. In JSON, the “keys” must always be strings. Each of these pairs is conventionally referred to as a “property”.') }) -Scenario('@editor-object @editableProperties should add properties', ({ I }) => { +Scenario('@editor-object @enablePropertiesToggle should add properties', ({ I }) => { I.amOnPage(`playground.html?theme=${theme}`) I.selectOption('#examples', '../json/editors/object.json') I._waitForElement('.jedi-ready') @@ -24,7 +24,7 @@ Scenario('@editor-object @editableProperties should add properties', ({ I }) => I.dontSee('[data-path="#/test"') }) -Scenario('@editor-object @editableProperties should activate and deactivate properties', ({ I }) => { +Scenario('@editor-object @enablePropertiesToggle should activate and deactivate properties', ({ I }) => { I.amOnPage(`playground.html?theme=${theme}`) I.selectOption('#examples', '../json/editors/object.json') I._waitForElement('.jedi-ready') @@ -37,6 +37,16 @@ Scenario('@editor-object @editableProperties should activate and deactivate prop I._waitForElement('[data-path="#/notRequired"]') }) +Scenario('@editor-object @enableCollapseToggle should collapse and expand contents', ({ I }) => { + I.amOnPage(`playground.html?theme=${theme}`) + I.selectOption('#examples', '../json/editors/object.json') + I._waitForElement('.jedi-ready') + I._click('.jedi-collapse-toggle') + I.waitForInvisible('.jedi-editor-card-body') + I._click('.jedi-collapse-toggle') + I.waitForVisible('.jedi-editor-card-body') +}) + Scenario('@editor-object @object-grid rows and columns', ({ I }) => { I.amOnPage(`playground.html?theme=${theme}`) I.selectOption('#examples', '../json/editors/object-grid.json') diff --git a/todo.md b/todo.md index 6241b290..ff60ab34 100644 --- a/todo.md +++ b/todo.md @@ -1,24 +1,22 @@ ## Todo -- replace node-sass with sass +- merge schema into own oneOf schemas https://json.schemastore.org/geojson.json +- additionalItems with prefixItems validation and editing https://json-schema.org/understanding-json-schema/reference/array#additionalitems +- multiple instance: do not transfer values between editors - append descriptions if set and not hidden - type hidden description - enforce margin-bottom -- actions buttons disabled - add property separated from edit properties - editor hidden description - hide if-then-else headers - better elements class names - move actions on top of cards -- multiple in field sets - ionic theme - integrate unevaluatedProperties "see through" - better NOT error messages - options can be global or scoped in schemas - resolvers system -- collapsed options and arrays - property already exist message box or disable add button -- use dropdown instead of collapse - minimize dependencies and overhead (webpack, sass, less, and stuff) - fix/check items constrain - error constrain property: allOf, dependentSchemas, if-then-else