@sfxcode/formkit-openvue 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.md +227 -2
- package/components.d.ts +1 -0
- package/dist/components/FormAutoComplete.vue +100 -0
- package/dist/components/FormCascadeSelect.vue +41 -0
- package/dist/components/FormCheckbox.vue +49 -0
- package/dist/components/FormColorPicker.vue +31 -0
- package/dist/components/FormDatePicker.vue +93 -0
- package/dist/components/FormInputMask.vue +67 -0
- package/dist/components/FormInputNumber.vue +72 -0
- package/dist/components/FormInputOtp.vue +40 -0
- package/dist/components/FormInputText.vue +63 -0
- package/dist/components/FormKitDataDebug.vue +25 -0
- package/dist/components/FormKitDataEdit.vue +123 -0
- package/dist/components/FormKitDataView.vue +56 -0
- package/dist/components/FormKitIcon.vue +23 -0
- package/dist/components/FormKitPrefix.vue +9 -0
- package/dist/components/FormKitSuffix.vue +9 -0
- package/dist/components/FormKnob.vue +48 -0
- package/dist/components/FormListbox.vue +482 -0
- package/dist/components/FormMultiSelect.vue +68 -0
- package/dist/components/FormOutputBoolean.vue +30 -0
- package/dist/components/FormOutputDate.vue +40 -0
- package/dist/components/FormOutputDuration.vue +24 -0
- package/dist/components/FormOutputLink.vue +39 -0
- package/dist/components/FormOutputList.vue +105 -0
- package/dist/components/FormOutputNumber.vue +47 -0
- package/dist/components/FormOutputReference.vue +52 -0
- package/dist/components/FormOutputText.vue +52 -0
- package/dist/components/FormPassword.vue +47 -0
- package/dist/components/FormRadioButton.vue +39 -0
- package/dist/components/FormRating.vue +38 -0
- package/dist/components/FormSelect.vue +69 -0
- package/dist/components/FormSelectButton.vue +42 -0
- package/dist/components/FormSlider.vue +40 -0
- package/dist/components/FormTextarea.vue +35 -0
- package/dist/components/FormToggleButton.vue +40 -0
- package/dist/components/FormToggleSwitch.vue +40 -0
- package/dist/components/FormTreeSelect.vue +46 -0
- package/dist/components/index.d.ts +24 -0
- package/dist/components/index.js +167 -0
- package/dist/components/index.mjs +48 -0
- package/dist/composables/index.d.ts +9 -0
- package/dist/composables/index.js +61 -0
- package/dist/composables/index.mjs +18 -0
- package/dist/composables/useFormInputs.d.ts +3 -0
- package/dist/composables/useFormInputs.js +62 -0
- package/dist/composables/useFormInputs.mjs +53 -0
- package/dist/composables/useFormKitInput.d.ts +11 -0
- package/dist/composables/useFormKitInput.js +58 -0
- package/dist/composables/useFormKitInput.mjs +45 -0
- package/dist/composables/useFormKitRepeater.d.ts +18 -0
- package/dist/composables/useFormKitRepeater.js +74 -0
- package/dist/composables/useFormKitRepeater.mjs +54 -0
- package/dist/composables/useFormKitSchema.d.ts +36 -0
- package/dist/composables/useFormKitSchema.js +83 -0
- package/dist/composables/useFormKitSchema.mjs +58 -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 +143 -0
- package/dist/composables/useInputEditorSchema.d.ts +163 -0
- package/dist/composables/useInputEditorSchema.js +313 -0
- package/dist/composables/useInputEditorSchema.mjs +315 -0
- package/dist/composables/useOutputDuration.d.ts +4 -0
- package/dist/composables/useOutputDuration.js +40 -0
- package/dist/composables/useOutputDuration.mjs +35 -0
- package/dist/definitions/index.d.ts +35 -0
- package/dist/definitions/index.js +44 -0
- package/dist/definitions/index.mjs +70 -0
- package/dist/definitions/input.d.ts +23 -0
- package/dist/definitions/input.js +118 -0
- package/dist/definitions/input.mjs +111 -0
- package/dist/definitions/output.d.ts +9 -0
- package/dist/definitions/output.js +46 -0
- package/dist/definitions/output.mjs +136 -0
- package/dist/definitions/repeater.d.ts +2 -0
- package/dist/definitions/repeater.js +234 -0
- package/dist/definitions/repeater.mjs +215 -0
- package/dist/index.d.ts +148 -0
- package/dist/index.js +62 -0
- package/dist/index.mjs +14 -0
- package/dist/plugins/autoAnimate.d.ts +9 -0
- package/dist/plugins/autoAnimate.js +93 -0
- package/dist/plugins/autoAnimate.mjs +87 -0
- package/dist/plugins/index.d.ts +5 -0
- package/dist/plugins/index.js +67 -0
- package/dist/plugins/index.mjs +56 -0
- package/dist/sass/formkit-openvue.scss +491 -0
- package/dist/style.css +1 -0
- package/dist/utils/clonePlain.d.ts +10 -0
- package/dist/utils/clonePlain.js +25 -0
- package/dist/utils/clonePlain.mjs +24 -0
- package/package.json +136 -4
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitSection } from "../composables";
|
|
4
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
5
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
6
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
7
|
+
const props = defineProps({ context: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
} });
|
|
11
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
12
|
+
const url = computed(() => {
|
|
13
|
+
if (props.context?._value) return props.context?._value.indexOf("http") > -1 ? props.context?._value : `https://${props.context?._value}`;
|
|
14
|
+
else return "";
|
|
15
|
+
});
|
|
16
|
+
const title = computed(() => {
|
|
17
|
+
const value = props.context?._value ?? "";
|
|
18
|
+
return props.context?.title ?? value;
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="p-formkit p-output-link">
|
|
24
|
+
<FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix" :on-click="context?.onIconPrefixClicked" :tooltip="context?.iconPrefixTooltip" position="prefix" />
|
|
25
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix" />
|
|
26
|
+
<a
|
|
27
|
+
v-if="context?.value"
|
|
28
|
+
:id="context?.id"
|
|
29
|
+
:style="context?.attrs?.style"
|
|
30
|
+
:class="context?.attrs?.class"
|
|
31
|
+
:href="url"
|
|
32
|
+
:target="context?.attrs?.target ?? '_new'"
|
|
33
|
+
>
|
|
34
|
+
<span>{{ title }}</span>
|
|
35
|
+
</a>
|
|
36
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix" />
|
|
37
|
+
<FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix" :on-click="context?.onIconSuffixClicked" :tooltip="context?.iconSuffixTooltip" position="suffix" />
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitSection } from "../composables";
|
|
4
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
5
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
6
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
7
|
+
const props = defineProps({ context: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
} });
|
|
11
|
+
const listStyle = computed(() => {
|
|
12
|
+
return props.context?.listStyle || "span";
|
|
13
|
+
});
|
|
14
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
15
|
+
const getListValues = computed(() => {
|
|
16
|
+
const values = Array.isArray(props.context?._value) ? props.context._value : [];
|
|
17
|
+
if (props.context?.options && props.context?.optionValue) {
|
|
18
|
+
const key = `${props.context.optionValue}`;
|
|
19
|
+
return values.map((value) => {
|
|
20
|
+
const foundOption = props.context?.options?.find((option) => option[key] === value);
|
|
21
|
+
return foundOption ? foundOption[props.context?.optionLabel] : value;
|
|
22
|
+
});
|
|
23
|
+
} else if (typeof props.context?.convertValue === "function") {
|
|
24
|
+
return props.context.convertValue([...values]);
|
|
25
|
+
}
|
|
26
|
+
return values;
|
|
27
|
+
});
|
|
28
|
+
const dividerClass = computed(() => props.context?.dividerClass || "");
|
|
29
|
+
const itemClass = computed(() => props.context?.itemClass || "");
|
|
30
|
+
const listItemsClass = computed(() => props.context?.attrs?.class || "");
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template>
|
|
34
|
+
<div class="p-formkit p-output-list">
|
|
35
|
+
<FormKitIcon
|
|
36
|
+
v-if="hasPrefixIcon"
|
|
37
|
+
:icon-class="context?.iconPrefix"
|
|
38
|
+
:on-click="context?.onIconPrefixClicked"
|
|
39
|
+
:tooltip="context?.iconPrefixTooltip"
|
|
40
|
+
position="prefix"
|
|
41
|
+
/>
|
|
42
|
+
<FormKitPrefix v-if="hasPrefix && listStyle === 'span'" :prefix="context?.prefix" />
|
|
43
|
+
<span
|
|
44
|
+
v-if="listStyle === 'span'"
|
|
45
|
+
:id="context?.id"
|
|
46
|
+
:style="context?.attrs?.style"
|
|
47
|
+
class="p-output-list-items"
|
|
48
|
+
:class="listItemsClass"
|
|
49
|
+
>
|
|
50
|
+
<template v-for="(value, index) of getListValues" :key="index">
|
|
51
|
+
<span v-if="index !== 0" class="p-output-list-divider" :class="dividerClass">{{
|
|
52
|
+
context?.divider ?? ", "
|
|
53
|
+
}}</span>
|
|
54
|
+
<span class="p-output-list-item" :class="itemClass">{{ value }}</span>
|
|
55
|
+
</template>
|
|
56
|
+
</span>
|
|
57
|
+
<div
|
|
58
|
+
v-if="listStyle === 'div'"
|
|
59
|
+
:id="context?.id"
|
|
60
|
+
:style="context?.attrs?.style"
|
|
61
|
+
class="p-output-list-items"
|
|
62
|
+
:class="listItemsClass"
|
|
63
|
+
>
|
|
64
|
+
<template v-for="(value, index) of getListValues" :key="index">
|
|
65
|
+
<div class="p-output-list-item" :class="itemClass">
|
|
66
|
+
{{ value }}
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
</div>
|
|
70
|
+
<ul
|
|
71
|
+
v-if="listStyle === 'ul'"
|
|
72
|
+
:id="context?.id"
|
|
73
|
+
:style="context?.attrs?.style"
|
|
74
|
+
class="p-output-list-items"
|
|
75
|
+
:class="listItemsClass"
|
|
76
|
+
>
|
|
77
|
+
<li v-for="(value, index) of getListValues" :key="index">
|
|
78
|
+
<span class="p-output-list-item" :class="itemClass">
|
|
79
|
+
{{ value }}
|
|
80
|
+
</span>
|
|
81
|
+
</li>
|
|
82
|
+
</ul>
|
|
83
|
+
<ol
|
|
84
|
+
v-if="listStyle === 'ol'"
|
|
85
|
+
:id="context?.id"
|
|
86
|
+
:style="context?.attrs?.style"
|
|
87
|
+
class="p-output-list-items"
|
|
88
|
+
:class="listItemsClass"
|
|
89
|
+
>
|
|
90
|
+
<li v-for="(value, index) of getListValues" :key="index">
|
|
91
|
+
<span class="p-output-list-item" :class="itemClass">
|
|
92
|
+
{{ value }}
|
|
93
|
+
</span>
|
|
94
|
+
</li>
|
|
95
|
+
</ol>
|
|
96
|
+
<FormKitSuffix v-if="hasSuffix && listStyle === 'span'" :suffix="context?.suffix" />
|
|
97
|
+
<FormKitIcon
|
|
98
|
+
v-if="hasSuffixIcon"
|
|
99
|
+
:icon-class="context?.iconSuffix"
|
|
100
|
+
:on-click="context?.onIconSuffixClicked"
|
|
101
|
+
:tooltip="context?.iconSuffixTooltip"
|
|
102
|
+
position="suffix"
|
|
103
|
+
/>
|
|
104
|
+
</div>
|
|
105
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useFormKitSection } from "../composables";
|
|
5
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
6
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
7
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
8
|
+
const props = defineProps({ context: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
} });
|
|
12
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
13
|
+
const { n } = useI18n();
|
|
14
|
+
const converted = computed(() => {
|
|
15
|
+
const value = props?.context?._value;
|
|
16
|
+
if (value) {
|
|
17
|
+
let result = "";
|
|
18
|
+
const format = props?.context?.attrs?.format ? props?.context?.attrs?.format : "short";
|
|
19
|
+
try {
|
|
20
|
+
result = n(value, format);
|
|
21
|
+
}
|
|
22
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
23
|
+
catch (e) {
|
|
24
|
+
try {
|
|
25
|
+
result = n(+value, format);
|
|
26
|
+
}
|
|
27
|
+
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
28
|
+
catch (e) {}
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
} else {
|
|
32
|
+
return "";
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<div class="p-formkit p-output-number">
|
|
39
|
+
<FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix" :on-click="context?.onIconPrefixClicked" :tooltip="context?.iconPrefixTooltip" position="prefix" />
|
|
40
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix" />
|
|
41
|
+
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
42
|
+
{{ converted }}
|
|
43
|
+
</span>
|
|
44
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix" />
|
|
45
|
+
<FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix" :on-click="context?.onIconSuffixClicked" :tooltip="context?.iconSuffixTooltip" position="suffix" />
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitSection } from "../composables";
|
|
4
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
5
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
6
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
7
|
+
const props = defineProps({ context: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
} });
|
|
11
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
12
|
+
const reference = computed(() => {
|
|
13
|
+
const value = props.context?._value ?? "";
|
|
14
|
+
let result = props.context?.reference ? `${props.context?.reference}` : "reference-must-be-set";
|
|
15
|
+
if (!props.context?.internal && !result.includes("http")) result = `https://${result}`;
|
|
16
|
+
return result.replace(/\{\{.*\}\}/, value);
|
|
17
|
+
});
|
|
18
|
+
const title = computed(() => {
|
|
19
|
+
const value = props.context?._value ?? "";
|
|
20
|
+
const result = props.context?.title ?? value;
|
|
21
|
+
return `${result}`.replace(/\{\{.*\}\}/, value);
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="p-formkit p-output-reference">
|
|
27
|
+
<FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix" :on-click="context?.onIconPrefixClicked" :tooltip="context?.iconPrefixTooltip" position="prefix" />
|
|
28
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix" />
|
|
29
|
+
<component
|
|
30
|
+
:is="context?.linkComponentName ? context?.linkComponentName : 'RouterLink'"
|
|
31
|
+
v-if="context?.internal"
|
|
32
|
+
:style="context?.attrs?.style"
|
|
33
|
+
:class="context?.attrs?.class"
|
|
34
|
+
:to="reference"
|
|
35
|
+
v-bind="context?.attrs"
|
|
36
|
+
>
|
|
37
|
+
{{ title }}
|
|
38
|
+
</component>
|
|
39
|
+
<a
|
|
40
|
+
v-else
|
|
41
|
+
:id="context?.id"
|
|
42
|
+
:style="context?.attrs?.style"
|
|
43
|
+
:class="context?.attrs?.class"
|
|
44
|
+
:href="reference"
|
|
45
|
+
:target="context?.attrs?.target ?? '_new'"
|
|
46
|
+
>
|
|
47
|
+
{{ title }}
|
|
48
|
+
</a>
|
|
49
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix" />
|
|
50
|
+
<FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix" :on-click="context?.onIconSuffixClicked" :tooltip="context?.iconSuffixTooltip" position="suffix" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useFormKitSection } from "../composables";
|
|
5
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
6
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
7
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
8
|
+
const props = defineProps({ context: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
} });
|
|
12
|
+
const { t } = useI18n();
|
|
13
|
+
const textValue = computed(() => {
|
|
14
|
+
const value = props.context?._value;
|
|
15
|
+
let result = "";
|
|
16
|
+
if (value) {
|
|
17
|
+
if (props.context?.isTranslationKey) {
|
|
18
|
+
result = t(value);
|
|
19
|
+
} else if (typeof props.context?.convertValue === "function") {
|
|
20
|
+
result = props.context?.convertValue(value);
|
|
21
|
+
} else {
|
|
22
|
+
result = value;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
// Apply maxLength truncation if specified
|
|
26
|
+
const maxLength = props.context?.maxLength;
|
|
27
|
+
if (result && maxLength && !props.context?.html && result.length > maxLength) {
|
|
28
|
+
// Try to truncate at word boundary
|
|
29
|
+
let truncated = result.substring(0, maxLength);
|
|
30
|
+
const lastSpaceIndex = truncated.lastIndexOf(" ");
|
|
31
|
+
// Only truncate at word boundary if there's a space, and it's not too far back
|
|
32
|
+
// (at least 80% of maxLength to avoid cutting too much)
|
|
33
|
+
if (lastSpaceIndex > maxLength * .8) {
|
|
34
|
+
truncated = truncated.substring(0, lastSpaceIndex);
|
|
35
|
+
}
|
|
36
|
+
result = `${truncated}...`;
|
|
37
|
+
}
|
|
38
|
+
return result;
|
|
39
|
+
});
|
|
40
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<template>
|
|
44
|
+
<div class="p-formkit p-output-text">
|
|
45
|
+
<FormKitIcon v-if="hasPrefixIcon" :icon-class="context?.iconPrefix" :on-click="context?.onIconPrefixClicked" :tooltip="context?.iconPrefixTooltip" position="prefix" />
|
|
46
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix" />
|
|
47
|
+
<span v-if="context?.html" :id="context?.id" :class="context?.attrs?.class" :style="context?.attrs?.style" v-html="textValue" />
|
|
48
|
+
<span v-else :id="context?.id" :class="context?.attrs?.class" :style="context?.attrs?.style" v-text="textValue" />
|
|
49
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix" />
|
|
50
|
+
<FormKitIcon v-if="hasSuffixIcon" :icon-class="context?.iconSuffix" :on-click="context?.onIconSuffixClicked" :tooltip="context?.iconSuffixTooltip" position="suffix" />
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<Password
|
|
13
|
+
v-model="modelValue"
|
|
14
|
+
v-bind="context?.attrs"
|
|
15
|
+
:input-id="context.id"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:input-style="context?.attrs.style"
|
|
19
|
+
:input-class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:size="context?.size ?? undefined"
|
|
25
|
+
:placeholder="context.placeholder"
|
|
26
|
+
:medium-regex="context.mediumRegex ?? '^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})'"
|
|
27
|
+
:strong-regex="context.strongRegex ?? '^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{8,})'"
|
|
28
|
+
:prompt-label="context.promptLabel"
|
|
29
|
+
:weak-label="context.weakLabel"
|
|
30
|
+
:medium-label="context.mediumLabel"
|
|
31
|
+
:strong-label="context.strongLabel"
|
|
32
|
+
:mask-icon="context.maskIcon"
|
|
33
|
+
:unmask-icon="context.unmaskIcon"
|
|
34
|
+
:feedback="context.feedback ?? false"
|
|
35
|
+
:toggle-mask="context.toggleMask ?? false"
|
|
36
|
+
:pt="context.pt"
|
|
37
|
+
:pt-options="context.ptOptions"
|
|
38
|
+
:unstyled="unstyled"
|
|
39
|
+
@input="handleInput"
|
|
40
|
+
@blur="handleBlur"
|
|
41
|
+
>
|
|
42
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
43
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
44
|
+
</template>
|
|
45
|
+
</Password>
|
|
46
|
+
</div>
|
|
47
|
+
</template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitInput } from "../composables";
|
|
4
|
+
const props = defineProps({ context: {
|
|
5
|
+
type: Object,
|
|
6
|
+
required: true
|
|
7
|
+
} });
|
|
8
|
+
const { unstyled, isInvalid, handleChange, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
9
|
+
const optionsClass = computed(() => props.context?.optionsClass ?? "");
|
|
10
|
+
const optionClass = computed(() => props.context?.optionClass ?? "");
|
|
11
|
+
const labelClass = computed(() => props.context?.labelClass ?? "");
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="p-formkit p-formkit-options" :class="optionsClass">
|
|
16
|
+
<div v-for="option in context.options" :key="option.value" class="p-formkit-option" :class="optionClass">
|
|
17
|
+
<RadioButton
|
|
18
|
+
:id="context.id"
|
|
19
|
+
v-model="modelValue"
|
|
20
|
+
v-bind="context?.attrs"
|
|
21
|
+
:disabled="!!context?.disabled"
|
|
22
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
23
|
+
:name="context?.attrs.name"
|
|
24
|
+
:value="option.value"
|
|
25
|
+
:input-style="context?.attrs.style"
|
|
26
|
+
:input-class="context?.attrs?.class"
|
|
27
|
+
:invalid="isInvalid"
|
|
28
|
+
:size="context?.size ?? undefined"
|
|
29
|
+
:pt="context.pt"
|
|
30
|
+
:pt-options="context.ptOptions"
|
|
31
|
+
:unstyled="unstyled"
|
|
32
|
+
@click="handleChange"
|
|
33
|
+
@change="handleChange"
|
|
34
|
+
@blur="handleBlur"
|
|
35
|
+
/>
|
|
36
|
+
<label :for="option.value" :class="labelClass">{{ option.label }}</label>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</template>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<Rating
|
|
13
|
+
:id="context.id"
|
|
14
|
+
v-model="modelValue"
|
|
15
|
+
v-bind="context?.attrs"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:style="context?.attrs.style"
|
|
19
|
+
:class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:stars="context.stars ?? 5"
|
|
25
|
+
:on-icon="context.onIcon"
|
|
26
|
+
:off-icon="context.offIcon"
|
|
27
|
+
:pt="context.pt"
|
|
28
|
+
:pt-options="context.ptOptions"
|
|
29
|
+
:unstyled="unstyled"
|
|
30
|
+
@change="handleInput"
|
|
31
|
+
@blur="handleBlur"
|
|
32
|
+
>
|
|
33
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
34
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
35
|
+
</template>
|
|
36
|
+
</Rating>
|
|
37
|
+
</div>
|
|
38
|
+
</template>
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { validSlotNames, unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<Select
|
|
13
|
+
v-model="modelValue"
|
|
14
|
+
v-bind="context?.attrs"
|
|
15
|
+
:input-id="context.id"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:style="context?.attrs.style"
|
|
19
|
+
:class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:input-style="context?.attrs.style"
|
|
22
|
+
:input-class="context?.attrs?.class"
|
|
23
|
+
:input-props="context?.attrs.inputProps"
|
|
24
|
+
:tabindex="context?.attrs.tabindex"
|
|
25
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
26
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
27
|
+
:size="context?.size ?? undefined"
|
|
28
|
+
:options="context.options"
|
|
29
|
+
:option-label="context.optionLabel"
|
|
30
|
+
:option-value="context.optionValue"
|
|
31
|
+
:option-disabled="context.optionDisabled"
|
|
32
|
+
:option-group-label="context.optionGroupLabel"
|
|
33
|
+
:option-group-children="context.optionGroupChildren"
|
|
34
|
+
:scroll-height="context.scrollHeight"
|
|
35
|
+
:filter="context.filter ?? false"
|
|
36
|
+
:filter-placeholder="context.filterPlaceholder"
|
|
37
|
+
:filter-locale="context.filterLocale"
|
|
38
|
+
:filter-match-mode="context.filterMatchMode"
|
|
39
|
+
:fitler-fields="context.filterFields"
|
|
40
|
+
:filter-input-props="context.filterInputProps"
|
|
41
|
+
:editable="context.editable"
|
|
42
|
+
:placeholder="context.placeholder"
|
|
43
|
+
:data-key="context.dataKey"
|
|
44
|
+
:show-clear="context.showClear ?? false"
|
|
45
|
+
:overlay-style="context.overlayStyle"
|
|
46
|
+
:overlay-class="context.overlayClass"
|
|
47
|
+
:panel-props="context.panelProps"
|
|
48
|
+
:append-to="context.appendTo"
|
|
49
|
+
:reset-filter-on-hide="context.resetFilterOnHide"
|
|
50
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
51
|
+
:auto-option-focus="context.autoOptionFocus"
|
|
52
|
+
:select-on-focus="context.selectOnFocus"
|
|
53
|
+
:filter-message="context.filterMessage"
|
|
54
|
+
:selection-message="context.selectionMessage"
|
|
55
|
+
:empty-selection-message="context.emptySelectionMessage"
|
|
56
|
+
:empty-filter-message="context.emptyFilterMessage"
|
|
57
|
+
:empty-message="context.emptyMessage"
|
|
58
|
+
:pt="context.pt"
|
|
59
|
+
:pt-options="context.ptOptions"
|
|
60
|
+
:unstyled="unstyled"
|
|
61
|
+
@change="handleInput"
|
|
62
|
+
@blur="handleBlur"
|
|
63
|
+
>
|
|
64
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
65
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
66
|
+
</template>
|
|
67
|
+
</Select>
|
|
68
|
+
</div>
|
|
69
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<SelectButton
|
|
13
|
+
:id="context.id"
|
|
14
|
+
v-model="modelValue"
|
|
15
|
+
v-bind="context?.attrs"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:style="context?.attrs.style"
|
|
19
|
+
:class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:size="context?.size ?? undefined"
|
|
25
|
+
:options="context.options"
|
|
26
|
+
:option-label="context.optionLabel"
|
|
27
|
+
:option-value="context.optionValue"
|
|
28
|
+
:option-disabled="context.optionDisabled"
|
|
29
|
+
:multiple="context.multiple ?? false"
|
|
30
|
+
:data-key="context.dataKey"
|
|
31
|
+
:pt="context.pt"
|
|
32
|
+
:pt-options="context.ptOptions"
|
|
33
|
+
:unstyled="unstyled"
|
|
34
|
+
@change="handleChange"
|
|
35
|
+
@blur="handleBlur"
|
|
36
|
+
>
|
|
37
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
38
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
39
|
+
</template>
|
|
40
|
+
</SelectButton>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { unstyled, isInvalid, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
function handleInput(e) {
|
|
9
|
+
props.context?.node.input(e);
|
|
10
|
+
props.context?.handlers.blur(e);
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<div class="p-formkit">
|
|
16
|
+
<Slider
|
|
17
|
+
:id="context.id"
|
|
18
|
+
v-model="modelValue"
|
|
19
|
+
v-bind="context?.attrs"
|
|
20
|
+
:disabled="!!context?.disabled"
|
|
21
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
22
|
+
:style="context?.attrs.style"
|
|
23
|
+
:class="context?.attrs?.class"
|
|
24
|
+
:invalid="isInvalid"
|
|
25
|
+
:tabindex="context?.attrs.tabindex"
|
|
26
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
27
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
28
|
+
:min="context.min ?? 0"
|
|
29
|
+
:max="context.max ?? 100"
|
|
30
|
+
:step="context.step ?? undefined"
|
|
31
|
+
:range="context.range ?? false"
|
|
32
|
+
:orientation="context.orientation ?? 'horizontal'"
|
|
33
|
+
:pt="context.pt"
|
|
34
|
+
:pt-options="context.ptOptions"
|
|
35
|
+
:unstyled="unstyled"
|
|
36
|
+
@change="handleInput"
|
|
37
|
+
@blur="handleBlur"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { unstyled, isInvalid, handleInput, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<Textarea
|
|
13
|
+
:id="context.id"
|
|
14
|
+
v-model="modelValue"
|
|
15
|
+
v-bind="context?.attrs"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:style="context?.attrs.style"
|
|
19
|
+
:class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:size="context?.size ?? undefined"
|
|
25
|
+
:placeholder="context.placeholder"
|
|
26
|
+
:rows="context.rows ?? 3"
|
|
27
|
+
:auto-resize="context.autoResize ?? false"
|
|
28
|
+
:pt="context.pt"
|
|
29
|
+
:pt-options="context.ptOptions"
|
|
30
|
+
:unstyled="unstyled"
|
|
31
|
+
@input="handleInput"
|
|
32
|
+
@blur="handleBlur"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitInput } from "../composables";
|
|
3
|
+
const props = defineProps({ context: {
|
|
4
|
+
type: Object,
|
|
5
|
+
required: true
|
|
6
|
+
} });
|
|
7
|
+
const { validSlotNames, unstyled, isInvalid, handleChange, handleBlur, modelValue } = useFormKitInput(props.context);
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="p-formkit">
|
|
12
|
+
<ToggleButton
|
|
13
|
+
v-model="modelValue"
|
|
14
|
+
v-bind="context?.attrs"
|
|
15
|
+
:input-id="context.id"
|
|
16
|
+
:disabled="!!context?.disabled"
|
|
17
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
18
|
+
:input-style="context?.attrs.style"
|
|
19
|
+
:input-class="context?.attrs?.class"
|
|
20
|
+
:invalid="isInvalid"
|
|
21
|
+
:tabindex="context?.attrs.tabindex"
|
|
22
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
23
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
24
|
+
:size="context?.size ?? undefined"
|
|
25
|
+
:on-label="context.onLabel ?? 'Yes'"
|
|
26
|
+
:off-label="context.offLabel ?? 'No'"
|
|
27
|
+
:on-icon="context.onIcon"
|
|
28
|
+
:off-icon="context.offIcon"
|
|
29
|
+
:pt="context.pt"
|
|
30
|
+
:pt-options="context.ptOptions"
|
|
31
|
+
:unstyled="unstyled"
|
|
32
|
+
@change="handleChange"
|
|
33
|
+
@blur="handleBlur"
|
|
34
|
+
>
|
|
35
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
36
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
37
|
+
</template>
|
|
38
|
+
</ToggleButton>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|