@sfxcode/formkit-primevue 3.2.10 → 3.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -138
- package/dist/PrimeTreeSelect-Dksx7tL-.js +1881 -0
- package/dist/components/index.d.ts +2 -24
- package/dist/components/index.js +4 -167
- package/dist/components-HJnJ39cU.js +255 -0
- package/dist/composables/index.d.ts +2 -9
- package/dist/composables/index.js +2 -61
- package/dist/composables-CZ6f1QYe.js +820 -0
- package/dist/definitions/index.d.ts +37 -32
- package/dist/definitions/index.js +4 -42
- package/dist/definitions-BHwWaom7.js +1196 -0
- package/dist/index-Ch3MtT1C.d.ts +266 -0
- package/dist/index-EJ8M51RO.d.ts +917 -0
- package/dist/index.d.ts +146 -143
- package/dist/index.js +5 -62
- package/dist/plugins/index.d.ts +7 -3
- package/dist/plugins/index.js +45 -57
- package/dist/sass/formkit-primevue.scss +99 -101
- package/package.json +32 -117
- package/LICENSE +0 -21
- package/components.d.ts +0 -1
- package/dist/components/FormKitDataDebug.d.vue.ts +0 -24
- package/dist/components/FormKitDataDebug.vue +0 -23
- package/dist/components/FormKitDataDebug.vue.d.ts +0 -24
- package/dist/components/FormKitDataEdit.d.vue.ts +0 -180
- package/dist/components/FormKitDataEdit.vue +0 -126
- package/dist/components/FormKitDataEdit.vue.d.ts +0 -180
- package/dist/components/FormKitDataView.d.vue.ts +0 -73
- package/dist/components/FormKitDataView.vue +0 -58
- package/dist/components/FormKitDataView.vue.d.ts +0 -73
- package/dist/components/FormKitIcon.d.vue.ts +0 -39
- package/dist/components/FormKitIcon.vue +0 -25
- package/dist/components/FormKitIcon.vue.d.ts +0 -39
- package/dist/components/FormKitPrefix.d.vue.ts +0 -7
- package/dist/components/FormKitPrefix.vue +0 -11
- package/dist/components/FormKitPrefix.vue.d.ts +0 -7
- package/dist/components/FormKitSuffix.d.vue.ts +0 -7
- package/dist/components/FormKitSuffix.vue +0 -11
- package/dist/components/FormKitSuffix.vue.d.ts +0 -7
- package/dist/components/PrimeAutoComplete.d.vue.ts +0 -31
- package/dist/components/PrimeAutoComplete.vue +0 -162
- package/dist/components/PrimeAutoComplete.vue.d.ts +0 -31
- package/dist/components/PrimeCascadeSelect.d.vue.ts +0 -28
- package/dist/components/PrimeCascadeSelect.vue +0 -62
- package/dist/components/PrimeCascadeSelect.vue.d.ts +0 -28
- package/dist/components/PrimeCheckbox.d.vue.ts +0 -27
- package/dist/components/PrimeCheckbox.vue +0 -71
- package/dist/components/PrimeCheckbox.vue.d.ts +0 -27
- package/dist/components/PrimeColorPicker.d.vue.ts +0 -24
- package/dist/components/PrimeColorPicker.vue +0 -48
- package/dist/components/PrimeColorPicker.vue.d.ts +0 -24
- package/dist/components/PrimeDatePicker.d.vue.ts +0 -63
- package/dist/components/PrimeDatePicker.vue +0 -153
- package/dist/components/PrimeDatePicker.vue.d.ts +0 -63
- package/dist/components/PrimeInputMask.d.vue.ts +0 -28
- package/dist/components/PrimeInputMask.vue +0 -88
- package/dist/components/PrimeInputMask.vue.d.ts +0 -28
- package/dist/components/PrimeInputNumber.d.vue.ts +0 -36
- package/dist/components/PrimeInputNumber.vue +0 -110
- package/dist/components/PrimeInputNumber.vue.d.ts +0 -36
- package/dist/components/PrimeInputOtp.d.vue.ts +0 -26
- package/dist/components/PrimeInputOtp.vue +0 -59
- package/dist/components/PrimeInputOtp.vue.d.ts +0 -26
- package/dist/components/PrimeInputText.d.vue.ts +0 -24
- package/dist/components/PrimeInputText.vue +0 -80
- package/dist/components/PrimeInputText.vue.d.ts +0 -24
- package/dist/components/PrimeKnob.d.vue.ts +0 -31
- package/dist/components/PrimeKnob.vue +0 -75
- package/dist/components/PrimeKnob.vue.d.ts +0 -31
- package/dist/components/PrimeListbox.d.vue.ts +0 -42
- package/dist/components/PrimeListbox.vue +0 -86
- package/dist/components/PrimeListbox.vue.d.ts +0 -42
- package/dist/components/PrimeMultiSelect.d.vue.ts +0 -53
- package/dist/components/PrimeMultiSelect.vue +0 -115
- package/dist/components/PrimeMultiSelect.vue.d.ts +0 -53
- package/dist/components/PrimeOutputBoolean.d.vue.ts +0 -16
- package/dist/components/PrimeOutputBoolean.vue +0 -41
- package/dist/components/PrimeOutputBoolean.vue.d.ts +0 -16
- package/dist/components/PrimeOutputDate.d.vue.ts +0 -16
- package/dist/components/PrimeOutputDate.vue +0 -51
- package/dist/components/PrimeOutputDate.vue.d.ts +0 -16
- package/dist/components/PrimeOutputDuration.d.vue.ts +0 -16
- package/dist/components/PrimeOutputDuration.vue +0 -32
- package/dist/components/PrimeOutputDuration.vue.d.ts +0 -16
- package/dist/components/PrimeOutputLink.d.vue.ts +0 -16
- package/dist/components/PrimeOutputLink.vue +0 -50
- package/dist/components/PrimeOutputLink.vue.d.ts +0 -16
- package/dist/components/PrimeOutputList.d.vue.ts +0 -19
- package/dist/components/PrimeOutputList.vue +0 -71
- package/dist/components/PrimeOutputList.vue.d.ts +0 -19
- package/dist/components/PrimeOutputNumber.d.vue.ts +0 -16
- package/dist/components/PrimeOutputNumber.vue +0 -59
- package/dist/components/PrimeOutputNumber.vue.d.ts +0 -16
- package/dist/components/PrimeOutputReference.d.vue.ts +0 -16
- package/dist/components/PrimeOutputReference.vue +0 -62
- package/dist/components/PrimeOutputReference.vue.d.ts +0 -16
- package/dist/components/PrimeOutputText.d.vue.ts +0 -22
- package/dist/components/PrimeOutputText.vue +0 -72
- package/dist/components/PrimeOutputText.vue.d.ts +0 -22
- package/dist/components/PrimePassword.d.vue.ts +0 -33
- package/dist/components/PrimePassword.vue +0 -73
- package/dist/components/PrimePassword.vue.d.ts +0 -33
- package/dist/components/PrimeRadioButton.d.vue.ts +0 -28
- package/dist/components/PrimeRadioButton.vue +0 -53
- package/dist/components/PrimeRadioButton.vue.d.ts +0 -28
- package/dist/components/PrimeRating.d.vue.ts +0 -24
- package/dist/components/PrimeRating.vue +0 -55
- package/dist/components/PrimeRating.vue.d.ts +0 -24
- package/dist/components/PrimeSelect.d.vue.ts +0 -50
- package/dist/components/PrimeSelect.vue +0 -113
- package/dist/components/PrimeSelect.vue.d.ts +0 -50
- package/dist/components/PrimeSelectButton.d.vue.ts +0 -28
- package/dist/components/PrimeSelectButton.vue +0 -64
- package/dist/components/PrimeSelectButton.vue.d.ts +0 -28
- package/dist/components/PrimeSlider.d.vue.ts +0 -26
- package/dist/components/PrimeSlider.vue +0 -60
- package/dist/components/PrimeSlider.vue.d.ts +0 -26
- package/dist/components/PrimeTextarea.d.vue.ts +0 -25
- package/dist/components/PrimeTextarea.vue +0 -53
- package/dist/components/PrimeTextarea.vue.d.ts +0 -25
- package/dist/components/PrimeToggleButton.d.vue.ts +0 -26
- package/dist/components/PrimeToggleButton.vue +0 -60
- package/dist/components/PrimeToggleButton.vue.d.ts +0 -26
- package/dist/components/PrimeToggleSwitch.d.vue.ts +0 -23
- package/dist/components/PrimeToggleSwitch.vue +0 -57
- package/dist/components/PrimeToggleSwitch.vue.d.ts +0 -23
- package/dist/components/PrimeTreeSelect.d.vue.ts +0 -32
- package/dist/components/PrimeTreeSelect.vue +0 -71
- package/dist/components/PrimeTreeSelect.vue.d.ts +0 -32
- package/dist/components/index.mjs +0 -48
- package/dist/composables/index.mjs +0 -18
- package/dist/composables/useFormKitInput.d.ts +0 -10
- package/dist/composables/useFormKitInput.js +0 -51
- package/dist/composables/useFormKitInput.mjs +0 -39
- package/dist/composables/useFormKitRepeater.d.ts +0 -15
- package/dist/composables/useFormKitRepeater.js +0 -74
- package/dist/composables/useFormKitRepeater.mjs +0 -54
- package/dist/composables/useFormKitSchema.d.ts +0 -36
- package/dist/composables/useFormKitSchema.js +0 -83
- package/dist/composables/useFormKitSchema.mjs +0 -58
- package/dist/composables/useFormKitSection.d.ts +0 -7
- package/dist/composables/useFormKitSection.js +0 -31
- package/dist/composables/useFormKitSection.mjs +0 -19
- package/dist/composables/useInputEditor.d.ts +0 -8
- package/dist/composables/useInputEditor.js +0 -148
- package/dist/composables/useInputEditor.mjs +0 -143
- package/dist/composables/useInputEditorSchema.d.ts +0 -163
- package/dist/composables/useInputEditorSchema.js +0 -313
- package/dist/composables/useInputEditorSchema.mjs +0 -315
- package/dist/composables/useOutputDuration.d.ts +0 -4
- package/dist/composables/useOutputDuration.js +0 -40
- package/dist/composables/useOutputDuration.mjs +0 -35
- package/dist/composables/usePrimeInputs.d.ts +0 -3
- package/dist/composables/usePrimeInputs.js +0 -62
- package/dist/composables/usePrimeInputs.mjs +0 -53
- package/dist/definitions/index.mjs +0 -68
- package/dist/definitions/input.d.ts +0 -47
- package/dist/definitions/input.js +0 -142
- package/dist/definitions/input.mjs +0 -135
- package/dist/definitions/output.d.ts +0 -9
- package/dist/definitions/output.js +0 -46
- package/dist/definitions/output.mjs +0 -39
- package/dist/index.mjs +0 -14
- package/dist/plugins/index.mjs +0 -55
|
@@ -1,48 +0,0 @@
|
|
|
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 } = useFormKitInput(props.context)
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<template>
|
|
28
|
-
<div class="p-formkit">
|
|
29
|
-
<ColorPicker
|
|
30
|
-
v-model="context._value"
|
|
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>
|
|
@@ -1,24 +0,0 @@
|
|
|
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;
|
|
@@ -1,63 +0,0 @@
|
|
|
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;
|
|
@@ -1,153 +0,0 @@
|
|
|
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 } = 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="context._value"
|
|
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>
|
|
@@ -1,63 +0,0 @@
|
|
|
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;
|
|
@@ -1,28 +0,0 @@
|
|
|
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;
|
|
@@ -1,88 +0,0 @@
|
|
|
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 } = 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="context._value"
|
|
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="context._value"
|
|
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>
|
|
@@ -1,28 +0,0 @@
|
|
|
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;
|
|
@@ -1,36 +0,0 @@
|
|
|
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;
|
|
@@ -1,110 +0,0 @@
|
|
|
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 } = 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="context._value"
|
|
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>
|