diff --git a/dist/jedi.js b/dist/jedi.js index f3535a7..eb98db8 100644 --- a/dist/jedi.js +++ b/dist/jedi.js @@ -716,7 +716,7 @@ class Editor { * Shows validation messages in the editor container. * @private */ - showValidationErrors (errors) { + showValidationErrors (errors, force = false) { errors = errors.filter((error) => { return error.path === this.instance.path }) @@ -726,7 +726,7 @@ class Editor { const neverShowErrors = this.instance.jedi.options.showErrors === 'never' || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaXOption)(this.instance.schema, 'showErrors') === 'never' - if (neverShowErrors || errors.length === 0) { + if ((neverShowErrors && !force) || errors.length === 0) { return } @@ -1625,6 +1625,40 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } } + /** + * Sorts the children of the current instance based on their `propertyOrder` value in ascending order. + * The sorting is done using the `propertyOrder` obtained from each child's schema, which should be a number. + * If a child does not have a valid `propertyOrder` (i.e., the value is not a number), it will be placed after the child with a valid `propertyOrder`. + * @returns {void} This function modifies the `children` array of the instance in place. + */ + sortChildrenByPropertyOrder () { + this.instance.children = this.instance.children.sort((a, b) => { + const propertyOrderA = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaXOption)(a.schema, 'propertyOrder') + const propertyOrderB = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaXOption)(b.schema, 'propertyOrder') + + const isValidNumberA = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isNumber)(propertyOrderA) + const isValidNumberB = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isNumber)(propertyOrderB) + + if (!isValidNumberA && isValidNumberB) { + return 1 + } + + if (isValidNumberA && !isValidNumberB) { + return -1 + } + + if (propertyOrderA < propertyOrderB) { + return -1 + } + + if (propertyOrderA > propertyOrderB) { + return 1 + } + + return 0 + }) + } + refreshEditors () { this.instance.children.forEach((child) => { if (child.isActive) { @@ -1646,6 +1680,7 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } refreshUI () { + this.sortChildrenByPropertyOrder() this.refreshInteractiveElements() this.refreshPropertiesSlot() this.refreshEditors() @@ -4563,7 +4598,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { * If an errors list is passed, it will display these errors; * otherwise, it will retrieve existing errors from the instance. * - * @param {Object|null} errorsList - An optional object containing error messages. + * @param {Array|null} errorsList - An optional array containing error messages. * @returns {boolean} Returns `true` if the container exists and errors are displayed, * or `false` if there is no container and thus no errors are displayed. */ @@ -4576,7 +4611,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { Object.keys(this.instances).forEach((key) => { const instance = this.instances[key] - instance.ui.showValidationErrors(errors) + instance.ui.showValidationErrors(errors, true) }) } @@ -9721,4 +9756,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNONEI7O0FBVUM7O0FBRUc7O0FBRWhDO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsbUNBQW1DLGtEQUFNO0FBQ3pDO0FBQ0EsdUJBQXVCLGlFQUFhO0FBQ3BDLHdCQUF3QixrRUFBYztBQUN0Qyw0QkFBNEIsd0RBQUssaUJBQWlCLGlFQUFhO0FBQy9ELHdCQUF3Qix3REFBSztBQUM3QiwwQkFBMEIsd0VBQW9CO0FBQzlDLG9CQUFvQix3REFBSyxpQkFBaUIsd0RBQUssQ0FBQyxpRUFBYTtBQUM3RCxxQkFBcUIsd0RBQUssaUJBQWlCLHdEQUFLOztBQUVoRDs7QUFFQSw2QkFBNkIsd0RBQUs7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G9ycy5hcHBlbmRDaGlsZChjaGVja2JveENvbnRyb2wuY29udGFpbmVyKVxuICAgICAgICB9XG5cbiAgICAgICAgY29uc3QgY2hlY2tib3ggPSB0aGlzLnByb3BlcnR5QWN0aXZhdG9yc1twcm9wZXJ0eV1cblxuICAgICAgICBpZiAoY2hlY2tib3gpIHtcbiAgICAgICAgICBjaGVja2JveC5kaXNhYmxlZCA9IHRoaXMuZGlzYWJsZWRcbiAgICAgICAgICBjaGVja2JveC5jaGVja2VkID0gaGFzT3duKHRoaXMuaW5zdGFuY2UuZ2V0VmFsdWUoKSwgcHJvcGVydHkpXG4gICAgICAgIH1cbiAgICAgIH0pXG4gICAgfVxuICB9XG5cbiAgcmVmcmVzaEVkaXRvcnMgKCkge1xuICAgIHRoaXMuaW5zdGFuY2UuY2hpbGRyZW4uZm9yRWFjaCgoY2hpbGQpID0+IHtcbiAgICAgIGlmIChjaGlsZC5pc0FjdGl2ZSkge1xuICAgICAgICBpZiAoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZSA9PT0gbnVsbCkge1xuICAgICAgICAgIHRoaXMuY29udHJvbC5jaGlsZHJlblNsb3QuYXBwZW5kQ2hpbGQoY2hpbGQudWkuY29udHJvbC5jb250YWluZXIpXG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5kaXNhYmxlZCB8fCB0aGlzLmluc3RhbmNlLmlzUmVhZE9ubHkoKSkge1xuICAgICAgICAgIGNoaWxkLnVpLmRpc2FibGUoKVxuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgIGNoaWxkLnVpLmVuYWJsZSgpXG4gICAgICAgIH1cbiAgICAgIH0gZWxzZSB7XG4gICAgICAgIGlmIChjaGlsZC51aS5jb250cm9sLmNvbnRhaW5lci5wYXJlbnROb2RlKSB7XG4gICAgICAgICAgY2hpbGQudWkuY29udHJvbC5jb250YWluZXIucGFyZW50Tm9kZS5yZW1vdmVDaGlsZChjaGlsZC51aS5jb250cm9sLmNvb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b3koKVxuICAgIH0pXG5cbiAgICBjb25zdCBjb250YWluc0ludmFsaWQgPSAoY291bnRlciA9PT0gMClcblxuICAgIGlmIChpc1NldChtaW5Db250YWlucykpIHtcbiAgICAgIGNvbnN0IG1pbkNvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyIDwgbWluQ29udGFpbnMpXG5cbiAgICAgIGlmIChtaW5Db250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvck1pbkNvbnRhaW5zLCB7XG4gICAgICAgICAgICAgIGNvdW50ZXI6IGNvdW50ZXIsXG4gICAgICAgICAgICAgIG1pbkNvbnRhaW5zOiBtaW5Db250YWluc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICBdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnbWluQ29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChjb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbaTE4bi5lcnJvckNvbnRhaW5zXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ2NvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1cblxuICAgIGlmIChpc1NldChtYXhDb250YWlucykpIHtcbiAgICAgIGNvbnN0IG1heENvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyID4gbWF4Q29udGFpbnMpXG5cbiAgICAgIGlmIChtYXhDb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5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ZXJuUHJvcGVydGllcykpIHtcbiAgICBPYmplY3Qua2V5cyh2YWx1ZSkuZm9yRWFjaCgocHJvcGVydHlOYW1lKSA9PiB7XG4gICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICBjb25zdCByZWdleHAgPSBuZXcgUmVnRXhwKHBhdHRlcm4pXG4gICAgICAgIGlmIChyZWdleHAudGVzdChwcm9wZXJ0eU5hbWUpKSB7XG4gICAgICAgICAgY29uc3Qgc2NoZW1hID0gcGF0dGVyblByb3BlcnRpZXNbcGF0dGVybl1cblxuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogc2NoZW1hLFxuICAgICAgICAgICAgZGF0YTogdmFsdWVbcHJvcGVydHlOYW1lXVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCBlZGl0b3JFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwYXRoICsgJy8nICsgcHJvcGVydHlOYW1lLFxuICAgICAgICAgICAgICBjb25zdHJhaW46ICdwYXR0ZXJuUHJvcGVydGllcydcbiAgICAgICAgICAgIH1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgZXJyb3JzID0gWy4uLmVycm9ycywgLi4uZWRpdG9yRXJyb3JzXVxuXG4gICAgICAgICAgZWRpdG9yLmRlc3Ryb3koKVxuICAgICAgICB9XG4gICAgICB9KVxuICAgIH0pXG4gIH1cblxuICByZXR1cm4gZXJyb3JzXG59XG4iLCJpbXBvcnQgeyBjb21waWxlVGVt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1xuICAgICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICAgIGNvbXBpbGVUZW1wbGF0ZShpMThuLmVycm9yVW5ldmFsdWF0ZWRQcm9wZXJ0aWVzLCB7XG4gICAgICAgICAgICAgICAgcHJvcGVydHk6IHByb3BlcnR5XG4gICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICBdLFxuICAgICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICAgIGNvbnN0cmFpbjogJ3VuZXZhbHVhdGVkUHJvcGVydGllcydcbiAgICAgICAgICB9KVxuICAgICAgICB9XG5cbiAgICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgaXNPYmplY3QodW5ldmFsdWF0ZWRQcm9wZXJ0aWVzKSAmJiAhaGFzT3duKHByb3BlcnRpZXMsIHByb3BlcnR5KSkge1xuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogdW5ldmFsdWF0ZWRQcm9wZXJ0aWVzLFxuICAgICAgICAgICAgZGF0YTogdmFsdWVbcHJvcGVydHldXG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGNvbnN0IHVuZXZhbHVhdGVkUHJvcGVydGllc0Vycm9ycyA9IGVkaXRvci5nZXRFcnJvcnMoKS5tYXAoKGVycm9yKSA9PiB7XG4gICAgICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgICBtZXNzYWdlczogZXJyb3IubWVzc2FnZXMsXG4gICAgICAgICAgICAgIHBhdGg6IHByb3BlcnR5LFxuICAgICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGVycm9ycyA9IFsu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LW11dGVkJylcbiAgICByZXR1cm4gZGVzY3JpcHRpb25cbiAgfVxuXG4gIGdldFRleHRhcmVhQ29udHJvbCAoY29uZmlnKSB7XG4gICAgY29uc3QgY29udHJvbCA9IHN1cGVyLmdldFRleHRhcmVhQ29udHJvbChjb25maWcpXG4gICAgY29uc3QgeyBjb250YWluZXIsIGlucHV0LCBsYWJlbCB9ID0gY29udHJvbFxuICAgIGNvbnRhaW5lci5jbGFzc0xpc3QuYWRkKCdtYi0zJylcbiAgICBpbnB1dC5jbGFzc0xpc3QuYWRkKCdmb3JtLWNvbnRyb2wnKVxuXG4gICAgaWYgKGNvbmZpZy50aXRsZUhpZGRlbikge1xuICAgICAgdGhpcy52aXN1YWxseUhpZGRlbihsYWJlbClcbiAgICB9XG5cbiAgICByZXR1cm4gY29udHJvbFxuICB9XG5cbiAgZ2V0SW5wdXRDb250cm9sIChjb25maWcpIHtcbiAgICBjb25zdCBjb250cm9sID0gc3VwZXIuZ2V0SW5wdXRDb250cm9sKGNvbmZpZylcbiAgICBjb25zdCB7IGNvbnRhaW5lciwgaW5wdXQsIGxhYmVsIH0gPSBjb250cm9sXG4gICAgY29udGFpbmVyLmNsYXNzTGlzdC5hZGQoJ21iLTMnKVxuICAgIGlucHV0LmNsYXNzTGlzdC5hZGQoJ2Zvcm0tY29udHJvbCcpXG5cbiAgICBpZiAoY29uZmlnLnRpdGxlSGlkZGVuKSB7XG4gICAgICB0aGlzLnZpc3VhbGx5SGlkZGVuKGxhYmVsKVxuICAgIH1cblxuICAgIHJldHVybiBjb250cm9sXG4gIH1cblxuICBnZXRSYWRpb3NDb250cm9sIChjb25maWcpIHtcbiAgICBjb25zdCBjb250cm9sID0gc3VwZXIuZ2V0UmFkaW9zQ29udHJvbChjb25maWcpXG4gICAgY29uc3QgeyBjb250YWluZXIsIGJvZHksIHJhZGlvcywgbGFiZWxzLCBsYWJlbFRleHRzLCByYWRpb0NvbnRyb2xzLCBkZXNjcmlwdGlvbiwgbWVzc2FnZXM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ICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaXNTZXQobWF4Q29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtYXhDb250YWluc0ludmFsaWQgPSAoY291bnRlciA+IG1heENvbnRhaW5zKVxuXG4gICAgICBpZiAobWF4Q29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNYXhDb250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtYXhDb250YWluczogbWF4Q29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21heENvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH1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zJ10pKSB7XG4gICAgICAgICAgICBwcm9wZXJ0aWVzID0geyAuLi5wcm9wZXJ0aWVzLCAuLi5zdWJzY2hlbWFbJ3Byb3BlcnRpZXMnXSB9XG4gICAgICAgICAgfVxuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0pXG5cbiAgICBpZiAocHJvcGVydGllcykge1xuICAgICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5KSA9PiB7XG4gICAgICAgIGxldCBkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgPSBmYWxzZVxuXG4gICAgICAgIGlmIChpc1NldChwYXR0ZXJuUHJvcGVydGllcykpIHtcbiAgICAgICAgICBPYmplY3Qua2V5cyhwYXR0ZXJuUHJvcGVydGllcykuZm9yRWFjaCgocGF0dGVybikgPT4ge1xuICAgICAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICAgICAgZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ID0gcmVnZXhwLnRlc3QocHJvcGVydHkpXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIHVuZXZhbHVhdGVkUHJvcGVydGllcyA9PT0gZmFsc2UgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4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ixcbiAgRWRpdG9yT2JqZWN0LFxuICBFZGl0b3JBcnJheU5hdixcbiAgRWRpdG9yQXJyYXksXG4gIEVkaXRvck11bHRpcGxlLFxuICBFZGl0b3JJZlRoZW5FbHNlLFxuICBFZGl0b3JOdWxsLFxuICBUaGVtZSxcbiAgVGhlbWVCb290c3RyYXAzLFxuICBUaGVtZUJvb3RzdHJhcDQsXG4gIFRoZW1lQm9vdHN0cmFwNSxcbiAgUmVmUGFyc2VyLFxuICBDcmVhdGVcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/docs/js/jedi.js b/docs/js/jedi.js index f3535a7..eb98db8 100644 --- a/docs/js/jedi.js +++ b/docs/js/jedi.js @@ -716,7 +716,7 @@ class Editor { * Shows validation messages in the editor container. * @private */ - showValidationErrors (errors) { + showValidationErrors (errors, force = false) { errors = errors.filter((error) => { return error.path === this.instance.path }) @@ -726,7 +726,7 @@ class Editor { const neverShowErrors = this.instance.jedi.options.showErrors === 'never' || (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_1__.getSchemaXOption)(this.instance.schema, 'showErrors') === 'never' - if (neverShowErrors || errors.length === 0) { + if ((neverShowErrors && !force) || errors.length === 0) { return } @@ -1625,6 +1625,40 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } } + /** + * Sorts the children of the current instance based on their `propertyOrder` value in ascending order. + * The sorting is done using the `propertyOrder` obtained from each child's schema, which should be a number. + * If a child does not have a valid `propertyOrder` (i.e., the value is not a number), it will be placed after the child with a valid `propertyOrder`. + * @returns {void} This function modifies the `children` array of the instance in place. + */ + sortChildrenByPropertyOrder () { + this.instance.children = this.instance.children.sort((a, b) => { + const propertyOrderA = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaXOption)(a.schema, 'propertyOrder') + const propertyOrderB = (0,_helpers_schema_js__WEBPACK_IMPORTED_MODULE_2__.getSchemaXOption)(b.schema, 'propertyOrder') + + const isValidNumberA = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isNumber)(propertyOrderA) + const isValidNumberB = (0,_helpers_utils_js__WEBPACK_IMPORTED_MODULE_1__.isNumber)(propertyOrderB) + + if (!isValidNumberA && isValidNumberB) { + return 1 + } + + if (isValidNumberA && !isValidNumberB) { + return -1 + } + + if (propertyOrderA < propertyOrderB) { + return -1 + } + + if (propertyOrderA > propertyOrderB) { + return 1 + } + + return 0 + }) + } + refreshEditors () { this.instance.children.forEach((child) => { if (child.isActive) { @@ -1646,6 +1680,7 @@ class EditorObject extends _editor_js__WEBPACK_IMPORTED_MODULE_0__["default"] { } refreshUI () { + this.sortChildrenByPropertyOrder() this.refreshInteractiveElements() this.refreshPropertiesSlot() this.refreshEditors() @@ -4563,7 +4598,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { * If an errors list is passed, it will display these errors; * otherwise, it will retrieve existing errors from the instance. * - * @param {Object|null} errorsList - An optional object containing error messages. + * @param {Array|null} errorsList - An optional array containing error messages. * @returns {boolean} Returns `true` if the container exists and errors are displayed, * or `false` if there is no container and thus no errors are displayed. */ @@ -4576,7 +4611,7 @@ class Jedi extends _event_emitter_js__WEBPACK_IMPORTED_MODULE_1__["default"] { Object.keys(this.instances).forEach((key) => { const instance = this.instances[key] - instance.ui.showValidationErrors(errors) + instance.ui.showValidationErrors(errors, true) }) } @@ -9721,4 +9756,4 @@ __webpack_exports__ = __webpack_exports__["default"]; /******/ })() ; }); -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiamVkaS5qcyIsIm1hcHBpbmdzIjoiQUFBQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxDQUFDO0FBQ0QsTzs7Ozs7Ozs7Ozs7Ozs7Ozs7QUNONEI7O0FBVUM7O0FBRUc7O0FBRWhDO0FBQ0E7Q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dENvbnRlbnQgPSBjb25maWcudGV4dFxuXG4gICAgaWYgKGNvbmZpZy52aXN1YWxseUhpZGRlbikge1xuICAgICAgdGhpcy52aXN1YWxseUhpZGRlbihsYWJlbClcbiAgICB9XG5cbiAgICBsYWJlbC5jbGFzc0xpc3QuYWRkKCdqZWRpLXRpdGxlJylcbiAgICBsYWJlbC5hcHBlbmRDaGlsZChpY29uKVxuICAgIGxhYmVsLmFwcGVuZENoaWxkKGxhYmVsVGV4dClcblxuICAgIHJldHVybiB7IGxhYmVsLCBsYWJlbFRleHQsIGljb24gfVxuICB9XG5cbiAgLyoqXG4gICAqIFJldHVybnMgYSBpY29uIGVsZW1lbnRcbiAgICogQHByaXZhdGVcbiAgICovXG4gIGdldEljb24gKGNsYXNzZXMgPSAnJykge1xuICAgIGNvbnN0IGljb24gPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50KCdpJylcbiAgICBsZXQgaWNvbkNsYXNzZXMgPSBjbGFzc2VzLnNwbGl0KCcgJylcbiAgICBpY29uQ2xhc3NlcyA9IGljb25DbGFzc2VzLmZpbHRlcigoY2xhc3NOYW1lKSA9PiBjbGFzc05hbWUubGVuZ3RoID4gMClcblxuICAgIGlmIChpY29uQ2xhc3Nlcykge1xuICAgICAgaWNvbkNsYXNzZXMuZm9yRWFjaCgoY2xhc3NOYW1lKSA9PiB7XG4gICAgICAgIGljb24uY2xhc3NMaXN0LmFkZChjbGFzc05hbWUpXG4gICAgICB9KVxuICAgIH1cblxuICAgIHJldHVybiBpY29uXG4gIH1cblxuICAvKipcbiAgICogQ29udGFpbmVyIGZvciBjb21wbGV4IGVkaXRvcnMgbGlrZSBhcnJheXMsIG9iamVjdHMgYW5kIG11bHRpcGxlXG4gICAqIEBwcml2YXRlXG4gICAqL1xuICBnZXRDYXJkICgpIHtcbiAgICBjb25zdCBodG1sID0gZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgnZGl2JylcbiAgICBodG1sLmNsYXNzTGlzdC5hZGQoJ2plZGktZW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G4gICAgICBjb25zdCBjb250YWluc0VkaXRvciA9IG5ldyBKZWRpKHsgcmVmUGFyc2VyOiB2YWxpZGF0b3IucmVmUGFyc2VyLCBzY2hlbWE6IGNvbnRhaW5zLCBkYXRhOiBpdGVtIH0pXG4gICAgICBjb25zdCBjb250YWluc0Vycm9ycyA9IGNvbnRhaW5zRWRpdG9yLmdldEVycm9ycygpXG5cbiAgICAgIGlmIChjb250YWluc0Vycm9ycy5sZW5ndGggPT09IDApIHtcbiAgICAgICAgY291bnRlcisrXG4gICAgICB9XG5cbiAgICAgIGNvbnRhaW5zRWRpdG9yLmRlc3Ryb3koKVxuICAgIH0pXG5cbiAgICBjb25zdCBjb250YWluc0ludmFsaWQgPSAoY291bnRlciA9PT0gMClcblxuICAgIGlmIChpc1NldChtaW5Db250YWlucykpIHtcbiAgICAgIGNvbnN0IG1pbkNvbnRhaW5zSW52YWxpZCA9IChjb3VudGVyIDwgbWluQ29udGFpbnMpXG5cbiAgICAgIGlmIChtaW5Db250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbXG4gICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvck1pbkNvbnRhaW5zLCB7XG4gICAgICAgICAgICAgIGNvdW50ZXI6IGNvdW50ZXIsXG4gICAgICAgICAgICAgIG1pbkNvbnRhaW5zOiBtaW5Db250YWluc1xuICAgICAgICAgICAgfSlcbiAgICAgICAgICBdLFxuICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgY29uc3RyYWluOiAnbWluQ29udGFpbnMnXG4gICAgICAgIH0pXG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGlmIChjb250YWluc0ludmFsaWQpIHtcbiAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgIG1lc3NhZ2VzOiBbaTE4bi5lcnJvckNvbnRhaW5zXSxcbiAgICAgICAgICBwYXRoOiBwYX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JlbCA9IGlzU2V0KHNjaGVtYVRpdGxlKSA/IHNjaGVtYVRpdGxlIDogcHJvcGVydHlcblxuICAgICAgICBpZiAobm90UmVxdWlyZWQgJiYgIWFjdGl2YXRvckluRG9tKSB7XG4gICAgICAgICAgY29uc3QgY2hlY2tib3hDb250cm9sID0gdGhpcy50aGVtZS5nZXRDaGVja2JveENvbnRyb2woe1xuICAgICAgICAgICAgaWQ6IGlkLFxuICAgICAgICAgICAgbGFiZWw6IGxhYmVsLFxuICAgICAgICAgICAgdGl0bGVIaWRkZW46IGZhbHNlXG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGNvbnN0IGNoZWNrYm94ID0gY2hlY2tib3hDb250cm9sLmlucHV0XG4gICAgICAgICAgdGhpcy5wcm9wZXJ0eUFjdGl2YXRvcnNbcHJvcGVydHldID0gY2hlY2tib3hcblxuICAgICAgICAgIGNoZWNrYm94LmFkZEV2ZW50TGlzdGVuZXIoJ2NoYW5nZScsICgpID0+IHtcbiAgICAgICAgICAgIGFyaWFMaXZlLmlubmVySFRNTCA9ICcnXG4gICAgICAgICAgICBjb25zdCBhcmlhTGl2ZU1lc3NhZ2UgPSB0aGlzLnRoZW1lLmdldEFyaWFMaXZlTWVzc2FnZSgpXG5cbiAgICAgICAgICAgIGlmIChjaGVja2JveC5jaGVja2VkKSB7XG4gICAgICAgICAgICAgIGNvbnN0IGNoaWxkID0gdGhpcy5pbnN0YW5jZS5nZXRDaGlsZChwcm9wZXJ0eSlcblxuICAgICAgICAgICAgICBpZiAoIWNoaWxkKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5pbnN0YW5jZS5jcmVhdGVDaGlsZChzY2hlbWEsIHByb3BlcnR5KVxuICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgdGhpcy5pbnN0YW5jZS5nZXRDaGlsZChwcm9wZXJ0eSkuYWN0aXZhdGUoKVxuICAgICAgICAgICAgICBhcmlhTGl2ZU1lc3NhZ2UudGV4dENvbnRlbnQgPSBsYW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G4gICAgICAgIHJldHVybiByZWdleHAudGVzdChwcm9wZXJ0eSlcbiAgICAgIH0pXG5cbiAgICAgIGNvbnN0IGlzRGVmaW5lZEluUHJvcGVydGllcyA9IGhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSlcblxuICAgICAgaWYgKCFkZWZpbmVkSW5QYXR0ZXJuUHJvcGVydHkgJiYgIWlzRGVmaW5lZEluUHJvcGVydGllcykge1xuICAgICAgICBpZiAoYWRkaXRpb25hbFByb3BlcnRpZXMgPT09IGZhbHNlKSB7XG4gICAgICAgICAgZXJyb3JzLnB1c2goe1xuICAgICAgICAgICAgbWVzc2FnZXM6IFtcbiAgICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JBZGRpdGlvbmFsUHJvcGVydGllcywgeyBwcm9wZXJ0eSB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICdhZGRpdGlvbmFsUHJvcGVydGllcydcbiAgICAgICAgICB9KVxuICAgICAgICB9IGVsc2UgaWYgKGlzT2JqZWN0KGFkZGl0aW9uYWxQcm9wZXJ0aWVzKSkge1xuICAgICAgICAgIGNvbnN0IGVkaXRvciA9IG5ldyBKZWRpKHtcbiAgICAgICAgICAgIHJlZlBhcnNlcjogdmFsaWRhdG9yLnJlZlBhcnNlcixcbiAgICAgICAgICAgIHNjaGVtYTogYWRkaXRpb25hbFByb3BlcnRpZXMsXG4gICAgICAgICAgICBkYXRhOiB2YWx1ZVtwcm9wZXJ0eV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgYWRkaXRpb25hbFByb3BlcnR5RXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+ICh7XG4gICAgICAgICAgICBtZXNzYWdlczogZXJyb3IubWVzc2FnZXMsXG4gICAgICAgICAgICBwYXRoOiBgJHtwYXRofS4ke3Byb3BlcnR5fWAsXG4g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bnNFcnJvcnMubGVuZ3RoID09PSAwKSB7XG4gICAgICAgIGNvdW50ZXIrK1xuICAgICAgfVxuXG4gICAgICBjb250YWluc0VkaXRvci5kZXN0cm95KClcbiAgICB9KVxuXG4gICAgY29uc3QgY29udGFpbnNJbnZhbGlkID0gKGNvdW50ZXIgPT09IDApXG5cbiAgICBpZiAoaXNTZXQobWluQ29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtaW5Db250YWluc0ludmFsaWQgPSAoY291bnRlciA8IG1pbkNvbnRhaW5zKVxuXG4gICAgICBpZiAobWluQ29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgY29tcGlsZVRlbXBsYXRlKGkxOG4uZXJyb3JNaW5Db250YWlucywge1xuICAgICAgICAgICAgICBjb3VudGVyOiBjb3VudGVyLFxuICAgICAgICAgICAgICBtaW5Db250YWluczogbWluQ29udGFpbnNcbiAgICAgICAgICAgIH0pXG4gICAgICAgICAgXSxcbiAgICAgICAgICBwYXRoOiBwYXRoLFxuICAgICAgICAgIGNvbnN0cmFpbjogJ21pbkNvbnRhaW5zJ1xuICAgICAgICB9KVxuICAgICAgfVxuICAgIH0gZWxzZSB7XG4gICAgICBpZiAoY29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIGVycm9ycy5wdXNoKHtcbiAgICAgICAgICBtZXNzYWdlczogW2kxOG4uZXJyb3JDb250YWluc10sXG4gICAgICAgICAgcGF0aDogcGF0aCxcbiAgICAgICAgICBjb25zdHJhaW46ICdjb250YWlucydcbiAgICAgICAgfSlcbiAgICAgIH1cbiAgICB9XG5cbiAgICBpZiAoaXNTZXQobWF4Q29udGFpbnMpKSB7XG4gICAgICBjb25zdCBtYXhDb250YWluc0ludmFsaWQgPSAoY291bnRlciA+IG1heENvbnRhaW5zKVxuXG4gICAgICBpZiAobWF4Q29udGFpbnNJbnZhbGlkKSB7XG4gICAgICAgIG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GVyblByb3BlcnRpZXMoc2NoZW1hKVxuXG4gIGlmIChpc09iamVjdCh2YWx1ZSkgJiYgaXNTZXQocGF0dGVyblByb3BlcnRpZXMpKSB7XG4gICAgT2JqZWN0LmtleXModmFsdWUpLmZvckVhY2goKHByb3BlcnR5TmFtZSkgPT4ge1xuICAgICAgT2JqZWN0LmtleXMocGF0dGVyblByb3BlcnRpZXMpLmZvckVhY2goKHBhdHRlcm4pID0+IHtcbiAgICAgICAgY29uc3QgcmVnZXhwID0gbmV3IFJlZ0V4cChwYXR0ZXJuKVxuICAgICAgICBpZiAocmVnZXhwLnRlc3QocHJvcGVydHlOYW1lKSkge1xuICAgICAgICAgIGNvbnN0IHNjaGVtYSA9IHBhdHRlcm5Qcm9wZXJ0aWVzW3BhdHRlcm5dXG5cbiAgICAgICAgICBjb25zdCBlZGl0b3IgPSBuZXcgSmVkaSh7XG4gICAgICAgICAgICByZWZQYXJzZXI6IHZhbGlkYXRvci5yZWZQYXJzZXIsXG4gICAgICAgICAgICBzY2hlbWE6IHNjaGVtYSxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5TmFtZV1cbiAgICAgICAgICB9KVxuXG4gICAgICAgICAgY29uc3QgZWRpdG9yRXJyb3JzID0gZWRpdG9yLmdldEVycm9ycygpLm1hcCgoZXJyb3IpID0+IHtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgIG1lc3NhZ2VzOiBlcnJvci5tZXNzYWdlcyxcbiAgICAgICAgICAgICAgcGF0aDogcGF0aCArICcvJyArIHByb3BlcnR5TmFtZSxcbiAgICAgICAgICAgICAgY29uc3RyYWluOiAncGF0dGVyblByb3BlcnRpZXMnXG4gICAgICAgICAgICB9XG4gICAgICAgICAgfSlcblxuICAgICAgICAgIGVycm9ycyA9IFsuLi5lcnJvcnMsIC4uLmVkaXRvckVycm9yc11cblxuICAgICAgICAgIGVkaXRvci5kZXN0cm95KClcbiAgICAgICAgfVxuICAgICAgfSlcb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wcm9wZXJ0eSkpIHtcbiAgICAgICAgICBlcnJvcnMucHVzaCh7XG4gICAgICAgICAgICBtZXNzYWdlczogW1xuICAgICAgICAgICAgICBjb21waWxlVGVtcGxhdGUoaTE4bi5lcnJvclVuZXZhbHVhdGVkUHJvcGVydGllcywge1xuICAgICAgICAgICAgICAgIHByb3BlcnR5OiBwcm9wZXJ0eVxuICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgXSxcbiAgICAgICAgICAgIHBhdGg6IHBhdGgsXG4gICAgICAgICAgICBjb25zdHJhaW46ICd1bmV2YWx1YXRlZFByb3BlcnRpZXMnXG4gICAgICAgICAgfSlcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZGVmaW5lZEluUGF0dGVyblByb3BlcnR5ICYmIGlzT2JqZWN0KHVuZXZhbHVhdGVkUHJvcGVydGllcykgJiYgIWhhc093bihwcm9wZXJ0aWVzLCBwcm9wZXJ0eSkpIHtcbiAgICAgICAgICBjb25zdCBlZGl0b3IgPSBuZXcgSmVkaSh7XG4gICAgICAgICAgICByZWZQYXJzZXI6IHZhbGlkYXRvci5yZWZQYXJzZXIsXG4gICAgICAgICAgICBzY2hlbWE6IHVuZXZhbHVhdGVkUHJvcGVydGllcyxcbiAgICAgICAgICAgIGRhdGE6IHZhbHVlW3Byb3BlcnR5XVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICBjb25zdCB1bmV2YWx1YXRlZFByb3BlcnRpZXNFcnJvcnMgPSBlZGl0b3IuZ2V0RXJyb3JzKCkubWFwKChlcnJvcikgPT4ge1xuICAgICAgICAgICAgcmV0dXJuIHtcbiAgICAgICAgICAgICAgbWVzc2FnZXM6IGVycm9yLm1lc3NhZ2VzLFxuICAgICAgICAgICAgICBwYXRoOiBwcm9wZXJ0eSxcbiAgICAgICAgICAgICAgY29uc3RyYWluOiAndW5ldmFsdWF0ZWRQcm9wZXJ0aWVzJ1xuICAgICAgICAgICAgfVxuICAgICAgICAgIH0pXG5cbiAgICAgICAgICB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dG9yU3RyaW5nRW51bVJhZGlvLFxuICBFZGl0b3JTdHJpbmdFbnVtU2VsZWN0LFxuICBFZGl0b3JTdHJpbmdUZXh0YXJlYSxcbiAgRWRpdG9yU3RyaW5nQXdlc29tcGxldGUsXG4gIEVkaXRvclN0cmluZ0lucHV0LFxuICBFZGl0b3JOdW1iZXIsXG4gIEVkaXRvck51bWJlckVudW1SYWRpbyxcbiAgRWRpdG9yTnVtYmVyRW51bVNlbGVjdCxcbiAgRWRpdG9yTnVtYmVySW5wdXQsXG4gIEVkaXRvck9iamVjdEdyaWQsXG4gIEVkaXRvck9iamVjdE5hdixcbiAgRWRpdG9yT2JqZWN0LFxuICBFZGl0b3JBcnJheU5hdixcbiAgRWRpdG9yQXJyYXksXG4gIEVkaXRvck11bHRpcGxlLFxuICBFZGl0b3JJZlRoZW5FbHNlLFxuICBFZGl0b3JOdWxsLFxuICBUaGVtZSxcbiAgVGhlbWVCb290c3RyYXAzLFxuICBUaGVtZUJvb3RzdHJhcDQsXG4gIFRoZW1lQm9vdHN0cmFwNSxcbiAgUmVmUGFyc2VyLFxuICBDcmVhdGVcbn1cbiJdLCJuYW1lcyI6W10sInNvdXJjZVJvb3QiOiIifQ== \ No newline at end of file diff --git a/docs/json/editors/object-propertyOrder.json b/docs/json/editors/object-propertyOrder.json new file mode 100644 index 0000000..50225b3 --- /dev/null +++ b/docs/json/editors/object-propertyOrder.json @@ -0,0 +1,23 @@ +{ + "type": "object", + "properties": { + "a": { + "type": "string", + "x-options": { + "propertyOrder": 3 + } + }, + "b": { + "type": "string", + "x-options": { + "propertyOrder": 2 + } + }, + "c": { + "type": "string", + "x-options": { + "propertyOrder": 1 + } + } + } +} \ No newline at end of file diff --git a/src/editors/object.js b/src/editors/object.js index 27aa161..2fb5a09 100644 --- a/src/editors/object.js +++ b/src/editors/object.js @@ -1,7 +1,7 @@ import Editor from './editor.js' import { equal, - hasOwn, + hasOwn, isNumber, isObject, isSet, pathToAttribute @@ -173,6 +173,40 @@ class EditorObject extends Editor { } } + /** + * Sorts the children of the current instance based on their `propertyOrder` value in ascending order. + * The sorting is done using the `propertyOrder` obtained from each child's schema, which should be a number. + * If a child does not have a valid `propertyOrder` (i.e., the value is not a number), it will be placed after the child with a valid `propertyOrder`. + * @returns {void} This function modifies the `children` array of the instance in place. + */ + sortChildrenByPropertyOrder () { + this.instance.children = this.instance.children.sort((a, b) => { + const propertyOrderA = getSchemaXOption(a.schema, 'propertyOrder') + const propertyOrderB = getSchemaXOption(b.schema, 'propertyOrder') + + const isValidNumberA = isNumber(propertyOrderA) + const isValidNumberB = isNumber(propertyOrderB) + + if (!isValidNumberA && isValidNumberB) { + return 1 + } + + if (isValidNumberA && !isValidNumberB) { + return -1 + } + + if (propertyOrderA < propertyOrderB) { + return -1 + } + + if (propertyOrderA > propertyOrderB) { + return 1 + } + + return 0 + }) + } + refreshEditors () { this.instance.children.forEach((child) => { if (child.isActive) { @@ -194,6 +228,7 @@ class EditorObject extends Editor { } refreshUI () { + this.sortChildrenByPropertyOrder() this.refreshInteractiveElements() this.refreshPropertiesSlot() this.refreshEditors() diff --git a/tests/e2e/codecept.conf.cjs b/tests/e2e/codecept.conf.cjs index dd5c533..7f44d29 100644 --- a/tests/e2e/codecept.conf.cjs +++ b/tests/e2e/codecept.conf.cjs @@ -14,6 +14,9 @@ exports.config = { waitForTimeout: 10000, windowSize: '1200x600', restart: false + }, + ChaiWrapper: { + require: 'codeceptjs-chai' } } } diff --git a/tests/e2e/tests/editors/object-propertyOrder_test.cjs b/tests/e2e/tests/editors/object-propertyOrder_test.cjs new file mode 100644 index 0000000..722f11a --- /dev/null +++ b/tests/e2e/tests/editors/object-propertyOrder_test.cjs @@ -0,0 +1,19 @@ +/* global Feature Scenario */ +const theme = process.env.THEME || 'barebones' + +Feature('object') + +Scenario('@editor-object should sort by @propertyOrder', async ({ I }) => { + I.amOnPage(`playground.html?theme=${theme}`) + I.selectOption('#examples', '../json/editors/object-propertyOrder.json') + I._waitForElement('.jedi-ready') + + const labelTexts = await I.executeScript(() => { + const labels = document.querySelectorAll('.jedi-children-slot label') + return Array.from(labels).map(label => label.textContent.trim()) + }) + + I.assertEqual(labelTexts[0], 'c') + I.assertEqual(labelTexts[1], 'b') + I.assertEqual(labelTexts[2], 'a') +}) \ No newline at end of file diff --git a/todo.md b/todo.md index 09a50bc..addf74c 100644 --- a/todo.md +++ b/todo.md @@ -1,11 +1,7 @@ ## Todo -- editor tests @setValue should proof for changes in ui too when possible -- options tests with @option tag - inputAttributes option, containerAttributes, ... - printable -- propertyOrder option -- showValidationErrors - enforceConst documentation and test - readOnly test - complementary schema (for ui stuff)