@sfxcode/formkit-primevue 3.3.3 → 3.3.5

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.
Files changed (140) hide show
  1. package/README.md +13 -138
  2. package/dist/components/FormKitDataDebug.vue +5 -9
  3. package/dist/components/FormKitDataEdit.vue +53 -46
  4. package/dist/components/FormKitDataView.vue +20 -27
  5. package/dist/components/FormKitIcon.vue +6 -13
  6. package/dist/components/FormKitPrefix.vue +3 -3
  7. package/dist/components/FormKitSuffix.vue +3 -3
  8. package/dist/components/PrimeAutoComplete.vue +41 -86
  9. package/dist/components/PrimeCascadeSelect.vue +7 -26
  10. package/dist/components/PrimeCheckbox.vue +9 -29
  11. package/dist/components/PrimeColorPicker.vue +7 -22
  12. package/dist/components/PrimeDatePicker.vue +17 -73
  13. package/dist/components/PrimeInputMask.vue +10 -29
  14. package/dist/components/PrimeInputNumber.vue +21 -56
  15. package/dist/components/PrimeInputOtp.vue +7 -24
  16. package/dist/components/PrimeInputText.vue +10 -25
  17. package/dist/components/PrimeKnob.vue +12 -37
  18. package/dist/components/PrimeListbox.vue +7 -39
  19. package/dist/components/PrimeMultiSelect.vue +7 -52
  20. package/dist/components/PrimeOutputBoolean.vue +28 -27
  21. package/dist/components/PrimeOutputDate.vue +33 -33
  22. package/dist/components/PrimeOutputDuration.vue +23 -19
  23. package/dist/components/PrimeOutputLink.vue +29 -27
  24. package/dist/components/PrimeOutputList.vue +71 -40
  25. package/dist/components/PrimeOutputNumber.vue +36 -39
  26. package/dist/components/PrimeOutputReference.vue +32 -30
  27. package/dist/components/PrimeOutputText.vue +53 -53
  28. package/dist/components/PrimePassword.vue +11 -32
  29. package/dist/components/PrimeRadioButton.vue +19 -29
  30. package/dist/components/PrimeRating.vue +7 -22
  31. package/dist/components/PrimeSelect.vue +7 -49
  32. package/dist/components/PrimeSelectButton.vue +7 -27
  33. package/dist/components/PrimeSlider.vue +10 -28
  34. package/dist/components/PrimeTextarea.vue +7 -23
  35. package/dist/components/PrimeToggleButton.vue +7 -25
  36. package/dist/components/PrimeToggleSwitch.vue +8 -23
  37. package/dist/components/PrimeTreeSelect.vue +7 -30
  38. package/dist/components/index.d.ts +23 -23
  39. package/dist/composables/index.d.ts +8 -8
  40. package/dist/composables/index.js +8 -8
  41. package/dist/composables/index.mjs +8 -8
  42. package/dist/composables/useFormKitInput.js +5 -1
  43. package/dist/composables/useFormKitInput.mjs +13 -1
  44. package/dist/composables/useFormKitRepeater.js +1 -1
  45. package/dist/composables/useFormKitRepeater.mjs +45 -17
  46. package/dist/composables/useFormKitSchema.mjs +10 -2
  47. package/dist/composables/useInputEditor.js +4 -4
  48. package/dist/composables/useInputEditor.mjs +52 -24
  49. package/dist/composables/useInputEditorSchema.js +3 -3
  50. package/dist/composables/useInputEditorSchema.mjs +25 -17
  51. package/dist/composables/useOutputDuration.mjs +3 -6
  52. package/dist/definitions/index.js +2 -2
  53. package/dist/definitions/index.mjs +2 -2
  54. package/dist/definitions/input.d.ts +1 -1
  55. package/dist/definitions/input.mjs +301 -15
  56. package/dist/definitions/output.d.ts +1 -1
  57. package/dist/definitions/output.js +1 -1
  58. package/dist/definitions/output.mjs +95 -14
  59. package/dist/index.d.ts +48 -48
  60. package/dist/index.js +12 -12
  61. package/dist/index.mjs +9 -3
  62. package/dist/plugins/index.d.ts +1 -1
  63. package/dist/plugins/index.mjs +31 -27
  64. package/dist/sass/formkit-primevue.scss +99 -101
  65. package/dist/vue.d.ts +5 -0
  66. package/package.json +45 -80
  67. package/LICENSE +0 -21
  68. package/components.d.ts +0 -1
  69. package/dist/components/FormKitDataDebug.d.vue.ts +0 -24
  70. package/dist/components/FormKitDataDebug.vue.d.ts +0 -24
  71. package/dist/components/FormKitDataEdit.d.vue.ts +0 -180
  72. package/dist/components/FormKitDataEdit.vue.d.ts +0 -180
  73. package/dist/components/FormKitDataView.d.vue.ts +0 -73
  74. package/dist/components/FormKitDataView.vue.d.ts +0 -73
  75. package/dist/components/FormKitIcon.d.vue.ts +0 -39
  76. package/dist/components/FormKitIcon.vue.d.ts +0 -39
  77. package/dist/components/FormKitPrefix.d.vue.ts +0 -7
  78. package/dist/components/FormKitPrefix.vue.d.ts +0 -7
  79. package/dist/components/FormKitSuffix.d.vue.ts +0 -7
  80. package/dist/components/FormKitSuffix.vue.d.ts +0 -7
  81. package/dist/components/PrimeAutoComplete.d.vue.ts +0 -31
  82. package/dist/components/PrimeAutoComplete.vue.d.ts +0 -31
  83. package/dist/components/PrimeCascadeSelect.d.vue.ts +0 -28
  84. package/dist/components/PrimeCascadeSelect.vue.d.ts +0 -28
  85. package/dist/components/PrimeCheckbox.d.vue.ts +0 -27
  86. package/dist/components/PrimeCheckbox.vue.d.ts +0 -27
  87. package/dist/components/PrimeColorPicker.d.vue.ts +0 -24
  88. package/dist/components/PrimeColorPicker.vue.d.ts +0 -24
  89. package/dist/components/PrimeDatePicker.d.vue.ts +0 -63
  90. package/dist/components/PrimeDatePicker.vue.d.ts +0 -63
  91. package/dist/components/PrimeInputMask.d.vue.ts +0 -28
  92. package/dist/components/PrimeInputMask.vue.d.ts +0 -28
  93. package/dist/components/PrimeInputNumber.d.vue.ts +0 -36
  94. package/dist/components/PrimeInputNumber.vue.d.ts +0 -36
  95. package/dist/components/PrimeInputOtp.d.vue.ts +0 -26
  96. package/dist/components/PrimeInputOtp.vue.d.ts +0 -26
  97. package/dist/components/PrimeInputText.d.vue.ts +0 -24
  98. package/dist/components/PrimeInputText.vue.d.ts +0 -24
  99. package/dist/components/PrimeKnob.d.vue.ts +0 -31
  100. package/dist/components/PrimeKnob.vue.d.ts +0 -31
  101. package/dist/components/PrimeListbox.d.vue.ts +0 -42
  102. package/dist/components/PrimeListbox.vue.d.ts +0 -42
  103. package/dist/components/PrimeMultiSelect.d.vue.ts +0 -53
  104. package/dist/components/PrimeMultiSelect.vue.d.ts +0 -53
  105. package/dist/components/PrimeOutputBoolean.d.vue.ts +0 -16
  106. package/dist/components/PrimeOutputBoolean.vue.d.ts +0 -16
  107. package/dist/components/PrimeOutputDate.d.vue.ts +0 -16
  108. package/dist/components/PrimeOutputDate.vue.d.ts +0 -16
  109. package/dist/components/PrimeOutputDuration.d.vue.ts +0 -16
  110. package/dist/components/PrimeOutputDuration.vue.d.ts +0 -16
  111. package/dist/components/PrimeOutputLink.d.vue.ts +0 -16
  112. package/dist/components/PrimeOutputLink.vue.d.ts +0 -16
  113. package/dist/components/PrimeOutputList.d.vue.ts +0 -19
  114. package/dist/components/PrimeOutputList.vue.d.ts +0 -19
  115. package/dist/components/PrimeOutputNumber.d.vue.ts +0 -16
  116. package/dist/components/PrimeOutputNumber.vue.d.ts +0 -16
  117. package/dist/components/PrimeOutputReference.d.vue.ts +0 -16
  118. package/dist/components/PrimeOutputReference.vue.d.ts +0 -16
  119. package/dist/components/PrimeOutputText.d.vue.ts +0 -22
  120. package/dist/components/PrimeOutputText.vue.d.ts +0 -22
  121. package/dist/components/PrimePassword.d.vue.ts +0 -33
  122. package/dist/components/PrimePassword.vue.d.ts +0 -33
  123. package/dist/components/PrimeRadioButton.d.vue.ts +0 -28
  124. package/dist/components/PrimeRadioButton.vue.d.ts +0 -28
  125. package/dist/components/PrimeRating.d.vue.ts +0 -24
  126. package/dist/components/PrimeRating.vue.d.ts +0 -24
  127. package/dist/components/PrimeSelect.d.vue.ts +0 -50
  128. package/dist/components/PrimeSelect.vue.d.ts +0 -50
  129. package/dist/components/PrimeSelectButton.d.vue.ts +0 -28
  130. package/dist/components/PrimeSelectButton.vue.d.ts +0 -28
  131. package/dist/components/PrimeSlider.d.vue.ts +0 -26
  132. package/dist/components/PrimeSlider.vue.d.ts +0 -26
  133. package/dist/components/PrimeTextarea.d.vue.ts +0 -25
  134. package/dist/components/PrimeTextarea.vue.d.ts +0 -25
  135. package/dist/components/PrimeToggleButton.d.vue.ts +0 -26
  136. package/dist/components/PrimeToggleButton.vue.d.ts +0 -26
  137. package/dist/components/PrimeToggleSwitch.d.vue.ts +0 -23
  138. package/dist/components/PrimeToggleSwitch.vue.d.ts +0 -23
  139. package/dist/components/PrimeTreeSelect.d.vue.ts +0 -32
  140. package/dist/components/PrimeTreeSelect.vue.d.ts +0 -32
@@ -1,34 +1,14 @@
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
-
1
+ <script setup>
2
+ import { useFormKitInput, useFormKitSection } from "../composables/index.ts";
20
3
  const props = defineProps({
21
4
  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()
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { hasPrefix, hasSuffix, generateId } = useFormKitSection(props.context);
10
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
11
+ const generatedId = generateId();
32
12
  </script>
33
13
 
34
14
  <template>
@@ -1,27 +1,12 @@
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
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
17
3
  const props = defineProps({
18
4
  context: {
19
- type: Object as PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>,
20
- required: true,
21
- },
22
- })
23
-
24
- const { unstyled, handleChange, modelValue } = useFormKitInput(props.context)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { unstyled, handleChange, modelValue } = useFormKitInput(props.context);
25
10
  </script>
26
11
 
27
12
  <template>
@@ -1,81 +1,25 @@
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
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
56
3
  const props = defineProps({
57
4
  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)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { validSlotNames, unstyled, isInvalid, handleInput, modelValue } = useFormKitInput(
10
+ props.context
11
+ );
12
+ function handleBlur(e) {
13
+ props.context?.handlers.blur(e.originalEvent);
67
14
  }
68
-
69
15
  function handleClearClick() {
70
- props.context?.node.input(null)
16
+ props.context?.node.input(null);
71
17
  }
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)
18
+ function handleSelect(e) {
19
+ if (props.context?.selectionMode === "range" || props.context?.selectionMode === "multiple") {
20
+ props.context?.node.input(props.context._value);
21
+ } else {
22
+ props.context?.node.input(e);
79
23
  }
80
24
  }
81
25
  </script>
@@ -1,34 +1,15 @@
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
-
1
+ <script setup>
2
+ import IconField from "primevue/iconfield";
3
+ import InputIcon from "primevue/inputicon";
4
+ import { useFormKitInput, useFormKitSection } from "../composables/index.ts";
23
5
  const props = defineProps({
24
6
  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)
7
+ type: Object,
8
+ required: true
9
+ }
10
+ });
11
+ const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
12
+ const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context);
32
13
  </script>
33
14
 
34
15
  <template>
@@ -1,70 +1,35 @@
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
-
1
+ <script setup>
2
+ import { watch } from "vue";
3
+ import { useFormKitInput } from "../composables/index.ts";
30
4
  const props = defineProps({
31
5
  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)
6
+ type: Object,
7
+ required: true
8
+ }
9
+ });
10
+ const { validSlotNames, unstyled, isInvalid, modelValue } = useFormKitInput(props.context);
11
+ function handleBlur(e) {
12
+ props.context?.handlers.blur(e.originalEvent);
41
13
  }
42
-
43
- function handleInput(_: any) {
44
- if (typeof _.value === 'number' || _.value === null)
45
- props.context?.node.input(_.value)
14
+ function handleInput(_) {
15
+ if (typeof _.value === "number" || _.value === null) props.context?.node.input(_.value);
46
16
  }
47
-
48
- function roundToDecimals(value: any, decimals: number) {
49
- const factor = 10 ** decimals
50
- return Math.round(value * factor) / factor
17
+ function roundToDecimals(value, decimals) {
18
+ const factor = 10 ** decimals;
19
+ return Math.round(value * factor) / factor;
51
20
  }
52
-
53
21
  watch(
54
22
  () => props.context._value,
55
23
  (newValue) => {
56
- // Only update if the value is different
57
- if (newValue !== props.context.node.value && typeof newValue === 'number') {
24
+ if (newValue !== props.context.node.value && typeof newValue === "number") {
58
25
  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)
26
+ props.context?.node.input(roundToDecimals(newValue, props.context.maxFractionDigits));
27
+ } else {
28
+ props.context?.node.input(newValue);
64
29
  }
65
30
  }
66
- },
67
- )
31
+ }
32
+ );
68
33
  </script>
69
34
 
70
35
  <template>
@@ -1,29 +1,12 @@
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
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
19
3
  const props = defineProps({
20
4
  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)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { validSlotNames, unstyled, isInvalid, handleBlur, handleInput, modelValue } = useFormKitInput(props.context);
27
10
  </script>
28
11
 
29
12
  <template>
@@ -1,30 +1,15 @@
1
- <script setup lang='ts'>
2
- import type { FormKitFrameworkContext } from '@formkit/core'
3
- import type { InputTextProps } from 'primevue/inputtext'
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 FormKitPrimeInputTextProps {
11
- pt?: InputTextProps['pt']
12
- ptOptions?: InputTextProps['ptOptions']
13
- unstyled?: InputTextProps['unstyled']
14
- size?: InputTextProps['size']
15
- inputType?: string | undefined
16
- placeholder?: string
17
- }
18
-
1
+ <script setup>
2
+ import IconField from "primevue/iconfield";
3
+ import InputIcon from "primevue/inputicon";
4
+ import { useFormKitInput, useFormKitSection } from "../composables/index.ts";
19
5
  const props = defineProps({
20
6
  context: {
21
- type: Object as PropType<FormKitFrameworkContext & FormKitPrimeInputTextProps>,
22
- required: true,
23
- },
24
- })
25
-
26
- const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
27
- const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context)
7
+ type: Object,
8
+ required: true
9
+ }
10
+ });
11
+ const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
12
+ const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context);
28
13
  </script>
29
14
 
30
15
  <template>
@@ -1,43 +1,18 @@
1
- <script setup lang='ts'>
2
- import type { FormKitFrameworkContext } from '@formkit/core'
3
- import type { KnobProps } from 'primevue/knob'
4
-
5
- import type { PropType } from 'vue'
6
- import { useFormKitInput } from '../composables'
7
-
8
- export interface FormKitPrimeKnobProps {
9
- pt?: KnobProps['pt']
10
- ptOptions?: KnobProps['ptOptions']
11
- unstyled?: KnobProps['unstyled']
12
- min?: KnobProps['min']
13
- max?: KnobProps['max']
14
- step?: KnobProps['step']
15
- size?: KnobProps['size']
16
- strokeWidth?: KnobProps['strokeWidth']
17
- showValue?: KnobProps['showValue']
18
- valueColor?: KnobProps['valueColor']
19
- rangeColor?: KnobProps['rangeColor']
20
- textColor?: KnobProps['textColor']
21
- valueTemplate?: KnobProps['valueTemplate']
22
-
23
- }
24
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
25
3
  const props = defineProps({
26
4
  context: {
27
- type: Object as PropType<FormKitFrameworkContext & FormKitPrimeKnobProps>,
28
- required: true,
29
- },
30
- })
31
-
32
- const { unstyled, isInvalid, modelValue } = useFormKitInput(props.context)
33
-
34
- function handleInput(e: any) {
35
- props.context?.node.input(e)
36
- props.context?.handlers.blur(e)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { unstyled, isInvalid, modelValue } = useFormKitInput(props.context);
10
+ function handleInput(e) {
11
+ props.context?.node.input(e);
12
+ props.context?.handlers.blur(e);
37
13
  }
38
-
39
- function updateValue(n: number) {
40
- props.context?.node.input(n)
14
+ function updateValue(n) {
15
+ props.context?.node.input(n);
41
16
  }
42
17
  </script>
43
18
 
@@ -1,44 +1,12 @@
1
- <script setup lang="ts">
2
- import type { FormKitFrameworkContext } from '@formkit/core'
3
- import type { ListboxProps } from 'primevue/listbox'
4
- import type { PropType } from 'vue'
5
- import { useFormKitInput } from '../composables'
6
-
7
- export interface FormKitPrimeListboxProps {
8
- pt?: ListboxProps['pt']
9
- ptOptions?: ListboxProps['ptOptions']
10
- unstyled?: ListboxProps['unstyled']
11
- options?: ListboxProps['options']
12
- optionLabel?: ListboxProps['optionLabel']
13
- optionValue?: ListboxProps['optionValue']
14
- multiple?: ListboxProps['multiple']
15
- filter?: ListboxProps['filter']
16
- filterIcon?: ListboxProps['filterIcon']
17
- filterPlaceholder?: ListboxProps['filterPlaceholder']
18
- filterLocale?: ListboxProps['filterLocale']
19
- filterMatchMode?: ListboxProps['filterMatchMode']
20
- autoOptionFocus?: ListboxProps['autoOptionFocus']
21
- selectOnFocus?: ListboxProps['selectOnFocus']
22
- optionDisabled?: ListboxProps['optionDisabled']
23
- optionGroupLabel?: ListboxProps['optionGroupLabel']
24
- optionGroupChildren?: ListboxProps['optionGroupChildren']
25
- listStyle?: ListboxProps['listStyle']
26
- dataKey?: ListboxProps['dataKey']
27
- metaKeySelection?: ListboxProps['metaKeySelection']
28
- virtualScrollerOptions?: ListboxProps['virtualScrollerOptions']
29
- tabindex?: ListboxProps['tabindex']
30
- ariaLabel?: ListboxProps['ariaLabel']
31
- ariaLabelledby?: ListboxProps['ariaLabelledby']
32
- }
33
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
34
3
  const props = defineProps({
35
4
  context: {
36
- type: Object as PropType<FormKitFrameworkContext & FormKitPrimeListboxProps>,
37
- required: true,
38
- },
39
- })
40
-
41
- const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
42
10
  </script>
43
11
 
44
12
  <template>
@@ -1,57 +1,12 @@
1
- <script setup lang='ts'>
2
- import type { FormKitFrameworkContext } from '@formkit/core'
3
- import type { MultiSelectProps } from 'primevue/multiselect'
4
-
5
- import type { PropType } from 'vue'
6
- import { useFormKitInput } from '../composables'
7
-
8
- export interface FormKitPrimeMultiSelectProps {
9
- options?: MultiSelectProps['options']
10
- optionLabel?: MultiSelectProps['optionLabel']
11
- optionValue?: MultiSelectProps['optionValue']
12
- optionDisabled?: MultiSelectProps['optionDisabled']
13
- optionGroupLabel?: MultiSelectProps['optionGroupLabel']
14
- optionGroupChildren?: MultiSelectProps['optionGroupChildren']
15
- scrollHeight?: MultiSelectProps['scrollHeight']
16
- dataKey?: MultiSelectProps['dataKey']
17
- filter?: MultiSelectProps['filter']
18
- filterPlaceholder?: MultiSelectProps['filterPlaceholder']
19
- filterLocale?: MultiSelectProps['filterLocale']
20
- filterMatchMode?: MultiSelectProps['filterMatchMode']
21
- filterFields?: MultiSelectProps['filterFields']
22
- appendTo?: MultiSelectProps['appendTo']
23
- display?: MultiSelectProps['display']
24
- maxSelectedLabels?: MultiSelectProps['maxSelectedLabels']
25
- selectedItemsLabel?: MultiSelectProps['selectedItemsLabel']
26
- selectionLimit?: MultiSelectProps['selectionLimit']
27
- showToggleAll?: MultiSelectProps['showToggleAll']
28
- loading?: MultiSelectProps['loading']
29
- selectAll?: MultiSelectProps['selectAll']
30
- resetFilterOnHide?: MultiSelectProps['resetFilterOnHide']
31
- virtualScrollerOptions?: MultiSelectProps['virtualScrollerOptions']
32
- autoOptionFocus?: MultiSelectProps['autoOptionFocus']
33
- autoFilterFocus?: MultiSelectProps['autoFilterFocus']
34
- filterMessage?: MultiSelectProps['filterMessage']
35
- selectionMessage?: MultiSelectProps['selectionMessage']
36
- emptySelectionMessage?: MultiSelectProps['emptySelectionMessage']
37
- emptyFilterMessage?: MultiSelectProps['emptyFilterMessage']
38
- emptyMessage?: MultiSelectProps['emptyMessage']
39
- pt?: MultiSelectProps['pt']
40
- placeholder?: MultiSelectProps['placeholder']
41
- ptOptions?: MultiSelectProps['ptOptions']
42
- unstyled?: MultiSelectProps['unstyled']
43
- size?: MultiSelectProps['size']
44
-
45
- }
46
-
1
+ <script setup>
2
+ import { useFormKitInput } from "../composables/index.ts";
47
3
  const props = defineProps({
48
4
  context: {
49
- type: Object as PropType<FormKitFrameworkContext & FormKitPrimeMultiSelectProps>,
50
- required: true,
51
- },
52
- })
53
-
54
- const { validSlotNames, unstyled, isInvalid, handleBlur, handleChange, modelValue } = useFormKitInput(props.context)
5
+ type: Object,
6
+ required: true
7
+ }
8
+ });
9
+ const { validSlotNames, unstyled, isInvalid, handleBlur, handleChange, modelValue } = useFormKitInput(props.context);
55
10
  </script>
56
11
 
57
12
  <template>
@@ -1,41 +1,42 @@
1
- <script setup lang='ts'>
2
- import type { FormKitFrameworkContext } from '@formkit/core'
3
- import type { PropType } from 'vue'
4
- import type { FormKitIconProps } from './FormKitIcon.vue'
5
- import { computed } from 'vue'
6
- import { useI18n } from 'vue-i18n'
7
- import { useFormKitSection } from '../composables'
8
- import FormKitIcon from './FormKitIcon.vue'
9
- import FormKitPrefix from './FormKitPrefix.vue'
10
- import FormKitSuffix from './FormKitSuffix.vue'
11
-
1
+ <script setup>
2
+ import { computed } from "vue";
3
+ import { useI18n } from "vue-i18n";
4
+ import { useFormKitSection } from "../composables/index.ts";
5
+ import FormKitIcon from "./FormKitIcon.vue";
6
+ import FormKitPrefix from "./FormKitPrefix.vue";
7
+ import FormKitSuffix from "./FormKitSuffix.vue";
12
8
  const props = defineProps({
13
9
  context: {
14
- type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
15
- required: true,
16
- },
17
- })
18
-
19
- const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
20
-
21
- const { t } = useI18n()
22
-
10
+ type: Object,
11
+ required: true
12
+ }
13
+ });
14
+ const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
15
+ const { t } = useI18n();
23
16
  const translated = computed(() => {
24
- if (props.context?._value)
25
- return props.context?.trueValue ?? t('formkit.prime.true', 'true')
26
- else
27
- return props.context?.falseValue ?? t('formkit.prime.false', 'false')
28
- })
17
+ if (props.context?._value) return props.context?.trueValue ?? t("formkit.prime.true", "true");
18
+ else return props.context?.falseValue ?? t("formkit.prime.false", "false");
19
+ });
29
20
  </script>
30
21
 
31
22
  <template>
32
23
  <div class="p-formkit p-output-boolean">
33
- <FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix as string" :on-click="context?.onIconPrefixClicked as (() => void)" position="prefix" />
24
+ <FormKitIcon
25
+ v-if="hasPrefixIcon"
26
+ :icon-class="context?.iconPrefix as string"
27
+ :on-click="context?.onIconPrefixClicked as () => void"
28
+ position="prefix"
29
+ />
34
30
  <FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
35
31
  <span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
36
32
  {{ translated }}
37
33
  </span>
38
34
  <FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
39
- <FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix as string" :on-click="context?.onIconSuffixClicked as (() => void)" position="suffix" />
35
+ <FormKitIcon
36
+ v-if="hasSuffixIcon"
37
+ :icon-class="context?.iconSuffix as string"
38
+ :on-click="context?.onIconSuffixClicked as () => void"
39
+ position="suffix"
40
+ />
40
41
  </div>
41
42
  </template>