@sfxcode/formkit-primevue 2.0.6 → 2.2.2
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 +14 -13
- package/dist/components/PrimeAutoComplete.vue +7 -13
- package/dist/components/PrimeCascadeSelect.vue +5 -11
- package/dist/components/PrimeCheckbox.vue +9 -11
- package/dist/components/PrimeColorPicker.vue +4 -4
- package/dist/components/PrimeDatePicker.vue +5 -11
- package/dist/components/PrimeEditor.vue +5 -7
- package/dist/components/PrimeInputMask.vue +6 -4
- package/dist/components/PrimeInputNumber.vue +6 -7
- package/dist/components/PrimeInputOtp.vue +5 -11
- package/dist/components/PrimeInputText.vue +5 -11
- package/dist/components/PrimeKnob.vue +6 -4
- package/dist/components/PrimeListbox.vue +5 -11
- package/dist/components/PrimeMultiSelect.vue +5 -11
- package/dist/components/PrimePassword.vue +5 -11
- package/dist/components/PrimeRadioButton.vue +9 -14
- package/dist/components/PrimeRating.vue +5 -11
- package/dist/components/PrimeSelect.vue +5 -9
- package/dist/components/PrimeSelectButton.vue +5 -11
- package/dist/components/PrimeSlider.vue +6 -8
- package/dist/components/PrimeTextarea.vue +5 -10
- package/dist/components/PrimeToggleButton.vue +5 -11
- package/dist/components/PrimeToggleSwitch.vue +7 -13
- package/dist/components/PrimeTreeSelect.vue +5 -11
- package/dist/composables/index.d.ts +2 -1
- package/dist/composables/index.js +7 -0
- package/dist/composables/index.mjs +2 -0
- package/dist/composables/useFormKitInput.d.ts +8 -0
- package/dist/composables/useFormKitInput.js +35 -0
- package/dist/composables/useFormKitInput.mjs +22 -0
- package/dist/definitions/index.js +23 -23
- package/dist/definitions/index.mjs +56 -25
- package/dist/sass/formkit-primevue.scss +2 -2
- package/dist/style.css +1 -1
- package/package.json +21 -21
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { RadioButtonProps } from 'primevue/radiobutton'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeRadioButtonProps {
|
|
8
9
|
pt?: RadioButtonProps['pt']
|
|
9
10
|
ptOptions?: RadioButtonProps['ptOptions']
|
|
10
11
|
unstyled?: RadioButtonProps['unstyled']
|
|
11
12
|
options?: { label: string, value: any }[]
|
|
12
|
-
|
|
13
|
+
optionClass?: string
|
|
14
|
+
labelClass?: string
|
|
15
|
+
wrapperClass?: string
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
const props = defineProps({
|
|
@@ -19,20 +22,12 @@ const props = defineProps({
|
|
|
19
22
|
},
|
|
20
23
|
})
|
|
21
24
|
|
|
22
|
-
|
|
23
|
-
props.context?.node.input(props.context?._value)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
function handleBlur(e: Event) {
|
|
27
|
-
props.context?.handlers.blur(e)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
25
|
+
const { styleClass, wrapperClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
31
26
|
</script>
|
|
32
27
|
|
|
33
28
|
<template>
|
|
34
|
-
<div :class="
|
|
35
|
-
<div v-for="option in context.options" :key="option.value" :class="context.
|
|
29
|
+
<div :class="wrapperClass">
|
|
30
|
+
<div v-for="option in context.options" :key="option.value" :class="context.optionClass">
|
|
36
31
|
<RadioButton
|
|
37
32
|
:id="context.id"
|
|
38
33
|
v-model="context._value"
|
|
@@ -50,7 +45,7 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
|
|
|
50
45
|
@change="handleChange"
|
|
51
46
|
@blur="handleBlur"
|
|
52
47
|
/>
|
|
53
|
-
<label :for="option.value" :class="context.
|
|
48
|
+
<label :for="option.value" :class="context.labelClass" class="p-formkit-radio-label">{{ option.label }}</label>
|
|
54
49
|
</div>
|
|
55
50
|
</div>
|
|
56
51
|
</template>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { RatingProps } from 'primevue/rating'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeRatingProps {
|
|
8
9
|
unstyled?: RatingProps['unstyled']
|
|
@@ -11,6 +12,7 @@ export interface FormKitPrimeRatingProps {
|
|
|
11
12
|
offIcon?: RatingProps['offIcon']
|
|
12
13
|
ptOptions?: RatingProps['ptOptions']
|
|
13
14
|
pt?: RatingProps['pt']
|
|
15
|
+
wrapperClass?: string
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const props = defineProps({
|
|
@@ -20,19 +22,11 @@ const props = defineProps({
|
|
|
20
22
|
},
|
|
21
23
|
})
|
|
22
24
|
|
|
23
|
-
|
|
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)
|
|
25
|
+
const { styleClass, wrapperClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
32
26
|
</script>
|
|
33
27
|
|
|
34
28
|
<template>
|
|
35
|
-
<div class="
|
|
29
|
+
<div :class="wrapperClass">
|
|
36
30
|
<Rating
|
|
37
31
|
:id="context.id"
|
|
38
32
|
v-model="context._value"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { SelectProps } from 'primevue/select'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeSelectProps {
|
|
8
9
|
options?: SelectProps['options']
|
|
@@ -36,6 +37,7 @@ export interface FormKitPrimeSelectProps {
|
|
|
36
37
|
pt?: SelectProps['pt']
|
|
37
38
|
ptOptions?: SelectProps['ptOptions']
|
|
38
39
|
unstyled?: SelectProps['unstyled']
|
|
40
|
+
wrapperClass?: string
|
|
39
41
|
}
|
|
40
42
|
|
|
41
43
|
const props = defineProps({
|
|
@@ -45,17 +47,11 @@ const props = defineProps({
|
|
|
45
47
|
},
|
|
46
48
|
})
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
props.context?.handlers.blur(e)
|
|
50
|
-
}
|
|
51
|
-
function handleInput(e: any) {
|
|
52
|
-
props.context?.node.input(e.value)
|
|
53
|
-
}
|
|
54
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
50
|
+
const { styleClass, wrapperClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
55
51
|
</script>
|
|
56
52
|
|
|
57
53
|
<template>
|
|
58
|
-
<div class="
|
|
54
|
+
<div :class="wrapperClass">
|
|
59
55
|
<Select
|
|
60
56
|
v-model="context._value"
|
|
61
57
|
v-bind="context?.attrs"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { SelectButtonProps } from 'primevue/selectbutton'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeSelectButtonProps {
|
|
8
9
|
pt?: SelectButtonProps['pt']
|
|
@@ -14,6 +15,7 @@ export interface FormKitPrimeSelectButtonProps {
|
|
|
14
15
|
multiple?: SelectButtonProps['multiple']
|
|
15
16
|
dataKey?: SelectButtonProps['dataKey']
|
|
16
17
|
options?: SelectButtonProps['options']
|
|
18
|
+
wrapperClass?: string
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
const props = defineProps({
|
|
@@ -23,19 +25,11 @@ const props = defineProps({
|
|
|
23
25
|
},
|
|
24
26
|
})
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
props.context?.node.input(props.context?._value)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function handleBlur(e: Event) {
|
|
31
|
-
props.context?.handlers.blur(e)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
28
|
+
const { styleClass, wrapperClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
35
29
|
</script>
|
|
36
30
|
|
|
37
31
|
<template>
|
|
38
|
-
<div class="
|
|
32
|
+
<div :class="wrapperClass">
|
|
39
33
|
<SelectButton
|
|
40
34
|
:id="context.id"
|
|
41
35
|
v-model="context._value"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { SliderProps } from 'primevue/slider'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeSliderProps {
|
|
8
9
|
pt?: SliderProps['pt']
|
|
@@ -13,6 +14,7 @@ export interface FormKitPrimeSliderProps {
|
|
|
13
14
|
step?: SliderProps['step']
|
|
14
15
|
range?: SliderProps['range']
|
|
15
16
|
orientation?: SliderProps['orientation']
|
|
17
|
+
wrapperClass?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const props = defineProps({
|
|
@@ -22,20 +24,16 @@ const props = defineProps({
|
|
|
22
24
|
},
|
|
23
25
|
})
|
|
24
26
|
|
|
27
|
+
const { styleClass, wrapperClass, handleBlur } = useFormKitInput(props.context)
|
|
28
|
+
|
|
25
29
|
function handleInput(e: any) {
|
|
26
30
|
props.context?.node.input(e)
|
|
27
31
|
props.context?.handlers.blur(e)
|
|
28
32
|
}
|
|
29
|
-
|
|
30
|
-
function handleBlur(e: Event) {
|
|
31
|
-
props.context?.handlers.blur(e)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
35
33
|
</script>
|
|
36
34
|
|
|
37
35
|
<template>
|
|
38
|
-
<div class="
|
|
36
|
+
<div :class="wrapperClass">
|
|
39
37
|
<Slider
|
|
40
38
|
:id="context.id"
|
|
41
39
|
v-model="context._value"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { TextareaProps } from 'primevue/textarea'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeTextareaProps {
|
|
8
9
|
pt?: TextareaProps['pt']
|
|
@@ -11,6 +12,7 @@ export interface FormKitPrimeTextareaProps {
|
|
|
11
12
|
autoResize?: TextareaProps['autoResize']
|
|
12
13
|
rows?: TextareaProps['rows']
|
|
13
14
|
placeholder?: TextareaProps['placeholder']
|
|
15
|
+
wrapperClass?: string
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
const props = defineProps({
|
|
@@ -20,18 +22,11 @@ const props = defineProps({
|
|
|
20
22
|
},
|
|
21
23
|
})
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
props.context?.handlers.blur(e)
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function handleInput(e: any) {
|
|
28
|
-
props.context?.node.input(e.target.value)
|
|
29
|
-
}
|
|
30
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
25
|
+
const { styleClass, wrapperClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
31
26
|
</script>
|
|
32
27
|
|
|
33
28
|
<template>
|
|
34
|
-
<div class="
|
|
29
|
+
<div :class="wrapperClass">
|
|
35
30
|
<Textarea
|
|
36
31
|
:id="context.id"
|
|
37
32
|
v-model="context._value"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { ToggleButtonProps } from 'primevue/togglebutton'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeToggleButtonProps {
|
|
8
9
|
pt?: ToggleButtonProps['pt']
|
|
@@ -13,6 +14,7 @@ export interface FormKitPrimeToggleButtonProps {
|
|
|
13
14
|
onIcon?: ToggleButtonProps['onIcon']
|
|
14
15
|
offIcon?: ToggleButtonProps['offIcon']
|
|
15
16
|
iconPos?: ToggleButtonProps['iconPos']
|
|
17
|
+
wrapperClass?: string
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
const props = defineProps({
|
|
@@ -22,19 +24,11 @@ const props = defineProps({
|
|
|
22
24
|
},
|
|
23
25
|
})
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
props.context?.node.input(props.context?._value)
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function handleBlur(e: Event) {
|
|
30
|
-
props.context?.handlers.blur(e)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
27
|
+
const { styleClass, wrapperClass, handleChange, handleBlur } = useFormKitInput(props.context)
|
|
34
28
|
</script>
|
|
35
29
|
|
|
36
30
|
<template>
|
|
37
|
-
<div class="
|
|
31
|
+
<div :class="wrapperClass">
|
|
38
32
|
<ToggleButton
|
|
39
33
|
v-model="context._value"
|
|
40
34
|
v-bind="context?.attrs"
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { ToggleSwitchProps } from 'primevue/toggleswitch'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeToggleSwitchProps {
|
|
8
9
|
trueValue?: ToggleSwitchProps['trueValue']
|
|
@@ -12,6 +13,7 @@ export interface FormKitPrimeToggleSwitchProps {
|
|
|
12
13
|
unstyled?: ToggleSwitchProps['unstyled']
|
|
13
14
|
labelLeft?: string
|
|
14
15
|
labelRight?: string
|
|
16
|
+
wrapperClass?: string
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const props = defineProps({
|
|
@@ -21,20 +23,12 @@ const props = defineProps({
|
|
|
21
23
|
},
|
|
22
24
|
})
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
props.context?.node.input(props.context?._value)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
function handleBlur(e: Event) {
|
|
29
|
-
props.context?.handlers.blur(e)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
26
|
+
const { styleClass, wrapperClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
33
27
|
</script>
|
|
34
28
|
|
|
35
29
|
<template>
|
|
36
|
-
<div :class="
|
|
37
|
-
<span v-if="context.
|
|
30
|
+
<div :class="wrapperClass">
|
|
31
|
+
<span v-if="context.labelLeft" class="formkit-prime-left">{{ context.labelLeft }}</span>
|
|
38
32
|
<ToggleSwitch
|
|
39
33
|
v-model="context._value"
|
|
40
34
|
v-bind="context?.attrs"
|
|
@@ -54,6 +48,6 @@ const styleClass = computed(() => (props.context?.state.validationVisible && !pr
|
|
|
54
48
|
@change="handleInput"
|
|
55
49
|
@blur="handleBlur"
|
|
56
50
|
/>
|
|
57
|
-
<span v-if="context.
|
|
51
|
+
<span v-if="context.labelRight" class="formkit-prime-right">{{ context.labelRight }}</span>
|
|
58
52
|
</div>
|
|
59
53
|
</template>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
3
|
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
4
|
|
|
5
5
|
import type { TreeSelectProps } from 'primevue/treeselect'
|
|
6
|
+
import { useFormKitInput } from '../composables'
|
|
6
7
|
|
|
7
8
|
export interface FormKitPrimeTreeSelectProps {
|
|
8
9
|
options?: TreeSelectProps['options']
|
|
@@ -18,6 +19,7 @@ export interface FormKitPrimeTreeSelectProps {
|
|
|
18
19
|
scrollHeight?: TreeSelectProps['scrollHeight']
|
|
19
20
|
panelClass?: TreeSelectProps['panelClass']
|
|
20
21
|
variant?: TreeSelectProps['variant']
|
|
22
|
+
wrapperClass?: string
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
const props = defineProps({
|
|
@@ -27,19 +29,11 @@ const props = defineProps({
|
|
|
27
29
|
},
|
|
28
30
|
})
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
props.context?.node.input(props.context?._value)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function handleBlur(e: Event) {
|
|
35
|
-
props.context?.handlers.blur(e)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
32
|
+
const { styleClass, wrapperClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
39
33
|
</script>
|
|
40
34
|
|
|
41
35
|
<template>
|
|
42
|
-
<div class="
|
|
36
|
+
<div :class="wrapperClass">
|
|
43
37
|
<TreeSelect
|
|
44
38
|
v-model="context._value"
|
|
45
39
|
v-bind="context?.attrs"
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useFormKitInput } from './useFormKitInput';
|
|
1
2
|
import { useFormKitSchema } from './useFormKitSchema';
|
|
2
3
|
import { useInputEditorSchema } from './useInputEditorSchema';
|
|
3
|
-
export { useFormKitSchema, useInputEditorSchema, };
|
|
4
|
+
export { useFormKitInput, useFormKitSchema, useInputEditorSchema, };
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "useFormKitInput", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _useFormKitInput.useFormKitInput;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "useFormKitSchema", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -15,5 +21,6 @@ Object.defineProperty(exports, "useInputEditorSchema", {
|
|
|
15
21
|
return _useInputEditorSchema.useInputEditorSchema;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
24
|
+
var _useFormKitInput = require("./useFormKitInput");
|
|
18
25
|
var _useFormKitSchema = require("./useFormKitSchema");
|
|
19
26
|
var _useInputEditorSchema = require("./useInputEditorSchema");
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function useFormKitInput(context: any): {
|
|
2
|
+
styleClass: import("vue").ComputedRef<any>;
|
|
3
|
+
wrapperClass: import("vue").ComputedRef<string>;
|
|
4
|
+
handleBlur: (event: Event) => void;
|
|
5
|
+
handleChange: (_: any) => void;
|
|
6
|
+
handleInput: (_: any) => void;
|
|
7
|
+
handleSelect: (e: any) => void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useFormKitInput = useFormKitInput;
|
|
7
|
+
var _vue = require("vue");
|
|
8
|
+
function useFormKitInput(context) {
|
|
9
|
+
const styleClass = (0, _vue.computed)(() => {
|
|
10
|
+
return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
|
|
11
|
+
});
|
|
12
|
+
const wrapperClass = (0, _vue.computed)(() => {
|
|
13
|
+
return context?.wrapperClass ? `p-formkit ${context?.wrapperClass}` : "p-formkit ";
|
|
14
|
+
});
|
|
15
|
+
function handleBlur(event) {
|
|
16
|
+
context?.handlers.blur(event);
|
|
17
|
+
}
|
|
18
|
+
function handleChange(_) {
|
|
19
|
+
context?.node.input(context?._value);
|
|
20
|
+
}
|
|
21
|
+
function handleInput(_) {
|
|
22
|
+
context?.node.input(context?._value);
|
|
23
|
+
}
|
|
24
|
+
function handleSelect(e) {
|
|
25
|
+
context?.node.input(e);
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
styleClass,
|
|
29
|
+
wrapperClass,
|
|
30
|
+
handleBlur,
|
|
31
|
+
handleChange,
|
|
32
|
+
handleInput,
|
|
33
|
+
handleSelect
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { computed } from "vue";
|
|
2
|
+
export function useFormKitInput(context) {
|
|
3
|
+
const styleClass = computed(() => {
|
|
4
|
+
return context?.state.validationVisible && !context?.state.valid ? `${context?.attrs?.class} p-invalid` : context?.attrs?.class;
|
|
5
|
+
});
|
|
6
|
+
const wrapperClass = computed(() => {
|
|
7
|
+
return context?.wrapperClass ? `p-formkit ${context?.wrapperClass}` : "p-formkit ";
|
|
8
|
+
});
|
|
9
|
+
function handleBlur(event) {
|
|
10
|
+
context?.handlers.blur(event);
|
|
11
|
+
}
|
|
12
|
+
function handleChange(_) {
|
|
13
|
+
context?.node.input(context?._value);
|
|
14
|
+
}
|
|
15
|
+
function handleInput(_) {
|
|
16
|
+
context?.node.input(context?._value);
|
|
17
|
+
}
|
|
18
|
+
function handleSelect(e) {
|
|
19
|
+
context?.node.input(e);
|
|
20
|
+
}
|
|
21
|
+
return { styleClass, wrapperClass, handleBlur, handleChange, handleInput, handleSelect };
|
|
22
|
+
}
|
|
@@ -30,73 +30,73 @@ var _PrimeTreeSelect = _interopRequireDefault(require("../components/PrimeTreeSe
|
|
|
30
30
|
var _PrimeSelectButton = _interopRequireDefault(require("../components/PrimeSelectButton.vue"));
|
|
31
31
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
32
32
|
const primeAutoCompleteDefinition = exports.primeAutoCompleteDefinition = (0, _vue.createInput)(_PrimeAutoComplete.default, {
|
|
33
|
-
props: ["pt", "ptOptions", "unstyled", "Select", "multiple"]
|
|
33
|
+
props: ["pt", "ptOptions", "unstyled", "Select", "multiple", "typeahead", "wrapperClass"]
|
|
34
34
|
});
|
|
35
35
|
const primeInputTextDefinition = exports.primeInputTextDefinition = (0, _vue.createInput)(_PrimeInputText.default, {
|
|
36
|
-
props: ["pt", "ptOptions", "unstyled", "placeholder", "icon"]
|
|
36
|
+
props: ["pt", "ptOptions", "unstyled", "placeholder", "icon", "wrapperClass"]
|
|
37
37
|
});
|
|
38
38
|
const primeInputNumberDefinition = exports.primeInputNumberDefinition = (0, _vue.createInput)(_PrimeInputNumber.default, {
|
|
39
|
-
props: ["useGrouping", "min", "max", "minFractionDigits", "maxFractionDigits", "locale", "mode", "currency", "prefix", "suffix", "showButtons", "buttonLayout", "step", "pt", "ptOptions", "unstyled", "placeholder"]
|
|
39
|
+
props: ["useGrouping", "min", "max", "minFractionDigits", "maxFractionDigits", "locale", "mode", "currency", "prefix", "suffix", "showButtons", "buttonLayout", "step", "pt", "ptOptions", "unstyled", "placeholder", "wrapperClass"]
|
|
40
40
|
});
|
|
41
41
|
const primeInputMaskDefinition = exports.primeInputMaskDefinition = (0, _vue.createInput)(_PrimeInputMask.default, {
|
|
42
|
-
props: ["mask", "slotChar", "autoClear", "unmask", "pt", "ptOptions", "unstyled", "invalid", "variant", "iconLeft", "iconRight"]
|
|
42
|
+
props: ["mask", "slotChar", "autoClear", "unmask", "pt", "ptOptions", "unstyled", "invalid", "variant", "iconLeft", "iconRight", "wrapperClass"]
|
|
43
43
|
});
|
|
44
44
|
const primePasswordDefinition = exports.primePasswordDefinition = (0, _vue.createInput)(_PrimePassword.default, {
|
|
45
|
-
props: ["mediumRegex", "strongRegex", "promptLabel", "weakLabel", "mediumLabel", "strongLabel", "hideIcon", "showIcon", "pt", "ptOptions", "unstyled", "placeholder", "feedback", "toggleMask"]
|
|
45
|
+
props: ["mediumRegex", "strongRegex", "promptLabel", "weakLabel", "mediumLabel", "strongLabel", "hideIcon", "showIcon", "pt", "ptOptions", "unstyled", "placeholder", "feedback", "toggleMask", "wrapperClass"]
|
|
46
46
|
});
|
|
47
47
|
const primeTextareaDefinition = exports.primeTextareaDefinition = (0, _vue.createInput)(_PrimeTextarea.default, {
|
|
48
|
-
props: ["pt", "ptOptions", "unstyled", "autoResize", "rows", "placeholder"]
|
|
48
|
+
props: ["pt", "ptOptions", "unstyled", "autoResize", "rows", "placeholder", "wrapperClass"]
|
|
49
49
|
});
|
|
50
50
|
const primeCheckboxDefinition = exports.primeCheckboxDefinition = (0, _vue.createInput)(_PrimeCheckbox.default, {
|
|
51
|
-
props: ["binary", "trueValue", "falseValue", "pt", "ptOptions", "unstyled", "labelLeft", "labelRight"]
|
|
51
|
+
props: ["binary", "trueValue", "falseValue", "pt", "ptOptions", "unstyled", "indeterminate", "variant", "labelLeft", "labelRight", "wrapperClass"]
|
|
52
52
|
});
|
|
53
53
|
const primeToggleSwitchDefinition = exports.primeToggleSwitchDefinition = (0, _vue.createInput)(_PrimeToggleSwitch.default, {
|
|
54
|
-
props: ["trueValue", "falseValue", "pt", "ptOptions", "unstyled", "labelLeft", "labelRight"]
|
|
54
|
+
props: ["trueValue", "falseValue", "pt", "ptOptions", "unstyled", "labelLeft", "labelRight", "wrapperClass"]
|
|
55
55
|
});
|
|
56
56
|
const primeInputOtpDefinition = exports.primeInputOtpDefinition = (0, _vue.createInput)(_PrimeInputOtp.default, {
|
|
57
|
-
props: ["length", "variant", "mask", "integerOnly", "pt", "ptOptions", "unstyled"]
|
|
57
|
+
props: ["length", "variant", "mask", "integerOnly", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
58
58
|
});
|
|
59
59
|
const primeEditorDefinition = exports.primeEditorDefinition = (0, _vue.createInput)(_PrimeEditor.default, {
|
|
60
|
-
props: ["placeholder", "formats", "modules", "pt", "ptOptions", "unstyled"]
|
|
60
|
+
props: ["placeholder", "formats", "modules", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
61
61
|
});
|
|
62
62
|
const primeSelectDefinition = exports.primeSelectDefinition = (0, _vue.createInput)(_PrimeSelect.default, {
|
|
63
|
-
props: ["options", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "scrollHeight", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "filterInputProps", "editable", "placeholder", "dataKey", "showClear", "panelStyle", "panelClass", "panelProps", "appendTo", "resetFilterOnHide", "virtualScrollerOptions", "autoOptionFocus", "selectOnFocus", "filterMessage", "selectionMessage", "emptySelectionMessage", "emptyFilterMessage", "emptyMessage", "pt", "ptOptions", "unstyled"]
|
|
63
|
+
props: ["options", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "scrollHeight", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "filterInputProps", "editable", "placeholder", "dataKey", "showClear", "panelStyle", "panelClass", "panelProps", "appendTo", "resetFilterOnHide", "virtualScrollerOptions", "autoOptionFocus", "selectOnFocus", "filterMessage", "selectionMessage", "emptySelectionMessage", "emptyFilterMessage", "emptyMessage", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
64
64
|
});
|
|
65
65
|
const primeMultiSelectDefinition = exports.primeMultiSelectDefinition = (0, _vue.createInput)(_PrimeMultiSelect.default, {
|
|
66
|
-
props: ["options", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "scrollHeight", "inputProps", "closeButtonProps", "dataKey", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "appendTo", "display", "maxSelectedLabels", "selectedItemsLabel", "selectionLimit", "showToggleAll", "loading", "selectAll", "resetFilterOnHide", "virtualScrollerOptions", "autoOptionFocus", "autoFilterFocus", "filterMessage", "selectionMessage", "emptySelectionMessage", "emptyFilterMessage", "emptyMessage", "pt", "placeholder", "ptOptions", "unstyled"]
|
|
66
|
+
props: ["options", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "scrollHeight", "inputProps", "closeButtonProps", "dataKey", "filter", "filterPlaceholder", "filterLocale", "filterMatchMode", "filterFields", "appendTo", "display", "maxSelectedLabels", "selectedItemsLabel", "selectionLimit", "showToggleAll", "loading", "selectAll", "resetFilterOnHide", "virtualScrollerOptions", "autoOptionFocus", "autoFilterFocus", "filterMessage", "selectionMessage", "emptySelectionMessage", "emptyFilterMessage", "emptyMessage", "pt", "placeholder", "ptOptions", "unstyled", "wrapperClass"]
|
|
67
67
|
});
|
|
68
68
|
const primeListboxDefinition = exports.primeListboxDefinition = (0, _vue.createInput)(_PrimeListbox.default, {
|
|
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", "wrapperClass"]
|
|
70
70
|
});
|
|
71
71
|
const primeDatePickerDefinition = exports.primeDatePickerDefinition = (0, _vue.createInput)(_PrimeDatePicker.default, {
|
|
72
|
-
props: ["dateFormat", "placeholder", "selectionMode", "inline", "icon", "showOtherMonths", "selectOtherMonths", "showIcon", "previousIcon", "nextIcon", "incrementIcon", "decrementIcon", "numberOfMonths", "responsiveOptions", "view", "touchUI", "minDate", "maxDate", "disabledDates", "disabledDays", "maxDateCount", "showOnFocus", "autoZIndex", "baseZIndex", "showButtonBar", "showTime", "timeOnly", "shortYearCutoff", "hourFormat", "stepHour", "stepMinute", "stepSecond", "showSeconds", "hideOnDateTimeSelect", "hideOnRangeSelection", "timeSeparator", "showWeek", "manualInput", "appendTo", "panelStyle", "panelClass", "pt", "ptOptions", "unstyled"]
|
|
72
|
+
props: ["dateFormat", "placeholder", "selectionMode", "inline", "icon", "showOtherMonths", "selectOtherMonths", "showIcon", "previousIcon", "nextIcon", "incrementIcon", "decrementIcon", "numberOfMonths", "responsiveOptions", "view", "touchUI", "minDate", "maxDate", "disabledDates", "disabledDays", "maxDateCount", "showOnFocus", "autoZIndex", "baseZIndex", "showButtonBar", "showTime", "timeOnly", "shortYearCutoff", "hourFormat", "stepHour", "stepMinute", "stepSecond", "showSeconds", "hideOnDateTimeSelect", "hideOnRangeSelection", "timeSeparator", "showWeek", "manualInput", "appendTo", "panelStyle", "panelClass", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
73
73
|
});
|
|
74
74
|
const primeSliderDefinition = exports.primeSliderDefinition = (0, _vue.createInput)(_PrimeSlider.default, {
|
|
75
|
-
props: ["pt", "ptOptions", "unstyled", "min", "max", "step", "range", "orientation"]
|
|
75
|
+
props: ["pt", "ptOptions", "unstyled", "min", "max", "step", "range", "orientation", "wrapperClass"]
|
|
76
76
|
});
|
|
77
77
|
const primeRatingDefinition = exports.primeRatingDefinition = (0, _vue.createInput)(_PrimeRating.default, {
|
|
78
|
-
props: ["unstyled", "stars", "cancel", "onIcon", "offIcon", "cancelIcon", "ptOptions", "pt"]
|
|
78
|
+
props: ["unstyled", "stars", "cancel", "onIcon", "offIcon", "cancelIcon", "ptOptions", "pt", "wrapperClass"]
|
|
79
79
|
});
|
|
80
80
|
const primeRadioButtonDefinition = exports.primeRadioButtonDefinition = (0, _vue.createInput)(_PrimeRadioButton.default, {
|
|
81
|
-
props: ["pt", "ptOptions", "unstyled", "options", "
|
|
81
|
+
props: ["pt", "ptOptions", "unstyled", "options", "optionClass", "labelClass", "wrapperClass"]
|
|
82
82
|
});
|
|
83
83
|
const primeKnobDefinition = exports.primeKnobDefinition = (0, _vue.createInput)(_PrimeKnob.default, {
|
|
84
|
-
props: ["pt", "ptOptions", "unstyled", "min", "max", "step", "size", "strokeWidth", "showValue", "valueColor", "rangeColor", "textColor", "valueTemplate"]
|
|
84
|
+
props: ["pt", "ptOptions", "unstyled", "min", "max", "step", "size", "strokeWidth", "showValue", "valueColor", "rangeColor", "textColor", "valueTemplate", "wrapperClass"]
|
|
85
85
|
});
|
|
86
86
|
const primeColorPickerDefinition = exports.primeColorPickerDefinition = (0, _vue.createInput)(_PrimeColorPicker.default, {
|
|
87
|
-
props: ["defaultColor", "inline", "format", "pt", "ptOptions", "unstyled"]
|
|
87
|
+
props: ["defaultColor", "inline", "format", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
88
88
|
});
|
|
89
89
|
const primeToggleButtonDefinition = exports.primeToggleButtonDefinition = (0, _vue.createInput)(_PrimeToggleButton.default, {
|
|
90
|
-
props: ["pt", "ptOptions", "unstyled", "onLabel", "offLabel", "onIcon", "offIcon", "iconPos"]
|
|
90
|
+
props: ["pt", "ptOptions", "unstyled", "onLabel", "offLabel", "onIcon", "offIcon", "iconPos", "wrapperClass"]
|
|
91
91
|
});
|
|
92
92
|
const primeSelectButtonDefinition = exports.primeSelectButtonDefinition = (0, _vue.createInput)(_PrimeSelectButton.default, {
|
|
93
|
-
props: ["pt", "ptOptions", "unstyled", "optionLabel", "optionValue", "optionDisabled", "multiple", "unselectable", "dataKey", "options"]
|
|
93
|
+
props: ["pt", "ptOptions", "unstyled", "optionLabel", "optionValue", "optionDisabled", "multiple", "unselectable", "dataKey", "options", "wrapperClass"]
|
|
94
94
|
});
|
|
95
95
|
const primeCascadeSelectDefinition = exports.primeCascadeSelectDefinition = (0, _vue.createInput)(_PrimeCascadeSelect.default, {
|
|
96
|
-
props: ["options", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "placeholder", "pt", "ptOptions", "unstyled"]
|
|
96
|
+
props: ["options", "optionLabel", "optionValue", "optionGroupLabel", "optionGroupChildren", "placeholder", "pt", "ptOptions", "unstyled", "wrapperClass"]
|
|
97
97
|
});
|
|
98
98
|
const primeTreeSelectDefinition = exports.primeTreeSelectDefinition = (0, _vue.createInput)(_PrimeTreeSelect.default, {
|
|
99
|
-
props: ["options", "placeholder", "selectionMode", "pt", "ptOptions", "unstyled", "emptyMessage", "display", "metaKeySelection", "appendTo", "scrollHeight", "panelClass", "variant"]
|
|
99
|
+
props: ["options", "placeholder", "selectionMode", "pt", "ptOptions", "unstyled", "emptyMessage", "display", "metaKeySelection", "appendTo", "scrollHeight", "panelClass", "variant", "wrapperClass"]
|
|
100
100
|
});
|
|
101
101
|
const primeInputs = exports.primeInputs = {
|
|
102
102
|
primeAutoComplete: primeAutoCompleteDefinition,
|