@dative-gpi/foundation-shared-components 0.0.11 → 0.0.12
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/aliases/FSButton.ts +8 -6
- package/components/FSAutocompleteField.vue +7 -5
- package/components/FSBreadcrumbs.vue +3 -1
- package/components/FSButton.vue +12 -9
- package/components/FSCalendar.vue +4 -3
- package/components/FSCalendarTwin.vue +4 -3
- package/components/FSCarousel.vue +3 -1
- package/components/FSCheckbox.vue +5 -3
- package/components/FSChip.vue +5 -3
- package/components/FSClock.vue +5 -4
- package/components/FSColor.vue +3 -1
- package/components/FSColorIcon.vue +3 -1
- package/components/FSContainer.vue +4 -2
- package/components/FSDateField.vue +4 -3
- package/components/FSDateRangeField.vue +4 -3
- package/components/FSDateTimeField.vue +4 -3
- package/components/FSDateTimeRangeField.vue +4 -3
- package/components/FSDivider.vue +3 -1
- package/components/FSFadeOut.vue +3 -1
- package/components/FSFileButton.vue +4 -3
- package/components/FSIconField.vue +5 -3
- package/components/FSImage.vue +1 -1
- package/components/FSLink.vue +95 -0
- package/components/FSPagination.vue +80 -0
- package/components/FSPasswordField.vue +4 -2
- package/components/FSRadio.vue +5 -3
- package/components/FSRemoveDialog.vue +1 -1
- package/components/FSRichTextField.vue +7 -6
- package/components/FSSearchField.vue +46 -13
- package/components/FSSelectField.vue +5 -3
- package/components/FSSlideGroup.vue +2 -1
- package/components/FSSlider.vue +5 -3
- package/components/FSSubmitDialog.vue +1 -1
- package/components/FSSwitch.vue +6 -4
- package/components/FSTabs.vue +4 -3
- package/components/FSTag.vue +4 -2
- package/components/FSTagField.vue +4 -3
- package/components/FSText.vue +2 -1
- package/components/FSTextArea.vue +4 -3
- package/components/FSTextField.vue +5 -3
- package/components/FSWrapGroup.vue +2 -1
- package/components/deviceOrganisations/FSConnectivity.vue +2 -1
- package/components/deviceOrganisations/FSWorstAlert.vue +2 -1
- package/components/lists/FSDataTableUI.vue +5 -4
- package/components/lists/FSFilterButton.vue +24 -16
- package/components/lists/FSHiddenButton.vue +1 -0
- package/components/lists/FSLoadDataTable.vue +88 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +1 -1
- package/components/tiles/FSGroupTileUI.vue +1 -1
- package/components/{FSLoadTile.vue → tiles/FSLoadTile.vue} +9 -7
- package/components/{FSTile.vue → tiles/FSTile.vue} +5 -4
- package/composables/index.ts +1 -0
- package/composables/useDebounce.ts +22 -0
- package/models/rules.ts +2 -1
- package/package.json +6 -4
- package/styles/components/fs_link.scss +6 -0
- package/styles/components/fs_load_data_table.scss +77 -0
- package/styles/components/fs_pagination.scss +11 -0
- package/styles/components/index.scss +3 -0
- package/index.ts +0 -6
|
@@ -6,18 +6,27 @@
|
|
|
6
6
|
:hideHeader="$props.hideHeader"
|
|
7
7
|
:required="$props.required"
|
|
8
8
|
:editable="$props.editable"
|
|
9
|
+
:placeholder="placeholder"
|
|
9
10
|
@keydown.enter="$emit('update:modelValue', innerValue)"
|
|
10
11
|
v-model="innerValue"
|
|
11
12
|
v-bind="$attrs"
|
|
12
13
|
>
|
|
13
|
-
<template
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
<template v-if="$props.prependInnerIcon" #prepend-inner>
|
|
15
|
+
<slot name="prepend-inner">
|
|
16
|
+
<FSButton
|
|
17
|
+
variant="icon"
|
|
18
|
+
:icon="$props.prependInnerIcon"
|
|
19
|
+
:editable="$props.editable"
|
|
20
|
+
:color="ColorEnum.Dark"
|
|
21
|
+
@click="$emit('update:modelValue', innerValue)"
|
|
22
|
+
/>
|
|
23
|
+
</slot>
|
|
24
|
+
</template>
|
|
25
|
+
<template v-if="!['instant'].includes($props.variant)" #append>
|
|
17
26
|
<slot name="append">
|
|
18
27
|
<FSButton
|
|
19
28
|
:prependIcon="$props.buttonPrependIcon"
|
|
20
|
-
:label="
|
|
29
|
+
:label="buttonLabel"
|
|
21
30
|
:appendIcon="$props.buttonAppendIcon"
|
|
22
31
|
:variant="$props.buttonVariant"
|
|
23
32
|
:color="$props.buttonColor"
|
|
@@ -33,8 +42,9 @@
|
|
|
33
42
|
</template>
|
|
34
43
|
|
|
35
44
|
<script lang="ts">
|
|
36
|
-
import { defineComponent, PropType, ref, watch } from "vue";
|
|
45
|
+
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
37
46
|
|
|
47
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
38
48
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
39
49
|
|
|
40
50
|
import FSTextField from "./FSTextField.vue";
|
|
@@ -57,11 +67,26 @@ export default defineComponent({
|
|
|
57
67
|
required: false,
|
|
58
68
|
default: null
|
|
59
69
|
},
|
|
60
|
-
|
|
70
|
+
placeholder: {
|
|
71
|
+
type: String,
|
|
72
|
+
required: false,
|
|
73
|
+
default: null
|
|
74
|
+
},
|
|
75
|
+
prependInnerIcon: {
|
|
61
76
|
type: String,
|
|
62
77
|
required: false,
|
|
63
78
|
default: "mdi-magnify"
|
|
64
79
|
},
|
|
80
|
+
variant: {
|
|
81
|
+
type: String as PropType<"standard" | "instant">,
|
|
82
|
+
required: false,
|
|
83
|
+
default: "instant"
|
|
84
|
+
},
|
|
85
|
+
buttonPrependIcon: {
|
|
86
|
+
type: String,
|
|
87
|
+
required: false,
|
|
88
|
+
default: null
|
|
89
|
+
},
|
|
65
90
|
buttonLabel: {
|
|
66
91
|
type: String,
|
|
67
92
|
required: false,
|
|
@@ -97,11 +122,6 @@ export default defineComponent({
|
|
|
97
122
|
required: false,
|
|
98
123
|
default: false
|
|
99
124
|
},
|
|
100
|
-
instant: {
|
|
101
|
-
type: Boolean,
|
|
102
|
-
required: false,
|
|
103
|
-
default: true
|
|
104
|
-
},
|
|
105
125
|
required: {
|
|
106
126
|
type: Boolean,
|
|
107
127
|
required: false,
|
|
@@ -115,15 +135,28 @@ export default defineComponent({
|
|
|
115
135
|
},
|
|
116
136
|
emits: ["update:modelValue"],
|
|
117
137
|
setup(props, { emit }) {
|
|
138
|
+
const { $tr } = useTranslationsProvider();
|
|
139
|
+
|
|
118
140
|
const innerValue = ref(props.modelValue);
|
|
119
141
|
|
|
142
|
+
const placeholder = computed(() => {
|
|
143
|
+
return props.placeholder ?? $tr('ui.search.placeholder', 'Search...');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const buttonLabel = computed(() => {
|
|
147
|
+
return props.buttonLabel ?? $tr('ui.button.search', 'Search');
|
|
148
|
+
});
|
|
149
|
+
|
|
120
150
|
watch(innerValue, () => {
|
|
121
|
-
if (props.
|
|
151
|
+
if (["instant"].includes(props.variant)) {
|
|
122
152
|
emit("update:modelValue", innerValue.value);
|
|
123
153
|
}
|
|
124
154
|
});
|
|
125
155
|
|
|
126
156
|
return {
|
|
157
|
+
ColorEnum,
|
|
158
|
+
placeholder,
|
|
159
|
+
buttonLabel,
|
|
127
160
|
innerValue
|
|
128
161
|
};
|
|
129
162
|
}
|
|
@@ -140,13 +140,15 @@ export default defineComponent({
|
|
|
140
140
|
},
|
|
141
141
|
emits: ["update:modelValue"],
|
|
142
142
|
setup(props) {
|
|
143
|
+
const { getColors } = useColors();
|
|
143
144
|
const { slots } = useSlots();
|
|
145
|
+
|
|
144
146
|
delete slots.label;
|
|
145
147
|
delete slots.description;
|
|
146
148
|
|
|
147
|
-
const errors =
|
|
148
|
-
const lights =
|
|
149
|
-
const darks =
|
|
149
|
+
const errors = getColors(ColorEnum.Error);
|
|
150
|
+
const lights = getColors(ColorEnum.Light);
|
|
151
|
+
const darks = getColors(ColorEnum.Dark);
|
|
150
152
|
|
|
151
153
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
152
154
|
if (!props.editable) {
|
|
@@ -36,8 +36,9 @@ export default defineComponent({
|
|
|
36
36
|
},
|
|
37
37
|
setup(props) {
|
|
38
38
|
const { getChildren } = useSlots();
|
|
39
|
+
const { getColors } = useColors();
|
|
39
40
|
|
|
40
|
-
const darks =
|
|
41
|
+
const darks = getColors(ColorEnum.Dark);
|
|
41
42
|
|
|
42
43
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
43
44
|
return {
|
package/components/FSSlider.vue
CHANGED
|
@@ -101,9 +101,11 @@ export default defineComponent({
|
|
|
101
101
|
}
|
|
102
102
|
},
|
|
103
103
|
setup(props) {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
const
|
|
104
|
+
const { getColors } = useColors();
|
|
105
|
+
|
|
106
|
+
const colors = computed(() => getColors(props.color));
|
|
107
|
+
const lights = getColors(ColorEnum.Light);
|
|
108
|
+
const darks = getColors(ColorEnum.Dark);
|
|
107
109
|
|
|
108
110
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
109
111
|
if (!props.editable) {
|
|
@@ -54,8 +54,8 @@
|
|
|
54
54
|
<script lang="ts">
|
|
55
55
|
import { computed, defineComponent, PropType } from "vue";
|
|
56
56
|
|
|
57
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
57
58
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
58
|
-
import { useTranslationsProvider } from "@dative-gpi/foundation-shared-services";
|
|
59
59
|
|
|
60
60
|
import FSDialog from "./FSDialog.vue";
|
|
61
61
|
import FSRow from "./FSRow.vue";
|
package/components/FSSwitch.vue
CHANGED
|
@@ -87,10 +87,12 @@ export default defineComponent({
|
|
|
87
87
|
},
|
|
88
88
|
emits: ["update:modelValue"],
|
|
89
89
|
setup(props, { emit }) {
|
|
90
|
-
const
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
const
|
|
90
|
+
const { getColors } = useColors();
|
|
91
|
+
|
|
92
|
+
const colors = computed(() => getColors(props.color));
|
|
93
|
+
const backgrounds = getColors(ColorEnum.Background);
|
|
94
|
+
const lights = getColors(ColorEnum.Light);
|
|
95
|
+
const darks = getColors(ColorEnum.Dark);
|
|
94
96
|
|
|
95
97
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
96
98
|
if (!props.editable) {
|
package/components/FSTabs.vue
CHANGED
|
@@ -40,11 +40,12 @@ export default defineComponent({
|
|
|
40
40
|
}
|
|
41
41
|
},
|
|
42
42
|
setup(props) {
|
|
43
|
+
const { getColors, getContrasts } = useColors();
|
|
43
44
|
const { getChildren } = useSlots();
|
|
44
45
|
|
|
45
|
-
const textColors = computed(() =>
|
|
46
|
-
const colors = computed(() =>
|
|
47
|
-
const darks =
|
|
46
|
+
const textColors = computed(() => getContrasts(props.color));
|
|
47
|
+
const colors = computed(() => getColors(props.color));
|
|
48
|
+
const darks = getColors(ColorEnum.Dark);
|
|
48
49
|
|
|
49
50
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => ({
|
|
50
51
|
"--fs-group-color" : darks.base,
|
package/components/FSTag.vue
CHANGED
|
@@ -73,8 +73,10 @@ export default defineComponent({
|
|
|
73
73
|
},
|
|
74
74
|
emits: ["remove"],
|
|
75
75
|
setup(props) {
|
|
76
|
-
const
|
|
77
|
-
|
|
76
|
+
const { getColors, getContrasts } = useColors();
|
|
77
|
+
|
|
78
|
+
const textColors = computed(() => getContrasts(props.color));
|
|
79
|
+
const colors = computed(() => getColors(props.color));
|
|
78
80
|
|
|
79
81
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
80
82
|
switch (props.variant) {
|
|
@@ -141,10 +141,11 @@ export default defineComponent({
|
|
|
141
141
|
},
|
|
142
142
|
emits: ["update:modelValue"],
|
|
143
143
|
setup(props, { emit }) {
|
|
144
|
+
const { getColors } = useColors();
|
|
144
145
|
|
|
145
|
-
const errors =
|
|
146
|
-
const lights =
|
|
147
|
-
const darks =
|
|
146
|
+
const errors = getColors(ColorEnum.Error);
|
|
147
|
+
const lights = getColors(ColorEnum.Light);
|
|
148
|
+
const darks = getColors(ColorEnum.Dark);
|
|
148
149
|
|
|
149
150
|
const innerValue = ref("");
|
|
150
151
|
|
package/components/FSText.vue
CHANGED
|
@@ -44,9 +44,10 @@ export default defineComponent({
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
setup(props) {
|
|
47
|
+
const { getColors } = useColors();
|
|
47
48
|
const { slots } = useSlots();
|
|
48
49
|
|
|
49
|
-
const colors = computed(() =>
|
|
50
|
+
const colors = computed(() => getColors(props.color));
|
|
50
51
|
|
|
51
52
|
const classes = computed((): string[] => {
|
|
52
53
|
const classNames = ["fs-text", props.font];
|
|
@@ -139,10 +139,11 @@ export default defineComponent({
|
|
|
139
139
|
emits: ["update:modelValue"],
|
|
140
140
|
setup(props) {
|
|
141
141
|
const { isMobileSized } = useBreakpoints();
|
|
142
|
+
const { getColors } = useColors();
|
|
142
143
|
|
|
143
|
-
const errors =
|
|
144
|
-
const lights =
|
|
145
|
-
const darks =
|
|
144
|
+
const errors = getColors(ColorEnum.Error);
|
|
145
|
+
const lights = getColors(ColorEnum.Light);
|
|
146
|
+
const darks = getColors(ColorEnum.Dark);
|
|
146
147
|
|
|
147
148
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
148
149
|
let height: string | undefined = undefined;
|
|
@@ -124,13 +124,15 @@ export default defineComponent({
|
|
|
124
124
|
},
|
|
125
125
|
emits: ["update:modelValue"],
|
|
126
126
|
setup(props) {
|
|
127
|
+
const { getColors } = useColors();
|
|
127
128
|
const { slots } = useSlots();
|
|
129
|
+
|
|
128
130
|
delete slots.label;
|
|
129
131
|
delete slots.description;
|
|
130
132
|
|
|
131
|
-
const errors =
|
|
132
|
-
const lights =
|
|
133
|
-
const darks =
|
|
133
|
+
const errors = getColors(ColorEnum.Error);
|
|
134
|
+
const lights = getColors(ColorEnum.Light);
|
|
135
|
+
const darks = getColors(ColorEnum.Dark);
|
|
134
136
|
|
|
135
137
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
136
138
|
if (!props.editable) {
|
|
@@ -35,8 +35,9 @@ export default defineComponent({
|
|
|
35
35
|
},
|
|
36
36
|
setup(props) {
|
|
37
37
|
const { getChildren } = useSlots();
|
|
38
|
+
const { getColors } = useColors();
|
|
38
39
|
|
|
39
|
-
const darks =
|
|
40
|
+
const darks = getColors(ColorEnum.Dark);
|
|
40
41
|
|
|
41
42
|
const style = computed((): { [code: string]: string } & Partial<CSSStyleDeclaration> => {
|
|
42
43
|
return {
|
|
@@ -57,9 +57,10 @@
|
|
|
57
57
|
<script lang="ts">
|
|
58
58
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
59
59
|
|
|
60
|
-
import {
|
|
60
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
61
61
|
import { FSDeviceConnectivity } from "@dative-gpi/foundation-shared-components/models";
|
|
62
62
|
import { ConnectivityStatus } from "@dative-gpi/foundation-shared-domain/models";
|
|
63
|
+
import { useTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
63
64
|
|
|
64
65
|
import FSColorIcon from "../FSColorIcon.vue";
|
|
65
66
|
import FSCard from "../FSCard.vue";
|
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
<script lang="ts">
|
|
63
63
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
64
64
|
|
|
65
|
-
import {
|
|
65
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
66
66
|
import { AlertStatus, Criticity } from "@dative-gpi/foundation-shared-domain/models";
|
|
67
|
+
import { useTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
67
68
|
import { FSDeviceAlert } from "@dative-gpi/foundation-shared-components/models";
|
|
68
69
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
69
70
|
|
|
@@ -412,7 +412,7 @@ import { useRouter } from "vue-router";
|
|
|
412
412
|
|
|
413
413
|
import { ColorEnum, FSDataTableColumn, FSDataTableFilter, FSDataTableOrder, FSToggle } from "@dative-gpi/foundation-shared-components/models";
|
|
414
414
|
import { useBreakpoints, useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
415
|
-
import { useTranslationsProvider } from "@dative-gpi/
|
|
415
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
416
416
|
|
|
417
417
|
import FSDataIteratorItem from "./FSDataIteratorItem.vue";
|
|
418
418
|
import FSFilterButton from "./FSFilterButton.vue";
|
|
@@ -546,10 +546,11 @@ export default defineComponent({
|
|
|
546
546
|
setup(props, { emit }) {
|
|
547
547
|
const { isExtraSmall } = useBreakpoints();
|
|
548
548
|
const { $tr } = useTranslationsProvider();
|
|
549
|
+
const { getColors } = useColors();
|
|
549
550
|
const router = useRouter();
|
|
550
551
|
|
|
551
|
-
const backgrounds =
|
|
552
|
-
const lights =
|
|
552
|
+
const backgrounds = getColors(ColorEnum.Background);
|
|
553
|
+
const lights = getColors(ColorEnum.Light);
|
|
553
554
|
|
|
554
555
|
const filters = ref<{ [key: string]: FSDataTableFilter[] }>({});
|
|
555
556
|
const innerRowsPerPage = ref(props.rowsPerPage);
|
|
@@ -829,7 +830,7 @@ export default defineComponent({
|
|
|
829
830
|
}
|
|
830
831
|
for (const [key, filters] of Object.entries(props.filters)) {
|
|
831
832
|
for (const filter of filters) {
|
|
832
|
-
const fromDictionary = filterDictionary[key]
|
|
833
|
+
const fromDictionary = filterDictionary[key]?.find(f => f.value == filter.value);
|
|
833
834
|
if (fromDictionary) {
|
|
834
835
|
fromDictionary.hidden = filter.hidden;
|
|
835
836
|
}
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
class="fs-filter-button-all"
|
|
33
33
|
:editable="true"
|
|
34
34
|
:color="$props.color"
|
|
35
|
-
:variant="
|
|
35
|
+
:variant="getAllVariant()"
|
|
36
36
|
:label="$tr('ui.data-table.all-values', 'All values')"
|
|
37
37
|
@click="onToggleAll"
|
|
38
38
|
/>
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
72
72
|
|
|
73
73
|
import { ColorBase, ColorEnum, FSDataTableColumn, FSDataTableFilter } from "@dative-gpi/foundation-shared-components/models";
|
|
74
|
-
import { useTranslationsProvider } from "@dative-gpi/
|
|
74
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
75
75
|
|
|
76
76
|
import FSSearchField from "../FSSearchField.vue";
|
|
77
77
|
import FSFadeOut from "../FSFadeOut.vue";
|
|
@@ -110,9 +110,9 @@ export default defineComponent({
|
|
|
110
110
|
setup(props, { emit }) {
|
|
111
111
|
const { $tr } = useTranslationsProvider();
|
|
112
112
|
|
|
113
|
+
const singlePick = ref(false);
|
|
113
114
|
const expanded = ref(false);
|
|
114
115
|
const search = ref(null);
|
|
115
|
-
const all = ref(!props.filters?.some(f => f.hidden) ?? true);
|
|
116
116
|
|
|
117
117
|
const label = computed(() => {
|
|
118
118
|
if (props.filters) {
|
|
@@ -132,32 +132,39 @@ export default defineComponent({
|
|
|
132
132
|
});
|
|
133
133
|
|
|
134
134
|
const getVariant = (filter: FSDataTableFilter): "standard" | "full" => {
|
|
135
|
-
if (
|
|
135
|
+
if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
|
|
136
|
+
if (filter.hidden) {
|
|
137
|
+
return "standard";
|
|
138
|
+
}
|
|
139
|
+
return "full";
|
|
140
|
+
}
|
|
141
|
+
return "standard";
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const getAllVariant = (): "standard" | "full" => {
|
|
145
|
+
if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
|
|
136
146
|
return "standard";
|
|
137
147
|
}
|
|
138
148
|
return "full";
|
|
139
149
|
};
|
|
140
150
|
|
|
141
151
|
const onToggle = (filter: FSDataTableFilter): void => {
|
|
142
|
-
if (
|
|
143
|
-
|
|
144
|
-
emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value !== filter.value })));
|
|
152
|
+
if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
|
|
153
|
+
emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value === filter.value ? !f.hidden : f.hidden })));
|
|
145
154
|
}
|
|
146
155
|
else {
|
|
147
|
-
|
|
148
|
-
all.value = true;
|
|
149
|
-
}
|
|
150
|
-
emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value === filter.value ? !f.hidden : f.hidden })));
|
|
156
|
+
emit("update:filter", props.filters.map(f => ({ ...f, hidden: f.value === filter.value ? false : true })));
|
|
151
157
|
}
|
|
158
|
+
singlePick.value = true;
|
|
152
159
|
};
|
|
153
160
|
|
|
154
161
|
const onToggleAll = (): void => {
|
|
155
|
-
if (
|
|
156
|
-
|
|
162
|
+
if (singlePick.value || props.filters.filter(f => f.hidden).length > 0) {
|
|
163
|
+
singlePick.value = false;
|
|
164
|
+
emit("update:filter", props.filters.map(f => ({ ...f, hidden: false })));
|
|
157
165
|
}
|
|
158
166
|
else {
|
|
159
|
-
|
|
160
|
-
emit("update:filter", props.filters.map(f => ({ ...f, hidden: false })));
|
|
167
|
+
singlePick.value = true;
|
|
161
168
|
}
|
|
162
169
|
};
|
|
163
170
|
|
|
@@ -167,8 +174,9 @@ export default defineComponent({
|
|
|
167
174
|
expanded,
|
|
168
175
|
search,
|
|
169
176
|
label,
|
|
170
|
-
|
|
177
|
+
singlePick,
|
|
171
178
|
getVariant,
|
|
179
|
+
getAllVariant,
|
|
172
180
|
onToggle,
|
|
173
181
|
onToggleAll
|
|
174
182
|
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol
|
|
3
|
+
class="fs-load-data-table"
|
|
4
|
+
gap="16px"
|
|
5
|
+
:style="style"
|
|
6
|
+
>
|
|
7
|
+
<FSRow
|
|
8
|
+
align="bottom-center"
|
|
9
|
+
>
|
|
10
|
+
<v-skeleton-loader
|
|
11
|
+
type="button"
|
|
12
|
+
/>
|
|
13
|
+
<v-skeleton-loader
|
|
14
|
+
type="button"
|
|
15
|
+
/>
|
|
16
|
+
<v-spacer />
|
|
17
|
+
<v-skeleton-loader
|
|
18
|
+
type="button"
|
|
19
|
+
/>
|
|
20
|
+
<v-skeleton-loader
|
|
21
|
+
type="button"
|
|
22
|
+
/>
|
|
23
|
+
</FSRow>
|
|
24
|
+
<FSRow>
|
|
25
|
+
<v-skeleton-loader
|
|
26
|
+
type="chip"
|
|
27
|
+
/>
|
|
28
|
+
<v-skeleton-loader
|
|
29
|
+
type="chip"
|
|
30
|
+
/>
|
|
31
|
+
<v-skeleton-loader
|
|
32
|
+
type="chip"
|
|
33
|
+
/>
|
|
34
|
+
</FSRow>
|
|
35
|
+
<v-skeleton-loader
|
|
36
|
+
type="table-row-divider@10"
|
|
37
|
+
/>
|
|
38
|
+
<FSRow
|
|
39
|
+
align="bottom-right"
|
|
40
|
+
>
|
|
41
|
+
<v-skeleton-loader
|
|
42
|
+
type="button"
|
|
43
|
+
/>
|
|
44
|
+
<v-skeleton-loader
|
|
45
|
+
type="button"
|
|
46
|
+
/>
|
|
47
|
+
<v-skeleton-loader
|
|
48
|
+
type="button"
|
|
49
|
+
/>
|
|
50
|
+
<v-skeleton-loader
|
|
51
|
+
type="button"
|
|
52
|
+
/>
|
|
53
|
+
</FSRow>
|
|
54
|
+
</FSCol>
|
|
55
|
+
</template>
|
|
56
|
+
|
|
57
|
+
<script lang="ts">
|
|
58
|
+
import { computed, defineComponent } from "vue";
|
|
59
|
+
|
|
60
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
61
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
62
|
+
|
|
63
|
+
import FSCol from "../FSCol.vue";
|
|
64
|
+
import FSRow from "../FSRow.vue";
|
|
65
|
+
|
|
66
|
+
export default defineComponent({
|
|
67
|
+
name: "FSLoadDataTable",
|
|
68
|
+
components: {
|
|
69
|
+
FSCol,
|
|
70
|
+
FSRow
|
|
71
|
+
},
|
|
72
|
+
setup() {
|
|
73
|
+
const { getColors } = useColors();
|
|
74
|
+
|
|
75
|
+
const backgroundColors = getColors(ColorEnum.Background);
|
|
76
|
+
|
|
77
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
78
|
+
return {
|
|
79
|
+
"--fs-load-data-table-background-color": backgroundColors.base
|
|
80
|
+
};
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
return {
|
|
84
|
+
style
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
</script>
|
|
@@ -82,7 +82,7 @@ import FSWorstAlert from "../deviceOrganisations/FSWorstAlert.vue";
|
|
|
82
82
|
import FSDivider from "../FSDivider.vue";
|
|
83
83
|
import FSImage from "../FSImage.vue";
|
|
84
84
|
import FSSpan from "../FSSpan.vue";
|
|
85
|
-
import FSTile from "
|
|
85
|
+
import FSTile from "./FSTile.vue";
|
|
86
86
|
import FSCol from "../FSCol.vue";
|
|
87
87
|
import FSRow from "../FSRow.vue";
|
|
88
88
|
|
|
@@ -100,7 +100,7 @@ import FSImage from "../FSImage.vue";
|
|
|
100
100
|
import FSColor from "../FSColor.vue";
|
|
101
101
|
import FSSpan from "../FSSpan.vue";
|
|
102
102
|
import FSText from "../FSText.vue";
|
|
103
|
-
import FSTile from "
|
|
103
|
+
import FSTile from "./FSTile.vue";
|
|
104
104
|
import FSCol from "../FSCol.vue";
|
|
105
105
|
import FSRow from "../FSRow.vue";
|
|
106
106
|
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
@update:modelValue="() => $emit('update:modelValue', !$props.modelValue)"
|
|
29
29
|
/>
|
|
30
30
|
</FSContainer>
|
|
31
|
-
</FSCard>
|
|
31
|
+
</FSCard>
|
|
32
32
|
</template>
|
|
33
33
|
|
|
34
34
|
<script lang="ts">
|
|
@@ -37,11 +37,11 @@ import { computed, defineComponent } from "vue";
|
|
|
37
37
|
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
38
38
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
39
39
|
|
|
40
|
-
import FSContainer from "
|
|
41
|
-
import FSCheckbox from "
|
|
42
|
-
import FSCard from "
|
|
43
|
-
import FSCol from "
|
|
44
|
-
import FSRow from "
|
|
40
|
+
import FSContainer from "../FSContainer.vue";
|
|
41
|
+
import FSCheckbox from "../FSCheckbox.vue";
|
|
42
|
+
import FSCard from "../FSCard.vue";
|
|
43
|
+
import FSCol from "../FSCol.vue";
|
|
44
|
+
import FSRow from "../FSRow.vue";
|
|
45
45
|
|
|
46
46
|
export default defineComponent({
|
|
47
47
|
name: "FSTile",
|
|
@@ -64,10 +64,12 @@ export default defineComponent({
|
|
|
64
64
|
default: false
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
+
emits: ["update:modelValue"],
|
|
67
68
|
setup() {
|
|
68
69
|
const { isMobileSized } = useBreakpoints();
|
|
70
|
+
const { getColors } = useColors();
|
|
69
71
|
|
|
70
|
-
const backgroundColors =
|
|
72
|
+
const backgroundColors = getColors(ColorEnum.Background);
|
|
71
73
|
|
|
72
74
|
const width = computed(() => {
|
|
73
75
|
return isMobileSized.value ? 336 : 352;
|
|
@@ -31,9 +31,9 @@ import { computed, defineComponent, PropType } from "vue";
|
|
|
31
31
|
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
32
32
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
33
33
|
|
|
34
|
-
import FSContainer from "
|
|
35
|
-
import FSCheckbox from "
|
|
36
|
-
import FSCard from "
|
|
34
|
+
import FSContainer from "../FSContainer.vue";
|
|
35
|
+
import FSCheckbox from "../FSCheckbox.vue";
|
|
36
|
+
import FSCard from "../FSCard.vue";
|
|
37
37
|
|
|
38
38
|
export default defineComponent({
|
|
39
39
|
name: "FSTile",
|
|
@@ -62,8 +62,9 @@ export default defineComponent({
|
|
|
62
62
|
emits: ["update:modelValue"],
|
|
63
63
|
setup(props) {
|
|
64
64
|
const { isMobileSized } = useBreakpoints();
|
|
65
|
+
const { getGradients } = useColors();
|
|
65
66
|
|
|
66
|
-
const bottomColors = computed(() =>
|
|
67
|
+
const bottomColors = computed(() => getGradients(props.bottomColor));
|
|
67
68
|
|
|
68
69
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
69
70
|
return {
|
package/composables/index.ts
CHANGED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ref, Ref } from "vue";
|
|
2
|
+
|
|
3
|
+
export const useDebounce = () => {
|
|
4
|
+
const timeOutId: Ref<NodeJS.Timeout | null> = ref(null);
|
|
5
|
+
|
|
6
|
+
const debounce = (callback: Function, wait: number, ...args: any[]): void => {
|
|
7
|
+
cancel();
|
|
8
|
+
timeOutId.value = setTimeout(() => callback(...args), wait);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const cancel = (): void => {
|
|
12
|
+
if (timeOutId.value) {
|
|
13
|
+
clearTimeout(timeOutId.value);
|
|
14
|
+
timeOutId.value = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return {
|
|
19
|
+
debounce,
|
|
20
|
+
cancel
|
|
21
|
+
};
|
|
22
|
+
}
|