@sfxcode/formkit-primevue 1.8.5 → 1.9.0
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 +1 -3
- package/dist/components/PrimeAutoComplete.vue +37 -11
- package/dist/components/PrimeCalendar.vue +109 -16
- package/dist/components/PrimeCascadeSelect.vue +41 -10
- package/dist/components/PrimeCheckbox.vue +40 -14
- package/dist/components/PrimeChips.vue +35 -11
- package/dist/components/PrimeColorPicker.vue +31 -11
- package/dist/components/PrimeDropdown.vue +90 -16
- package/dist/components/PrimeEditor.vue +32 -14
- package/dist/components/PrimeInputMask.vue +69 -18
- package/dist/components/PrimeInputNumber.vue +55 -13
- package/dist/components/PrimeInputSwitch.vue +40 -14
- package/dist/components/PrimeInputText.vue +45 -20
- package/dist/components/PrimeKnob.vue +47 -13
- package/dist/components/PrimeListbox.vue +52 -12
- package/dist/components/PrimeMultiSelect.vue +96 -11
- package/dist/components/PrimePassword.vue +48 -13
- package/dist/components/PrimeRadioButton.vue +33 -15
- package/dist/components/PrimeRating.vue +40 -14
- package/dist/components/PrimeSelectButton.vue +44 -11
- package/dist/components/PrimeSlider.vue +42 -12
- package/dist/components/PrimeTextarea.vue +32 -13
- package/dist/components/PrimeToggleButton.vue +39 -11
- package/dist/components/PrimeTreeSelect.vue +50 -11
- package/dist/components/PrimeTriStateCheckbox.vue +36 -13
- package/dist/index.d.ts +55 -56
- package/dist/index.js +24 -24
- package/dist/index.mjs +343 -24
- package/dist/sass/formkit-primevue.scss +4 -0
- package/dist/style.css +1 -1
- package/package.json +12 -11
|
@@ -1,31 +1,116 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { MultiSelectProps } from 'primevue/multiselect'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeMultiSelectProps {
|
|
7
|
+
options?: MultiSelectProps['options']
|
|
8
|
+
optionLabel?: MultiSelectProps['optionLabel']
|
|
9
|
+
optionValue?: MultiSelectProps['optionValue']
|
|
10
|
+
optionDisabled?: MultiSelectProps['optionDisabled']
|
|
11
|
+
optionGroupLabel?: MultiSelectProps['optionGroupLabel']
|
|
12
|
+
optionGroupChildren?: MultiSelectProps['optionGroupChildren']
|
|
13
|
+
scrollHeight?: MultiSelectProps['scrollHeight']
|
|
14
|
+
inputProps?: MultiSelectProps['inputProps']
|
|
15
|
+
closeButtonProps?: MultiSelectProps['closeButtonProps']
|
|
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
|
+
}
|
|
3
44
|
|
|
4
45
|
const props = defineProps({
|
|
5
|
-
context:
|
|
46
|
+
context: {
|
|
47
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeMultiSelectProps>,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
6
50
|
})
|
|
7
51
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
52
|
function handleChange(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
53
|
+
props.context?.node.input(props.context?._value)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function handleBlur(e: Event) {
|
|
57
|
+
props.context?.handlers.blur(e)
|
|
13
58
|
}
|
|
14
59
|
|
|
15
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
60
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
16
61
|
</script>
|
|
17
62
|
|
|
18
63
|
<template>
|
|
19
64
|
<div class="p-formkit">
|
|
20
65
|
<MultiSelect
|
|
21
66
|
v-model="context._value"
|
|
22
|
-
v-bind="attrs"
|
|
67
|
+
v-bind="context?.attrs"
|
|
23
68
|
:input-id="context.id"
|
|
24
|
-
:disabled="
|
|
25
|
-
:readonly="attrs._readonly ?? false"
|
|
26
|
-
:list-style="attrs.style"
|
|
69
|
+
:disabled="!!context?.disabled"
|
|
70
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
71
|
+
:list-style="context?.attrs.style"
|
|
27
72
|
:class="styleClass"
|
|
73
|
+
:tabindex="context?.attrs.tabindex"
|
|
74
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
75
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
76
|
+
:placeholder="context.placeholder"
|
|
77
|
+
:options="context.options"
|
|
78
|
+
:option-label="context.optionLabel"
|
|
79
|
+
:option-value="context.optionValue"
|
|
80
|
+
:option-disabled="context.optionDisabled"
|
|
81
|
+
:option-group-label="context.optionGroupLabel"
|
|
82
|
+
:option-group-children="context.optionGroupChildren"
|
|
83
|
+
:scroll-height="context.scrollHeight"
|
|
84
|
+
:input-props="context.inputProps"
|
|
85
|
+
:close-button-props="context.closeButtonProps"
|
|
86
|
+
:data-key="context.dataKey"
|
|
87
|
+
:filter="context.filter ?? false"
|
|
88
|
+
:filter-placeholder="context.filterPlaceholder"
|
|
89
|
+
:filter-locale="context.filterLocale"
|
|
90
|
+
:filter-match-mode="context.filterMatchMode"
|
|
91
|
+
:fitler-fields="context.filterFields"
|
|
92
|
+
:append-to="context.appendTo"
|
|
93
|
+
:display="context.display"
|
|
94
|
+
:max-selected-labels="context.maxSelectedLabels"
|
|
95
|
+
:selected-items-label="context.selectedItemsLabel"
|
|
96
|
+
:selection-limit="context.selectionLimit"
|
|
97
|
+
:show-toggle-all="context.showToggleAll"
|
|
98
|
+
:loading="context.loading"
|
|
99
|
+
:select-all="context.selectAll"
|
|
100
|
+
:reset-filter-on-hide="context.resetFilterOnHide"
|
|
101
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
102
|
+
:auto-option-focus="context.autoOptionFocus"
|
|
103
|
+
:auto-filter-focus="context.autoFilterFocus"
|
|
104
|
+
:filter-message="context.filterMessage"
|
|
105
|
+
:selection-message="context.selectionMessage"
|
|
106
|
+
:empty-selection-message="context.emptySelectionMessage"
|
|
107
|
+
:empty-filter-message="context.emptyFilterMessage"
|
|
108
|
+
:empty-message="context.emptyMessage"
|
|
109
|
+
:pt="context.pt"
|
|
110
|
+
:pt-options="context.ptOptions"
|
|
111
|
+
:unstyled="context.unstyled ?? false"
|
|
28
112
|
@change="handleChange"
|
|
113
|
+
@blur="handleBlur"
|
|
29
114
|
/>
|
|
30
115
|
</div>
|
|
31
116
|
</template>
|
|
@@ -1,35 +1,70 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { PasswordProps } from 'primevue/password'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimePasswordProps {
|
|
7
|
+
mediumRegex?: PasswordProps['mediumRegex']
|
|
8
|
+
strongRegex?: PasswordProps['strongRegex']
|
|
9
|
+
promptLabel?: PasswordProps['promptLabel']
|
|
10
|
+
weakLabel?: PasswordProps['weakLabel']
|
|
11
|
+
mediumLabel?: PasswordProps['mediumLabel']
|
|
12
|
+
strongLabel?: PasswordProps['strongLabel']
|
|
13
|
+
hideIcon?: PasswordProps['hideIcon']
|
|
14
|
+
showIcon?: PasswordProps['showIcon']
|
|
15
|
+
pt?: PasswordProps['pt']
|
|
16
|
+
ptOptions?: PasswordProps['ptOptions']
|
|
17
|
+
unstyled?: PasswordProps['unstyled']
|
|
18
|
+
placeholder?: PasswordProps['placeholder']
|
|
19
|
+
feedback?: PasswordProps['feedback']
|
|
20
|
+
toggleMask?: PasswordProps['toggleMask']
|
|
21
|
+
}
|
|
3
22
|
|
|
4
23
|
const props = defineProps({
|
|
5
|
-
context:
|
|
24
|
+
context: {
|
|
25
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimePasswordProps>,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
6
28
|
})
|
|
7
29
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function handleBlur(e: any) {
|
|
12
|
-
context?.handlers.blur(e.target.value)
|
|
30
|
+
function handleBlur(e: Event) {
|
|
31
|
+
props.context?.handlers.blur(e)
|
|
13
32
|
}
|
|
14
33
|
|
|
15
34
|
function handleInput(e: any) {
|
|
16
|
-
context?.node.input(e.target.value)
|
|
35
|
+
props.context?.node.input(e.target.value)
|
|
17
36
|
}
|
|
18
37
|
|
|
19
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
38
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
20
39
|
</script>
|
|
21
40
|
|
|
22
41
|
<template>
|
|
23
42
|
<div class="p-formkit">
|
|
24
43
|
<Password
|
|
25
44
|
v-model="context._value"
|
|
26
|
-
v-bind="attrs"
|
|
45
|
+
v-bind="context?.attrs"
|
|
27
46
|
:input-id="context.id"
|
|
28
|
-
:disabled="
|
|
29
|
-
:readonly="attrs._readonly ?? false"
|
|
30
|
-
:input-style="attrs.style"
|
|
47
|
+
:disabled="!!context?.disabled"
|
|
48
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
49
|
+
:input-style="context?.attrs.style"
|
|
31
50
|
:input-class="styleClass"
|
|
51
|
+
:tabindex="context?.attrs.tabindex"
|
|
52
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
53
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
54
|
+
:placeholder="context.placeholder"
|
|
55
|
+
:medium-regex="context.mediumRegex ?? '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})'"
|
|
56
|
+
:strong-regex="context.strongRegex ?? '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})'"
|
|
57
|
+
:prompt-label="context.promptLabel"
|
|
58
|
+
:weak-label="context.weakLabel"
|
|
59
|
+
:medium-label="context.mediumLabel"
|
|
60
|
+
:strong-label="context.strongLabel"
|
|
61
|
+
:hide-icon="context.hideIcon ?? 'pi pi-eye-slash'"
|
|
62
|
+
:show-icon="context.showIcon ?? 'pi pi-eye'"
|
|
32
63
|
:feedback="context.feedback ?? false"
|
|
64
|
+
:toggle-mask="context.toggleMask ?? false"
|
|
65
|
+
:pt="context.pt"
|
|
66
|
+
:pt-options="context.ptOptions"
|
|
67
|
+
:unstyled="context.unstyled ?? false"
|
|
33
68
|
@input="handleInput"
|
|
34
69
|
@blur="handleBlur"
|
|
35
70
|
/>
|
|
@@ -1,37 +1,55 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { RadioButtonProps } from 'primevue/radiobutton'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeRadioButtonProps {
|
|
7
|
+
pt?: RadioButtonProps['pt']
|
|
8
|
+
ptOptions?: RadioButtonProps['ptOptions']
|
|
9
|
+
unstyled?: RadioButtonProps['unstyled']
|
|
10
|
+
options?: { label: string, value: any }[]
|
|
11
|
+
options_class?: string
|
|
12
|
+
}
|
|
3
13
|
|
|
4
14
|
const props = defineProps({
|
|
5
|
-
context:
|
|
15
|
+
context: {
|
|
16
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeRadioButtonProps>,
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
6
19
|
})
|
|
7
20
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
21
|
function handleChange(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
22
|
+
props.context?.node.input(props.context?._value)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function handleBlur(e: Event) {
|
|
26
|
+
props.context?.handlers.blur(e)
|
|
13
27
|
}
|
|
14
28
|
|
|
15
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
29
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
16
30
|
</script>
|
|
17
31
|
|
|
18
32
|
<template>
|
|
19
|
-
<div :class="
|
|
20
|
-
<div v-for="option in
|
|
33
|
+
<div :class="context.options_class" class="p-formkit">
|
|
34
|
+
<div v-for="option in context.options" :key="option.value" :class="context.option_class">
|
|
21
35
|
<RadioButton
|
|
22
36
|
:id="context.id"
|
|
23
37
|
v-model="context._value"
|
|
24
|
-
v-bind="attrs"
|
|
25
|
-
:disabled="
|
|
26
|
-
:readonly="attrs._readonly ?? false"
|
|
27
|
-
:name="attrs.name"
|
|
38
|
+
v-bind="context?.attrs"
|
|
39
|
+
:disabled="!!context?.disabled"
|
|
40
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
41
|
+
:name="context?.attrs.name"
|
|
28
42
|
:value="option.value"
|
|
29
|
-
:input-style="attrs.style"
|
|
43
|
+
:input-style="context?.attrs.style"
|
|
30
44
|
:input-class="styleClass"
|
|
45
|
+
:pt="context.pt"
|
|
46
|
+
:pt-options="context.ptOptions"
|
|
47
|
+
:unstyled="context.unstyled ?? false"
|
|
31
48
|
@click="handleChange"
|
|
32
49
|
@change="handleChange"
|
|
50
|
+
@blur="handleChange"
|
|
33
51
|
/>
|
|
34
|
-
<label :for="option.value">{{ option.label }}</label>
|
|
52
|
+
<label :for="option.value" class="p-formkit-radio-label">{{ option.label }}</label>
|
|
35
53
|
</div>
|
|
36
54
|
</div>
|
|
37
55
|
</template>
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { RatingProps } from 'primevue/rating'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeRatingProps {
|
|
7
|
+
unstyled?: RatingProps['unstyled']
|
|
8
|
+
stars?: RatingProps['stars']
|
|
9
|
+
cancel?: RatingProps['cancel']
|
|
10
|
+
onIcon?: RatingProps['onIcon']
|
|
11
|
+
offIcon?: RatingProps['offIcon']
|
|
12
|
+
cancelIcon?: RatingProps['cancelIcon']
|
|
13
|
+
ptOptions?: RatingProps['ptOptions']
|
|
14
|
+
pt?: RatingProps['pt']
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeRatingProps>,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
6
22
|
})
|
|
7
23
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
24
|
function handleInput(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
25
|
+
props.context?.node.input(props.context?._value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function handleBlur(e: Event) {
|
|
29
|
+
props.context?.handlers.blur(e)
|
|
13
30
|
}
|
|
14
31
|
|
|
15
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
32
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
16
33
|
</script>
|
|
17
34
|
|
|
18
35
|
<template>
|
|
@@ -20,15 +37,24 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
20
37
|
<Rating
|
|
21
38
|
:id="context.id"
|
|
22
39
|
v-model="context._value"
|
|
23
|
-
v-bind="attrs"
|
|
24
|
-
:disabled="
|
|
25
|
-
:readonly="attrs._readonly ?? false"
|
|
26
|
-
:style="attrs.style"
|
|
40
|
+
v-bind="context?.attrs"
|
|
41
|
+
:disabled="!!context?.disabled"
|
|
42
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
43
|
+
:style="context?.attrs.style"
|
|
27
44
|
:class="styleClass"
|
|
28
|
-
:
|
|
29
|
-
:
|
|
30
|
-
:
|
|
45
|
+
:tabindex="context?.attrs.tabindex"
|
|
46
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
47
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
48
|
+
:stars="context.stars ?? 5"
|
|
49
|
+
:cancel="context.cancel ?? false"
|
|
50
|
+
:on-icon="context.onIcon ?? 'pi pi-star-fill'"
|
|
51
|
+
:off-icon="context.offIcon ?? 'pi pi-star'"
|
|
52
|
+
:cancel-icon="context.cancelIcon ?? 'pi pi-ban'"
|
|
53
|
+
:pt="context.pt"
|
|
54
|
+
:pt-options="context.ptOptions"
|
|
55
|
+
:unstyled="context.unstyled ?? false"
|
|
31
56
|
@change="handleInput"
|
|
57
|
+
@blur="handleBlur"
|
|
32
58
|
/>
|
|
33
59
|
</div>
|
|
34
60
|
</template>
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { SelectButtonProps } from 'primevue/selectbutton'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeSelectButtonProps {
|
|
7
|
+
pt?: SelectButtonProps['pt']
|
|
8
|
+
ptOptions?: SelectButtonProps['ptOptions']
|
|
9
|
+
unstyled?: SelectButtonProps['unstyled']
|
|
10
|
+
optionLabel?: SelectButtonProps['optionLabel']
|
|
11
|
+
optionValue?: SelectButtonProps['optionValue']
|
|
12
|
+
optionDisabled?: SelectButtonProps['optionDisabled']
|
|
13
|
+
multiple?: SelectButtonProps['multiple']
|
|
14
|
+
unselectable?: SelectButtonProps['unselectable']
|
|
15
|
+
dataKey?: SelectButtonProps['dataKey']
|
|
16
|
+
options?: SelectButtonProps['options']
|
|
17
|
+
}
|
|
3
18
|
|
|
4
19
|
const props = defineProps({
|
|
5
|
-
context:
|
|
20
|
+
context: {
|
|
21
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeSelectButtonProps>,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
6
24
|
})
|
|
7
25
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
26
|
function handleChange(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
27
|
+
props.context?.node.input(props.context?._value)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function handleBlur(e: Event) {
|
|
31
|
+
props.context?.handlers.blur(e)
|
|
13
32
|
}
|
|
14
33
|
|
|
15
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
34
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
16
35
|
</script>
|
|
17
36
|
|
|
18
37
|
<template>
|
|
@@ -20,12 +39,26 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
20
39
|
<SelectButton
|
|
21
40
|
:id="context.id"
|
|
22
41
|
v-model="context._value"
|
|
23
|
-
v-bind="attrs"
|
|
24
|
-
:disabled="
|
|
25
|
-
:readonly="attrs._readonly ?? false"
|
|
26
|
-
:style="attrs.style"
|
|
42
|
+
v-bind="context?.attrs"
|
|
43
|
+
:disabled="!!context?.disabled"
|
|
44
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
45
|
+
:style="context?.attrs.style"
|
|
27
46
|
:class="styleClass"
|
|
47
|
+
:tabindex="context?.attrs.tabindex"
|
|
48
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
49
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
50
|
+
:options="context.options"
|
|
51
|
+
:option-label="context.optionLabel"
|
|
52
|
+
:option-value="context.optionValue"
|
|
53
|
+
:option-disabled="context.optionDisabled"
|
|
54
|
+
:multiple="context.multiple ?? false"
|
|
55
|
+
:unselectable="context.unselectable ?? true"
|
|
56
|
+
:data-key="context.dataKey"
|
|
57
|
+
:pt="context.pt"
|
|
58
|
+
:pt-options="context.ptOptions"
|
|
59
|
+
:unstyled="context.unstyled ?? false"
|
|
28
60
|
@change="handleChange"
|
|
61
|
+
@blur="handleBlur"
|
|
29
62
|
/>
|
|
30
63
|
</div>
|
|
31
64
|
</template>
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { SliderProps } from 'primevue/slider'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeSliderProps {
|
|
7
|
+
pt?: SliderProps['pt']
|
|
8
|
+
ptOptions?: SliderProps['ptOptions']
|
|
9
|
+
unstyled?: SliderProps['unstyled']
|
|
10
|
+
min?: SliderProps['min']
|
|
11
|
+
max?: SliderProps['max']
|
|
12
|
+
step?: SliderProps['step']
|
|
13
|
+
range?: SliderProps['range']
|
|
14
|
+
orientation?: SliderProps['orientation']
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeSliderProps>,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
6
22
|
})
|
|
7
23
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
24
|
function handleInput(e: any) {
|
|
12
|
-
context?.node.input(e)
|
|
13
|
-
context?.handlers.blur(e)
|
|
25
|
+
props.context?.node.input(e)
|
|
26
|
+
props.context?.handlers.blur(e)
|
|
14
27
|
}
|
|
15
|
-
|
|
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)
|
|
16
34
|
</script>
|
|
17
35
|
|
|
18
36
|
<template>
|
|
@@ -20,12 +38,24 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
20
38
|
<Slider
|
|
21
39
|
:id="context.id"
|
|
22
40
|
v-model="context._value"
|
|
23
|
-
v-bind="attrs"
|
|
24
|
-
:disabled="
|
|
25
|
-
:readonly="attrs._readonly ?? false"
|
|
26
|
-
:style="attrs.style"
|
|
41
|
+
v-bind="context?.attrs"
|
|
42
|
+
:disabled="!!context?.disabled"
|
|
43
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
44
|
+
:style="context?.attrs.style"
|
|
27
45
|
:class="styleClass"
|
|
46
|
+
:tabindex="context?.attrs.tabindex"
|
|
47
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
48
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
49
|
+
:min="context.min ?? 0"
|
|
50
|
+
:max="context.max ?? 100"
|
|
51
|
+
:step="context.step ?? undefined"
|
|
52
|
+
:range="context.range ?? false"
|
|
53
|
+
:orientation="context.orientation ?? 'horizontal'"
|
|
54
|
+
:pt="context.pt"
|
|
55
|
+
:pt-options="context.ptOptions"
|
|
56
|
+
:unstyled="context.unstyled ?? false"
|
|
28
57
|
@change="handleInput"
|
|
58
|
+
@blur="handleBlur"
|
|
29
59
|
/>
|
|
30
60
|
</div>
|
|
31
61
|
</template>
|
|
@@ -1,21 +1,32 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { TextareaProps } from 'primevue/textarea'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeTextareaProps {
|
|
7
|
+
pt?: TextareaProps['pt']
|
|
8
|
+
ptOptions?: TextareaProps['ptOptions']
|
|
9
|
+
unstyled?: TextareaProps['unstyled']
|
|
10
|
+
autoResize?: TextareaProps['autoResize']
|
|
11
|
+
rows?: TextareaProps['rows']
|
|
12
|
+
placeholder?: TextareaProps['placeholder']
|
|
13
|
+
}
|
|
3
14
|
|
|
4
15
|
const props = defineProps({
|
|
5
|
-
context:
|
|
16
|
+
context: {
|
|
17
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeTextareaProps>,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
6
20
|
})
|
|
7
21
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function handleBlur(e: any) {
|
|
12
|
-
context?.handlers.blur(e.target.value)
|
|
22
|
+
function handleBlur(e: Event) {
|
|
23
|
+
props.context?.handlers.blur(e)
|
|
13
24
|
}
|
|
14
25
|
|
|
15
26
|
function handleInput(e: any) {
|
|
16
|
-
context?.node.input(e.target.value)
|
|
27
|
+
props.context?.node.input(e.target.value)
|
|
17
28
|
}
|
|
18
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
29
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
19
30
|
</script>
|
|
20
31
|
|
|
21
32
|
<template>
|
|
@@ -23,12 +34,20 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
23
34
|
<Textarea
|
|
24
35
|
:id="context.id"
|
|
25
36
|
v-model="context._value"
|
|
26
|
-
v-bind="attrs"
|
|
27
|
-
:disabled="
|
|
28
|
-
:readonly="attrs._readonly ?? false"
|
|
29
|
-
:style="attrs.style"
|
|
37
|
+
v-bind="context?.attrs"
|
|
38
|
+
:disabled="!!context?.disabled"
|
|
39
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
40
|
+
:style="context?.attrs.style"
|
|
30
41
|
:class="styleClass"
|
|
42
|
+
:tabindex="context?.attrs.tabindex"
|
|
43
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
44
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
45
|
+
:placeholder="context.placeholder"
|
|
31
46
|
:rows="context.rows ?? 3"
|
|
47
|
+
:auto-resize="context.autoResize ?? false"
|
|
48
|
+
:pt="context.pt"
|
|
49
|
+
:pt-options="context.ptOptions"
|
|
50
|
+
:unstyled="context.unstyled ?? false"
|
|
32
51
|
@input="handleInput"
|
|
33
52
|
@blur="handleBlur"
|
|
34
53
|
/>
|
|
@@ -1,32 +1,60 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { ToggleButtonProps } from 'primevue/togglebutton'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeToggleButtonProps {
|
|
7
|
+
pt?: ToggleButtonProps['pt']
|
|
8
|
+
ptOptions?: ToggleButtonProps['ptOptions']
|
|
9
|
+
unstyled?: ToggleButtonProps['unstyled']
|
|
10
|
+
onLabel?: ToggleButtonProps['onLabel']
|
|
11
|
+
offLabel?: ToggleButtonProps['offLabel']
|
|
12
|
+
onIcon?: ToggleButtonProps['onIcon']
|
|
13
|
+
offIcon?: ToggleButtonProps['offIcon']
|
|
14
|
+
iconPos?: ToggleButtonProps['iconPos']
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeToggleButtonProps>,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
6
22
|
})
|
|
7
23
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
24
|
function handleChange(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
25
|
+
props.context?.node.input(props.context?._value)
|
|
13
26
|
}
|
|
14
|
-
|
|
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)
|
|
15
33
|
</script>
|
|
16
34
|
|
|
17
35
|
<template>
|
|
18
36
|
<div class="p-formkit">
|
|
19
37
|
<ToggleButton
|
|
20
38
|
v-model="context._value"
|
|
21
|
-
v-bind="attrs"
|
|
39
|
+
v-bind="context?.attrs"
|
|
22
40
|
:input-id="context.id"
|
|
23
|
-
:disabled="
|
|
24
|
-
:readonly="attrs._readonly ?? false"
|
|
25
|
-
:input-style="attrs.style"
|
|
41
|
+
:disabled="!!context?.disabled"
|
|
42
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
43
|
+
:input-style="context?.attrs.style"
|
|
26
44
|
:input-class="styleClass"
|
|
45
|
+
:tabindex="context?.attrs.tabindex"
|
|
46
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
47
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
48
|
+
:on-label="context.onLabel ?? 'Yes'"
|
|
49
|
+
:off-label="context.offLabel ?? 'No'"
|
|
27
50
|
:on-icon="context.onIcon ?? 'pi pi-check'"
|
|
28
51
|
:off-icon="context.offIcon ?? 'pi pi-times'"
|
|
52
|
+
:icon-pos="context.iconPos ?? 'left'"
|
|
53
|
+
:pt="context.pt"
|
|
54
|
+
:pt-options="context.ptOptions"
|
|
55
|
+
:unstyled="context.unstyled ?? false"
|
|
29
56
|
@change="handleChange"
|
|
57
|
+
@blur="handleBlur"
|
|
30
58
|
/>
|
|
31
59
|
</div>
|
|
32
60
|
</template>
|