@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,153 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { DatePickerBlurEvent, DatePickerProps } from 'primevue/datepicker'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeDatePickerProps {
|
|
9
|
+
dateFormat?: DatePickerProps['dateFormat']
|
|
10
|
+
placeholder?: DatePickerProps['placeholder']
|
|
11
|
+
selectionMode?: DatePickerProps['selectionMode']
|
|
12
|
+
inline?: DatePickerProps['inline']
|
|
13
|
+
icon?: DatePickerProps['icon']
|
|
14
|
+
showOtherMonths?: DatePickerProps['showOtherMonths']
|
|
15
|
+
selectOtherMonths?: DatePickerProps['selectOtherMonths']
|
|
16
|
+
showIcon?: DatePickerProps['showIcon']
|
|
17
|
+
prevIcon?: DatePickerProps['prevIcon']
|
|
18
|
+
nextIcon?: DatePickerProps['nextIcon']
|
|
19
|
+
incrementIcon?: DatePickerProps['incrementIcon']
|
|
20
|
+
decrementIcon?: DatePickerProps['decrementIcon']
|
|
21
|
+
numberOfMonths?: DatePickerProps['numberOfMonths']
|
|
22
|
+
responsiveOptions?: DatePickerProps['responsiveOptions']
|
|
23
|
+
view?: DatePickerProps['view']
|
|
24
|
+
minDate?: DatePickerProps['minDate']
|
|
25
|
+
maxDate?: DatePickerProps['maxDate']
|
|
26
|
+
disabledDates?: DatePickerProps['disabledDates']
|
|
27
|
+
disabledDays?: DatePickerProps['disabledDays']
|
|
28
|
+
maxDateCount?: DatePickerProps['maxDateCount']
|
|
29
|
+
showOnFocus?: DatePickerProps['showOnFocus']
|
|
30
|
+
autoZIndex?: DatePickerProps['autoZIndex']
|
|
31
|
+
baseZIndex?: DatePickerProps['baseZIndex']
|
|
32
|
+
showButtonBar?: DatePickerProps['showButtonBar']
|
|
33
|
+
showTime?: DatePickerProps['showTime']
|
|
34
|
+
timeOnly?: DatePickerProps['timeOnly']
|
|
35
|
+
shortYearCutoff?: DatePickerProps['shortYearCutoff']
|
|
36
|
+
hourFormat?: DatePickerProps['hourFormat']
|
|
37
|
+
stepHour?: DatePickerProps['stepHour']
|
|
38
|
+
stepMinute?: DatePickerProps['stepMinute']
|
|
39
|
+
stepSecond?: DatePickerProps['stepSecond']
|
|
40
|
+
showSeconds?: DatePickerProps['showSeconds']
|
|
41
|
+
hideOnDateTimeSelect?: DatePickerProps['hideOnDateTimeSelect']
|
|
42
|
+
hideOnRangeSelection?: DatePickerProps['hideOnRangeSelection']
|
|
43
|
+
timeSeparator?: DatePickerProps['timeSeparator']
|
|
44
|
+
showWeek?: DatePickerProps['showWeek']
|
|
45
|
+
manualInput?: DatePickerProps['manualInput']
|
|
46
|
+
appendTo?: DatePickerProps['appendTo']
|
|
47
|
+
panelStyle?: DatePickerProps['panelStyle']
|
|
48
|
+
panelClass?: DatePickerProps['panelClass']
|
|
49
|
+
pt?: DatePickerProps['pt']
|
|
50
|
+
ptOptions?: DatePickerProps['ptOptions']
|
|
51
|
+
unstyled?: DatePickerProps['unstyled']
|
|
52
|
+
size?: DatePickerProps['size']
|
|
53
|
+
updateModelType?: DatePickerProps['updateModelType']
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const props = defineProps({
|
|
57
|
+
context: {
|
|
58
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeDatePickerProps>,
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
|
|
63
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, modelValue } = useFormKitInput(props.context)
|
|
64
|
+
|
|
65
|
+
function handleBlur(e: DatePickerBlurEvent) {
|
|
66
|
+
props.context?.handlers.blur(e.originalEvent as FocusEvent)
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function handleClearClick() {
|
|
70
|
+
props.context?.node.input(null)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function handleSelect(e: any) {
|
|
74
|
+
if (props.context?.selectionMode === 'range' || props.context?.selectionMode === 'multiple') {
|
|
75
|
+
props.context?.node.input(props.context._value)
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
props.context?.node.input(e)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
</script>
|
|
82
|
+
|
|
83
|
+
<template>
|
|
84
|
+
<div class="p-formkit">
|
|
85
|
+
<DatePicker
|
|
86
|
+
v-model="modelValue"
|
|
87
|
+
v-bind="context?.attrs"
|
|
88
|
+
:input-id="context.id"
|
|
89
|
+
:disabled="!!context?.disabled"
|
|
90
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
91
|
+
:input-style="context?.attrs.style"
|
|
92
|
+
:input-class="context?.attrs?.class"
|
|
93
|
+
:invalid="isInvalid"
|
|
94
|
+
:tabindex="context?.attrs.tabindex"
|
|
95
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
96
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
97
|
+
:size="context?.size ?? undefined"
|
|
98
|
+
:date-format="context?.dateFormat"
|
|
99
|
+
:placeholder="context?.placeholder"
|
|
100
|
+
:selection-mode="context?.selectionMode ?? 'single'"
|
|
101
|
+
:inline="context?.inline ?? false"
|
|
102
|
+
:show-other-months="context?.showOtherMonths ?? true"
|
|
103
|
+
:select-other-months="context?.selectOtherMonths ?? false"
|
|
104
|
+
:icon="context?.icon"
|
|
105
|
+
:show-icon="context.showIcon"
|
|
106
|
+
:previous-icon="context?.previousIcon"
|
|
107
|
+
:next-icon="context?.nextIcon"
|
|
108
|
+
:increment-icon="context?.incrementIcon"
|
|
109
|
+
:decrement-icon="context?.decrementIcon"
|
|
110
|
+
:number-of-months="context?.numberOfMonths ?? 1"
|
|
111
|
+
:responsive-options="context?.responsiveOptions"
|
|
112
|
+
:view="context?.view ?? 'date'"
|
|
113
|
+
:touch-u-i="context?.touchUI ?? false"
|
|
114
|
+
:min-date="context?.minDate"
|
|
115
|
+
:max-date="context?.maxDate"
|
|
116
|
+
:disabled-dates="context?.disabledDates"
|
|
117
|
+
:disabled-days="context?.disabledDays"
|
|
118
|
+
:max-date-count="context?.maxDateCount"
|
|
119
|
+
:show-on-focus="context?.showOnFocus ?? true"
|
|
120
|
+
:auto-z-index="context?.autoZIndex ?? true"
|
|
121
|
+
:base-z-index="context?.baseZIndex ?? 0"
|
|
122
|
+
:show-button-bar="context?.showButtonBar ?? false"
|
|
123
|
+
:show-time="context?.showTime ?? false"
|
|
124
|
+
:time-only="context?.timeOnly ?? false"
|
|
125
|
+
:short-year-cutoff="context?.shortYearCutoff ?? '+10'"
|
|
126
|
+
:hour-format="context?.hourFormat ?? '24'"
|
|
127
|
+
:step-hour="context?.stepHour ?? 1"
|
|
128
|
+
:step-minute="context?.stepMinute ?? 1"
|
|
129
|
+
:step-second="context?.stepSecond ?? 1"
|
|
130
|
+
:show-seconds="context?.showSeconds ?? false"
|
|
131
|
+
:hide-on-date-time-select="context?.hideOnDateTimeSelect ?? false"
|
|
132
|
+
:hide-on-range-selection="context?.hideOnRangeSelection ?? false"
|
|
133
|
+
:time-separator="context?.timeSeparator ?? ':'"
|
|
134
|
+
:show-week="context?.showWeek ?? false"
|
|
135
|
+
:manual-input="context?.manualInput ?? true"
|
|
136
|
+
:append-to="context?.appendTo ?? 'body'"
|
|
137
|
+
:panel-style="context?.panelStyle"
|
|
138
|
+
:panel-class="context?.panelClass"
|
|
139
|
+
:pt="context?.pt"
|
|
140
|
+
:pt-options="context?.ptOptions"
|
|
141
|
+
:unstyled="unstyled"
|
|
142
|
+
:update-model-type="context?.updateModelType ?? 'date'"
|
|
143
|
+
@date-select="handleSelect"
|
|
144
|
+
@blur="handleBlur"
|
|
145
|
+
@clear-click="handleClearClick"
|
|
146
|
+
@value-change="handleInput"
|
|
147
|
+
>
|
|
148
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
149
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
150
|
+
</template>
|
|
151
|
+
</DatePicker>
|
|
152
|
+
</div>
|
|
153
|
+
</template>
|
|
@@ -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;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputMaskProps } from 'primevue/inputmask';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputMaskProps {
|
|
5
|
+
mask?: InputMaskProps['mask'];
|
|
6
|
+
slotChar?: InputMaskProps['slotChar'];
|
|
7
|
+
autoClear?: InputMaskProps['autoClear'];
|
|
8
|
+
unmask?: InputMaskProps['unmask'];
|
|
9
|
+
pt?: InputMaskProps['pt'];
|
|
10
|
+
ptOptions?: InputMaskProps['ptOptions'];
|
|
11
|
+
unstyled?: InputMaskProps['unstyled'];
|
|
12
|
+
invalid?: InputMaskProps['invalid'];
|
|
13
|
+
variant?: InputMaskProps['variant'];
|
|
14
|
+
size?: InputMaskProps['size'];
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
context: {
|
|
18
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputMaskProps>;
|
|
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 & FormKitPrimeInputMaskProps>;
|
|
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,88 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { InputMaskProps } from 'primevue/inputmask'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import IconField from 'primevue/iconfield'
|
|
7
|
+
import InputIcon from 'primevue/inputicon'
|
|
8
|
+
import { useFormKitInput, useFormKitSection } from '../composables'
|
|
9
|
+
|
|
10
|
+
export interface FormKitPrimeInputMaskProps {
|
|
11
|
+
mask?: InputMaskProps['mask']
|
|
12
|
+
slotChar?: InputMaskProps['slotChar']
|
|
13
|
+
autoClear?: InputMaskProps['autoClear']
|
|
14
|
+
unmask?: InputMaskProps['unmask']
|
|
15
|
+
pt?: InputMaskProps['pt']
|
|
16
|
+
ptOptions?: InputMaskProps['ptOptions']
|
|
17
|
+
unstyled?: InputMaskProps['unstyled']
|
|
18
|
+
invalid?: InputMaskProps['invalid']
|
|
19
|
+
variant?: InputMaskProps['variant']
|
|
20
|
+
size?: InputMaskProps['size']
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const props = defineProps({
|
|
24
|
+
context: {
|
|
25
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeInputMaskProps>,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
|
|
31
|
+
const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div class="p-formkit">
|
|
36
|
+
<IconField v-if="hasPrefixIcon || hasSuffixIcon">
|
|
37
|
+
<InputIcon v-if="hasPrefixIcon" :class="context?.iconPrefix" />
|
|
38
|
+
<InputMask
|
|
39
|
+
:id="context.id"
|
|
40
|
+
v-model="modelValue"
|
|
41
|
+
v-bind="context?.attrs"
|
|
42
|
+
:disabled="!!context?.disabled"
|
|
43
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
44
|
+
:class="context?.attrs?.class"
|
|
45
|
+
:invalid="isInvalid"
|
|
46
|
+
:tabindex="context?.attrs.tabindex"
|
|
47
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
48
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
49
|
+
:size="context?.size ?? undefined"
|
|
50
|
+
:mask="context.mask ?? undefined"
|
|
51
|
+
:slot-char="context.slotChar ?? '_'"
|
|
52
|
+
:auto-clear="context.autoClear ?? true"
|
|
53
|
+
:unmask="context.unmask ?? false"
|
|
54
|
+
:pt="context.pt"
|
|
55
|
+
:variant="context.variant"
|
|
56
|
+
:pt-options="context.ptOptions"
|
|
57
|
+
:unstyled="unstyled"
|
|
58
|
+
@update:model-value="handleInput"
|
|
59
|
+
@blur="handleBlur"
|
|
60
|
+
/>
|
|
61
|
+
<InputIcon v-if="hasSuffixIcon" :class="context?.iconSuffix" />
|
|
62
|
+
</IconField>
|
|
63
|
+
<InputMask
|
|
64
|
+
v-if="!hasPrefixIcon && !hasSuffixIcon"
|
|
65
|
+
:id="context.id"
|
|
66
|
+
v-model="modelValue"
|
|
67
|
+
v-bind="context?.attrs"
|
|
68
|
+
:disabled="!!context?.disabled"
|
|
69
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
70
|
+
:class="context?.attrs?.class"
|
|
71
|
+
:invalid="isInvalid"
|
|
72
|
+
:tabindex="context?.attrs.tabindex"
|
|
73
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
74
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
75
|
+
:size="context?.size ?? undefined"
|
|
76
|
+
:mask="context.mask ?? undefined"
|
|
77
|
+
:slot-char="context.slotChar ?? '_'"
|
|
78
|
+
:auto-clear="context.autoClear ?? true"
|
|
79
|
+
:unmask="context.unmask ?? false"
|
|
80
|
+
:pt="context.pt"
|
|
81
|
+
:variant="context.variant"
|
|
82
|
+
:pt-options="context.ptOptions"
|
|
83
|
+
:unstyled="unstyled"
|
|
84
|
+
@update:model-value="handleInput"
|
|
85
|
+
@blur="handleBlur"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
</template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputMaskProps } from 'primevue/inputmask';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputMaskProps {
|
|
5
|
+
mask?: InputMaskProps['mask'];
|
|
6
|
+
slotChar?: InputMaskProps['slotChar'];
|
|
7
|
+
autoClear?: InputMaskProps['autoClear'];
|
|
8
|
+
unmask?: InputMaskProps['unmask'];
|
|
9
|
+
pt?: InputMaskProps['pt'];
|
|
10
|
+
ptOptions?: InputMaskProps['ptOptions'];
|
|
11
|
+
unstyled?: InputMaskProps['unstyled'];
|
|
12
|
+
invalid?: InputMaskProps['invalid'];
|
|
13
|
+
variant?: InputMaskProps['variant'];
|
|
14
|
+
size?: InputMaskProps['size'];
|
|
15
|
+
}
|
|
16
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
17
|
+
context: {
|
|
18
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputMaskProps>;
|
|
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 & FormKitPrimeInputMaskProps>;
|
|
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,36 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputNumberProps } from 'primevue/inputnumber';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputNumberProps {
|
|
5
|
+
useGrouping?: InputNumberProps['useGrouping'];
|
|
6
|
+
min?: InputNumberProps['min'];
|
|
7
|
+
max?: InputNumberProps['max'];
|
|
8
|
+
minFractionDigits?: InputNumberProps['minFractionDigits'];
|
|
9
|
+
maxFractionDigits?: InputNumberProps['maxFractionDigits'];
|
|
10
|
+
locale?: InputNumberProps['locale'];
|
|
11
|
+
mode?: InputNumberProps['mode'];
|
|
12
|
+
currency?: InputNumberProps['currency'];
|
|
13
|
+
prefix?: InputNumberProps['prefix'];
|
|
14
|
+
suffix?: InputNumberProps['suffix'];
|
|
15
|
+
showButtons?: InputNumberProps['showButtons'];
|
|
16
|
+
buttonLayout?: InputNumberProps['buttonLayout'];
|
|
17
|
+
step?: InputNumberProps['step'];
|
|
18
|
+
pt?: InputNumberProps['pt'];
|
|
19
|
+
ptOptions?: InputNumberProps['ptOptions'];
|
|
20
|
+
unstyled?: InputNumberProps['unstyled'];
|
|
21
|
+
placeholder?: InputNumberProps['placeholder'];
|
|
22
|
+
size?: InputNumberProps['size'];
|
|
23
|
+
}
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
25
|
+
context: {
|
|
26
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputNumberProps>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
context: {
|
|
31
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputNumberProps>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { InputNumberBlurEvent, InputNumberProps } from 'primevue/inputnumber'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { watch } from 'vue'
|
|
7
|
+
import { useFormKitInput } from '../composables'
|
|
8
|
+
|
|
9
|
+
export interface FormKitPrimeInputNumberProps {
|
|
10
|
+
useGrouping?: InputNumberProps['useGrouping']
|
|
11
|
+
min?: InputNumberProps['min']
|
|
12
|
+
max?: InputNumberProps['max']
|
|
13
|
+
minFractionDigits?: InputNumberProps['minFractionDigits']
|
|
14
|
+
maxFractionDigits?: InputNumberProps['maxFractionDigits']
|
|
15
|
+
locale?: InputNumberProps['locale']
|
|
16
|
+
mode?: InputNumberProps['mode']
|
|
17
|
+
currency?: InputNumberProps['currency']
|
|
18
|
+
prefix?: InputNumberProps['prefix']
|
|
19
|
+
suffix?: InputNumberProps['suffix']
|
|
20
|
+
showButtons?: InputNumberProps['showButtons']
|
|
21
|
+
buttonLayout?: InputNumberProps['buttonLayout']
|
|
22
|
+
step?: InputNumberProps['step']
|
|
23
|
+
pt?: InputNumberProps['pt']
|
|
24
|
+
ptOptions?: InputNumberProps['ptOptions']
|
|
25
|
+
unstyled?: InputNumberProps['unstyled']
|
|
26
|
+
placeholder?: InputNumberProps['placeholder']
|
|
27
|
+
size?: InputNumberProps['size']
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const props = defineProps({
|
|
31
|
+
context: {
|
|
32
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeInputNumberProps>,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const { validSlotNames, unstyled, isInvalid, modelValue } = useFormKitInput(props.context)
|
|
38
|
+
|
|
39
|
+
function handleBlur(e: InputNumberBlurEvent) {
|
|
40
|
+
props.context?.handlers.blur(e.originalEvent as FocusEvent)
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function handleInput(_: any) {
|
|
44
|
+
if (typeof _.value === 'number' || _.value === null)
|
|
45
|
+
props.context?.node.input(_.value)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function roundToDecimals(value: any, decimals: number) {
|
|
49
|
+
const factor = 10 ** decimals
|
|
50
|
+
return Math.round(value * factor) / factor
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
watch(
|
|
54
|
+
() => props.context._value,
|
|
55
|
+
(newValue) => {
|
|
56
|
+
// Only update if the value is different
|
|
57
|
+
if (newValue !== props.context.node.value && typeof newValue === 'number') {
|
|
58
|
+
if (props.context.maxFractionDigits && props.context.maxFractionDigits > 0) {
|
|
59
|
+
// fix floating-point precision issues
|
|
60
|
+
props.context?.node.input(roundToDecimals(newValue, props.context.maxFractionDigits))
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
props.context?.node.input(newValue)
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
)
|
|
68
|
+
</script>
|
|
69
|
+
|
|
70
|
+
<template>
|
|
71
|
+
<div class="p-formkit">
|
|
72
|
+
<InputNumber
|
|
73
|
+
v-model="modelValue"
|
|
74
|
+
v-bind="context?.attrs"
|
|
75
|
+
:input-id="context.id"
|
|
76
|
+
:disabled="!!context?.disabled"
|
|
77
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
78
|
+
:input-style="context?.attrs.style"
|
|
79
|
+
:input-class="context?.attrs?.class"
|
|
80
|
+
:invalid="isInvalid"
|
|
81
|
+
:tabindex="context?.attrs.tabindex"
|
|
82
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
83
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
84
|
+
:size="context?.size ?? undefined"
|
|
85
|
+
:placeholder="context.placeholder"
|
|
86
|
+
:use-grouping="context.useGrouping ?? true"
|
|
87
|
+
:min="context.min ?? undefined"
|
|
88
|
+
:max="context.max ?? undefined"
|
|
89
|
+
:min-fraction-digits="context.minFractionDigits ?? undefined"
|
|
90
|
+
:max-fraction-digits="context.maxFractionDigits ?? undefined"
|
|
91
|
+
:locale="context.locale ?? undefined"
|
|
92
|
+
:mode="context.mode ?? undefined"
|
|
93
|
+
:currency="context.currency ?? undefined"
|
|
94
|
+
:prefix="context.prefix ?? undefined"
|
|
95
|
+
:suffix="context.suffix ?? undefined"
|
|
96
|
+
:show-buttons="context.showButtons ?? undefined"
|
|
97
|
+
:button-layout="context.buttonLayout ?? 'stacked'"
|
|
98
|
+
:step="context.step ?? undefined"
|
|
99
|
+
:pt="context.pt"
|
|
100
|
+
:pt-options="context.ptOptions"
|
|
101
|
+
:unstyled="unstyled"
|
|
102
|
+
@input="handleInput"
|
|
103
|
+
@blur="handleBlur"
|
|
104
|
+
>
|
|
105
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
106
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
107
|
+
</template>
|
|
108
|
+
</InputNumber>
|
|
109
|
+
</div>
|
|
110
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputNumberProps } from 'primevue/inputnumber';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputNumberProps {
|
|
5
|
+
useGrouping?: InputNumberProps['useGrouping'];
|
|
6
|
+
min?: InputNumberProps['min'];
|
|
7
|
+
max?: InputNumberProps['max'];
|
|
8
|
+
minFractionDigits?: InputNumberProps['minFractionDigits'];
|
|
9
|
+
maxFractionDigits?: InputNumberProps['maxFractionDigits'];
|
|
10
|
+
locale?: InputNumberProps['locale'];
|
|
11
|
+
mode?: InputNumberProps['mode'];
|
|
12
|
+
currency?: InputNumberProps['currency'];
|
|
13
|
+
prefix?: InputNumberProps['prefix'];
|
|
14
|
+
suffix?: InputNumberProps['suffix'];
|
|
15
|
+
showButtons?: InputNumberProps['showButtons'];
|
|
16
|
+
buttonLayout?: InputNumberProps['buttonLayout'];
|
|
17
|
+
step?: InputNumberProps['step'];
|
|
18
|
+
pt?: InputNumberProps['pt'];
|
|
19
|
+
ptOptions?: InputNumberProps['ptOptions'];
|
|
20
|
+
unstyled?: InputNumberProps['unstyled'];
|
|
21
|
+
placeholder?: InputNumberProps['placeholder'];
|
|
22
|
+
size?: InputNumberProps['size'];
|
|
23
|
+
}
|
|
24
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
25
|
+
context: {
|
|
26
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputNumberProps>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
30
|
+
context: {
|
|
31
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputNumberProps>;
|
|
32
|
+
required: true;
|
|
33
|
+
};
|
|
34
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
35
|
+
declare const _default: typeof __VLS_export;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputOtpProps } from 'primevue/inputotp';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputOtpProps {
|
|
5
|
+
unstyled?: InputOtpProps['unstyled'];
|
|
6
|
+
ptOptions?: InputOtpProps['ptOptions'];
|
|
7
|
+
pt?: InputOtpProps['pt'];
|
|
8
|
+
length?: InputOtpProps['length'];
|
|
9
|
+
variant?: InputOtpProps['variant'];
|
|
10
|
+
mask?: InputOtpProps['mask'];
|
|
11
|
+
integerOnly?: InputOtpProps['integerOnly'];
|
|
12
|
+
size?: InputOtpProps['size'];
|
|
13
|
+
}
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
context: {
|
|
16
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
context: {
|
|
21
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
|
+
import type { InputOtpProps } from 'primevue/inputotp'
|
|
4
|
+
|
|
5
|
+
import type { PropType } from 'vue'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
7
|
+
|
|
8
|
+
export interface FormKitPrimeInputOtpProps {
|
|
9
|
+
unstyled?: InputOtpProps['unstyled']
|
|
10
|
+
ptOptions?: InputOtpProps['ptOptions']
|
|
11
|
+
pt?: InputOtpProps['pt']
|
|
12
|
+
length?: InputOtpProps['length']
|
|
13
|
+
variant?: InputOtpProps['variant']
|
|
14
|
+
mask?: InputOtpProps['mask']
|
|
15
|
+
integerOnly?: InputOtpProps['integerOnly']
|
|
16
|
+
size?: InputOtpProps['size']
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const props = defineProps({
|
|
20
|
+
context: {
|
|
21
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const { validSlotNames, unstyled, isInvalid, handleBlur, handleInput, modelValue } = useFormKitInput(props.context)
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<template>
|
|
30
|
+
<div class="p-formkit">
|
|
31
|
+
<InputOtp
|
|
32
|
+
:id="context.id"
|
|
33
|
+
v-model="modelValue"
|
|
34
|
+
v-bind="context?.attrs"
|
|
35
|
+
:disabled="!!context?.disabled"
|
|
36
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
37
|
+
:style="context?.attrs.style"
|
|
38
|
+
:class="context?.attrs?.class"
|
|
39
|
+
:invalid="isInvalid"
|
|
40
|
+
:tabindex="context?.attrs.tabindex"
|
|
41
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
42
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
43
|
+
:size="context?.size ?? undefined"
|
|
44
|
+
:length="context.length"
|
|
45
|
+
:variant="context.variant"
|
|
46
|
+
:mask="context.mask"
|
|
47
|
+
:integer-only="context.integerOnly"
|
|
48
|
+
:pt="context.pt"
|
|
49
|
+
:pt-options="context.ptOptions"
|
|
50
|
+
:unstyled="unstyled"
|
|
51
|
+
@change="handleInput"
|
|
52
|
+
@blur="handleBlur"
|
|
53
|
+
>
|
|
54
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
55
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
56
|
+
</template>
|
|
57
|
+
</InputOtp>
|
|
58
|
+
</div>
|
|
59
|
+
</template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
|
+
import type { InputOtpProps } from 'primevue/inputotp';
|
|
3
|
+
import type { PropType } from 'vue';
|
|
4
|
+
export interface FormKitPrimeInputOtpProps {
|
|
5
|
+
unstyled?: InputOtpProps['unstyled'];
|
|
6
|
+
ptOptions?: InputOtpProps['ptOptions'];
|
|
7
|
+
pt?: InputOtpProps['pt'];
|
|
8
|
+
length?: InputOtpProps['length'];
|
|
9
|
+
variant?: InputOtpProps['variant'];
|
|
10
|
+
mask?: InputOtpProps['mask'];
|
|
11
|
+
integerOnly?: InputOtpProps['integerOnly'];
|
|
12
|
+
size?: InputOtpProps['size'];
|
|
13
|
+
}
|
|
14
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
15
|
+
context: {
|
|
16
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
20
|
+
context: {
|
|
21
|
+
type: PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
25
|
+
declare const _default: typeof __VLS_export;
|
|
26
|
+
export default _default;
|