@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.
Files changed (105) hide show
  1. package/package.json +46 -0
  2. package/src/core/field-auto-complete/field-auto-complete.vue +121 -0
  3. package/src/core/field-auto-complete/field-auto-complete.vue.d.ts +107 -0
  4. package/src/core/field-auto-complete/field-auto-complete.vue.d.ts.map +1 -0
  5. package/src/core/field-auto-complete/package.json +11 -0
  6. package/src/core/field-checkbox-block/field-checkbox-block.vue +106 -0
  7. package/src/core/field-checkbox-block/field-checkbox-block.vue.d.ts +111 -0
  8. package/src/core/field-checkbox-block/field-checkbox-block.vue.d.ts.map +1 -0
  9. package/src/core/field-checkbox-block/package.json +11 -0
  10. package/src/core/field-dropdown/field-dropdown.vue +240 -0
  11. package/src/core/field-dropdown/field-dropdown.vue.d.ts +203 -0
  12. package/src/core/field-dropdown/field-dropdown.vue.d.ts.map +1 -0
  13. package/src/core/field-dropdown/package.json +11 -0
  14. package/src/core/field-dropdown-icon/field-dropdown-icon.vue +129 -0
  15. package/src/core/field-dropdown-icon/field-dropdown-icon.vue.d.ts +111 -0
  16. package/src/core/field-dropdown-icon/field-dropdown-icon.vue.d.ts.map +1 -0
  17. package/src/core/field-dropdown-icon/package.json +11 -0
  18. package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue +631 -0
  19. package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue.d.ts +196 -0
  20. package/src/core/field-dropdown-lazy-loader/field-dropdown-lazy-loader.vue.d.ts.map +1 -0
  21. package/src/core/field-dropdown-lazy-loader/package.json +11 -0
  22. package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue +426 -0
  23. package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts +158 -0
  24. package/src/core/field-dropdown-lazy-loader-dynamic/field-dropdown-lazy-loader-dynamic.vue.d.ts.map +1 -0
  25. package/src/core/field-dropdown-lazy-loader-dynamic/package.json +11 -0
  26. package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue +527 -0
  27. package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue.d.ts +203 -0
  28. package/src/core/field-dropdown-lazy-loader-with-filter/field-dropdown-lazy-loader-with-filter.vue.d.ts.map +1 -0
  29. package/src/core/field-dropdown-lazy-loader-with-filter/package.json +11 -0
  30. package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue +439 -0
  31. package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue.d.ts +162 -0
  32. package/src/core/field-dropdown-multi-select-lazy-loader/field-dropdown-multi-select-lazy-loader.vue.d.ts.map +1 -0
  33. package/src/core/field-dropdown-multi-select-lazy-loader/package.json +11 -0
  34. package/src/core/field-group-checkbox/field-group-checkbox.vue +102 -0
  35. package/src/core/field-group-checkbox/field-group-checkbox.vue.d.ts +87 -0
  36. package/src/core/field-group-checkbox/field-group-checkbox.vue.d.ts.map +1 -0
  37. package/src/core/field-group-checkbox/package.json +11 -0
  38. package/src/core/field-group-radio/field-group-radio.vue +149 -0
  39. package/src/core/field-group-radio/field-group-radio.vue.d.ts +99 -0
  40. package/src/core/field-group-radio/field-group-radio.vue.d.ts.map +1 -0
  41. package/src/core/field-group-radio/package.json +11 -0
  42. package/src/core/field-group-switch/field-group-switch.vue +121 -0
  43. package/src/core/field-group-switch/field-group-switch.vue.d.ts +87 -0
  44. package/src/core/field-group-switch/field-group-switch.vue.d.ts.map +1 -0
  45. package/src/core/field-group-switch/package.json +11 -0
  46. package/src/core/field-input-group/field-input-group.vue +111 -0
  47. package/src/core/field-input-group/field-input-group.vue.d.ts +87 -0
  48. package/src/core/field-input-group/field-input-group.vue.d.ts.map +1 -0
  49. package/src/core/field-input-group/package.json +11 -0
  50. package/src/core/field-multi-select/field-multi-select.vue +167 -0
  51. package/src/core/field-multi-select/field-multi-select.vue.d.ts +136 -0
  52. package/src/core/field-multi-select/field-multi-select.vue.d.ts.map +1 -0
  53. package/src/core/field-multi-select/package.json +11 -0
  54. package/src/core/field-number/field-number.vue +144 -0
  55. package/src/core/field-number/field-number.vue.d.ts +132 -0
  56. package/src/core/field-number/field-number.vue.d.ts.map +1 -0
  57. package/src/core/field-number/package.json +11 -0
  58. package/src/core/field-phone-number/field-phone-number.vue +151 -0
  59. package/src/core/field-phone-number/field-phone-number.vue.d.ts +76 -0
  60. package/src/core/field-phone-number/field-phone-number.vue.d.ts.map +1 -0
  61. package/src/core/field-phone-number/package.json +11 -0
  62. package/src/core/field-phone-number-country/field-phone-number-country.vue +60 -0
  63. package/src/core/field-phone-number-country/field-phone-number-country.vue.d.ts +18 -0
  64. package/src/core/field-phone-number-country/field-phone-number-country.vue.d.ts.map +1 -0
  65. package/src/core/field-phone-number-country/package.json +11 -0
  66. package/src/core/field-pick-list/field-pick-list.vue +285 -0
  67. package/src/core/field-pick-list/field-pick-list.vue.d.ts +43 -0
  68. package/src/core/field-pick-list/field-pick-list.vue.d.ts.map +1 -0
  69. package/src/core/field-pick-list/package.json +11 -0
  70. package/src/core/field-radio-block/field-radio-block.vue +108 -0
  71. package/src/core/field-radio-block/field-radio-block.vue.d.ts +115 -0
  72. package/src/core/field-radio-block/field-radio-block.vue.d.ts.map +1 -0
  73. package/src/core/field-radio-block/package.json +11 -0
  74. package/src/core/field-switch/field-switch.vue +41 -0
  75. package/src/core/field-switch/field-switch.vue.d.ts +33 -0
  76. package/src/core/field-switch/field-switch.vue.d.ts.map +1 -0
  77. package/src/core/field-switch/package.json +11 -0
  78. package/src/core/field-switch-block/field-switch-block.vue +123 -0
  79. package/src/core/field-switch-block/field-switch-block.vue.d.ts +123 -0
  80. package/src/core/field-switch-block/field-switch-block.vue.d.ts.map +1 -0
  81. package/src/core/field-switch-block/package.json +11 -0
  82. package/src/core/field-text/field-text.vue +128 -0
  83. package/src/core/field-text/field-text.vue.d.ts +108 -0
  84. package/src/core/field-text/field-text.vue.d.ts.map +1 -0
  85. package/src/core/field-text/package.json +11 -0
  86. package/src/core/field-text-area/field-text-area.vue +178 -0
  87. package/src/core/field-text-area/field-text-area.vue.d.ts +142 -0
  88. package/src/core/field-text-area/field-text-area.vue.d.ts.map +1 -0
  89. package/src/core/field-text-area/package.json +11 -0
  90. package/src/core/field-text-icon/field-text-icon.vue +127 -0
  91. package/src/core/field-text-icon/field-text-icon.vue.d.ts +100 -0
  92. package/src/core/field-text-icon/field-text-icon.vue.d.ts.map +1 -0
  93. package/src/core/field-text-icon/package.json +11 -0
  94. package/src/core/field-text-password/field-text-password.vue +127 -0
  95. package/src/core/field-text-password/field-text-password.vue.d.ts +108 -0
  96. package/src/core/field-text-password/field-text-password.vue.d.ts.map +1 -0
  97. package/src/core/field-text-password/package.json +11 -0
  98. package/src/core/label/label.vue +35 -0
  99. package/src/core/label/label.vue.d.ts +24 -0
  100. package/src/core/label/label.vue.d.ts.map +1 -0
  101. package/src/core/label/package.json +11 -0
  102. package/src/core/selector-block/package.json +11 -0
  103. package/src/core/selector-block/selector-block.vue +128 -0
  104. package/src/core/selector-block/selector-block.vue.d.ts +99 -0
  105. package/src/core/selector-block/selector-block.vue.d.ts.map +1 -0
@@ -0,0 +1,60 @@
1
+ <script setup>
2
+ import { computed, onMounted, ref, watch } from 'vue'
3
+ import { useField } from 'vee-validate'
4
+ import FieldPhoneNumber from '../field-phone-number'
5
+
6
+ const props = defineProps({
7
+ listCountriesPhoneService: {
8
+ type: Function,
9
+ required: true
10
+ }
11
+ })
12
+
13
+ const emit = defineEmits(['countries-loaded'])
14
+
15
+ const options = ref([])
16
+
17
+ const loading = computed(() => !options.value.length)
18
+
19
+ const { value: countryCallCode, resetField } = useField('countryCallCode')
20
+
21
+ const normalizeCountryCode = (countries) => {
22
+ const currentValue = countryCallCode.value
23
+ if (!currentValue) return
24
+
25
+ const hasExactMatch = countries.some((country) => country.value === currentValue)
26
+ if (hasExactMatch) return
27
+
28
+ const partialMatch = countries.find((country) => country.value.endsWith(` - ${currentValue}`))
29
+ if (partialMatch) {
30
+ resetField({ value: partialMatch.value })
31
+ }
32
+ }
33
+
34
+ watch(countryCallCode, (newValue) => {
35
+ if (!options.value.length || !newValue) return
36
+
37
+ const hasMatch = options.value.some((country) => country.value === newValue)
38
+ if (!hasMatch) {
39
+ const partialMatch = options.value.find((country) => country.value.endsWith(` - ${newValue}`))
40
+ if (partialMatch) {
41
+ resetField({ value: partialMatch.value })
42
+ }
43
+ }
44
+ })
45
+
46
+ onMounted(async () => {
47
+ const countries = await props.listCountriesPhoneService()
48
+ options.value = countries
49
+ normalizeCountryCode(countries)
50
+ emit('countries-loaded', countries)
51
+ })
52
+ </script>
53
+
54
+ <template>
55
+ <FieldPhoneNumber
56
+ v-bind="$attrs"
57
+ :options="options"
58
+ :loading="loading"
59
+ />
60
+ </template>
@@ -0,0 +1,18 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ listCountriesPhoneService: {
5
+ type: FunctionConstructor;
6
+ required: true;
7
+ };
8
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
9
+ "countries-loaded": (...args: any[]) => void;
10
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
11
+ listCountriesPhoneService: {
12
+ type: FunctionConstructor;
13
+ required: true;
14
+ };
15
+ }>> & Readonly<{
16
+ "onCountries-loaded"?: ((...args: any[]) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
18
+ //# sourceMappingURL=field-phone-number-country.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-phone-number-country.vue.d.ts","sourceRoot":"","sources":["field-phone-number-country.vue"],"names":[],"mappings":"wBAkKqB,OAAO,YAAY;;AATxC;;;;;;;;;;;;;;kFAQG"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "main": "./field-phone-number-country.vue",
3
+ "module": "./field-phone-number-country.vue",
4
+ "types": "./field-phone-number-country.vue.d.ts",
5
+ "browser": {
6
+ "./sfc": "./field-phone-number-country.vue"
7
+ },
8
+ "sideEffects": [
9
+ "*.vue"
10
+ ]
11
+ }
@@ -0,0 +1,285 @@
1
+ <template>
2
+ <div>
3
+ <PickList
4
+ :modelValue="[filteredSource, filteredTarget]"
5
+ :disabled="disabled"
6
+ @update:modelValue="onPickListUpdate"
7
+ :pt="{
8
+ sourceList: { class: ['h-80'] },
9
+ targetList: { class: ['h-80'] },
10
+ sourceWrapper: { class: 'max-w-[340px]' },
11
+ targetWrapper: { class: 'max-w-[340px]' }
12
+ }"
13
+ :dataKey="dataKey"
14
+ breakpoint="1400px"
15
+ :showSourceControls="false"
16
+ :showTargetControls="false"
17
+ data-testid="picklist__field"
18
+ :move-all-to-source-props="{
19
+ 'data-testid': 'picklist__move-all-to-source-btn'
20
+ }"
21
+ :move-all-to-target-props="{
22
+ 'data-testid': 'picklist__move-all-to-target-btn'
23
+ }"
24
+ :move-to-target-props="{
25
+ 'data-testid': 'picklist__move-to-target-btn'
26
+ }"
27
+ :move-to-source-props="{
28
+ 'data-testid': 'picklist__move-to-source-btn'
29
+ }"
30
+ >
31
+ <template #sourceheader>
32
+ <div class="flex flex-col w-full">
33
+ <span class="mb-4">Available {{ title }}</span>
34
+
35
+ <Divider class="ml-[-16px] w-[calc(100%+32px)]" />
36
+
37
+ <span class="p-input-icon-right w-full mt-4">
38
+ <i class="pi pi-search text-[var(--text-color-secondary)]" />
39
+ <InputText
40
+ class="h-8 w-full"
41
+ v-model.trim="searchSource"
42
+ data-testid="search-input-source"
43
+ placeholder="Search"
44
+ />
45
+ </span>
46
+ </div>
47
+ </template>
48
+ <template #targetheader>
49
+ <div class="flex flex-col w-full">
50
+ <span class="mb-4">Chosen {{ title }}</span>
51
+
52
+ <Divider class="ml-[-16px] w-[calc(100%+32px)]" />
53
+
54
+ <span class="p-input-icon-right w-full mt-4">
55
+ <i class="pi pi-search text-[var(--text-color-secondary)]" />
56
+ <InputText
57
+ class="h-8 w-full"
58
+ v-model.trim="searchTarget"
59
+ data-testid="search-input-target"
60
+ placeholder="Search"
61
+ />
62
+ </span>
63
+ </div>
64
+ </template>
65
+
66
+ <template #item="slotProps">
67
+ <div class="flex flex-wrap pl-3 align-items-center gap-3 py-2">
68
+ <div
69
+ class="flex-1 flex flex-column gap-2"
70
+ v-if="!slotProps.item?.loading"
71
+ >
72
+ <span data-testid="picklist_name-item">{{ slotProps.item.name }} </span>
73
+ </div>
74
+ <div
75
+ class="flex-1 flex flex-column gap-2"
76
+ v-else
77
+ >
78
+ <ProgressSpinner style="width: 25px; height: 25px" />
79
+ </div>
80
+ </div>
81
+ </template>
82
+ </PickList>
83
+ </div>
84
+ </template>
85
+
86
+ <script setup>
87
+ import { ref, onMounted, onBeforeUnmount, nextTick, computed, watch } from 'vue'
88
+ import { watchDebounced } from '@vueuse/core'
89
+ import PickList from 'primevue/picklist'
90
+ import ProgressSpinner from 'primevue/progressspinner'
91
+ import InputText from 'primevue/inputtext'
92
+ import Divider from 'primevue/divider'
93
+ import { useToast } from 'primevue/usetoast'
94
+
95
+ const props = defineProps({
96
+ disabled: {
97
+ type: Boolean
98
+ },
99
+ dataPick: {
100
+ type: Array,
101
+ default: () => [[], []]
102
+ },
103
+ dataKey: {
104
+ type: String,
105
+ required: true
106
+ },
107
+ title: {
108
+ type: String
109
+ },
110
+ service: {
111
+ type: Function
112
+ }
113
+ })
114
+ let scrollElement = null
115
+ const PAGE_SIZE = 100
116
+ const page = ref(1)
117
+ const PAGE_INCREMENT = 1
118
+ const notRequest = ref(false)
119
+ const NUMBER_OF_CHARACTERS_MIN_FOR_SEARCH = 3
120
+ const NUMBER_OF_CHARACTERS_TO_RESET_SEARCH = 0
121
+ const SEARCH_DEBOUNCE = 500
122
+ const SEARCH_MAX_WAIT = 1000
123
+ const searchSource = ref('')
124
+ const searchTarget = ref('')
125
+ const originalSource = ref([])
126
+ const originalTarget = ref([])
127
+ const data = ref(props.dataPick)
128
+ const loading = ref(false)
129
+
130
+ const toast = useToast()
131
+
132
+ const addUniqueItems = (targetArray, itemsToAdd) => {
133
+ const existingIds = new Set(targetArray.map((item) => item.id))
134
+ itemsToAdd.forEach((item) => {
135
+ if (!existingIds.has(item.id)) {
136
+ data.value[0].push(item)
137
+ }
138
+ })
139
+ }
140
+ const handleLazyLoad = async () => {
141
+ if (!notRequest.value) {
142
+ page.value += PAGE_INCREMENT
143
+ await fetchData(page.value)
144
+ if (!searchSource.value) {
145
+ originalSource.value = [...data.value[0]]
146
+ }
147
+ }
148
+ }
149
+ const handleScroll = (event) => {
150
+ const element = event.target
151
+ const isBottom = element.scrollTop + element.clientHeight >= element.scrollHeight
152
+ if (isBottom && !loading.value) {
153
+ handleLazyLoad()
154
+ }
155
+ }
156
+ const filteredSource = computed(() => {
157
+ return data.value[0]
158
+ })
159
+ const filteredTarget = computed(() => {
160
+ return data.value[1]?.filter((item) =>
161
+ item.name.toLowerCase().includes(searchTarget.value.toLowerCase())
162
+ )
163
+ })
164
+ const handleSelectItemWithSearch = () => {
165
+ const idsParaRemover = new Set(data.value[1].map((item) => item.id))
166
+ data.value[0] = originalSource.value.filter((item) => !idsParaRemover.has(item.id))
167
+ originalSource.value = data.value[0]
168
+ }
169
+ const setOriginalTarget = (target) => {
170
+ originalTarget.value = target
171
+ }
172
+ const handleSelectItemWithSearchTarget = (targets) => {
173
+ const map = new Map()
174
+ originalTarget.value.forEach((item) => {
175
+ map.set(item.id, item)
176
+ })
177
+ targets.forEach((item) => {
178
+ map.set(item.id, item)
179
+ })
180
+ data.value[1] = Array.from(map.values())
181
+ }
182
+ function onPickListUpdate([newSource, newTarget]) {
183
+ data.value[0] = newSource
184
+ data.value[1] = newTarget
185
+ if (searchSource.value) {
186
+ handleSelectItemWithSearch()
187
+ } else {
188
+ originalSource.value = [...data.value[0]]
189
+ }
190
+ if (searchTarget.value) {
191
+ handleSelectItemWithSearchTarget(newTarget)
192
+ } else {
193
+ setOriginalTarget(newTarget)
194
+ }
195
+ }
196
+ const searchFilter = () => {
197
+ const pageToSearch = 1
198
+ data.value[0] = []
199
+ if (!searchSource.value) {
200
+ data.value[0] = [...originalSource.value]
201
+ return
202
+ }
203
+ fetchData(pageToSearch)
204
+ }
205
+ const loadingPickList = () => {
206
+ data.value[0].push({ id: 0, loading: true })
207
+ }
208
+ const removeLoadingPickList = () => {
209
+ data.value[0].pop()
210
+ }
211
+ const fetchData = async (currentPage = 1) => {
212
+ loading.value = true
213
+ loadingPickList()
214
+ try {
215
+ const response = await props.service({
216
+ pageSize: PAGE_SIZE,
217
+ fields: 'id, name',
218
+ page: currentPage,
219
+ search: searchSource.value,
220
+ ordering: 'name'
221
+ })
222
+ // remove load item
223
+ removeLoadingPickList()
224
+ const dataPicks = [...data.value[0], ...data.value[1]]
225
+ addUniqueItems(dataPicks, response.results)
226
+ } catch (error) {
227
+ notRequest.value = true
228
+ removeLoadingPickList()
229
+
230
+ toast.add({
231
+ severity: 'info',
232
+ summary: 'Info',
233
+ detail: 'No more items to load',
234
+ life: 5000
235
+ })
236
+ } finally {
237
+ loading.value = false
238
+ }
239
+ }
240
+ watchDebounced(
241
+ searchSource,
242
+ () => {
243
+ if (
244
+ searchSource.value.length >= NUMBER_OF_CHARACTERS_MIN_FOR_SEARCH ||
245
+ searchSource.value.length === NUMBER_OF_CHARACTERS_TO_RESET_SEARCH
246
+ ) {
247
+ searchFilter()
248
+ }
249
+ },
250
+ { debounce: SEARCH_DEBOUNCE, maxWait: SEARCH_MAX_WAIT }
251
+ )
252
+
253
+ watch(
254
+ () => props.dataPick,
255
+ (newDataPick) => {
256
+ if (newDataPick && Array.isArray(newDataPick)) {
257
+ data.value = newDataPick
258
+ originalSource.value = [...(newDataPick[0] || [])]
259
+ originalTarget.value = [...(newDataPick[1] || [])]
260
+ }
261
+ },
262
+ { deep: true }
263
+ )
264
+ onMounted(async () => {
265
+ await nextTick()
266
+ scrollElement = document.querySelector('.p-picklist-source-list')
267
+ if (scrollElement) {
268
+ scrollElement.addEventListener('scroll', handleScroll)
269
+ }
270
+ originalSource.value = [...props.dataPick[0]]
271
+ originalTarget.value = [...props.dataPick[1]]
272
+ })
273
+ onBeforeUnmount(() => {
274
+ if (scrollElement) {
275
+ scrollElement.removeEventListener('scroll', handleScroll)
276
+ }
277
+ })
278
+ </script>
279
+
280
+ <style>
281
+ .p-picklist-source-wrapper .p-picklist-list li,
282
+ .p-picklist-target-wrapper .p-picklist-list li {
283
+ padding: 0 !important;
284
+ }
285
+ </style>
@@ -0,0 +1,43 @@
1
+ declare const _default: typeof __VLS_export;
2
+ export default _default;
3
+ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
4
+ disabled: {
5
+ type: BooleanConstructor;
6
+ };
7
+ dataPick: {
8
+ type: ArrayConstructor;
9
+ default: () => never[][];
10
+ };
11
+ dataKey: {
12
+ type: StringConstructor;
13
+ required: true;
14
+ };
15
+ title: {
16
+ type: StringConstructor;
17
+ };
18
+ service: {
19
+ type: FunctionConstructor;
20
+ };
21
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
22
+ disabled: {
23
+ type: BooleanConstructor;
24
+ };
25
+ dataPick: {
26
+ type: ArrayConstructor;
27
+ default: () => never[][];
28
+ };
29
+ dataKey: {
30
+ type: StringConstructor;
31
+ required: true;
32
+ };
33
+ title: {
34
+ type: StringConstructor;
35
+ };
36
+ service: {
37
+ type: FunctionConstructor;
38
+ };
39
+ }>> & Readonly<{}>, {
40
+ disabled: boolean;
41
+ dataPick: unknown[];
42
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
43
+ //# sourceMappingURL=field-pick-list.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-pick-list.vue.d.ts","sourceRoot":"","sources":["field-pick-list.vue"],"names":[],"mappings":"wBA+vBqB,OAAO,YAAY;;AArBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAoBG"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "main": "./field-pick-list.vue",
3
+ "module": "./field-pick-list.vue",
4
+ "types": "./field-pick-list.vue.d.ts",
5
+ "browser": {
6
+ "./sfc": "./field-pick-list.vue"
7
+ },
8
+ "sideEffects": [
9
+ "*.vue"
10
+ ]
11
+ }
@@ -0,0 +1,108 @@
1
+ <template>
2
+ <SelectorBlock
3
+ v-bind="props"
4
+ :selected="checked"
5
+ :nameId="props.name"
6
+ @click="clickCard"
7
+ >
8
+ <template #selector>
9
+ <PrimeRadio
10
+ :disabled="disabled"
11
+ :inputId="props.name"
12
+ :name="props.name"
13
+ @click="stopPropagation"
14
+ :value="props.inputValue"
15
+ v-model="inputValue"
16
+ :binary="props.binary"
17
+ @change="emit('onRadioChange')"
18
+ />
19
+ </template>
20
+ <template #footer>
21
+ <slot name="footer" />
22
+ </template>
23
+ </SelectorBlock>
24
+ </template>
25
+
26
+ <script setup>
27
+ import PrimeRadio from 'primevue/radiobutton'
28
+ import SelectorBlock from '../selector-block'
29
+
30
+ import { useField } from 'vee-validate'
31
+ import { toRefs } from 'vue'
32
+
33
+ defineOptions({ name: 'FieldRadioBlock' })
34
+ const emit = defineEmits(['onRadioChange'])
35
+
36
+ const props = defineProps({
37
+ title: {
38
+ type: String
39
+ },
40
+ isLabel: {
41
+ type: Boolean,
42
+ default: false
43
+ },
44
+ subtitle: {
45
+ type: String
46
+ },
47
+ description: {
48
+ type: String
49
+ },
50
+ disabled: {
51
+ type: Boolean,
52
+ default: false
53
+ },
54
+ auto: {
55
+ type: Boolean,
56
+ default: false
57
+ },
58
+ isCard: {
59
+ type: Boolean,
60
+ default: true
61
+ },
62
+ hideSelector: {
63
+ type: Boolean,
64
+ default: false
65
+ },
66
+ nameField: {
67
+ type: String,
68
+ required: true
69
+ },
70
+ name: {
71
+ type: String,
72
+ required: true
73
+ },
74
+ inputValue: {
75
+ type: [Boolean, String, Object],
76
+ default: false
77
+ },
78
+ binary: {
79
+ type: Boolean,
80
+ default: false
81
+ }
82
+ })
83
+
84
+ const { nameField } = toRefs(props)
85
+
86
+ const {
87
+ value: inputValue,
88
+ checked,
89
+ handleChange
90
+ } = useField(nameField, undefined, {
91
+ type: 'checkbox',
92
+ checkedValue: props.binary ? true : props.inputValue,
93
+ uncheckedValue: props.binary ? false : ''
94
+ })
95
+
96
+ const stopPropagation = (event) => {
97
+ event.preventDefault()
98
+ event.stopPropagation()
99
+ }
100
+
101
+ const clickCard = (event) => {
102
+ if (props.binary) {
103
+ stopPropagation(event)
104
+ handleChange(!inputValue.value)
105
+ return
106
+ }
107
+ }
108
+ </script>
@@ -0,0 +1,115 @@
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
+ title: {
9
+ type: StringConstructor;
10
+ };
11
+ isLabel: {
12
+ type: BooleanConstructor;
13
+ default: boolean;
14
+ };
15
+ subtitle: {
16
+ type: StringConstructor;
17
+ };
18
+ description: {
19
+ type: StringConstructor;
20
+ };
21
+ disabled: {
22
+ type: BooleanConstructor;
23
+ default: boolean;
24
+ };
25
+ auto: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ isCard: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ hideSelector: {
34
+ type: BooleanConstructor;
35
+ default: boolean;
36
+ };
37
+ nameField: {
38
+ type: StringConstructor;
39
+ required: true;
40
+ };
41
+ name: {
42
+ type: StringConstructor;
43
+ required: true;
44
+ };
45
+ inputValue: {
46
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor)[];
47
+ default: boolean;
48
+ };
49
+ binary: {
50
+ type: BooleanConstructor;
51
+ default: boolean;
52
+ };
53
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
54
+ onRadioChange: (...args: any[]) => void;
55
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
+ title: {
57
+ type: StringConstructor;
58
+ };
59
+ isLabel: {
60
+ type: BooleanConstructor;
61
+ default: boolean;
62
+ };
63
+ subtitle: {
64
+ type: StringConstructor;
65
+ };
66
+ description: {
67
+ type: StringConstructor;
68
+ };
69
+ disabled: {
70
+ type: BooleanConstructor;
71
+ default: boolean;
72
+ };
73
+ auto: {
74
+ type: BooleanConstructor;
75
+ default: boolean;
76
+ };
77
+ isCard: {
78
+ type: BooleanConstructor;
79
+ default: boolean;
80
+ };
81
+ hideSelector: {
82
+ type: BooleanConstructor;
83
+ default: boolean;
84
+ };
85
+ nameField: {
86
+ type: StringConstructor;
87
+ required: true;
88
+ };
89
+ name: {
90
+ type: StringConstructor;
91
+ required: true;
92
+ };
93
+ inputValue: {
94
+ type: (StringConstructor | BooleanConstructor | ObjectConstructor)[];
95
+ default: boolean;
96
+ };
97
+ binary: {
98
+ type: BooleanConstructor;
99
+ default: boolean;
100
+ };
101
+ }>> & Readonly<{
102
+ onOnRadioChange?: ((...args: any[]) => any) | undefined;
103
+ }>, {
104
+ disabled: boolean;
105
+ inputValue: string | boolean | Record<string, any>;
106
+ isLabel: boolean;
107
+ auto: boolean;
108
+ isCard: boolean;
109
+ hideSelector: boolean;
110
+ binary: boolean;
111
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
112
+ type __VLS_Slots = {
113
+ footer?: ((props: {}) => any) | undefined;
114
+ };
115
+ //# sourceMappingURL=field-radio-block.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-radio-block.vue.d.ts","sourceRoot":"","sources":["field-radio-block.vue"],"names":[],"mappings":"wBA+VqB,OAAO,YAAY;;AADxC,4BAA2B,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;qBAEtD,CAAC,EAAE,CAAC;;;AApDzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EAiDG"}
@@ -0,0 +1,11 @@
1
+ {
2
+ "main": "./field-radio-block.vue",
3
+ "module": "./field-radio-block.vue",
4
+ "types": "./field-radio-block.vue.d.ts",
5
+ "browser": {
6
+ "./sfc": "./field-radio-block.vue"
7
+ },
8
+ "sideEffects": [
9
+ "*.vue"
10
+ ]
11
+ }