let components = { //'x-html', //'x-object-editor', //'x-code-editor', //'x-complex-example': { path: 'components/x-complex-example.vue' }, //'x-grid': { path: 'components/x-grid.vue' }, 'x-button': { path: 'components/x-button.vue' }, 'x-container': { path: 'components/x-container.vue' }, 'x-logic': { path: 'components/x-logic.vue' }, 'x-logic-capture': { path: 'components/x-logic-capture.vue' }, 'x-logic-code': { path: 'components/x-logic-code.vue' }, 'x-logic-empty': { path: 'components/x-logic-empty.vue' }, 'x-logic-sql-table-select': { path: 'components/x-logic-sql-table-select.vue' }, 'x-input': { path: 'components/x-input.vue' }, 'x-table': { path: 'components/x-table.vue' }, 'x-qrcode': { path: 'components/x-qrcode.vue' }, 'x-status': { path: 'components/x-status.vue' }, 'x-progress-circular': { path: 'components/x-progress-circular.vue' }, 'x-progress-linear': { path: 'components/x-progress-linear.vue' }, 'x-select': { path: 'components/x-select.vue' }, 'x-page': { path: 'components/x-page.vue' }, 'x-file': { path: 'components/x-file.vue' }, 'x-text': { path: 'components/x-text.vue' }, 'x-chart': { path: 'components/x-chart.vue' }, 'x-card': { path: 'components/x-card.vue' }, 'x-tabs': { path: 'components/x-tabs.vue' }, 'x-image': { path: 'components/x-image.vue' }, 'x-calendar': { path: 'components/x-calendar.vue' }, 'x-accordion': { path: 'components/x-accordion.vue' }, 'x-iframe': { path: 'components/x-iframe.vue' }, 'x-codescanner': { path: 'components/x-codescanner.vue' }, 'x-otp': { path: 'components/x-otp.vue' }, 'x-avatar': { path: 'components/x-avatar.vue' }, 'x-chat': { path: 'components/x-chat.vue' }, 'x-chat-internal': { path: 'components/x-chat-internal.vue' }, 'x-stepper': { path: 'components/x-stepper.vue' }, 'x-canvas-paint': { path: 'components/x-canvas-paint.vue' }, 'x-threejs': { path: 'components/x-threejs.vue' }, 'x-nfc': {path: 'components/x-nfc.vue'}, } //TODO: move function to another file function optionsSanityCheck(value, options, item_value = null, multiple = false, invalidValue = {}) { let getValue = (x) => item_value ? x[item_value] : x if (multiple) { for (let i = 0; i < value.length; i++) { let hit = options.find(x => getValue(x) == value[i]) if (!hit) { if (invalidValue) { invalidValue.invalid.push(value[i]) } value.splice(i, 1) i-- } } } else { let hit = options.find(x => getValue(x) == value) if (!hit) { if (invalidValue) { invalidValue.invalid.push(value) } value = null } } return value }