@sfxcode/formkit-primevue 3.0.10 → 3.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/PrimeInputNumber.vue +5 -4
- package/dist/components/PrimeListbox.d.vue.ts +10 -0
- package/dist/components/PrimeListbox.vue +17 -2
- package/dist/components/PrimeListbox.vue.d.ts +10 -0
- package/dist/components/PrimeOutputText.d.vue.ts +7 -2
- package/dist/components/PrimeOutputText.vue +14 -3
- package/dist/components/PrimeOutputText.vue.d.ts +7 -2
- package/dist/definitions/input.js +1 -1
- package/dist/definitions/input.mjs +1 -1
- package/dist/definitions/output.js +1 -1
- package/dist/definitions/output.mjs +1 -1
- package/package.json +12 -12
|
@@ -41,7 +41,8 @@ function handleBlur(e: InputNumberBlurEvent) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
function handleInput(_: any) {
|
|
44
|
-
|
|
44
|
+
if (typeof _.value === 'number' || _.value === null)
|
|
45
|
+
props.context?.node.input(_.value)
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
function roundToDecimals(value: any, decimals: number) {
|
|
@@ -52,13 +53,13 @@ function roundToDecimals(value: any, decimals: number) {
|
|
|
52
53
|
watch(
|
|
53
54
|
() => props.context._value,
|
|
54
55
|
(newValue) => {
|
|
55
|
-
if
|
|
56
|
-
|
|
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) {
|
|
57
59
|
// fix floating-point precision issues
|
|
58
60
|
props.context?.node.input(roundToDecimals(newValue, props.context.maxFractionDigits))
|
|
59
61
|
}
|
|
60
62
|
else {
|
|
61
|
-
// Only update if the value is different
|
|
62
63
|
props.context?.node.input(newValue)
|
|
63
64
|
}
|
|
64
65
|
}
|
|
@@ -16,6 +16,16 @@ export interface FormKitPrimeListboxProps {
|
|
|
16
16
|
filterMatchMode?: ListboxProps['filterMatchMode'];
|
|
17
17
|
autoOptionFocus?: ListboxProps['autoOptionFocus'];
|
|
18
18
|
selectOnFocus?: ListboxProps['selectOnFocus'];
|
|
19
|
+
optionDisabled?: ListboxProps['optionDisabled'];
|
|
20
|
+
optionGroupLabel?: ListboxProps['optionGroupLabel'];
|
|
21
|
+
optionGroupChildren?: ListboxProps['optionGroupChildren'];
|
|
22
|
+
listStyle?: ListboxProps['listStyle'];
|
|
23
|
+
dataKey?: ListboxProps['dataKey'];
|
|
24
|
+
metaKeySelection?: ListboxProps['metaKeySelection'];
|
|
25
|
+
virtualScrollerOptions?: ListboxProps['virtualScrollerOptions'];
|
|
26
|
+
tabindex?: ListboxProps['tabindex'];
|
|
27
|
+
ariaLabel?: ListboxProps['ariaLabel'];
|
|
28
|
+
ariaLabelledby?: ListboxProps['ariaLabelledby'];
|
|
19
29
|
}
|
|
20
30
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
21
31
|
context: {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
<script setup lang=
|
|
1
|
+
<script setup lang="ts">
|
|
2
2
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
3
|
import type { ListboxProps } from 'primevue/listbox'
|
|
4
|
-
|
|
5
4
|
import type { PropType } from 'vue'
|
|
6
5
|
import { useFormKitInput } from '../composables'
|
|
7
6
|
|
|
@@ -20,6 +19,16 @@ export interface FormKitPrimeListboxProps {
|
|
|
20
19
|
filterMatchMode?: ListboxProps['filterMatchMode']
|
|
21
20
|
autoOptionFocus?: ListboxProps['autoOptionFocus']
|
|
22
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']
|
|
23
32
|
}
|
|
24
33
|
|
|
25
34
|
const props = defineProps({
|
|
@@ -49,6 +58,9 @@ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useForm
|
|
|
49
58
|
:options="context?.options"
|
|
50
59
|
:option-label="context.optionLabel"
|
|
51
60
|
:option-value="context.optionValue"
|
|
61
|
+
:option-disabled="context.optionDisabled"
|
|
62
|
+
:option-group-label="context.optionGroupLabel"
|
|
63
|
+
:option-group-children="context.optionGroupChildren"
|
|
52
64
|
:multiple="context.multiple ?? false"
|
|
53
65
|
:filter="context.filter ?? false"
|
|
54
66
|
:filter-icon="context.filterIcon"
|
|
@@ -57,6 +69,9 @@ const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur } = useForm
|
|
|
57
69
|
:filter-match-mode="context.filterMatchMode"
|
|
58
70
|
:auto-option-focus="context.autoOptionFocus ?? true"
|
|
59
71
|
:select-on-focus="context.selectOnFocus ?? false"
|
|
72
|
+
:data-key="context.dataKey"
|
|
73
|
+
:meta-key-selection="context.metaKeySelection ?? false"
|
|
74
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
60
75
|
:pt="context.pt"
|
|
61
76
|
:pt-options="context.ptOptions"
|
|
62
77
|
:unstyled="unstyled"
|
|
@@ -16,6 +16,16 @@ export interface FormKitPrimeListboxProps {
|
|
|
16
16
|
filterMatchMode?: ListboxProps['filterMatchMode'];
|
|
17
17
|
autoOptionFocus?: ListboxProps['autoOptionFocus'];
|
|
18
18
|
selectOnFocus?: ListboxProps['selectOnFocus'];
|
|
19
|
+
optionDisabled?: ListboxProps['optionDisabled'];
|
|
20
|
+
optionGroupLabel?: ListboxProps['optionGroupLabel'];
|
|
21
|
+
optionGroupChildren?: ListboxProps['optionGroupChildren'];
|
|
22
|
+
listStyle?: ListboxProps['listStyle'];
|
|
23
|
+
dataKey?: ListboxProps['dataKey'];
|
|
24
|
+
metaKeySelection?: ListboxProps['metaKeySelection'];
|
|
25
|
+
virtualScrollerOptions?: ListboxProps['virtualScrollerOptions'];
|
|
26
|
+
tabindex?: ListboxProps['tabindex'];
|
|
27
|
+
ariaLabel?: ListboxProps['ariaLabel'];
|
|
28
|
+
ariaLabelledby?: ListboxProps['ariaLabelledby'];
|
|
19
29
|
}
|
|
20
30
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
21
31
|
context: {
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { FormKitIconProps } from './FormKitIcon.vue';
|
|
4
|
+
export interface FormKitOutputTextProps {
|
|
5
|
+
html?: boolean;
|
|
6
|
+
isTranslationKey?: boolean;
|
|
7
|
+
convertValue?: (value: string) => string;
|
|
8
|
+
}
|
|
4
9
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
10
|
context: {
|
|
6
|
-
type: PropType<FormKitFrameworkContext> & FormKitIconProps;
|
|
11
|
+
type: PropType<FormKitFrameworkContext> & FormKitIconProps & FormKitOutputTextProps;
|
|
7
12
|
required: true;
|
|
8
13
|
};
|
|
9
14
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
15
|
context: {
|
|
11
|
-
type: PropType<FormKitFrameworkContext> & FormKitIconProps;
|
|
16
|
+
type: PropType<FormKitFrameworkContext> & FormKitIconProps & FormKitOutputTextProps;
|
|
12
17
|
required: true;
|
|
13
18
|
};
|
|
14
19
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -9,9 +9,15 @@ import FormKitIcon from './FormKitIcon.vue'
|
|
|
9
9
|
import FormKitPrefix from './FormKitPrefix.vue'
|
|
10
10
|
import FormKitSuffix from './FormKitSuffix.vue'
|
|
11
11
|
|
|
12
|
+
export interface FormKitOutputTextProps {
|
|
13
|
+
html?: boolean
|
|
14
|
+
isTranslationKey?: boolean
|
|
15
|
+
convertValue?: (value: string) => string
|
|
16
|
+
}
|
|
17
|
+
|
|
12
18
|
const props = defineProps({
|
|
13
19
|
context: {
|
|
14
|
-
type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps,
|
|
20
|
+
type: Object as PropType<FormKitFrameworkContext> & FormKitIconProps & FormKitOutputTextProps,
|
|
15
21
|
required: true,
|
|
16
22
|
},
|
|
17
23
|
})
|
|
@@ -20,10 +26,15 @@ const textValue = computed(() => {
|
|
|
20
26
|
const value = props.context?._value
|
|
21
27
|
const { t } = useI18n()
|
|
22
28
|
if (value) {
|
|
23
|
-
if (props.context?.isTranslationKey)
|
|
29
|
+
if (props.context?.isTranslationKey) {
|
|
24
30
|
return t(value)
|
|
25
|
-
|
|
31
|
+
}
|
|
32
|
+
else if (typeof props.context?.convertValue === 'function') {
|
|
33
|
+
return props.context?.convertValue(value)
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
26
36
|
return value
|
|
37
|
+
}
|
|
27
38
|
}
|
|
28
39
|
else {
|
|
29
40
|
return ''
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { FormKitFrameworkContext } from '@formkit/core';
|
|
2
2
|
import type { PropType } from 'vue';
|
|
3
3
|
import type { FormKitIconProps } from './FormKitIcon.vue';
|
|
4
|
+
export interface FormKitOutputTextProps {
|
|
5
|
+
html?: boolean;
|
|
6
|
+
isTranslationKey?: boolean;
|
|
7
|
+
convertValue?: (value: string) => string;
|
|
8
|
+
}
|
|
4
9
|
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
5
10
|
context: {
|
|
6
|
-
type: PropType<FormKitFrameworkContext> & FormKitIconProps;
|
|
11
|
+
type: PropType<FormKitFrameworkContext> & FormKitIconProps & FormKitOutputTextProps;
|
|
7
12
|
required: true;
|
|
8
13
|
};
|
|
9
14
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
15
|
context: {
|
|
11
|
-
type: PropType<FormKitFrameworkContext> & FormKitIconProps;
|
|
16
|
+
type: PropType<FormKitFrameworkContext> & FormKitIconProps & FormKitOutputTextProps;
|
|
12
17
|
required: true;
|
|
13
18
|
};
|
|
14
19
|
}>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -73,7 +73,7 @@ const primeMultiSelectDefinition = exports.primeMultiSelectDefinition = (0, _vue
|
|
|
73
73
|
family: "PrimeInput"
|
|
74
74
|
});
|
|
75
75
|
const primeListboxDefinition = exports.primeListboxDefinition = (0, _vue.createInput)(_PrimeListbox.default, {
|
|
76
|
-
props: ["pt", "ptOptions", "unstyled", "options", "optionLabel", "optionValue", "multiple", "filter", "filterIcon", "filterPlaceholder", "filterLocale", "filterMatchMode", "autoOptionFocus", "selectOnFocus"],
|
|
76
|
+
props: ["pt", "ptOptions", "unstyled", "options", "optionLabel", "optionValue", "multiple", "filter", "filterIcon", "filterPlaceholder", "filterLocale", "filterMatchMode", "autoOptionFocus", "selectOnFocus", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "dataKey", "metaKeySelection", "virtualScrollerOptions"],
|
|
77
77
|
family: "PrimeInput"
|
|
78
78
|
});
|
|
79
79
|
const primeDatePickerDefinition = exports.primeDatePickerDefinition = (0, _vue.createInput)(_PrimeDatePicker.default, {
|
|
@@ -66,7 +66,7 @@ export const primeMultiSelectDefinition = createInput(PrimeMultiSelect, {
|
|
|
66
66
|
family: "PrimeInput"
|
|
67
67
|
});
|
|
68
68
|
export const primeListboxDefinition = createInput(PrimeListbox, {
|
|
69
|
-
props: ["pt", "ptOptions", "unstyled", "options", "optionLabel", "optionValue", "multiple", "filter", "filterIcon", "filterPlaceholder", "filterLocale", "filterMatchMode", "autoOptionFocus", "selectOnFocus"],
|
|
69
|
+
props: ["pt", "ptOptions", "unstyled", "options", "optionLabel", "optionValue", "multiple", "filter", "filterIcon", "filterPlaceholder", "filterLocale", "filterMatchMode", "autoOptionFocus", "selectOnFocus", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "dataKey", "metaKeySelection", "virtualScrollerOptions"],
|
|
70
70
|
family: "PrimeInput"
|
|
71
71
|
});
|
|
72
72
|
export const primeDatePickerDefinition = createInput(PrimeDatePicker, {
|
|
@@ -15,7 +15,7 @@ var _PrimeOutputReference = _interopRequireDefault(require("../components/PrimeO
|
|
|
15
15
|
var _PrimeOutputText = _interopRequireDefault(require("../components/PrimeOutputText.vue"));
|
|
16
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
17
17
|
const primeOutputTextDefinition = exports.primeOutputTextDefinition = (0, _vue.createInput)(_PrimeOutputText.default, {
|
|
18
|
-
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked"]
|
|
18
|
+
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked", "convertValue"]
|
|
19
19
|
});
|
|
20
20
|
const primeOutputDateDefinition = exports.primeOutputDateDefinition = (0, _vue.createInput)(_PrimeOutputDate.default, {
|
|
21
21
|
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
|
|
@@ -8,7 +8,7 @@ import PrimeOutputNumber from "../components/PrimeOutputNumber.vue";
|
|
|
8
8
|
import PrimeOutputReference from "../components/PrimeOutputReference.vue";
|
|
9
9
|
import PrimeOutputText from "../components/PrimeOutputText.vue";
|
|
10
10
|
export const primeOutputTextDefinition = createInput(PrimeOutputText, {
|
|
11
|
-
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked"]
|
|
11
|
+
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "isTranslationKey", "html", "onIconPrefixClicked", "onIconSuffixClicked", "convertValue"]
|
|
12
12
|
});
|
|
13
13
|
export const primeOutputDateDefinition = createInput(PrimeOutputDate, {
|
|
14
14
|
props: ["prefix", "suffix", "iconPrefix", "iconSuffix", "onIconPrefixClicked", "onIconSuffixClicked"]
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.0.
|
|
5
|
-
"packageManager": "pnpm@10.
|
|
4
|
+
"version": "3.0.12",
|
|
5
|
+
"packageManager": "pnpm@10.18.2+sha512.9fb969fa749b3ade6035e0f109f0b8a60b5d08a1a87fdf72e337da90dcc93336e2280ca4e44f2358a649b83c17959e9993e777c2080879f3801e6f0d999ad3dd",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "Tom",
|
|
8
8
|
"email": "tom@sfxcode.com"
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"@formkit/vue": "^1.6.9",
|
|
94
94
|
"@intlify/core": "^11.1.12",
|
|
95
95
|
"primeicons": "^7.0.0",
|
|
96
|
-
"primevue": "^4.4.
|
|
96
|
+
"primevue": "^4.4.1",
|
|
97
97
|
"vue-i18n": "^11.1.12"
|
|
98
98
|
},
|
|
99
99
|
"devDependencies": {
|
|
@@ -101,9 +101,9 @@
|
|
|
101
101
|
"@formkit/core": "^1.6.9",
|
|
102
102
|
"@formkit/drag-and-drop": "^0.5.3",
|
|
103
103
|
"@primeuix/themes": "^1.2.5",
|
|
104
|
-
"@types/node": "^24.
|
|
105
|
-
"@unocss/preset-icons": "66.5.
|
|
106
|
-
"@unocss/preset-uno": "66.5.
|
|
104
|
+
"@types/node": "^24.7.2",
|
|
105
|
+
"@unocss/preset-icons": "66.5.3",
|
|
106
|
+
"@unocss/preset-uno": "66.5.3",
|
|
107
107
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
108
108
|
"@vitest/coverage-v8": "^3.2.4",
|
|
109
109
|
"@vitest/ui": "^3.2.4",
|
|
@@ -118,27 +118,27 @@
|
|
|
118
118
|
"consola": "^3.4.2",
|
|
119
119
|
"cookie": "^1.0.2",
|
|
120
120
|
"esbuild": "^0.25.10",
|
|
121
|
-
"eslint": "^9.
|
|
122
|
-
"happy-dom": "^
|
|
121
|
+
"eslint": "^9.37.0",
|
|
122
|
+
"happy-dom": "^20.0.0",
|
|
123
123
|
"json-editor-vue": "^0.18.1",
|
|
124
124
|
"mkdist": "^2.4.1",
|
|
125
125
|
"sass": "^1.93.2",
|
|
126
126
|
"tslib": "^2.8.1",
|
|
127
127
|
"typescript": "^5.9.3",
|
|
128
128
|
"unbuild": "^3.6.1",
|
|
129
|
-
"unocss": "66.5.
|
|
129
|
+
"unocss": "66.5.3",
|
|
130
130
|
"unplugin-auto-import": "^20.2.0",
|
|
131
131
|
"unplugin-vue-components": "^29.1.0",
|
|
132
|
-
"vite": "^7.1.
|
|
132
|
+
"vite": "^7.1.9",
|
|
133
133
|
"vite-plugin-dts": "^4.5.4",
|
|
134
134
|
"vite-plugin-eslint": "^1.8.1",
|
|
135
135
|
"vite-plugin-pages": "^0.33.1",
|
|
136
|
-
"vite-ssg": "^28.1
|
|
136
|
+
"vite-ssg": "^28.2.1",
|
|
137
137
|
"vitepress": "^1.6.4",
|
|
138
138
|
"vitest": "^3.2.4",
|
|
139
139
|
"vue": "^3.5.22",
|
|
140
140
|
"vue-demi": "^0.14.10",
|
|
141
141
|
"vue-router": "^4.5.1",
|
|
142
|
-
"vue-tsc": "^3.1.
|
|
142
|
+
"vue-tsc": "^3.1.1"
|
|
143
143
|
}
|
|
144
144
|
}
|