@dative-gpi/foundation-shared-components 0.0.9 → 0.0.10

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.
@@ -64,9 +64,10 @@
64
64
  :singleSelect="$props.singleSelect"
65
65
  :headers="extraHeaders.concat(innerHeaders)"
66
66
  :groupBy="$props.groupBy ? [$props.groupBy] : []"
67
+ :sortBy="innerSortBy ? [innerSortBy] : []"
67
68
  :items="innerItems"
68
69
  :fixedHeader="true"
69
- :multiSort="true"
70
+ :multiSort="false"
70
71
  :hover="true"
71
72
  :style="style"
72
73
  :class="classes"
@@ -75,7 +76,7 @@
75
76
  :modelValue="innerValue"
76
77
  @auxclick:row="onClickRow"
77
78
  @click:row="onClickRow"
78
- v-model:sortBy="innerSortBy"
79
+ @update:sortBy="innerSortBy = $event ? $event[0] : null"
79
80
  >
80
81
  <template #no-data>
81
82
  <FSText
@@ -197,24 +198,26 @@
197
198
  padding="16px"
198
199
  gap="24px"
199
200
  >
200
- <template v-if="$props.modelValue.length >= innerItems.length">
201
- <FSRow
202
- gap="2px"
203
- >
204
- <FSText
205
- font="text-button"
201
+ <template v-if="$props.modelValue.length">
202
+ <template v-if="$props.modelValue.length >= innerItems.length">
203
+ <FSRow
204
+ gap="2px"
206
205
  >
207
- {{ $tr("ui.data-table.all-selected-bold", "Warning:") }}
208
- </FSText>
206
+ <FSText
207
+ font="text-button"
208
+ >
209
+ {{ $tr("ui.data-table.all-selected-bold", "Warning:") }}
210
+ </FSText>
211
+ <FSText>
212
+ {{ $tr("ui.data-table.all-selected-regular", "All elements selected") }}
213
+ </FSText>
214
+ </FSRow>
215
+ </template>
216
+ <template v-else>
209
217
  <FSText>
210
- {{ $tr("ui.data-table.all-selected-regular", "All elements selected") }}
218
+ {{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
211
219
  </FSText>
212
- </FSRow>
213
- </template>
214
- <template v-else-if="$props.modelValue.length">
215
- <FSText>
216
- {{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
217
- </FSText>
220
+ </template>
218
221
  </template>
219
222
  <v-spacer />
220
223
  <FSRow
@@ -302,24 +305,26 @@
302
305
  padding="16px"
303
306
  gap="24px"
304
307
  >
305
- <template v-if="$props.modelValue.length >= innerItems.length">
306
- <FSRow
307
- gap="2px"
308
- >
309
- <FSText
310
- font="text-button"
308
+ <template v-if="$props.modelValue.length">
309
+ <template v-if="$props.modelValue.length >= innerItems.length">
310
+ <FSRow
311
+ gap="2px"
311
312
  >
312
- {{ $tr("ui.data-table.all-selected-bold", "Attention:") }}
313
- </FSText>
313
+ <FSText
314
+ font="text-button"
315
+ >
316
+ {{ $tr("ui.data-table.all-selected-bold", "Attention:") }}
317
+ </FSText>
318
+ <FSText>
319
+ {{ $tr("ui.data-table.all-selected-regular", "All elements selected") }}
320
+ </FSText>
321
+ </FSRow>
322
+ </template>
323
+ <template v-else>
314
324
  <FSText>
315
- {{ $tr("ui.data-table.all-selected-regular", "All elements selected") }}
325
+ {{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
316
326
  </FSText>
317
- </FSRow>
318
- </template>
319
- <template v-else-if="$props.modelValue.length">
320
- <FSText>
321
- {{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
322
- </FSText>
327
+ </template>
323
328
  </template>
324
329
  <v-spacer />
325
330
  <FSRow
@@ -425,7 +430,7 @@ import FSRow from "../FSRow.vue";
425
430
  import FSCol from "../FSCol.vue";
426
431
 
427
432
  export default defineComponent({
428
- name: "FSDataTable",
433
+ name: "FSDataTableUI",
429
434
  components: {
430
435
  FSDataIteratorItem,
431
436
  FSFilterButton,
@@ -447,6 +452,11 @@ export default defineComponent({
447
452
  type: Array as PropType<FSDataTableColumn[]>,
448
453
  required: true
449
454
  },
455
+ filters: {
456
+ type: Object as PropType<{ [key: string]: FSDataTableFilter[] }>,
457
+ required: false,
458
+ default: () => ({})
459
+ },
450
460
  sneakyHeaders: {
451
461
  type: Array as PropType<string[]>,
452
462
  required: false,
@@ -482,9 +492,9 @@ export default defineComponent({
482
492
  default: null
483
493
  },
484
494
  sortBy: {
485
- type: Array as PropType<FSDataTableOrder[]>,
495
+ type: Object as PropType<FSDataTableOrder>,
486
496
  required: false,
487
- default: () => []
497
+ default: null
488
498
  },
489
499
  modelValue: {
490
500
  type: Array as PropType<string[]>,
@@ -817,6 +827,14 @@ export default defineComponent({
817
827
  return v1.text.localeCompare(v2.text, undefined, { numeric: true });
818
828
  });
819
829
  }
830
+ for (const [key, filters] of Object.entries(props.filters)) {
831
+ for (const filter of filters) {
832
+ const fromDictionary = filterDictionary[key].find(f => f.value == filter.value);
833
+ if (fromDictionary) {
834
+ fromDictionary.hidden = filter.hidden;
835
+ }
836
+ }
837
+ }
820
838
  filters.value = filterDictionary;
821
839
  };
822
840
 
@@ -15,12 +15,13 @@
15
15
  />
16
16
  </template>
17
17
  <FSCard
18
+ class="fs-filter-button-menu"
18
19
  :elevation="true"
19
20
  :border="false"
20
21
  >
21
22
  <FSCol
22
23
  gap="16px"
23
- padding="0 0 0 16px"
24
+ padding="6px 16px"
24
25
  >
25
26
  <FSSpan
26
27
  font="text-overline"
@@ -47,7 +48,7 @@
47
48
  <FSCol>
48
49
  <FSChip
49
50
  v-for="(filter, index) in searchedFilters"
50
- class="fs-filter-button-filter"
51
+ class="fs-filter-button-chip"
51
52
  :key="index"
52
53
  :editable="true"
53
54
  :label="filter.text"
@@ -13,12 +13,13 @@
13
13
  />
14
14
  </template>
15
15
  <FSCard
16
+ class="fs-hidden-button-menu"
16
17
  :elevation="true"
17
18
  :border="false"
18
19
  >
19
20
  <FSCol
20
21
  gap="16px"
21
- padding="16px"
22
+ padding="6px 16px"
22
23
  >
23
24
  <FSSpan
24
25
  font="text-overline"
@@ -27,6 +28,7 @@
27
28
  </FSSpan>
28
29
  <FSChip
29
30
  v-for="(header, index) in $props.headers"
31
+ class="fs-hidden-button-chip"
30
32
  :color="$props.color"
31
33
  :label="header.text"
32
34
  :editable="true"
package/models/index.ts CHANGED
@@ -3,7 +3,7 @@ export * from "./colors";
3
3
  export * from "./deviceAlerts";
4
4
  export * from "./deviceConnectivities";
5
5
  export * from "./deviceStatuses";
6
- export * from "./dispositions";
7
6
  export * from "./modelStatuses";
8
7
  export * from "./rules";
8
+ export * from "./tables";
9
9
  export * from "./toggleSets";
package/models/rules.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { useTimeZone, useTranslationsProvider } from "@dative-gpi/foundation-shared-services/composables";
2
2
 
3
- const { epochToLongDateFormat } = useTimeZone();
3
+ const { epochToLongDateFormat } = useTimeZone()!;
4
4
  const { $tr } = useTranslationsProvider();
5
5
 
6
6
  export const TextRules = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dative-gpi/foundation-shared-components",
3
- "version": "0.0.9",
3
+ "version": "0.0.10",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,8 +9,8 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@dative-gpi/foundation-shared-domain": "0.0.9",
13
- "@dative-gpi/foundation-shared-services": "0.0.9",
12
+ "@dative-gpi/foundation-shared-domain": "0.0.10",
13
+ "@dative-gpi/foundation-shared-services": "0.0.10",
14
14
  "@fontsource/montserrat": "^5.0.16",
15
15
  "@lexical/history": "^0.12.5",
16
16
  "@lexical/link": "^0.12.5",
@@ -19,6 +19,7 @@
19
19
  "@lexical/selection": "^0.12.5",
20
20
  "@lexical/text": "^0.12.5",
21
21
  "@lexical/utils": "^0.12.5",
22
+ "@mdi/font": "^7.4.47",
22
23
  "blurhash": "^2.0.5",
23
24
  "color": "^4.2.3",
24
25
  "lexical": "^0.12.5",
@@ -29,5 +30,5 @@
29
30
  "sass": "^1.69.5",
30
31
  "sass-loader": "^13.3.2"
31
32
  },
32
- "gitHead": "d079d93c7d8677f8269b97bc71820bc35dc46921"
33
+ "gitHead": "765222a4eb6a5cdd690f64bc0ae3c5415081e0f0"
33
34
  }
@@ -1,3 +1,12 @@
1
+ .fs-filter-button-menu {
2
+ @include web {
3
+ min-width: 200px !important;
4
+ }
5
+ @include mobile {
6
+ min-width: 180px !important;
7
+ }
8
+ }
9
+
1
10
  .fs-filter-button-all {
2
11
  width: calc(100% - 16px) !important;
3
12
  }
@@ -7,6 +16,6 @@
7
16
  max-height: 360px;
8
17
  }
9
18
 
10
- .fs-filter-button-filter {
19
+ .fs-filter-button-chip {
11
20
  width: 100%;
12
21
  }
@@ -0,0 +1,12 @@
1
+ .fs-hidden-button-menu {
2
+ @include web {
3
+ min-width: 200px !important;
4
+ }
5
+ @include mobile {
6
+ min-width: 180px !important;
7
+ }
8
+ }
9
+
10
+ .fs-hidden-button-chip {
11
+ width: calc(100% - 16px) !important;
12
+ }
@@ -19,6 +19,7 @@
19
19
  @import "fs_fade_out.scss";
20
20
  @import "fs_filter_button.scss";
21
21
  @import "fs_header_button.scss";
22
+ @import "fs_hidden_button.scss";
22
23
  @import "fs_icon_field.scss";
23
24
  @import "fs_icon.scss";
24
25
  @import "fs_image.scss";
File without changes