@dative-gpi/foundation-shared-components 0.0.49 → 0.0.51
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/FSAccordion.vue +3 -3
- package/components/FSAccordionPanel.vue +5 -5
- package/components/FSBadge.vue +1 -1
- package/components/FSBreadcrumbs.vue +1 -1
- package/components/FSButton.vue +5 -5
- package/components/FSCalendar.vue +22 -12
- package/components/FSCalendarTwin.vue +16 -12
- package/components/FSCard.vue +11 -2
- package/components/FSCarousel.vue +1 -1
- package/components/FSCheckbox.vue +4 -4
- package/components/FSChip.vue +4 -4
- package/components/FSClickable.vue +1 -1
- package/components/FSClock.vue +40 -48
- package/components/FSCol.vue +1 -1
- package/components/FSColor.vue +9 -7
- package/components/FSColorIcon.vue +1 -1
- package/components/FSDivider.vue +2 -2
- package/components/FSEditImage.vue +131 -0
- package/components/FSErrorToast.vue +1 -1
- package/components/FSFadeOut.vue +1 -1
- package/components/FSForm.vue +4 -4
- package/components/FSGrid.vue +1 -1
- package/components/FSImage.vue +50 -12
- package/components/FSLabel.vue +1 -1
- package/components/FSLink.vue +1 -1
- package/components/FSLoader.vue +1 -1
- package/components/FSOptionGroup.vue +3 -3
- package/components/FSOptionItem.vue +4 -4
- package/components/FSPagination.vue +1 -1
- package/components/FSRadio.vue +4 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRow.vue +1 -1
- package/components/FSSlideGroup.vue +11 -11
- package/components/FSSlider.vue +4 -4
- package/components/FSSpan.vue +1 -1
- package/components/FSSubmitDialog.vue +8 -8
- package/components/FSSwitch.vue +4 -4
- package/components/FSTab.vue +4 -4
- package/components/FSTabs.vue +2 -2
- package/components/FSTag.vue +2 -2
- package/components/FSText.vue +1 -1
- package/components/FSToggleSet.vue +4 -4
- package/components/FSWindow.vue +1 -1
- package/components/FSWrapGroup.vue +2 -2
- package/components/buttons/FSButtonFile.vue +17 -10
- package/components/buttons/FSButtonFileIcon.vue +17 -10
- package/components/buttons/FSButtonFileLabel.vue +17 -10
- package/components/buttons/FSButtonFileMini.vue +17 -10
- package/components/deviceOrganisations/FSConnectivityCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusCard.vue +2 -2
- package/components/deviceOrganisations/FSStatusesCarousel.vue +2 -3
- package/components/deviceOrganisations/FSStatusesRow.vue +2 -3
- package/components/deviceOrganisations/FSWorstAlertCard.vue +2 -2
- package/components/fields/FSAutocompleteField.vue +5 -5
- package/components/fields/FSColorField.vue +3 -3
- package/components/fields/FSDateField.vue +10 -9
- package/components/fields/FSDateRangeField.vue +8 -8
- package/components/fields/FSDateTimeField.vue +16 -14
- package/components/fields/FSDateTimeRangeField.vue +12 -14
- package/components/fields/FSIconField.vue +10 -10
- package/components/fields/FSNumberField.vue +2 -2
- package/components/fields/FSPasswordField.vue +4 -4
- package/components/fields/FSRichTextField.vue +82 -92
- package/components/fields/FSSearchField.vue +8 -8
- package/components/fields/FSSelectField.vue +6 -6
- package/components/fields/FSTagField.vue +4 -4
- package/components/fields/FSTextArea.vue +5 -5
- package/components/fields/FSTextField.vue +5 -5
- package/components/fields/FSTimeField.vue +15 -9
- package/components/fields/FSTimeSlotField.vue +49 -21
- package/components/lists/FSDataTableUI.vue +24 -12
- package/components/lists/FSDraggable.vue +12 -6
- package/components/lists/FSFilterButton.vue +11 -8
- package/components/lists/FSLoadDataTable.vue +1 -1
- package/components/selects/FSSelectTimeZone.vue +7 -11
- package/components/tiles/FSDeviceOrganisationTileUI.vue +3 -3
- package/components/tiles/FSGroupTileUI.vue +3 -3
- package/components/tiles/FSLoadTile.vue +1 -1
- package/components/tiles/FSTile.vue +1 -1
- package/composables/index.ts +1 -0
- package/composables/useFiles.ts +13 -0
- package/composables/useRules.ts +1 -1
- package/models/colors.ts +1 -1
- package/models/deviceStatuses.ts +1 -1
- package/models/images.ts +4 -0
- package/models/index.ts +1 -0
- package/models/rules.ts +2 -2
- package/package.json +4 -4
- package/styles/components/fs_clock.scss +3 -2
- package/styles/components/fs_edit_image.scss +3 -0
- package/styles/components/index.scss +1 -0
- package/styles/globals/overrides.scss +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-expansion-panels variant="accordion">
|
|
3
3
|
<template
|
|
4
|
-
v-for="(component, index) in getChildren()"
|
|
4
|
+
v-for="(component, index) in getChildren(undefined)"
|
|
5
5
|
:key="index"
|
|
6
6
|
>
|
|
7
7
|
<component :is="component" />
|
|
@@ -21,7 +21,7 @@ export default defineComponent({
|
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
23
|
getChildren
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
25
|
}
|
|
26
|
-
})
|
|
26
|
+
});
|
|
27
27
|
</script>
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
</template>
|
|
38
38
|
|
|
39
39
|
<script lang="ts">
|
|
40
|
-
import { computed, defineComponent } from "vue";
|
|
40
|
+
import { computed, defineComponent, PropType } from "vue";
|
|
41
41
|
|
|
42
42
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
43
43
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -58,17 +58,17 @@ export default defineComponent({
|
|
|
58
58
|
},
|
|
59
59
|
props: {
|
|
60
60
|
prependIcon: {
|
|
61
|
-
type: String
|
|
61
|
+
type: String as PropType<string | null>,
|
|
62
62
|
required: false,
|
|
63
63
|
default: null
|
|
64
64
|
},
|
|
65
65
|
title: {
|
|
66
|
-
type: String
|
|
66
|
+
type: String as PropType<string | null>,
|
|
67
67
|
required: false,
|
|
68
68
|
default: null
|
|
69
69
|
},
|
|
70
70
|
content: {
|
|
71
|
-
type: String
|
|
71
|
+
type: String as PropType<string | null>,
|
|
72
72
|
required: false,
|
|
73
73
|
default: null
|
|
74
74
|
},
|
|
@@ -109,7 +109,7 @@ export default defineComponent({
|
|
|
109
109
|
const backgrounds = getColors(ColorEnum.Background);
|
|
110
110
|
const lights = getColors(ColorEnum.Light);
|
|
111
111
|
|
|
112
|
-
const style = computed((): {[
|
|
112
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
113
113
|
return {
|
|
114
114
|
"--fs-accordion-panel-padding-title" : sizeToVar(props.paddingTitle),
|
|
115
115
|
"--fs-accordion-panel-padding-content" : sizeToVar(props.paddingContent),
|
package/components/FSBadge.vue
CHANGED
|
@@ -42,7 +42,7 @@ export default defineComponent({
|
|
|
42
42
|
|
|
43
43
|
const darks = getColors(ColorEnum.Dark);
|
|
44
44
|
|
|
45
|
-
const style: Ref<{ [
|
|
45
|
+
const style: Ref<{ [key: string] : string }> = ref({
|
|
46
46
|
"--fs-breadcrumbs-color": darks.dark,
|
|
47
47
|
"--fs-breadcrumbs-active-color": darks.base,
|
|
48
48
|
"--fs-breadcrumbs-disabled-color": darks.light
|
package/components/FSButton.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSClickable
|
|
3
3
|
v-if="!['icon'].includes($props.variant)"
|
|
4
|
-
:fullWidth="$props.fullWidth"
|
|
5
4
|
:editable="$props.editable"
|
|
6
5
|
:height="['40px', '36px']"
|
|
7
6
|
:variant="$props.variant"
|
|
@@ -121,7 +120,7 @@ export default defineComponent({
|
|
|
121
120
|
default: null
|
|
122
121
|
},
|
|
123
122
|
prependIcon: {
|
|
124
|
-
type: String
|
|
123
|
+
type: String as PropType<string | null>,
|
|
125
124
|
required: false,
|
|
126
125
|
default: null
|
|
127
126
|
},
|
|
@@ -131,12 +130,12 @@ export default defineComponent({
|
|
|
131
130
|
default: null
|
|
132
131
|
},
|
|
133
132
|
appendIcon: {
|
|
134
|
-
type: String
|
|
133
|
+
type: String as PropType<string | null>,
|
|
135
134
|
required: false,
|
|
136
135
|
default: null
|
|
137
136
|
},
|
|
138
137
|
icon: {
|
|
139
|
-
type: String
|
|
138
|
+
type: String as PropType<string | null>,
|
|
140
139
|
required: false,
|
|
141
140
|
default: null
|
|
142
141
|
},
|
|
@@ -175,7 +174,7 @@ export default defineComponent({
|
|
|
175
174
|
const lights = getColors(ColorEnum.Light);
|
|
176
175
|
const darks = getColors(ColorEnum.Dark);
|
|
177
176
|
|
|
178
|
-
const style = computed((): { [
|
|
177
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
179
178
|
if (!props.editable) {
|
|
180
179
|
switch (props.variant) {
|
|
181
180
|
case "icon": return {
|
|
@@ -196,6 +195,7 @@ export default defineComponent({
|
|
|
196
195
|
};
|
|
197
196
|
}
|
|
198
197
|
}
|
|
198
|
+
return {};
|
|
199
199
|
});
|
|
200
200
|
|
|
201
201
|
const iconClasses = computed((): string[] => {
|
|
@@ -42,15 +42,17 @@
|
|
|
42
42
|
class="fs-calendar-divider"
|
|
43
43
|
:style="style"
|
|
44
44
|
/>
|
|
45
|
-
<v-locale-provider
|
|
45
|
+
<v-locale-provider
|
|
46
|
+
:locale="languageCode"
|
|
47
|
+
>
|
|
46
48
|
<v-date-picker-month
|
|
47
49
|
:month="innerMonth"
|
|
48
50
|
:year="innerYear"
|
|
49
51
|
:multiple="false"
|
|
50
52
|
:showAdjacentMonths="true"
|
|
51
53
|
:allowedDates="allowedDates"
|
|
52
|
-
:modelValue="epochToPicker($props.modelValue)"
|
|
53
|
-
@update:modelValue="
|
|
54
|
+
:modelValue="[epochToPicker($props.modelValue)]"
|
|
55
|
+
@update:modelValue="onClickDate"
|
|
54
56
|
@update:month="null"
|
|
55
57
|
@update:year="null"
|
|
56
58
|
/>
|
|
@@ -62,7 +64,7 @@
|
|
|
62
64
|
<script lang="ts">
|
|
63
65
|
import { computed, defineComponent, PropType, ref } from "vue";
|
|
64
66
|
|
|
65
|
-
import {
|
|
67
|
+
import { useAppTimeZone, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
66
68
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
67
69
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
68
70
|
|
|
@@ -81,12 +83,12 @@ export default defineComponent({
|
|
|
81
83
|
},
|
|
82
84
|
props: {
|
|
83
85
|
label: {
|
|
84
|
-
type: String
|
|
86
|
+
type: String as PropType<string | null>,
|
|
85
87
|
required: false,
|
|
86
88
|
default: null
|
|
87
89
|
},
|
|
88
90
|
modelValue: {
|
|
89
|
-
type: Number
|
|
91
|
+
type: Number as PropType<number | null>,
|
|
90
92
|
required: false,
|
|
91
93
|
default: null
|
|
92
94
|
},
|
|
@@ -102,9 +104,9 @@ export default defineComponent({
|
|
|
102
104
|
}
|
|
103
105
|
},
|
|
104
106
|
emits: ["update:modelValue"],
|
|
105
|
-
setup(props) {
|
|
106
|
-
const { epochToPicker, pickerToEpoch, todayToEpoch } =
|
|
107
|
-
const { languageCode } =
|
|
107
|
+
setup(props, { emit }) {
|
|
108
|
+
const { epochToPicker, pickerToEpoch, todayToEpoch } = useAppTimeZone();
|
|
109
|
+
const { languageCode } = useAppLanguageCode();
|
|
108
110
|
const { getColors } = useColors();
|
|
109
111
|
|
|
110
112
|
const colors = computed(() => getColors(props.color));
|
|
@@ -114,7 +116,7 @@ export default defineComponent({
|
|
|
114
116
|
const innerMonth = ref(props.modelValue ? epochToPicker(props.modelValue).getMonth() : new Date().getMonth());
|
|
115
117
|
const innerYear = ref(props.modelValue ? epochToPicker(props.modelValue).getFullYear() : new Date().getFullYear());
|
|
116
118
|
|
|
117
|
-
const style = computed((): {[
|
|
119
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
118
120
|
return {
|
|
119
121
|
"--fs-calendar-background-color" : backgrounds.base,
|
|
120
122
|
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
@@ -155,8 +157,15 @@ export default defineComponent({
|
|
|
155
157
|
}
|
|
156
158
|
};
|
|
157
159
|
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
+
const onClickDate = (value: unknown): void => {
|
|
161
|
+
const date = (value as Date[])[0];
|
|
162
|
+
const epoch = pickerToEpoch(date);
|
|
163
|
+
emit("update:modelValue", epoch);
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
const allowedDates = (value: unknown): boolean => {
|
|
167
|
+
const date = value as Date;
|
|
168
|
+
const valueEpoch = pickerToEpoch(date);
|
|
160
169
|
switch (props.limit) {
|
|
161
170
|
case "past":
|
|
162
171
|
return valueEpoch <= todayToEpoch(true);
|
|
@@ -178,6 +187,7 @@ export default defineComponent({
|
|
|
178
187
|
pickerToEpoch,
|
|
179
188
|
onClickPrevious,
|
|
180
189
|
onClickNext,
|
|
190
|
+
onClickDate,
|
|
181
191
|
allowedDates
|
|
182
192
|
};
|
|
183
193
|
}
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
<script lang="ts">
|
|
103
103
|
import { computed, defineComponent, onMounted, PropType, ref } from "vue";
|
|
104
104
|
|
|
105
|
-
import {
|
|
105
|
+
import { useAppTimeZone, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
106
106
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
107
107
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
108
108
|
|
|
@@ -121,12 +121,12 @@ export default defineComponent({
|
|
|
121
121
|
},
|
|
122
122
|
props: {
|
|
123
123
|
label: {
|
|
124
|
-
type: String
|
|
124
|
+
type: String as PropType<string | null>,
|
|
125
125
|
required: false,
|
|
126
126
|
default: null
|
|
127
127
|
},
|
|
128
128
|
modelValue: {
|
|
129
|
-
type: Array as PropType<number[]>,
|
|
129
|
+
type: Array as PropType<number[] | null>,
|
|
130
130
|
required: false,
|
|
131
131
|
default: null
|
|
132
132
|
},
|
|
@@ -143,8 +143,8 @@ export default defineComponent({
|
|
|
143
143
|
},
|
|
144
144
|
emits: ["update:modelValue"],
|
|
145
145
|
setup(props, { emit }) {
|
|
146
|
-
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } =
|
|
147
|
-
const { languageCode } =
|
|
146
|
+
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useAppTimeZone();
|
|
147
|
+
const { languageCode } = useAppLanguageCode();
|
|
148
148
|
const { getColors } = useColors();
|
|
149
149
|
|
|
150
150
|
const colors = computed(() => getColors(props.color));
|
|
@@ -212,7 +212,7 @@ export default defineComponent({
|
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
const style = computed((): {[
|
|
215
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
216
216
|
return {
|
|
217
217
|
"--fs-calendar-background-color" : backgrounds.base,
|
|
218
218
|
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
@@ -338,8 +338,9 @@ export default defineComponent({
|
|
|
338
338
|
}
|
|
339
339
|
};
|
|
340
340
|
|
|
341
|
-
const onClickLeft = (value:
|
|
342
|
-
const
|
|
341
|
+
const onClickLeft = (value: unknown): void => {
|
|
342
|
+
const dates = value as Date[];
|
|
343
|
+
const clicked = pickerToEpoch(dates[dates.length - 1]);
|
|
343
344
|
if (!props.modelValue || !props.modelValue.length) {
|
|
344
345
|
emit("update:modelValue", [clicked, clicked]);
|
|
345
346
|
}
|
|
@@ -357,8 +358,10 @@ export default defineComponent({
|
|
|
357
358
|
}
|
|
358
359
|
};
|
|
359
360
|
|
|
360
|
-
|
|
361
|
-
|
|
361
|
+
|
|
362
|
+
const onClickRight = (value: unknown): void => {
|
|
363
|
+
const dates = value as Date[];
|
|
364
|
+
const clicked = pickerToEpoch(dates[dates.length - 1]);
|
|
362
365
|
if (!props.modelValue || !props.modelValue.length) {
|
|
363
366
|
emit("update:modelValue", [clicked, clicked]);
|
|
364
367
|
}
|
|
@@ -377,8 +380,9 @@ export default defineComponent({
|
|
|
377
380
|
toggle.value = (++toggle.value) % 2;
|
|
378
381
|
};
|
|
379
382
|
|
|
380
|
-
const allowedDates = (value:
|
|
381
|
-
const
|
|
383
|
+
const allowedDates = (value: unknown): boolean => {
|
|
384
|
+
const date = value as Date;
|
|
385
|
+
const valueEpoch = pickerToEpoch(date);
|
|
382
386
|
switch (props.limit) {
|
|
383
387
|
case "past":
|
|
384
388
|
return valueEpoch <= todayToEpoch(true);
|
package/components/FSCard.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div
|
|
3
|
-
class="
|
|
3
|
+
:class="classes"
|
|
4
4
|
:style="style"
|
|
5
5
|
>
|
|
6
6
|
<slot>
|
|
@@ -98,7 +98,7 @@ export default defineComponent({
|
|
|
98
98
|
const lights = getColors(ColorEnum.Light);
|
|
99
99
|
const darks = getColors(ColorEnum.Dark);
|
|
100
100
|
|
|
101
|
-
const style = computed((): {[
|
|
101
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
102
102
|
switch (props.variant) {
|
|
103
103
|
case "standard": return {
|
|
104
104
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
@@ -123,7 +123,16 @@ export default defineComponent({
|
|
|
123
123
|
}
|
|
124
124
|
});
|
|
125
125
|
|
|
126
|
+
const classes = computed((): string[] => {
|
|
127
|
+
const classNames = ["fs-card"];
|
|
128
|
+
if (props.elevation) {
|
|
129
|
+
classNames.push("fs-card-elevation");
|
|
130
|
+
}
|
|
131
|
+
return classNames;
|
|
132
|
+
});
|
|
133
|
+
|
|
126
134
|
return {
|
|
135
|
+
classes,
|
|
127
136
|
style
|
|
128
137
|
};
|
|
129
138
|
}
|
|
@@ -44,7 +44,7 @@ export default defineComponent({
|
|
|
44
44
|
|
|
45
45
|
const backgrounds = getColors(ColorEnum.Background);
|
|
46
46
|
|
|
47
|
-
const style = computed((): {[
|
|
47
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
48
48
|
return {
|
|
49
49
|
"--fs-carousel-height" : sizeToVar(props.height),
|
|
50
50
|
"--fs-carousel-background-color": backgrounds.base
|
|
@@ -73,12 +73,12 @@ export default defineComponent({
|
|
|
73
73
|
},
|
|
74
74
|
props: {
|
|
75
75
|
label: {
|
|
76
|
-
type: String
|
|
76
|
+
type: String as PropType<string | null>,
|
|
77
77
|
required: false,
|
|
78
78
|
default: null
|
|
79
79
|
},
|
|
80
80
|
description: {
|
|
81
|
-
type: String
|
|
81
|
+
type: String as PropType<string | null>,
|
|
82
82
|
required: false,
|
|
83
83
|
default: null
|
|
84
84
|
},
|
|
@@ -98,7 +98,7 @@ export default defineComponent({
|
|
|
98
98
|
default: ColorEnum.Primary
|
|
99
99
|
},
|
|
100
100
|
rules: {
|
|
101
|
-
type: Array as PropType<
|
|
101
|
+
type: Array as PropType<any[]>,
|
|
102
102
|
required: false,
|
|
103
103
|
default: () => []
|
|
104
104
|
},
|
|
@@ -123,7 +123,7 @@ export default defineComponent({
|
|
|
123
123
|
const lights = getColors(ColorEnum.Light);
|
|
124
124
|
const darks = getColors(ColorEnum.Dark);
|
|
125
125
|
|
|
126
|
-
const style = computed((): {[
|
|
126
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
127
127
|
if (!props.editable) {
|
|
128
128
|
return {
|
|
129
129
|
"--fs-checkbox-cursor" : "default",
|
package/components/FSChip.vue
CHANGED
|
@@ -54,17 +54,17 @@ export default defineComponent({
|
|
|
54
54
|
},
|
|
55
55
|
props: {
|
|
56
56
|
prependIcon: {
|
|
57
|
-
type: String
|
|
57
|
+
type: String as PropType<string | null>,
|
|
58
58
|
required: false,
|
|
59
59
|
default: null
|
|
60
60
|
},
|
|
61
61
|
label: {
|
|
62
|
-
type: String
|
|
62
|
+
type: String as PropType<string | null>,
|
|
63
63
|
required: false,
|
|
64
64
|
default: null
|
|
65
65
|
},
|
|
66
66
|
appendIcon: {
|
|
67
|
-
type: String
|
|
67
|
+
type: String as PropType<string | null>,
|
|
68
68
|
required: false,
|
|
69
69
|
default: null
|
|
70
70
|
},
|
|
@@ -90,7 +90,7 @@ export default defineComponent({
|
|
|
90
90
|
const colors = computed(() => getColors(props.color));
|
|
91
91
|
const backgrounds = getColors(ColorEnum.Background);
|
|
92
92
|
|
|
93
|
-
const style = computed((): { [
|
|
93
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
94
94
|
switch (props.variant) {
|
|
95
95
|
case "standard": return {
|
|
96
96
|
"--fs-chip-background-color" : backgrounds.base,
|
|
@@ -130,7 +130,7 @@ export default defineComponent({
|
|
|
130
130
|
const lights = getColors(ColorEnum.Light);
|
|
131
131
|
const darks = getColors(ColorEnum.Dark);
|
|
132
132
|
|
|
133
|
-
const style = computed((): { [
|
|
133
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
134
134
|
if (!props.editable) {
|
|
135
135
|
return {
|
|
136
136
|
"--fs-clickable-border-size" : props.border ? "1px" : "0",
|
package/components/FSClock.vue
CHANGED
|
@@ -7,38 +7,27 @@
|
|
|
7
7
|
align="center-center"
|
|
8
8
|
:wrap="false"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<v-text-field
|
|
32
|
-
class="fs-clock-field"
|
|
33
|
-
variant="outlined"
|
|
34
|
-
type="number"
|
|
35
|
-
hide-details
|
|
36
|
-
:style="style"
|
|
37
|
-
:readonly="!$props.editable"
|
|
38
|
-
:modelValue="innerMinutes.toString().padStart(2, '0')"
|
|
39
|
-
@update:modelValue="onChangeMinutes"
|
|
40
|
-
/>
|
|
41
|
-
</FSRow>
|
|
10
|
+
<v-text-field
|
|
11
|
+
class="fs-clock-field"
|
|
12
|
+
variant="outlined"
|
|
13
|
+
type="number"
|
|
14
|
+
hide-details
|
|
15
|
+
:style="style"
|
|
16
|
+
:readonly="!$props.editable"
|
|
17
|
+
:modelValue="innerHours.toString().padStart(2, '0')"
|
|
18
|
+
@update:modelValue="onChangeHours"
|
|
19
|
+
/>
|
|
20
|
+
:
|
|
21
|
+
<v-text-field
|
|
22
|
+
class="fs-clock-field"
|
|
23
|
+
variant="outlined"
|
|
24
|
+
type="number"
|
|
25
|
+
hide-details
|
|
26
|
+
:style="style"
|
|
27
|
+
:readonly="!$props.editable"
|
|
28
|
+
:modelValue="innerMinutes.toString().padStart(2, '0')"
|
|
29
|
+
@update:modelValue="onChangeMinutes"
|
|
30
|
+
/>
|
|
42
31
|
</FSRow>
|
|
43
32
|
<FSCol
|
|
44
33
|
v-if="$props.slider"
|
|
@@ -73,7 +62,7 @@
|
|
|
73
62
|
import { computed, defineComponent, PropType, ref, watch } from "vue";
|
|
74
63
|
|
|
75
64
|
import { ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
76
|
-
import {
|
|
65
|
+
import { useAppTimeZone } from "@dative-gpi/foundation-shared-services/composables";
|
|
77
66
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
78
67
|
|
|
79
68
|
import FSSlider from "./FSSlider.vue";
|
|
@@ -91,7 +80,7 @@ export default defineComponent({
|
|
|
91
80
|
},
|
|
92
81
|
props: {
|
|
93
82
|
modelValue: {
|
|
94
|
-
type: Number
|
|
83
|
+
type: Number as PropType<number | null>,
|
|
95
84
|
required: false,
|
|
96
85
|
default: null
|
|
97
86
|
},
|
|
@@ -101,15 +90,10 @@ export default defineComponent({
|
|
|
101
90
|
default: ColorEnum.Primary
|
|
102
91
|
},
|
|
103
92
|
date: {
|
|
104
|
-
type: Number
|
|
93
|
+
type: Number as PropType<number | null>,
|
|
105
94
|
required: false,
|
|
106
95
|
default: null
|
|
107
96
|
},
|
|
108
|
-
reminder: {
|
|
109
|
-
type: Boolean,
|
|
110
|
-
required: false,
|
|
111
|
-
default: false
|
|
112
|
-
},
|
|
113
97
|
editable: {
|
|
114
98
|
type: Boolean,
|
|
115
99
|
required: false,
|
|
@@ -123,7 +107,7 @@ export default defineComponent({
|
|
|
123
107
|
},
|
|
124
108
|
emits: ["update:modelValue"],
|
|
125
109
|
setup(props, { emit }) {
|
|
126
|
-
const { epochToLongDateFormat } =
|
|
110
|
+
const { epochToLongDateFormat } = useAppTimeZone();
|
|
127
111
|
const { getColors } = useColors();
|
|
128
112
|
|
|
129
113
|
const colors = computed(() => getColors(props.color));
|
|
@@ -134,7 +118,7 @@ export default defineComponent({
|
|
|
134
118
|
const innerHours = ref(props.modelValue ? Math.floor(props.modelValue / (60 * 60 * 1000)) : 0);
|
|
135
119
|
const innerMinutes = ref(props.modelValue ? Math.floor((props.modelValue % (60 * 60 * 1000)) / (60 * 1000)) : 0);
|
|
136
120
|
|
|
137
|
-
const style = computed((): {[
|
|
121
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
138
122
|
if (!props.editable) {
|
|
139
123
|
return {
|
|
140
124
|
"--fs-clock-field-cursor" : "default",
|
|
@@ -153,14 +137,22 @@ export default defineComponent({
|
|
|
153
137
|
};
|
|
154
138
|
});
|
|
155
139
|
|
|
156
|
-
const onChangeHours = (value:
|
|
157
|
-
|
|
158
|
-
|
|
140
|
+
const onChangeHours = (value: string): void => {
|
|
141
|
+
let number = parseInt(value);
|
|
142
|
+
if (isNaN(number) || !isFinite(number)) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
number = Math.min(23, Math.max(0, number));
|
|
146
|
+
innerHours.value = number;
|
|
159
147
|
};
|
|
160
148
|
|
|
161
|
-
const onChangeMinutes = (value:
|
|
162
|
-
|
|
163
|
-
|
|
149
|
+
const onChangeMinutes = (value: string): void => {
|
|
150
|
+
let number = parseInt(value);
|
|
151
|
+
if (isNaN(number) || !isFinite(number)) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
number = Math.min(59, Math.max(0, number));
|
|
155
|
+
innerMinutes.value = number;
|
|
164
156
|
};
|
|
165
157
|
|
|
166
158
|
watch([innerHours, innerMinutes], () => {
|
package/components/FSCol.vue
CHANGED
|
@@ -43,7 +43,7 @@ export default defineComponent({
|
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
setup(props) {
|
|
46
|
-
const style = computed((): {[
|
|
46
|
+
const style = computed((): { [key: string] : string | undefined } => ({
|
|
47
47
|
"--fs-col-padding": sizeToVar(props.padding),
|
|
48
48
|
"--fs-col-gap" : sizeToVar(props.gap),
|
|
49
49
|
"--fs-col-width" : sizeToVar(props.width),
|
package/components/FSColor.vue
CHANGED
|
@@ -39,13 +39,15 @@ export default defineComponent({
|
|
|
39
39
|
|
|
40
40
|
const colors = computed(() => getColors(props.color));
|
|
41
41
|
|
|
42
|
-
const style:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
43
|
+
return {
|
|
44
|
+
"--fs-color-background-color": colors.value.light,
|
|
45
|
+
"--fs-color-border-color" : colors.value.lightContrast,
|
|
46
|
+
"--fs-color-color" : colors.value.lightContrast,
|
|
47
|
+
"--fs-color-light" : colors.value.light,
|
|
48
|
+
"--fs-color-base" : colors.value.base,
|
|
49
|
+
"--fs-color-dark" : colors.value.dark
|
|
50
|
+
};
|
|
49
51
|
});
|
|
50
52
|
|
|
51
53
|
const classes = computed((): string[] => {
|
|
@@ -39,7 +39,7 @@ export default defineComponent({
|
|
|
39
39
|
|
|
40
40
|
const colors = computed(() => getColors(props.color));
|
|
41
41
|
|
|
42
|
-
const style = computed((): { [
|
|
42
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
43
43
|
switch (props.variant) {
|
|
44
44
|
case "full": return {
|
|
45
45
|
"--fs-icon-background-color": colors.value.light
|
package/components/FSDivider.vue
CHANGED
|
@@ -44,7 +44,7 @@ export default defineComponent({
|
|
|
44
44
|
},
|
|
45
45
|
props: {
|
|
46
46
|
label: {
|
|
47
|
-
type: String
|
|
47
|
+
type: String as PropType<string | null>,
|
|
48
48
|
required: false,
|
|
49
49
|
default: null
|
|
50
50
|
},
|
|
@@ -75,7 +75,7 @@ export default defineComponent({
|
|
|
75
75
|
|
|
76
76
|
const colors = computed(() => getColors(props.color));
|
|
77
77
|
|
|
78
|
-
const style = computed((): { [
|
|
78
|
+
const style = computed((): { [key: string] : string | undefined } => {
|
|
79
79
|
switch (props.variant) {
|
|
80
80
|
case "base": return {
|
|
81
81
|
"--fs-divider-width": sizeToVar(props.width),
|