@koumoul/vjsf 3.20.7 → 3.20.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koumoul/vjsf",
3
- "version": "3.20.7",
3
+ "version": "3.20.8",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "scripts": {
6
6
  "test-tz1": "TZ=Europe/Paris vitest run",
@@ -5,6 +5,7 @@
5
5
  :class="`vjsf-help-message-tooltip vjsf-help-message-tooltip-${node.options.density}`"
6
6
  location="top end"
7
7
  offset="4"
8
+ :z-index="zIndex"
8
9
  :close-on-content-click="false"
9
10
  >
10
11
  <template #activator="{ props }">
@@ -42,8 +43,9 @@ import { VAlert } from 'vuetify/components/VAlert'
42
43
  import { VMenu } from 'vuetify/components/VMenu'
43
44
  import { VBtn } from 'vuetify/components/VBtn'
44
45
  import { ref } from 'vue'
46
+ import useZIndexStack from '../../composables/use-z-index-stack.js'
45
47
 
46
- defineProps({
48
+ const props = defineProps({
47
49
  node: {
48
50
  /** @type import('vue').PropType<import('../../types.js').VjsfNode> */
49
51
  type: Object,
@@ -51,6 +53,8 @@ defineProps({
51
53
  }
52
54
  })
53
55
 
56
+ const zIndex = useZIndexStack(props.node.fullKey)
57
+
54
58
  const show = ref(false)
55
59
  </script>
56
60
 
@@ -55,14 +55,14 @@ const fieldProps = computed(() => {
55
55
  return fieldProps
56
56
  })
57
57
 
58
- const zIndex = useZIndexStack(() => props.modelValue.fullKey)
58
+ const zIndex = useZIndexStack(props.modelValue.fullKey)
59
59
 
60
60
  const menuProps = computed(() => {
61
61
  return {
62
62
  ...compProps.value,
63
63
  minWidth: props.minWidth,
64
64
  maxWidth: props.maxWidth,
65
- zIndex: zIndex.value,
65
+ zIndex,
66
66
  closeOnContentClick: false,
67
67
  disabled: true
68
68
  }
@@ -25,7 +25,7 @@ export default defineComponent({
25
25
  const nodeRef = toRef(props, 'modelValue')
26
26
  const getItems = useGetItems(nodeRef, props.statefulLayout)
27
27
  const { inputProps, compSlots, localData, layout, options } = useNode(nodeRef, props.statefulLayout)
28
- const zIndex = useZIndexStack(() => props.modelValue.fullKey)
28
+ const zIndex = useZIndexStack(props.modelValue.fullKey)
29
29
 
30
30
  const fieldProps = computed(() => {
31
31
  const fieldProps = { ...inputProps.value }
@@ -33,7 +33,7 @@ export default defineComponent({
33
33
  if (options.value.readOnly) {
34
34
  fieldProps.menuProps = { modelValue: false }
35
35
  } else {
36
- fieldProps.menuProps = { zIndex: zIndex.value }
36
+ fieldProps.menuProps = { zIndex }
37
37
  }
38
38
  if (getItems.hasItems.value) {
39
39
  fieldProps.items = getItems.items.value
@@ -70,7 +70,7 @@ const prepareDrag = (/** @type {number} */index) => {
70
70
  menuOpened.value = -1
71
71
  }
72
72
 
73
- const zIndex = useZIndexStack(() => props.modelValue.fullKey)
73
+ const zIndex = useZIndexStack(props.modelValue.fullKey)
74
74
 
75
75
  /* manage hovered and edited items */
76
76
  // const editedItem = computed(() => activatedItems.value[fullKey.value])
@@ -495,6 +495,7 @@ const itemBorderColor = computed(() => (/** @type {import('@json-layout/core').S
495
495
  v-if="layout.listEditMode === 'dialog'"
496
496
  :model-value="editedItem !== undefined"
497
497
  v-bind="vEditDialogProps"
498
+ :z-index="zIndex"
498
499
  >
499
500
  <v-sheet v-bind="vEditDialogVSheetProps">
500
501
  <v-toolbar
@@ -25,7 +25,7 @@ export default defineComponent({
25
25
  const nodeRef = toRef(props, 'modelValue')
26
26
  const getItems = useGetItems(nodeRef, props.statefulLayout)
27
27
  const { inputProps, compSlots, localData, layout, options } = useNode(nodeRef, props.statefulLayout, { bindData: false, layoutPropsMap: ['step', 'min', 'max'] })
28
- const zIndex = useZIndexStack(() => props.modelValue.fullKey)
28
+ const zIndex = useZIndexStack(props.modelValue.fullKey)
29
29
 
30
30
  const fieldProps = computed(() => {
31
31
  const fieldProps = { ...inputProps.value }
@@ -34,7 +34,7 @@ export default defineComponent({
34
34
  if (options.value.readOnly) {
35
35
  fieldProps.menuProps = { modelValue: false }
36
36
  } else {
37
- fieldProps.menuProps = { zIndex: zIndex.value }
37
+ fieldProps.menuProps = { zIndex }
38
38
  }
39
39
  if (getItems.hasItems.value) {
40
40
  fieldProps.items = getItems.items.value
@@ -27,7 +27,7 @@ const props = defineProps({
27
27
  const { inputProps, localData, skeleton, children } = useNode(
28
28
  toRef(props, 'modelValue'), props.statefulLayout, { bindData: false }
29
29
  )
30
- const zIndex = useZIndexStack(() => props.modelValue.fullKey)
30
+ const zIndex = useZIndexStack(props.modelValue.fullKey)
31
31
 
32
32
  /** @type import('vue').Ref<string | undefined> */
33
33
  const activeChildTree = ref(undefined)
@@ -50,7 +50,7 @@ const fieldProps = computed(() => {
50
50
  const fieldProps = { ...inputProps.value }
51
51
  fieldProps['onUpdate:modelValue'] = onChange
52
52
  if (!props.modelValue.options.readOnly) {
53
- fieldProps.menuProps = { zIndex: zIndex.value }
53
+ fieldProps.menuProps = { zIndex }
54
54
  }
55
55
  const items = []
56
56
  for (const childTreePointer of skeleton.value.childrenTrees || []) {
@@ -18,8 +18,11 @@ export default function (nodeRef, statefulLayout) {
18
18
 
19
19
  const fetchItems = async () => {
20
20
  loading.value = true
21
- items.value = await statefulLayout.getItems(nodeRef.value, search.value)
22
- loading.value = false
21
+ try {
22
+ items.value = await statefulLayout.getItems(nodeRef.value, search.value)
23
+ } finally {
24
+ loading.value = false
25
+ }
23
26
  }
24
27
 
25
28
  watch(() => nodeRef.value.itemsCacheKey, (newValue, oldValue) => {
@@ -17,7 +17,7 @@ export default function (nodeRef, statefulLayout, avatarProps, cssPrefix) {
17
17
 
18
18
  const { inputProps, options, skeleton, localData, compSlots } = useField(nodeRef, statefulLayout, { layoutPropsMap: ['multiple', 'placeholder'], bindData: false })
19
19
  const getItems = useGetItems(nodeRef, statefulLayout)
20
- const zIndex = useZIndexStack(() => nodeRef.value.fullKey)
20
+ const zIndex = useZIndexStack(nodeRef.value.fullKey)
21
21
 
22
22
  const selectProps = computed(() => {
23
23
  const props = { ...inputProps.value }
@@ -25,7 +25,7 @@ export default function (nodeRef, statefulLayout, avatarProps, cssPrefix) {
25
25
  if (options.value.readOnly) {
26
26
  props.menuProps = { modelValue: false }
27
27
  } else {
28
- props.menuProps = { zIndex: zIndex.value }
28
+ props.menuProps = { zIndex }
29
29
  }
30
30
  props.clearable = props.clearable ?? !skeleton.value.required
31
31
  props.valueComparator = (/** @type {any} */a, /** @type {any} */b) => {
@@ -1,21 +1,18 @@
1
1
  // vuetify zIndex stacking is buggy (for example https://github.com/vuetifyjs/vuetify/issues/16251)
2
2
  // we try to work around this in this composable
3
3
 
4
- import { provide, inject, computed } from 'vue'
4
+ import { provide, inject } from 'vue'
5
5
 
6
6
  const symbol = Symbol.for('vjsf:z-index-stack')
7
7
 
8
8
  /**
9
- * @param {() => string} keyGetter
9
+ * @param {string} fullKey
10
10
  */
11
- export default (keyGetter) => {
12
- return computed(() => {
13
- const fullKey = keyGetter()
14
- const currentZIndex = inject(symbol, { zIndex: 3000, fullKey })
15
- const newZIndex = currentZIndex.zIndex + 10
16
- if (fullKey.length > currentZIndex.fullKey.length) {
17
- provide(symbol, { zIndex: newZIndex, fullKey })
18
- }
19
- return newZIndex
20
- })
11
+ export default (fullKey) => {
12
+ const currentZIndex = inject(symbol, { zIndex: 3000, fullKey, initial: true })
13
+ const newZIndex = currentZIndex.zIndex + 10
14
+ if (currentZIndex.initial || fullKey.length > currentZIndex.fullKey.length) {
15
+ provide(symbol, { zIndex: newZIndex, fullKey })
16
+ }
17
+ return newZIndex
21
18
  }
@@ -21,8 +21,8 @@
21
21
  display: none;
22
22
  }
23
23
  .vjsf-node.vjsf-has-help {
24
- padding-right: 28px!important;
24
+ padding-right: 30px!important;
25
25
  }
26
26
  .vjsf-node.vjsf-density-default.vjsf-has-help {
27
- padding-right: 32px!important;
27
+ padding-right: 42px!important;
28
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"use-get-items.d.ts","sourceRoot":"","sources":["../../src/composables/use-get-items.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,kBACjD,OAAO,aAAa,EAAE,kBAAkB;;;;;wCA8BtC,GAAG,aACH,GAAG;EAiBf"}
1
+ {"version":3,"file":"use-get-items.d.ts","sourceRoot":"","sources":["../../src/composables/use-get-items.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,0CAHW,OAAO,KAAK,EAAE,GAAG,CAAC,OAAO,aAAa,EAAE,QAAQ,CAAC,kBACjD,OAAO,aAAa,EAAE,kBAAkB;;;;;wCAiCtC,GAAG,aACH,GAAG;EAiBf"}
@@ -1,3 +1,3 @@
1
- declare function _default(keyGetter: () => string): import("vue").ComputedRef<number>;
1
+ declare function _default(fullKey: string): number;
2
2
  export default _default;
3
3
  //# sourceMappingURL=use-z-index-stack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-z-index-stack.d.ts","sourceRoot":"","sources":["../../src/composables/use-z-index-stack.js"],"names":[],"mappings":"AAUe,qCAFJ,MAAM,MAAM,qCAYtB"}
1
+ {"version":3,"file":"use-z-index-stack.d.ts","sourceRoot":"","sources":["../../src/composables/use-z-index-stack.js"],"names":[],"mappings":"AAUe,mCAFJ,MAAM,UAShB"}