@sfxcode/formkit-primevue 3.3.1 → 3.3.3
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/LICENSE +21 -0
- package/README.md +138 -13
- package/components.d.ts +1 -0
- package/dist/components/FormKitDataDebug.d.vue.ts +24 -0
- package/dist/components/FormKitDataDebug.vue +23 -0
- package/dist/components/FormKitDataDebug.vue.d.ts +24 -0
- package/dist/components/FormKitDataEdit.d.vue.ts +180 -0
- package/dist/components/FormKitDataEdit.vue +126 -0
- package/dist/components/FormKitDataEdit.vue.d.ts +180 -0
- package/dist/components/FormKitDataView.d.vue.ts +73 -0
- package/dist/components/FormKitDataView.vue +58 -0
- package/dist/components/FormKitDataView.vue.d.ts +73 -0
- package/dist/components/FormKitIcon.d.vue.ts +39 -0
- package/dist/components/FormKitIcon.vue +25 -0
- package/dist/components/FormKitIcon.vue.d.ts +39 -0
- package/dist/components/FormKitPrefix.d.vue.ts +7 -0
- package/dist/components/FormKitPrefix.vue +11 -0
- package/dist/components/FormKitPrefix.vue.d.ts +7 -0
- package/dist/components/FormKitSuffix.d.vue.ts +7 -0
- package/dist/components/FormKitSuffix.vue +11 -0
- package/dist/components/FormKitSuffix.vue.d.ts +7 -0
- package/dist/components/PrimeAutoComplete.d.vue.ts +31 -0
- package/dist/components/PrimeAutoComplete.vue +140 -0
- package/dist/components/PrimeAutoComplete.vue.d.ts +31 -0
- package/dist/components/PrimeCascadeSelect.d.vue.ts +28 -0
- package/dist/components/PrimeCascadeSelect.vue +62 -0
- package/dist/components/PrimeCascadeSelect.vue.d.ts +28 -0
- package/dist/components/PrimeCheckbox.d.vue.ts +27 -0
- package/dist/components/PrimeCheckbox.vue +71 -0
- package/dist/components/PrimeCheckbox.vue.d.ts +27 -0
- package/dist/components/PrimeColorPicker.d.vue.ts +24 -0
- package/dist/components/PrimeColorPicker.vue +48 -0
- package/dist/components/PrimeColorPicker.vue.d.ts +24 -0
- package/dist/components/PrimeDatePicker.d.vue.ts +63 -0
- package/dist/components/PrimeDatePicker.vue +153 -0
- package/dist/components/PrimeDatePicker.vue.d.ts +63 -0
- package/dist/components/PrimeInputMask.d.vue.ts +28 -0
- package/dist/components/PrimeInputMask.vue +88 -0
- package/dist/components/PrimeInputMask.vue.d.ts +28 -0
- package/dist/components/PrimeInputNumber.d.vue.ts +36 -0
- package/dist/components/PrimeInputNumber.vue +110 -0
- package/dist/components/PrimeInputNumber.vue.d.ts +36 -0
- package/dist/components/PrimeInputOtp.d.vue.ts +26 -0
- package/dist/components/PrimeInputOtp.vue +59 -0
- package/dist/components/PrimeInputOtp.vue.d.ts +26 -0
- package/dist/components/PrimeInputText.d.vue.ts +24 -0
- package/dist/components/PrimeInputText.vue +80 -0
- package/dist/components/PrimeInputText.vue.d.ts +24 -0
- package/dist/components/PrimeKnob.d.vue.ts +31 -0
- package/dist/components/PrimeKnob.vue +75 -0
- package/dist/components/PrimeKnob.vue.d.ts +31 -0
- package/dist/components/PrimeListbox.d.vue.ts +42 -0
- package/dist/components/PrimeListbox.vue +86 -0
- package/dist/components/PrimeListbox.vue.d.ts +42 -0
- package/dist/components/PrimeMultiSelect.d.vue.ts +53 -0
- package/dist/components/PrimeMultiSelect.vue +115 -0
- package/dist/components/PrimeMultiSelect.vue.d.ts +53 -0
- package/dist/components/PrimeOutputBoolean.d.vue.ts +16 -0
- package/dist/components/PrimeOutputBoolean.vue +41 -0
- package/dist/components/PrimeOutputBoolean.vue.d.ts +16 -0
- package/dist/components/PrimeOutputDate.d.vue.ts +16 -0
- package/dist/components/PrimeOutputDate.vue +51 -0
- package/dist/components/PrimeOutputDate.vue.d.ts +16 -0
- package/dist/components/PrimeOutputDuration.d.vue.ts +16 -0
- package/dist/components/PrimeOutputDuration.vue +32 -0
- package/dist/components/PrimeOutputDuration.vue.d.ts +16 -0
- package/dist/components/PrimeOutputLink.d.vue.ts +16 -0
- package/dist/components/PrimeOutputLink.vue +50 -0
- package/dist/components/PrimeOutputLink.vue.d.ts +16 -0
- package/dist/components/PrimeOutputList.d.vue.ts +19 -0
- package/dist/components/PrimeOutputList.vue +75 -0
- package/dist/components/PrimeOutputList.vue.d.ts +19 -0
- package/dist/components/PrimeOutputNumber.d.vue.ts +16 -0
- package/dist/components/PrimeOutputNumber.vue +59 -0
- package/dist/components/PrimeOutputNumber.vue.d.ts +16 -0
- package/dist/components/PrimeOutputReference.d.vue.ts +16 -0
- package/dist/components/PrimeOutputReference.vue +62 -0
- package/dist/components/PrimeOutputReference.vue.d.ts +16 -0
- package/dist/components/PrimeOutputText.d.vue.ts +22 -0
- package/dist/components/PrimeOutputText.vue +72 -0
- package/dist/components/PrimeOutputText.vue.d.ts +22 -0
- package/dist/components/PrimePassword.d.vue.ts +33 -0
- package/dist/components/PrimePassword.vue +73 -0
- package/dist/components/PrimePassword.vue.d.ts +33 -0
- package/dist/components/PrimeRadioButton.d.vue.ts +28 -0
- package/dist/components/PrimeRadioButton.vue +58 -0
- package/dist/components/PrimeRadioButton.vue.d.ts +28 -0
- package/dist/components/PrimeRating.d.vue.ts +24 -0
- package/dist/components/PrimeRating.vue +55 -0
- package/dist/components/PrimeRating.vue.d.ts +24 -0
- package/dist/components/PrimeSelect.d.vue.ts +50 -0
- package/dist/components/PrimeSelect.vue +113 -0
- package/dist/components/PrimeSelect.vue.d.ts +50 -0
- package/dist/components/PrimeSelectButton.d.vue.ts +28 -0
- package/dist/components/PrimeSelectButton.vue +64 -0
- package/dist/components/PrimeSelectButton.vue.d.ts +28 -0
- package/dist/components/PrimeSlider.d.vue.ts +26 -0
- package/dist/components/PrimeSlider.vue +60 -0
- package/dist/components/PrimeSlider.vue.d.ts +26 -0
- package/dist/components/PrimeTextarea.d.vue.ts +25 -0
- package/dist/components/PrimeTextarea.vue +53 -0
- package/dist/components/PrimeTextarea.vue.d.ts +25 -0
- package/dist/components/PrimeToggleButton.d.vue.ts +26 -0
- package/dist/components/PrimeToggleButton.vue +60 -0
- package/dist/components/PrimeToggleButton.vue.d.ts +26 -0
- package/dist/components/PrimeToggleSwitch.d.vue.ts +23 -0
- package/dist/components/PrimeToggleSwitch.vue +57 -0
- package/dist/components/PrimeToggleSwitch.vue.d.ts +23 -0
- package/dist/components/PrimeTreeSelect.d.vue.ts +32 -0
- package/dist/components/PrimeTreeSelect.vue +71 -0
- package/dist/components/PrimeTreeSelect.vue.d.ts +32 -0
- package/dist/components/index.d.ts +24 -2
- package/dist/components/index.js +167 -4
- package/dist/components/index.mjs +48 -0
- package/dist/composables/index.d.ts +9 -2
- package/dist/composables/index.js +61 -2
- package/dist/composables/index.mjs +18 -0
- package/dist/composables/useFormKitInput.d.ts +11 -0
- package/dist/composables/useFormKitInput.js +58 -0
- package/dist/composables/useFormKitInput.mjs +45 -0
- package/dist/composables/useFormKitRepeater.d.ts +15 -0
- package/dist/composables/useFormKitRepeater.js +74 -0
- package/dist/composables/useFormKitRepeater.mjs +54 -0
- package/dist/composables/useFormKitSchema.d.ts +36 -0
- package/dist/composables/useFormKitSchema.js +83 -0
- package/dist/composables/useFormKitSchema.mjs +58 -0
- package/dist/composables/useFormKitSection.d.ts +7 -0
- package/dist/composables/useFormKitSection.js +31 -0
- package/dist/composables/useFormKitSection.mjs +19 -0
- package/dist/composables/useInputEditor.d.ts +8 -0
- package/dist/composables/useInputEditor.js +148 -0
- package/dist/composables/useInputEditor.mjs +143 -0
- package/dist/composables/useInputEditorSchema.d.ts +163 -0
- package/dist/composables/useInputEditorSchema.js +313 -0
- package/dist/composables/useInputEditorSchema.mjs +315 -0
- package/dist/composables/useOutputDuration.d.ts +4 -0
- package/dist/composables/useOutputDuration.js +40 -0
- package/dist/composables/useOutputDuration.mjs +35 -0
- package/dist/composables/usePrimeInputs.d.ts +3 -0
- package/dist/composables/usePrimeInputs.js +62 -0
- package/dist/composables/usePrimeInputs.mjs +53 -0
- package/dist/definitions/index.d.ts +32 -37
- package/dist/definitions/index.js +42 -4
- package/dist/definitions/index.mjs +68 -0
- package/dist/definitions/input.d.ts +47 -0
- package/dist/definitions/input.js +142 -0
- package/dist/definitions/input.mjs +135 -0
- package/dist/definitions/output.d.ts +9 -0
- package/dist/definitions/output.js +46 -0
- package/dist/definitions/output.mjs +39 -0
- package/dist/index.d.ts +143 -146
- package/dist/index.js +62 -5
- package/dist/index.mjs +14 -0
- package/dist/plugins/index.d.ts +3 -7
- package/dist/plugins/index.js +57 -45
- package/dist/plugins/index.mjs +55 -0
- package/dist/sass/formkit-primevue.scss +101 -99
- package/package.json +115 -30
- package/dist/PrimeTreeSelect-Dksx7tL-.js +0 -1881
- package/dist/components-HJnJ39cU.js +0 -255
- package/dist/composables-CZ6f1QYe.js +0 -820
- package/dist/definitions-BHwWaom7.js +0 -1196
- package/dist/index-Ch3MtT1C.d.ts +0 -266
- package/dist/index-EJ8M51RO.d.ts +0 -917
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { AutoCompleteCompleteEvent, AutoCompleteProps } from 'primevue/autocomplete'
|
|
4
|
+
import type { PropType } from 'vue'
|
|
5
|
+
import { ref } from 'vue'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeAutoCompleteProps {
|
|
9
|
+
pt?: AutoCompleteProps['pt']
|
|
10
|
+
ptOptions?: AutoCompleteProps['ptOptions']
|
|
11
|
+
unstyled?: AutoCompleteProps['unstyled']
|
|
12
|
+
dropdown?: AutoCompleteProps['dropdown']
|
|
13
|
+
multiple?: AutoCompleteProps['multiple']
|
|
14
|
+
typeahead?: AutoCompleteProps['typeahead']
|
|
15
|
+
optionLabel?: AutoCompleteProps['optionLabel']
|
|
16
|
+
options?: any[] | undefined
|
|
17
|
+
size?: AutoCompleteProps['size']
|
|
18
|
+
minLength?: AutoCompleteProps['minLength']
|
|
19
|
+
placeholder?: AutoCompleteProps['placeholder']
|
|
20
|
+
fluid?: AutoCompleteProps['fluid']
|
|
21
|
+
separators?: string[] | []
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
context: {
|
|
26
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeAutoCompleteProps>,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
|
|
32
|
+
|
|
33
|
+
const suggestions = ref(['', {}])
|
|
34
|
+
suggestions.value = []
|
|
35
|
+
const loading = ref(false)
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Searches for suggestions based on the input query.
|
|
39
|
+
*/
|
|
40
|
+
async function search(event: AutoCompleteCompleteEvent) {
|
|
41
|
+
if (props.context?.options && props.context?.optionLabel) {
|
|
42
|
+
suggestions.value = props.context.options.filter((option) => {
|
|
43
|
+
return option[`${props.context.optionLabel}`].toString().toLowerCase().includes(event.query.toLowerCase())
|
|
44
|
+
})
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
loading.value = true
|
|
48
|
+
try {
|
|
49
|
+
suggestions.value = await props.context?.attrs.complete(event.query)
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
console.error('Error fetching suggestions:', error)
|
|
53
|
+
suggestions.value = []
|
|
54
|
+
}
|
|
55
|
+
finally {
|
|
56
|
+
loading.value = false
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Handles paste event to transform a string separated by any of the provided separators into multiple items.
|
|
63
|
+
*/
|
|
64
|
+
function handlePaste(event: ClipboardEvent) {
|
|
65
|
+
if (!props.context?.multiple)
|
|
66
|
+
return
|
|
67
|
+
const clipboardData = event.clipboardData
|
|
68
|
+
if (!clipboardData)
|
|
69
|
+
return
|
|
70
|
+
const pastedText = clipboardData.getData('text')
|
|
71
|
+
const separators = Array.isArray(props.context?.separators) && props.context.separators.length > 0
|
|
72
|
+
? props.context.separators
|
|
73
|
+
: [',']
|
|
74
|
+
const regex = new RegExp(`[${separators.map(s => s.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&')).join('')}]`)
|
|
75
|
+
// If separators are provided, split the pasted text by them
|
|
76
|
+
if (pastedText && regex.test(pastedText)) {
|
|
77
|
+
event.preventDefault()
|
|
78
|
+
const items = pastedText
|
|
79
|
+
.split(regex)
|
|
80
|
+
.map(item => item.trim())
|
|
81
|
+
.filter(item => item.length > 0)
|
|
82
|
+
// Use a local ref, never mutate context._value directly
|
|
83
|
+
if (Array.isArray(modelValue.value)) {
|
|
84
|
+
modelValue.value = [...modelValue.value, ...items]
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
modelValue.value = items
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// If no separators, just set the value directly
|
|
91
|
+
else if (pastedText) {
|
|
92
|
+
event.preventDefault()
|
|
93
|
+
// If no separators, just set the value directly
|
|
94
|
+
if (Array.isArray(modelValue.value)) {
|
|
95
|
+
modelValue.value = [...modelValue.value, pastedText.trim()]
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
modelValue.value = [pastedText.trim()]
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
</script>
|
|
103
|
+
|
|
104
|
+
<template>
|
|
105
|
+
<div class="p-formkit">
|
|
106
|
+
<AutoComplete
|
|
107
|
+
:id="context.id"
|
|
108
|
+
v-model="modelValue"
|
|
109
|
+
v-bind="context?.attrs"
|
|
110
|
+
:disabled="!!context?.disabled"
|
|
111
|
+
:class="context?.attrs?.class"
|
|
112
|
+
:invalid="isInvalid"
|
|
113
|
+
:tabindex="context?.attrs.tabindex"
|
|
114
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
115
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
116
|
+
:size="context?.size ?? undefined"
|
|
117
|
+
:suggestions="suggestions"
|
|
118
|
+
:option-label="context?.optionLabel"
|
|
119
|
+
:dropdown="context?.dropdown ?? false"
|
|
120
|
+
:multiple="context?.multiple ?? false"
|
|
121
|
+
:typeahead="context?.typeahead ?? true"
|
|
122
|
+
:min-length="context?.minLength ?? undefined"
|
|
123
|
+
:placeholder="context?.placeholder ?? undefined"
|
|
124
|
+
:fluid="context?.fluid ?? undefined"
|
|
125
|
+
:pt="context?.pt"
|
|
126
|
+
:pt-options="context?.ptOptions"
|
|
127
|
+
:unstyled="unstyled"
|
|
128
|
+
:loading="loading"
|
|
129
|
+
@keydown.enter.prevent
|
|
130
|
+
@complete="search"
|
|
131
|
+
@change="handleInput"
|
|
132
|
+
@blur="handleBlur"
|
|
133
|
+
@paste="handlePaste"
|
|
134
|
+
>
|
|
135
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
136
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
137
|
+
</template>
|
|
138
|
+
</AutoComplete>
|
|
139
|
+
</div>
|
|
140
|
+
</template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { AutoCompleteProps } from 'primevue/autocomplete';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeAutoCompleteProps {
|
|
5
|
+
pt?: AutoCompleteProps['pt'];
|
|
6
|
+
ptOptions?: AutoCompleteProps['ptOptions'];
|
|
7
|
+
unstyled?: AutoCompleteProps['unstyled'];
|
|
8
|
+
dropdown?: AutoCompleteProps['dropdown'];
|
|
9
|
+
multiple?: AutoCompleteProps['multiple'];
|
|
10
|
+
typeahead?: AutoCompleteProps['typeahead'];
|
|
11
|
+
optionLabel?: AutoCompleteProps['optionLabel'];
|
|
12
|
+
options?: any[] | undefined;
|
|
13
|
+
size?: AutoCompleteProps['size'];
|
|
14
|
+
minLength?: AutoCompleteProps['minLength'];
|
|
15
|
+
placeholder?: AutoCompleteProps['placeholder'];
|
|
16
|
+
fluid?: AutoCompleteProps['fluid'];
|
|
17
|
+
separators?: string[] | [];
|
|
18
|
+
}
|
|
19
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
20
|
+
context: {
|
|
21
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeAutoCompleteProps>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
|
+
context: {
|
|
26
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeAutoCompleteProps>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
30
|
+
declare const _default: typeof __VLS_export;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { CascadeSelectProps } from 'primevue/cascadeselect';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeCascadeSelectProps {
|
|
5
|
+
options?: CascadeSelectProps['options'];
|
|
6
|
+
optionLabel?: CascadeSelectProps['optionLabel'];
|
|
7
|
+
optionValue?: CascadeSelectProps['optionValue'];
|
|
8
|
+
optionGroupLabel?: CascadeSelectProps['optionGroupLabel'];
|
|
9
|
+
optionGroupChildren?: CascadeSelectProps['optionGroupChildren'];
|
|
10
|
+
placeholder?: CascadeSelectProps['placeholder'];
|
|
11
|
+
pt?: CascadeSelectProps['pt'];
|
|
12
|
+
ptOptions?: CascadeSelectProps['ptOptions'];
|
|
13
|
+
unstyled?: CascadeSelectProps['unstyled'];
|
|
14
|
+
size?: CascadeSelectProps['size'];
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
context: {
|
|
18
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
context: {
|
|
23
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { CascadeSelectProps } from 'primevue/cascadeselect'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeCascadeSelectProps {
|
|
9
|
+
options?: CascadeSelectProps['options']
|
|
10
|
+
optionLabel?: CascadeSelectProps['optionLabel']
|
|
11
|
+
optionValue?: CascadeSelectProps['optionValue']
|
|
12
|
+
optionGroupLabel?: CascadeSelectProps['optionGroupLabel']
|
|
13
|
+
optionGroupChildren?: CascadeSelectProps['optionGroupChildren']
|
|
14
|
+
placeholder?: CascadeSelectProps['placeholder']
|
|
15
|
+
pt?: CascadeSelectProps['pt']
|
|
16
|
+
ptOptions?: CascadeSelectProps['ptOptions']
|
|
17
|
+
unstyled?: CascadeSelectProps['unstyled']
|
|
18
|
+
size?: CascadeSelectProps['size']
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const props = defineProps({
|
|
22
|
+
context: {
|
|
23
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="p-formkit">
|
|
33
|
+
<CascadeSelect
|
|
34
|
+
:id="context.id"
|
|
35
|
+
v-model="modelValue"
|
|
36
|
+
v-bind="context?.attrs"
|
|
37
|
+
:disabled="!!context?.disabled"
|
|
38
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
39
|
+
:class="context?.attrs?.class"
|
|
40
|
+
:invalid="isInvalid"
|
|
41
|
+
:tabindex="context?.attrs.tabindex"
|
|
42
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
43
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
44
|
+
:size="context?.size ?? undefined"
|
|
45
|
+
:options="context?.options"
|
|
46
|
+
:option-label="context?.optionLabel"
|
|
47
|
+
:option-value="context.optionValue"
|
|
48
|
+
:option-group-label="context.optionGroupLabel"
|
|
49
|
+
:option-group-children="context.optionGroupChildren"
|
|
50
|
+
:placeholder="context.placeholder"
|
|
51
|
+
:pt="context.pt"
|
|
52
|
+
:pt-options="context.ptOptions"
|
|
53
|
+
:unstyled="unstyled"
|
|
54
|
+
@change="handleInput"
|
|
55
|
+
@blur="handleBlur"
|
|
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
|
+
</CascadeSelect>
|
|
61
|
+
</div>
|
|
62
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { CascadeSelectProps } from 'primevue/cascadeselect';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeCascadeSelectProps {
|
|
5
|
+
options?: CascadeSelectProps['options'];
|
|
6
|
+
optionLabel?: CascadeSelectProps['optionLabel'];
|
|
7
|
+
optionValue?: CascadeSelectProps['optionValue'];
|
|
8
|
+
optionGroupLabel?: CascadeSelectProps['optionGroupLabel'];
|
|
9
|
+
optionGroupChildren?: CascadeSelectProps['optionGroupChildren'];
|
|
10
|
+
placeholder?: CascadeSelectProps['placeholder'];
|
|
11
|
+
pt?: CascadeSelectProps['pt'];
|
|
12
|
+
ptOptions?: CascadeSelectProps['ptOptions'];
|
|
13
|
+
unstyled?: CascadeSelectProps['unstyled'];
|
|
14
|
+
size?: CascadeSelectProps['size'];
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
context: {
|
|
18
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
context: {
|
|
23
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { CheckboxProps } from 'primevue/checkbox';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeCheckboxProps {
|
|
5
|
+
binary?: CheckboxProps['binary'];
|
|
6
|
+
trueValue?: CheckboxProps['trueValue'];
|
|
7
|
+
falseValue?: CheckboxProps['falseValue'];
|
|
8
|
+
pt?: CheckboxProps['pt'];
|
|
9
|
+
ptOptions?: CheckboxProps['ptOptions'];
|
|
10
|
+
unstyled?: CheckboxProps['unstyled'];
|
|
11
|
+
indeterminate?: CheckboxProps['indeterminate'];
|
|
12
|
+
variant?: CheckboxProps['variant'];
|
|
13
|
+
size?: CheckboxProps['size'];
|
|
14
|
+
}
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
|
+
context: {
|
|
17
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
context: {
|
|
22
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { CheckboxProps } from 'primevue/checkbox'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { useFormKitInput, useFormKitSection } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeCheckboxProps {
|
|
9
|
+
binary?: CheckboxProps['binary']
|
|
10
|
+
trueValue?: CheckboxProps['trueValue']
|
|
11
|
+
falseValue?: CheckboxProps['falseValue']
|
|
12
|
+
pt?: CheckboxProps['pt']
|
|
13
|
+
ptOptions?: CheckboxProps['ptOptions']
|
|
14
|
+
unstyled?: CheckboxProps['unstyled']
|
|
15
|
+
indeterminate?: CheckboxProps['indeterminate']
|
|
16
|
+
variant?: CheckboxProps['variant']
|
|
17
|
+
size?: CheckboxProps['size']
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const props = defineProps({
|
|
21
|
+
context: {
|
|
22
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
const { hasPrefix, hasSuffix, generateId } = useFormKitSection(props.context)
|
|
28
|
+
|
|
29
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
|
|
30
|
+
|
|
31
|
+
const generatedId = generateId()
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div class="p-formkit">
|
|
36
|
+
<label v-if="hasPrefix" :for="generatedId" class="formkit-prefix">
|
|
37
|
+
{{ context?.prefix }}
|
|
38
|
+
</label>
|
|
39
|
+
<Checkbox
|
|
40
|
+
v-model="modelValue"
|
|
41
|
+
v-bind="context?.attrs"
|
|
42
|
+
:input-id="generatedId"
|
|
43
|
+
:disabled="!!context?.disabled"
|
|
44
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
45
|
+
:input-style="context?.attrs.style"
|
|
46
|
+
:input-class="context?.attrs?.class"
|
|
47
|
+
:invalid="isInvalid"
|
|
48
|
+
:tabindex="context?.attrs.tabindex"
|
|
49
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
50
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
51
|
+
:size="context?.size ?? undefined"
|
|
52
|
+
:indeterminate="context.indeterminate ?? undefined"
|
|
53
|
+
:binary="context.binary ?? true"
|
|
54
|
+
:variant="context.variant ?? 'outlined'"
|
|
55
|
+
:true-value="context.trueValue ?? undefined"
|
|
56
|
+
:false-value="context.falseValue ?? undefined"
|
|
57
|
+
:pt="context.pt"
|
|
58
|
+
:pt-options="context.ptOptions"
|
|
59
|
+
:unstyled="unstyled"
|
|
60
|
+
@change="handleInput"
|
|
61
|
+
@blur="handleBlur"
|
|
62
|
+
>
|
|
63
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
64
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
65
|
+
</template>
|
|
66
|
+
</Checkbox>
|
|
67
|
+
<label v-if="hasSuffix" :for="generatedId" class="formkit-suffix">
|
|
68
|
+
{{ context?.suffix }}
|
|
69
|
+
</label>
|
|
70
|
+
</div>
|
|
71
|
+
</template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { CheckboxProps } from 'primevue/checkbox';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeCheckboxProps {
|
|
5
|
+
binary?: CheckboxProps['binary'];
|
|
6
|
+
trueValue?: CheckboxProps['trueValue'];
|
|
7
|
+
falseValue?: CheckboxProps['falseValue'];
|
|
8
|
+
pt?: CheckboxProps['pt'];
|
|
9
|
+
ptOptions?: CheckboxProps['ptOptions'];
|
|
10
|
+
unstyled?: CheckboxProps['unstyled'];
|
|
11
|
+
indeterminate?: CheckboxProps['indeterminate'];
|
|
12
|
+
variant?: CheckboxProps['variant'];
|
|
13
|
+
size?: CheckboxProps['size'];
|
|
14
|
+
}
|
|
15
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
16
|
+
context: {
|
|
17
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
21
|
+
context: {
|
|
22
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
declare const _default: typeof __VLS_export;
|
|
27
|
+
export default _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { ColorPickerProps } from 'primevue/colorpicker';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeColorPickerProps {
|
|
5
|
+
defaultColor?: ColorPickerProps['defaultColor'];
|
|
6
|
+
inline?: ColorPickerProps['inline'];
|
|
7
|
+
format?: ColorPickerProps['format'];
|
|
8
|
+
pt?: ColorPickerProps['pt'];
|
|
9
|
+
ptOptions?: ColorPickerProps['ptOptions'];
|
|
10
|
+
unstyled?: ColorPickerProps['unstyled'];
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
context: {
|
|
14
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
context: {
|
|
19
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { ColorPickerProps } from 'primevue/colorpicker'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeColorPickerProps {
|
|
9
|
+
defaultColor?: ColorPickerProps['defaultColor']
|
|
10
|
+
inline?: ColorPickerProps['inline']
|
|
11
|
+
format?: ColorPickerProps['format']
|
|
12
|
+
pt?: ColorPickerProps['pt']
|
|
13
|
+
ptOptions?: ColorPickerProps['ptOptions']
|
|
14
|
+
unstyled?: ColorPickerProps['unstyled']
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const props = defineProps({
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const { unstyled, handleChange, modelValue } = useFormKitInput(props.context)
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="p-formkit">
|
|
29
|
+
<ColorPicker
|
|
30
|
+
v-model="modelValue"
|
|
31
|
+
v-bind="context?.attrs"
|
|
32
|
+
:disabled="!!context?.disabled"
|
|
33
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
34
|
+
:style="context?.attrs.style"
|
|
35
|
+
:panel-class="context?.attrs.class"
|
|
36
|
+
:tabindex="context?.attrs.tabindex"
|
|
37
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
38
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
39
|
+
:default-color="context.defaultColor ?? 'ff0000'"
|
|
40
|
+
:inline="context.inline ?? false"
|
|
41
|
+
:format="context.format"
|
|
42
|
+
:pt="context.pt"
|
|
43
|
+
:pt-options="context.ptOptions"
|
|
44
|
+
:unstyled="unstyled"
|
|
45
|
+
@change="handleChange"
|
|
46
|
+
/>
|
|
47
|
+
</div>
|
|
48
|
+
</template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { ColorPickerProps } from 'primevue/colorpicker';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeColorPickerProps {
|
|
5
|
+
defaultColor?: ColorPickerProps['defaultColor'];
|
|
6
|
+
inline?: ColorPickerProps['inline'];
|
|
7
|
+
format?: ColorPickerProps['format'];
|
|
8
|
+
pt?: ColorPickerProps['pt'];
|
|
9
|
+
ptOptions?: ColorPickerProps['ptOptions'];
|
|
10
|
+
unstyled?: ColorPickerProps['unstyled'];
|
|
11
|
+
}
|
|
12
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
context: {
|
|
14
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>;
|
|
15
|
+
required: true;
|
|
16
|
+
};
|
|
17
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
18
|
+
context: {
|
|
19
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { DatePickerProps } from 'primevue/datepicker';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeDatePickerProps {
|
|
5
|
+
dateFormat?: DatePickerProps['dateFormat'];
|
|
6
|
+
placeholder?: DatePickerProps['placeholder'];
|
|
7
|
+
selectionMode?: DatePickerProps['selectionMode'];
|
|
8
|
+
inline?: DatePickerProps['inline'];
|
|
9
|
+
icon?: DatePickerProps['icon'];
|
|
10
|
+
showOtherMonths?: DatePickerProps['showOtherMonths'];
|
|
11
|
+
selectOtherMonths?: DatePickerProps['selectOtherMonths'];
|
|
12
|
+
showIcon?: DatePickerProps['showIcon'];
|
|
13
|
+
prevIcon?: DatePickerProps['prevIcon'];
|
|
14
|
+
nextIcon?: DatePickerProps['nextIcon'];
|
|
15
|
+
incrementIcon?: DatePickerProps['incrementIcon'];
|
|
16
|
+
decrementIcon?: DatePickerProps['decrementIcon'];
|
|
17
|
+
numberOfMonths?: DatePickerProps['numberOfMonths'];
|
|
18
|
+
responsiveOptions?: DatePickerProps['responsiveOptions'];
|
|
19
|
+
view?: DatePickerProps['view'];
|
|
20
|
+
minDate?: DatePickerProps['minDate'];
|
|
21
|
+
maxDate?: DatePickerProps['maxDate'];
|
|
22
|
+
disabledDates?: DatePickerProps['disabledDates'];
|
|
23
|
+
disabledDays?: DatePickerProps['disabledDays'];
|
|
24
|
+
maxDateCount?: DatePickerProps['maxDateCount'];
|
|
25
|
+
showOnFocus?: DatePickerProps['showOnFocus'];
|
|
26
|
+
autoZIndex?: DatePickerProps['autoZIndex'];
|
|
27
|
+
baseZIndex?: DatePickerProps['baseZIndex'];
|
|
28
|
+
showButtonBar?: DatePickerProps['showButtonBar'];
|
|
29
|
+
showTime?: DatePickerProps['showTime'];
|
|
30
|
+
timeOnly?: DatePickerProps['timeOnly'];
|
|
31
|
+
shortYearCutoff?: DatePickerProps['shortYearCutoff'];
|
|
32
|
+
hourFormat?: DatePickerProps['hourFormat'];
|
|
33
|
+
stepHour?: DatePickerProps['stepHour'];
|
|
34
|
+
stepMinute?: DatePickerProps['stepMinute'];
|
|
35
|
+
stepSecond?: DatePickerProps['stepSecond'];
|
|
36
|
+
showSeconds?: DatePickerProps['showSeconds'];
|
|
37
|
+
hideOnDateTimeSelect?: DatePickerProps['hideOnDateTimeSelect'];
|
|
38
|
+
hideOnRangeSelection?: DatePickerProps['hideOnRangeSelection'];
|
|
39
|
+
timeSeparator?: DatePickerProps['timeSeparator'];
|
|
40
|
+
showWeek?: DatePickerProps['showWeek'];
|
|
41
|
+
manualInput?: DatePickerProps['manualInput'];
|
|
42
|
+
appendTo?: DatePickerProps['appendTo'];
|
|
43
|
+
panelStyle?: DatePickerProps['panelStyle'];
|
|
44
|
+
panelClass?: DatePickerProps['panelClass'];
|
|
45
|
+
pt?: DatePickerProps['pt'];
|
|
46
|
+
ptOptions?: DatePickerProps['ptOptions'];
|
|
47
|
+
unstyled?: DatePickerProps['unstyled'];
|
|
48
|
+
size?: DatePickerProps['size'];
|
|
49
|
+
updateModelType?: DatePickerProps['updateModelType'];
|
|
50
|
+
}
|
|
51
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
52
|
+
context: {
|
|
53
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeDatePickerProps>;
|
|
54
|
+
required: true;
|
|
55
|
+
};
|
|
56
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
57
|
+
context: {
|
|
58
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeDatePickerProps>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
62
|
+
declare const _default: typeof __VLS_export;
|
|
63
|
+
export default _default;
|