@aziontech/webkit 0.0.1
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/package.json +46 -0
- package/src/core/field-auto-complete/field-auto-complete.vue +121 -0
- package/src/core/field-auto-complete/field-auto-complete.vue.d.ts +107 -0
- package/src/core/field-auto-complete/field-auto-complete.vue.d.ts.map +1 -0
- package/src/core/field-auto-complete/package.json +11 -0
- package/src/core/field-checkbox-block/field-checkbox-block.vue +106 -0
- package/src/core/field-checkbox-block/field-checkbox-block.vue.d.ts +111 -0
- package/src/core/field-checkbox-block/field-checkbox-block.vue.d.ts.map +1 -0
- package/src/core/field-checkbox-block/package.json +11 -0
- package/src/core/field-dropdown/field-dropdown.vue +240 -0
- package/src/core/field-dropdown/field-dropdown.vue.d.ts +203 -0
- package/src/core/field-dropdown/field-dropdown.vue.d.ts.map +1 -0
- package/src/core/field-dropdown/package.json +11 -0
- package/src/core/field-dropdown-icon/field-dropdown-icon.vue +129 -0
- package/src/core/field-dropdown-icon/field-dropdown-icon.vue.d.ts +111 -0
- package/src/core/field-dropdown-icon/field-dropdown-icon.vue.d.ts.map +1 -0
- package/src/core/field-dropdown-icon/package.json +11 -0
- package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue +631 -0
- package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue.d.ts +196 -0
- package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue.d.ts.map +1 -0
- package/src/core/field-dropdown-lazy-loader/package.json +11 -0
- package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue +426 -0
- package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts +158 -0
- package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts.map +1 -0
- package/src/core/field-dropdown-lazy-loader-dynamic/package.json +11 -0
- package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue +527 -0
- package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue.d.ts +203 -0
- package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue.d.ts.map +1 -0
- package/src/core/field-dropdown-lazy-loader-with-filter/package.json +11 -0
- package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue +439 -0
- package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue.d.ts +162 -0
- package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue.d.ts.map +1 -0
- package/src/core/field-dropdown-multi-select-lazy-loader/package.json +11 -0
- package/src/core/field-group-checkbox/field-group-checkbox.vue +102 -0
- package/src/core/field-group-checkbox/field-group-checkbox.vue.d.ts +87 -0
- package/src/core/field-group-checkbox/field-group-checkbox.vue.d.ts.map +1 -0
- package/src/core/field-group-checkbox/package.json +11 -0
- package/src/core/field-group-radio/field-group-radio.vue +149 -0
- package/src/core/field-group-radio/field-group-radio.vue.d.ts +99 -0
- package/src/core/field-group-radio/field-group-radio.vue.d.ts.map +1 -0
- package/src/core/field-group-radio/package.json +11 -0
- package/src/core/field-group-switch/field-group-switch.vue +121 -0
- package/src/core/field-group-switch/field-group-switch.vue.d.ts +87 -0
- package/src/core/field-group-switch/field-group-switch.vue.d.ts.map +1 -0
- package/src/core/field-group-switch/package.json +11 -0
- package/src/core/field-input-group/field-input-group.vue +111 -0
- package/src/core/field-input-group/field-input-group.vue.d.ts +87 -0
- package/src/core/field-input-group/field-input-group.vue.d.ts.map +1 -0
- package/src/core/field-input-group/package.json +11 -0
- package/src/core/field-multi-select/field-multi-select.vue +167 -0
- package/src/core/field-multi-select/field-multi-select.vue.d.ts +136 -0
- package/src/core/field-multi-select/field-multi-select.vue.d.ts.map +1 -0
- package/src/core/field-multi-select/package.json +11 -0
- package/src/core/field-number/field-number.vue +144 -0
- package/src/core/field-number/field-number.vue.d.ts +132 -0
- package/src/core/field-number/field-number.vue.d.ts.map +1 -0
- package/src/core/field-number/package.json +11 -0
- package/src/core/field-phone-number/field-phone-number.vue +151 -0
- package/src/core/field-phone-number/field-phone-number.vue.d.ts +76 -0
- package/src/core/field-phone-number/field-phone-number.vue.d.ts.map +1 -0
- package/src/core/field-phone-number/package.json +11 -0
- package/src/core/field-phone-number-country/field-phone-number-country.vue +60 -0
- package/src/core/field-phone-number-country/field-phone-number-country.vue.d.ts +18 -0
- package/src/core/field-phone-number-country/field-phone-number-country.vue.d.ts.map +1 -0
- package/src/core/field-phone-number-country/package.json +11 -0
- package/src/core/field-pick-list/field-pick-list.vue +285 -0
- package/src/core/field-pick-list/field-pick-list.vue.d.ts +43 -0
- package/src/core/field-pick-list/field-pick-list.vue.d.ts.map +1 -0
- package/src/core/field-pick-list/package.json +11 -0
- package/src/core/field-radio-block/field-radio-block.vue +108 -0
- package/src/core/field-radio-block/field-radio-block.vue.d.ts +115 -0
- package/src/core/field-radio-block/field-radio-block.vue.d.ts.map +1 -0
- package/src/core/field-radio-block/package.json +11 -0
- package/src/core/field-switch/field-switch.vue +41 -0
- package/src/core/field-switch/field-switch.vue.d.ts +33 -0
- package/src/core/field-switch/field-switch.vue.d.ts.map +1 -0
- package/src/core/field-switch/package.json +11 -0
- package/src/core/field-switch-block/field-switch-block.vue +123 -0
- package/src/core/field-switch-block/field-switch-block.vue.d.ts +123 -0
- package/src/core/field-switch-block/field-switch-block.vue.d.ts.map +1 -0
- package/src/core/field-switch-block/package.json +11 -0
- package/src/core/field-text/field-text.vue +128 -0
- package/src/core/field-text/field-text.vue.d.ts +108 -0
- package/src/core/field-text/field-text.vue.d.ts.map +1 -0
- package/src/core/field-text/package.json +11 -0
- package/src/core/field-text-area/field-text-area.vue +178 -0
- package/src/core/field-text-area/field-text-area.vue.d.ts +142 -0
- package/src/core/field-text-area/field-text-area.vue.d.ts.map +1 -0
- package/src/core/field-text-area/package.json +11 -0
- package/src/core/field-text-icon/field-text-icon.vue +127 -0
- package/src/core/field-text-icon/field-text-icon.vue.d.ts +100 -0
- package/src/core/field-text-icon/field-text-icon.vue.d.ts.map +1 -0
- package/src/core/field-text-icon/package.json +11 -0
- package/src/core/field-text-password/field-text-password.vue +127 -0
- package/src/core/field-text-password/field-text-password.vue.d.ts +108 -0
- package/src/core/field-text-password/field-text-password.vue.d.ts.map +1 -0
- package/src/core/field-text-password/package.json +11 -0
- package/src/core/label/label.vue +35 -0
- package/src/core/label/label.vue.d.ts +24 -0
- package/src/core/label/label.vue.d.ts.map +1 -0
- package/src/core/label/package.json +11 -0
- package/src/core/selector-block/package.json +11 -0
- package/src/core/selector-block/selector-block.vue +128 -0
- package/src/core/selector-block/selector-block.vue.d.ts +99 -0
- package/src/core/selector-block/selector-block.vue.d.ts.map +1 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
4
|
+
type __VLS_WithSlots<T, S> = T & (new () => {
|
|
5
|
+
$slots: S;
|
|
6
|
+
});
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
8
|
+
value: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
name: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
required: true;
|
|
15
|
+
};
|
|
16
|
+
label: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
placeholder: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
description: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
optionLabel: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
optionValue: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
optionDisabled: {
|
|
37
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
38
|
+
default: string;
|
|
39
|
+
};
|
|
40
|
+
options: {
|
|
41
|
+
type: ArrayConstructor;
|
|
42
|
+
default: () => never[];
|
|
43
|
+
};
|
|
44
|
+
loading: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
disabled: {
|
|
49
|
+
type: BooleanConstructor;
|
|
50
|
+
default: boolean;
|
|
51
|
+
};
|
|
52
|
+
filter: {
|
|
53
|
+
type: BooleanConstructor;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
pt: {
|
|
57
|
+
type: ObjectConstructor;
|
|
58
|
+
default: () => void;
|
|
59
|
+
};
|
|
60
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
61
|
+
onBlur: (...args: any[]) => void;
|
|
62
|
+
onChange: (...args: any[]) => void;
|
|
63
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
64
|
+
value: {
|
|
65
|
+
type: ArrayConstructor;
|
|
66
|
+
default: () => never[];
|
|
67
|
+
};
|
|
68
|
+
name: {
|
|
69
|
+
type: StringConstructor;
|
|
70
|
+
required: true;
|
|
71
|
+
};
|
|
72
|
+
label: {
|
|
73
|
+
type: StringConstructor;
|
|
74
|
+
default: string;
|
|
75
|
+
};
|
|
76
|
+
placeholder: {
|
|
77
|
+
type: StringConstructor;
|
|
78
|
+
default: string;
|
|
79
|
+
};
|
|
80
|
+
description: {
|
|
81
|
+
type: StringConstructor;
|
|
82
|
+
default: string;
|
|
83
|
+
};
|
|
84
|
+
optionLabel: {
|
|
85
|
+
type: StringConstructor;
|
|
86
|
+
default: string;
|
|
87
|
+
};
|
|
88
|
+
optionValue: {
|
|
89
|
+
type: StringConstructor;
|
|
90
|
+
default: string;
|
|
91
|
+
};
|
|
92
|
+
optionDisabled: {
|
|
93
|
+
type: (StringConstructor | FunctionConstructor)[];
|
|
94
|
+
default: string;
|
|
95
|
+
};
|
|
96
|
+
options: {
|
|
97
|
+
type: ArrayConstructor;
|
|
98
|
+
default: () => never[];
|
|
99
|
+
};
|
|
100
|
+
loading: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: boolean;
|
|
103
|
+
};
|
|
104
|
+
disabled: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
filter: {
|
|
109
|
+
type: BooleanConstructor;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
pt: {
|
|
113
|
+
type: ObjectConstructor;
|
|
114
|
+
default: () => void;
|
|
115
|
+
};
|
|
116
|
+
}>> & Readonly<{
|
|
117
|
+
onOnBlur?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
onOnChange?: ((...args: any[]) => any) | undefined;
|
|
119
|
+
}>, {
|
|
120
|
+
value: unknown[];
|
|
121
|
+
label: string;
|
|
122
|
+
placeholder: string;
|
|
123
|
+
description: string;
|
|
124
|
+
disabled: boolean;
|
|
125
|
+
filter: boolean;
|
|
126
|
+
optionLabel: string;
|
|
127
|
+
optionDisabled: string | Function;
|
|
128
|
+
loading: boolean;
|
|
129
|
+
pt: Record<string, any>;
|
|
130
|
+
optionValue: string;
|
|
131
|
+
options: unknown[];
|
|
132
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
133
|
+
type __VLS_Slots = {
|
|
134
|
+
description?: ((props: {}) => any) | undefined;
|
|
135
|
+
};
|
|
136
|
+
//# sourceMappingURL=field-multi-select.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-multi-select.vue.d.ts","sourceRoot":"","sources":["field-multi-select.vue"],"names":[],"mappings":"wBAgeqB,OAAO,YAAY;;AADxC,4BAA2B,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;qBAEtD,CAAC,EAAE,CAAC;;;AA3DzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAwDG"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, toRef, useAttrs } from 'vue'
|
|
3
|
+
import { useField } from 'vee-validate'
|
|
4
|
+
import InputNumber from 'primevue/inputnumber'
|
|
5
|
+
import LabelBlock from '../label'
|
|
6
|
+
|
|
7
|
+
const emit = defineEmits(['blur', 'input'])
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
value: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ''
|
|
12
|
+
},
|
|
13
|
+
name: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
label: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ''
|
|
20
|
+
},
|
|
21
|
+
placeholder: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
readonly: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
inputClass: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: ''
|
|
40
|
+
},
|
|
41
|
+
min: {
|
|
42
|
+
type: Number
|
|
43
|
+
},
|
|
44
|
+
max: {
|
|
45
|
+
type: Number
|
|
46
|
+
},
|
|
47
|
+
step: {
|
|
48
|
+
type: Number,
|
|
49
|
+
default: 1
|
|
50
|
+
},
|
|
51
|
+
showButtons: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true
|
|
54
|
+
},
|
|
55
|
+
useGrouping: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: true
|
|
58
|
+
},
|
|
59
|
+
aditionalError: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: ''
|
|
62
|
+
}
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
const name = toRef(props, 'name')
|
|
66
|
+
|
|
67
|
+
const {
|
|
68
|
+
value: inputValue,
|
|
69
|
+
errorMessage,
|
|
70
|
+
handleBlur,
|
|
71
|
+
handleChange
|
|
72
|
+
} = useField(name, undefined, {
|
|
73
|
+
initialValue: props.value ?? null
|
|
74
|
+
})
|
|
75
|
+
|
|
76
|
+
const attrs = useAttrs()
|
|
77
|
+
|
|
78
|
+
const customTestId = computed(() => {
|
|
79
|
+
const id = attrs['data-testid'] || 'field-number'
|
|
80
|
+
|
|
81
|
+
return {
|
|
82
|
+
label: `${id}__label`,
|
|
83
|
+
input: `${id}__input`,
|
|
84
|
+
description: `${id}__description`,
|
|
85
|
+
error: `${id}__error-message`
|
|
86
|
+
}
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
const onBlur = (event) => {
|
|
90
|
+
handleBlur(event)
|
|
91
|
+
emit('blur', event)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const onInput = (event) => {
|
|
95
|
+
handleChange(event.value)
|
|
96
|
+
emit('input', event.value)
|
|
97
|
+
}
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<template>
|
|
101
|
+
<LabelBlock
|
|
102
|
+
:for="props.name"
|
|
103
|
+
:data-testid="customTestId.label"
|
|
104
|
+
:label="props.label"
|
|
105
|
+
:isRequired="$attrs.required"
|
|
106
|
+
/>
|
|
107
|
+
<InputNumber
|
|
108
|
+
v-model="inputValue"
|
|
109
|
+
:showButtons="props.showButtons"
|
|
110
|
+
:placeholder="props.placeholder"
|
|
111
|
+
:disabled="props.disabled"
|
|
112
|
+
:readonly="props.readonly"
|
|
113
|
+
:id="name"
|
|
114
|
+
:min="props.min"
|
|
115
|
+
:max="props.max"
|
|
116
|
+
:step="props.step"
|
|
117
|
+
:useGrouping="props.useGrouping"
|
|
118
|
+
type="number"
|
|
119
|
+
@input="onInput"
|
|
120
|
+
@blur="onBlur"
|
|
121
|
+
:pt="{
|
|
122
|
+
input: {
|
|
123
|
+
name: props.name
|
|
124
|
+
}
|
|
125
|
+
}"
|
|
126
|
+
:class="[{ 'p-invalid': aditionalError || errorMessage }, props.inputClass]"
|
|
127
|
+
:data-testid="customTestId.input"
|
|
128
|
+
/>
|
|
129
|
+
|
|
130
|
+
<small
|
|
131
|
+
v-if="aditionalError || errorMessage"
|
|
132
|
+
class="p-error text-xs font-normal leading-tight"
|
|
133
|
+
:data-testid="customTestId.error"
|
|
134
|
+
>
|
|
135
|
+
{{ aditionalError || errorMessage }}
|
|
136
|
+
</small>
|
|
137
|
+
<small
|
|
138
|
+
class="text-xs text-color-secondary font-normal leading-5"
|
|
139
|
+
:data-testid="customTestId.description"
|
|
140
|
+
v-if="props.description"
|
|
141
|
+
>
|
|
142
|
+
{{ props.description }}
|
|
143
|
+
</small>
|
|
144
|
+
</template>
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
value: {
|
|
5
|
+
type: StringConstructor;
|
|
6
|
+
default: string;
|
|
7
|
+
};
|
|
8
|
+
name: {
|
|
9
|
+
type: StringConstructor;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
label: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
placeholder: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
disabled: {
|
|
25
|
+
type: BooleanConstructor;
|
|
26
|
+
default: boolean;
|
|
27
|
+
};
|
|
28
|
+
readonly: {
|
|
29
|
+
type: BooleanConstructor;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
32
|
+
inputClass: {
|
|
33
|
+
type: StringConstructor;
|
|
34
|
+
default: string;
|
|
35
|
+
};
|
|
36
|
+
min: {
|
|
37
|
+
type: NumberConstructor;
|
|
38
|
+
};
|
|
39
|
+
max: {
|
|
40
|
+
type: NumberConstructor;
|
|
41
|
+
};
|
|
42
|
+
step: {
|
|
43
|
+
type: NumberConstructor;
|
|
44
|
+
default: number;
|
|
45
|
+
};
|
|
46
|
+
showButtons: {
|
|
47
|
+
type: BooleanConstructor;
|
|
48
|
+
default: boolean;
|
|
49
|
+
};
|
|
50
|
+
useGrouping: {
|
|
51
|
+
type: BooleanConstructor;
|
|
52
|
+
default: boolean;
|
|
53
|
+
};
|
|
54
|
+
aditionalError: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
59
|
+
input: (...args: any[]) => void;
|
|
60
|
+
blur: (...args: any[]) => void;
|
|
61
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
62
|
+
value: {
|
|
63
|
+
type: StringConstructor;
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
name: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
required: true;
|
|
69
|
+
};
|
|
70
|
+
label: {
|
|
71
|
+
type: StringConstructor;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
placeholder: {
|
|
75
|
+
type: StringConstructor;
|
|
76
|
+
default: string;
|
|
77
|
+
};
|
|
78
|
+
description: {
|
|
79
|
+
type: StringConstructor;
|
|
80
|
+
default: string;
|
|
81
|
+
};
|
|
82
|
+
disabled: {
|
|
83
|
+
type: BooleanConstructor;
|
|
84
|
+
default: boolean;
|
|
85
|
+
};
|
|
86
|
+
readonly: {
|
|
87
|
+
type: BooleanConstructor;
|
|
88
|
+
default: boolean;
|
|
89
|
+
};
|
|
90
|
+
inputClass: {
|
|
91
|
+
type: StringConstructor;
|
|
92
|
+
default: string;
|
|
93
|
+
};
|
|
94
|
+
min: {
|
|
95
|
+
type: NumberConstructor;
|
|
96
|
+
};
|
|
97
|
+
max: {
|
|
98
|
+
type: NumberConstructor;
|
|
99
|
+
};
|
|
100
|
+
step: {
|
|
101
|
+
type: NumberConstructor;
|
|
102
|
+
default: number;
|
|
103
|
+
};
|
|
104
|
+
showButtons: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
useGrouping: {
|
|
109
|
+
type: BooleanConstructor;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
aditionalError: {
|
|
113
|
+
type: StringConstructor;
|
|
114
|
+
default: string;
|
|
115
|
+
};
|
|
116
|
+
}>> & Readonly<{
|
|
117
|
+
onInput?: ((...args: any[]) => any) | undefined;
|
|
118
|
+
onBlur?: ((...args: any[]) => any) | undefined;
|
|
119
|
+
}>, {
|
|
120
|
+
value: string;
|
|
121
|
+
label: string;
|
|
122
|
+
placeholder: string;
|
|
123
|
+
description: string;
|
|
124
|
+
disabled: boolean;
|
|
125
|
+
readonly: boolean;
|
|
126
|
+
inputClass: string;
|
|
127
|
+
aditionalError: string;
|
|
128
|
+
step: number;
|
|
129
|
+
showButtons: boolean;
|
|
130
|
+
useGrouping: boolean;
|
|
131
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
132
|
+
//# sourceMappingURL=field-number.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-number.vue.d.ts","sourceRoot":"","sources":["field-number.vue"],"names":[],"mappings":"wBA0aqB,OAAO,YAAY;;AA3DxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0DG"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, toRef, useAttrs } from 'vue'
|
|
3
|
+
import { useField } from 'vee-validate'
|
|
4
|
+
import Dropdown from 'primevue/dropdown'
|
|
5
|
+
import InputMask from 'primevue/inputmask'
|
|
6
|
+
import LabelBlock from '../label'
|
|
7
|
+
|
|
8
|
+
const props = defineProps({
|
|
9
|
+
options: {
|
|
10
|
+
type: Array,
|
|
11
|
+
default: () => []
|
|
12
|
+
},
|
|
13
|
+
loading: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: false
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'Phone Number'
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ''
|
|
28
|
+
},
|
|
29
|
+
countryCodeName: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: 'countryCallCode'
|
|
32
|
+
},
|
|
33
|
+
mobileName: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'mobile'
|
|
36
|
+
}
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
const emit = defineEmits(['change:countryCode', 'change:mobile'])
|
|
40
|
+
|
|
41
|
+
const attrs = useAttrs()
|
|
42
|
+
const countryCodeName = toRef(props, 'countryCodeName')
|
|
43
|
+
const mobileName = toRef(props, 'mobileName')
|
|
44
|
+
|
|
45
|
+
const customTestId = computed(() => {
|
|
46
|
+
const id = attrs['data-testid'] || 'field-phone-number'
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
label: `${id}__label`,
|
|
50
|
+
countryDropdown: `${id}__country-dropdown`,
|
|
51
|
+
filterInput: `${id}__filter-input`,
|
|
52
|
+
mobileInput: `${id}__mobile-input`,
|
|
53
|
+
description: `${id}__description`,
|
|
54
|
+
errorMobile: `${id}__error-mobile`,
|
|
55
|
+
errorCountryCode: `${id}__error-country-code`
|
|
56
|
+
}
|
|
57
|
+
})
|
|
58
|
+
|
|
59
|
+
const { value: countryCallCode, errorMessage: errorCountryCallCode } = useField(
|
|
60
|
+
countryCodeName,
|
|
61
|
+
undefined,
|
|
62
|
+
{ initialValue: '' }
|
|
63
|
+
)
|
|
64
|
+
const { value: mobile, errorMessage: errorMobile } = useField(mobileName, undefined, {
|
|
65
|
+
initialValue: ''
|
|
66
|
+
})
|
|
67
|
+
|
|
68
|
+
const handleCountryChange = () => {
|
|
69
|
+
emit('change:countryCode', countryCallCode.value)
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const handleMobileInput = () => {
|
|
73
|
+
emit('change:mobile', mobile.value)
|
|
74
|
+
}
|
|
75
|
+
</script>
|
|
76
|
+
|
|
77
|
+
<template>
|
|
78
|
+
<div class="flex flex-col sm:max-w-lg w-full gap-2">
|
|
79
|
+
<LabelBlock
|
|
80
|
+
:data-testid="customTestId.label"
|
|
81
|
+
:for="mobileName"
|
|
82
|
+
:label="props.label"
|
|
83
|
+
isRequired
|
|
84
|
+
/>
|
|
85
|
+
<div class="flex gap-2">
|
|
86
|
+
<div class="p-inputgroup">
|
|
87
|
+
<Dropdown
|
|
88
|
+
:data-testid="customTestId.countryDropdown"
|
|
89
|
+
filter
|
|
90
|
+
autoFilterFocus
|
|
91
|
+
appendTo="self"
|
|
92
|
+
:id="countryCodeName"
|
|
93
|
+
:name="countryCodeName"
|
|
94
|
+
:options="props.options"
|
|
95
|
+
optionLabel="labelFormat"
|
|
96
|
+
optionValue="value"
|
|
97
|
+
:loading="props.loading"
|
|
98
|
+
:disabled="props.loading || props.disabled"
|
|
99
|
+
:class="{ 'p-invalid': errorCountryCallCode }"
|
|
100
|
+
class="surface-border border-r-0 w-1/4"
|
|
101
|
+
v-model="countryCallCode"
|
|
102
|
+
@change="handleCountryChange"
|
|
103
|
+
:pt="{
|
|
104
|
+
filterInput: {
|
|
105
|
+
class: 'w-full',
|
|
106
|
+
'data-testid': customTestId.filterInput
|
|
107
|
+
}
|
|
108
|
+
}"
|
|
109
|
+
>
|
|
110
|
+
<template #option="{ option }">
|
|
111
|
+
{{ option.label }}
|
|
112
|
+
</template>
|
|
113
|
+
</Dropdown>
|
|
114
|
+
|
|
115
|
+
<InputMask
|
|
116
|
+
:data-testid="customTestId.mobileInput"
|
|
117
|
+
date="phone"
|
|
118
|
+
v-model="mobile"
|
|
119
|
+
class="w-full"
|
|
120
|
+
:name="mobileName"
|
|
121
|
+
:disabled="props.loading || props.disabled"
|
|
122
|
+
mask="?99999999999999999999"
|
|
123
|
+
placeholder="5500999999999"
|
|
124
|
+
:class="{ 'p-invalid': errorMobile }"
|
|
125
|
+
@update:modelValue="handleMobileInput"
|
|
126
|
+
/>
|
|
127
|
+
</div>
|
|
128
|
+
</div>
|
|
129
|
+
<small
|
|
130
|
+
v-if="errorCountryCallCode"
|
|
131
|
+
class="p-error text-xs font-normal leading-tight"
|
|
132
|
+
:data-testid="customTestId.errorCountryCode"
|
|
133
|
+
>
|
|
134
|
+
{{ errorCountryCallCode }}
|
|
135
|
+
</small>
|
|
136
|
+
<small
|
|
137
|
+
v-if="errorMobile"
|
|
138
|
+
class="p-error text-xs font-normal leading-tight"
|
|
139
|
+
:data-testid="customTestId.errorMobile"
|
|
140
|
+
>
|
|
141
|
+
{{ errorMobile }}
|
|
142
|
+
</small>
|
|
143
|
+
<small
|
|
144
|
+
v-if="props.description"
|
|
145
|
+
class="text-xs text-color-secondary font-normal leading-5"
|
|
146
|
+
:data-testid="customTestId.description"
|
|
147
|
+
>
|
|
148
|
+
{{ props.description }}
|
|
149
|
+
</small>
|
|
150
|
+
</div>
|
|
151
|
+
</template>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
declare const _default: typeof __VLS_export;
|
|
2
|
+
export default _default;
|
|
3
|
+
declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
4
|
+
options: {
|
|
5
|
+
type: ArrayConstructor;
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
loading: {
|
|
9
|
+
type: BooleanConstructor;
|
|
10
|
+
default: boolean;
|
|
11
|
+
};
|
|
12
|
+
disabled: {
|
|
13
|
+
type: BooleanConstructor;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
label: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
default: string;
|
|
19
|
+
};
|
|
20
|
+
description: {
|
|
21
|
+
type: StringConstructor;
|
|
22
|
+
default: string;
|
|
23
|
+
};
|
|
24
|
+
countryCodeName: {
|
|
25
|
+
type: StringConstructor;
|
|
26
|
+
default: string;
|
|
27
|
+
};
|
|
28
|
+
mobileName: {
|
|
29
|
+
type: StringConstructor;
|
|
30
|
+
default: string;
|
|
31
|
+
};
|
|
32
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
"change:countryCode": (...args: any[]) => void;
|
|
34
|
+
"change:mobile": (...args: any[]) => void;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
options: {
|
|
37
|
+
type: ArrayConstructor;
|
|
38
|
+
default: () => never[];
|
|
39
|
+
};
|
|
40
|
+
loading: {
|
|
41
|
+
type: BooleanConstructor;
|
|
42
|
+
default: boolean;
|
|
43
|
+
};
|
|
44
|
+
disabled: {
|
|
45
|
+
type: BooleanConstructor;
|
|
46
|
+
default: boolean;
|
|
47
|
+
};
|
|
48
|
+
label: {
|
|
49
|
+
type: StringConstructor;
|
|
50
|
+
default: string;
|
|
51
|
+
};
|
|
52
|
+
description: {
|
|
53
|
+
type: StringConstructor;
|
|
54
|
+
default: string;
|
|
55
|
+
};
|
|
56
|
+
countryCodeName: {
|
|
57
|
+
type: StringConstructor;
|
|
58
|
+
default: string;
|
|
59
|
+
};
|
|
60
|
+
mobileName: {
|
|
61
|
+
type: StringConstructor;
|
|
62
|
+
default: string;
|
|
63
|
+
};
|
|
64
|
+
}>> & Readonly<{
|
|
65
|
+
"onChange:countryCode"?: ((...args: any[]) => any) | undefined;
|
|
66
|
+
"onChange:mobile"?: ((...args: any[]) => any) | undefined;
|
|
67
|
+
}>, {
|
|
68
|
+
label: string;
|
|
69
|
+
description: string;
|
|
70
|
+
disabled: boolean;
|
|
71
|
+
loading: boolean;
|
|
72
|
+
options: unknown[];
|
|
73
|
+
countryCodeName: string;
|
|
74
|
+
mobileName: string;
|
|
75
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
76
|
+
//# sourceMappingURL=field-phone-number.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-phone-number.vue.d.ts","sourceRoot":"","sources":["field-phone-number.vue"],"names":[],"mappings":"wBAkdqB,OAAO,YAAY;;AAjCxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAgCG"}
|