@sfxcode/formkit-primevue 1.9.3 → 1.9.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.
- package/README.md +2 -2
- package/dist/components/PrimeInputOtp.vue +58 -0
- package/dist/components/PrimeRadioButton.vue +2 -2
- package/dist/index.js +8 -3
- package/dist/index.mjs +17 -2
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -27,7 +27,6 @@ import { primeInputs } from '@sfxcode/formkit-primevue'
|
|
|
27
27
|
|
|
28
28
|
[useFormKitSchema](https://github.com/sfxcode/formkit-primevue/blob/main/src/composables/useFormKitSchema.ts) provide functions to simplify the usage of elements, components, lists, ...
|
|
29
29
|
|
|
30
|
-
|
|
31
30
|
### Basic Styling
|
|
32
31
|
|
|
33
32
|
Basic styling is provided with the [formkit-primevue.scss](https://github.com/sfxcode/formkit-primevue/blob/main/src/sass/formkit-primevue.scss) file.
|
|
@@ -47,7 +46,7 @@ You can use it or take it as base for your own styling.
|
|
|
47
46
|
- PT and PTOptions are available ([https://primevue.org/passthrough/](https://primevue.org/passthrough/))
|
|
48
47
|
- [Styling](https://formkit-primevue.netlify.app/styling/base) and [PT](https://formkit-primevue.netlify.app/styling/passThrough) demo available
|
|
49
48
|
|
|
50
|
-
### Samples
|
|
49
|
+
### Samples
|
|
51
50
|
|
|
52
51
|
Some samples for common tasks are available
|
|
53
52
|
|
|
@@ -71,6 +70,7 @@ Some samples for common tasks are available
|
|
|
71
70
|
- Editor (HTML Editor)
|
|
72
71
|
- InputMask
|
|
73
72
|
- InputNumber
|
|
73
|
+
- InputOtp
|
|
74
74
|
- InputSwitch
|
|
75
75
|
- InputText
|
|
76
76
|
- InputTextarea
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<script setup lang='ts'>
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { InputOtpProps } from 'primevue/inputotp'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeInputOtpProps {
|
|
7
|
+
unstyled?: InputOtpProps['unstyled']
|
|
8
|
+
ptOptions?: InputOtpProps['ptOptions']
|
|
9
|
+
pt?: InputOtpProps['pt']
|
|
10
|
+
length?: InputOtpProps['length']
|
|
11
|
+
variant?: InputOtpProps['variant']
|
|
12
|
+
mask?: InputOtpProps['mask']
|
|
13
|
+
integerOnly?: InputOtpProps['integerOnly']
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = defineProps({
|
|
17
|
+
context: {
|
|
18
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeInputOtpProps>,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
function handleInput(_: any) {
|
|
24
|
+
props.context?.node.input(props.context?._value)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function handleBlur(e: Event) {
|
|
28
|
+
props.context?.handlers.blur(e)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<div class="p-formkit">
|
|
36
|
+
<InputOtp
|
|
37
|
+
:id="context.id"
|
|
38
|
+
v-model="context._value"
|
|
39
|
+
v-bind="context?.attrs"
|
|
40
|
+
:disabled="!!context?.disabled"
|
|
41
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
42
|
+
:style="context?.attrs.style"
|
|
43
|
+
:class="styleClass"
|
|
44
|
+
:tabindex="context?.attrs.tabindex"
|
|
45
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
46
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
47
|
+
:length="context.length"
|
|
48
|
+
:variant="context.variant"
|
|
49
|
+
:mask="context.mask"
|
|
50
|
+
:integer-only="context.integerOnly"
|
|
51
|
+
:pt="context.pt"
|
|
52
|
+
:pt-options="context.ptOptions"
|
|
53
|
+
:unstyled="context.unstyled ?? false"
|
|
54
|
+
@change="handleInput"
|
|
55
|
+
@blur="handleBlur"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
@@ -31,7 +31,7 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
|
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
33
|
<div :class="context.options_class" class="p-formkit">
|
|
34
|
-
<div v-for="option in context.options" :key="option.value" :class="context.
|
|
34
|
+
<div v-for="option in context.options" :key="option.value" :class="context.option_class">
|
|
35
35
|
<RadioButton
|
|
36
36
|
:id="context.id"
|
|
37
37
|
v-model="context._value"
|
|
@@ -49,7 +49,7 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
|
|
|
49
49
|
@change="handleChange"
|
|
50
50
|
@blur="handleBlur"
|
|
51
51
|
/>
|
|
52
|
-
<label :for="option.value" class="p-formkit-radio-label">{{ option.label }}</label>
|
|
52
|
+
<label :for="option.value" :class="context.label_class" class="p-formkit-radio-label">{{ option.label }}</label>
|
|
53
53
|
</div>
|
|
54
54
|
</div>
|
|
55
55
|
</template>
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.primeTriStateCheckboxDefinition = exports.primeTreeSelectDefinition = exports.primeToggleButtonDefinition = exports.primeTextareaDefinition = exports.primeSliderDefinition = exports.primeSelectButtonDefinition = exports.primeRatingDefinition = exports.primeRadioButtonDefinition = exports.primePasswordDefinition = exports.primeMultiSelectDefinition = exports.primeListboxDefinition = exports.primeKnobDefinition = exports.primeInputs = exports.primeInputTextDefinition = exports.primeInputSwitchDefinition = exports.primeInputNumberDefinition = exports.primeInputMaskDefinition = exports.primeEditorDefinition = exports.primeDropdownDefinition = exports.primeColorPickerDefinition = exports.primeChipsDefinition = exports.primeCheckboxDefinition = exports.primeCascadeSelectDefinition = exports.primeCalendarDefinition = exports.primeAutoCompleteDefinition = exports.default = void 0;
|
|
6
|
+
exports.primeTriStateCheckboxDefinition = exports.primeTreeSelectDefinition = exports.primeToggleButtonDefinition = exports.primeTextareaDefinition = exports.primeSliderDefinition = exports.primeSelectButtonDefinition = exports.primeRatingDefinition = exports.primeRadioButtonDefinition = exports.primePasswordDefinition = exports.primeMultiSelectDefinition = exports.primeListboxDefinition = exports.primeKnobDefinition = exports.primeInputs = exports.primeInputTextDefinition = exports.primeInputSwitchDefinition = exports.primeInputOtpDefinition = exports.primeInputNumberDefinition = exports.primeInputMaskDefinition = exports.primeEditorDefinition = exports.primeDropdownDefinition = exports.primeColorPickerDefinition = exports.primeChipsDefinition = exports.primeCheckboxDefinition = exports.primeCascadeSelectDefinition = exports.primeCalendarDefinition = exports.primeAutoCompleteDefinition = exports.default = void 0;
|
|
7
7
|
Object.defineProperty(exports, "useFormKitSchema", {
|
|
8
8
|
enumerable: true,
|
|
9
9
|
get: function () {
|
|
@@ -21,6 +21,7 @@ var _PrimeDropdown = _interopRequireDefault(require("./components/PrimeDropdown.
|
|
|
21
21
|
var _PrimeEditor = _interopRequireDefault(require("./components/PrimeEditor.vue"));
|
|
22
22
|
var _PrimeInputMask = _interopRequireDefault(require("./components/PrimeInputMask.vue"));
|
|
23
23
|
var _PrimeInputNumber = _interopRequireDefault(require("./components/PrimeInputNumber.vue"));
|
|
24
|
+
var _PrimeInputOtp = _interopRequireDefault(require("./components/PrimeInputOtp.vue"));
|
|
24
25
|
var _PrimeInputSwitch = _interopRequireDefault(require("./components/PrimeInputSwitch.vue"));
|
|
25
26
|
var _PrimeInputText = _interopRequireDefault(require("./components/PrimeInputText.vue"));
|
|
26
27
|
var _PrimeTextarea = _interopRequireDefault(require("./components/PrimeTextarea.vue"));
|
|
@@ -70,6 +71,9 @@ const primeCheckboxDefinition = exports.primeCheckboxDefinition = (0, _vue.creat
|
|
|
70
71
|
const primeInputSwitchDefinition = exports.primeInputSwitchDefinition = (0, _vue.createInput)(_PrimeInputSwitch.default, {
|
|
71
72
|
props: ["trueValue", "falseValue", "pt", "ptOptions", "unstyled", "labelLeft", "labelRight"]
|
|
72
73
|
});
|
|
74
|
+
const primeInputOtpDefinition = exports.primeInputOtpDefinition = (0, _vue.createInput)(_PrimeInputOtp.default, {
|
|
75
|
+
props: ["length", "variant", "mask", "integerOnly", "pt", "ptOptions", "unstyled"]
|
|
76
|
+
});
|
|
73
77
|
const primeEditorDefinition = exports.primeEditorDefinition = (0, _vue.createInput)(_PrimeEditor.default, {
|
|
74
78
|
props: ["placeholder", "formats", "modules", "pt", "ptOptions", "unstyled"]
|
|
75
79
|
});
|
|
@@ -92,7 +96,7 @@ const primeRatingDefinition = exports.primeRatingDefinition = (0, _vue.createInp
|
|
|
92
96
|
props: ["unstyled", "stars", "cancel", "onIcon", "offIcon", "cancelIcon", "ptOptions", "pt"]
|
|
93
97
|
});
|
|
94
98
|
const primeRadioButtonDefinition = exports.primeRadioButtonDefinition = (0, _vue.createInput)(_PrimeRadioButton.default, {
|
|
95
|
-
props: ["pt", "ptOptions", "unstyled", "options", "options_class"]
|
|
99
|
+
props: ["pt", "ptOptions", "unstyled", "options", "options_class", "option_class", "label_class"]
|
|
96
100
|
});
|
|
97
101
|
const primeChipsDefinition = exports.primeChipsDefinition = (0, _vue.createInput)(_PrimeChips.default, {
|
|
98
102
|
props: ["allowDuplicate", "addOnBlur", "max", "placeholder", "seperator", "pt", "ptOptions", "unstyled"]
|
|
@@ -142,5 +146,6 @@ const primeInputs = exports.primeInputs = {
|
|
|
142
146
|
primeSelectButton: primeSelectButtonDefinition,
|
|
143
147
|
primeTriStateCheckbox: primeTriStateCheckboxDefinition,
|
|
144
148
|
primeCascadeSelect: primeCascadeSelectDefinition,
|
|
145
|
-
primeTreeSelect: primeTreeSelectDefinition
|
|
149
|
+
primeTreeSelect: primeTreeSelectDefinition,
|
|
150
|
+
primeInputOtp: primeInputOtpDefinition
|
|
146
151
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import PrimeDropdown from "./components/PrimeDropdown.vue";
|
|
|
9
9
|
import PrimeEditor from "./components/PrimeEditor.vue";
|
|
10
10
|
import PrimeInputMask from "./components/PrimeInputMask.vue";
|
|
11
11
|
import PrimeInputNumber from "./components/PrimeInputNumber.vue";
|
|
12
|
+
import PrimeInputOtp from "./components/PrimeInputOtp.vue";
|
|
12
13
|
import PrimeInputSwitch from "./components/PrimeInputSwitch.vue";
|
|
13
14
|
import PrimeInputText from "./components/PrimeInputText.vue";
|
|
14
15
|
import PrimeTextarea from "./components/PrimeTextarea.vue";
|
|
@@ -132,6 +133,17 @@ export const primeInputSwitchDefinition = createInput(PrimeInputSwitch, {
|
|
|
132
133
|
"labelRight"
|
|
133
134
|
]
|
|
134
135
|
});
|
|
136
|
+
export const primeInputOtpDefinition = createInput(PrimeInputOtp, {
|
|
137
|
+
props: [
|
|
138
|
+
"length",
|
|
139
|
+
"variant",
|
|
140
|
+
"mask",
|
|
141
|
+
"integerOnly",
|
|
142
|
+
"pt",
|
|
143
|
+
"ptOptions",
|
|
144
|
+
"unstyled"
|
|
145
|
+
]
|
|
146
|
+
});
|
|
135
147
|
export const primeEditorDefinition = createInput(PrimeEditor, {
|
|
136
148
|
props: [
|
|
137
149
|
"placeholder",
|
|
@@ -315,7 +327,9 @@ export const primeRadioButtonDefinition = createInput(PrimeRadioButton, {
|
|
|
315
327
|
"ptOptions",
|
|
316
328
|
"unstyled",
|
|
317
329
|
"options",
|
|
318
|
-
"options_class"
|
|
330
|
+
"options_class",
|
|
331
|
+
"option_class",
|
|
332
|
+
"label_class"
|
|
319
333
|
]
|
|
320
334
|
});
|
|
321
335
|
export const primeChipsDefinition = createInput(PrimeChips, {
|
|
@@ -447,7 +461,8 @@ export const primeInputs = {
|
|
|
447
461
|
primeSelectButton: primeSelectButtonDefinition,
|
|
448
462
|
primeTriStateCheckbox: primeTriStateCheckboxDefinition,
|
|
449
463
|
primeCascadeSelect: primeCascadeSelectDefinition,
|
|
450
|
-
primeTreeSelect: primeTreeSelectDefinition
|
|
464
|
+
primeTreeSelect: primeTreeSelectDefinition,
|
|
465
|
+
primeInputOtp: primeInputOtpDefinition
|
|
451
466
|
};
|
|
452
467
|
export {
|
|
453
468
|
useFormKitSchema
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sfxcode/formkit-primevue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.9.
|
|
4
|
+
"version": "1.9.5",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Tom",
|
|
7
7
|
"email": "tom@sfxcode.com"
|
|
@@ -64,18 +64,18 @@
|
|
|
64
64
|
"@formkit/i18n": "^1.6.0",
|
|
65
65
|
"@formkit/vue": "^1.6.0",
|
|
66
66
|
"primeicons": "^6.0.1",
|
|
67
|
-
"primevue": "^3.
|
|
67
|
+
"primevue": "^3.50.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@antfu/eslint-config": "2.8.
|
|
70
|
+
"@antfu/eslint-config": "2.8.3",
|
|
71
71
|
"@formkit/core": "^1.6.0",
|
|
72
|
-
"@types/node": "^20.11.
|
|
73
|
-
"@unocss/preset-icons": "^0.58.
|
|
74
|
-
"@unocss/preset-uno": "0.58.
|
|
72
|
+
"@types/node": "^20.11.28",
|
|
73
|
+
"@unocss/preset-icons": "^0.58.6",
|
|
74
|
+
"@unocss/preset-uno": "0.58.6",
|
|
75
75
|
"@vitejs/plugin-vue": "^5.0.4",
|
|
76
76
|
"@vue/compiler-sfc": "^3.4.21",
|
|
77
77
|
"@vue/server-renderer": "^3.4.21",
|
|
78
|
-
"@vue/test-utils": "^2.4.
|
|
78
|
+
"@vue/test-utils": "^2.4.5",
|
|
79
79
|
"@vue/tsconfig": "^0.5.1",
|
|
80
80
|
"@vuedx/typecheck": "~0.7.6",
|
|
81
81
|
"@vuedx/typescript-plugin-vue": "~0.7.6",
|
|
@@ -87,20 +87,20 @@
|
|
|
87
87
|
"json-editor-vue": "^0.12.0",
|
|
88
88
|
"mkdist": "^1.4.0",
|
|
89
89
|
"quill": "^1.3.7",
|
|
90
|
-
"sass": "^1.
|
|
90
|
+
"sass": "^1.72.0",
|
|
91
91
|
"tslib": "^2.6.2",
|
|
92
92
|
"typescript": "^5.4.2",
|
|
93
93
|
"unbuild": "2.0.0",
|
|
94
|
-
"unocss": "^0.58.
|
|
94
|
+
"unocss": "^0.58.6",
|
|
95
95
|
"unplugin-auto-import": "^0.17.5",
|
|
96
96
|
"unplugin-vue-components": "^0.26.0",
|
|
97
|
-
"vanilla-jsoneditor": "^0.
|
|
97
|
+
"vanilla-jsoneditor": "^0.23.0",
|
|
98
98
|
"vite": "^5.1.6",
|
|
99
99
|
"vite-plugin-dts": "^3.7.3",
|
|
100
100
|
"vite-plugin-eslint": "^1.8.1",
|
|
101
101
|
"vite-plugin-pages": "^0.32.0",
|
|
102
102
|
"vite-ssg": "^0.23.6",
|
|
103
|
-
"vitepress": "1.0.0-rc.
|
|
103
|
+
"vitepress": "1.0.0-rc.45",
|
|
104
104
|
"vue": "^3.4.21",
|
|
105
105
|
"vue-demi": "^0.14.7",
|
|
106
106
|
"vue-router": "^4.3.0",
|