@sfxcode/formkit-primevue 3.3.1 → 3.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FormKitDataDebug.vue +19 -0
- package/dist/components/FormKitDataEdit.vue +133 -0
- package/dist/components/FormKitDataView.vue +51 -0
- package/dist/components/FormKitIcon.vue +18 -0
- package/dist/components/FormKitPrefix.vue +11 -0
- package/dist/components/FormKitSuffix.vue +11 -0
- package/dist/components/PrimeAutoComplete.vue +95 -0
- package/dist/components/PrimeCascadeSelect.vue +43 -0
- package/dist/components/PrimeCheckbox.vue +51 -0
- package/dist/components/PrimeColorPicker.vue +33 -0
- package/dist/components/PrimeDatePicker.vue +97 -0
- package/dist/components/PrimeInputMask.vue +69 -0
- package/dist/components/PrimeInputNumber.vue +75 -0
- package/dist/components/PrimeInputOtp.vue +42 -0
- package/dist/components/PrimeInputText.vue +65 -0
- package/dist/components/PrimeKnob.vue +50 -0
- package/dist/components/PrimeListbox.vue +54 -0
- package/dist/components/PrimeMultiSelect.vue +70 -0
- package/dist/components/PrimeOutputBoolean.vue +42 -0
- package/dist/components/PrimeOutputDate.vue +51 -0
- package/dist/components/PrimeOutputDuration.vue +36 -0
- package/dist/components/PrimeOutputLink.vue +52 -0
- package/dist/components/PrimeOutputList.vue +106 -0
- package/dist/components/PrimeOutputNumber.vue +56 -0
- package/dist/components/PrimeOutputReference.vue +64 -0
- package/dist/components/PrimeOutputText.vue +72 -0
- package/dist/components/PrimePassword.vue +52 -0
- package/dist/components/PrimeRadioButton.vue +48 -0
- package/dist/components/PrimeRating.vue +40 -0
- package/dist/components/PrimeSelect.vue +71 -0
- package/dist/components/PrimeSelectButton.vue +44 -0
- package/dist/components/PrimeSlider.vue +42 -0
- package/dist/components/PrimeTextarea.vue +37 -0
- package/dist/components/PrimeToggleButton.vue +42 -0
- package/dist/components/PrimeToggleSwitch.vue +42 -0
- package/dist/components/PrimeTreeSelect.vue +48 -0
- package/dist/components/index.d.ts +24 -2
- package/dist/components/index.js +167 -4
- package/dist/components/index.mjs +48 -0
- package/dist/composables/index.d.ts +9 -2
- package/dist/composables/index.js +61 -2
- package/dist/composables/index.mjs +18 -0
- package/dist/composables/useFormKitInput.d.ts +11 -0
- package/dist/composables/useFormKitInput.js +62 -0
- package/dist/composables/useFormKitInput.mjs +57 -0
- package/dist/composables/useFormKitRepeater.d.ts +15 -0
- package/dist/composables/useFormKitRepeater.js +74 -0
- package/dist/composables/useFormKitRepeater.mjs +82 -0
- package/dist/composables/useFormKitSchema.d.ts +36 -0
- package/dist/composables/useFormKitSchema.js +83 -0
- package/dist/composables/useFormKitSchema.mjs +66 -0
- package/dist/composables/useFormKitSection.d.ts +7 -0
- package/dist/composables/useFormKitSection.js +31 -0
- package/dist/composables/useFormKitSection.mjs +19 -0
- package/dist/composables/useInputEditor.d.ts +8 -0
- package/dist/composables/useInputEditor.js +148 -0
- package/dist/composables/useInputEditor.mjs +171 -0
- package/dist/composables/useInputEditorSchema.d.ts +163 -0
- package/dist/composables/useInputEditorSchema.js +313 -0
- package/dist/composables/useInputEditorSchema.mjs +323 -0
- package/dist/composables/useOutputDuration.d.ts +4 -0
- package/dist/composables/useOutputDuration.js +40 -0
- package/dist/composables/useOutputDuration.mjs +32 -0
- package/dist/composables/usePrimeInputs.d.ts +3 -0
- package/dist/composables/usePrimeInputs.js +62 -0
- package/dist/composables/usePrimeInputs.mjs +53 -0
- package/dist/definitions/index.d.ts +32 -37
- package/dist/definitions/index.js +42 -4
- package/dist/definitions/index.mjs +68 -0
- package/dist/definitions/input.d.ts +47 -0
- package/dist/definitions/input.js +142 -0
- package/dist/definitions/input.mjs +421 -0
- package/dist/definitions/output.d.ts +9 -0
- package/dist/definitions/output.js +46 -0
- package/dist/definitions/output.mjs +120 -0
- package/dist/index.d.ts +142 -145
- package/dist/index.js +62 -5
- package/dist/index.mjs +20 -0
- package/dist/plugins/index.d.ts +3 -7
- package/dist/plugins/index.js +57 -45
- package/dist/plugins/index.mjs +59 -0
- package/dist/vue.d.ts +5 -0
- package/package.json +88 -40
- package/dist/PrimeTreeSelect-Dksx7tL-.js +0 -1881
- package/dist/components-HJnJ39cU.js +0 -255
- package/dist/composables-CZ6f1QYe.js +0 -820
- package/dist/definitions-BHwWaom7.js +0 -1196
- package/dist/index-Ch3MtT1C.d.ts +0 -266
- package/dist/index-EJ8M51RO.d.ts +0 -917
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
data: {
|
|
4
|
+
type: Object,
|
|
5
|
+
default: null
|
|
6
|
+
},
|
|
7
|
+
header: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "Debug"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<Fieldset class="p-formkit-data-debug" :legend="header" :toggleable="true" :collapsed="true">
|
|
16
|
+
<pre v-if="data">{{ data }}</pre>
|
|
17
|
+
<span v-else>No Data available</span>
|
|
18
|
+
</Fieldset>
|
|
19
|
+
</template>
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reset } from "@formkit/core";
|
|
3
|
+
import { FormKit, FormKitMessages, FormKitSchema } from "@formkit/vue";
|
|
4
|
+
import { ref } from "vue";
|
|
5
|
+
import FormKitDataDebug from "./FormKitDataDebug.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
id: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: "formkit_form"
|
|
10
|
+
},
|
|
11
|
+
data: {
|
|
12
|
+
type: Object,
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
schema: {
|
|
16
|
+
type: Object,
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
formClass: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: ""
|
|
22
|
+
},
|
|
23
|
+
actionsClass: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ""
|
|
26
|
+
},
|
|
27
|
+
submitSeverity: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
submitClass: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: ""
|
|
34
|
+
},
|
|
35
|
+
submitLabel: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "Save"
|
|
38
|
+
},
|
|
39
|
+
submitIcon: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ""
|
|
42
|
+
},
|
|
43
|
+
showReset: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: false
|
|
46
|
+
},
|
|
47
|
+
resetSeverity: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "danger"
|
|
50
|
+
},
|
|
51
|
+
resetLabel: {
|
|
52
|
+
type: String,
|
|
53
|
+
default: "Reset"
|
|
54
|
+
},
|
|
55
|
+
resetClass: {
|
|
56
|
+
type: String,
|
|
57
|
+
default: ""
|
|
58
|
+
},
|
|
59
|
+
resetIcon: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ""
|
|
62
|
+
},
|
|
63
|
+
debugData: {
|
|
64
|
+
type: Boolean,
|
|
65
|
+
default: false
|
|
66
|
+
},
|
|
67
|
+
debugSchema: {
|
|
68
|
+
type: Boolean,
|
|
69
|
+
default: false
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
const emit = defineEmits(["dataSaved", "onReset"]);
|
|
73
|
+
const formData = defineModel({ type: null });
|
|
74
|
+
if (props.data) {
|
|
75
|
+
formData.value = props.data;
|
|
76
|
+
}
|
|
77
|
+
const formSchema = ref(props.schema);
|
|
78
|
+
function handleSave() {
|
|
79
|
+
emit("dataSaved", formData.value);
|
|
80
|
+
}
|
|
81
|
+
function handleReset() {
|
|
82
|
+
reset(props.id);
|
|
83
|
+
emit("onReset");
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<template>
|
|
88
|
+
<FormKit
|
|
89
|
+
:id="id"
|
|
90
|
+
v-model="formData"
|
|
91
|
+
:actions-class="actionsClass"
|
|
92
|
+
:form-class="`p-formkit-data-edit ${formClass}`"
|
|
93
|
+
type="form"
|
|
94
|
+
@submit="handleSave"
|
|
95
|
+
>
|
|
96
|
+
<template #default>
|
|
97
|
+
<FormKitSchema v-if="formSchema" :schema="formSchema" :data="formData" />
|
|
98
|
+
<slot />
|
|
99
|
+
<FormKitDataDebug v-if="debugData" :data="formData" header="Debug Mode - Data" />
|
|
100
|
+
<FormKitDataDebug
|
|
101
|
+
v-if="debugSchema"
|
|
102
|
+
:data="formSchema as object"
|
|
103
|
+
header="Debug Mode - Schema"
|
|
104
|
+
/>
|
|
105
|
+
</template>
|
|
106
|
+
<template #messages>
|
|
107
|
+
<slot name="messages">
|
|
108
|
+
<FormKitMessages class="p-formkit-data-edit-messages" />
|
|
109
|
+
</slot>
|
|
110
|
+
</template>
|
|
111
|
+
<template #submit>
|
|
112
|
+
<slot name="submit">
|
|
113
|
+
<Button
|
|
114
|
+
:icon="submitIcon"
|
|
115
|
+
type="submit"
|
|
116
|
+
:label="submitLabel"
|
|
117
|
+
:class="submitClass"
|
|
118
|
+
:severity="submitSeverity"
|
|
119
|
+
@submit="handleSave"
|
|
120
|
+
/>
|
|
121
|
+
<Button
|
|
122
|
+
v-if="showReset"
|
|
123
|
+
type="reset"
|
|
124
|
+
:icon="resetIcon"
|
|
125
|
+
:label="resetLabel"
|
|
126
|
+
:class="resetClass"
|
|
127
|
+
:severity="resetSeverity"
|
|
128
|
+
@click="handleReset"
|
|
129
|
+
/>
|
|
130
|
+
</slot>
|
|
131
|
+
</template>
|
|
132
|
+
</FormKit>
|
|
133
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { FormKit, FormKitSchema } from "@formkit/vue";
|
|
3
|
+
import { ref } from "vue";
|
|
4
|
+
import FormKitDataDebug from "./FormKitDataDebug.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
data: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
schema: {
|
|
11
|
+
type: Object,
|
|
12
|
+
default: null
|
|
13
|
+
},
|
|
14
|
+
formClass: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
debugData: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false
|
|
21
|
+
},
|
|
22
|
+
debugSchema: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const formSchema = ref(props.schema);
|
|
28
|
+
const formData = defineModel({ type: null });
|
|
29
|
+
if (props.data) {
|
|
30
|
+
formData.value = props.data;
|
|
31
|
+
}
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template>
|
|
35
|
+
<FormKit
|
|
36
|
+
v-model="formData"
|
|
37
|
+
:actions="false"
|
|
38
|
+
:form-class="`p-formkit-data-view ${formClass}`"
|
|
39
|
+
class="p-formkit-data-view"
|
|
40
|
+
type="form"
|
|
41
|
+
>
|
|
42
|
+
<FormKitSchema v-if="schema" :schema="formSchema" :data="formData" />
|
|
43
|
+
<slot />
|
|
44
|
+
<FormKitDataDebug v-if="debugData" :data="formData" header="Debug Mode - Data" />
|
|
45
|
+
<FormKitDataDebug
|
|
46
|
+
v-if="debugSchema"
|
|
47
|
+
:data="formSchema as object"
|
|
48
|
+
header="Debug Mode - Schema"
|
|
49
|
+
/>
|
|
50
|
+
</FormKit>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
iconClass: {
|
|
4
|
+
type: String,
|
|
5
|
+
default: ""
|
|
6
|
+
},
|
|
7
|
+
onClick: { type: Function, default: void 0 },
|
|
8
|
+
position: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
validator: (val) => ["prefix", "suffix"].includes(val)
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<i :class="[`formkit-${position}-icon`, iconClass]" @click="onClick" />
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useFormKitInput } from "../composables/index.ts";
|
|
4
|
+
const props = defineProps({
|
|
5
|
+
context: {
|
|
6
|
+
type: Object,
|
|
7
|
+
required: true
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
11
|
+
const suggestions = ref(["", {}]);
|
|
12
|
+
suggestions.value = [];
|
|
13
|
+
const loading = ref(false);
|
|
14
|
+
async function search(event) {
|
|
15
|
+
if (props.context?.options && props.context?.optionLabel) {
|
|
16
|
+
suggestions.value = props.context.options.filter((option) => {
|
|
17
|
+
return option[`${props.context.optionLabel}`].toString().toLowerCase().includes(event.query.toLowerCase());
|
|
18
|
+
});
|
|
19
|
+
} else {
|
|
20
|
+
loading.value = true;
|
|
21
|
+
try {
|
|
22
|
+
suggestions.value = await props.context?.attrs.complete(event.query);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.error("Error fetching suggestions:", error);
|
|
25
|
+
suggestions.value = [];
|
|
26
|
+
} finally {
|
|
27
|
+
loading.value = false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function handlePaste(event) {
|
|
32
|
+
if (!props.context?.multiple) return;
|
|
33
|
+
const clipboardData = event.clipboardData;
|
|
34
|
+
if (!clipboardData) return;
|
|
35
|
+
const pastedText = clipboardData.getData("text");
|
|
36
|
+
const separators = Array.isArray(props.context?.separators) && props.context.separators.length > 0 ? props.context.separators : [","];
|
|
37
|
+
const regex = new RegExp(
|
|
38
|
+
`[${separators.map((s) => s.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")).join("")}]`
|
|
39
|
+
);
|
|
40
|
+
if (pastedText && regex.test(pastedText)) {
|
|
41
|
+
event.preventDefault();
|
|
42
|
+
const items = pastedText.split(regex).map((item) => item.trim()).filter((item) => item.length > 0);
|
|
43
|
+
if (Array.isArray(modelValue.value)) {
|
|
44
|
+
modelValue.value = [...modelValue.value, ...items];
|
|
45
|
+
} else {
|
|
46
|
+
modelValue.value = items;
|
|
47
|
+
}
|
|
48
|
+
} else if (pastedText) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
if (Array.isArray(modelValue.value)) {
|
|
51
|
+
modelValue.value = [...modelValue.value, pastedText.trim()];
|
|
52
|
+
} else {
|
|
53
|
+
modelValue.value = [pastedText.trim()];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<template>
|
|
60
|
+
<div class="p-formkit">
|
|
61
|
+
<AutoComplete
|
|
62
|
+
:id="context.id"
|
|
63
|
+
v-model="modelValue"
|
|
64
|
+
v-bind="context?.attrs"
|
|
65
|
+
:disabled="!!context?.disabled"
|
|
66
|
+
:class="context?.attrs?.class"
|
|
67
|
+
:invalid="isInvalid"
|
|
68
|
+
:tabindex="context?.attrs.tabindex"
|
|
69
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
70
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
71
|
+
:size="context?.size ?? undefined"
|
|
72
|
+
:suggestions="suggestions"
|
|
73
|
+
:option-label="context?.optionLabel"
|
|
74
|
+
:dropdown="context?.dropdown ?? false"
|
|
75
|
+
:multiple="context?.multiple ?? false"
|
|
76
|
+
:typeahead="context?.typeahead ?? true"
|
|
77
|
+
:min-length="context?.minLength ?? undefined"
|
|
78
|
+
:placeholder="context?.placeholder ?? undefined"
|
|
79
|
+
:fluid="context?.fluid ?? undefined"
|
|
80
|
+
:pt="context?.pt"
|
|
81
|
+
:pt-options="context?.ptOptions"
|
|
82
|
+
:unstyled="unstyled"
|
|
83
|
+
:loading="loading"
|
|
84
|
+
@keydown.enter.prevent
|
|
85
|
+
@complete="search"
|
|
86
|
+
@change="handleInput"
|
|
87
|
+
@blur="handleBlur"
|
|
88
|
+
@paste="handlePaste"
|
|
89
|
+
>
|
|
90
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
91
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
92
|
+
</template>
|
|
93
|
+
</AutoComplete>
|
|
94
|
+
</div>
|
|
95
|
+
</template>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables/index.ts";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="p-formkit">
|
|
14
|
+
<CascadeSelect
|
|
15
|
+
:id="context.id"
|
|
16
|
+
v-model="modelValue"
|
|
17
|
+
v-bind="context?.attrs"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
20
|
+
:class="context?.attrs?.class"
|
|
21
|
+
:invalid="isInvalid"
|
|
22
|
+
:tabindex="context?.attrs.tabindex"
|
|
23
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
24
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
25
|
+
:size="context?.size ?? undefined"
|
|
26
|
+
:options="context?.options"
|
|
27
|
+
:option-label="context?.optionLabel"
|
|
28
|
+
:option-value="context.optionValue"
|
|
29
|
+
:option-group-label="context.optionGroupLabel"
|
|
30
|
+
:option-group-children="context.optionGroupChildren"
|
|
31
|
+
:placeholder="context.placeholder"
|
|
32
|
+
:pt="context.pt"
|
|
33
|
+
:pt-options="context.ptOptions"
|
|
34
|
+
:unstyled="unstyled"
|
|
35
|
+
@change="handleInput"
|
|
36
|
+
@blur="handleBlur"
|
|
37
|
+
>
|
|
38
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
39
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
40
|
+
</template>
|
|
41
|
+
</CascadeSelect>
|
|
42
|
+
</div>
|
|
43
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput, useFormKitSection } from "../composables/index.ts";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const { hasPrefix, hasSuffix, generateId } = useFormKitSection(props.context);
|
|
10
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
11
|
+
const generatedId = generateId();
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="p-formkit">
|
|
16
|
+
<label v-if="hasPrefix" :for="generatedId" class="formkit-prefix">
|
|
17
|
+
{{ context?.prefix }}
|
|
18
|
+
</label>
|
|
19
|
+
<Checkbox
|
|
20
|
+
v-model="modelValue"
|
|
21
|
+
v-bind="context?.attrs"
|
|
22
|
+
:input-id="generatedId"
|
|
23
|
+
:disabled="!!context?.disabled"
|
|
24
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
25
|
+
:input-style="context?.attrs.style"
|
|
26
|
+
:input-class="context?.attrs?.class"
|
|
27
|
+
:invalid="isInvalid"
|
|
28
|
+
:tabindex="context?.attrs.tabindex"
|
|
29
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
30
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
31
|
+
:size="context?.size ?? undefined"
|
|
32
|
+
:indeterminate="context.indeterminate ?? undefined"
|
|
33
|
+
:binary="context.binary ?? true"
|
|
34
|
+
:variant="context.variant ?? 'outlined'"
|
|
35
|
+
:true-value="context.trueValue ?? undefined"
|
|
36
|
+
:false-value="context.falseValue ?? undefined"
|
|
37
|
+
:pt="context.pt"
|
|
38
|
+
:pt-options="context.ptOptions"
|
|
39
|
+
:unstyled="unstyled"
|
|
40
|
+
@change="handleInput"
|
|
41
|
+
@blur="handleBlur"
|
|
42
|
+
>
|
|
43
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
44
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
45
|
+
</template>
|
|
46
|
+
</Checkbox>
|
|
47
|
+
<label v-if="hasSuffix" :for="generatedId" class="formkit-suffix">
|
|
48
|
+
{{ context?.suffix }}
|
|
49
|
+
</label>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables/index.ts";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const { unstyled, handleChange, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="p-formkit">
|
|
14
|
+
<ColorPicker
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="context?.attrs"
|
|
17
|
+
:disabled="!!context?.disabled"
|
|
18
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
19
|
+
:style="context?.attrs.style"
|
|
20
|
+
:panel-class="context?.attrs.class"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:default-color="context.defaultColor ?? 'ff0000'"
|
|
25
|
+
:inline="context.inline ?? false"
|
|
26
|
+
:format="context.format"
|
|
27
|
+
:pt="context.pt"
|
|
28
|
+
:pt-options="context.ptOptions"
|
|
29
|
+
:unstyled="unstyled"
|
|
30
|
+
@change="handleChange"
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables/index.ts";
|
|
3
|
+
const props = defineProps({
|
|
4
|
+
context: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, modelValue } = useFormKitInput(
|
|
10
|
+
props.context
|
|
11
|
+
);
|
|
12
|
+
function handleBlur(e) {
|
|
13
|
+
props.context?.handlers.blur(e.originalEvent);
|
|
14
|
+
}
|
|
15
|
+
function handleClearClick() {
|
|
16
|
+
props.context?.node.input(null);
|
|
17
|
+
}
|
|
18
|
+
function handleSelect(e) {
|
|
19
|
+
if (props.context?.selectionMode === "range" || props.context?.selectionMode === "multiple") {
|
|
20
|
+
props.context?.node.input(props.context._value);
|
|
21
|
+
} else {
|
|
22
|
+
props.context?.node.input(e);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="p-formkit">
|
|
29
|
+
<DatePicker
|
|
30
|
+
v-model="modelValue"
|
|
31
|
+
v-bind="context?.attrs"
|
|
32
|
+
:input-id="context.id"
|
|
33
|
+
:disabled="!!context?.disabled"
|
|
34
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
35
|
+
:input-style="context?.attrs.style"
|
|
36
|
+
:input-class="context?.attrs?.class"
|
|
37
|
+
:invalid="isInvalid"
|
|
38
|
+
:tabindex="context?.attrs.tabindex"
|
|
39
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
40
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
41
|
+
:size="context?.size ?? undefined"
|
|
42
|
+
:date-format="context?.dateFormat"
|
|
43
|
+
:placeholder="context?.placeholder"
|
|
44
|
+
:selection-mode="context?.selectionMode ?? 'single'"
|
|
45
|
+
:inline="context?.inline ?? false"
|
|
46
|
+
:show-other-months="context?.showOtherMonths ?? true"
|
|
47
|
+
:select-other-months="context?.selectOtherMonths ?? false"
|
|
48
|
+
:icon="context?.icon"
|
|
49
|
+
:show-icon="context.showIcon"
|
|
50
|
+
:previous-icon="context?.previousIcon"
|
|
51
|
+
:next-icon="context?.nextIcon"
|
|
52
|
+
:increment-icon="context?.incrementIcon"
|
|
53
|
+
:decrement-icon="context?.decrementIcon"
|
|
54
|
+
:number-of-months="context?.numberOfMonths ?? 1"
|
|
55
|
+
:responsive-options="context?.responsiveOptions"
|
|
56
|
+
:view="context?.view ?? 'date'"
|
|
57
|
+
:touch-u-i="context?.touchUI ?? false"
|
|
58
|
+
:min-date="context?.minDate"
|
|
59
|
+
:max-date="context?.maxDate"
|
|
60
|
+
:disabled-dates="context?.disabledDates"
|
|
61
|
+
:disabled-days="context?.disabledDays"
|
|
62
|
+
:max-date-count="context?.maxDateCount"
|
|
63
|
+
:show-on-focus="context?.showOnFocus ?? true"
|
|
64
|
+
:auto-z-index="context?.autoZIndex ?? true"
|
|
65
|
+
:base-z-index="context?.baseZIndex ?? 0"
|
|
66
|
+
:show-button-bar="context?.showButtonBar ?? false"
|
|
67
|
+
:show-time="context?.showTime ?? false"
|
|
68
|
+
:time-only="context?.timeOnly ?? false"
|
|
69
|
+
:short-year-cutoff="context?.shortYearCutoff ?? '+10'"
|
|
70
|
+
:hour-format="context?.hourFormat ?? '24'"
|
|
71
|
+
:step-hour="context?.stepHour ?? 1"
|
|
72
|
+
:step-minute="context?.stepMinute ?? 1"
|
|
73
|
+
:step-second="context?.stepSecond ?? 1"
|
|
74
|
+
:show-seconds="context?.showSeconds ?? false"
|
|
75
|
+
:hide-on-date-time-select="context?.hideOnDateTimeSelect ?? false"
|
|
76
|
+
:hide-on-range-selection="context?.hideOnRangeSelection ?? false"
|
|
77
|
+
:time-separator="context?.timeSeparator ?? ':'"
|
|
78
|
+
:show-week="context?.showWeek ?? false"
|
|
79
|
+
:manual-input="context?.manualInput ?? true"
|
|
80
|
+
:append-to="context?.appendTo ?? 'body'"
|
|
81
|
+
:panel-style="context?.panelStyle"
|
|
82
|
+
:panel-class="context?.panelClass"
|
|
83
|
+
:pt="context?.pt"
|
|
84
|
+
:pt-options="context?.ptOptions"
|
|
85
|
+
:unstyled="unstyled"
|
|
86
|
+
:update-model-type="context?.updateModelType ?? 'date'"
|
|
87
|
+
@date-select="handleSelect"
|
|
88
|
+
@blur="handleBlur"
|
|
89
|
+
@clear-click="handleClearClick"
|
|
90
|
+
@value-change="handleInput"
|
|
91
|
+
>
|
|
92
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
93
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
94
|
+
</template>
|
|
95
|
+
</DatePicker>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import IconField from "primevue/iconfield";
|
|
3
|
+
import InputIcon from "primevue/inputicon";
|
|
4
|
+
import { useFormKitInput, useFormKitSection } from "../composables/index.ts";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
context: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
12
|
+
const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<div class="p-formkit">
|
|
17
|
+
<IconField v-if="hasPrefixIcon || hasSuffixIcon">
|
|
18
|
+
<InputIcon v-if="hasPrefixIcon" :class="context?.iconPrefix" />
|
|
19
|
+
<InputMask
|
|
20
|
+
:id="context.id"
|
|
21
|
+
v-model="modelValue"
|
|
22
|
+
v-bind="context?.attrs"
|
|
23
|
+
:disabled="!!context?.disabled"
|
|
24
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
25
|
+
:class="context?.attrs?.class"
|
|
26
|
+
:invalid="isInvalid"
|
|
27
|
+
:tabindex="context?.attrs.tabindex"
|
|
28
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
29
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
30
|
+
:size="context?.size ?? undefined"
|
|
31
|
+
:mask="context.mask ?? undefined"
|
|
32
|
+
:slot-char="context.slotChar ?? '_'"
|
|
33
|
+
:auto-clear="context.autoClear ?? true"
|
|
34
|
+
:unmask="context.unmask ?? false"
|
|
35
|
+
:pt="context.pt"
|
|
36
|
+
:variant="context.variant"
|
|
37
|
+
:pt-options="context.ptOptions"
|
|
38
|
+
:unstyled="unstyled"
|
|
39
|
+
@update:model-value="handleInput"
|
|
40
|
+
@blur="handleBlur"
|
|
41
|
+
/>
|
|
42
|
+
<InputIcon v-if="hasSuffixIcon" :class="context?.iconSuffix" />
|
|
43
|
+
</IconField>
|
|
44
|
+
<InputMask
|
|
45
|
+
v-if="!hasPrefixIcon && !hasSuffixIcon"
|
|
46
|
+
:id="context.id"
|
|
47
|
+
v-model="modelValue"
|
|
48
|
+
v-bind="context?.attrs"
|
|
49
|
+
:disabled="!!context?.disabled"
|
|
50
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
51
|
+
:class="context?.attrs?.class"
|
|
52
|
+
:invalid="isInvalid"
|
|
53
|
+
:tabindex="context?.attrs.tabindex"
|
|
54
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
55
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
56
|
+
:size="context?.size ?? undefined"
|
|
57
|
+
:mask="context.mask ?? undefined"
|
|
58
|
+
:slot-char="context.slotChar ?? '_'"
|
|
59
|
+
:auto-clear="context.autoClear ?? true"
|
|
60
|
+
:unmask="context.unmask ?? false"
|
|
61
|
+
:pt="context.pt"
|
|
62
|
+
:variant="context.variant"
|
|
63
|
+
:pt-options="context.ptOptions"
|
|
64
|
+
:unstyled="unstyled"
|
|
65
|
+
@update:model-value="handleInput"
|
|
66
|
+
@blur="handleBlur"
|
|
67
|
+
/>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|