@sfxcode/formkit-primevue 2.3.5 → 2.3.7
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/FormKitDataEdit.vue +6 -0
- package/dist/components/FormKitDataView.vue +5 -0
- package/dist/components/PrimeAutoComplete.vue +2 -3
- package/dist/components/PrimeCascadeSelect.vue +3 -3
- package/dist/components/PrimeCheckbox.vue +3 -3
- package/dist/components/PrimeColorPicker.vue +3 -3
- package/dist/components/PrimeDatePicker.vue +3 -3
- package/dist/components/PrimeEditor.vue +3 -3
- package/dist/components/PrimeInputMask.vue +5 -9
- package/dist/components/PrimeInputNumber.vue +3 -3
- package/dist/components/PrimeInputOtp.vue +3 -3
- package/dist/components/PrimeInputText.vue +7 -7
- package/dist/components/PrimeKnob.vue +3 -3
- package/dist/components/PrimeListbox.vue +3 -3
- package/dist/components/PrimeMultiSelect.vue +3 -3
- package/dist/components/PrimeOutputBoolean.vue +11 -6
- package/dist/components/PrimeOutputDate.vue +11 -6
- package/dist/components/PrimeOutputDuration.vue +11 -6
- package/dist/components/PrimeOutputLink.vue +11 -6
- package/dist/components/PrimeOutputList.vue +11 -6
- package/dist/components/PrimeOutputNumber.vue +20 -8
- package/dist/components/PrimeOutputText.vue +11 -6
- package/dist/components/PrimePassword.vue +3 -3
- package/dist/components/PrimeRadioButton.vue +3 -3
- package/dist/components/PrimeRating.vue +3 -3
- package/dist/components/PrimeSelect.vue +3 -3
- package/dist/components/PrimeSelectButton.vue +3 -3
- package/dist/components/PrimeSlider.vue +3 -3
- package/dist/components/PrimeTextarea.vue +3 -3
- package/dist/components/PrimeToggleButton.vue +3 -3
- package/dist/components/PrimeToggleSwitch.vue +3 -3
- package/dist/components/PrimeTreeSelect.vue +3 -3
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.js +5 -5
- package/dist/composables/index.mjs +2 -2
- package/dist/composables/useFormKitIcon.js +2 -3
- package/dist/composables/useFormKitIcon.mjs +2 -4
- package/dist/composables/useFormKitInput.d.ts +0 -1
- package/dist/composables/useFormKitInput.js +0 -4
- package/dist/composables/useFormKitInput.mjs +1 -4
- package/dist/composables/useFormKitSection.d.ts +6 -0
- package/dist/composables/useFormKitSection.js +27 -0
- package/dist/composables/useFormKitSection.mjs +16 -0
- package/dist/composables/useInputEditor.d.ts +1 -0
- package/dist/composables/useInputEditor.js +2 -0
- package/dist/composables/useInputEditor.mjs +2 -1
- package/dist/composables/useInputEditorSchema.js +34 -21
- package/dist/composables/useInputEditorSchema.mjs +44 -24
- package/dist/sass/formkit-primevue.scss +24 -21
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/composables/useFormKitOutput.d.ts +0 -3
- package/dist/composables/useFormKitOutput.js +0 -15
- package/dist/composables/useFormKitOutput.mjs +0 -7
|
@@ -23,6 +23,10 @@ const props = defineProps({
|
|
|
23
23
|
type: String,
|
|
24
24
|
default: 'Save',
|
|
25
25
|
},
|
|
26
|
+
formClass: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: '',
|
|
29
|
+
},
|
|
26
30
|
})
|
|
27
31
|
|
|
28
32
|
const emit = defineEmits(['dataSaved'])
|
|
@@ -40,11 +44,13 @@ function handleSave() {
|
|
|
40
44
|
<FormKit
|
|
41
45
|
id="form"
|
|
42
46
|
v-model="formData"
|
|
47
|
+
:form-class="formClass"
|
|
43
48
|
type="form"
|
|
44
49
|
:submit-label="submitLabel"
|
|
45
50
|
:submit-attrs="{
|
|
46
51
|
inputClass: 'p-button p-component p-formkit-button',
|
|
47
52
|
}"
|
|
53
|
+
|
|
48
54
|
@submit="handleSave"
|
|
49
55
|
>
|
|
50
56
|
<FormKitSchema :schema="formSchema" :data="formData" />
|
|
@@ -11,6 +11,10 @@ const props = defineProps({
|
|
|
11
11
|
type: Object,
|
|
12
12
|
default: null,
|
|
13
13
|
},
|
|
14
|
+
formClass: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: '',
|
|
17
|
+
},
|
|
14
18
|
debugData: {
|
|
15
19
|
type: Boolean,
|
|
16
20
|
default: false,
|
|
@@ -30,6 +34,7 @@ const formData = ref(props.data)
|
|
|
30
34
|
<FormKit
|
|
31
35
|
v-model="formData"
|
|
32
36
|
type="form"
|
|
37
|
+
:form-class="formClass"
|
|
33
38
|
:submit-attrs="{
|
|
34
39
|
style: 'display: none;',
|
|
35
40
|
}"
|
|
@@ -12,7 +12,6 @@ export interface FormKitPrimeAutoCompleteProps {
|
|
|
12
12
|
dropdown?: AutoCompleteProps['dropdown']
|
|
13
13
|
multiple?: AutoCompleteProps['multiple']
|
|
14
14
|
typeahead?: AutoCompleteProps['typeahead']
|
|
15
|
-
wrapperClass?: string
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
const props = defineProps({
|
|
@@ -22,7 +21,7 @@ const props = defineProps({
|
|
|
22
21
|
},
|
|
23
22
|
})
|
|
24
23
|
|
|
25
|
-
const { styleClass,
|
|
24
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
26
25
|
|
|
27
26
|
const suggestions = ref([])
|
|
28
27
|
|
|
@@ -32,7 +31,7 @@ function search(event: AutoCompleteCompleteEvent) {
|
|
|
32
31
|
</script>
|
|
33
32
|
|
|
34
33
|
<template>
|
|
35
|
-
<div
|
|
34
|
+
<div class="p-formkit">
|
|
36
35
|
<AutoComplete
|
|
37
36
|
:id="context.id"
|
|
38
37
|
v-model="context._value"
|
|
@@ -15,7 +15,7 @@ export interface FormKitPrimeCascadeSelectProps {
|
|
|
15
15
|
pt?: CascadeSelectProps['pt']
|
|
16
16
|
ptOptions?: CascadeSelectProps['ptOptions']
|
|
17
17
|
unstyled?: CascadeSelectProps['unstyled']
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
const props = defineProps({
|
|
@@ -25,11 +25,11 @@ const props = defineProps({
|
|
|
25
25
|
},
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
-
const { styleClass,
|
|
28
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
31
|
<template>
|
|
32
|
-
<div
|
|
32
|
+
<div class="p-formkit">
|
|
33
33
|
<CascadeSelect
|
|
34
34
|
:id="context.id"
|
|
35
35
|
v-model="context._value"
|
|
@@ -16,7 +16,7 @@ export interface FormKitPrimeCheckboxProps {
|
|
|
16
16
|
variant?: CheckboxProps['variant']
|
|
17
17
|
labelLeft?: string
|
|
18
18
|
labelRight?: string
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
const props = defineProps({
|
|
@@ -26,11 +26,11 @@ const props = defineProps({
|
|
|
26
26
|
},
|
|
27
27
|
})
|
|
28
28
|
|
|
29
|
-
const { styleClass,
|
|
29
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
30
30
|
</script>
|
|
31
31
|
|
|
32
32
|
<template>
|
|
33
|
-
<div
|
|
33
|
+
<div class="p-formkit">
|
|
34
34
|
<span v-if="context.labelLeft" class="formkit-prime-left">{{ context.labelLeft }}</span>
|
|
35
35
|
<Checkbox
|
|
36
36
|
v-model="context._value"
|
|
@@ -12,7 +12,7 @@ export interface FormKitPrimeColorPickerProps {
|
|
|
12
12
|
pt?: ColorPickerProps['pt']
|
|
13
13
|
ptOptions?: ColorPickerProps['ptOptions']
|
|
14
14
|
unstyled?: ColorPickerProps['unstyled']
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
@@ -22,11 +22,11 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const {
|
|
25
|
+
const { handleChange } = useFormKitInput(props.context)
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<template>
|
|
29
|
-
<div
|
|
29
|
+
<div class="p-formkit">
|
|
30
30
|
<ColorPicker
|
|
31
31
|
v-model="context._value"
|
|
32
32
|
v-bind="context?.attrs"
|
|
@@ -49,7 +49,7 @@ export interface FormKitPrimeDatePickerProps {
|
|
|
49
49
|
pt?: DatePickerProps['pt']
|
|
50
50
|
ptOptions?: DatePickerProps['ptOptions']
|
|
51
51
|
unstyled?: DatePickerProps['unstyled']
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
const props = defineProps({
|
|
@@ -59,7 +59,7 @@ const props = defineProps({
|
|
|
59
59
|
},
|
|
60
60
|
})
|
|
61
61
|
|
|
62
|
-
const { styleClass,
|
|
62
|
+
const { styleClass, handleInput, handleSelect } = useFormKitInput(props.context)
|
|
63
63
|
|
|
64
64
|
function handleBlur(e: DatePickerBlurEvent) {
|
|
65
65
|
props.context?.handlers.blur(e.originalEvent)
|
|
@@ -71,7 +71,7 @@ function handleClearClick() {
|
|
|
71
71
|
</script>
|
|
72
72
|
|
|
73
73
|
<template>
|
|
74
|
-
<div
|
|
74
|
+
<div class="p-formkit">
|
|
75
75
|
<DatePicker
|
|
76
76
|
v-model="context._value"
|
|
77
77
|
v-bind="context?.attrs"
|
|
@@ -12,7 +12,7 @@ export interface FormKitPrimeEditorProps {
|
|
|
12
12
|
pt?: EditorProps['pt']
|
|
13
13
|
ptOptions?: EditorProps['ptOptions']
|
|
14
14
|
unstyled?: EditorProps['unstyled']
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
const props = defineProps({
|
|
@@ -22,7 +22,7 @@ const props = defineProps({
|
|
|
22
22
|
},
|
|
23
23
|
})
|
|
24
24
|
|
|
25
|
-
const { styleClass,
|
|
25
|
+
const { styleClass, handleInput } = useFormKitInput(props.context)
|
|
26
26
|
|
|
27
27
|
function handleSelection(e: EditorSelectionChangeEvent) {
|
|
28
28
|
if (e.range === null)
|
|
@@ -31,7 +31,7 @@ function handleSelection(e: EditorSelectionChangeEvent) {
|
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
33
|
<template>
|
|
34
|
-
<div
|
|
34
|
+
<div class="p-formkit">
|
|
35
35
|
<Editor
|
|
36
36
|
:id="context.id"
|
|
37
37
|
v-model="context._value"
|
|
@@ -17,7 +17,7 @@ export interface FormKitPrimeInputMaskProps {
|
|
|
17
17
|
variant?: InputMaskProps['variant']
|
|
18
18
|
iconLeft?: string
|
|
19
19
|
iconRight?: string
|
|
20
|
-
|
|
20
|
+
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const props = defineProps({
|
|
@@ -27,7 +27,7 @@ const props = defineProps({
|
|
|
27
27
|
},
|
|
28
28
|
})
|
|
29
29
|
|
|
30
|
-
const { styleClass
|
|
30
|
+
const { styleClass } = useFormKitInput(props.context)
|
|
31
31
|
|
|
32
32
|
function handleInput(e: FocusEvent) {
|
|
33
33
|
props.context?.node.input(props.context?._value)
|
|
@@ -53,11 +53,9 @@ function spanClass() {
|
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
55
|
<template>
|
|
56
|
-
<div
|
|
56
|
+
<div class="p-formkit">
|
|
57
57
|
<span :class="spanClass()">
|
|
58
|
-
<i v-if="hasLeftIcon()" :class="context.iconLeft" />
|
|
59
|
-
|
|
60
|
-
<InputMask
|
|
58
|
+
<i v-if="hasLeftIcon()" :class="context.iconLeft" /> <InputMask
|
|
61
59
|
:id="context.id"
|
|
62
60
|
v-model="context._value"
|
|
63
61
|
v-bind="context?.attrs"
|
|
@@ -77,9 +75,7 @@ function spanClass() {
|
|
|
77
75
|
:pt-options="context.ptOptions"
|
|
78
76
|
:unstyled="context.unstyled ?? false"
|
|
79
77
|
@blur="handleInput"
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
<i v-if="hasRightIcon" :class="context.iconRight" />
|
|
78
|
+
/> <i v-if="hasRightIcon" :class="context.iconRight" />
|
|
83
79
|
</span>
|
|
84
80
|
</div>
|
|
85
81
|
</template>
|
|
@@ -23,7 +23,7 @@ export interface FormKitPrimeInputNumberProps {
|
|
|
23
23
|
ptOptions?: InputNumberProps['ptOptions']
|
|
24
24
|
unstyled?: InputNumberProps['unstyled']
|
|
25
25
|
placeholder?: InputNumberProps['placeholder']
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
const props = defineProps({
|
|
@@ -33,7 +33,7 @@ const props = defineProps({
|
|
|
33
33
|
},
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
const { styleClass,
|
|
36
|
+
const { styleClass, handleInput } = useFormKitInput(props.context)
|
|
37
37
|
|
|
38
38
|
function handleBlur(e: InputNumberBlurEvent) {
|
|
39
39
|
props.context?.handlers.blur(e.originalEvent)
|
|
@@ -41,7 +41,7 @@ function handleBlur(e: InputNumberBlurEvent) {
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<template>
|
|
44
|
-
<div
|
|
44
|
+
<div class="p-formkit">
|
|
45
45
|
<InputNumber
|
|
46
46
|
v-model="context._value"
|
|
47
47
|
v-bind="context?.attrs"
|
|
@@ -13,7 +13,7 @@ export interface FormKitPrimeInputOtpProps {
|
|
|
13
13
|
variant?: InputOtpProps['variant']
|
|
14
14
|
mask?: InputOtpProps['mask']
|
|
15
15
|
integerOnly?: InputOtpProps['integerOnly']
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const props = defineProps({
|
|
@@ -23,11 +23,11 @@ const props = defineProps({
|
|
|
23
23
|
},
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const { styleClass,
|
|
26
|
+
const { styleClass, handleBlur, handleInput } = useFormKitInput(props.context)
|
|
27
27
|
</script>
|
|
28
28
|
|
|
29
29
|
<template>
|
|
30
|
-
<div
|
|
30
|
+
<div class="p-formkit">
|
|
31
31
|
<InputOtp
|
|
32
32
|
:id="context.id"
|
|
33
33
|
v-model="context._value"
|
|
@@ -5,7 +5,7 @@ import type { FormKitFrameworkContext } from '@formkit/core'
|
|
|
5
5
|
import IconField from 'primevue/iconfield'
|
|
6
6
|
import InputIcon from 'primevue/inputicon'
|
|
7
7
|
import type { InputTextProps } from 'primevue/inputtext'
|
|
8
|
-
import {
|
|
8
|
+
import { useFormKitInput, useFormKitSection } from '../composables'
|
|
9
9
|
|
|
10
10
|
export interface FormKitPrimeInputTextProps {
|
|
11
11
|
pt?: InputTextProps['pt']
|
|
@@ -13,7 +13,7 @@ export interface FormKitPrimeInputTextProps {
|
|
|
13
13
|
unstyled?: InputTextProps['unstyled']
|
|
14
14
|
placeholder?: InputTextProps['placeholder']
|
|
15
15
|
icon?: string
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
const props = defineProps({
|
|
@@ -23,14 +23,14 @@ const props = defineProps({
|
|
|
23
23
|
},
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const { styleClass,
|
|
27
|
-
const {
|
|
26
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
27
|
+
const { hasPrefixIcon, hasSuffixIcon } = useFormKitSection(props.context)
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<div
|
|
31
|
+
<div class="p-formkit">
|
|
32
32
|
<IconField>
|
|
33
|
-
<InputIcon v-if="
|
|
33
|
+
<InputIcon v-if="hasPrefixIcon" :class="context?.prefixIcon" />
|
|
34
34
|
<InputText
|
|
35
35
|
:id="context.id"
|
|
36
36
|
v-model="context._value"
|
|
@@ -49,7 +49,7 @@ const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
|
49
49
|
@input="handleInput"
|
|
50
50
|
@blur="handleBlur"
|
|
51
51
|
/>
|
|
52
|
-
<InputIcon v-if="
|
|
52
|
+
<InputIcon v-if="hasSuffixIcon" :class="context?.suffixIcon" />
|
|
53
53
|
</IconField>
|
|
54
54
|
</div>
|
|
55
55
|
</template>
|
|
@@ -19,7 +19,7 @@ export interface FormKitPrimeKnobProps {
|
|
|
19
19
|
rangeColor?: KnobProps['rangeColor']
|
|
20
20
|
textColor?: KnobProps['textColor']
|
|
21
21
|
valueTemplate?: KnobProps['valueTemplate']
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
const props = defineProps({
|
|
@@ -29,7 +29,7 @@ const props = defineProps({
|
|
|
29
29
|
},
|
|
30
30
|
})
|
|
31
31
|
|
|
32
|
-
const { styleClass
|
|
32
|
+
const { styleClass } = useFormKitInput(props.context)
|
|
33
33
|
|
|
34
34
|
function handleInput(e: any) {
|
|
35
35
|
props.context?.node.input(e)
|
|
@@ -42,7 +42,7 @@ function updateValue(n: number) {
|
|
|
42
42
|
</script>
|
|
43
43
|
|
|
44
44
|
<template>
|
|
45
|
-
<div
|
|
45
|
+
<div class="p-formkit">
|
|
46
46
|
<Knob
|
|
47
47
|
:id="context.id"
|
|
48
48
|
v-model="context._value"
|
|
@@ -20,7 +20,7 @@ export interface FormKitPrimeListboxProps {
|
|
|
20
20
|
filterMatchMode?: ListboxProps['filterMatchMode']
|
|
21
21
|
autoOptionFocus?: ListboxProps['autoOptionFocus']
|
|
22
22
|
selectOnFocus?: ListboxProps['selectOnFocus']
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const props = defineProps({
|
|
@@ -30,11 +30,11 @@ const props = defineProps({
|
|
|
30
30
|
},
|
|
31
31
|
})
|
|
32
32
|
|
|
33
|
-
const { styleClass,
|
|
33
|
+
const { styleClass, handleInput, handleBlur } = useFormKitInput(props.context)
|
|
34
34
|
</script>
|
|
35
35
|
|
|
36
36
|
<template>
|
|
37
|
-
<div
|
|
37
|
+
<div class="p-formkit">
|
|
38
38
|
<Listbox
|
|
39
39
|
:id="context.id"
|
|
40
40
|
v-model="context._value"
|
|
@@ -41,7 +41,7 @@ export interface FormKitPrimeMultiSelectProps {
|
|
|
41
41
|
placeholder?: MultiSelectProps['placeholder']
|
|
42
42
|
ptOptions?: MultiSelectProps['ptOptions']
|
|
43
43
|
unstyled?: MultiSelectProps['unstyled']
|
|
44
|
-
|
|
44
|
+
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
const props = defineProps({
|
|
@@ -51,11 +51,11 @@ const props = defineProps({
|
|
|
51
51
|
},
|
|
52
52
|
})
|
|
53
53
|
|
|
54
|
-
const { styleClass,
|
|
54
|
+
const { styleClass, handleBlur, handleChange } = useFormKitInput(props.context)
|
|
55
55
|
</script>
|
|
56
56
|
|
|
57
57
|
<template>
|
|
58
|
-
<div
|
|
58
|
+
<div class="p-formkit">
|
|
59
59
|
<MultiSelect
|
|
60
60
|
v-model="context._value"
|
|
61
61
|
v-bind="context?.attrs"
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import { useI18n } from 'vue-i18n'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import {
|
|
4
|
+
import { useFormKitSection } from '../composables'
|
|
5
5
|
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
context: Object,
|
|
8
8
|
})
|
|
9
|
-
const {
|
|
10
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
9
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
11
10
|
|
|
12
11
|
const { t } = useI18n()
|
|
13
12
|
|
|
@@ -20,11 +19,17 @@ const translated = computed(() => {
|
|
|
20
19
|
</script>
|
|
21
20
|
|
|
22
21
|
<template>
|
|
23
|
-
<div
|
|
24
|
-
<i v-if="
|
|
22
|
+
<div class="p-formkit p-output-boolean">
|
|
23
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
24
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
25
|
+
{{ context?.attrs?.prefix }}
|
|
26
|
+
</span>
|
|
25
27
|
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
26
28
|
{{ translated }}
|
|
27
29
|
</span>
|
|
28
|
-
<
|
|
30
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
31
|
+
{{ context?.attrs?.suffix }}
|
|
32
|
+
</span>
|
|
33
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
29
34
|
</div>
|
|
30
35
|
</template>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import { useI18n } from 'vue-i18n'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
|
-
import {
|
|
4
|
+
import { useFormKitSection } from '../composables'
|
|
5
5
|
|
|
6
6
|
const props = defineProps({
|
|
7
7
|
context: Object,
|
|
8
8
|
})
|
|
9
|
-
const {
|
|
10
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
9
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
11
10
|
|
|
12
11
|
const { d } = useI18n()
|
|
13
12
|
|
|
@@ -30,11 +29,17 @@ const converted = computed(() => {
|
|
|
30
29
|
</script>
|
|
31
30
|
|
|
32
31
|
<template>
|
|
33
|
-
<div
|
|
34
|
-
<i v-if="
|
|
32
|
+
<div class="p-formkit p-output-date">
|
|
33
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
34
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
35
|
+
{{ context?.attrs?.prefix }}
|
|
36
|
+
</span>
|
|
35
37
|
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
36
38
|
{{ converted }}
|
|
37
39
|
</span>
|
|
38
|
-
<
|
|
40
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
41
|
+
{{ context?.attrs?.suffix }}
|
|
42
|
+
</span>
|
|
43
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
39
44
|
</div>
|
|
40
45
|
</template>
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { useFormKitSection, useOutputDuration } from '../composables'
|
|
3
3
|
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object,
|
|
6
6
|
})
|
|
7
7
|
|
|
8
|
-
const {
|
|
9
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
8
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
10
9
|
|
|
11
10
|
const { formattedDuration } = useOutputDuration()
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<template>
|
|
15
|
-
<div
|
|
16
|
-
<i v-if="
|
|
14
|
+
<div class="p-formkit p-output-duration">
|
|
15
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
16
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
17
|
+
{{ context?.attrs?.prefix }}
|
|
18
|
+
</span>
|
|
17
19
|
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
18
20
|
{{ formattedDuration(context?._value) }}
|
|
19
21
|
</span>
|
|
20
|
-
<
|
|
22
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
23
|
+
{{ context?.attrs?.suffix }}
|
|
24
|
+
</span>
|
|
25
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
21
26
|
</div>
|
|
22
27
|
</template>
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
-
import {
|
|
3
|
+
import { useFormKitSection } from '../composables'
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
6
6
|
context: Object,
|
|
7
7
|
})
|
|
8
|
-
const {
|
|
9
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
8
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
10
9
|
|
|
11
10
|
const url = computed(() => props.context?._value.indexOf('http') > -1 ? props.context?._value : `https://${props.context?._value}`)
|
|
12
11
|
</script>
|
|
13
12
|
|
|
14
13
|
<template>
|
|
15
|
-
<div
|
|
16
|
-
<i v-if="
|
|
14
|
+
<div class="p-formkit p-output-link">
|
|
15
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
16
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
17
|
+
{{ context?.attrs?.prefix }}
|
|
18
|
+
</span>
|
|
17
19
|
<a
|
|
18
20
|
:id="context?.id"
|
|
19
21
|
:style="context?.attrs?.style"
|
|
@@ -23,6 +25,9 @@ const url = computed(() => props.context?._value.indexOf('http') > -1 ? props.co
|
|
|
23
25
|
>
|
|
24
26
|
{{ context?._value }}
|
|
25
27
|
</a>
|
|
26
|
-
<
|
|
28
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
29
|
+
{{ context?.attrs?.suffix }}
|
|
30
|
+
</span>
|
|
31
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
27
32
|
</div>
|
|
28
33
|
</template>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script setup lang='ts'>
|
|
2
|
-
import {
|
|
2
|
+
import { useFormKitSection } from '../composables'
|
|
3
3
|
|
|
4
4
|
const props = defineProps({
|
|
5
5
|
context: Object,
|
|
6
6
|
})
|
|
7
|
-
const {
|
|
8
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
7
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
9
8
|
|
|
10
9
|
function listValue(index: number, value: string): string {
|
|
11
10
|
const divider = props.context?.attrs?.divider || ', '
|
|
@@ -17,13 +16,19 @@ function listValue(index: number, value: string): string {
|
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
18
|
<template>
|
|
20
|
-
<div
|
|
21
|
-
<i v-if="
|
|
19
|
+
<div class="p-formkit p-output-list">
|
|
20
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
21
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
22
|
+
{{ context?.attrs?.prefix }}
|
|
23
|
+
</span>
|
|
22
24
|
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
23
25
|
<template v-for="(value, index) of context?._value" :key="index">
|
|
24
26
|
<span class="p-output-list-item">{{ listValue(index, value) }}</span>
|
|
25
27
|
</template>
|
|
26
28
|
</span>
|
|
27
|
-
<
|
|
29
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
30
|
+
{{ context?.attrs?.suffix }}
|
|
31
|
+
</span>
|
|
32
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
28
33
|
</div>
|
|
29
34
|
</template>
|
|
@@ -2,25 +2,31 @@
|
|
|
2
2
|
import { useI18n } from 'vue-i18n'
|
|
3
3
|
import { computed } from 'vue'
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useFormKitSection } from '../composables'
|
|
6
6
|
|
|
7
7
|
const props = defineProps({
|
|
8
8
|
context: Object,
|
|
9
9
|
})
|
|
10
|
-
const {
|
|
11
|
-
const { hasIcon, icon, iconPosition } = useFormKitIcon(props.context)
|
|
10
|
+
const { hasPrefix, hasPrefixIcon, hasSuffix, hasSuffixIcon } = useFormKitSection(props.context)
|
|
12
11
|
|
|
13
12
|
const { n } = useI18n()
|
|
14
13
|
|
|
15
14
|
const converted = computed(() => {
|
|
16
|
-
|
|
15
|
+
const value = props?.context?._value
|
|
16
|
+
if (value) {
|
|
17
17
|
let result = ''
|
|
18
18
|
const format = props?.context?.attrs?.format ? props?.context?.attrs?.format : 'short'
|
|
19
19
|
try {
|
|
20
|
-
result = n(
|
|
20
|
+
result = n(value, format)
|
|
21
21
|
}
|
|
22
22
|
// eslint-disable-next-line unused-imports/no-unused-vars
|
|
23
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
|
+
}
|
|
24
30
|
}
|
|
25
31
|
return result
|
|
26
32
|
}
|
|
@@ -31,11 +37,17 @@ const converted = computed(() => {
|
|
|
31
37
|
</script>
|
|
32
38
|
|
|
33
39
|
<template>
|
|
34
|
-
<div
|
|
35
|
-
<i v-if="
|
|
40
|
+
<div class="p-formkit p-output-number">
|
|
41
|
+
<i v-if="hasPrefixIcon" class="formkit-prefix-icon" :class="context?.prefixIcon" />
|
|
42
|
+
<span v-if="hasPrefix" class="formkit-prefix">
|
|
43
|
+
{{ context?.attrs?.prefix }}
|
|
44
|
+
</span>
|
|
36
45
|
<span :id="context?.id" :style="context?.attrs?.style" :class="context?.attrs?.class">
|
|
37
46
|
{{ converted }}
|
|
38
47
|
</span>
|
|
39
|
-
<
|
|
48
|
+
<span v-if="hasSuffix" class="formkit-suffix">
|
|
49
|
+
{{ context?.attrs?.suffix }}
|
|
50
|
+
</span>
|
|
51
|
+
<i v-if="hasSuffixIcon" class="formkit-suffix-icon" :class="context?.suffixIcon" />
|
|
40
52
|
</div>
|
|
41
53
|
</template>
|