@koumoul/vjsf 3.26.0 → 3.26.1

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.26.0",
3
+ "version": "3.26.1",
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",
@@ -1,57 +1,38 @@
1
- <script setup>
2
- import TextFieldMenu from '../fragments/text-field-menu.vue'
3
- import { VColorPicker } from 'vuetify/components/VColorPicker'
4
- import { computed, toRef } from 'vue'
1
+ <script>
2
+ import { defineComponent, h, toRef, watch, computed } from 'vue'
3
+ import { VColorInput } from 'vuetify/labs/VColorInput'
5
4
  import useNode from '../../composables/use-node.js'
6
5
  import { useDefaults } from 'vuetify'
6
+ import useCompDefaults from '../../composables/use-comp-defaults.js'
7
7
 
8
- useDefaults({}, 'VjsfColorPicker')
9
-
10
- const props = defineProps({
11
- modelValue: {
12
- /** @type import('vue').PropType<import('../../types.js').VjsfColorPickerNode> */
13
- type: Object,
14
- required: true
8
+ export default defineComponent({
9
+ props: {
10
+ modelValue: {
11
+ /** @type import('vue').PropType<import('../../types.js').VjsfColorPickerNode> */
12
+ type: Object,
13
+ required: true
14
+ },
15
+ statefulLayout: {
16
+ /** @type import('vue').PropType<import('../../types.js').VjsfStatefulLayout> */
17
+ type: Object,
18
+ required: true
19
+ }
15
20
  },
16
- statefulLayout: {
17
- /** @type import('vue').PropType<import('../../types.js').VjsfStatefulLayout> */
18
- type: Object,
19
- required: true
20
- }
21
- })
21
+ setup (props) {
22
+ useDefaults({}, 'VjsfColorPicker')
23
+ const vColorInputDefaults = useCompDefaults('VColorInput', { colorPip: true, hideActions: true })
22
24
 
23
- const { compProps, localData } = useNode(toRef(props, 'modelValue'), props.statefulLayout)
25
+ const { inputProps, localData, compSlots } = useNode(
26
+ toRef(props, 'modelValue'), props.statefulLayout, { layoutPropsMap: ['placeholder'] }
27
+ )
24
28
 
25
- const colorPickerProps = computed(() => {
26
- const colorPickerProps = { ...compProps.value }
27
- colorPickerProps.modelValue = localData.value
28
- return colorPickerProps
29
- })
29
+ const colorInputProps = computed(() => ({
30
+ ...vColorInputDefaults.value, ...inputProps.value, modelValue: localData.value
31
+ }))
32
+ watch(colorInputProps, () => console.log('colorInputProps', colorInputProps.value), { immediate: true })
30
33
 
31
- const menuProps = computed(() => {
32
- return {
33
- minWidth: '300px',
34
- maxWidth: '300px',
34
+ return () => h(VColorInput, colorInputProps.value, compSlots.value)
35
35
  }
36
36
  })
37
- </script>
38
37
 
39
- <template>
40
- <text-field-menu
41
- :model-value="modelValue"
42
- v-bind="menuProps"
43
- :stateful-layout="statefulLayout"
44
- :formatted-value="modelValue.data ?? undefined"
45
- >
46
- <template
47
- v-if="modelValue.data"
48
- #prepend-inner
49
- >
50
- <div :style="`height:30px; width: 30px; border-radius: 40px; margin-right:6px; background: ${modelValue.data};`" />
51
- </template>
52
- <v-color-picker
53
- v-bind="colorPickerProps"
54
- @update:model-value="value => statefulLayout.input(modelValue, value)"
55
- />
56
- </text-field-menu>
57
- </template>
38
+ </script>
@@ -11,7 +11,9 @@ declare const __VLS_export: import("vue", { with: { "resolution-mode": "import"
11
11
  type: import("vue").PropType<import("../../types.js").VjsfStatefulLayout>;
12
12
  required: true;
13
13
  };
14
- }>, {}, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<import("vue", { with: { "resolution-mode": "import" } }).ExtractPropTypes<{
14
+ }>, () => import("vue", { with: { "resolution-mode": "import" } }).VNode<import("vue", { with: { "resolution-mode": "import" } }).RendererNode, import("vue", { with: { "resolution-mode": "import" } }).RendererElement, {
15
+ [key: string]: any;
16
+ }>, {}, {}, {}, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, import("vue", { with: { "resolution-mode": "import" } }).ComponentOptionsMixin, {}, string, import("vue", { with: { "resolution-mode": "import" } }).PublicProps, Readonly<import("vue", { with: { "resolution-mode": "import" } }).ExtractPropTypes<{
15
17
  modelValue: {
16
18
  /** @type import('vue').PropType<import('../../types.js').VjsfColorPickerNode> */
17
19
  type: import("vue").PropType<import("../../types.js").VjsfColorPickerNode>;
@@ -1 +1 @@
1
- {"version":3,"file":"color-picker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/nodes/color-picker.vue"],"names":[],"mappings":"wBAmLqB,OAAO,YAAY;;AAdxC;;QAGI,iFAAiF;cAAvE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,mBAAmB,CAAC;;;;QAK9E,gFAAgF;cAAtE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,kBAAkB,CAAC;;;;;QAL7E,iFAAiF;cAAvE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,mBAAmB,CAAC;;;;QAK9E,gFAAgF;cAAtE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,kBAAkB,CAAC;;;6IAK9E"}
1
+ {"version":3,"file":"color-picker.vue.d.ts","sourceRoot":"","sources":["../../../src/components/nodes/color-picker.vue"],"names":[],"mappings":"wBA+CqB,OAAO,YAAY;;AAQxC;;QAGM,iFAAiF;cAAvE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,mBAAmB,CAAC;;;;QAK9E,gFAAgF;cAAtE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,kBAAkB,CAAC;;;;;;;QAL7E,iFAAiF;cAAvE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,mBAAmB,CAAC;;;;QAK9E,gFAAgF;cAAtE,OAAO,KAAK,EAAE,QAAQ,CAAC,OAAO,gBAAgB,EAAE,kBAAkB,CAAC;;;6IAoBhF"}