@sfxcode/formkit-primevue 2.4.18 → 2.5.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/dist/components/FormKitDataEdit.vue +20 -7
- package/dist/components/FormKitDataView.vue +2 -1
- package/dist/components/PrimeAutoComplete.vue +6 -2
- package/dist/components/PrimeCascadeSelect.vue +6 -2
- package/dist/components/PrimeCheckbox.vue +6 -2
- package/dist/components/PrimeDatePicker.vue +6 -2
- package/dist/components/PrimeInputNumber.vue +6 -2
- package/dist/components/PrimeInputOtp.vue +6 -2
- package/dist/components/PrimeListbox.vue +6 -2
- package/dist/components/PrimeMultiSelect.vue +6 -2
- package/dist/components/PrimeOutputText.vue +17 -2
- package/dist/components/PrimePassword.vue +6 -2
- package/dist/components/PrimeRating.vue +6 -2
- package/dist/components/PrimeSelect.vue +6 -2
- package/dist/components/PrimeSelectButton.vue +6 -2
- package/dist/components/PrimeToggleButton.vue +6 -2
- package/dist/components/PrimeTreeSelect.vue +6 -2
- package/dist/composables/useFormKitInput.d.ts +1 -0
- package/dist/composables/useFormKitInput.js +3 -0
- package/dist/composables/useFormKitInput.mjs +5 -1
- package/dist/definitions/output.js +1 -1
- package/dist/definitions/output.mjs +1 -1
- package/dist/sass/formkit-primevue.scss +112 -2
- package/dist/style.css +1 -1
- package/package.json +15 -14
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import { FormKit, FormKitSchema } from '@formkit/vue'
|
|
2
|
+
import { FormKit, FormKitMessages, FormKitSchema } from '@formkit/vue'
|
|
3
3
|
import { ref } from 'vue'
|
|
4
4
|
import FormKitDebug from './FormKitDebug.vue'
|
|
5
5
|
|
|
6
6
|
const props = defineProps({
|
|
7
|
+
id: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: 'form',
|
|
10
|
+
},
|
|
7
11
|
data: {
|
|
8
12
|
type: Object,
|
|
9
13
|
default: null,
|
|
@@ -28,6 +32,10 @@ const props = defineProps({
|
|
|
28
32
|
type: String,
|
|
29
33
|
default: 'Save',
|
|
30
34
|
},
|
|
35
|
+
cancelLabel: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'Cancel',
|
|
38
|
+
},
|
|
31
39
|
actionsClass: {
|
|
32
40
|
type: String,
|
|
33
41
|
default: '',
|
|
@@ -51,18 +59,23 @@ function handleSave() {
|
|
|
51
59
|
<template>
|
|
52
60
|
<div class="p-formkit-data-edit">
|
|
53
61
|
<FormKit
|
|
54
|
-
id="
|
|
62
|
+
:id="id"
|
|
55
63
|
v-model="formData"
|
|
56
64
|
:form-class="formClass"
|
|
57
65
|
:actions-class="actionsClass"
|
|
58
66
|
type="form"
|
|
59
|
-
:submit-label="submitLabel"
|
|
60
|
-
:submit-attrs="{
|
|
61
|
-
inputClass,
|
|
62
|
-
}"
|
|
63
67
|
@submit="handleSave"
|
|
64
68
|
>
|
|
65
|
-
<
|
|
69
|
+
<template #default>
|
|
70
|
+
<FormKitSchema v-if="formSchema" :schema="formSchema" :data="formData" />
|
|
71
|
+
<slot />
|
|
72
|
+
</template>
|
|
73
|
+
<template #messages>
|
|
74
|
+
<FormKitMessages class="p-formkit-data-edit-messages" />
|
|
75
|
+
</template>
|
|
76
|
+
<template #submit>
|
|
77
|
+
<Button type="submit" :label="submitLabel" @submit="handleSave" />
|
|
78
|
+
</template>
|
|
66
79
|
</FormKit>
|
|
67
80
|
<FormKitDebug v-if="debugData" :data="formData" header="Data" />
|
|
68
81
|
<FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
|
|
@@ -38,7 +38,8 @@ const formData = ref(props.data)
|
|
|
38
38
|
:form-class="formClass"
|
|
39
39
|
:actions="false"
|
|
40
40
|
>
|
|
41
|
-
<FormKitSchema :schema="formSchema" :data="formData" />
|
|
41
|
+
<FormKitSchema v-if="formSchema" :schema="formSchema" :data="formData" />
|
|
42
|
+
<slot />
|
|
42
43
|
</FormKit>
|
|
43
44
|
<FormKitDebug v-if="debugData" :data="formData" header="Data" />
|
|
44
45
|
<FormKitDebug v-if="debugSchema" :data="formSchema" header="Schema" />
|
|
@@ -21,7 +21,7 @@ const props = defineProps({
|
|
|
21
21
|
},
|
|
22
22
|
})
|
|
23
23
|
|
|
24
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
24
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
25
25
|
|
|
26
26
|
const suggestions = ref([])
|
|
27
27
|
|
|
@@ -53,6 +53,10 @@ function search(event: AutoCompleteCompleteEvent) {
|
|
|
53
53
|
@complete="search"
|
|
54
54
|
@change="handleInput"
|
|
55
55
|
@blur="handleBlur"
|
|
56
|
-
|
|
56
|
+
>
|
|
57
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
58
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
59
|
+
</template>
|
|
60
|
+
</AutoComplete>
|
|
57
61
|
</div>
|
|
58
62
|
</template>
|
|
@@ -25,7 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
},
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
28
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<template>
|
|
@@ -52,6 +52,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
52
52
|
:unstyled="unstyled"
|
|
53
53
|
@change="handleInput"
|
|
54
54
|
@blur="handleBlur"
|
|
55
|
-
|
|
55
|
+
>
|
|
56
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
57
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
58
|
+
</template>
|
|
59
|
+
</CascadeSelect>
|
|
56
60
|
</div>
|
|
57
61
|
</template>
|
|
@@ -25,7 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
|
|
26
26
|
const { hasPrefix, hasSuffix, generateId } = useFormKitSection(props.context)
|
|
27
27
|
|
|
28
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
28
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
29
29
|
|
|
30
30
|
const generatedId = generateId()
|
|
31
31
|
</script>
|
|
@@ -57,7 +57,11 @@ const generatedId = generateId()
|
|
|
57
57
|
:unstyled="unstyled"
|
|
58
58
|
@change="handleInput"
|
|
59
59
|
@blur="handleBlur"
|
|
60
|
-
|
|
60
|
+
>
|
|
61
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
62
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
63
|
+
</template>
|
|
64
|
+
</Checkbox>
|
|
61
65
|
<label v-if="hasSuffix" :for="generatedId" class="formkit-suffix">
|
|
62
66
|
{{ context?.suffix }}
|
|
63
67
|
</label>
|
|
@@ -59,7 +59,7 @@ const props = defineProps({
|
|
|
59
59
|
},
|
|
60
60
|
})
|
|
61
61
|
|
|
62
|
-
const { unstyled, isInvalid, handleInput, handleSelect } = useFormKitInput(props.context)
|
|
62
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleSelect } = useFormKitInput(props.context)
|
|
63
63
|
|
|
64
64
|
function handleBlur(e: DatePickerBlurEvent) {
|
|
65
65
|
props.context?.handlers.blur(e.originalEvent)
|
|
@@ -132,6 +132,10 @@ function handleClearClick() {
|
|
|
132
132
|
@input="handleInput"
|
|
133
133
|
@blur="handleBlur"
|
|
134
134
|
@clear-click="handleClearClick"
|
|
135
|
-
|
|
135
|
+
>
|
|
136
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
137
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
138
|
+
</template>
|
|
139
|
+
</DatePicker>
|
|
136
140
|
</div>
|
|
137
141
|
</template>
|
|
@@ -34,7 +34,7 @@ const props = defineProps({
|
|
|
34
34
|
},
|
|
35
35
|
})
|
|
36
36
|
|
|
37
|
-
const { unstyled, isInvalid } = useFormKitInput(props.context)
|
|
37
|
+
const { validSlotNames, unstyled, isInvalid } = useFormKitInput(props.context)
|
|
38
38
|
|
|
39
39
|
function handleBlur(e: InputNumberBlurEvent) {
|
|
40
40
|
props.context?.handlers.blur(e.originalEvent)
|
|
@@ -99,6 +99,10 @@ watch(
|
|
|
99
99
|
:unstyled="unstyled"
|
|
100
100
|
@input="handleInput"
|
|
101
101
|
@blur="handleBlur"
|
|
102
|
-
|
|
102
|
+
>
|
|
103
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
104
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
105
|
+
</template>
|
|
106
|
+
</InputNumber>
|
|
103
107
|
</div>
|
|
104
108
|
</template>
|
|
@@ -23,7 +23,7 @@ const props = defineProps({
|
|
|
23
23
|
},
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const { unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.context)
|
|
26
|
+
const { validSlotNames, unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.context)
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
@@ -49,6 +49,10 @@ const { unstyled, isInvalid, handleBlur, handleInput } = useFormKitInput(props.c
|
|
|
49
49
|
:unstyled="unstyled"
|
|
50
50
|
@change="handleInput"
|
|
51
51
|
@blur="handleBlur"
|
|
52
|
-
|
|
52
|
+
>
|
|
53
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
54
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
55
|
+
</template>
|
|
56
|
+
</InputOtp>
|
|
53
57
|
</div>
|
|
54
58
|
</template>
|
|
@@ -30,7 +30,7 @@ const props = defineProps({
|
|
|
30
30
|
},
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
33
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
@@ -63,6 +63,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
63
63
|
:unstyled="unstyled"
|
|
64
64
|
@change="handleInput"
|
|
65
65
|
@blur="handleBlur"
|
|
66
|
-
|
|
66
|
+
>
|
|
67
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
68
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
69
|
+
</template>
|
|
70
|
+
</Listbox>
|
|
67
71
|
</div>
|
|
68
72
|
</template>
|
|
@@ -51,7 +51,7 @@ const props = defineProps({
|
|
|
51
51
|
},
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
const { unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.context)
|
|
54
|
+
const { validSlotNames, unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.context)
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<template>
|
|
@@ -105,6 +105,10 @@ const { unstyled, isInvalid, handleBlur, handleChange } = useFormKitInput(props.
|
|
|
105
105
|
:unstyled="unstyled"
|
|
106
106
|
@change="handleChange"
|
|
107
107
|
@blur="handleBlur"
|
|
108
|
-
|
|
108
|
+
>
|
|
109
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
110
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
111
|
+
</template>
|
|
112
|
+
</MultiSelect>
|
|
109
113
|
</div>
|
|
110
114
|
</template>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
3
|
import type { PropType } from 'vue'
|
|
4
|
+
import { useI18n } from 'vue-i18n'
|
|
4
5
|
import { useFormKitSection } from '../composables'
|
|
5
6
|
|
|
6
7
|
const props = defineProps({
|
|
@@ -10,6 +11,20 @@ const props = defineProps({
|
|
|
10
11
|
},
|
|
11
12
|
})
|
|
12
13
|
|
|
14
|
+
const textValue = computed(() => {
|
|
15
|
+
const value = props.context?._value
|
|
16
|
+
const { t } = useI18n()
|
|
17
|
+
if (value) {
|
|
18
|
+
if (props.context?.isTranslationKey)
|
|
19
|
+
return t(value)
|
|
20
|
+
else
|
|
21
|
+
return value
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
return ''
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
|
|
13
28
|
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
14
29
|
</script>
|
|
15
30
|
|
|
@@ -24,8 +39,8 @@ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection
|
|
|
24
39
|
:style="context?.attrs?.style"
|
|
25
40
|
:class="context?.attrs?.class"
|
|
26
41
|
>
|
|
27
|
-
<span v-if="context?.html" v-html="
|
|
28
|
-
<span v-else v-text="
|
|
42
|
+
<span v-if="context?.html" v-html="textValue" />
|
|
43
|
+
<span v-else v-text="textValue" />
|
|
29
44
|
</span>
|
|
30
45
|
<span v-if="hasSuffix" class="formkit-suffix">
|
|
31
46
|
{{ context?.suffix }}
|
|
@@ -30,7 +30,7 @@ const props = defineProps({
|
|
|
30
30
|
},
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
33
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
@@ -63,6 +63,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
63
63
|
:unstyled="unstyled"
|
|
64
64
|
@input="handleInput"
|
|
65
65
|
@blur="handleBlur"
|
|
66
|
-
|
|
66
|
+
>
|
|
67
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
68
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
69
|
+
</template>
|
|
70
|
+
</Password>
|
|
67
71
|
</div>
|
|
68
72
|
</template>
|
|
@@ -22,7 +22,7 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
25
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
@@ -47,6 +47,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
47
47
|
:unstyled="unstyled"
|
|
48
48
|
@change="handleInput"
|
|
49
49
|
@blur="handleBlur"
|
|
50
|
-
|
|
50
|
+
>
|
|
51
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
52
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
53
|
+
</template>
|
|
54
|
+
</Rating>
|
|
51
55
|
</div>
|
|
52
56
|
</template>
|
|
@@ -47,7 +47,7 @@ const props = defineProps({
|
|
|
47
47
|
},
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
50
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<template>
|
|
@@ -102,6 +102,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
102
102
|
:unstyled="unstyled"
|
|
103
103
|
@change="handleInput"
|
|
104
104
|
@blur="handleBlur"
|
|
105
|
-
|
|
105
|
+
>
|
|
106
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
107
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
108
|
+
</template>
|
|
109
|
+
</Select>
|
|
106
110
|
</div>
|
|
107
111
|
</template>
|
|
@@ -25,7 +25,7 @@ const props = defineProps({
|
|
|
25
25
|
},
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
28
|
+
const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<template>
|
|
@@ -53,6 +53,10 @@ const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.
|
|
|
53
53
|
:unstyled="unstyled"
|
|
54
54
|
@change="handleChange"
|
|
55
55
|
@blur="handleBlur"
|
|
56
|
-
|
|
56
|
+
>
|
|
57
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
58
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
59
|
+
</template>
|
|
60
|
+
</SelectButton>
|
|
57
61
|
</div>
|
|
58
62
|
</template>
|
|
@@ -24,7 +24,7 @@ const props = defineProps({
|
|
|
24
24
|
},
|
|
25
25
|
})
|
|
26
26
|
|
|
27
|
-
const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
27
|
+
const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
@@ -51,6 +51,10 @@ const { unstyled, isInvalid, handleChange, handleBlur } = useFormKitInput(props.
|
|
|
51
51
|
:unstyled="unstyled"
|
|
52
52
|
@change="handleChange"
|
|
53
53
|
@blur="handleBlur"
|
|
54
|
-
|
|
54
|
+
>
|
|
55
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
56
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
57
|
+
</template>
|
|
58
|
+
</ToggleButton>
|
|
55
59
|
</div>
|
|
56
60
|
</template>
|
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
},
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
32
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
33
33
|
</script>
|
|
34
34
|
|
|
35
35
|
<template>
|
|
@@ -61,6 +61,10 @@ const { unstyled, isInvalid, handleInput, handleBlur } = useFormKitInput(props.c
|
|
|
61
61
|
:unstyled="unstyled"
|
|
62
62
|
@change="handleInput"
|
|
63
63
|
@blur="handleBlur"
|
|
64
|
-
|
|
64
|
+
>
|
|
65
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
66
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
67
|
+
</template>
|
|
68
|
+
</TreeSelect>
|
|
65
69
|
</div>
|
|
66
70
|
</template>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare function useFormKitInput(context: any): {
|
|
2
2
|
isInvalid: import("vue").ComputedRef<any>;
|
|
3
|
+
validSlotNames: import("vue").ComputedRef<string[]>;
|
|
3
4
|
styleClass: import("vue").ComputedRef<any>;
|
|
4
5
|
unstyled: import("vue").ComputedRef<any>;
|
|
5
6
|
handleBlur: (event: Event) => void;
|
|
@@ -24,6 +24,8 @@ function useFormKitInput(context) {
|
|
|
24
24
|
const unstyled = (0, _vue.computed)(() => {
|
|
25
25
|
return context?.unstyled ?? isGlobalUnstyledMode();
|
|
26
26
|
});
|
|
27
|
+
const formKitCreateInputSlots = /* @__PURE__ */new Set(["label", "help", "messages", "message", "input"]);
|
|
28
|
+
const validSlotNames = (0, _vue.computed)(() => Object.keys(context?.slots).filter(slotName => !formKitCreateInputSlots.has(slotName)));
|
|
27
29
|
function handleBlur(event) {
|
|
28
30
|
context?.handlers.blur(event);
|
|
29
31
|
}
|
|
@@ -38,6 +40,7 @@ function useFormKitInput(context) {
|
|
|
38
40
|
}
|
|
39
41
|
return {
|
|
40
42
|
isInvalid,
|
|
43
|
+
validSlotNames,
|
|
41
44
|
styleClass,
|
|
42
45
|
unstyled,
|
|
43
46
|
handleBlur,
|
|
@@ -19,6 +19,10 @@ export function useFormKitInput(context) {
|
|
|
19
19
|
const unstyled = computed(() => {
|
|
20
20
|
return context?.unstyled ?? isGlobalUnstyledMode();
|
|
21
21
|
});
|
|
22
|
+
const formKitCreateInputSlots = /* @__PURE__ */ new Set(["label", "help", "messages", "message", "input"]);
|
|
23
|
+
const validSlotNames = computed(
|
|
24
|
+
() => Object.keys(context?.slots).filter((slotName) => !formKitCreateInputSlots.has(slotName))
|
|
25
|
+
);
|
|
22
26
|
function handleBlur(event) {
|
|
23
27
|
context?.handlers.blur(event);
|
|
24
28
|
}
|
|
@@ -31,5 +35,5 @@ export function useFormKitInput(context) {
|
|
|
31
35
|
function handleSelect(e) {
|
|
32
36
|
context?.node.input(e);
|
|
33
37
|
}
|
|
34
|
-
return { isInvalid, styleClass, unstyled, handleBlur, handleChange, handleInput, handleSelect };
|
|
38
|
+
return { isInvalid, validSlotNames, styleClass, unstyled, handleBlur, handleChange, handleInput, handleSelect };
|
|
35
39
|
}
|
|
@@ -15,7 +15,7 @@ var _PrimeOutputReference = _interopRequireDefault(require("../components/PrimeO
|
|
|
15
15
|
var _PrimeOutputText = _interopRequireDefault(require("../components/PrimeOutputText.vue"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const primeOutputTextDefinition = exports.primeOutputTextDefinition = (0, _vue.createInput)(_PrimeOutputText.default, {
|
|
18
|
-
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "html"]
|
|
18
|
+
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html"]
|
|
19
19
|
});
|
|
20
20
|
const primeOutputDateDefinition = exports.primeOutputDateDefinition = (0, _vue.createInput)(_PrimeOutputDate.default, {
|
|
21
21
|
props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
|
|
@@ -8,7 +8,7 @@ import PrimeOutputNumber from "../components/PrimeOutputNumber.vue";
|
|
|
8
8
|
import PrimeOutputReference from "../components/PrimeOutputReference.vue";
|
|
9
9
|
import PrimeOutputText from "../components/PrimeOutputText.vue";
|
|
10
10
|
export const primeOutputTextDefinition = createInput(PrimeOutputText, {
|
|
11
|
-
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "html"]
|
|
11
|
+
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html"]
|
|
12
12
|
});
|
|
13
13
|
export const primeOutputDateDefinition = createInput(PrimeOutputDate, {
|
|
14
14
|
props: ["prefix", "suffix", "iconPrefix", "iconSuffix"]
|
|
@@ -35,8 +35,8 @@ $grid-breakpoints: (
|
|
|
35
35
|
// General message item styling
|
|
36
36
|
.formkit-messages {
|
|
37
37
|
margin: 0.125rem 0;
|
|
38
|
-
padding-top: 0.
|
|
39
|
-
padding-left: 0;
|
|
38
|
+
padding-top: 0.5rem;
|
|
39
|
+
padding-left: 0.5rem;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
.formkit-message {
|
|
@@ -51,6 +51,12 @@ $grid-breakpoints: (
|
|
|
51
51
|
.formkit-outer {
|
|
52
52
|
padding-bottom: 0.8rem;
|
|
53
53
|
|
|
54
|
+
.formkit-messages {
|
|
55
|
+
margin: 0.125rem 0;
|
|
56
|
+
padding-top: 0.25rem;
|
|
57
|
+
padding-left: 0;
|
|
58
|
+
}
|
|
59
|
+
|
|
54
60
|
.formkit-inner {
|
|
55
61
|
.p-formkit {
|
|
56
62
|
.p-formkit-icon {
|
|
@@ -163,6 +169,110 @@ $grid-breakpoints: (
|
|
|
163
169
|
}
|
|
164
170
|
}
|
|
165
171
|
|
|
172
|
+
// data view only
|
|
173
|
+
.p-formkit-data-view {
|
|
174
|
+
.formkit-form {
|
|
175
|
+
.formkit-outer {
|
|
176
|
+
padding-bottom: 0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.formkit-help {
|
|
180
|
+
margin: 0;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// data edit only
|
|
186
|
+
.p-formkit-data-edit {
|
|
187
|
+
|
|
188
|
+
.formkit-form {
|
|
189
|
+
.formkit-label {
|
|
190
|
+
//font-weight: normal;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
// specific checkbox stylings
|
|
194
|
+
.formkit-outer[data-type="primeCheckbox"] {
|
|
195
|
+
//padding-left: 0;
|
|
196
|
+
|
|
197
|
+
.formkit-wrapper {
|
|
198
|
+
display: flex;
|
|
199
|
+
flex-wrap: wrap;
|
|
200
|
+
|
|
201
|
+
.formkit-inner {
|
|
202
|
+
width: auto !important;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
label {
|
|
206
|
+
width: auto;
|
|
207
|
+
order: 2;
|
|
208
|
+
padding: 0.125rem 0;
|
|
209
|
+
|
|
210
|
+
&:after {
|
|
211
|
+
content: "";
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// styling of output when label is used in schema
|
|
215
|
+
+ .formkit-inner {
|
|
216
|
+
margin-left: 0 !important;
|
|
217
|
+
order: 1;
|
|
218
|
+
flex-basis: 2rem;
|
|
219
|
+
flex-grow: 0;
|
|
220
|
+
flex-shrink: 0;
|
|
221
|
+
overflow: hidden;
|
|
222
|
+
// styling of suffix when suffix is used in addition to label
|
|
223
|
+
&:has( label) {
|
|
224
|
+
flex-grow: 1;
|
|
225
|
+
flex-basis: 100%;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// styling when both prefix and suffix are used in schema
|
|
231
|
+
label:first-child:nth-last-child(3), label:first-child:nth-last-child(3) ~ label {
|
|
232
|
+
width: auto;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
label:first-child:nth-last-child(3) {
|
|
236
|
+
order: 1;
|
|
237
|
+
|
|
238
|
+
+ div.p-checkbox {
|
|
239
|
+
order: 2;
|
|
240
|
+
width: auto;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
label:first-child:nth-last-child(3) ~ label {
|
|
245
|
+
order: 3
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// end styling when both prefix and suffix are used in schema
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
// styling of output when only suffix is used in schema
|
|
252
|
+
.formkit-inner:first-child {
|
|
253
|
+
margin-left: 0 !important;
|
|
254
|
+
|
|
255
|
+
.p-formkit {
|
|
256
|
+
display: flex;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
.p-checkbox:not(:only-child) {
|
|
261
|
+
width: 2rem;
|
|
262
|
+
overflow: hidden;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.formkit-help {
|
|
267
|
+
width: auto !important;
|
|
268
|
+
//padding-left: 2rem;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
166
276
|
// Debug
|
|
167
277
|
.p-formkit-data-debug {
|
|
168
278
|
pre, span {
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--formkit-error-color: #ef9a9a}.formkit-form .formkit-messages{margin:.125rem 0;padding-top:.
|
|
1
|
+
:root{--formkit-error-color: #ef9a9a}.formkit-form .formkit-messages{margin:.125rem 0;padding-top:.5rem;padding-left:.5rem}.formkit-form .formkit-message{list-style:none;padding:0;margin:0;color:var(--formkit-error-color);font-size:.8rem}.formkit-form .formkit-outer{padding-bottom:.8rem}.formkit-form .formkit-outer .formkit-messages{margin:.125rem 0;padding-top:.25rem;padding-left:0}.formkit-form .formkit-outer .formkit-inner .p-formkit .p-formkit-icon{box-sizing:border-box;width:100%}.formkit-form .formkit-outer .formkit-inner .p-formkit .p-inputtext,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-textarea,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-password,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-multiselect,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-select,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-editor{box-sizing:border-box;width:100%}.formkit-form .formkit-outer .formkit-inner .p-formkit .p-inputtext.p-colorpicker-preview,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-textarea.p-colorpicker-preview,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-password.p-colorpicker-preview,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-multiselect.p-colorpicker-preview,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-select.p-colorpicker-preview,.formkit-form .formkit-outer .formkit-inner .p-formkit .p-editor.p-colorpicker-preview{width:2rem}.formkit-form .formkit-outer .formkit-help{margin:.25rem 0 0 0;font-size:.8rem;color:var(--text-color-secondary)}.formkit-form .formkit-label{display:block;margin:0;padding-bottom:.5rem;font-weight:bold;font-size:.8rem}.formkit-form .p-formkit>*{margin-right:.5rem}.formkit-form .p-formkit>*:last-child,.formkit-form .p-formkit>*:only-child{margin-right:0}.formkit-form .p-formkit-options{display:flex;flex-wrap:wrap;gap:.5rem}.formkit-form .p-formkit-options .p-formkit-option{display:flex;align-items:center}.formkit-form .p-formkit-options .p-formkit-option label{margin-left:.5rem}.formkit-form .formkit-fieldset{margin:0;padding:0;border-radius:0;border:0}.formkit-form .formkit-fieldset:focus-within{border:0}.formkit-form .formkit-fieldset>.formkit-help{margin-top:0;margin-bottom:0}.formkit-form .formkit-legend{display:block;margin:0;padding:0}.formkit-form .formkit-actions{padding-top:.5rem}.formkit-form .p-action-buttons{margin-top:.25rem}.formkit-form .p-action-buttons .p-button{margin-right:.5rem}.formkit-form .p-action-buttons span .p-space{margin-right:3rem}.formkit-form .p-chip-item{align-items:center;background:var(--p-surface-500);color:var(--p-surface-0);border-radius:1rem;padding:.2rem .5rem}.p-formkit-data-view .formkit-form .formkit-outer{padding-bottom:0}.p-formkit-data-view .formkit-form .formkit-help{margin:0}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper{display:flex;flex-wrap:wrap}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper .formkit-inner{width:auto !important}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label{width:auto;order:2;padding:.125rem 0}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:after{content:""}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label+.formkit-inner{margin-left:0 !important;order:1;flex-basis:2rem;flex-grow:0;flex-shrink:0;overflow:hidden}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label+.formkit-inner:has(label){flex-grow:1;flex-basis:100%}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:first-child:nth-last-child(3),.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:first-child:nth-last-child(3)~label{width:auto}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:first-child:nth-last-child(3){order:1}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:first-child:nth-last-child(3)+div.p-checkbox{order:2;width:auto}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper label:first-child:nth-last-child(3)~label{order:3}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper .formkit-inner:first-child{margin-left:0 !important}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper .formkit-inner:first-child .p-formkit{display:flex}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-wrapper .p-checkbox:not(:only-child){width:2rem;overflow:hidden}.p-formkit-data-edit .formkit-form .formkit-outer[data-type=primeCheckbox] .formkit-help{width:auto !important}.p-formkit-data-debug pre,.p-formkit-data-debug span{font-size:.75rem;line-height:1rem}@media(min-width: 1024px){.formkit-form{display:flex;flex-wrap:wrap;margin-left:-0.5rem;margin-right:-0.5rem}.formkit-form>*{flex-shrink:0;width:100%;max-width:100%;padding-left:.5rem;padding-right:.5rem}.col-1{width:8.3333333333%}.col-2{width:16.6666666667%}.col-3{width:25%}.col-4{width:33.3333333333%}.col-5{width:41.6666666667%}.col-6{width:50%}.col-7{width:58.3333333333%}.col-8{width:66.6666666667%}.col-9{width:75%}.col-10{width:83.3333333333%}.col-11{width:91.6666666667%}.col-12{width:100%}}@media(min-width: 768px){.formkit-form.form-horizontal .formkit-wrapper{display:flex}.formkit-form.form-horizontal .formkit-wrapper label{display:inline-block;padding:0 .25rem 0 0;font-size:inherit}.formkit-form.form-horizontal .formkit-wrapper label:after{content:":"}.p-formkit-data-view .formkit-form.form-horizontal label{white-space:nowrap}.p-formkit-data-edit .formkit-form.form-horizontal .formkit-outer{width:100%}.p-formkit-data-edit .formkit-form.form-horizontal .formkit-outer label{@apply w-4/12;padding-top:.25rem;line-height:normal}.p-formkit-data-edit .formkit-form.form-horizontal .formkit-outer .formkit-inner{@apply w-8/12}.p-formkit-data-edit .formkit-form.form-horizontal div[data-type=primeCheckbox] .formkit-inner{margin-left:auto}.p-formkit-data-edit .formkit-form.form-horizontal div[data-type=primeCheckbox] .formkit-inner .p-formkit{display:flex}.p-formkit-data-edit .formkit-form.form-horizontal div[data-type=primeCheckbox] .formkit-inner label{width:auto;padding:0}.p-formkit-data-edit .formkit-form.form-horizontal .formkit-help,.p-formkit-data-edit .formkit-form.form-horizontal .formkit-messages{@apply w-8/12;margin-left:auto}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0",
|
|
5
5
|
"packageManager": "pnpm@9.11.0+sha256.1c0e33f70e5df9eede84a357bdfa0b1f9dba6e58194628d48a1055756f553754",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom",
|
|
@@ -72,7 +72,7 @@
|
|
|
72
72
|
"dev": "vite serve dev",
|
|
73
73
|
"dev:build": "vite build dev",
|
|
74
74
|
"dev:preview": "vite preview dev",
|
|
75
|
-
"release": "npm run lint && npm run build && changelogen --
|
|
75
|
+
"release": "npm run lint && npm run build && changelogen --minor --release && npm publish --access public && git push --follow-tags",
|
|
76
76
|
"lint": "eslint ./src",
|
|
77
77
|
"lint:fix": "eslint . --fix",
|
|
78
78
|
"prepublishOnly": "pnpm build",
|
|
@@ -93,21 +93,22 @@
|
|
|
93
93
|
"@formkit/vue": "^1.6.7",
|
|
94
94
|
"primeicons": "^7.0.0",
|
|
95
95
|
"primevue": "4.0.7",
|
|
96
|
+
"quill": "^2.0.2",
|
|
96
97
|
"uuid": "^10.0.0",
|
|
97
|
-
"vue-i18n": "
|
|
98
|
+
"vue-i18n": "10.0.3"
|
|
98
99
|
},
|
|
99
100
|
"devDependencies": {
|
|
100
|
-
"@antfu/eslint-config": "3.
|
|
101
|
+
"@antfu/eslint-config": "3.7.3",
|
|
101
102
|
"@formkit/core": "^1.6.7",
|
|
102
103
|
"@primevue/themes": "4.0.7",
|
|
103
|
-
"@types/node": "^22.7.
|
|
104
|
-
"@unocss/preset-icons": "^0.
|
|
105
|
-
"@unocss/preset-uno": "^0.
|
|
104
|
+
"@types/node": "^22.7.4",
|
|
105
|
+
"@unocss/preset-icons": "^0.63.0",
|
|
106
|
+
"@unocss/preset-uno": "^0.63.0",
|
|
106
107
|
"@vitejs/plugin-vue": "^5.1.4",
|
|
107
108
|
"@vitest/coverage-v8": "^2.1.1",
|
|
108
109
|
"@vitest/ui": "^2.1.1",
|
|
109
|
-
"@vue/compiler-sfc": "^3.5.
|
|
110
|
-
"@vue/server-renderer": "^3.5.
|
|
110
|
+
"@vue/compiler-sfc": "^3.5.10",
|
|
111
|
+
"@vue/server-renderer": "^3.5.10",
|
|
111
112
|
"@vue/test-utils": "^2.4.6",
|
|
112
113
|
"@vue/tsconfig": "^0.5.1",
|
|
113
114
|
"@vuedx/typecheck": "~0.7.6",
|
|
@@ -119,25 +120,25 @@
|
|
|
119
120
|
"consola": "^3.2.3",
|
|
120
121
|
"eslint": "^9.11.1",
|
|
121
122
|
"happy-dom": "^15.7.4",
|
|
122
|
-
"json-editor-vue": "^0.
|
|
123
|
+
"json-editor-vue": "^0.17.0",
|
|
123
124
|
"mkdist": "^1.5.9",
|
|
124
125
|
"quill": "^2.0.2",
|
|
125
126
|
"sass": "1.78.0",
|
|
126
127
|
"tslib": "^2.7.0",
|
|
127
128
|
"typescript": "^5.6.2",
|
|
128
129
|
"unbuild": "3.0.0-rc.8",
|
|
129
|
-
"unocss": "^0.
|
|
130
|
+
"unocss": "^0.63.0",
|
|
130
131
|
"unplugin-auto-import": "^0.18.3",
|
|
131
132
|
"unplugin-vue-components": "^0.27.4",
|
|
132
|
-
"vanilla-jsoneditor": "^0.
|
|
133
|
+
"vanilla-jsoneditor": "^1.0.4",
|
|
133
134
|
"vite": "^5.4.8",
|
|
134
|
-
"vite-plugin-dts": "4.2.
|
|
135
|
+
"vite-plugin-dts": "4.2.2",
|
|
135
136
|
"vite-plugin-eslint": "^1.8.1",
|
|
136
137
|
"vite-plugin-pages": "^0.32.3",
|
|
137
138
|
"vite-ssg": "^0.23.8",
|
|
138
139
|
"vitepress": "^1.3.4",
|
|
139
140
|
"vitest": "^2.1.1",
|
|
140
|
-
"vue": "^3.5.
|
|
141
|
+
"vue": "^3.5.10",
|
|
141
142
|
"vue-demi": "^0.14.10",
|
|
142
143
|
"vue-router": "^4.4.5",
|
|
143
144
|
"vue-tsc": "^2.1.6"
|