@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.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/dist/dito-admin.common.js +1193 -968
  3. package/dist/dito-admin.common.js.map +1 -1
  4. package/dist/dito-admin.umd.js +1193 -968
  5. package/dist/dito-admin.umd.js.map +1 -1
  6. package/dist/dito-admin.umd.min.js +3 -3
  7. package/dist/dito-admin.umd.min.js.map +1 -1
  8. package/package.json +13 -13
  9. package/src/DitoAdmin.js +3 -2
  10. package/src/components/DitoAccount.vue +4 -3
  11. package/src/components/DitoButtons.vue +4 -6
  12. package/src/components/DitoClipboard.vue +20 -9
  13. package/src/components/{DitoComponentContainer.vue → DitoContainer.vue} +4 -8
  14. package/src/components/DitoForm.vue +30 -16
  15. package/src/components/DitoLabel.vue +2 -2
  16. package/src/components/{DitoComponents.vue → DitoPane.vue} +18 -28
  17. package/src/components/DitoPanel.vue +10 -5
  18. package/src/components/DitoPanels.vue +4 -2
  19. package/src/components/DitoSchema.vue +59 -51
  20. package/src/components/DitoSchemaInlined.vue +1 -1
  21. package/src/components/index.js +5 -6
  22. package/src/mixins/DitoMixin.js +13 -4
  23. package/src/mixins/ResourceMixin.js +6 -1
  24. package/src/mixins/RouteMixin.js +1 -1
  25. package/src/mixins/SchemaParentMixin.js +6 -0
  26. package/src/mixins/SourceMixin.js +63 -33
  27. package/src/mixins/TypeMixin.js +32 -17
  28. package/src/mixins/ValidatorMixin.js +0 -4
  29. package/src/styles/_button.sass +1 -1
  30. package/src/types/TypeButton.vue +12 -11
  31. package/src/types/TypeCode.vue +1 -1
  32. package/src/types/TypeMarkup.vue +1 -1
  33. package/src/types/TypeMultiselect.vue +11 -10
  34. package/src/types/TypeSection.vue +1 -1
  35. package/src/types/TypeTreeList.vue +1 -3
  36. package/src/types/TypeUpload.vue +1 -1
  37. package/src/utils/accessor.js +2 -0
  38. package/src/utils/schema.js +17 -7
  39. package/src/components/DitoButtonContainer.vue +0 -22
@@ -491,7 +491,7 @@ export default TypeComponent.register('markup', {
491
491
  return list
492
492
  },
493
493
 
494
- focus() {
494
+ focusElement() {
495
495
  this.$el.scrollIntoView?.()
496
496
  this.editor.focus()
497
497
  }
@@ -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
- focus() {
338
+ focusElement() {
338
339
  this.$refs.element.activate()
339
340
  },
340
341
 
@@ -2,7 +2,7 @@
2
2
  .dito-section(
3
3
  :class="{ 'dito-section-labelled' : !!schema.label }"
4
4
  )
5
- dito-components.dito-section-components(
5
+ dito-pane.dito-section-pane(
6
6
  :schema="getItemFormSchema(schema, item, context)"
7
7
  :dataPath="dataPath"
8
8
  :data="item"
@@ -52,9 +52,7 @@ export default TypeComponent.register([
52
52
  mixins: [SourceMixin],
53
53
 
54
54
  provide() {
55
- return {
56
- container: this
57
- }
55
+ return { container: this }
58
56
  },
59
57
 
60
58
  getSourceType(type) {
@@ -233,7 +233,7 @@ export default TypeComponent.register('upload', {
233
233
  this.notify({
234
234
  type: 'info',
235
235
  title: 'Successfully Removed',
236
- text: `${name} was ${this.verbs.removed}.`
236
+ text: `${name} was ${this.verbs.deleted}.`
237
237
  })
238
238
  }
239
239
  },
@@ -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:
@@ -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(schema, appendDataPath(dataPath, key))
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(schema, dataPath, schemaComponent = null) {
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>