@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,75 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { watch } 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, modelValue } = useFormKitInput(props.context);
|
|
11
|
+
function handleBlur(e) {
|
|
12
|
+
props.context?.handlers.blur(e.originalEvent);
|
|
13
|
+
}
|
|
14
|
+
function handleInput(_) {
|
|
15
|
+
if (typeof _.value === "number" || _.value === null) props.context?.node.input(_.value);
|
|
16
|
+
}
|
|
17
|
+
function roundToDecimals(value, decimals) {
|
|
18
|
+
const factor = 10 ** decimals;
|
|
19
|
+
return Math.round(value * factor) / factor;
|
|
20
|
+
}
|
|
21
|
+
watch(
|
|
22
|
+
() => props.context._value,
|
|
23
|
+
(newValue) => {
|
|
24
|
+
if (newValue !== props.context.node.value && typeof newValue === "number") {
|
|
25
|
+
if (props.context.maxFractionDigits && props.context.maxFractionDigits > 0) {
|
|
26
|
+
props.context?.node.input(roundToDecimals(newValue, props.context.maxFractionDigits));
|
|
27
|
+
} else {
|
|
28
|
+
props.context?.node.input(newValue);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
);
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template>
|
|
36
|
+
<div class="p-formkit">
|
|
37
|
+
<InputNumber
|
|
38
|
+
v-model="modelValue"
|
|
39
|
+
v-bind="context?.attrs"
|
|
40
|
+
:input-id="context.id"
|
|
41
|
+
:disabled="!!context?.disabled"
|
|
42
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
43
|
+
:input-style="context?.attrs.style"
|
|
44
|
+
:input-class="context?.attrs?.class"
|
|
45
|
+
:invalid="isInvalid"
|
|
46
|
+
:tabindex="context?.attrs.tabindex"
|
|
47
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
48
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
49
|
+
:size="context?.size ?? undefined"
|
|
50
|
+
:placeholder="context.placeholder"
|
|
51
|
+
:use-grouping="context.useGrouping ?? true"
|
|
52
|
+
:min="context.min ?? undefined"
|
|
53
|
+
:max="context.max ?? undefined"
|
|
54
|
+
:min-fraction-digits="context.minFractionDigits ?? undefined"
|
|
55
|
+
:max-fraction-digits="context.maxFractionDigits ?? undefined"
|
|
56
|
+
:locale="context.locale ?? undefined"
|
|
57
|
+
:mode="context.mode ?? undefined"
|
|
58
|
+
:currency="context.currency ?? undefined"
|
|
59
|
+
:prefix="context.prefix ?? undefined"
|
|
60
|
+
:suffix="context.suffix ?? undefined"
|
|
61
|
+
:show-buttons="context.showButtons ?? undefined"
|
|
62
|
+
:button-layout="context.buttonLayout ?? 'stacked'"
|
|
63
|
+
:step="context.step ?? undefined"
|
|
64
|
+
:pt="context.pt"
|
|
65
|
+
:pt-options="context.ptOptions"
|
|
66
|
+
:unstyled="unstyled"
|
|
67
|
+
@input="handleInput"
|
|
68
|
+
@blur="handleBlur"
|
|
69
|
+
>
|
|
70
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
71
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
72
|
+
</template>
|
|
73
|
+
</InputNumber>
|
|
74
|
+
</div>
|
|
75
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
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, handleBlur, handleInput, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="p-formkit">
|
|
14
|
+
<InputOtp
|
|
15
|
+
:id="context.id"
|
|
16
|
+
v-model="modelValue"
|
|
17
|
+
v-bind="context?.attrs"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
20
|
+
:style="context?.attrs.style"
|
|
21
|
+
:class="context?.attrs?.class"
|
|
22
|
+
:invalid="isInvalid"
|
|
23
|
+
:tabindex="context?.attrs.tabindex"
|
|
24
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
25
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
26
|
+
:size="context?.size ?? undefined"
|
|
27
|
+
:length="context.length"
|
|
28
|
+
:variant="context.variant"
|
|
29
|
+
:mask="context.mask"
|
|
30
|
+
:integer-only="context.integerOnly"
|
|
31
|
+
:pt="context.pt"
|
|
32
|
+
:pt-options="context.ptOptions"
|
|
33
|
+
:unstyled="unstyled"
|
|
34
|
+
@change="handleInput"
|
|
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
|
+
</InputOtp>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,65 @@
|
|
|
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
|
+
<InputText
|
|
20
|
+
:id="context.id"
|
|
21
|
+
v-model="modelValue"
|
|
22
|
+
v-bind="context?.attrs"
|
|
23
|
+
:type="context?.attrs?.inputType ?? 'text'"
|
|
24
|
+
:disabled="!!context?.disabled"
|
|
25
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
26
|
+
:style="context?.attrs?.style"
|
|
27
|
+
:class="context?.attrs?.class"
|
|
28
|
+
:invalid="isInvalid"
|
|
29
|
+
:tabindex="context?.attrs.tabindex"
|
|
30
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
31
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
32
|
+
:size="context?.size ?? undefined"
|
|
33
|
+
:placeholder="context.placeholder"
|
|
34
|
+
:pt="context.pt"
|
|
35
|
+
:pt-options="context.ptOptions"
|
|
36
|
+
:unstyled="unstyled"
|
|
37
|
+
@input="handleInput"
|
|
38
|
+
@blur="handleBlur"
|
|
39
|
+
/>
|
|
40
|
+
<InputIcon v-if="hasSuffixIcon" :class="context?.iconSuffix" />
|
|
41
|
+
</IconField>
|
|
42
|
+
<InputText
|
|
43
|
+
v-if="!hasPrefixIcon && !hasSuffixIcon"
|
|
44
|
+
:id="context.id"
|
|
45
|
+
v-model="modelValue"
|
|
46
|
+
v-bind="context?.attrs"
|
|
47
|
+
:type="context?.inputType ?? 'text'"
|
|
48
|
+
:disabled="!!context?.disabled"
|
|
49
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
50
|
+
:style="context?.attrs.style"
|
|
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
|
+
:placeholder="context.placeholder"
|
|
58
|
+
:pt="context.pt"
|
|
59
|
+
:pt-options="context.ptOptions"
|
|
60
|
+
:unstyled="unstyled"
|
|
61
|
+
@input="handleInput"
|
|
62
|
+
@blur="handleBlur"
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
</template>
|
|
@@ -0,0 +1,50 @@
|
|
|
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, isInvalid, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
function handleInput(e) {
|
|
11
|
+
props.context?.node.input(e);
|
|
12
|
+
props.context?.handlers.blur(e);
|
|
13
|
+
}
|
|
14
|
+
function updateValue(n) {
|
|
15
|
+
props.context?.node.input(n);
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="p-formkit">
|
|
21
|
+
<Knob
|
|
22
|
+
:id="context.id"
|
|
23
|
+
v-model="modelValue"
|
|
24
|
+
v-bind="context?.attrs"
|
|
25
|
+
:disabled="!!context?.disabled"
|
|
26
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
27
|
+
:style="context?.attrs.style"
|
|
28
|
+
:class="context?.attrs?.class"
|
|
29
|
+
:invalid="isInvalid"
|
|
30
|
+
:tabindex="context?.attrs.tabindex"
|
|
31
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
32
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
33
|
+
:min="context.min ?? 0"
|
|
34
|
+
:max="context.max ?? 100"
|
|
35
|
+
:step="context.step ?? undefined"
|
|
36
|
+
:size="context.size ?? 100"
|
|
37
|
+
:stroke-width="context.strokeWidth ?? 14"
|
|
38
|
+
:show-value="context.showValue ?? true"
|
|
39
|
+
:value-color="context.valueColor ?? undefined"
|
|
40
|
+
:range-color="context.rangeColor ?? undefined"
|
|
41
|
+
:text-color="context.textColor ?? undefined"
|
|
42
|
+
:value-template="context.valueTemplate ?? undefined"
|
|
43
|
+
:pt="context.pt"
|
|
44
|
+
:pt-options="context.ptOptions"
|
|
45
|
+
:unstyled="unstyled"
|
|
46
|
+
@change="handleInput"
|
|
47
|
+
@update:model-value="updateValue"
|
|
48
|
+
/>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
<Listbox
|
|
15
|
+
:id="context.id"
|
|
16
|
+
v-model="modelValue"
|
|
17
|
+
v-bind="context?.attrs"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
20
|
+
:list-style="context?.attrs.style"
|
|
21
|
+
:class="context?.attrs?.class"
|
|
22
|
+
:invalid="isInvalid"
|
|
23
|
+
:tabindex="context?.attrs.tabindex"
|
|
24
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
25
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
26
|
+
:options="context?.options"
|
|
27
|
+
:option-label="context.optionLabel"
|
|
28
|
+
:option-value="context.optionValue"
|
|
29
|
+
:option-disabled="context.optionDisabled"
|
|
30
|
+
:option-group-label="context.optionGroupLabel"
|
|
31
|
+
:option-group-children="context.optionGroupChildren"
|
|
32
|
+
:multiple="context.multiple ?? false"
|
|
33
|
+
:filter="context.filter ?? false"
|
|
34
|
+
:filter-icon="context.filterIcon"
|
|
35
|
+
:filter-placeholder="context.filterPlaceholder"
|
|
36
|
+
:filter-locale="context.filterLocale"
|
|
37
|
+
:filter-match-mode="context.filterMatchMode"
|
|
38
|
+
:auto-option-focus="context.autoOptionFocus ?? true"
|
|
39
|
+
:select-on-focus="context.selectOnFocus ?? false"
|
|
40
|
+
:data-key="context.dataKey"
|
|
41
|
+
:meta-key-selection="context.metaKeySelection ?? false"
|
|
42
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
43
|
+
:pt="context.pt"
|
|
44
|
+
:pt-options="context.ptOptions"
|
|
45
|
+
:unstyled="unstyled"
|
|
46
|
+
@change="handleInput"
|
|
47
|
+
@blur="handleBlur"
|
|
48
|
+
>
|
|
49
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
50
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
51
|
+
</template>
|
|
52
|
+
</Listbox>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
@@ -0,0 +1,70 @@
|
|
|
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, handleBlur, handleChange, modelValue } = useFormKitInput(props.context);
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<div class="p-formkit">
|
|
14
|
+
<MultiSelect
|
|
15
|
+
v-model="modelValue"
|
|
16
|
+
v-bind="context?.attrs"
|
|
17
|
+
:input-id="context.id"
|
|
18
|
+
:disabled="!!context?.disabled"
|
|
19
|
+
:readonly="context?.attrs.readonly ?? false"
|
|
20
|
+
:list-style="context?.attrs.style"
|
|
21
|
+
:class="context?.attrs?.class"
|
|
22
|
+
:invalid="isInvalid"
|
|
23
|
+
:tabindex="context?.attrs.tabindex"
|
|
24
|
+
:aria-label="context?.attrs.ariaLabel"
|
|
25
|
+
:aria-labelledby="context?.attrs.ariaLabelledby"
|
|
26
|
+
:size="context?.size ?? undefined"
|
|
27
|
+
:placeholder="context.placeholder"
|
|
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
|
+
:data-key="context.dataKey"
|
|
36
|
+
:filter="context.filter ?? false"
|
|
37
|
+
:filter-placeholder="context.filterPlaceholder"
|
|
38
|
+
:filter-locale="context.filterLocale"
|
|
39
|
+
:filter-match-mode="context.filterMatchMode"
|
|
40
|
+
:fitler-fields="context.filterFields"
|
|
41
|
+
:append-to="context.appendTo"
|
|
42
|
+
:close-icon="context.closeIcon"
|
|
43
|
+
:display="context.display"
|
|
44
|
+
:max-selected-labels="context.maxSelectedLabels"
|
|
45
|
+
:selected-items-label="context.selectedItemsLabel"
|
|
46
|
+
:selection-limit="context.selectionLimit"
|
|
47
|
+
:show-toggle-all="context.showToggleAll"
|
|
48
|
+
:loading="context.loading"
|
|
49
|
+
:select-all="context.selectAll"
|
|
50
|
+
:reset-filter-on-hide="context.resetFilterOnHide"
|
|
51
|
+
:virtual-scroller-options="context.virtualScrollerOptions"
|
|
52
|
+
:auto-option-focus="context.autoOptionFocus"
|
|
53
|
+
:auto-filter-focus="context.autoFilterFocus"
|
|
54
|
+
:filter-message="context.filterMessage"
|
|
55
|
+
:selection-message="context.selectionMessage"
|
|
56
|
+
:empty-selection-message="context.emptySelectionMessage"
|
|
57
|
+
:empty-filter-message="context.emptyFilterMessage"
|
|
58
|
+
:empty-message="context.emptyMessage"
|
|
59
|
+
:pt="context.pt"
|
|
60
|
+
:pt-options="context.ptOptions"
|
|
61
|
+
:unstyled="unstyled"
|
|
62
|
+
@change="handleChange"
|
|
63
|
+
@blur="handleBlur"
|
|
64
|
+
>
|
|
65
|
+
<template v-for="slotName in validSlotNames" :key="slotName" #[slotName]="slotProps">
|
|
66
|
+
<component :is="context?.slots[slotName]" v-bind="{ ...context, ...slotProps }" />
|
|
67
|
+
</template>
|
|
68
|
+
</MultiSelect>
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useFormKitSection } from "../composables/index.ts";
|
|
5
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
6
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
7
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
context: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
15
|
+
const { t } = useI18n();
|
|
16
|
+
const translated = computed(() => {
|
|
17
|
+
if (props.context?._value) return props.context?.trueValue ?? t("formkit.prime.true", "true");
|
|
18
|
+
else return props.context?.falseValue ?? t("formkit.prime.false", "false");
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<div class="p-formkit p-output-boolean">
|
|
24
|
+
<FormKitIcon
|
|
25
|
+
v-if="hasPrefixIcon"
|
|
26
|
+
:icon-class="context?.iconPrefix as string"
|
|
27
|
+
:on-click="context?.onIconPrefixClicked as () => void"
|
|
28
|
+
position="prefix"
|
|
29
|
+
/>
|
|
30
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
|
|
31
|
+
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
32
|
+
{{ translated }}
|
|
33
|
+
</span>
|
|
34
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
|
|
35
|
+
<FormKitIcon
|
|
36
|
+
v-if="hasSuffixIcon"
|
|
37
|
+
:icon-class="context?.iconSuffix as string"
|
|
38
|
+
:on-click="context?.onIconSuffixClicked as () => void"
|
|
39
|
+
position="suffix"
|
|
40
|
+
/>
|
|
41
|
+
</div>
|
|
42
|
+
</template>
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useI18n } from "vue-i18n";
|
|
4
|
+
import { useFormKitSection } from "../composables/index.ts";
|
|
5
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
6
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
7
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
context: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
15
|
+
const { d } = useI18n();
|
|
16
|
+
const converted = computed(() => {
|
|
17
|
+
if (props?.context?._value) {
|
|
18
|
+
let result = "";
|
|
19
|
+
const format = props?.context?.attrs?.value?.format ? props?.context?.attrs.value.format : "short";
|
|
20
|
+
try {
|
|
21
|
+
result = d(props?.context?._value, format);
|
|
22
|
+
} catch (e) {
|
|
23
|
+
}
|
|
24
|
+
return result;
|
|
25
|
+
} else {
|
|
26
|
+
return "";
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<div class="p-formkit p-output-date">
|
|
33
|
+
<FormKitIcon
|
|
34
|
+
v-if="hasPrefixIcon"
|
|
35
|
+
:icon-class="context?.iconPrefix as string"
|
|
36
|
+
:on-click="context?.onIconPrefixClicked as () => void"
|
|
37
|
+
position="prefix"
|
|
38
|
+
/>
|
|
39
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
|
|
40
|
+
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
41
|
+
{{ converted }}
|
|
42
|
+
</span>
|
|
43
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
|
|
44
|
+
<FormKitIcon
|
|
45
|
+
v-if="hasSuffixIcon"
|
|
46
|
+
:icon-class="context?.iconSuffix as string"
|
|
47
|
+
:on-click="context?.onIconSuffixClicked as () => void"
|
|
48
|
+
position="suffix"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { useFormKitSection, useOutputDuration } from "../composables/index.ts";
|
|
3
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
4
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
5
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
context: {
|
|
8
|
+
type: Object,
|
|
9
|
+
required: true
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
13
|
+
const { formattedDuration } = useOutputDuration();
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div class="p-formkit p-output-duration">
|
|
18
|
+
<FormKitIcon
|
|
19
|
+
v-if="hasPrefixIcon"
|
|
20
|
+
:icon-class="context?.iconPrefix as string"
|
|
21
|
+
:on-click="context?.onIconPrefixClicked as () => void"
|
|
22
|
+
position="prefix"
|
|
23
|
+
/>
|
|
24
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
|
|
25
|
+
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
26
|
+
{{ formattedDuration(context?._value) }}
|
|
27
|
+
</span>
|
|
28
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
|
|
29
|
+
<FormKitIcon
|
|
30
|
+
v-if="hasSuffixIcon"
|
|
31
|
+
:icon-class="context?.iconSuffix as string"
|
|
32
|
+
:on-click="context?.onIconSuffixClicked as () => void"
|
|
33
|
+
position="suffix"
|
|
34
|
+
/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitSection } from "../composables/index.ts";
|
|
4
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
5
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
6
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
7
|
+
const props = defineProps({
|
|
8
|
+
context: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: true
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
14
|
+
const url = computed(() => {
|
|
15
|
+
if (props.context?._value)
|
|
16
|
+
return props.context?._value.indexOf("http") > -1 ? props.context?._value : `https://${props.context?._value}`;
|
|
17
|
+
else return "";
|
|
18
|
+
});
|
|
19
|
+
const title = computed(() => {
|
|
20
|
+
const value = props.context?._value ?? "";
|
|
21
|
+
return props.context?.title ?? value;
|
|
22
|
+
});
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<div class="p-formkit p-output-link">
|
|
27
|
+
<FormKitIcon
|
|
28
|
+
v-if="hasPrefixIcon"
|
|
29
|
+
:icon-class="context?.iconPrefix as string"
|
|
30
|
+
:on-click="context?.onIconPrefixClicked as () => void"
|
|
31
|
+
position="prefix"
|
|
32
|
+
/>
|
|
33
|
+
<FormKitPrefix v-if="hasPrefix" :prefix="context?.prefix as string" />
|
|
34
|
+
<a
|
|
35
|
+
v-if="context?.value"
|
|
36
|
+
:id="context?.id"
|
|
37
|
+
:style="context?.attrs?.style"
|
|
38
|
+
:class="context?.attrs?.class"
|
|
39
|
+
:href="url"
|
|
40
|
+
:target="context?.attrs?.target ?? '_new'"
|
|
41
|
+
>
|
|
42
|
+
<span>{{ title }}</span>
|
|
43
|
+
</a>
|
|
44
|
+
<FormKitSuffix v-if="hasSuffix" :suffix="context?.suffix as string" />
|
|
45
|
+
<FormKitIcon
|
|
46
|
+
v-if="hasSuffixIcon"
|
|
47
|
+
:icon-class="context?.iconSuffix as string"
|
|
48
|
+
:on-click="context?.onIconSuffixClicked as () => void"
|
|
49
|
+
position="suffix"
|
|
50
|
+
/>
|
|
51
|
+
</div>
|
|
52
|
+
</template>
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useFormKitSection } from "../composables/index.ts";
|
|
4
|
+
import FormKitIcon from "./FormKitIcon.vue";
|
|
5
|
+
import FormKitPrefix from "./FormKitPrefix.vue";
|
|
6
|
+
import FormKitSuffix from "./FormKitSuffix.vue";
|
|
7
|
+
import { options } from "@formkit/inputs";
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
context: {
|
|
10
|
+
type: Object,
|
|
11
|
+
required: true
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
const listStyle = computed(() => {
|
|
15
|
+
return props.context?.listStyle || "span";
|
|
16
|
+
});
|
|
17
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context);
|
|
18
|
+
const getListValues = computed(() => {
|
|
19
|
+
const values = Array.isArray(props.context?._value) ? props.context._value : [];
|
|
20
|
+
if (props.context?.options && props.context?.optionValue) {
|
|
21
|
+
const key = "" + props.context.optionValue;
|
|
22
|
+
return values.map((value) => {
|
|
23
|
+
const foundOption = props.context?.options?.find((option) => option[key] === value);
|
|
24
|
+
return foundOption ? foundOption[props.context?.optionLabel] : value;
|
|
25
|
+
});
|
|
26
|
+
} else if (typeof props.context?.convertValue === "function") {
|
|
27
|
+
return props.context.convertValue([...values]);
|
|
28
|
+
}
|
|
29
|
+
return values;
|
|
30
|
+
});
|
|
31
|
+
const dividerClass = computed(() => props.context?.dividerClass || "");
|
|
32
|
+
const itemClass = computed(() => props.context?.itemClass || "");
|
|
33
|
+
const listItemsClass = computed(() => props.context?.attrs?.class || "");
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template>
|
|
37
|
+
<div class="p-formkit p-output-list">
|
|
38
|
+
<FormKitIcon
|
|
39
|
+
v-if="hasPrefixIcon"
|
|
40
|
+
:icon-class="context?.iconPrefix as string"
|
|
41
|
+
:on-click="context?.onIconPrefixClicked as () => void"
|
|
42
|
+
position="prefix"
|
|
43
|
+
/>
|
|
44
|
+
<FormKitPrefix v-if="hasPrefix && listStyle === 'span'" :prefix="context?.prefix as string" />
|
|
45
|
+
<span
|
|
46
|
+
v-if="listStyle === 'span'"
|
|
47
|
+
:id="context?.id"
|
|
48
|
+
:style="context?.attrs?.style"
|
|
49
|
+
class="p-output-list-items"
|
|
50
|
+
:class="listItemsClass"
|
|
51
|
+
>
|
|
52
|
+
<template v-for="(value, index) of getListValues" :key="index">
|
|
53
|
+
<span v-if="index !== 0" class="p-output-list-divider" :class="dividerClass">{{
|
|
54
|
+
context?.divider ?? ", "
|
|
55
|
+
}}</span>
|
|
56
|
+
<span class="p-output-list-item" :class="itemClass">{{ value }}</span>
|
|
57
|
+
</template>
|
|
58
|
+
</span>
|
|
59
|
+
<div
|
|
60
|
+
v-if="listStyle === 'div'"
|
|
61
|
+
:id="context?.id"
|
|
62
|
+
:style="context?.attrs?.style"
|
|
63
|
+
class="p-output-list-items"
|
|
64
|
+
:class="listItemsClass"
|
|
65
|
+
>
|
|
66
|
+
<template v-for="(value, index) of getListValues" :key="index">
|
|
67
|
+
<div class="p-output-list-item" :class="itemClass">
|
|
68
|
+
{{ value }}
|
|
69
|
+
</div>
|
|
70
|
+
</template>
|
|
71
|
+
</div>
|
|
72
|
+
<ul
|
|
73
|
+
v-if="listStyle === 'ul'"
|
|
74
|
+
:id="context?.id"
|
|
75
|
+
:style="context?.attrs?.style"
|
|
76
|
+
class="p-output-list-items"
|
|
77
|
+
:class="listItemsClass"
|
|
78
|
+
>
|
|
79
|
+
<li v-for="(value, index) of getListValues" :key="index">
|
|
80
|
+
<span class="p-output-list-item" :class="itemClass">
|
|
81
|
+
{{ value }}
|
|
82
|
+
</span>
|
|
83
|
+
</li>
|
|
84
|
+
</ul>
|
|
85
|
+
<ol
|
|
86
|
+
v-if="listStyle === 'ol'"
|
|
87
|
+
:id="context?.id"
|
|
88
|
+
:style="context?.attrs?.style"
|
|
89
|
+
class="p-output-list-items"
|
|
90
|
+
:class="listItemsClass"
|
|
91
|
+
>
|
|
92
|
+
<li v-for="(value, index) of getListValues" :key="index">
|
|
93
|
+
<span class="p-output-list-item" :class="itemClass">
|
|
94
|
+
{{ value }}
|
|
95
|
+
</span>
|
|
96
|
+
</li>
|
|
97
|
+
</ol>
|
|
98
|
+
<FormKitSuffix v-if="hasSuffix && listStyle === 'span'" :suffix="context?.suffix as string" />
|
|
99
|
+
<FormKitIcon
|
|
100
|
+
v-if="hasSuffixIcon"
|
|
101
|
+
:icon-class="context?.iconSuffix as string"
|
|
102
|
+
:on-click="context?.onIconSuffixClicked as () => void"
|
|
103
|
+
position="suffix"
|
|
104
|
+
/>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|