@dative-gpi/foundation-shared-components 0.0.8 → 0.0.9
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/{models/FSButtons.ts → aliases/FSButton.ts} +24 -21
- package/aliases/index.ts +1 -0
- package/components/FSAutocompleteField.vue +207 -0
- package/components/FSBadge.vue +38 -0
- package/components/FSBreadcrumbs.vue +49 -55
- package/components/FSButton.vue +116 -101
- package/components/FSCalendar.vue +52 -39
- package/components/FSCalendarTwin.vue +120 -102
- package/components/FSCard.vue +35 -21
- package/components/FSCarousel.vue +63 -0
- package/components/FSCheckbox.vue +111 -103
- package/components/FSChip.vue +140 -0
- package/components/FSClock.vue +149 -15
- package/components/FSCol.vue +104 -98
- package/components/FSColor.vue +61 -64
- package/components/FSColorIcon.vue +67 -0
- package/components/FSContainer.vue +64 -0
- package/components/FSDateField.vue +211 -0
- package/components/FSDateRangeField.vue +225 -0
- package/components/FSDateTimeField.vue +257 -0
- package/components/FSDateTimeRangeField.vue +286 -0
- package/components/FSDialog.vue +103 -0
- package/components/FSDivider.vue +39 -0
- package/components/FSFadeOut.vue +49 -59
- package/components/FSFileButton.vue +245 -0
- package/components/FSHeaderButton.vue +17 -0
- package/components/FSIcon.vue +23 -23
- package/components/FSIconField.vue +232 -0
- package/components/FSImage.vue +142 -0
- package/components/FSLoadTile.vue +93 -0
- package/components/FSNumberField.vue +51 -53
- package/components/FSPasswordField.vue +99 -101
- package/components/FSRadio.vue +107 -109
- package/components/FSRadioGroup.vue +55 -57
- package/components/FSRemoveDialog.vue +123 -0
- package/components/FSRichTextField.vue +26 -33
- package/components/FSRow.vue +110 -104
- package/components/FSSearchField.vue +35 -27
- package/components/FSSelectField.vue +188 -0
- package/components/FSSlideGroup.vue +45 -49
- package/components/FSSlider.vue +31 -33
- package/components/FSSpan.vue +53 -37
- package/components/FSSubmitDialog.vue +165 -0
- package/components/FSSwitch.vue +110 -109
- package/components/FSTab.vue +61 -61
- package/components/FSTabs.vue +53 -55
- package/components/FSTag.vue +88 -84
- package/components/FSTagField.vue +32 -36
- package/components/FSTagGroup.vue +38 -45
- package/components/FSText.vue +74 -64
- package/components/FSTextArea.vue +187 -185
- package/components/FSTextField.vue +18 -20
- package/components/FSTile.vue +90 -0
- package/components/FSToggleSet.vue +282 -0
- package/components/FSTooltip.vue +21 -0
- package/components/FSWindow.vue +26 -16
- package/components/FSWrapGroup.vue +44 -47
- package/components/deviceOrganisations/FSConnectivity.vue +114 -0
- package/components/deviceOrganisations/FSStatus.vue +117 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +105 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +66 -0
- package/components/deviceOrganisations/FSWorstAlert.vue +165 -0
- package/components/lists/FSDataIteratorGroup.vue +7 -0
- package/components/lists/FSDataIteratorItem.vue +103 -0
- package/components/lists/FSDataTable.vue +964 -0
- package/components/lists/FSFilterButton.vue +176 -0
- package/components/lists/FSHeaderButton.vue +99 -0
- package/components/lists/FSHiddenButton.vue +79 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +232 -0
- package/components/tiles/FSGroupTileUI.vue +192 -0
- package/composables/index.ts +1 -1
- package/composables/useBreakpoints.ts +23 -4
- package/composables/useColors.ts +53 -23
- package/composables/useSlots.ts +43 -0
- package/index.ts +6 -0
- package/models/breadcrumbs.ts +8 -0
- package/models/colors.ts +17 -0
- package/models/deviceAlerts.ts +10 -0
- package/models/deviceConnectivities.ts +11 -0
- package/models/deviceStatuses.ts +16 -0
- package/models/dispositions.ts +33 -0
- package/models/index.ts +9 -0
- package/models/modelStatuses.ts +11 -0
- package/models/rules.ts +50 -0
- package/models/toggleSets.ts +7 -0
- package/package.json +5 -4
- package/plugins/colorPlugin.ts +2 -2
- package/shims-plugin.d.ts +1 -1
- package/styles/components/fs_autocomplete_field.scss +123 -0
- package/styles/components/fs_button.scss +4 -6
- package/styles/components/fs_calendar.scss +24 -1
- package/styles/components/fs_card.scss +2 -5
- package/styles/components/fs_carousel.scss +4 -0
- package/styles/components/fs_chip.scss +33 -0
- package/styles/components/fs_clock.scss +43 -0
- package/styles/components/fs_col.scss +2 -0
- package/styles/components/fs_color_icon.scss +37 -0
- package/styles/components/fs_container.scss +16 -0
- package/styles/components/fs_data_iterator_item.scss +19 -0
- package/styles/components/fs_data_table.scss +97 -0
- package/styles/components/fs_date_field.scss +8 -0
- package/styles/components/fs_dialog.scss +30 -0
- package/styles/components/fs_divider.scss +5 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +12 -0
- package/styles/components/fs_header_button.scss +4 -0
- package/styles/components/fs_icon.scss +19 -3
- package/styles/components/fs_icon_field.scss +12 -0
- package/styles/components/fs_image.scss +7 -0
- package/styles/components/fs_load_tile.scss +49 -0
- package/styles/components/fs_password_field.scss +2 -2
- package/styles/components/fs_row.scss +4 -1
- package/styles/components/fs_select_field.scss +71 -0
- package/styles/components/fs_slide_group.scss +6 -0
- package/styles/components/fs_slider.scss +29 -9
- package/styles/components/fs_span.scss +8 -0
- package/styles/components/fs_submit_dialog.scss +9 -0
- package/styles/components/fs_tabs.scss +4 -0
- package/styles/components/fs_tag_field.scss +0 -11
- package/styles/components/fs_text_field.scss +23 -15
- package/styles/components/fs_tile.scss +33 -0
- package/styles/components/fs_tooltip.scss +5 -0
- package/styles/components/fs_wrap_group.scss +7 -8
- package/styles/components/index.scss +21 -1
- package/styles/globals/breakpoints.scss +7 -0
- package/styles/globals/overrides.scss +20 -7
- package/styles/globals/text_fonts.scss +8 -8
- package/themes/default.ts +1 -11
- package/utils/css.ts +11 -0
- package/utils/icons.ts +75416 -0
- package/utils/index.ts +5 -1
- package/utils/levenshtein.ts +97 -0
- package/utils/sort.ts +9 -0
- package/components/FSDatePicker.vue +0 -226
- package/composables/useDates.ts +0 -39
- package/models/FSTags.ts +0 -8
- package/models/FSTextFields.ts +0 -23
- package/styles/components/fs_date_picker.scss +0 -0
- /package/utils/{FSRichTextField.ts → lexical.ts} +0 -0
|
@@ -9,7 +9,10 @@
|
|
|
9
9
|
{{ $props.label }}
|
|
10
10
|
</FSSpan>
|
|
11
11
|
</FSRow>
|
|
12
|
-
<FSRow
|
|
12
|
+
<FSRow
|
|
13
|
+
class="fs-calendar-twin"
|
|
14
|
+
:style="style"
|
|
15
|
+
>
|
|
13
16
|
<FSCol
|
|
14
17
|
:class="leftClasses"
|
|
15
18
|
:style="style"
|
|
@@ -22,6 +25,7 @@
|
|
|
22
25
|
size="l"
|
|
23
26
|
variant="icon"
|
|
24
27
|
icon="mdi-chevron-left"
|
|
28
|
+
:color="ColorEnum.Dark"
|
|
25
29
|
@click="onClickPrevious"
|
|
26
30
|
/>
|
|
27
31
|
<FSSpan
|
|
@@ -41,7 +45,8 @@
|
|
|
41
45
|
:month="innerLeftMonth"
|
|
42
46
|
:year="innerLeftYear"
|
|
43
47
|
:multiple="true"
|
|
44
|
-
:
|
|
48
|
+
:allowedDates="allowedDates"
|
|
49
|
+
:modelValue="innerLeftValue.map(epochToPicker)"
|
|
45
50
|
@update:modelValue="onClickLeft"
|
|
46
51
|
@update:month="null"
|
|
47
52
|
@update:year="null"
|
|
@@ -67,6 +72,7 @@
|
|
|
67
72
|
size="l"
|
|
68
73
|
variant="icon"
|
|
69
74
|
icon="mdi-chevron-right"
|
|
75
|
+
:color="ColorEnum.Dark"
|
|
70
76
|
@click="onClickNext"
|
|
71
77
|
/>
|
|
72
78
|
</FSRow>
|
|
@@ -79,7 +85,8 @@
|
|
|
79
85
|
:month="innerRightMonth"
|
|
80
86
|
:year="innerRightYear"
|
|
81
87
|
:multiple="true"
|
|
82
|
-
:
|
|
88
|
+
:allowedDates="allowedDates"
|
|
89
|
+
:modelValue="innerRightValue.map(epochToPicker)"
|
|
83
90
|
@update:modelValue="onClickRight"
|
|
84
91
|
@update:month="null"
|
|
85
92
|
@update:year="null"
|
|
@@ -91,12 +98,11 @@
|
|
|
91
98
|
</template>
|
|
92
99
|
|
|
93
100
|
<script lang="ts">
|
|
94
|
-
import { computed, defineComponent, onMounted, PropType, ref
|
|
95
|
-
import { useDate as useAdapter } from "vuetify/lib/composables/date/index.mjs";
|
|
101
|
+
import { computed, defineComponent, onMounted, PropType, ref } from "vue";
|
|
96
102
|
|
|
97
|
-
import {
|
|
98
|
-
import {
|
|
99
|
-
import {
|
|
103
|
+
import { useTimeZone, useLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
104
|
+
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
105
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
100
106
|
|
|
101
107
|
import FSButton from "./FSButton.vue";
|
|
102
108
|
import FSSpan from "./FSSpan.vue";
|
|
@@ -118,33 +124,29 @@ export default defineComponent({
|
|
|
118
124
|
default: null
|
|
119
125
|
},
|
|
120
126
|
modelValue: {
|
|
121
|
-
type: Array as PropType<
|
|
127
|
+
type: Array as PropType<number[]>,
|
|
122
128
|
required: false,
|
|
123
129
|
default: null
|
|
124
130
|
},
|
|
125
131
|
color: {
|
|
126
132
|
type: String as PropType<ColorBase>,
|
|
127
133
|
required: false,
|
|
128
|
-
default:
|
|
134
|
+
default: ColorEnum.Dark
|
|
129
135
|
},
|
|
130
|
-
|
|
131
|
-
type: String as PropType<
|
|
136
|
+
limit: {
|
|
137
|
+
type: String as PropType<"none" | "past" | "future">,
|
|
132
138
|
required: false,
|
|
133
|
-
default:
|
|
139
|
+
default: "none"
|
|
134
140
|
}
|
|
135
141
|
},
|
|
136
142
|
emits: ["update:modelValue"],
|
|
137
143
|
setup(props, { emit }) {
|
|
138
|
-
const {
|
|
139
|
-
|
|
140
|
-
const languageCode = useLanguageCode().languageCode;
|
|
141
|
-
const datesTools = useDates();
|
|
142
|
-
const adapter = useAdapter();
|
|
143
|
-
|
|
144
|
-
const colors = useColors().getColors(color.value);
|
|
145
|
-
const buttonColors = useColors().getColors(buttonColor.value);
|
|
144
|
+
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useTimeZone();
|
|
145
|
+
const { languageCode } = useLanguageCode();
|
|
146
146
|
|
|
147
|
-
const
|
|
147
|
+
const colors = computed(() => useColors().getColors(props.color));
|
|
148
|
+
const backgrounds = useColors().getColors(ColorEnum.Background);
|
|
149
|
+
const darks = useColors().getColors(ColorEnum.Dark);
|
|
148
150
|
|
|
149
151
|
const innerLeftMonth = ref(new Date().getMonth());
|
|
150
152
|
const innerLeftYear = ref(new Date().getFullYear());
|
|
@@ -152,34 +154,32 @@ export default defineComponent({
|
|
|
152
154
|
const innerRightMonth = ref(new Date().getMonth());
|
|
153
155
|
const innerRightYear = ref(new Date().getFullYear());
|
|
154
156
|
|
|
155
|
-
const toggle = ref(modelValue
|
|
157
|
+
const toggle = ref((props.modelValue?.length ?? 0) % 2);
|
|
156
158
|
|
|
157
159
|
onMounted((): void => {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
}
|
|
182
|
-
break;
|
|
160
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
161
|
+
innerLeftMonth.value = new Date().getMonth();
|
|
162
|
+
innerLeftYear.value = new Date().getFullYear();
|
|
163
|
+
if (innerLeftMonth.value < 11) {
|
|
164
|
+
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
165
|
+
innerRightYear.value = innerLeftYear.value;
|
|
166
|
+
}
|
|
167
|
+
else {
|
|
168
|
+
innerRightMonth.value = 0;
|
|
169
|
+
innerRightYear.value = innerLeftYear.value + 1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
173
|
+
innerLeftMonth.value = epochToPickerHeader(props.modelValue[0]).m;
|
|
174
|
+
innerLeftYear.value = epochToPickerHeader(props.modelValue[0]).y;
|
|
175
|
+
if (innerLeftMonth.value < 11) {
|
|
176
|
+
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
177
|
+
innerRightYear.value = innerLeftYear.value;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
innerRightMonth.value = 0;
|
|
181
|
+
innerRightYear.value = innerLeftYear.value + 1;
|
|
182
|
+
}
|
|
183
183
|
}
|
|
184
184
|
});
|
|
185
185
|
|
|
@@ -212,89 +212,93 @@ export default defineComponent({
|
|
|
212
212
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
213
213
|
return {
|
|
214
214
|
"--fs-calendar-background-color" : backgrounds.base,
|
|
215
|
-
"--fs-calendar-hover-background-color" :
|
|
216
|
-
"--fs-calendar-active-background-color":
|
|
217
|
-
"--fs-calendar-border-color" :
|
|
218
|
-
"--fs-calendar-hover-border-color" :
|
|
219
|
-
"--fs-calendar-active-border-color" :
|
|
220
|
-
"--fs-calendar-color" :
|
|
221
|
-
"--fs-calendar-hover-color" :
|
|
222
|
-
"--fs-calendar-active-color" :
|
|
215
|
+
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
216
|
+
"--fs-calendar-active-background-color": colors.value.base,
|
|
217
|
+
"--fs-calendar-border-color" : darks.base,
|
|
218
|
+
"--fs-calendar-hover-border-color" : colors.value.base,
|
|
219
|
+
"--fs-calendar-active-border-color" : colors.value.base,
|
|
220
|
+
"--fs-calendar-color" : darks.base,
|
|
221
|
+
"--fs-calendar-hover-color" : colors.value.base,
|
|
222
|
+
"--fs-calendar-active-color" : colors.value.light
|
|
223
223
|
};
|
|
224
224
|
});
|
|
225
225
|
|
|
226
226
|
const innerLeftValue = computed((): number[] => {
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
return props.modelValue.filter(value =>
|
|
231
|
+
compare("during", "left", epochToPickerHeader(value)) || compare("before", "left", epochToPickerHeader(value))
|
|
229
232
|
);
|
|
230
233
|
});
|
|
231
234
|
|
|
232
235
|
const innerRightValue = computed((): number[] => {
|
|
233
|
-
|
|
234
|
-
|
|
236
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
237
|
+
return [];
|
|
238
|
+
}
|
|
239
|
+
return props.modelValue.filter(value =>
|
|
240
|
+
compare("during", "right", epochToPickerHeader(value)) || compare("after", "right", epochToPickerHeader(value))
|
|
235
241
|
);
|
|
236
242
|
});
|
|
237
243
|
|
|
238
244
|
const leftText = computed(() => {
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
);
|
|
245
|
+
const date = new Date(0);
|
|
246
|
+
date.setMonth(innerLeftMonth.value);
|
|
247
|
+
date.setFullYear(innerLeftYear.value);
|
|
248
|
+
return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
|
|
244
249
|
});
|
|
245
250
|
|
|
246
251
|
const rightText = computed(() => {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
);
|
|
252
|
+
const date = new Date(0);
|
|
253
|
+
date.setMonth(innerRightMonth.value);
|
|
254
|
+
date.setFullYear(innerRightYear.value);
|
|
255
|
+
return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
|
|
252
256
|
});
|
|
253
257
|
|
|
254
258
|
const leftClasses = computed((): string[] => {
|
|
255
|
-
const
|
|
256
|
-
if (modelValue.
|
|
257
|
-
const first =
|
|
258
|
-
const last =
|
|
259
|
+
const classNames = ["fs-calendar-half", "fs-calendar-left"];
|
|
260
|
+
if (props.modelValue && props.modelValue.length > 1) {
|
|
261
|
+
const first = epochToPickerHeader(props.modelValue[0]);
|
|
262
|
+
const last = epochToPickerHeader(props.modelValue[1]);
|
|
259
263
|
if (compare("before", "left", first) && compare("after", "left", last)) {
|
|
260
|
-
|
|
264
|
+
classNames.push("fs-calendar-full");
|
|
261
265
|
}
|
|
262
266
|
else if (compare("during", "left", first) && compare("during", "left", last)) {
|
|
263
267
|
if (first.d !== last.d) {
|
|
264
|
-
|
|
268
|
+
classNames.push("fs-calendar-part");
|
|
265
269
|
}
|
|
266
270
|
}
|
|
267
271
|
else if (compare("during", "left", first)) {
|
|
268
|
-
|
|
272
|
+
classNames.push("fs-calendar-start");
|
|
269
273
|
}
|
|
270
274
|
else if (compare("during", "left", last)) {
|
|
271
|
-
|
|
275
|
+
classNames.push("fs-calendar-end");
|
|
272
276
|
}
|
|
273
277
|
}
|
|
274
|
-
return
|
|
278
|
+
return classNames;
|
|
275
279
|
});
|
|
276
280
|
|
|
277
281
|
const rightClasses = computed((): string[] => {
|
|
278
|
-
const
|
|
279
|
-
if (modelValue.
|
|
280
|
-
const first =
|
|
281
|
-
const last =
|
|
282
|
+
const classNames = ["fs-calendar-half", "fs-calendar-right"];
|
|
283
|
+
if (props.modelValue && props.modelValue.length > 1) {
|
|
284
|
+
const first = epochToPickerHeader(props.modelValue[0]);
|
|
285
|
+
const last = epochToPickerHeader(props.modelValue[1]);
|
|
282
286
|
if (compare("before", "right", first) && compare("after", "right", last)) {
|
|
283
|
-
|
|
287
|
+
classNames.push("fs-calendar-full");
|
|
284
288
|
}
|
|
285
289
|
else if (compare("during", "right", first) && compare("during", "right", last)) {
|
|
286
290
|
if (first.d !== last.d) {
|
|
287
|
-
|
|
291
|
+
classNames.push("fs-calendar-part");
|
|
288
292
|
}
|
|
289
293
|
}
|
|
290
294
|
else if (compare("during", "right", first)) {
|
|
291
|
-
|
|
295
|
+
classNames.push("fs-calendar-start");
|
|
292
296
|
}
|
|
293
297
|
else if (compare("during", "right", last)) {
|
|
294
|
-
|
|
298
|
+
classNames.push("fs-calendar-end");
|
|
295
299
|
}
|
|
296
300
|
}
|
|
297
|
-
return
|
|
301
|
+
return classNames;
|
|
298
302
|
});
|
|
299
303
|
|
|
300
304
|
const onClickPrevious = (): void => {
|
|
@@ -332,45 +336,58 @@ export default defineComponent({
|
|
|
332
336
|
};
|
|
333
337
|
|
|
334
338
|
const onClickLeft = (value: Date[]): void => {
|
|
335
|
-
const clicked =
|
|
336
|
-
if (modelValue.
|
|
339
|
+
const clicked = pickerToEpoch(value[value.length - 1]);
|
|
340
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
337
341
|
emit("update:modelValue", [clicked, clicked]);
|
|
338
342
|
}
|
|
339
|
-
else if (modelValue.
|
|
340
|
-
emit("update:modelValue", [modelValue
|
|
343
|
+
else if (props.modelValue.length === 1) {
|
|
344
|
+
emit("update:modelValue", [props.modelValue[0], clicked].sort());
|
|
341
345
|
}
|
|
342
346
|
else {
|
|
343
347
|
if (innerLeftValue.value.length === 0) {
|
|
344
|
-
emit("update:modelValue", [clicked, modelValue
|
|
348
|
+
emit("update:modelValue", [clicked, props.modelValue[1]]);
|
|
345
349
|
}
|
|
346
350
|
else {
|
|
347
|
-
emit("update:modelValue", [clicked, modelValue
|
|
351
|
+
emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
|
|
348
352
|
toggle.value = (++toggle.value) % 2;
|
|
349
353
|
}
|
|
350
354
|
}
|
|
351
355
|
};
|
|
352
356
|
|
|
353
357
|
const onClickRight = (value: Date[]): void => {
|
|
354
|
-
const clicked =
|
|
355
|
-
if (modelValue.
|
|
358
|
+
const clicked = pickerToEpoch(value[value.length - 1]);
|
|
359
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
356
360
|
emit("update:modelValue", [clicked, clicked]);
|
|
357
361
|
}
|
|
358
|
-
else if (modelValue.
|
|
359
|
-
emit("update:modelValue", [modelValue
|
|
362
|
+
else if (props.modelValue.length === 1) {
|
|
363
|
+
emit("update:modelValue", [props.modelValue[0], clicked].sort());
|
|
360
364
|
}
|
|
361
365
|
else {
|
|
362
366
|
if (innerRightValue.value.length === 0) {
|
|
363
|
-
emit("update:modelValue", [modelValue
|
|
367
|
+
emit("update:modelValue", [props.modelValue[0], clicked]);
|
|
364
368
|
}
|
|
365
369
|
else {
|
|
366
|
-
emit("update:modelValue", [clicked, modelValue
|
|
370
|
+
emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
|
|
367
371
|
toggle.value = (++toggle.value) % 2;
|
|
368
372
|
}
|
|
369
373
|
}
|
|
370
374
|
toggle.value = (++toggle.value) % 2;
|
|
371
375
|
};
|
|
372
376
|
|
|
377
|
+
const allowedDates = (value: Date): boolean => {
|
|
378
|
+
const valueEpoch = pickerToEpoch(value);
|
|
379
|
+
switch (props.limit) {
|
|
380
|
+
case "past":
|
|
381
|
+
return valueEpoch <= todayToEpoch(true);
|
|
382
|
+
case "future":
|
|
383
|
+
return valueEpoch >= todayToEpoch(true);
|
|
384
|
+
default:
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
|
|
373
389
|
return {
|
|
390
|
+
ColorEnum,
|
|
374
391
|
languageCode,
|
|
375
392
|
style,
|
|
376
393
|
leftClasses,
|
|
@@ -383,11 +400,12 @@ export default defineComponent({
|
|
|
383
400
|
innerRightMonth,
|
|
384
401
|
innerRightYear,
|
|
385
402
|
innerRightValue,
|
|
386
|
-
|
|
403
|
+
epochToPicker,
|
|
387
404
|
onClickPrevious,
|
|
388
405
|
onClickNext,
|
|
389
406
|
onClickLeft,
|
|
390
|
-
onClickRight
|
|
407
|
+
onClickRight,
|
|
408
|
+
allowedDates
|
|
391
409
|
};
|
|
392
410
|
}
|
|
393
411
|
});
|
package/components/FSCard.vue
CHANGED
|
@@ -1,57 +1,71 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
2
|
+
<FSContainer
|
|
3
3
|
class="fs-card"
|
|
4
4
|
:style="style"
|
|
5
|
+
v-bind="$attrs"
|
|
5
6
|
>
|
|
6
|
-
<slot
|
|
7
|
-
<FSCol
|
|
8
|
-
|
|
7
|
+
<slot>
|
|
8
|
+
<FSCol
|
|
9
|
+
:gap="$props.gap"
|
|
10
|
+
>
|
|
11
|
+
<FSRow
|
|
12
|
+
v-if="$slots.header"
|
|
13
|
+
>
|
|
9
14
|
<slot name="header" />
|
|
10
15
|
</FSRow>
|
|
11
|
-
<FSRow
|
|
16
|
+
<FSRow
|
|
17
|
+
v-if="$slots.body"
|
|
18
|
+
>
|
|
12
19
|
<slot name="body" />
|
|
13
20
|
</FSRow>
|
|
14
|
-
<FSRow
|
|
21
|
+
<FSRow
|
|
22
|
+
v-if="$slots.footer"
|
|
23
|
+
>
|
|
15
24
|
<slot name="footer" />
|
|
16
25
|
</FSRow>
|
|
17
26
|
</FSCol>
|
|
18
27
|
</slot>
|
|
19
|
-
</
|
|
28
|
+
</FSContainer>
|
|
20
29
|
</template>
|
|
21
30
|
|
|
22
31
|
<script lang="ts">
|
|
23
|
-
import { computed, defineComponent
|
|
32
|
+
import { computed, defineComponent } from "vue";
|
|
24
33
|
|
|
25
|
-
import {
|
|
26
|
-
import { ColorBase } from "@dative-gpi/foundation-shared-components/themes";
|
|
34
|
+
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
27
35
|
|
|
36
|
+
import FSContainer from "./FSContainer.vue";
|
|
28
37
|
import FSCol from "./FSCol.vue";
|
|
29
38
|
import FSRow from "./FSRow.vue";
|
|
30
39
|
|
|
31
40
|
export default defineComponent({
|
|
32
41
|
name: "FSCard",
|
|
33
42
|
components: {
|
|
43
|
+
FSContainer,
|
|
34
44
|
FSCol,
|
|
35
45
|
FSRow
|
|
36
46
|
},
|
|
37
47
|
props: {
|
|
38
|
-
|
|
39
|
-
type: String
|
|
48
|
+
width: {
|
|
49
|
+
type: [String, Number],
|
|
40
50
|
required: false,
|
|
41
|
-
default:
|
|
51
|
+
default: null
|
|
42
52
|
},
|
|
53
|
+
height: {
|
|
54
|
+
type: [String, Number],
|
|
55
|
+
required: false,
|
|
56
|
+
default: null
|
|
57
|
+
},
|
|
58
|
+
gap: {
|
|
59
|
+
type: [String, Number],
|
|
60
|
+
required: false,
|
|
61
|
+
default: 8
|
|
62
|
+
}
|
|
43
63
|
},
|
|
44
64
|
setup(props) {
|
|
45
|
-
const { color } = toRefs(props);
|
|
46
|
-
|
|
47
|
-
const colors = useColors().getColors(color.value);
|
|
48
|
-
|
|
49
|
-
const backgrounds = useColors().getColors(ColorBase.Background);
|
|
50
|
-
|
|
51
65
|
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
52
66
|
return {
|
|
53
|
-
"--fs-card-
|
|
54
|
-
"--fs-card-
|
|
67
|
+
"--fs-card-width" : sizeToVar(props.width),
|
|
68
|
+
"--fs-card-height": sizeToVar(props.height)
|
|
55
69
|
};
|
|
56
70
|
});
|
|
57
71
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-carousel
|
|
3
|
+
class="fs-carousel"
|
|
4
|
+
:hideDelimiters="true"
|
|
5
|
+
:style="style"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
>
|
|
8
|
+
<template v-for="(_, name) in slots" v-slot:[name]="slotData">
|
|
9
|
+
<slot :name="name" v-bind="slotData" />
|
|
10
|
+
</template>
|
|
11
|
+
<v-carousel-item
|
|
12
|
+
v-for="(component, index) in getChildren('default')"
|
|
13
|
+
:value="value(component, index)"
|
|
14
|
+
:key="index"
|
|
15
|
+
>
|
|
16
|
+
<component
|
|
17
|
+
:is="component"
|
|
18
|
+
/>
|
|
19
|
+
</v-carousel-item>
|
|
20
|
+
</v-carousel>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<script lang="ts">
|
|
24
|
+
import { computed, defineComponent, VNode } from "vue";
|
|
25
|
+
|
|
26
|
+
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
27
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
28
|
+
|
|
29
|
+
export default defineComponent({
|
|
30
|
+
name: "FSCarousel",
|
|
31
|
+
props: {
|
|
32
|
+
height: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
required: false,
|
|
35
|
+
default: "100%"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
setup(props) {
|
|
39
|
+
const { slots, getChildren } = useSlots();
|
|
40
|
+
delete slots.default;
|
|
41
|
+
|
|
42
|
+
const backgrounds = useColors().getColors(ColorEnum.Background);
|
|
43
|
+
|
|
44
|
+
const style = computed((): {[code: string]: string} & Partial<CSSStyleDeclaration> => {
|
|
45
|
+
return {
|
|
46
|
+
"--fs-carousel-height" : typeof(props.height) === "string" ? props.height : `${props.height}px`,
|
|
47
|
+
"--fs-carousel-background-color": backgrounds.base
|
|
48
|
+
};
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const value = (component: VNode, index: number): any => {
|
|
52
|
+
return component?.props?.value ?? index;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
getChildren,
|
|
57
|
+
slots,
|
|
58
|
+
style,
|
|
59
|
+
value
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
})
|
|
63
|
+
</script>
|