@koumoul/vjsf 3.25.3 → 3.25.5

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.25.3",
3
+ "version": "3.25.5",
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",
@@ -25,6 +25,8 @@ import useZIndexStack from '../../composables/use-z-index-stack.js'
25
25
 
26
26
  useDefaults({}, 'VjsfList')
27
27
  const vCardProps = useCompDefaults('VjsfList-VCard', { border: true, flat: true, tile: true })
28
+ const vListProps = useCompDefaults('VjsfList-VList', { class: 'py-0' })
29
+ const vListItemProps = useCompDefaults('VjsfList-VListItem', { variant: 'flat', class: 'pa-1' })
28
30
  const vEditDialogProps = useCompDefaults('VjsfList-Edit-VDialog', { width: 500, persistent: true })
29
31
  const vEditDialogVSheetProps = useCompDefaults('VjsfList-Edit-VDialog-VSheet', {})
30
32
  const vEditMenuProps = useCompDefaults('VjsfList-Edit-VMenu', { width: 500 })
@@ -233,7 +235,7 @@ const toggleDialog = (/** @type {boolean} */value) => {
233
235
  v-bind="vCardProps"
234
236
  :loading="modelValue.loading"
235
237
  >
236
- <v-list class="py-0">
238
+ <v-list v-bind="vListProps">
237
239
  <v-list-subheader v-if="modelValue.layout.title">
238
240
  {{ modelValue.layout.title }}
239
241
  </v-list-subheader>
@@ -242,11 +244,10 @@ const toggleDialog = (/** @type {boolean} */value) => {
242
244
  :key="children.findIndex(c => c === child)"
243
245
  >
244
246
  <v-list-item
245
- v-bind="itemBind(childIndex)"
247
+ v-bind="itemBind(childIndex, vListItemProps)"
246
248
  :draggable="draggable === childIndex"
247
- variant="flat"
248
249
  :style="`border: 1px solid ${itemBorderColor(child, childIndex)}`"
249
- class="pa-1 vjsf-list-item"
250
+ class="vjsf-list-item"
250
251
  >
251
252
  <v-list-item-title
252
253
  v-if="itemTitles?.[childIndex]"
@@ -24,7 +24,8 @@ export default function useDnd (array, callback) {
24
24
 
25
25
  hovered.value = 1
26
26
 
27
- const itemBind = (/** @type {number} */itemIndex) => ({
27
+ const itemBind = (/** @type {number} */itemIndex, /** @type {Record<String, any>} */defaultItemProps) => ({
28
+ ...defaultItemProps,
28
29
  // hover the item
29
30
  onMouseenter: () => {
30
31
  hovered.value = itemIndex
@@ -10,7 +10,7 @@ export default function useDnd<T>(array: T[], callback: () => void): {
10
10
  hovered: import("vue").Ref<number, number>;
11
11
  draggable: import("vue").Ref<number, number>;
12
12
  dragging: import("vue").Ref<number, number>;
13
- itemBind: (itemIndex: number) => {
13
+ itemBind: (itemIndex: number, defaultItemProps: Record<string, any>) => {
14
14
  onMouseenter: () => void;
15
15
  onMouseleave: () => void;
16
16
  onDragstart: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"use-dnd.d.ts","sourceRoot":"","sources":["../../src/composables/use-dnd.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wDAHW,MAAM,IAAI;;;;;;0BAoBU,MAAM;;;;;;;4BAwBJ,MAAM;;;;EAmBtC"}
1
+ {"version":3,"file":"use-dnd.d.ts","sourceRoot":"","sources":["../../src/composables/use-dnd.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wDAHW,MAAM,IAAI;;;;;;0BAoBU,MAAM,oBAA0B,eAAe,GAAG,CAAC;;;;;;;4BAyBjD,MAAM;;;;EAmBtC"}