@dative-gpi/foundation-shared-components 0.0.9 → 0.0.11
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.
- package/components/FSButton.vue +20 -16
- package/components/lists/{FSDataTable.vue → FSDataTableUI.vue} +53 -35
- package/components/lists/FSFilterButton.vue +3 -2
- package/components/lists/FSHiddenButton.vue +3 -1
- package/models/index.ts +1 -1
- package/models/rules.ts +1 -1
- package/package.json +5 -4
- package/styles/components/fs_calendar.scss +2 -2
- package/styles/components/fs_filter_button.scss +10 -1
- package/styles/components/fs_hidden_button.scss +12 -0
- package/styles/components/index.scss +1 -0
- /package/models/{dispositions.ts → tables.ts} +0 -0
package/components/FSButton.vue
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-btn
|
|
3
|
-
v-if="!['icon'].includes(
|
|
3
|
+
v-if="!['icon'].includes(props.variant)"
|
|
4
4
|
:ripple="false"
|
|
5
5
|
:style="style"
|
|
6
6
|
:class="classes"
|
|
7
|
-
:disabled="
|
|
7
|
+
:disabled="!props.editable"
|
|
8
8
|
v-bind="$attrs"
|
|
9
9
|
>
|
|
10
10
|
<FSRow
|
|
@@ -12,33 +12,33 @@
|
|
|
12
12
|
width="hug"
|
|
13
13
|
:wrap="false"
|
|
14
14
|
>
|
|
15
|
-
<slot name="prepend" v-bind="{ color:
|
|
15
|
+
<slot name="prepend" v-bind="{ color: props.color, colors }">
|
|
16
16
|
<FSIcon
|
|
17
|
-
v-if="
|
|
17
|
+
v-if="props.prependIcon"
|
|
18
18
|
size="l"
|
|
19
19
|
>
|
|
20
|
-
{{
|
|
20
|
+
{{ props.prependIcon }}
|
|
21
21
|
</FSIcon>
|
|
22
22
|
</slot>
|
|
23
|
-
<slot v-bind="{ color:
|
|
23
|
+
<slot v-bind="{ color: props.color, colors }">
|
|
24
24
|
<FSSpan
|
|
25
|
-
v-if="
|
|
25
|
+
v-if="props.label"
|
|
26
26
|
>
|
|
27
|
-
{{
|
|
27
|
+
{{ props.label }}
|
|
28
28
|
</FSSpan>
|
|
29
29
|
</slot>
|
|
30
|
-
<slot name="append" v-bind="{ color:
|
|
30
|
+
<slot name="append" v-bind="{ color: props.color, colors }">
|
|
31
31
|
<FSIcon
|
|
32
|
-
v-if="
|
|
32
|
+
v-if="props.appendIcon"
|
|
33
33
|
size="l"
|
|
34
34
|
>
|
|
35
|
-
{{
|
|
35
|
+
{{ props.appendIcon }}
|
|
36
36
|
</FSIcon>
|
|
37
37
|
</slot>
|
|
38
38
|
</FSRow>
|
|
39
39
|
</v-btn>
|
|
40
40
|
<FSRow
|
|
41
|
-
v-else-if="
|
|
41
|
+
v-else-if="props.icon"
|
|
42
42
|
align="center-center"
|
|
43
43
|
width="hug"
|
|
44
44
|
:style="style"
|
|
@@ -48,19 +48,20 @@
|
|
|
48
48
|
<FSIcon
|
|
49
49
|
size="l"
|
|
50
50
|
>
|
|
51
|
-
{{
|
|
51
|
+
{{ props.icon }}
|
|
52
52
|
</FSIcon>
|
|
53
53
|
<FSSpan
|
|
54
|
-
v-if="
|
|
54
|
+
v-if="props.label"
|
|
55
55
|
font="text-overline"
|
|
56
56
|
>
|
|
57
|
-
{{
|
|
57
|
+
{{ props.label }}
|
|
58
58
|
</FSSpan>
|
|
59
59
|
</FSRow>
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<script lang="ts">
|
|
63
|
-
import { computed, defineComponent, PropType } from "vue";
|
|
63
|
+
import { computed, defineComponent, getCurrentInstance, PropType } from "vue";
|
|
64
|
+
import { useDefaults } from "vuetify";
|
|
64
65
|
|
|
65
66
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
66
67
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -119,6 +120,8 @@ export default defineComponent({
|
|
|
119
120
|
}
|
|
120
121
|
},
|
|
121
122
|
setup(props) {
|
|
123
|
+
props = useDefaults(props, getCurrentInstance().type.name)
|
|
124
|
+
|
|
122
125
|
const textColors = computed(() => useColors().getContrasts(props.color));
|
|
123
126
|
const colors = computed(() => useColors().getColors(props.color));
|
|
124
127
|
const lights = useColors().getColors(ColorEnum.Light);
|
|
@@ -202,6 +205,7 @@ export default defineComponent({
|
|
|
202
205
|
});
|
|
203
206
|
|
|
204
207
|
return {
|
|
208
|
+
props,
|
|
205
209
|
colors,
|
|
206
210
|
style,
|
|
207
211
|
classes
|
|
@@ -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="
|
|
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
|
-
|
|
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
|
|
201
|
-
<
|
|
202
|
-
|
|
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
|
-
|
|
208
|
-
|
|
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.
|
|
218
|
+
{{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
|
|
211
219
|
</FSText>
|
|
212
|
-
</
|
|
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
|
|
306
|
-
<
|
|
307
|
-
|
|
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
|
-
|
|
313
|
-
|
|
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.
|
|
325
|
+
{{ $tr("ui.data-table.some-selected", "{0} element(s) selected", $props.modelValue.length.toString()) }}
|
|
316
326
|
</FSText>
|
|
317
|
-
</
|
|
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: "
|
|
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:
|
|
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="
|
|
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-
|
|
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.
|
|
3
|
+
"version": "0.0.11",
|
|
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.
|
|
13
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
12
|
+
"@dative-gpi/foundation-shared-domain": "0.0.11",
|
|
13
|
+
"@dative-gpi/foundation-shared-services": "0.0.11",
|
|
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": "
|
|
33
|
+
"gitHead": "4f28939e7d42ab1ef8319c614fbc210b1291fd79"
|
|
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-
|
|
19
|
+
.fs-filter-button-chip {
|
|
11
20
|
width: 100%;
|
|
12
21
|
}
|
|
File without changes
|