@ditojs/admin 0.265.0 → 0.269.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/dito-admin.common.js +1193 -968
- package/dist/dito-admin.common.js.map +1 -1
- package/dist/dito-admin.umd.js +1193 -968
- package/dist/dito-admin.umd.js.map +1 -1
- package/dist/dito-admin.umd.min.js +3 -3
- package/dist/dito-admin.umd.min.js.map +1 -1
- package/package.json +13 -13
- package/src/DitoAdmin.js +3 -2
- package/src/components/DitoAccount.vue +4 -3
- package/src/components/DitoButtons.vue +4 -6
- package/src/components/DitoClipboard.vue +20 -9
- package/src/components/{DitoComponentContainer.vue → DitoContainer.vue} +4 -8
- package/src/components/DitoForm.vue +30 -16
- package/src/components/DitoLabel.vue +2 -2
- package/src/components/{DitoComponents.vue → DitoPane.vue} +18 -28
- package/src/components/DitoPanel.vue +10 -5
- package/src/components/DitoPanels.vue +4 -2
- package/src/components/DitoSchema.vue +59 -51
- package/src/components/DitoSchemaInlined.vue +1 -1
- package/src/components/index.js +5 -6
- package/src/mixins/DitoMixin.js +13 -4
- package/src/mixins/ResourceMixin.js +6 -1
- package/src/mixins/RouteMixin.js +1 -1
- package/src/mixins/SchemaParentMixin.js +6 -0
- package/src/mixins/SourceMixin.js +63 -33
- package/src/mixins/TypeMixin.js +32 -17
- package/src/mixins/ValidatorMixin.js +0 -4
- package/src/styles/_button.sass +1 -1
- package/src/types/TypeButton.vue +12 -11
- package/src/types/TypeCode.vue +1 -1
- package/src/types/TypeMarkup.vue +1 -1
- package/src/types/TypeMultiselect.vue +11 -10
- package/src/types/TypeSection.vue +1 -1
- package/src/types/TypeTreeList.vue +1 -3
- package/src/types/TypeUpload.vue +1 -1
- package/src/utils/accessor.js +2 -0
- package/src/utils/schema.js +17 -7
- package/src/components/DitoButtonContainer.vue +0 -22
package/src/types/TypeMarkup.vue
CHANGED
|
@@ -290,15 +290,6 @@ export default TypeComponent.register('multiselect', {
|
|
|
290
290
|
default: false
|
|
291
291
|
}),
|
|
292
292
|
|
|
293
|
-
listeners() {
|
|
294
|
-
// override TypeMixin's listeners to re-route input to onChange()
|
|
295
|
-
return {
|
|
296
|
-
focus: this.onFocus,
|
|
297
|
-
blur: this.onBlur,
|
|
298
|
-
input: this.onChange
|
|
299
|
-
}
|
|
300
|
-
},
|
|
301
|
-
|
|
302
293
|
placeholder() {
|
|
303
294
|
const { placeholder, searchable, taggable } = this.schema
|
|
304
295
|
return placeholder || (
|
|
@@ -318,6 +309,16 @@ export default TypeComponent.register('multiselect', {
|
|
|
318
309
|
},
|
|
319
310
|
|
|
320
311
|
methods: {
|
|
312
|
+
// @override
|
|
313
|
+
getListeners() {
|
|
314
|
+
// override `TypeMixin.getListeners()` to re-route 'input' to `onChange()`
|
|
315
|
+
return {
|
|
316
|
+
focus: this.onFocus,
|
|
317
|
+
blur: this.onBlur,
|
|
318
|
+
input: this.onChange
|
|
319
|
+
}
|
|
320
|
+
},
|
|
321
|
+
|
|
321
322
|
addTagOption(tag) {
|
|
322
323
|
if (this.taggable) {
|
|
323
324
|
const { optionLabel, optionValue } = this
|
|
@@ -334,7 +335,7 @@ export default TypeComponent.register('multiselect', {
|
|
|
334
335
|
}
|
|
335
336
|
},
|
|
336
337
|
|
|
337
|
-
|
|
338
|
+
focusElement() {
|
|
338
339
|
this.$refs.element.activate()
|
|
339
340
|
},
|
|
340
341
|
|
package/src/types/TypeUpload.vue
CHANGED
package/src/utils/accessor.js
CHANGED
|
@@ -48,6 +48,8 @@ export function getStoreAccessor(name, { default: def, get, set } = {}) {
|
|
|
48
48
|
value = isFunction(def) ? def.call(this, this.context) : def
|
|
49
49
|
// Trigger setter by setting value and accessor to default:
|
|
50
50
|
this[name] = value
|
|
51
|
+
// Now access store again, for reactivity tracking
|
|
52
|
+
this.getStore(name)
|
|
51
53
|
}
|
|
52
54
|
// Allow the provided getter to further change or process the value
|
|
53
55
|
// retrieved from the store:
|
package/src/utils/schema.js
CHANGED
|
@@ -653,7 +653,7 @@ export function getSourceType(schemaOrType) {
|
|
|
653
653
|
) ?? null
|
|
654
654
|
}
|
|
655
655
|
|
|
656
|
-
export function getPanelSchema(schema, dataPath) {
|
|
656
|
+
export function getPanelSchema(schema, dataPath, tabComponent) {
|
|
657
657
|
return schema
|
|
658
658
|
? {
|
|
659
659
|
schema,
|
|
@@ -661,15 +661,20 @@ export function getPanelSchema(schema, dataPath) {
|
|
|
661
661
|
// This is used e.g. for $filters panels.
|
|
662
662
|
dataPath: schema.name
|
|
663
663
|
? appendDataPath(dataPath, schema.name)
|
|
664
|
-
: dataPath
|
|
664
|
+
: dataPath,
|
|
665
|
+
tabComponent
|
|
665
666
|
}
|
|
666
667
|
: null
|
|
667
668
|
}
|
|
668
669
|
|
|
669
|
-
export function getPanelSchemas(schemas, dataPath, panels = []) {
|
|
670
|
+
export function getPanelSchemas(schemas, dataPath, tabComponent, panels = []) {
|
|
670
671
|
if (schemas) {
|
|
671
672
|
for (const [key, schema] of Object.entries(schemas)) {
|
|
672
|
-
const panel = getPanelSchema(
|
|
673
|
+
const panel = getPanelSchema(
|
|
674
|
+
schema,
|
|
675
|
+
appendDataPath(dataPath, key),
|
|
676
|
+
tabComponent
|
|
677
|
+
)
|
|
673
678
|
if (panel) {
|
|
674
679
|
panels.push(panel)
|
|
675
680
|
}
|
|
@@ -678,16 +683,21 @@ export function getPanelSchemas(schemas, dataPath, panels = []) {
|
|
|
678
683
|
return panels
|
|
679
684
|
}
|
|
680
685
|
|
|
681
|
-
export function getAllPanelSchemas(
|
|
686
|
+
export function getAllPanelSchemas(
|
|
687
|
+
schema,
|
|
688
|
+
dataPath,
|
|
689
|
+
schemaComponent = null,
|
|
690
|
+
tabComponent = null
|
|
691
|
+
) {
|
|
682
692
|
const panel = getTypeOptions(schema)?.getPanelSchema?.(
|
|
683
693
|
schema,
|
|
684
694
|
dataPath,
|
|
685
695
|
schemaComponent
|
|
686
696
|
)
|
|
687
|
-
const panels = panel ? [getPanelSchema(panel, dataPath)] : []
|
|
697
|
+
const panels = panel ? [getPanelSchema(panel, dataPath, tabComponent)] : []
|
|
688
698
|
// Allow each component to provide its own set of panels, in
|
|
689
699
|
// addition to the default one (e.g. $filter):
|
|
690
|
-
getPanelSchemas(schema.panels, dataPath, panels)
|
|
700
|
+
getPanelSchemas(schema.panels, dataPath, tabComponent, panels)
|
|
691
701
|
return panels
|
|
692
702
|
}
|
|
693
703
|
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
import DitoComponentContainer from './DitoComponentContainer'
|
|
3
|
-
|
|
4
|
-
// NOTE: DitoButtonContainer extends DitoComponentContainer and changes the
|
|
5
|
-
// behavior of computed properties for use with buttons.
|
|
6
|
-
// @vue/component
|
|
7
|
-
export default DitoComponentContainer.component('dito-button-container', {
|
|
8
|
-
computed: {
|
|
9
|
-
width() {
|
|
10
|
-
// Override DitoComponentContainer's width() to never use a default width:
|
|
11
|
-
return this.schema.width
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
containerStyle() {
|
|
15
|
-
// Remove 'flex-grow' from DitoComponentContainer's containerStyle()
|
|
16
|
-
return {
|
|
17
|
-
'flex-basis': this.percentage && `${this.percentage}%`
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
</script>
|