@tekkare/auriga 0.1.24 → 0.1.25

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.
@@ -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
  });
@@ -26,7 +26,7 @@ declare const _default: import("vue").DefineComponent<{
26
26
  };
27
27
  filter_placeholder: {
28
28
  type: StringConstructor;
29
- required: false;
29
+ default: null;
30
30
  };
31
31
  show_all: {
32
32
  type: BooleanConstructor;
@@ -70,9 +70,9 @@ declare const _default: import("vue").DefineComponent<{
70
70
  type: BooleanConstructor;
71
71
  default: boolean;
72
72
  };
73
- emptyMsg: {
73
+ empty_msg: {
74
74
  type: StringConstructor;
75
- default: string;
75
+ default: null;
76
76
  };
77
77
  multiple_label: {
78
78
  type: StringConstructor;
@@ -82,6 +82,32 @@ declare const _default: import("vue").DefineComponent<{
82
82
  type: BooleanConstructor;
83
83
  default: boolean;
84
84
  };
85
+ lang: {
86
+ type: StringConstructor;
87
+ default: string;
88
+ validator: (value: string) => boolean;
89
+ };
90
+ loader_text: {
91
+ type: {
92
+ (arrayLength: number): string[];
93
+ (...items: string[]): string[];
94
+ new (arrayLength: number): string[];
95
+ new (...items: string[]): string[];
96
+ isArray(arg: any): arg is any[];
97
+ readonly prototype: any[];
98
+ from<T>(arrayLike: ArrayLike<T>): T[];
99
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
100
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
101
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
102
+ of<T_4>(...items: T_4[]): T_4[];
103
+ readonly [Symbol.species]: ArrayConstructor;
104
+ };
105
+ default: null;
106
+ };
107
+ empty_content_msg: {
108
+ type: StringConstructor;
109
+ default: null;
110
+ };
85
111
  }, {
86
112
  del_all: () => void;
87
113
  del_all_cat: (index: number) => void;
@@ -110,6 +136,10 @@ declare const _default: import("vue").DefineComponent<{
110
136
  selected_all: import("vue").Ref<boolean>;
111
137
  selectedCats: import("vue").Ref<number[]>;
112
138
  valueFrom: import("vue").Ref<never[]>;
139
+ getEmptyMsg: import("vue").ComputedRef<string>;
140
+ getLoaderText: import("vue").ComputedRef<string[]>;
141
+ getPlaceholder: import("vue").ComputedRef<string>;
142
+ getEmptyContentMsg: import("vue").ComputedRef<string>;
113
143
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("onClose" | "changeElement" | "update:Selection" | "changeInputValue")[], "onClose" | "changeElement" | "update:Selection" | "changeInputValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
114
144
  element_table: {
115
145
  type: {
@@ -138,7 +168,7 @@ declare const _default: import("vue").DefineComponent<{
138
168
  };
139
169
  filter_placeholder: {
140
170
  type: StringConstructor;
141
- required: false;
171
+ default: null;
142
172
  };
143
173
  show_all: {
144
174
  type: BooleanConstructor;
@@ -182,9 +212,9 @@ declare const _default: import("vue").DefineComponent<{
182
212
  type: BooleanConstructor;
183
213
  default: boolean;
184
214
  };
185
- emptyMsg: {
215
+ empty_msg: {
186
216
  type: StringConstructor;
187
- default: string;
217
+ default: null;
188
218
  };
189
219
  multiple_label: {
190
220
  type: StringConstructor;
@@ -194,22 +224,52 @@ declare const _default: import("vue").DefineComponent<{
194
224
  type: BooleanConstructor;
195
225
  default: boolean;
196
226
  };
227
+ lang: {
228
+ type: StringConstructor;
229
+ default: string;
230
+ validator: (value: string) => boolean;
231
+ };
232
+ loader_text: {
233
+ type: {
234
+ (arrayLength: number): string[];
235
+ (...items: string[]): string[];
236
+ new (arrayLength: number): string[];
237
+ new (...items: string[]): string[];
238
+ isArray(arg: any): arg is any[];
239
+ readonly prototype: any[];
240
+ from<T>(arrayLike: ArrayLike<T>): T[];
241
+ from<T_1, U>(arrayLike: ArrayLike<T_1>, mapfn: (v: T_1, k: number) => U, thisArg?: any): U[];
242
+ from<T_2>(iterable: Iterable<T_2> | ArrayLike<T_2>): T_2[];
243
+ from<T_3, U_1>(iterable: Iterable<T_3> | ArrayLike<T_3>, mapfn: (v: T_3, k: number) => U_1, thisArg?: any): U_1[];
244
+ of<T_4>(...items: T_4[]): T_4[];
245
+ readonly [Symbol.species]: ArrayConstructor;
246
+ };
247
+ default: null;
248
+ };
249
+ empty_content_msg: {
250
+ type: StringConstructor;
251
+ default: null;
252
+ };
197
253
  }>> & {
198
254
  onOnClose?: ((...args: any[]) => any) | undefined;
199
255
  onChangeElement?: ((...args: any[]) => any) | undefined;
200
256
  "onUpdate:Selection"?: ((...args: any[]) => any) | undefined;
201
257
  onChangeInputValue?: ((...args: any[]) => any) | undefined;
202
258
  }, {
259
+ lang: string;
203
260
  loading: boolean;
204
261
  disabled: boolean;
205
262
  show_amount: boolean;
263
+ empty_msg: string;
264
+ loader_text: string[];
265
+ empty_content_msg: string;
206
266
  search: boolean;
267
+ filter_placeholder: string;
207
268
  default_select: any[];
208
269
  nested: boolean;
209
270
  show_all: boolean;
210
271
  preselection_all: boolean;
211
272
  multiple_columns: boolean;
212
273
  options_disable: unknown[];
213
- emptyMsg: string;
214
274
  }, {}>;
215
275
  export default _default;
@@ -212,6 +212,20 @@ export default defineComponent({
212
212
  min-height: 10px;
213
213
  }
214
214
 
215
+ .oip_select_dropdown_selection_container:only-child {
216
+ margin-top: 0px;
217
+ }
218
+
219
+ .oip_empty_dropdown {
220
+ padding-top: 16px;
221
+ text-align: center;
222
+ font-weight: 400;
223
+ font-size: 14px;
224
+ line-height: 16px;
225
+ font-style: italic;
226
+ color: var(--cool-grey);
227
+ }
228
+
215
229
  .oip_select_complex_selection_loop > svg.add {
216
230
  fill: var(--accent) !important;
217
231
  color: var(--pure-white) !important;