@sfxcode/formkit-primevue 1.8.6 → 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
package/README.md
CHANGED
|
@@ -15,7 +15,6 @@ Helper classes for using [Formkit](https://formkit.com/) with the [PrimeVue UI F
|
|
|
15
15
|
import { defaultConfig, plugin } from '@formkit/vue'
|
|
16
16
|
import { primeInputs } from '@sfxcode/formkit-primevue'
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
app.use(plugin, defaultConfig({
|
|
20
19
|
locales: { de, en },
|
|
21
20
|
// Define the active locale
|
|
@@ -74,8 +73,7 @@ You can use it or take it as base for your own styling.
|
|
|
74
73
|
- RadioButton
|
|
75
74
|
- TreeSelect
|
|
76
75
|
|
|
77
|
-
## Demo
|
|
76
|
+
## Demo
|
|
78
77
|
[Demo/Playground](https://formkit-primevue.netlify.app/)
|
|
79
78
|
|
|
80
79
|

|
|
81
|
-
|
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { type PropType, computed, ref } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type {
|
|
5
|
+
AutoCompleteCompleteEvent,
|
|
6
|
+
AutoCompleteProps,
|
|
7
|
+
} from 'primevue/autocomplete'
|
|
8
|
+
|
|
9
|
+
export interface FormKitPrimeAutoCompleteProps {
|
|
10
|
+
pt?: AutoCompleteProps['pt']
|
|
11
|
+
ptOptions?: AutoCompleteProps['ptOptions']
|
|
12
|
+
unstyled?: AutoCompleteProps['unstyled']
|
|
13
|
+
dropdown?: AutoCompleteProps['dropdown']
|
|
14
|
+
multiple?: AutoCompleteProps['multiple']
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeAutoCompleteProps>,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
6
22
|
})
|
|
7
23
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
24
|
const suggestions = ref([])
|
|
12
25
|
|
|
13
|
-
function search(event) {
|
|
14
|
-
suggestions.value = attrs.
|
|
26
|
+
function search(event: AutoCompleteCompleteEvent) {
|
|
27
|
+
suggestions.value = props.context?.attrs.complete(event.query)
|
|
15
28
|
}
|
|
16
29
|
|
|
17
30
|
function handleInput(e: any) {
|
|
18
|
-
context?.node.input(props.context?._value)
|
|
31
|
+
props.context?.node.input(props.context?._value)
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function handleBlur(event: Event) {
|
|
35
|
+
props.context?.handlers.blur(event)
|
|
19
36
|
}
|
|
20
37
|
|
|
21
|
-
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)
|
|
22
39
|
</script>
|
|
23
40
|
|
|
24
41
|
<template>
|
|
@@ -26,12 +43,21 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
26
43
|
<AutoComplete
|
|
27
44
|
:id="context.id"
|
|
28
45
|
v-model="context._value"
|
|
29
|
-
v-bind="attrs"
|
|
30
|
-
:disabled="
|
|
46
|
+
v-bind="context?.attrs"
|
|
47
|
+
:disabled="!!context?.disabled"
|
|
31
48
|
:class="styleClass"
|
|
49
|
+
:tabindex="context?.attrs.tabindex"
|
|
50
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
51
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
32
52
|
:suggestions="suggestions"
|
|
53
|
+
:dropdown="context?.dropdown ?? false"
|
|
54
|
+
:multiple="context?.multiple ?? false"
|
|
55
|
+
:pt="context?.pt"
|
|
56
|
+
:pt-options="context?.ptOptions"
|
|
57
|
+
:unstyled="context?.unstyled ?? false"
|
|
33
58
|
@complete="search"
|
|
34
59
|
@change="handleInput"
|
|
60
|
+
@blur="handleBlur"
|
|
35
61
|
/>
|
|
36
62
|
</div>
|
|
37
63
|
</template>
|
|
@@ -1,45 +1,138 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { CalendarBlurEvent, CalendarProps } from 'primevue/calendar'
|
|
3
|
+
import { type PropType, computed } from 'vue'
|
|
4
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
export interface FormKitPrimeCalendarProps {
|
|
7
|
+
dateFormat?: CalendarProps['dateFormat']
|
|
8
|
+
placeholder?: CalendarProps['placeholder']
|
|
9
|
+
selectionMode?: CalendarProps['selectionMode']
|
|
10
|
+
inline?: CalendarProps['inline']
|
|
11
|
+
icon?: CalendarProps['icon']
|
|
12
|
+
showOtherMonths?: CalendarProps['showOtherMonths']
|
|
13
|
+
selectOtherMonths?: CalendarProps['selectOtherMonths']
|
|
14
|
+
showIcon?: CalendarProps['showIcon']
|
|
15
|
+
previousIcon?: CalendarProps['previousIcon']
|
|
16
|
+
nextIcon?: CalendarProps['nextIcon']
|
|
17
|
+
incrementIcon?: CalendarProps['incrementIcon']
|
|
18
|
+
decrementIcon?: CalendarProps['decrementIcon']
|
|
19
|
+
numberOfMonths?: CalendarProps['numberOfMonths']
|
|
20
|
+
responsiveOptions?: CalendarProps['responsiveOptions']
|
|
21
|
+
view?: CalendarProps['view']
|
|
22
|
+
touchUI?: CalendarProps['touchUI']
|
|
23
|
+
minDate?: CalendarProps['minDate']
|
|
24
|
+
maxDate?: CalendarProps['maxDate']
|
|
25
|
+
disabledDates?: CalendarProps['disabledDates']
|
|
26
|
+
disabledDays?: CalendarProps['disabledDays']
|
|
27
|
+
maxDateCount?: CalendarProps['maxDateCount']
|
|
28
|
+
showOnFocus?: CalendarProps['showOnFocus']
|
|
29
|
+
autoZIndex?: CalendarProps['autoZIndex']
|
|
30
|
+
baseZIndex?: CalendarProps['baseZIndex']
|
|
31
|
+
showButtonBar?: CalendarProps['showButtonBar']
|
|
32
|
+
showTime?: CalendarProps['showTime']
|
|
33
|
+
timeOnly?: CalendarProps['timeOnly']
|
|
34
|
+
shortYearCutoff?: CalendarProps['shortYearCutoff']
|
|
35
|
+
hourFormat?: CalendarProps['hourFormat']
|
|
36
|
+
stepHour?: CalendarProps['stepHour']
|
|
37
|
+
stepMinute?: CalendarProps['stepMinute']
|
|
38
|
+
stepSecond?: CalendarProps['stepSecond']
|
|
39
|
+
showSeconds?: CalendarProps['showSeconds']
|
|
40
|
+
hideOnDateTimeSelect?: CalendarProps['hideOnDateTimeSelect']
|
|
41
|
+
hideOnRangeSelection?: CalendarProps['hideOnRangeSelection']
|
|
42
|
+
timeSeparator?: CalendarProps['timeSeparator']
|
|
43
|
+
showWeek?: CalendarProps['showWeek']
|
|
44
|
+
manualInput?: CalendarProps['manualInput']
|
|
45
|
+
appendTo?: CalendarProps['appendTo']
|
|
46
|
+
panelStyle?: CalendarProps['panelStyle']
|
|
47
|
+
panelClass?: CalendarProps['panelClass']
|
|
48
|
+
pt?: CalendarProps['pt']
|
|
49
|
+
ptOptions?: CalendarProps['ptOptions']
|
|
50
|
+
unstyled?: CalendarProps['unstyled']
|
|
51
|
+
}
|
|
5
52
|
|
|
6
53
|
const props = defineProps({
|
|
7
|
-
context:
|
|
54
|
+
context: {
|
|
55
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeCalendarProps>,
|
|
56
|
+
required: true,
|
|
57
|
+
},
|
|
8
58
|
})
|
|
9
59
|
|
|
10
|
-
const context = props.context
|
|
11
|
-
const attrs = computed(() => context?.attrs)
|
|
12
|
-
|
|
13
60
|
function handleInput(e: any) {
|
|
14
|
-
context?.node.input(context?._value)
|
|
61
|
+
props.context?.node.input(props.context?._value)
|
|
15
62
|
}
|
|
16
63
|
|
|
17
64
|
function handleSelect(e: any) {
|
|
18
|
-
context?.node.input(e)
|
|
65
|
+
props.context?.node.input(e)
|
|
19
66
|
}
|
|
20
67
|
|
|
21
68
|
function handleBlur(e: CalendarBlurEvent) {
|
|
22
|
-
context?.handlers.blur(e.
|
|
69
|
+
props.context?.handlers.blur(e.originalEvent)
|
|
23
70
|
}
|
|
24
71
|
|
|
25
72
|
function handleClearClick() {
|
|
26
|
-
context?.node.input(null)
|
|
73
|
+
props.context?.node.input(null)
|
|
27
74
|
}
|
|
28
75
|
|
|
29
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
76
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
30
77
|
</script>
|
|
31
78
|
|
|
32
79
|
<template>
|
|
33
80
|
<div class="p-formkit">
|
|
34
81
|
<Calendar
|
|
35
82
|
v-model="context._value"
|
|
36
|
-
v-bind="attrs"
|
|
37
|
-
:input-id="
|
|
38
|
-
:disabled="
|
|
39
|
-
:readonly="attrs._readonly ?? false"
|
|
40
|
-
:input-style="attrs.style"
|
|
83
|
+
v-bind="context?.attrs"
|
|
84
|
+
:input-id="context.id"
|
|
85
|
+
:disabled="!!context?.disabled"
|
|
86
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
87
|
+
:input-style="context?.attrs.style"
|
|
41
88
|
:input-class="styleClass"
|
|
89
|
+
:tabindex="context?.attrs.tabindex"
|
|
90
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
91
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
92
|
+
:date-format="context?.dateFormat"
|
|
93
|
+
:placeholder="context?.placeholder"
|
|
94
|
+
:selection-mode="context?.selectionMode ?? 'single'"
|
|
95
|
+
:inline="context?.inline ?? false"
|
|
96
|
+
:show-other-months="context?.showOtherMonths ?? true"
|
|
97
|
+
:select-other-months="context?.selectOtherMonths ?? false"
|
|
98
|
+
:icon="context?.icon"
|
|
42
99
|
:show-icon="context.showIcon"
|
|
100
|
+
:previous-icon="context?.previousIcon ?? 'pi pi-chevron-left'"
|
|
101
|
+
:next-icon="context?.nextIcon ?? 'pi pi-chevron-right'"
|
|
102
|
+
:increment-icon="context?.incrementIcon ?? 'pi pi-chevron-up'"
|
|
103
|
+
:decrement-icon="context?.decrementIcon ?? 'pi pi-chevron-down'"
|
|
104
|
+
:number-of-months="context?.numberOfMonths ?? 1"
|
|
105
|
+
:responsive-options="context?.responsiveOptions"
|
|
106
|
+
:view="context?.view ?? 'date'"
|
|
107
|
+
:touch-u-i="context?.touchUI ?? false"
|
|
108
|
+
:min-date="context?.minDate"
|
|
109
|
+
:max-date="context?.maxDate"
|
|
110
|
+
:disabled-dates="context?.disabledDates"
|
|
111
|
+
:disabled-days="context?.disabledDays"
|
|
112
|
+
:max-date-count="context?.maxDateCount"
|
|
113
|
+
:show-on-focus="context?.showOnFocus ?? true"
|
|
114
|
+
:auto-z-index="context?.autoZIndex ?? true"
|
|
115
|
+
:base-z-index="context?.baseZIndex ?? 0"
|
|
116
|
+
:show-button-bar="context?.showButtonBar ?? false"
|
|
117
|
+
:show-time="context?.showTime ?? false"
|
|
118
|
+
:time-only="context?.timeOnly ?? false"
|
|
119
|
+
:short-year-cutoff="context?.shortYearCutoff ?? '+10'"
|
|
120
|
+
:hour-format="context?.hourFormat ?? '24'"
|
|
121
|
+
:step-hour="context?.stepHour ?? 1"
|
|
122
|
+
:step-minute="context?.stepMinute ?? 1"
|
|
123
|
+
:step-second="context?.stepSecond ?? 1"
|
|
124
|
+
:show-seconds="context?.showSeconds ?? false"
|
|
125
|
+
:hide-on-date-time-select="context?.hideOnDateTimeSelect ?? false"
|
|
126
|
+
:hide-on-range-selection="context?.hideOnRangeSelection ?? false"
|
|
127
|
+
:time-separator="context?.timeSeparator ?? ':'"
|
|
128
|
+
:show-week="context?.showWeek ?? false"
|
|
129
|
+
:manual-input="context?.manualInput ?? true"
|
|
130
|
+
:append-to="context?.appendTo ?? 'body'"
|
|
131
|
+
:panel-style="context?.panelStyle"
|
|
132
|
+
:panel-class="context?.panelClass"
|
|
133
|
+
:pt="context?.pt"
|
|
134
|
+
:pt-options="context?.ptOptions"
|
|
135
|
+
:unstyled="context?.unstyled ?? false"
|
|
43
136
|
@date-select="handleSelect"
|
|
44
137
|
@input="handleInput"
|
|
45
138
|
@blur="handleBlur"
|
|
@@ -1,18 +1,36 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { CascadeSelectProps } from 'primevue/cascadeselect'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeCascadeSelectProps {
|
|
7
|
+
options?: CascadeSelectProps['options']
|
|
8
|
+
optionLabel?: CascadeSelectProps['optionLabel']
|
|
9
|
+
optionValue?: CascadeSelectProps['optionValue']
|
|
10
|
+
optionGroupLabel?: CascadeSelectProps['optionGroupLabel']
|
|
11
|
+
optionGroupChildren?: CascadeSelectProps['optionGroupChildren']
|
|
12
|
+
placeholder?: CascadeSelectProps['placeholder']
|
|
13
|
+
pt?: CascadeSelectProps['pt']
|
|
14
|
+
ptOptions?: CascadeSelectProps['ptOptions']
|
|
15
|
+
unstyled?: CascadeSelectProps['unstyled']
|
|
16
|
+
}
|
|
3
17
|
|
|
4
18
|
const props = defineProps({
|
|
5
|
-
context:
|
|
19
|
+
context: {
|
|
20
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeCascadeSelectProps>,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
6
23
|
})
|
|
7
24
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
25
|
function handleInput(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
26
|
+
props.context?.node.input(props.context?._value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function handleBlur(e: Event) {
|
|
30
|
+
props.context?.handlers.blur(e)
|
|
13
31
|
}
|
|
14
32
|
|
|
15
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
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,11 +38,24 @@ const styleClass = computed(() => (context?.state.validationVisible && !context?
|
|
|
20
38
|
<CascadeSelect
|
|
21
39
|
:id="context.id"
|
|
22
40
|
v-model="context._value"
|
|
23
|
-
v-bind="attrs"
|
|
24
|
-
:disabled="
|
|
25
|
-
:readonly="attrs._readonly ?? false"
|
|
41
|
+
v-bind="context?.attrs"
|
|
42
|
+
:disabled="!!context?.disabled"
|
|
43
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
26
44
|
:class="styleClass"
|
|
45
|
+
:tabindex="context?.attrs.tabindex"
|
|
46
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
47
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
48
|
+
:options="context?.options"
|
|
49
|
+
:option-label="context?.optionLabel"
|
|
50
|
+
:option-value="context.optionValue"
|
|
51
|
+
:option-group-label="context.optionGroupLabel"
|
|
52
|
+
:option-group-children="context.optionGroupChildren"
|
|
53
|
+
:placeholder="context.placeholder"
|
|
54
|
+
:pt="context.pt"
|
|
55
|
+
:pt-options="context.ptOptions"
|
|
56
|
+
:unstyled="context.unstyled ?? false"
|
|
27
57
|
@change="handleInput"
|
|
58
|
+
@blur="handleBlur"
|
|
28
59
|
/>
|
|
29
60
|
</div>
|
|
30
61
|
</template>
|
|
@@ -1,34 +1,60 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { CheckboxProps } from 'primevue/checkbox'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeCheckboxProps {
|
|
7
|
+
binary?: CheckboxProps['binary']
|
|
8
|
+
trueValue?: CheckboxProps['trueValue']
|
|
9
|
+
falseValue?: CheckboxProps['falseValue']
|
|
10
|
+
pt?: CheckboxProps['pt']
|
|
11
|
+
ptOptions?: CheckboxProps['ptOptions']
|
|
12
|
+
unstyled?: CheckboxProps['unstyled']
|
|
13
|
+
labelLeft?: string
|
|
14
|
+
labelRight?: string
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeCheckboxProps>,
|
|
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>
|
|
19
36
|
<div class="p-formkit">
|
|
20
|
-
<span v-if="context.
|
|
37
|
+
<span v-if="context.labelLeft" class="formkit-prime-left">{{ context.labelLeft }}</span>
|
|
21
38
|
<Checkbox
|
|
22
39
|
v-model="context._value"
|
|
23
|
-
v-bind="attrs"
|
|
40
|
+
v-bind="context?.attrs"
|
|
24
41
|
:input-id="context.id"
|
|
25
|
-
:disabled="
|
|
26
|
-
:readonly="attrs._readonly ?? false"
|
|
27
|
-
:input-style="attrs.style"
|
|
42
|
+
:disabled="!!context?.disabled"
|
|
43
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
44
|
+
:input-style="context?.attrs.style"
|
|
28
45
|
:input-class="styleClass"
|
|
29
|
-
:
|
|
46
|
+
:tabindex="context?.attrs.tabindex"
|
|
47
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
48
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
49
|
+
:binary="context.binary ?? true"
|
|
50
|
+
:true-value="context.trueValue ?? undefined"
|
|
51
|
+
:false-value="context.falseValue ?? undefined"
|
|
52
|
+
:pt="context.pt"
|
|
53
|
+
:pt-options="context.ptOptions"
|
|
54
|
+
:unstyled="context.unstyled ?? false"
|
|
30
55
|
@change="handleInput"
|
|
56
|
+
@blur="handleBlur"
|
|
31
57
|
/>
|
|
32
|
-
<span v-if="context.
|
|
58
|
+
<span v-if="context.labelRight" class="formkit-prime-right">{{ context.labelRight }}</span>
|
|
33
59
|
</div>
|
|
34
60
|
</template>
|
|
@@ -1,29 +1,53 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import { computed } from 'vue'
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { ChipsProps } from 'primevue/chips'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeChipsProps {
|
|
7
|
+
allowDuplicate?: ChipsProps['allowDuplicate']
|
|
8
|
+
addOnBlur?: ChipsProps['addOnBlur']
|
|
9
|
+
max?: ChipsProps['max']
|
|
10
|
+
placeholder?: ChipsProps['placeholder']
|
|
11
|
+
separator?: ChipsProps['separator']
|
|
12
|
+
pt?: ChipsProps['pt']
|
|
13
|
+
ptOptions?: ChipsProps['ptOptions']
|
|
14
|
+
unstyled?: ChipsProps['unstyled']
|
|
15
|
+
}
|
|
3
16
|
|
|
4
17
|
const props = defineProps({
|
|
5
|
-
context:
|
|
18
|
+
context: {
|
|
19
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeChipsProps>,
|
|
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)
|
|
13
26
|
}
|
|
14
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
27
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
15
28
|
</script>
|
|
16
29
|
|
|
17
30
|
<template>
|
|
18
31
|
<div class="p-formkit">
|
|
19
32
|
<Chips
|
|
20
33
|
v-model="context._value"
|
|
21
|
-
v-bind="attrs"
|
|
34
|
+
v-bind="context?.attrs"
|
|
22
35
|
:input-id="context.id"
|
|
23
|
-
:disabled="
|
|
24
|
-
:readonly="attrs._readonly ?? false"
|
|
25
|
-
:input-style="attrs.style"
|
|
36
|
+
:disabled="!!context?.disabled"
|
|
37
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
38
|
+
:input-style="context?.attrs.style"
|
|
26
39
|
:input-class="styleClass"
|
|
40
|
+
:tabindex="context?.attrs.tabindex"
|
|
41
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
42
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
43
|
+
:allow-duplicate="context.allowDuplicate ?? true"
|
|
44
|
+
:add-on-blur="context.addOnBlur ?? false"
|
|
45
|
+
:max="context.max ?? undefined"
|
|
46
|
+
:placeholder="context.placeholder"
|
|
47
|
+
:separator="context.separator"
|
|
48
|
+
:pt="context.pt"
|
|
49
|
+
:pt-options="context.ptOptions"
|
|
50
|
+
:unstyled="context.unstyled ?? false"
|
|
27
51
|
@add="handleInput"
|
|
28
52
|
@remove="handleInput"
|
|
29
53
|
/>
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import type { PropType } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { ColorPickerProps } from 'primevue/colorpicker'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeColorPickerProps {
|
|
7
|
+
defaultColor?: ColorPickerProps['defaultColor']
|
|
8
|
+
inline?: ColorPickerProps['inline']
|
|
9
|
+
format?: ColorPickerProps['format']
|
|
10
|
+
pt?: ColorPickerProps['pt']
|
|
11
|
+
ptOptions?: ColorPickerProps['ptOptions']
|
|
12
|
+
unstyled?: ColorPickerProps['unstyled']
|
|
13
|
+
}
|
|
3
14
|
|
|
4
15
|
const props = defineProps({
|
|
5
|
-
context:
|
|
16
|
+
context: {
|
|
17
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeColorPickerProps>,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
6
20
|
})
|
|
7
21
|
|
|
8
|
-
const context = props.context
|
|
9
|
-
const attrs = computed(() => context?.attrs)
|
|
10
|
-
|
|
11
22
|
function handleChange(e: any) {
|
|
12
|
-
context?.node.input(props.context?._value)
|
|
23
|
+
props.context?.node.input(props.context?._value)
|
|
13
24
|
}
|
|
14
25
|
</script>
|
|
15
26
|
|
|
@@ -17,11 +28,20 @@ function handleChange(e: any) {
|
|
|
17
28
|
<div class="p-formkit">
|
|
18
29
|
<ColorPicker
|
|
19
30
|
v-model="context._value"
|
|
20
|
-
v-bind="attrs"
|
|
21
|
-
:disabled="
|
|
22
|
-
:readonly="attrs._readonly ?? false"
|
|
23
|
-
:style="attrs.style"
|
|
24
|
-
:panel-class="attrs.class"
|
|
31
|
+
v-bind="context?.attrs"
|
|
32
|
+
:disabled="!!context?.disabled"
|
|
33
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
34
|
+
:style="context?.attrs.style"
|
|
35
|
+
:panel-class="context?.attrs.class"
|
|
36
|
+
:tabindex="context?.attrs.tabindex"
|
|
37
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
38
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
39
|
+
:default-color="context.defaultColor ?? 'ff0000'"
|
|
40
|
+
:inline="context.inline ?? false"
|
|
41
|
+
:format="context.format"
|
|
42
|
+
:pt="context.pt"
|
|
43
|
+
:pt-options="context.ptOptions"
|
|
44
|
+
:unstyled="context.unstyled ?? false"
|
|
25
45
|
@change="handleChange"
|
|
26
46
|
/>
|
|
27
47
|
</div>
|
|
@@ -1,35 +1,109 @@
|
|
|
1
|
-
<script setup lang=
|
|
2
|
-
import { computed } from 'vue'
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { type PropType, computed } from 'vue'
|
|
3
|
+
import type { FormKitFrameworkContext } from '@formkit/core'
|
|
4
|
+
import type { DropdownProps } from 'primevue/dropdown'
|
|
5
|
+
|
|
6
|
+
export interface FormKitPrimeDropdownProps {
|
|
7
|
+
options?: DropdownProps['options']
|
|
8
|
+
optionLabel?: DropdownProps['optionLabel']
|
|
9
|
+
optionValue?: DropdownProps['optionValue']
|
|
10
|
+
optionDisabled?: DropdownProps['optionDisabled']
|
|
11
|
+
optionGroupLabel?: DropdownProps['optionGroupLabel']
|
|
12
|
+
optionGroupChildren?: DropdownProps['optionGroupChildren']
|
|
13
|
+
scrollHeight?: DropdownProps['scrollHeight']
|
|
14
|
+
filter?: DropdownProps['filter']
|
|
15
|
+
filterPlaceholder?: DropdownProps['filterPlaceholder']
|
|
16
|
+
filterLocale?: DropdownProps['filterLocale']
|
|
17
|
+
filterMatchMode?: DropdownProps['filterMatchMode']
|
|
18
|
+
filterFields?: DropdownProps['filterFields']
|
|
19
|
+
filterInputProps?: DropdownProps['filterInputProps']
|
|
20
|
+
editable?: DropdownProps['editable']
|
|
21
|
+
placeholder?: DropdownProps['placeholder']
|
|
22
|
+
dataKey?: DropdownProps['dataKey']
|
|
23
|
+
showClear?: DropdownProps['showClear']
|
|
24
|
+
panelStyle?: DropdownProps['panelStyle']
|
|
25
|
+
panelClass?: DropdownProps['panelClass']
|
|
26
|
+
panelProps?: DropdownProps['panelProps']
|
|
27
|
+
appendTo?: DropdownProps['appendTo']
|
|
28
|
+
resetFilterOnHide?: DropdownProps['resetFilterOnHide']
|
|
29
|
+
virtualScrollerOptions?: DropdownProps['virtualScrollerOptions']
|
|
30
|
+
autoOptionFocus?: DropdownProps['autoOptionFocus']
|
|
31
|
+
selectOnFocus?: DropdownProps['selectOnFocus']
|
|
32
|
+
filterMessage?: DropdownProps['filterMessage']
|
|
33
|
+
selectionMessage?: DropdownProps['selectionMessage']
|
|
34
|
+
emptySelectionMessage?: DropdownProps['emptySelectionMessage']
|
|
35
|
+
emptyFilterMessage?: DropdownProps['emptyFilterMessage']
|
|
36
|
+
emptyMessage?: DropdownProps['emptyMessage']
|
|
37
|
+
pt?: DropdownProps['pt']
|
|
38
|
+
ptOptions?: DropdownProps['ptOptions']
|
|
39
|
+
unstyled?: DropdownProps['unstyled']
|
|
40
|
+
}
|
|
3
41
|
|
|
4
42
|
const props = defineProps({
|
|
5
|
-
context:
|
|
43
|
+
context: {
|
|
44
|
+
type: Object as PropType<FormKitFrameworkContext & FormKitPrimeDropdownProps>,
|
|
45
|
+
required: true,
|
|
46
|
+
},
|
|
6
47
|
})
|
|
7
48
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
function handleBlur(e: any) {
|
|
12
|
-
context?.handlers.blur(e.value)
|
|
49
|
+
function handleBlur(e: Event) {
|
|
50
|
+
props.context?.handlers.blur(e)
|
|
13
51
|
}
|
|
14
52
|
function handleInput(e: any) {
|
|
15
|
-
context?.node.input(e.value)
|
|
53
|
+
props.context?.node.input(e.value)
|
|
16
54
|
}
|
|
17
|
-
const styleClass = computed(() => (context?.state.validationVisible && !context?.state.valid) ? `${
|
|
55
|
+
const styleClass = computed(() => (props.context?.state.validationVisible && !props.context?.state.valid) ? `${props.context?.attrs?.class} p-invalid` : props.context?.attrs?.class)
|
|
18
56
|
</script>
|
|
19
57
|
|
|
20
58
|
<template>
|
|
21
59
|
<div class="p-formkit">
|
|
22
60
|
<Dropdown
|
|
23
61
|
v-model="context._value"
|
|
24
|
-
v-bind="attrs"
|
|
62
|
+
v-bind="context?.attrs"
|
|
25
63
|
:input-id="context.id"
|
|
26
|
-
:disabled="
|
|
27
|
-
:readonly="attrs._readonly ?? false"
|
|
28
|
-
:style="attrs.style"
|
|
64
|
+
:disabled="!!context?.disabled"
|
|
65
|
+
:readonly="context?.attrs._readonly ?? false"
|
|
66
|
+
:style="context?.attrs.style"
|
|
29
67
|
:class="styleClass"
|
|
30
|
-
:input-style="attrs.style"
|
|
68
|
+
:input-style="context?.attrs.style"
|
|
31
69
|
:input-class="styleClass"
|
|
32
|
-
:input-props="attrs.inputProps"
|
|
70
|
+
:input-props="context?.attrs.inputProps"
|
|
71
|
+
:tabindex="context?.attrs.tabindex"
|
|
72
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
73
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
74
|
+
:options="context.options"
|
|
75
|
+
:option-label="context.optionLabel"
|
|
76
|
+
:option-value="context.optionValue"
|
|
77
|
+
:option-disabled="context.optionDisabled"
|
|
78
|
+
:option-group-label="context.optionGroupLabel"
|
|
79
|
+
:option-group-children="context.optionGroupChildren"
|
|
80
|
+
:scroll-height="context.scrollHeight"
|
|
81
|
+
:filter="context.filter ?? false"
|
|
82
|
+
:filter-placeholder="context.filterPlaceholder"
|
|
83
|
+
:filter-locale="context.filterLocale"
|
|
84
|
+
:filter-match-mode="context.filterMatchMode"
|
|
85
|
+
:fitler-fields="context.filterFields"
|
|
86
|
+
:filter-input-props="context.filterInputProps"
|
|
87
|
+
:editable="context.editable"
|
|
88
|
+
:placeholder="context.placeholder"
|
|
89
|
+
:data-key="context.dataKey"
|
|
90
|
+
:show-clear="context.showClear ?? false"
|
|
91
|
+
:panel-style="context.panelStyle"
|
|
92
|
+
:panel-class="context.panelClass"
|
|
93
|
+
:panel-props="context.panelProps"
|
|
94
|
+
:append-to="context.appendTo"
|
|
95
|
+
:reset-filter-on-hide="context.resetFilterOnHide"
|
|
96
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
97
|
+
:auto-option-focus="context.autoOptionFocus"
|
|
98
|
+
:select-on-focus="context.selectOnFocus"
|
|
99
|
+
:filter-message="context.filterMessage"
|
|
100
|
+
:selection-message="context.selectionMessage"
|
|
101
|
+
:empty-selection-message="context.emptySelectionMessage"
|
|
102
|
+
:empty-filter-message="context.emptyFilterMessage"
|
|
103
|
+
:empty-message="context.emptyMessage"
|
|
104
|
+
:pt="context.pt"
|
|
105
|
+
:pt-options="context.ptOptions"
|
|
106
|
+
:unstyled="context.unstyled ?? false"
|
|
33
107
|
@change="handleInput"
|
|
34
108
|
@blur="handleBlur"
|
|
35
109
|
/>
|