@tekkare/auriga 0.1.24 → 0.1.26

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.
@@ -22,8 +22,7 @@ declare const _default: import("vue").DefineComponent<{
22
22
  };
23
23
  filter_placeholder: {
24
24
  type: StringConstructor;
25
- required: false;
26
- default: string;
25
+ default: null;
27
26
  };
28
27
  close_on_click: {
29
28
  type: BooleanConstructor;
@@ -52,7 +51,7 @@ declare const _default: import("vue").DefineComponent<{
52
51
  };
53
52
  empty_msg: {
54
53
  type: StringConstructor;
55
- default: string;
54
+ default: null;
56
55
  };
57
56
  dropdown_label: {
58
57
  type: StringConstructor;
@@ -62,6 +61,32 @@ declare const _default: import("vue").DefineComponent<{
62
61
  type: BooleanConstructor;
63
62
  default: boolean;
64
63
  };
64
+ lang: {
65
+ type: StringConstructor;
66
+ default: string;
67
+ validator: (value: string) => boolean;
68
+ };
69
+ loader_text: {
70
+ type: {
71
+ (arrayLength: number): string[];
72
+ (...items: string[]): string[];
73
+ new (arrayLength: number): string[];
74
+ new (...items: string[]): string[];
75
+ isArray(arg: any): arg is any[];
76
+ readonly prototype: any[];
77
+ from<T>(arrayLike: ArrayLike<T>): T[];
78
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
79
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
80
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
81
+ of<T_4>(...items: T_4[]): T_4[];
82
+ readonly [Symbol.species]: ArrayConstructor;
83
+ };
84
+ default: null;
85
+ };
86
+ empty_content_msg: {
87
+ type: StringConstructor;
88
+ default: null;
89
+ };
65
90
  }, {
66
91
  isDisplay: import("vue").Ref<boolean>;
67
92
  searchName: import("vue").Ref<string>;
@@ -73,9 +98,13 @@ declare const _default: import("vue").DefineComponent<{
73
98
  checkActiveEllipsis: () => void;
74
99
  add_element: (element: string, index: number) => void;
75
100
  closeDropdown: () => void;
76
- filterName: () => string[];
101
+ filterName: import("vue").ComputedRef<string[]>;
77
102
  changeDisplay: () => void;
78
103
  changeInput: () => void;
104
+ getEmptyMsg: import("vue").ComputedRef<string>;
105
+ getLoaderText: import("vue").ComputedRef<string[]>;
106
+ getPlaceholder: import("vue").ComputedRef<string>;
107
+ getEmptyContentMsg: import("vue").ComputedRef<string>;
79
108
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("changeElement" | "update:Selection" | "changeInputValue")[], "changeElement" | "update:Selection" | "changeInputValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
80
109
  element_table: {
81
110
  type: {
@@ -100,8 +129,7 @@ declare const _default: import("vue").DefineComponent<{
100
129
  };
101
130
  filter_placeholder: {
102
131
  type: StringConstructor;
103
- required: false;
104
- default: string;
132
+ default: null;
105
133
  };
106
134
  close_on_click: {
107
135
  type: BooleanConstructor;
@@ -130,7 +158,7 @@ declare const _default: import("vue").DefineComponent<{
130
158
  };
131
159
  empty_msg: {
132
160
  type: StringConstructor;
133
- default: string;
161
+ default: null;
134
162
  };
135
163
  dropdown_label: {
136
164
  type: StringConstructor;
@@ -140,15 +168,44 @@ declare const _default: import("vue").DefineComponent<{
140
168
  type: BooleanConstructor;
141
169
  default: boolean;
142
170
  };
171
+ lang: {
172
+ type: StringConstructor;
173
+ default: string;
174
+ validator: (value: string) => boolean;
175
+ };
176
+ loader_text: {
177
+ type: {
178
+ (arrayLength: number): string[];
179
+ (...items: string[]): string[];
180
+ new (arrayLength: number): string[];
181
+ new (...items: string[]): string[];
182
+ isArray(arg: any): arg is any[];
183
+ readonly prototype: any[];
184
+ from<T>(arrayLike: ArrayLike<T>): T[];
185
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
186
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
187
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
188
+ of<T_4>(...items: T_4[]): T_4[];
189
+ readonly [Symbol.species]: ArrayConstructor;
190
+ };
191
+ default: null;
192
+ };
193
+ empty_content_msg: {
194
+ type: StringConstructor;
195
+ default: null;
196
+ };
143
197
  }>> & {
144
198
  onChangeElement?: ((...args: any[]) => any) | undefined;
145
199
  "onUpdate:Selection"?: ((...args: any[]) => any) | undefined;
146
200
  onChangeInputValue?: ((...args: any[]) => any) | undefined;
147
201
  }, {
202
+ lang: string;
148
203
  loading: boolean;
149
204
  return_value: boolean;
150
205
  disabled: boolean;
151
206
  empty_msg: string;
207
+ loader_text: string[];
208
+ empty_content_msg: string;
152
209
  search: boolean;
153
210
  filter_placeholder: string;
154
211
  close_on_click: boolean;
@@ -23,7 +23,7 @@
23
23
  (nested && selected_nested.length > 0) ||
24
24
  (!nested && selected_items.length > 0)
25
25
  ? getAllSelect
26
- : emptyMsg
26
+ : getEmptyMsg
27
27
  }}
28
28
  </p>
29
29
  </arg-simple-label>
@@ -40,113 +40,78 @@
40
40
  <input
41
41
  v-model="searchName"
42
42
  class="oip_search_name"
43
- placeholder="Search"
43
+ :placeholder="getPlaceholder"
44
44
  @input="changeInput()"
45
45
  />
46
46
  </div>
47
- <arg-data-loader v-if="loading" />
48
- <div v-else>
49
- <!-- List -->
50
- <div v-if="!nested" class="oip_select_dropdown_selection_container">
51
- <div
52
- v-if="show_all"
53
- class="oip_select_complex_selection_loop"
54
- @click="
47
+ <arg-data-loader
48
+ v-if="loading"
49
+ :text="getLoaderText[0]"
50
+ :sub-text="getLoaderText[1]"
51
+ />
52
+ <div class="oip_empty_dropdown" v-else-if="filterName.length === 0">
53
+ <p>{{ getEmptyContentMsg }}</p>
54
+ </div>
55
+ <!-- List -->
56
+ <div v-else-if="!nested" class="oip_select_dropdown_selection_container">
57
+ <div
58
+ v-if="show_all"
59
+ class="oip_select_complex_selection_loop"
60
+ @click="
61
+ selected_all || getOptions.length === selected_items.length
62
+ ? del_all()
63
+ : add_all()
64
+ "
65
+ >
66
+ <arg-icon
67
+ :class="
68
+ !selected_all && getOptions.length !== selected_items.length
69
+ ? 'del'
70
+ : 'add'
71
+ "
72
+ thickness="24"
73
+ size="16px"
74
+ :name="
55
75
  selected_all || getOptions.length === selected_items.length
56
- ? del_all()
57
- : add_all()
76
+ ? 'CheckSquareFill'
77
+ : 'Square'
58
78
  "
79
+ />
80
+ <div
81
+ :class="[
82
+ 'oip_select_complex_selection_loop_name',
83
+ !selected_all && getOptions.length !== selected_items.length
84
+ ? 'del'
85
+ : 'add',
86
+ ]"
59
87
  >
60
- <arg-icon
61
- :class="
62
- !selected_all && getOptions.length !== selected_items.length
63
- ? 'del'
64
- : 'add'
65
- "
66
- thickness="24"
67
- size="16px"
68
- :name="
69
- selected_all || getOptions.length === selected_items.length
70
- ? 'CheckSquareFill'
71
- : 'Square'
72
- "
73
- />
74
- <div
75
- :class="[
76
- 'oip_select_complex_selection_loop_name',
77
- !selected_all && getOptions.length !== selected_items.length
78
- ? 'del'
79
- : 'add',
80
- ]"
81
- >
82
- All
83
- </div>
88
+ {{ lang === "fr" ? "Tous" : "All" }}
84
89
  </div>
85
- <div :class="show_all ? 'oip_select_multiple_left_margin' : ''">
86
- <div v-if="multiple_columns" class="oip_row v-start gap-16">
87
- <div v-for="(table, tabIndex) of filterName" :key="tabIndex">
88
- <div
89
- v-for="(element, index) of table"
90
- :key="index"
91
- class="oip_select_complex_selection_loop multiple"
92
- :class="
93
- options_disable.includes(index + tabIndex * 7)
94
- ? 'disabled'
95
- : ''
96
- "
97
- @click="
98
- selected_items.includes(element)
99
- ? del_element(element, index + tabIndex * 7)
100
- : add_element(element, index + tabIndex * 7)
101
- "
102
- >
103
- <arg-icon
104
- v-if="
105
- tabIndex === 0
106
- ? options_disable.includes(index)
107
- : options_disable.includes(index + tabIndex * 7)
108
- "
109
- name="MinusSquareDisable"
110
- size="16"
111
- color="var(--independence)"
112
- class="disable"
113
- />
114
- <arg-icon
115
- v-else
116
- :class="selected_items.includes(element) ? 'add' : ''"
117
- size="16px"
118
- thickness="24"
119
- :name="
120
- selected_items.includes(element)
121
- ? 'CheckSquareFill'
122
- : 'Square'
123
- "
124
- />
125
- <div
126
- :class="[
127
- 'oip_select_complex_selection_loop_name',
128
- selected_items.includes(element) ? 'add' : 'del',
129
- ]"
130
- >
131
- {{ element }}
132
- </div>
133
- </div>
134
- </div>
135
- </div>
136
- <div v-else>
90
+ </div>
91
+ <div :class="show_all ? 'oip_select_multiple_left_margin' : ''">
92
+ <div v-if="multiple_columns" class="oip_row v-start gap-16">
93
+ <div v-for="(table, tabIndex) of filterName" :key="tabIndex">
137
94
  <div
138
- v-for="(element, index) of filterName"
95
+ v-for="(element, index) of table"
139
96
  :key="index"
140
97
  class="oip_select_complex_selection_loop multiple"
141
- :class="options_disable.includes(index) ? 'disabled' : ''"
98
+ :class="
99
+ options_disable.includes(index + tabIndex * 7)
100
+ ? 'disabled'
101
+ : ''
102
+ "
142
103
  @click="
143
104
  selected_items.includes(element)
144
- ? del_element(element, index)
145
- : add_element(element, index)
105
+ ? del_element(element, index + tabIndex * 7)
106
+ : add_element(element, index + tabIndex * 7)
146
107
  "
147
108
  >
148
109
  <arg-icon
149
- v-if="options_disable.includes(index)"
110
+ v-if="
111
+ tabIndex === 0
112
+ ? options_disable.includes(index)
113
+ : options_disable.includes(index + tabIndex * 7)
114
+ "
150
115
  name="MinusSquareDisable"
151
116
  size="16"
152
117
  color="var(--independence)"
@@ -167,7 +132,6 @@
167
132
  :class="[
168
133
  'oip_select_complex_selection_loop_name',
169
134
  selected_items.includes(element) ? 'add' : 'del',
170
- options_disable.includes(index) ? 'disabled' : '',
171
135
  ]"
172
136
  >
173
137
  {{ element }}
@@ -175,119 +139,156 @@
175
139
  </div>
176
140
  </div>
177
141
  </div>
178
- </div>
179
- <div v-else class="oip_select_dropdown_selection_container">
180
- <div
181
- v-if="show_all"
182
- class="oip_select_complex_selection_loop"
183
- @click="
184
- selected_all || getOptions.length === nestedSelectedLength
185
- ? del_all()
186
- : add_all()
187
- "
188
- >
189
- <arg-icon
190
- :class="
191
- !selected_all && getOptions.length !== nestedSelectedLength
192
- ? 'del'
193
- : selected_all || getOptions.length === nestedSelectedLength
194
- ? 'add'
195
- : 'more'
196
- "
197
- thickness="24"
198
- size="16px"
199
- :name="
200
- selected_all || getOptions.length === nestedSelectedLength
201
- ? 'CheckSquareFill'
202
- : 'Square'
203
- "
204
- />
142
+ <div v-else>
205
143
  <div
206
- :class="[
207
- 'oip_select_complex_selection_loop_name',
208
- !selected_all && getOptions.length !== nestedSelectedLength
209
- ? 'del'
210
- : selected_all || getOptions.length === nestedSelectedLength
211
- ? 'add'
212
- : 'more',
213
- ]"
144
+ v-for="(element, index) of filterName"
145
+ :key="index"
146
+ class="oip_select_complex_selection_loop multiple"
147
+ :class="options_disable.includes(index) ? 'disabled' : ''"
148
+ @click="
149
+ selected_items.includes(element)
150
+ ? del_element(element, index)
151
+ : add_element(element, index)
152
+ "
214
153
  >
215
- All
154
+ <arg-icon
155
+ v-if="options_disable.includes(index)"
156
+ name="MinusSquareDisable"
157
+ size="16"
158
+ color="var(--independence)"
159
+ class="disable"
160
+ />
161
+ <arg-icon
162
+ v-else
163
+ :class="selected_items.includes(element) ? 'add' : ''"
164
+ size="16px"
165
+ thickness="24"
166
+ :name="
167
+ selected_items.includes(element)
168
+ ? 'CheckSquareFill'
169
+ : 'Square'
170
+ "
171
+ />
172
+ <div
173
+ :class="[
174
+ 'oip_select_complex_selection_loop_name',
175
+ selected_items.includes(element) ? 'add' : 'del',
176
+ options_disable.includes(index) ? 'disabled' : '',
177
+ ]"
178
+ >
179
+ {{ element }}
180
+ </div>
216
181
  </div>
217
182
  </div>
183
+ </div>
184
+ </div>
185
+ <div v-else class="oip_select_dropdown_selection_container">
186
+ <div
187
+ v-if="show_all"
188
+ class="oip_select_complex_selection_loop"
189
+ @click="
190
+ selected_all || getOptions.length === nestedSelectedLength
191
+ ? del_all()
192
+ : add_all()
193
+ "
194
+ >
195
+ <arg-icon
196
+ :class="
197
+ !selected_all && getOptions.length !== nestedSelectedLength
198
+ ? 'del'
199
+ : selected_all || getOptions.length === nestedSelectedLength
200
+ ? 'add'
201
+ : 'more'
202
+ "
203
+ thickness="24"
204
+ size="16px"
205
+ :name="
206
+ selected_all || getOptions.length === nestedSelectedLength
207
+ ? 'CheckSquareFill'
208
+ : 'Square'
209
+ "
210
+ />
218
211
  <div
219
212
  :class="[
220
- show_all
221
- ? 'oip_select_multiple_left_margin cate_left_margin'
222
- : '',
223
- multiple_columns ? 'cate_row' : 'cate_col',
213
+ 'oip_select_complex_selection_loop_name',
214
+ !selected_all && getOptions.length !== nestedSelectedLength
215
+ ? 'del'
216
+ : selected_all || getOptions.length === nestedSelectedLength
217
+ ? 'add'
218
+ : 'more',
224
219
  ]"
225
220
  >
226
- <div v-for="(element, index) of filterNested" :key="index">
221
+ {{ lang === "fr" ? "Tous" : "All" }}
222
+ </div>
223
+ </div>
224
+ <div
225
+ :class="[
226
+ show_all ? 'oip_select_multiple_left_margin cate_left_margin' : '',
227
+ multiple_columns ? 'cate_row' : 'cate_col',
228
+ ]"
229
+ >
230
+ <div v-for="(element, index) of filterNested" :key="index">
231
+ <div
232
+ class="oip_select_complex_selection_loop"
233
+ @click="
234
+ selectedCats.includes(index)
235
+ ? del_all_cat(index)
236
+ : add_all_cat(index)
237
+ "
238
+ >
239
+ <arg-icon
240
+ :class="
241
+ !selectedCats.includes(index)
242
+ ? 'del'
243
+ : selectedCats.includes(index)
244
+ ? 'add'
245
+ : 'more'
246
+ "
247
+ thickness="24"
248
+ size="16px"
249
+ :name="
250
+ selectedCats.includes(index) ? 'CheckSquareFill' : 'Square'
251
+ "
252
+ />
253
+ <div
254
+ :class="[
255
+ 'oip_select_complex_selection_loop_name',
256
+ !selectedCats.includes(index)
257
+ ? 'del'
258
+ : selectedCats.includes(index)
259
+ ? 'add'
260
+ : 'more',
261
+ ]"
262
+ >
263
+ {{ element.title }}
264
+ </div>
265
+ </div>
266
+ <div class="left_margin">
227
267
  <div
228
- class="oip_select_complex_selection_loop"
268
+ v-for="(option, optIndex) of element.values"
269
+ :key="optIndex"
270
+ class="oip_select_complex_selection_loop multiple"
229
271
  @click="
230
- selectedCats.includes(index)
231
- ? del_all_cat(index)
232
- : add_all_cat(index)
272
+ nestedIncludes(option, index)
273
+ ? del_nested_element(index, option)
274
+ : add_nested_element(index, option)
233
275
  "
234
276
  >
235
277
  <arg-icon
236
- :class="
237
- !selectedCats.includes(index)
238
- ? 'del'
239
- : selectedCats.includes(index)
240
- ? 'add'
241
- : 'more'
242
- "
243
- thickness="24"
278
+ :class="nestedIncludes(option, index) ? 'add' : ''"
244
279
  size="16px"
280
+ thickness="24"
245
281
  :name="
246
- selectedCats.includes(index) ? 'CheckSquareFill' : 'Square'
282
+ nestedIncludes(option, index) ? 'CheckSquareFill' : 'Square'
247
283
  "
248
284
  />
249
285
  <div
250
286
  :class="[
251
287
  'oip_select_complex_selection_loop_name',
252
- !selectedCats.includes(index)
253
- ? 'del'
254
- : selectedCats.includes(index)
255
- ? 'add'
256
- : 'more',
288
+ nestedIncludes(option, index) ? 'add' : 'del',
257
289
  ]"
258
290
  >
259
- {{ element.title }}
260
- </div>
261
- </div>
262
- <div class="left_margin">
263
- <div
264
- v-for="(option, optIndex) of element.values"
265
- :key="optIndex"
266
- class="oip_select_complex_selection_loop multiple"
267
- @click="
268
- nestedIncludes(option, index)
269
- ? del_nested_element(index, option)
270
- : add_nested_element(index, option)
271
- "
272
- >
273
- <arg-icon
274
- :class="nestedIncludes(option, index) ? 'add' : ''"
275
- size="16px"
276
- thickness="24"
277
- :name="
278
- nestedIncludes(option, index)
279
- ? 'CheckSquareFill'
280
- : 'Square'
281
- "
282
- />
283
- <div
284
- :class="[
285
- 'oip_select_complex_selection_loop_name',
286
- nestedIncludes(option, index) ? 'add' : 'del',
287
- ]"
288
- >
289
- {{ option }}
290
- </div>
291
+ {{ option }}
291
292
  </div>
292
293
  </div>
293
294
  </div>
@@ -316,7 +317,7 @@ export default defineComponent({
316
317
  element_table: { type: Array, required: true },
317
318
  nested: { type: Boolean, default: false },
318
319
  search: { type: Boolean, default: true },
319
- filter_placeholder: { type: String, required: false },
320
+ filter_placeholder: { type: String, default: null },
320
321
  show_all: { type: Boolean, default: false },
321
322
  default_select: { type: Array, required: false, default: () => [] },
322
323
  preselection_all: { type: Boolean, default: false },
@@ -324,9 +325,18 @@ export default defineComponent({
324
325
  multiple_columns: { type: Boolean, default: false },
325
326
  options_disable: { type: Array, default: () => [] },
326
327
  show_amount: { type: Boolean, default: true },
327
- emptyMsg: { type: String, default: "No selection" },
328
+ empty_msg: { type: String, default: null },
328
329
  multiple_label: { type: String, required: true },
329
- loading: { type: Boolean, default: false }
330
+ loading: { type: Boolean, default: false },
331
+ lang: {
332
+ type: String,
333
+ default: "en",
334
+ validator: (value) => {
335
+ return ["en", "fr"].includes(value);
336
+ }
337
+ },
338
+ loader_text: { type: Array, default: null },
339
+ empty_content_msg: { type: String, default: null }
330
340
  },
331
341
  emits: ["changeElement", "update:Selection", "changeInputValue", "onClose"],
332
342
  setup(props, { emit }) {
@@ -365,6 +375,30 @@ export default defineComponent({
365
375
  selected_items.value = props.default_select;
366
376
  }
367
377
  });
378
+ const getEmptyMsg = computed(() => {
379
+ if (props.empty_msg === null) {
380
+ return props.lang === "fr" ? "Aucune S\xE9lection" : "No Selection";
381
+ } else
382
+ return props.empty_msg;
383
+ });
384
+ const getLoaderText = computed(() => {
385
+ if (props.loader_text === null) {
386
+ return props.lang === "fr" ? ["Chargement...", "Veuillez patienter"] : ["Loading...", "Please wait"];
387
+ } else
388
+ return props.loader_text;
389
+ });
390
+ const getPlaceholder = computed(() => {
391
+ if (props.filter_placeholder === null) {
392
+ return props.lang === "fr" ? "Rechercher une option..." : "Search options...";
393
+ } else
394
+ return props.filter_placeholder;
395
+ });
396
+ const getEmptyContentMsg = computed(() => {
397
+ if (props.empty_content_msg === null) {
398
+ return props.lang === "fr" ? "Aucun contenu n'a \xE9t\xE9 trouv\xE9" : "No content was found";
399
+ } else
400
+ return props.empty_content_msg;
401
+ });
368
402
  const getAllSelect = computed(() => {
369
403
  const fullSelect = props.nested ? selected_nested.value : selected_items.value;
370
404
  let filterFill = ``;
@@ -726,7 +760,11 @@ export default defineComponent({
726
760
  selected_nested,
727
761
  selected_all,
728
762
  selectedCats,
729
- valueFrom
763
+ valueFrom,
764
+ getEmptyMsg,
765
+ getLoaderText,
766
+ getPlaceholder,
767
+ getEmptyContentMsg
730
768
  };
731
769
  }
732
770
  });