@dative-gpi/foundation-shared-components 0.0.123 → 0.0.125

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.
@@ -17,6 +17,7 @@
17
17
  #input
18
18
  >
19
19
  <FSRow
20
+ class="fs-checkbox-label"
20
21
  align="center-left"
21
22
  width="hug"
22
23
  :style="style"
@@ -28,10 +29,12 @@
28
29
  >
29
30
  {{ icon }}
30
31
  </FSIcon>
31
- <slot>
32
+ <slot
33
+ name="label"
34
+ v-bind="{ font }"
35
+ >
32
36
  <FSSpan
33
37
  v-if="$props.label"
34
- class="fs-checkbox-label"
35
38
  :style="style"
36
39
  :font="font"
37
40
  >
@@ -8,16 +8,19 @@
8
8
  :rules="$props.rules"
9
9
  :validateOn="validateOn"
10
10
  :modelValue="$props.selected"
11
- @click.prevent
11
+ @click.prevent.stop
12
12
  @blur="blurred = true"
13
13
  v-bind="$attrs"
14
14
  >
15
- <template #input>
15
+ <template
16
+ #input
17
+ >
16
18
  <FSRow
19
+ class="fs-radio-label"
17
20
  align="center-left"
18
21
  width="hug"
19
22
  :style="style"
20
- @click.stop="onToggle"
23
+ @click.prevent.stop="onToggle"
21
24
  >
22
25
  <FSIcon
23
26
  class="fs-radio"
@@ -26,10 +29,12 @@
26
29
  >
27
30
  {{ icon }}
28
31
  </FSIcon>
29
- <slot>
32
+ <slot
33
+ name="label"
34
+ v-bind="{ item: $props.item, font }"
35
+ >
30
36
  <FSSpan
31
37
  v-if="$props.label"
32
- class="fs-radio-label"
33
38
  :style="style"
34
39
  :font="font"
35
40
  >
@@ -39,7 +44,9 @@
39
44
  </FSRow>
40
45
  </template>
41
46
  </v-radio>
42
- <slot name="description">
47
+ <slot
48
+ name="description"
49
+ >
43
50
  <FSSpan
44
51
  v-if="$props.description"
45
52
  class="fs-radio-description"
@@ -72,6 +79,11 @@ export default defineComponent({
72
79
  FSRow
73
80
  },
74
81
  props: {
82
+ item: {
83
+ type: Object as PropType<object | null>,
84
+ required: false,
85
+ default: null
86
+ },
75
87
  label: {
76
88
  type: String as PropType<string | null>,
77
89
  required: false,
@@ -5,15 +5,26 @@
5
5
  >
6
6
  <FSRadio
7
7
  v-for="(item, index) in $props.values"
8
- :key="index"
9
- :label="item.label"
10
- :description="item.description"
11
8
  :selected="isSelected(item.value)"
12
- :color="$props.color"
9
+ :description="item.description"
13
10
  :editable="$props.editable"
11
+ :color="$props.color"
12
+ :label="item.label"
13
+ :item="item.item"
14
+ :key="index"
14
15
  :modelValue="item.value"
15
16
  @update:modelValue="onToggle"
16
- />
17
+ >
18
+ <template
19
+ v-for="(_, name) in $slots"
20
+ v-slot:[name]="slotData"
21
+ >
22
+ <slot
23
+ :name="name"
24
+ v-bind="slotData"
25
+ />
26
+ </template>
27
+ </FSRadio>
17
28
  </FSCol>
18
29
  </template>
19
30
 
@@ -38,7 +49,7 @@ export default defineComponent({
38
49
  default: "8px"
39
50
  },
40
51
  values: {
41
- type: Array as PropType<{ value: string | boolean | number, label?: string, description?: string }[]>,
52
+ type: Array as PropType<{ value: string | boolean | number, label?: string, description?: string, item: any | null }[]>,
42
53
  required: true,
43
54
  default: null
44
55
  },
@@ -12,7 +12,7 @@
12
12
  >
13
13
  <FSButtonPreviousIcon
14
14
  :color="ColorEnum.Dark"
15
- @click="goToPrev"
15
+ @click.prevent.stop="goToPrev"
16
16
  />
17
17
  </template>
18
18
  <template
@@ -33,7 +33,7 @@
33
33
  <FSButtonNextIcon
34
34
  :color="ColorEnum.Dark"
35
35
  :class="nextClasses"
36
- @click="goToNext"
36
+ @click.prevent.stop="goToNext"
37
37
  />
38
38
  </template>
39
39
  </v-slide-group>
@@ -105,6 +105,20 @@ export default defineComponent({
105
105
  return classes;
106
106
  });
107
107
 
108
+ const goToStart = () => {
109
+ if (slideGroupRef.value) {
110
+ const scrollElement = (slideGroupRef.value as any).$el.children[1];
111
+ scrollElement.scrollTo({ left: -scrollElement.scrollLeft, behavior: "smooth" });
112
+ }
113
+ };
114
+
115
+ const goToEnd = () => {
116
+ if (slideGroupRef.value) {
117
+ const scrollElement = (slideGroupRef.value as any).$el.children[1];
118
+ scrollElement.scrollTo({ left: scrollElement.scrollWidth - scrollElement.scrollLeft, behavior: "smooth" });
119
+ }
120
+ };
121
+
108
122
  const goToPrev = () => {
109
123
  if (slideGroupRef.value) {
110
124
  (slideGroupRef.value as any).scrollTo("prev");
@@ -143,8 +157,10 @@ export default defineComponent({
143
157
  elementId,
144
158
  style,
145
159
  getChildren,
160
+ goToStart,
161
+ goToNext,
146
162
  goToPrev,
147
- goToNext
163
+ goToEnd
148
164
  };
149
165
  }
150
166
  });
@@ -157,6 +157,11 @@ export default defineComponent({
157
157
  required: false,
158
158
  default: ColorEnum.Primary
159
159
  },
160
+ errorColor: {
161
+ type: String as PropType<ColorBase>,
162
+ required: false,
163
+ default: ColorEnum.Error
164
+ },
160
165
  padding: {
161
166
  type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
162
167
  required: false,
@@ -210,6 +215,9 @@ export default defineComponent({
210
215
  if (!Array.isArray(props.modelValue) && props.modelValue === value.id) {
211
216
  return props.activeColor;
212
217
  }
218
+ if (inputRef.value && (inputRef.value as any).errorMessages.length) {
219
+ return props.errorColor;
220
+ }
213
221
  return props.buttonColor;
214
222
  };
215
223
 
@@ -37,6 +37,15 @@
37
37
  v-bind="slotData"
38
38
  />
39
39
  </template>
40
+ <template
41
+ v-if="mobileSelectionProps"
42
+ #prepend-inner
43
+ >
44
+ <slot
45
+ name="selection-mobile"
46
+ v-bind="mobileSelectionProps"
47
+ />
48
+ </template>
40
49
  <template
41
50
  #append-inner
42
51
  >
@@ -66,32 +75,47 @@
66
75
  :height="height"
67
76
  >
68
77
  <FSCol
78
+ v-if="$props.multiple"
69
79
  gap="12px"
70
80
  >
71
- <template
72
- v-if="$props.multiple"
81
+ <FSRow
82
+ v-for="(item, index) in searchItems"
83
+ :key="index"
73
84
  >
74
- <FSRow
75
- v-for="(item, index) in searchItems"
76
- :key="index"
85
+ <FSCheckbox
86
+ :label="item[$props.itemTitle]"
87
+ :editable="$props.editable"
88
+ :modelValue="$props.modelValue?.includes(item[$props.itemValue])"
89
+ @update:modelValue="() => onCheckboxChange(item[$props.itemValue])"
77
90
  >
78
- <FSCheckbox
79
- :label="item[$props.itemTitle]"
80
- :editable="$props.editable"
81
- :modelValue="$props.modelValue?.includes(item[$props.itemValue])"
82
- @update:modelValue="() => onCheckboxChange(item[$props.itemValue])"
83
- />
84
- </FSRow>
85
- </template>
86
- <FSRadioGroup
87
- v-else
88
- gap="12px"
89
- :values="searchItems.map((item: any) => ({ value: item[$props.itemValue], label: item[$props.itemTitle] }))"
90
- :modelValue="$props.modelValue"
91
- :editable="$props.editable"
92
- @update:modelValue="onRadioChange"
93
- />
91
+ <template
92
+ #label="{ font }"
93
+ >
94
+ <slot
95
+ name="item-label"
96
+ v-bind="mobileItemProps(item, font)"
97
+ />
98
+ </template>
99
+ </FSCheckbox>
100
+ </FSRow>
94
101
  </FSCol>
102
+ <FSRadioGroup
103
+ v-else
104
+ gap="12px"
105
+ :values="searchItems.map((item: any) => ({ value: item[$props.itemValue], label: item[$props.itemTitle], item: item }))"
106
+ :editable="$props.editable"
107
+ :modelValue="$props.modelValue"
108
+ @update:modelValue="onRadioChange"
109
+ >
110
+ <template
111
+ #label="{ item, font }"
112
+ >
113
+ <slot
114
+ name="item-label"
115
+ v-bind="mobileItemProps(item, font)"
116
+ />
117
+ </template>
118
+ </FSRadioGroup>
95
119
  </FSFadeOut>
96
120
  </template>
97
121
  </FSDialogMenu>
@@ -135,6 +159,7 @@
135
159
  :style="style"
136
160
  :listProps="listStyle"
137
161
  :class="classes"
162
+ :persistentClear="true"
138
163
  :hideDetails="true"
139
164
  :items="$props.items"
140
165
  :autoSelectFirst="true"
@@ -149,10 +174,20 @@
149
174
  :validateOn="validateOn"
150
175
  :modelValue="$props.modelValue"
151
176
  @update:modelValue="onUpdate"
177
+ @click="onClick"
152
178
  @blur="blurred = true"
153
179
  v-model:search="search"
154
180
  v-bind="$attrs"
155
181
  >
182
+ <template
183
+ v-for="(_, name) in autocompleteSlots"
184
+ v-slot:[name]="slotData"
185
+ >
186
+ <slot
187
+ :name="`autocomplete-${name}`"
188
+ v-bind="slotData"
189
+ />
190
+ </template>
156
191
  <template
157
192
  #item="{ props, item }"
158
193
  >
@@ -161,28 +196,42 @@
161
196
  >
162
197
  <FSRow
163
198
  align="center-left"
164
- :wrap="false"
165
199
  >
166
200
  <FSCheckbox
167
201
  v-if="$props.multiple"
168
202
  :modelValue="$props.modelValue?.includes(item.raw[$props.itemValue])"
169
203
  @click="props.onClick"
170
- />
171
- <FSSpan>
172
- {{ item.raw[$props.itemTitle] }}
204
+ >
205
+ <template
206
+ #label="{ font }"
207
+ >
208
+ <slot
209
+ name="item-label"
210
+ v-bind="{ item, font }"
211
+ >
212
+ <FSSpan
213
+ :font="font"
214
+ >
215
+ {{ item.raw[$props.itemTitle] }}
216
+ </FSSpan>
217
+ </slot>
218
+ </template>
219
+ </FSCheckbox>
220
+ <FSSpan
221
+ v-else
222
+ >
223
+ <slot
224
+ name="item-label"
225
+ v-bind="{ item }"
226
+ >
227
+ <FSSpan>
228
+ {{ item.raw[$props.itemTitle] }}
229
+ </FSSpan>
230
+ </slot>
173
231
  </FSSpan>
174
232
  </FSRow>
175
233
  </v-list-item>
176
234
  </template>
177
- <template
178
- v-for="(_, name) in autocompleteSlots"
179
- v-slot:[name]="slotData"
180
- >
181
- <slot
182
- :name="`autocomplete-${name}`"
183
- v-bind="slotData"
184
- />
185
- </template>
186
235
  <template
187
236
  #clear
188
237
  >
@@ -447,6 +496,40 @@ export default defineComponent({
447
496
  return null;
448
497
  });
449
498
 
499
+ const mobileSelectionProps = computed((): any | null => {
500
+ const item = props.items.find((item: any) => item[props.itemValue] === props.modelValue);
501
+ if (item) {
502
+ return {
503
+ item: {
504
+ title: "",
505
+ value: item[props.itemValue],
506
+ props: {
507
+ title: item[props.itemTitle],
508
+ value: item[props.itemValue]
509
+ },
510
+ raw: { ...item }
511
+ },
512
+ font: "text-body"
513
+ };
514
+ }
515
+ return null;
516
+ });
517
+
518
+ const mobileItemProps = (item: any, font: "text-body" | "text-button" | null): any => {
519
+ return {
520
+ item: {
521
+ title: "",
522
+ value: item[props.itemValue],
523
+ props: {
524
+ title: item[props.itemTitle],
525
+ value: item[props.itemValue]
526
+ },
527
+ raw: { ...item }
528
+ },
529
+ font
530
+ }
531
+ };
532
+
450
533
  const openMobileOverlay = () => {
451
534
  if (!props.editable) {
452
535
  return;
@@ -455,38 +538,45 @@ export default defineComponent({
455
538
  };
456
539
 
457
540
  const onRadioChange = (value: any) => {
458
- emit('update:modelValue', value);
541
+ emit("update:modelValue", value);
459
542
  dialog.value = false;
460
543
  };
461
544
 
462
545
  const onCheckboxChange = (value: any) => {
463
546
  if (Array.isArray(props.modelValue)) {
464
547
  if (props.modelValue.includes(value)) {
465
- emit('update:modelValue', props.modelValue.filter((item: any) => item !== value));
548
+ emit("update:modelValue", props.modelValue.filter((item: any) => item !== value));
466
549
  }
467
550
  else {
468
- emit('update:modelValue', [...props.modelValue, value]);
551
+ emit("update:modelValue", [...props.modelValue, value]);
469
552
  }
470
553
  }
471
554
  else {
472
555
  if (props.modelValue === value) {
473
- emit('update:modelValue', []);
556
+ emit("update:modelValue", []);
474
557
  }
475
558
  else {
476
- emit('update:modelValue', [props.modelValue, value]);
559
+ emit("update:modelValue", [props.modelValue, value]);
477
560
  }
478
561
  }
479
562
  };
480
563
 
481
564
  const onUpdate = (value: string[] | string) => {
482
- emit('update:modelValue', value);
565
+ emit("update:modelValue", value);
483
566
  };
484
567
 
568
+ const onClick = () => {
569
+ search.value = "";
570
+ emit("update:search", search.value);
571
+ emit("update:modelValue", null);
572
+ }
573
+
485
574
  watch(search, () => {
486
575
  emit("update:search", search.value);
487
576
  });
488
577
 
489
578
  return {
579
+ mobileSelectionProps,
490
580
  autocompleteSlots,
491
581
  toggleSetSlots,
492
582
  isExtraSmall,
@@ -505,8 +595,10 @@ export default defineComponent({
505
595
  style,
506
596
  openMobileOverlay,
507
597
  onCheckboxChange,
598
+ mobileItemProps,
508
599
  onRadioChange,
509
- onUpdate
600
+ onUpdate,
601
+ onClick
510
602
  };
511
603
  }
512
604
  });
@@ -30,6 +30,15 @@
30
30
  v-bind="slotData"
31
31
  />
32
32
  </template>
33
+ <template
34
+ v-if="mobileSelectionProps"
35
+ #prepend-inner
36
+ >
37
+ <slot
38
+ name="selection-mobile"
39
+ v-bind="mobileSelectionProps"
40
+ />
41
+ </template>
33
42
  <template
34
43
  #append-inner
35
44
  >
@@ -68,17 +77,35 @@
68
77
  :editable="$props.editable"
69
78
  :modelValue="$props.modelValue?.includes(item[$props.itemValue])"
70
79
  @update:modelValue="() => onCheckboxChange(item[$props.itemValue])"
71
- />
80
+ >
81
+ <template
82
+ #label="{ font }"
83
+ >
84
+ <slot
85
+ name="item-label"
86
+ v-bind="mobileItemProps(item, font)"
87
+ />
88
+ </template>
89
+ </FSCheckbox>
72
90
  </FSRow>
73
91
  </FSCol>
74
92
  <FSRadioGroup
75
93
  v-else
76
94
  gap="12px"
77
- :values="$props.items.map((item: any) => ({ value: item[$props.itemValue], label: item[$props.itemTitle] }))"
78
- :modelValue="$props.modelValue"
95
+ :values="$props.items.map((item: any) => ({ value: item[$props.itemValue], label: item[$props.itemTitle], item: item }))"
79
96
  :editable="$props.editable"
97
+ :modelValue="$props.modelValue"
80
98
  @update:modelValue="onRadioChange"
81
- />
99
+ >
100
+ <template
101
+ #label="{ item, font }"
102
+ >
103
+ <slot
104
+ name="item-label"
105
+ v-bind="mobileItemProps(item, font)"
106
+ />
107
+ </template>
108
+ </FSRadioGroup>
82
109
  </FSFadeOut>
83
110
  </template>
84
111
  </FSDialogMenu>
@@ -100,6 +127,7 @@
100
127
  :menuIcon="null"
101
128
  :style="style"
102
129
  :listProps="listStyle"
130
+ :persistentClear="true"
103
131
  :hideDetails="true"
104
132
  :items="$props.items"
105
133
  :itemTitle="$props.itemTitle"
@@ -115,6 +143,15 @@
115
143
  @blur="blurred = true"
116
144
  v-bind="$attrs"
117
145
  >
146
+ <template
147
+ v-for="(_, name) in $slots"
148
+ v-slot:[name]="slotData"
149
+ >
150
+ <slot
151
+ :name="name"
152
+ v-bind="slotData"
153
+ />
154
+ </template>
118
155
  <template
119
156
  #item="{ props, item }"
120
157
  >
@@ -126,24 +163,39 @@
126
163
  >
127
164
  <FSCheckbox
128
165
  v-if="$props.multiple"
129
- :modelValue="$props.modelValue?.includes(item.raw.id)"
166
+ :modelValue="$props.modelValue?.includes(item.raw[$props.itemValue])"
130
167
  @click="props.onClick"
131
- />
132
- <FSSpan>
133
- {{ item.raw.label }}
168
+ >
169
+ <template
170
+ #label="{ font }"
171
+ >
172
+ <slot
173
+ name="item-label"
174
+ v-bind="{ item, font }"
175
+ >
176
+ <FSSpan
177
+ :font="font"
178
+ >
179
+ {{ item.raw[$props.itemTitle] }}
180
+ </FSSpan>
181
+ </slot>
182
+ </template>
183
+ </FSCheckbox>
184
+ <FSSpan
185
+ v-else
186
+ >
187
+ <slot
188
+ name="item-label"
189
+ v-bind="{ item }"
190
+ >
191
+ <FSSpan>
192
+ {{ item.raw[$props.itemTitle] }}
193
+ </FSSpan>
194
+ </slot>
134
195
  </FSSpan>
135
196
  </FSRow>
136
197
  </v-list-item>
137
198
  </template>
138
- <template
139
- v-for="(_, name) in $slots"
140
- v-slot:[name]="slotData"
141
- >
142
- <slot
143
- :name="name"
144
- v-bind="slotData"
145
- />
146
- </template>
147
199
  <template
148
200
  #clear
149
201
  >
@@ -173,6 +225,17 @@
173
225
  />
174
226
  </slot>
175
227
  </template>
228
+ <template
229
+ #no-data
230
+ >
231
+ <FSRow
232
+ padding="17px"
233
+ >
234
+ <FSSpan>
235
+ {{ $tr("ui.common.no-data", "No data") }}
236
+ </FSSpan>
237
+ </FSRow>
238
+ </template>
176
239
  </v-select>
177
240
  </FSBaseField>
178
241
  </template>
@@ -346,6 +409,40 @@ export default defineComponent({
346
409
  return null;
347
410
  });
348
411
 
412
+ const mobileSelectionProps = computed((): any | null => {
413
+ const item = props.items.find((item: any) => item[props.itemValue] === props.modelValue);
414
+ if (item) {
415
+ return {
416
+ item: {
417
+ title: "",
418
+ value: item[props.itemValue],
419
+ props: {
420
+ title: item[props.itemTitle],
421
+ value: item[props.itemValue]
422
+ },
423
+ raw: { ...item }
424
+ },
425
+ font: "text-body"
426
+ };
427
+ }
428
+ return null;
429
+ });
430
+
431
+ const mobileItemProps = (item: any, font: "text-body" | "text-button" | null): any => {
432
+ return {
433
+ item: {
434
+ title: "",
435
+ value: item[props.itemValue],
436
+ props: {
437
+ title: item[props.itemTitle],
438
+ value: item[props.itemValue]
439
+ },
440
+ raw: { ...item }
441
+ },
442
+ font
443
+ }
444
+ };
445
+
349
446
  const openMobileOverlay = () => {
350
447
  if (!props.editable) {
351
448
  return;
@@ -378,6 +475,7 @@ export default defineComponent({
378
475
  };
379
476
 
380
477
  return {
478
+ mobileSelectionProps,
381
479
  isExtraSmall,
382
480
  mobileValue,
383
481
  validateOn,
@@ -390,6 +488,7 @@ export default defineComponent({
390
488
  style,
391
489
  openMobileOverlay,
392
490
  onCheckboxChange,
491
+ mobileItemProps,
393
492
  onRadioChange
394
493
  };
395
494
  }
@@ -13,6 +13,7 @@
13
13
  :style="style"
14
14
  :class="classes"
15
15
  :rows="$props.rows"
16
+ :persistentClear="true"
16
17
  :hideDetails="true"
17
18
  :noResize="true"
18
19
  :autoGrow="$props.autoGrow"
@@ -12,6 +12,7 @@
12
12
  variant="outlined"
13
13
  :style="style"
14
14
  :type="$props.type"
15
+ :persistentClear="true"
15
16
  :hideDetails="true"
16
17
  :readonly="!$props.editable"
17
18
  :clearable="$props.clearable && $props.editable && !!$props.modelValue"
@@ -5,6 +5,7 @@
5
5
  width="100%"
6
6
  :color="$props.itemColor"
7
7
  :variant="variant"
8
+ :style="style"
8
9
  >
9
10
  <FSCol>
10
11
  <slot
@@ -112,6 +113,11 @@ export default defineComponent({
112
113
  required: false,
113
114
  default: ColorEnum.Primary
114
115
  },
116
+ clickable: {
117
+ type: Boolean,
118
+ required: false,
119
+ default: false
120
+ },
115
121
  showSelect: {
116
122
  type: Boolean,
117
123
  required: false,
@@ -127,8 +133,15 @@ export default defineComponent({
127
133
  }
128
134
  });
129
135
 
136
+ const style = computed((): { [key: string]: string | null | undefined } => {
137
+ return {
138
+ "--fs-data-iterator-item-cursor": props.clickable ? "pointer" : "default"
139
+ }
140
+ });
141
+
130
142
  return {
131
- variant
143
+ variant,
144
+ style
132
145
  };
133
146
  }
134
147
  });
@@ -125,8 +125,8 @@
125
125
  :page="innerPage"
126
126
  :itemsPerPage="innerRowsPerPage"
127
127
  :modelValue="$props.modelValue"
128
- @auxclick:row="onClickRow"
129
- @click:row="onClickRow"
128
+ @auxclick:row="onClickLibrary.row"
129
+ @click:row="onClickLibrary.row"
130
130
  @update:sortBy="innerSortBy = $event ? $event[0] : null"
131
131
  @dragover.prevent
132
132
  @drop:row="(event, row) => onDrop(event, row, 'tr.v-data-table__tr')"
@@ -435,6 +435,7 @@
435
435
  v-if="item.type === 'item'"
436
436
  :itemColor="$props.rowColor ? $props.rowColor(item.raw) : ColorEnum.Background"
437
437
  :headers="innerHeaders.filter(h => !$props.sneakyHeaders.includes(h.value))"
438
+ :clickable="onClickLibrary.clickable"
438
439
  :showSelect="$props.showSelect"
439
440
  :itemTo="$props.itemTo"
440
441
  :color="$props.color"
@@ -442,6 +443,8 @@
442
443
  :key="index"
443
444
  :modelValue="$props.modelValue.includes(item.raw[$props.itemValue])"
444
445
  @update:modelValue="toggleSelect"
446
+ @auxclick="() => onClickLibrary.mobile($event, item)"
447
+ @click="() => onClickLibrary.mobile($event, item)"
445
448
  >
446
449
  <template
447
450
  #item.top="props"
@@ -584,6 +587,7 @@
584
587
  <FSDataIteratorItem
585
588
  :itemColor="$props.rowColor ? $props.rowColor(item.raw) : ColorEnum.Background"
586
589
  :headers="innerHeaders.filter(h => !$props.sneakyHeaders.includes(h.value))"
590
+ :clickable="onClickLibrary.clickable"
587
591
  :showSelect="$props.showSelect"
588
592
  :itemTo="$props.itemTo"
589
593
  :color="$props.color"
@@ -591,6 +595,8 @@
591
595
  :key="index"
592
596
  :modelValue="$props.modelValue.includes(item.raw[$props.itemValue])"
593
597
  @update:modelValue="toggleSelect"
598
+ @auxclick="() => onClickLibrary.mobile($event, item)"
599
+ @click="() => onClickLibrary.mobile($event, item)"
594
600
  >
595
601
  <template
596
602
  #item.top="props"
@@ -638,7 +644,7 @@
638
644
  </template>
639
645
 
640
646
  <script lang="ts">
641
- import { computed, defineComponent, getCurrentInstance, onMounted, onUnmounted, PropType, ref, Ref, Slot, watch } from "vue";
647
+ import { computed, defineComponent, onMounted, onUnmounted, PropType, ref, Ref, Slot, watch } from "vue";
642
648
  import { useRouter } from "vue-router";
643
649
 
644
650
  import { ColorEnum, FSDataTableColumn, FSDataTableFilter, FSDataTableOrder, FSToggle } from "@dative-gpi/foundation-shared-components/models";
@@ -718,6 +724,11 @@ export default defineComponent({
718
724
  required: false,
719
725
  default: null
720
726
  },
727
+ ["onClick:row"]: {
728
+ type: Function,
729
+ required: false,
730
+ default: null
731
+ },
721
732
  rowsPerPage: {
722
733
  type: Number,
723
734
  required: false,
@@ -1018,25 +1029,43 @@ export default defineComponent({
1018
1029
  }
1019
1030
  });
1020
1031
 
1021
- const onClickRow = computed(() => {
1022
- if (!!getCurrentInstance()?.vnode.props?.["onClick:row"] || props.itemTo) {
1023
- return (event: PointerEvent, row: any) => {
1024
- if (props.itemTo && router) {
1025
- if (event.metaKey || event.ctrlKey || event.button === 1) {
1026
- window.open(router.resolve(props.itemTo(row.item)).href, "_blank");
1032
+ const onClickLibrary = computed((): { [key: string]: Function | boolean } => {
1033
+ if (props["onClick:row"] || props.itemTo) {
1034
+ return {
1035
+ clickable: true,
1036
+ row: (event: PointerEvent, row: any) => {
1037
+ if (props.itemTo && router) {
1038
+ if (event.metaKey || event.ctrlKey || event.button === 1) {
1039
+ window.open(router.resolve(props.itemTo(row.item)).href, "_blank");
1040
+ }
1041
+ else {
1042
+ router.push(props.itemTo(row.item));
1043
+ }
1027
1044
  }
1028
1045
  else {
1029
- router.push(props.itemTo(row.item));
1046
+ emit("click:row", row.item);
1047
+ }
1048
+ },
1049
+ mobile: (event: PointerEvent, item: any) => {
1050
+ if (props.itemTo && router) {
1051
+ if (event.metaKey || event.ctrlKey || event.button === 1) {
1052
+ window.open(router.resolve(props.itemTo(item)).href, "_blank");
1053
+ }
1054
+ else {
1055
+ router.push(props.itemTo(item));
1056
+ }
1057
+ }
1058
+ else {
1059
+ emit("click:row", item);
1030
1060
  }
1031
1061
  }
1032
- else {
1033
- emit("click:row", row.item);
1034
- }
1035
- };
1036
- }
1037
- else {
1038
- return null;
1062
+ }
1039
1063
  }
1064
+ return {
1065
+ clickable: false,
1066
+ row: null,
1067
+ mobile: () => null
1068
+ };
1040
1069
  });
1041
1070
 
1042
1071
  const draggableDisabled = computed(() => {
@@ -1453,10 +1482,10 @@ export default defineComponent({
1453
1482
  classes,
1454
1483
  style,
1455
1484
  size,
1456
- onClickRow,
1457
1485
  isExtraSmall,
1458
1486
  draggableDisabled,
1459
1487
  elementId,
1488
+ onClickLibrary,
1460
1489
  toggleSelectAll,
1461
1490
  toggleSelectGroup,
1462
1491
  toggleSelect,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
3
  "sideEffects": false,
4
- "version": "0.0.123",
4
+ "version": "0.0.125",
5
5
  "description": "",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -10,8 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@dative-gpi/foundation-shared-domain": "0.0.123",
14
- "@dative-gpi/foundation-shared-services": "0.0.123",
13
+ "@dative-gpi/foundation-shared-domain": "0.0.125",
14
+ "@dative-gpi/foundation-shared-services": "0.0.125",
15
15
  "@fontsource/montserrat": "^5.0.16",
16
16
  "@lexical/clipboard": "^0.12.5",
17
17
  "@lexical/history": "^0.12.5",
@@ -32,5 +32,5 @@
32
32
  "sass": "^1.69.5",
33
33
  "sass-loader": "^13.3.2"
34
34
  },
35
- "gitHead": "0d9536cb31dbffca7286a843898128087323db0f"
35
+ "gitHead": "d86e2497538681c5758fe0621a34497cbc395997"
36
36
  }
@@ -1,6 +1,5 @@
1
1
  .fs-card {
2
2
  border: var(--fs-card-border-size) var(--fs-card-border-style);
3
- transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
4
3
  border-radius: var(--fs-card-border-radius);
5
4
  padding: var(--fs-card-padding);
6
5
  height: var(--fs-card-height);
@@ -3,7 +3,8 @@
3
3
  color: var(--fs-checkbox-checkbox-color) !important;
4
4
  }
5
5
 
6
- .fs-checkbox-label {
6
+ .fs-checkbox-label,
7
+ .fs-checkbox-label :not(.fs-checkbox) {
7
8
  cursor: var(--fs-checkbox-cursor) !important;
8
9
  color: var(--fs-checkbox-color) !important;
9
10
  user-select: none;
@@ -1,4 +1,5 @@
1
1
  .fs-data-iterator-item {
2
+ cursor: var(--fs-data-iterator-item-cursor);
2
3
  position: relative;
3
4
  min-height: 36px;
4
5
  flex: 1 0 0;
@@ -6,15 +7,27 @@
6
7
  & > .fs-col > .fs-row:first-of-type > :last-child {
7
8
  padding-right: 32px;
8
9
  }
10
+
11
+ &:hover::after {
12
+ content: "";
13
+ background-color: black;
14
+ pointer-events: none;
15
+ position: absolute;
16
+ opacity: 0.04;
17
+ height: 100%;
18
+ width: 100%;
19
+ left: 0;
20
+ top: 0;
21
+ }
9
22
  }
10
23
 
11
24
  .fs-data-iterator-item-checkbox {
12
- border-radius: 4px;
13
- position: absolute;
14
- align-items: center;
15
25
  justify-content: center;
16
- top: 1px;
17
- right: 1px;
18
- width: 32px;
26
+ align-items: center;
27
+ position: absolute;
28
+ border-radius: 4px;
19
29
  height: 32px;
30
+ width: 32px;
31
+ right: 1px;
32
+ top: 1px;
20
33
  }
@@ -0,0 +1,6 @@
1
+ // If the custom property value is a boolean or an icon, hide the FSTextField input value in a FSMetaField while on mobile
2
+ .fs-meta-field .v-field:has(.v-field__prepend-inner:not(:empty)) input {
3
+ @include mobile {
4
+ content-visibility: hidden;
5
+ }
6
+ }
@@ -3,7 +3,8 @@
3
3
  color: var(--fs-radio-radio-color) !important;
4
4
  }
5
5
 
6
- .fs-radio-label {
6
+ .fs-radio-label,
7
+ .fs-radio-label :not(.fs-radio) {
7
8
  cursor: var(--fs-radio-cursor) !important;
8
9
  color: var(--fs-radio-color) !important;
9
10
  user-select: none;
@@ -15,7 +15,6 @@
15
15
  @import "fs_color_icon.scss";
16
16
  @import "fs_data_table.scss";
17
17
  @import "fs_data_iterator_item.scss";
18
- @import "fs_date_field.scss";
19
18
  @import "fs_dialog_menu.scss";
20
19
  @import "fs_dialog.scss";
21
20
  @import "fs_divider.scss";
@@ -36,6 +35,7 @@
36
35
  @import "fs_load_data_table.scss";
37
36
  @import "fs_load_tile.scss";
38
37
  @import "fs_loader.scss";
38
+ @import "fs_meta_field.scss";
39
39
  @import "fs_option_group.scss";
40
40
  @import "fs_pagination.scss";
41
41
  @import "fs_password_field.scss";
@@ -50,11 +50,11 @@
50
50
  }
51
51
 
52
52
  & .v-input__prepend {
53
- margin-inline-end: 8px !important;
53
+ margin-inline-end: 0 !important;
54
54
  }
55
55
 
56
56
  & .v-input__append {
57
- margin-inline-start: 8px !important;
57
+ margin-inline-start: 0 !important;
58
58
  }
59
59
 
60
60
  & > .v-input__control > .v-field {
@@ -65,6 +65,10 @@
65
65
  margin-inline: 0px;
66
66
  padding-top: 0px;
67
67
  height: 100%;
68
+
69
+ & > .v-icon {
70
+ opacity: 1 !important;
71
+ }
68
72
  }
69
73
 
70
74
  & > .v-field__outline {
@@ -78,10 +82,9 @@
78
82
  & > .v-field__field > .v-field__input {
79
83
  @extend .text-body;
80
84
 
81
- padding-inline: 0px !important;
82
85
  padding-bottom: 0px !important;
86
+ padding-inline: 0px !important;
83
87
  padding-top: 0px !important;
84
- align-items: center;
85
88
  flex-wrap: nowrap;
86
89
  overflow: hidden;
87
90
 
@@ -98,11 +101,34 @@
98
101
  }
99
102
  }
100
103
 
104
+ // If there is a prepend, it has a padding on the right and an opacity of 100%
105
+ .v-field__prepend-inner:not(:empty) {
106
+ padding-inline-end: 4px !important;
107
+
108
+ & > .v-icon {
109
+ opacity: 1 !important;
110
+ }
111
+ }
112
+
113
+ // If there is an append, it has a padding on the left and an opacity of 100%
114
+ .v-field__append-inner:not(:empty) {
115
+ padding-inline-start: 4px !important;
116
+
117
+ & > .v-icon {
118
+ opacity: 1 !important;
119
+ }
120
+ }
121
+
101
122
  // No input messages allowed
102
123
  .v-input__details {
103
124
  display: none !important;
104
125
  }
105
126
 
127
+ // Ellipsis on input of all fields
128
+ input {
129
+ text-overflow: ellipsis;
130
+ }
131
+
106
132
  // No up / down buttons in input field of type number
107
133
  input[type=number] {
108
134
  -moz-appearance: textfield;
@@ -128,6 +154,7 @@ $nthOverlay: 25;
128
154
  .fs-slide-group {
129
155
  max-width: 100%;
130
156
 
157
+ // To avoid borders clipping
131
158
  & > .v-slide-group__container > .v-slide-group__content {
132
159
  margin: 0 2px 1px 0 !important;
133
160
  }
@@ -1,8 +0,0 @@
1
- .fs-date-field-label {
2
- color: var(--fs-date-field-color);
3
- }
4
-
5
- .fs-date-field-messages {
6
- align-self: stretch;
7
- color: var(--fs-date-field-error-color);
8
- }