@dative-gpi/foundation-shared-components 0.0.11 → 0.0.13
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/FSBreadcrumbs.vue +3 -1
- package/components/FSButton.vue +13 -10
- package/components/FSCalendar.vue +4 -3
- package/components/FSCalendarTwin.vue +4 -3
- package/components/FSCarousel.vue +3 -1
- package/components/FSCheckbox.vue +8 -6
- package/components/FSChip.vue +5 -3
- package/components/FSClock.vue +50 -34
- package/components/FSColor.vue +3 -1
- package/components/FSColorIcon.vue +3 -1
- package/components/FSContainer.vue +4 -2
- package/components/FSDivider.vue +49 -8
- package/components/FSFadeOut.vue +3 -1
- package/components/FSFileButton.vue +4 -3
- package/components/FSForm.vue +52 -0
- package/components/FSImage.vue +42 -33
- package/components/FSLabel.vue +105 -0
- package/components/FSLink.vue +95 -0
- package/components/FSPagination.vue +96 -0
- package/components/FSPermissions.vue +0 -0
- package/components/FSRadio.vue +8 -6
- package/components/FSRemoveDialog.vue +1 -1
- package/components/FSSlideGroup.vue +2 -1
- package/components/FSSlider.vue +5 -3
- package/components/FSSubmitDialog.vue +2 -2
- package/components/FSSwitch.vue +9 -7
- package/components/FSTabs.vue +4 -3
- package/components/FSTag.vue +4 -2
- package/components/FSText.vue +3 -2
- package/components/FSWrapGroup.vue +2 -1
- package/components/deviceOrganisations/FSConnectivity.vue +2 -1
- package/components/deviceOrganisations/FSWorstAlert.vue +2 -1
- package/components/{FSAutocompleteField.vue → fields/FSAutocompleteField.vue} +25 -22
- package/components/fields/FSColorField.vue +194 -0
- package/components/{FSDateField.vue → fields/FSDateField.vue} +18 -52
- package/components/{FSDateRangeField.vue → fields/FSDateRangeField.vue} +22 -67
- package/components/{FSDateTimeField.vue → fields/FSDateTimeField.vue} +20 -54
- package/components/{FSDateTimeRangeField.vue → fields/FSDateTimeRangeField.vue} +27 -70
- package/components/{FSIconField.vue → fields/FSIconField.vue} +20 -53
- package/components/{FSNumberField.vue → fields/FSNumberField.vue} +0 -24
- package/components/{FSPasswordField.vue → fields/FSPasswordField.vue} +9 -31
- package/components/{FSRichTextField.vue → fields/FSRichTextField.vue} +10 -9
- package/components/{FSSearchField.vue → fields/FSSearchField.vue} +47 -14
- package/components/{FSSelectField.vue → fields/FSSelectField.vue} +22 -24
- package/components/{FSTagField.vue → fields/FSTagField.vue} +19 -53
- package/components/{FSTextArea.vue → fields/FSTextArea.vue} +28 -27
- package/components/{FSTextField.vue → fields/FSTextField.vue} +23 -21
- package/components/fields/FSTimeField.vue +104 -0
- package/components/fields/FSTimeSlotField.vue +263 -0
- package/components/lists/FSDataTableUI.vue +7 -6
- package/components/lists/FSFilterButton.vue +25 -17
- package/components/lists/FSHiddenButton.vue +1 -0
- package/components/lists/FSLoadDataTable.vue +88 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +5 -10
- package/components/tiles/FSGroupTileUI.vue +5 -10
- package/components/{FSLoadTile.vue → tiles/FSLoadTile.vue} +9 -7
- package/components/{FSTile.vue → tiles/FSTile.vue} +5 -4
- package/composables/index.ts +2 -0
- package/composables/useBreakpoints.ts +7 -5
- package/composables/useDebounce.ts +22 -0
- package/composables/useRules.ts +72 -0
- package/elements/FSFormElement.ts +17 -0
- package/icons/flags/France.vue +9 -0
- package/icons/flags/Germany.vue +7 -0
- package/icons/flags/GreatBritain.vue +9 -0
- package/icons/flags/Italy.vue +9 -0
- package/icons/flags/Portugal.vue +59 -0
- package/icons/flags/Spain.vue +546 -0
- package/icons/flags/UnitedStates.vue +12 -0
- package/icons/sets.ts +17 -0
- package/models/rules.ts +10 -1
- package/package.json +6 -4
- package/pages/FSExternalIdentityButton.vue +64 -0
- package/pages/FSLanguageSetter.vue +140 -0
- package/pages/FSLoginPage.vue +253 -0
- package/styles/components/fs_clock.scss +4 -0
- package/styles/components/fs_color_field.scss +17 -0
- package/styles/components/fs_divider.scss +5 -0
- package/styles/components/fs_image.scss +12 -1
- package/styles/components/fs_label.scss +86 -0
- 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/fs_time_field.scss +3 -0
- package/styles/components/fs_timeslot_field.scss +75 -0
- package/styles/components/index.scss +7 -0
- package/styles/globals/text_fonts.scss +18 -0
- package/styles/main.scss +3 -1
- package/styles/pages/fs_language_setter.scss +55 -0
- package/styles/pages/index.scss +1 -0
- package/utils/color.ts +7 -0
- package/utils/css.ts +2 -1
- package/utils/index.ts +3 -1
- package/utils/time.ts +29 -0
- package/components/FSHeaderButton.vue +0 -17
- package/components/lists/FSDataIteratorGroup.vue +0 -7
- package/index.ts +0 -6
|
@@ -0,0 +1,263 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol>
|
|
3
|
+
<slot v-if="!$props.hideHeader" name="label">
|
|
4
|
+
<FSRow :wrap="false">
|
|
5
|
+
<FSSpan
|
|
6
|
+
v-if="$props.label"
|
|
7
|
+
class="fs-time-slot-field-label"
|
|
8
|
+
font="text-overline"
|
|
9
|
+
:style="style"
|
|
10
|
+
>
|
|
11
|
+
{{ $props.label }}
|
|
12
|
+
</FSSpan>
|
|
13
|
+
<FSSpan
|
|
14
|
+
v-if="$props.label && $props.required"
|
|
15
|
+
class="fs-time-slot-field-label"
|
|
16
|
+
style="margin-left: -8px;"
|
|
17
|
+
font="text-overline"
|
|
18
|
+
:ellipsis="false"
|
|
19
|
+
:style="style"
|
|
20
|
+
>
|
|
21
|
+
*
|
|
22
|
+
</FSSpan>
|
|
23
|
+
<v-spacer style="min-width: 40px;" />
|
|
24
|
+
<FSSpan
|
|
25
|
+
v-if="messages.length > 0"
|
|
26
|
+
class="fs-time-slot-field-messages"
|
|
27
|
+
font="text-overline"
|
|
28
|
+
:style="style"
|
|
29
|
+
>
|
|
30
|
+
{{ messages.join(", ") }}
|
|
31
|
+
</FSSpan>
|
|
32
|
+
</FSRow>
|
|
33
|
+
</slot>
|
|
34
|
+
<FSRow>
|
|
35
|
+
<FSSelectField
|
|
36
|
+
class="fs-time-slot-field-select"
|
|
37
|
+
:editable="$props.editable"
|
|
38
|
+
:items="daysObject"
|
|
39
|
+
:hideHeader="true"
|
|
40
|
+
:clearable="false"
|
|
41
|
+
:style="style"
|
|
42
|
+
:modelValue="dayStart"
|
|
43
|
+
@update:modelValue="onChangeDayStart"
|
|
44
|
+
>
|
|
45
|
+
<template v-for="(_, name) in slots" v-slot:[name]="slotData">
|
|
46
|
+
<slot :name="name" v-bind="slotData" />
|
|
47
|
+
</template>
|
|
48
|
+
<template #append>
|
|
49
|
+
<FSClock
|
|
50
|
+
class="fs-time-slot-field-number"
|
|
51
|
+
:editable="$props.editable"
|
|
52
|
+
:color="ColorEnum.Light"
|
|
53
|
+
:reminder="false"
|
|
54
|
+
:slider="false"
|
|
55
|
+
:style="style"
|
|
56
|
+
:modelValue="$props.modelValue[0][1]"
|
|
57
|
+
@update:modelValue="onChangeHourStart"
|
|
58
|
+
/>
|
|
59
|
+
</template>
|
|
60
|
+
</FSSelectField>
|
|
61
|
+
<FSSelectField
|
|
62
|
+
class="fs-time-slot-field-select"
|
|
63
|
+
:editable="$props.editable"
|
|
64
|
+
:items="daysObject"
|
|
65
|
+
:hideHeader="true"
|
|
66
|
+
:clearable="false"
|
|
67
|
+
:style="style"
|
|
68
|
+
:modelValue="dayEnd"
|
|
69
|
+
@update:modelValue="onChangeDayEnd"
|
|
70
|
+
>
|
|
71
|
+
<template #append>
|
|
72
|
+
<FSClock
|
|
73
|
+
class="fs-time-slot-field-number"
|
|
74
|
+
:editable="$props.editable"
|
|
75
|
+
:color="ColorEnum.Light"
|
|
76
|
+
:reminder="false"
|
|
77
|
+
:slider="false"
|
|
78
|
+
:style="style"
|
|
79
|
+
:modelValue="$props.modelValue[1][1]"
|
|
80
|
+
@update:modelValue="onChangeHourEnd"
|
|
81
|
+
/>
|
|
82
|
+
</template>
|
|
83
|
+
</FSSelectField>
|
|
84
|
+
</FSRow>
|
|
85
|
+
<slot name="description">
|
|
86
|
+
<FSSpan
|
|
87
|
+
v-if="$props.description"
|
|
88
|
+
class="fs-time-slot-field-description"
|
|
89
|
+
font="text-underline"
|
|
90
|
+
:style="style"
|
|
91
|
+
>
|
|
92
|
+
{{ $props.description }}
|
|
93
|
+
</FSSpan>
|
|
94
|
+
</slot>
|
|
95
|
+
</FSCol>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script lang="ts">
|
|
99
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
100
|
+
|
|
101
|
+
import { useColors, useRules, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
102
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
103
|
+
import { Days } from "@dative-gpi/foundation-shared-domain/models";
|
|
104
|
+
|
|
105
|
+
import FSSelectField from "./FSSelectField.vue";
|
|
106
|
+
import FSClock from "../FSClock.vue";
|
|
107
|
+
import FSSpan from "../FSSpan.vue";
|
|
108
|
+
import FSCol from "../FSCol.vue";
|
|
109
|
+
import FSRow from "../FSRow.vue";
|
|
110
|
+
|
|
111
|
+
export default defineComponent({
|
|
112
|
+
name: "FSTimeSlotField",
|
|
113
|
+
components: {
|
|
114
|
+
FSSelectField,
|
|
115
|
+
FSClock,
|
|
116
|
+
FSSpan,
|
|
117
|
+
FSCol,
|
|
118
|
+
FSRow
|
|
119
|
+
},
|
|
120
|
+
props: {
|
|
121
|
+
label: {
|
|
122
|
+
type: String,
|
|
123
|
+
required: false,
|
|
124
|
+
default: null
|
|
125
|
+
},
|
|
126
|
+
description: {
|
|
127
|
+
type: String,
|
|
128
|
+
required: false,
|
|
129
|
+
default: null
|
|
130
|
+
},
|
|
131
|
+
modelValue: {
|
|
132
|
+
type: Array as PropType<number[][]>,
|
|
133
|
+
required: true,
|
|
134
|
+
default: null
|
|
135
|
+
},
|
|
136
|
+
hideHeader: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
required: false,
|
|
139
|
+
default: false
|
|
140
|
+
},
|
|
141
|
+
required: {
|
|
142
|
+
type: Boolean,
|
|
143
|
+
required: false,
|
|
144
|
+
default: false
|
|
145
|
+
},
|
|
146
|
+
rules: {
|
|
147
|
+
type: Array as PropType<Function[]>,
|
|
148
|
+
required: false,
|
|
149
|
+
default: () => []
|
|
150
|
+
},
|
|
151
|
+
messages: {
|
|
152
|
+
type: Array as PropType<string[]>,
|
|
153
|
+
required: false,
|
|
154
|
+
default: null
|
|
155
|
+
},
|
|
156
|
+
editable: {
|
|
157
|
+
type: Boolean,
|
|
158
|
+
required: false,
|
|
159
|
+
default: true
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
emits: ["update:modelValue"],
|
|
163
|
+
setup(props, { emit }) {
|
|
164
|
+
const { validateOn, blurred, getMessages } = useRules();
|
|
165
|
+
const { getColors } = useColors();
|
|
166
|
+
const { slots } = useSlots();
|
|
167
|
+
|
|
168
|
+
delete slots.label;
|
|
169
|
+
delete slots.description;
|
|
170
|
+
|
|
171
|
+
const errors = getColors(ColorEnum.Error);
|
|
172
|
+
const lights = getColors(ColorEnum.Light);
|
|
173
|
+
const darks = getColors(ColorEnum.Dark);
|
|
174
|
+
|
|
175
|
+
const daysObject: { id: number; label: string }[] = Object.keys(Days).reduce((acc, key) => {
|
|
176
|
+
if(isNaN(Number(key))){
|
|
177
|
+
acc.push({
|
|
178
|
+
id: Days[key],
|
|
179
|
+
label: key
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
return acc;
|
|
183
|
+
}, []);
|
|
184
|
+
|
|
185
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
186
|
+
if (!props.editable) {
|
|
187
|
+
return {
|
|
188
|
+
"--fs-time-slot-field-cursor" : "default",
|
|
189
|
+
"--fs-time-slot-field-border-color" : lights.base,
|
|
190
|
+
"--fs-time-slot-field-color" : lights.dark,
|
|
191
|
+
"--fs-time-slot-field-active-border-color": lights.base
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
"--fs-time-slot-field-cursor" : "text",
|
|
196
|
+
"--fs-time-slot-field-border-color" : lights.dark,
|
|
197
|
+
"--fs-time-slot-field-color" : darks.base,
|
|
198
|
+
"--fs-time-slot-field-active-border-color": darks.dark,
|
|
199
|
+
"--fs-time-slot-field-error-color" : errors.base,
|
|
200
|
+
"--fs-time-slot-field-error-border-color" : errors.base
|
|
201
|
+
};
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
const dayStart = computed((): number => {
|
|
205
|
+
return props.modelValue[1][0] === 7 ? 7 : props.modelValue[0][0];
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
const dayEnd = computed((): number => {
|
|
209
|
+
return props.modelValue[0][0] === 7 ? 7 : props.modelValue[1][0];
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
213
|
+
|
|
214
|
+
const onChangeDayStart = (value: number) => {
|
|
215
|
+
if (value === 7) {
|
|
216
|
+
emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
if (props.modelValue[1][0] === 7) {
|
|
220
|
+
emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
emit("update:modelValue", [[value, props.modelValue[0][1]], props.modelValue[1]]);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
const onChangeHourStart = (value: number) => {
|
|
227
|
+
emit("update:modelValue", [[props.modelValue[0][0], value], props.modelValue[1]]);
|
|
228
|
+
};
|
|
229
|
+
|
|
230
|
+
const onChangeDayEnd = (value: number) => {
|
|
231
|
+
if (value === 7) {
|
|
232
|
+
emit("update:modelValue", [[7, props.modelValue[0][1]], [7, props.modelValue[1][1]]]);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (props.modelValue[0][0] === 7) {
|
|
236
|
+
emit("update:modelValue", [[value, props.modelValue[0][1]], [value, props.modelValue[1][1]]]);
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
emit("update:modelValue", [props.modelValue[0], [value, props.modelValue[1][1]]]);
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const onChangeHourEnd = (value: number) => {
|
|
243
|
+
emit("update:modelValue", [props.modelValue[0], [props.modelValue[1][0], value]]);
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
ColorEnum,
|
|
248
|
+
daysObject,
|
|
249
|
+
dayStart,
|
|
250
|
+
dayEnd,
|
|
251
|
+
validateOn,
|
|
252
|
+
messages,
|
|
253
|
+
blurred,
|
|
254
|
+
slots,
|
|
255
|
+
style,
|
|
256
|
+
onChangeDayStart,
|
|
257
|
+
onChangeHourStart,
|
|
258
|
+
onChangeDayEnd,
|
|
259
|
+
onChangeHourEnd
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
</script>
|
|
@@ -412,14 +412,14 @@ 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
|
+
import FSSearchField from "../fields/FSSearchField.vue";
|
|
419
|
+
import FSSelectField from "../fields/FSSelectField.vue";
|
|
418
420
|
import FSFilterButton from "./FSFilterButton.vue";
|
|
419
421
|
import FSHiddenButton from "./FSHiddenButton.vue";
|
|
420
422
|
import FSHeaderButton from "./FSHeaderButton.vue";
|
|
421
|
-
import FSSearchField from "../FSSearchField.vue";
|
|
422
|
-
import FSSelectField from "../FSSelectField.vue";
|
|
423
423
|
import FSContainer from "../FSContainer.vue";
|
|
424
424
|
import FSToggleSet from "../FSToggleSet.vue";
|
|
425
425
|
import FSCheckbox from "../FSCheckbox.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,9 +71,9 @@
|
|
|
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
|
-
import FSSearchField from "../FSSearchField.vue";
|
|
76
|
+
import FSSearchField from "../fields/FSSearchField.vue";
|
|
77
77
|
import FSFadeOut from "../FSFadeOut.vue";
|
|
78
78
|
import FSCard from "../FSCard.vue";
|
|
79
79
|
import FSChip from "../FSChip.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>
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
align="center-center"
|
|
14
14
|
gap="24px"
|
|
15
15
|
:wrap="false"
|
|
16
|
-
:height="
|
|
16
|
+
:height="imageSize"
|
|
17
17
|
>
|
|
18
18
|
<FSCol
|
|
19
19
|
gap="12px"
|
|
@@ -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
|
|
|
@@ -205,16 +205,12 @@ export default defineComponent({
|
|
|
205
205
|
return isMobileSized.value ? 90 : 100;
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
-
const infoWidth = computed(():
|
|
208
|
+
const infoWidth = computed((): number => {
|
|
209
209
|
let width = isMobileSized.value ? 288 : 304;
|
|
210
210
|
if (props.imageId) {
|
|
211
211
|
width -= imageSize.value;
|
|
212
212
|
}
|
|
213
|
-
return
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
const infoHeight = computed((): string => {
|
|
217
|
-
return `${imageSize.value}px`;
|
|
213
|
+
return width;
|
|
218
214
|
});
|
|
219
215
|
|
|
220
216
|
return {
|
|
@@ -224,8 +220,7 @@ export default defineComponent({
|
|
|
224
220
|
carouselModelStatuses,
|
|
225
221
|
carouselDeviceStatuses,
|
|
226
222
|
imageSize,
|
|
227
|
-
infoWidth
|
|
228
|
-
infoHeight
|
|
223
|
+
infoWidth
|
|
229
224
|
};
|
|
230
225
|
}
|
|
231
226
|
});
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
align="center-center"
|
|
14
14
|
gap="24px"
|
|
15
15
|
:wrap="false"
|
|
16
|
-
:height="
|
|
16
|
+
:height="imageSize"
|
|
17
17
|
>
|
|
18
18
|
<FSCol
|
|
19
19
|
gap="12px"
|
|
@@ -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
|
|
|
@@ -167,16 +167,12 @@ export default defineComponent({
|
|
|
167
167
|
return isMobileSized.value ? 90 : 100;
|
|
168
168
|
});
|
|
169
169
|
|
|
170
|
-
const infoWidth = computed(():
|
|
170
|
+
const infoWidth = computed((): number => {
|
|
171
171
|
let width = isMobileSized.value ? 288 : 304;
|
|
172
172
|
if (props.imageId) {
|
|
173
173
|
width -= imageSize.value;
|
|
174
174
|
}
|
|
175
|
-
return
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
const infoHeight = computed((): string => {
|
|
179
|
-
return `${imageSize.value}px`;
|
|
175
|
+
return width;
|
|
180
176
|
});
|
|
181
177
|
|
|
182
178
|
return {
|
|
@@ -184,8 +180,7 @@ export default defineComponent({
|
|
|
184
180
|
groupsLabel,
|
|
185
181
|
deviceOrganisationsLabel,
|
|
186
182
|
imageSize,
|
|
187
|
-
infoWidth
|
|
188
|
-
infoHeight
|
|
183
|
+
infoWidth
|
|
189
184
|
};
|
|
190
185
|
}
|
|
191
186
|
});
|
|
@@ -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
|
@@ -3,19 +3,21 @@ import { computed, onMounted, onUnmounted, ref } from "vue";
|
|
|
3
3
|
export const useBreakpoints = () => {
|
|
4
4
|
const windowWidth = ref(window.innerWidth);
|
|
5
5
|
|
|
6
|
-
const
|
|
6
|
+
const onSizeChange = (): void => {
|
|
7
|
+
windowWidth.value = window.innerWidth;
|
|
8
|
+
};
|
|
7
9
|
|
|
8
10
|
onMounted(() => {
|
|
9
|
-
window.addEventListener("resize",
|
|
11
|
+
window.addEventListener("resize", onSizeChange);
|
|
10
12
|
});
|
|
11
13
|
|
|
12
14
|
onUnmounted(() => {
|
|
13
|
-
window.removeEventListener("resize",
|
|
15
|
+
window.removeEventListener("resize", onSizeChange);
|
|
14
16
|
});
|
|
15
17
|
|
|
16
|
-
const isTouchScreenEnabled = (): boolean => {
|
|
18
|
+
const isTouchScreenEnabled = computed((): boolean => {
|
|
17
19
|
return navigator.maxTouchPoints > 0;
|
|
18
|
-
};
|
|
20
|
+
});
|
|
19
21
|
|
|
20
22
|
const isMobileSized = computed((): boolean => {
|
|
21
23
|
return windowWidth.value < 1264;
|