@dative-gpi/foundation-shared-components 1.0.6 → 1.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/components/FSAccordionPanel.vue +8 -10
- package/components/FSBadge.vue +2 -4
- package/components/FSBreadcrumbs.vue +6 -6
- package/components/FSButton.vue +4 -4
- package/components/FSCalendar.vue +33 -31
- package/components/FSCalendarTwin.vue +75 -82
- package/components/FSCard.vue +7 -7
- package/components/FSCardPlaceholder.vue +1 -2
- package/components/FSCheckbox.vue +4 -6
- package/components/FSChip.vue +9 -11
- package/components/FSClickable.vue +44 -48
- package/components/FSClock.vue +2 -2
- package/components/FSCol.vue +2 -3
- package/components/FSColorIcon.vue +2 -4
- package/components/FSDialog.vue +1 -2
- package/components/FSDialogMenu.vue +2 -4
- package/components/FSDialogSubmit.vue +2 -4
- package/components/FSDivider.vue +6 -8
- package/components/FSEditImage.vue +6 -8
- package/components/FSErrorToast.vue +3 -4
- package/components/FSFadeOut.vue +9 -11
- package/components/FSGrid.vue +5 -9
- package/components/FSGridMosaic.vue +1 -2
- package/components/FSIcon.vue +5 -7
- package/components/FSIconCard.vue +20 -25
- package/components/FSIconCheck.vue +1 -2
- package/components/FSImage.vue +9 -10
- package/components/FSImageCard.vue +2 -2
- package/components/FSLabel.vue +17 -19
- package/components/FSLink.vue +18 -20
- package/components/FSLoader.vue +8 -11
- package/components/FSOptionGroup.vue +7 -9
- package/components/FSPagination.vue +3 -5
- package/components/FSRadio.vue +4 -6
- package/components/FSRadioGroup.vue +2 -4
- package/components/FSRow.vue +3 -4
- package/components/FSSlideGroup.vue +2 -3
- package/components/FSSlider.vue +8 -10
- package/components/FSSpan.vue +5 -8
- package/components/FSSwitch.vue +7 -9
- package/components/FSTab.vue +2 -4
- package/components/FSTabs.vue +9 -9
- package/components/FSTag.vue +9 -11
- package/components/FSTagGroup.vue +2 -4
- package/components/FSText.vue +7 -11
- package/components/FSWindow.vue +2 -2
- package/components/FSWrapGroup.vue +2 -3
- package/components/deviceOrganisations/FSConnectivityCard.vue +1 -2
- package/components/deviceOrganisations/FSStatusCard.vue +1 -2
- package/components/deviceOrganisations/FSStatusesRow.vue +1 -2
- package/components/deviceOrganisations/FSWorstAlert.vue +1 -2
- package/components/deviceOrganisations/FSWorstAlertCard.vue +1 -2
- package/components/fields/FSAutocompleteField.vue +2 -3
- package/components/fields/FSBaseField.vue +13 -10
- package/components/fields/FSColorField.vue +16 -16
- package/components/fields/FSDateTimeField.vue +2 -2
- package/components/fields/FSDateTimeRangeField.vue +4 -4
- package/components/fields/FSIconField.vue +2 -3
- package/components/fields/FSMagicConfigField.vue +1 -2
- package/components/fields/FSMagicField.vue +1 -2
- package/components/fields/FSNumberField.vue +1 -2
- package/components/fields/FSPasswordField.vue +2 -3
- package/components/fields/FSRichTextField.vue +3 -4
- package/components/fields/FSSearchField.vue +1 -2
- package/components/fields/FSSelectField.vue +2 -3
- package/components/fields/FSTagField.vue +3 -5
- package/components/fields/FSTermField.vue +6 -5
- package/components/fields/FSTextArea.vue +2 -3
- package/components/fields/FSTextField.vue +2 -3
- package/components/fields/FSTimeField.vue +1 -1
- package/components/fields/FSTimeSlotField.vue +2 -3
- package/components/fields/FSTranslateField.vue +2 -2
- package/components/fields/FSTreeViewField.vue +4 -6
- package/components/lists/FSDataIteratorItem.vue +8 -10
- package/components/lists/FSDataTableUI.vue +7 -11
- package/components/lists/FSFilterButton.vue +1 -2
- package/components/lists/FSLoadDataTable.vue +4 -6
- package/components/map/FSMap.vue +11 -14
- package/components/map/FSMapOverlay.vue +10 -10
- package/components/selects/FSSelectDateSetting.vue +1 -2
- package/components/tiles/FSLoadTile.vue +5 -7
- package/components/views/FSEntityHeader.vue +4 -4
- package/components/views/FSListHeader.vue +83 -0
- package/components/views/FSListView.vue +83 -0
- package/models/rules.ts +1 -1
- package/package.json +4 -4
- package/utils/badge.ts +9 -0
- package/utils/index.ts +1 -0
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script lang="ts">
|
|
55
|
-
import { computed, defineComponent, type PropType } from "vue";
|
|
55
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
56
56
|
|
|
57
57
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
58
58
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -136,15 +136,13 @@ export default defineComponent({
|
|
|
136
136
|
const backgrounds = getColors(ColorEnum.Background);
|
|
137
137
|
const lights = getColors(ColorEnum.Light);
|
|
138
138
|
|
|
139
|
-
const style = computed(():
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
};
|
|
147
|
-
});
|
|
139
|
+
const style = computed((): StyleValue => ({
|
|
140
|
+
"--fs-accordion-panel-padding-title" : sizeToVar(props.paddingTitle),
|
|
141
|
+
"--fs-accordion-panel-padding-content" : sizeToVar(props.paddingContent),
|
|
142
|
+
"--fs-accordion-panel-divider-size" : props.divider ? "1px" : "0",
|
|
143
|
+
"--fs-accordion-panel-divider-color" : lights.dark,
|
|
144
|
+
"--fs-accordion-panel-background-color": backgrounds.base
|
|
145
|
+
}));
|
|
148
146
|
|
|
149
147
|
return {
|
|
150
148
|
style
|
package/components/FSBadge.vue
CHANGED
|
@@ -18,11 +18,9 @@
|
|
|
18
18
|
</template>
|
|
19
19
|
|
|
20
20
|
<script lang="ts">
|
|
21
|
-
import type
|
|
22
|
-
import { defineComponent } from "vue";
|
|
21
|
+
import { defineComponent, type PropType } from "vue";
|
|
23
22
|
|
|
24
|
-
import type
|
|
25
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
23
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
26
24
|
|
|
27
25
|
export default defineComponent({
|
|
28
26
|
name: "FSBadge",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-breadcrumbs
|
|
3
|
-
:style="style"
|
|
4
3
|
:items="$props.items"
|
|
4
|
+
:style="style"
|
|
5
5
|
v-bind="$attrs"
|
|
6
6
|
>
|
|
7
7
|
<template
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script lang="ts">
|
|
30
|
-
import { defineComponent, type PropType, type
|
|
30
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
31
31
|
|
|
32
32
|
import { ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
33
33
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
@@ -53,11 +53,11 @@ export default defineComponent({
|
|
|
53
53
|
|
|
54
54
|
const darks = getColors(ColorEnum.Dark);
|
|
55
55
|
|
|
56
|
-
const style
|
|
57
|
-
"--fs-breadcrumbs-color": darks.dark,
|
|
58
|
-
"--fs-breadcrumbs-active-color": darks.base,
|
|
56
|
+
const style = computed((): StyleValue => ({
|
|
57
|
+
"--fs-breadcrumbs-color" : darks.dark,
|
|
58
|
+
"--fs-breadcrumbs-active-color" : darks.base,
|
|
59
59
|
"--fs-breadcrumbs-disabled-color": darks.soft
|
|
60
|
-
});
|
|
60
|
+
}));
|
|
61
61
|
|
|
62
62
|
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
63
63
|
const classNames = ["fs-breadcrumbs-label"];
|
package/components/FSButton.vue
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSClickable
|
|
3
|
-
v-if="
|
|
3
|
+
v-if="$props.variant !== 'icon'"
|
|
4
4
|
:editable="$props.editable"
|
|
5
5
|
:height="['40px', '36px']"
|
|
6
6
|
:variant="$props.variant"
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
</template>
|
|
129
129
|
|
|
130
130
|
<script lang="ts">
|
|
131
|
-
import { computed, defineComponent, type PropType } from "vue";
|
|
131
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
132
132
|
import { type RouteLocation } from "vue-router";
|
|
133
133
|
|
|
134
134
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -164,7 +164,7 @@ export default defineComponent({
|
|
|
164
164
|
default: null
|
|
165
165
|
},
|
|
166
166
|
label: {
|
|
167
|
-
type: [String, Function]
|
|
167
|
+
type: [String, Function] as PropType<string | Function | null>,
|
|
168
168
|
required: false,
|
|
169
169
|
default: null
|
|
170
170
|
},
|
|
@@ -218,7 +218,7 @@ export default defineComponent({
|
|
|
218
218
|
const lights = getColors(ColorEnum.Light);
|
|
219
219
|
const darks = getColors(ColorEnum.Dark);
|
|
220
220
|
|
|
221
|
-
const style = computed(():
|
|
221
|
+
const style = computed((): StyleValue => {
|
|
222
222
|
if (!props.editable) {
|
|
223
223
|
switch (props.variant) {
|
|
224
224
|
case "icon": return {
|
|
@@ -65,12 +65,10 @@
|
|
|
65
65
|
</template>
|
|
66
66
|
|
|
67
67
|
<script lang="ts">
|
|
68
|
-
import type
|
|
69
|
-
import { computed, defineComponent, ref } from "vue";
|
|
68
|
+
import { computed, defineComponent, onMounted, type PropType, ref, type StyleValue } from "vue";
|
|
70
69
|
|
|
71
70
|
import { useAppTimeZone, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
72
|
-
import type
|
|
73
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
71
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
74
72
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
75
73
|
|
|
76
74
|
import FSButton from "./FSButton.vue";
|
|
@@ -113,27 +111,25 @@ export default defineComponent({
|
|
|
113
111
|
const { epochToPicker, pickerToEpoch, todayToEpoch } = useAppTimeZone();
|
|
114
112
|
const { languageCode } = useAppLanguageCode();
|
|
115
113
|
const { getColors } = useColors();
|
|
114
|
+
|
|
115
|
+
const innerMonth = ref(new Date().getMonth());
|
|
116
|
+
const innerYear = ref(new Date().getFullYear());
|
|
116
117
|
|
|
117
118
|
const colors = computed(() => getColors(props.color));
|
|
118
119
|
const backgrounds = getColors(ColorEnum.Background);
|
|
119
120
|
const darks = getColors(ColorEnum.Dark);
|
|
120
|
-
|
|
121
|
-
const innerMonth = ref(props.modelValue ? epochToPicker(props.modelValue).getMonth() : new Date().getMonth());
|
|
122
|
-
const innerYear = ref(props.modelValue ? epochToPicker(props.modelValue).getFullYear() : new Date().getFullYear());
|
|
123
121
|
|
|
124
|
-
const style = computed(():
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
};
|
|
136
|
-
});
|
|
122
|
+
const style = computed((): StyleValue => ({
|
|
123
|
+
"--fs-calendar-background-color" : backgrounds.base,
|
|
124
|
+
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
125
|
+
"--fs-calendar-active-background-color": colors.value.base,
|
|
126
|
+
"--fs-calendar-border-color" : darks.base,
|
|
127
|
+
"--fs-calendar-hover-border-color" : colors.value.base,
|
|
128
|
+
"--fs-calendar-active-border-color" : colors.value.base,
|
|
129
|
+
"--fs-calendar-color" : darks.base,
|
|
130
|
+
"--fs-calendar-hover-color" : colors.value.base,
|
|
131
|
+
"--fs-calendar-active-color" : colors.value.light
|
|
132
|
+
}));
|
|
137
133
|
|
|
138
134
|
const text = computed((): string => {
|
|
139
135
|
const date = new Date(0);
|
|
@@ -163,24 +159,30 @@ export default defineComponent({
|
|
|
163
159
|
};
|
|
164
160
|
|
|
165
161
|
const onClickDate = (value: unknown): void => {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
162
|
+
if (!Array.isArray(value) || !(value[0] instanceof Date)) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
emit("update:modelValue", pickerToEpoch(value[0]));
|
|
169
166
|
};
|
|
170
167
|
|
|
171
168
|
const allowedDates = (value: unknown): boolean => {
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
if (!(value instanceof Date)) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
174
172
|
switch (props.limit) {
|
|
175
|
-
case "past":
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
return valueEpoch >= todayToEpoch(true);
|
|
179
|
-
default:
|
|
180
|
-
return true;
|
|
173
|
+
case "past" : return pickerToEpoch(value) <= todayToEpoch();
|
|
174
|
+
case "future": return pickerToEpoch(value) >= todayToEpoch();
|
|
175
|
+
default : return true;
|
|
181
176
|
}
|
|
182
177
|
};
|
|
183
178
|
|
|
179
|
+
onMounted(() => {
|
|
180
|
+
if (props.modelValue) {
|
|
181
|
+
innerMonth.value = epochToPicker(props.modelValue).getMonth();
|
|
182
|
+
innerYear.value = epochToPicker(props.modelValue).getFullYear();
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
|
|
184
186
|
return {
|
|
185
187
|
ColorEnum,
|
|
186
188
|
languageCode,
|
|
@@ -112,12 +112,10 @@
|
|
|
112
112
|
</template>
|
|
113
113
|
|
|
114
114
|
<script lang="ts">
|
|
115
|
-
import type
|
|
116
|
-
import { computed, defineComponent, onMounted, ref } from "vue";
|
|
115
|
+
import { computed, defineComponent, onMounted, type PropType, ref, type StyleValue } from "vue";
|
|
117
116
|
|
|
118
117
|
import { useAppTimeZone, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
119
|
-
import type
|
|
120
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
118
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
121
119
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
122
120
|
|
|
123
121
|
import FSButton from "./FSButton.vue";
|
|
@@ -160,10 +158,6 @@ export default defineComponent({
|
|
|
160
158
|
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useAppTimeZone();
|
|
161
159
|
const { languageCode } = useAppLanguageCode();
|
|
162
160
|
const { getColors } = useColors();
|
|
163
|
-
|
|
164
|
-
const colors = computed(() => getColors(props.color));
|
|
165
|
-
const backgrounds = getColors(ColorEnum.Background);
|
|
166
|
-
const darks = getColors(ColorEnum.Dark);
|
|
167
161
|
|
|
168
162
|
const innerLeftMonth = ref(new Date().getMonth());
|
|
169
163
|
const innerLeftYear = ref(new Date().getFullYear());
|
|
@@ -173,72 +167,21 @@ export default defineComponent({
|
|
|
173
167
|
|
|
174
168
|
const toggle = ref((props.modelValue?.length ?? 0) % 2);
|
|
175
169
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
innerLeftYear.value = new Date().getFullYear();
|
|
180
|
-
if (innerLeftMonth.value < 11) {
|
|
181
|
-
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
182
|
-
innerRightYear.value = innerLeftYear.value;
|
|
183
|
-
}
|
|
184
|
-
else {
|
|
185
|
-
innerRightMonth.value = 0;
|
|
186
|
-
innerRightYear.value = innerLeftYear.value + 1;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
innerLeftMonth.value = epochToPickerHeader(props.modelValue[0]).m;
|
|
191
|
-
innerLeftYear.value = epochToPickerHeader(props.modelValue[0]).y;
|
|
192
|
-
if (innerLeftMonth.value < 11) {
|
|
193
|
-
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
194
|
-
innerRightYear.value = innerLeftYear.value;
|
|
195
|
-
}
|
|
196
|
-
else {
|
|
197
|
-
innerRightMonth.value = 0;
|
|
198
|
-
innerRightYear.value = innerLeftYear.value + 1;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
|
|
203
|
-
const compare = (operator: "before" | "during" | "after", side: "left" | "right", date: { d: number, m: number, y: number }): boolean => {
|
|
204
|
-
switch (operator) {
|
|
205
|
-
case "before":
|
|
206
|
-
switch (side) {
|
|
207
|
-
case "left":
|
|
208
|
-
return innerLeftYear.value > date.y || (innerLeftYear.value === date.y && innerLeftMonth.value > date.m);
|
|
209
|
-
default:
|
|
210
|
-
return innerRightYear.value > date.y || (innerRightYear.value === date.y && innerRightMonth.value > date.m);
|
|
211
|
-
}
|
|
212
|
-
case "during":
|
|
213
|
-
switch (side) {
|
|
214
|
-
case "left":
|
|
215
|
-
return innerLeftYear.value === date.y && innerLeftMonth.value === date.m;
|
|
216
|
-
default:
|
|
217
|
-
return innerRightYear.value === date.y && innerRightMonth.value === date.m;
|
|
218
|
-
}
|
|
219
|
-
case "after":
|
|
220
|
-
switch (side) {
|
|
221
|
-
case "left":
|
|
222
|
-
return innerLeftYear.value < date.y || (innerLeftYear.value === date.y && innerLeftMonth.value < date.m);
|
|
223
|
-
default:
|
|
224
|
-
return innerRightYear.value < date.y || (innerRightYear.value === date.y && innerRightMonth.value < date.m);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
}
|
|
170
|
+
const colors = computed(() => getColors(props.color));
|
|
171
|
+
const backgrounds = getColors(ColorEnum.Background);
|
|
172
|
+
const darks = getColors(ColorEnum.Dark);
|
|
228
173
|
|
|
229
|
-
const style = computed(():
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
};
|
|
241
|
-
});
|
|
174
|
+
const style = computed((): StyleValue => ({
|
|
175
|
+
"--fs-calendar-background-color" : backgrounds.base,
|
|
176
|
+
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
177
|
+
"--fs-calendar-active-background-color": colors.value.base,
|
|
178
|
+
"--fs-calendar-border-color" : darks.base,
|
|
179
|
+
"--fs-calendar-hover-border-color" : colors.value.base,
|
|
180
|
+
"--fs-calendar-active-border-color" : colors.value.base,
|
|
181
|
+
"--fs-calendar-color" : darks.base,
|
|
182
|
+
"--fs-calendar-hover-color" : colors.value.base,
|
|
183
|
+
"--fs-calendar-active-color" : colors.value.light
|
|
184
|
+
}));
|
|
242
185
|
|
|
243
186
|
const innerLeftValue = computed((): number[] => {
|
|
244
187
|
if (!props.modelValue || !props.modelValue.length) {
|
|
@@ -318,6 +261,32 @@ export default defineComponent({
|
|
|
318
261
|
return classNames;
|
|
319
262
|
});
|
|
320
263
|
|
|
264
|
+
const compare = (operator: "before" | "during" | "after", side: "left" | "right", date: { d: number, m: number, y: number }): boolean => {
|
|
265
|
+
switch (operator) {
|
|
266
|
+
case "before":
|
|
267
|
+
switch (side) {
|
|
268
|
+
case "left":
|
|
269
|
+
return innerLeftYear.value > date.y || (innerLeftYear.value === date.y && innerLeftMonth.value > date.m);
|
|
270
|
+
default:
|
|
271
|
+
return innerRightYear.value > date.y || (innerRightYear.value === date.y && innerRightMonth.value > date.m);
|
|
272
|
+
}
|
|
273
|
+
case "during":
|
|
274
|
+
switch (side) {
|
|
275
|
+
case "left":
|
|
276
|
+
return innerLeftYear.value === date.y && innerLeftMonth.value === date.m;
|
|
277
|
+
default:
|
|
278
|
+
return innerRightYear.value === date.y && innerRightMonth.value === date.m;
|
|
279
|
+
}
|
|
280
|
+
case "after":
|
|
281
|
+
switch (side) {
|
|
282
|
+
case "left":
|
|
283
|
+
return innerLeftYear.value < date.y || (innerLeftYear.value === date.y && innerLeftMonth.value < date.m);
|
|
284
|
+
default:
|
|
285
|
+
return innerRightYear.value < date.y || (innerRightYear.value === date.y && innerRightMonth.value < date.m);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
321
290
|
const onClickPrevious = (): void => {
|
|
322
291
|
if (innerLeftMonth.value === 11) {
|
|
323
292
|
innerLeftMonth.value--;
|
|
@@ -372,7 +341,6 @@ export default defineComponent({
|
|
|
372
341
|
}
|
|
373
342
|
};
|
|
374
343
|
|
|
375
|
-
|
|
376
344
|
const onClickRight = (value: unknown): void => {
|
|
377
345
|
const dates = value as Date[];
|
|
378
346
|
const clicked = pickerToEpoch(dates[dates.length - 1]);
|
|
@@ -395,18 +363,43 @@ export default defineComponent({
|
|
|
395
363
|
};
|
|
396
364
|
|
|
397
365
|
const allowedDates = (value: unknown): boolean => {
|
|
398
|
-
|
|
399
|
-
|
|
366
|
+
if (!(value instanceof Date)) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
400
369
|
switch (props.limit) {
|
|
401
|
-
case "past":
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
return valueEpoch >= todayToEpoch(true);
|
|
405
|
-
default:
|
|
406
|
-
return true;
|
|
370
|
+
case "past" : return pickerToEpoch(value) <= todayToEpoch();
|
|
371
|
+
case "future": return pickerToEpoch(value) >= todayToEpoch();
|
|
372
|
+
default : return true;
|
|
407
373
|
}
|
|
408
374
|
};
|
|
409
375
|
|
|
376
|
+
onMounted((): void => {
|
|
377
|
+
if (!props.modelValue || !props.modelValue.length) {
|
|
378
|
+
innerLeftMonth.value = new Date().getMonth();
|
|
379
|
+
innerLeftYear.value = new Date().getFullYear();
|
|
380
|
+
if (innerLeftMonth.value < 11) {
|
|
381
|
+
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
382
|
+
innerRightYear.value = innerLeftYear.value;
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
innerRightMonth.value = 0;
|
|
386
|
+
innerRightYear.value = innerLeftYear.value + 1;
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
else {
|
|
390
|
+
innerLeftMonth.value = epochToPickerHeader(props.modelValue[0]).m;
|
|
391
|
+
innerLeftYear.value = epochToPickerHeader(props.modelValue[0]).y;
|
|
392
|
+
if (innerLeftMonth.value < 11) {
|
|
393
|
+
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
394
|
+
innerRightYear.value = innerLeftYear.value;
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
innerRightMonth.value = 0;
|
|
398
|
+
innerRightYear.value = innerLeftYear.value + 1;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
|
|
410
403
|
return {
|
|
411
404
|
ColorEnum,
|
|
412
405
|
languageCode,
|
package/components/FSCard.vue
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</template>
|
|
35
35
|
|
|
36
36
|
<script lang="ts">
|
|
37
|
-
import { computed, defineComponent, type PropType } from "vue";
|
|
37
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
38
38
|
|
|
39
39
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
40
40
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
@@ -115,7 +115,7 @@ export default defineComponent({
|
|
|
115
115
|
const lights = getColors(ColorEnum.Light);
|
|
116
116
|
const darks = getColors(ColorEnum.Dark);
|
|
117
117
|
|
|
118
|
-
const style = computed(():
|
|
118
|
+
const style = computed((): StyleValue => {
|
|
119
119
|
switch (props.variant) {
|
|
120
120
|
case "background": return {
|
|
121
121
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
@@ -136,8 +136,8 @@ export default defineComponent({
|
|
|
136
136
|
"--fs-card-height" : sizeToVar(props.height),
|
|
137
137
|
"--fs-card-width" : sizeToVar(props.width),
|
|
138
138
|
"--fs-card-background-color": colors.value.light,
|
|
139
|
-
"--fs-card-border-color" : colors.value.lightContrast
|
|
140
|
-
"--fs-card-color" : colors.value.lightContrast
|
|
139
|
+
"--fs-card-border-color" : colors.value.lightContrast!,
|
|
140
|
+
"--fs-card-color" : colors.value.lightContrast!
|
|
141
141
|
}
|
|
142
142
|
case "full": return {
|
|
143
143
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
@@ -148,7 +148,7 @@ export default defineComponent({
|
|
|
148
148
|
"--fs-card-width" : sizeToVar(props.width),
|
|
149
149
|
"--fs-card-background-color": colors.value.base,
|
|
150
150
|
"--fs-card-border-color" : colors.value.base,
|
|
151
|
-
"--fs-card-color" : colors.value.baseContrast
|
|
151
|
+
"--fs-card-color" : colors.value.baseContrast!
|
|
152
152
|
}
|
|
153
153
|
case "gradient": return {
|
|
154
154
|
"--fs-card-border-size" : props.border ? "1px" : "0",
|
|
@@ -158,8 +158,8 @@ export default defineComponent({
|
|
|
158
158
|
"--fs-card-height" : sizeToVar(props.height),
|
|
159
159
|
"--fs-card-width" : sizeToVar(props.width),
|
|
160
160
|
"--fs-card-background-color": gradients.value.base,
|
|
161
|
-
"--fs-card-border-color" : colors.value.lightContrast
|
|
162
|
-
"--fs-card-color" : colors.value.lightContrast
|
|
161
|
+
"--fs-card-border-color" : colors.value.lightContrast!,
|
|
162
|
+
"--fs-card-color" : colors.value.lightContrast!
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
});
|
|
@@ -59,12 +59,10 @@
|
|
|
59
59
|
</template>
|
|
60
60
|
|
|
61
61
|
<script lang="ts">
|
|
62
|
-
import type
|
|
63
|
-
import { computed, defineComponent } from "vue";
|
|
62
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
64
63
|
|
|
64
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
65
65
|
import { useColors, useRules } from "@dative-gpi/foundation-shared-components/composables";
|
|
66
|
-
import type { ColorBase} from "@dative-gpi/foundation-shared-components/models";
|
|
67
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
68
66
|
|
|
69
67
|
import FSIcon from "./FSIcon.vue";
|
|
70
68
|
import FSSpan from "./FSSpan.vue";
|
|
@@ -131,7 +129,7 @@ export default defineComponent({
|
|
|
131
129
|
const lights = getColors(ColorEnum.Light);
|
|
132
130
|
const darks = getColors(ColorEnum.Dark);
|
|
133
131
|
|
|
134
|
-
const style = computed(():
|
|
132
|
+
const style = computed((): StyleValue => {
|
|
135
133
|
if (!props.editable) {
|
|
136
134
|
return {
|
|
137
135
|
"--fs-checkbox-cursor" : "default",
|
|
@@ -155,7 +153,7 @@ export default defineComponent({
|
|
|
155
153
|
|
|
156
154
|
const icon = computed((): string => props.modelValue ? "mdi-checkbox-marked" : props.indeterminate ? "mdi-minus-box" : "mdi-checkbox-blank-outline");
|
|
157
155
|
|
|
158
|
-
const font = computed(():
|
|
156
|
+
const font = computed((): "text-button" | "text-body" => props.modelValue ? "text-button" : "text-body");
|
|
159
157
|
|
|
160
158
|
const messages = computed((): string[] => props.messages ?? getMessages(props.modelValue, props.rules));
|
|
161
159
|
|
package/components/FSChip.vue
CHANGED
|
@@ -44,11 +44,9 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script lang="ts">
|
|
47
|
-
import type
|
|
48
|
-
import { computed, defineComponent } from "vue";
|
|
47
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
49
48
|
|
|
50
|
-
import type
|
|
51
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
49
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
52
50
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
53
51
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
54
52
|
|
|
@@ -107,7 +105,7 @@ export default defineComponent({
|
|
|
107
105
|
const backgrounds = getColors(ColorEnum.Background);
|
|
108
106
|
const darks = getColors(ColorEnum.Dark);
|
|
109
107
|
|
|
110
|
-
const style = computed(():
|
|
108
|
+
const style = computed((): StyleValue => {
|
|
111
109
|
switch (props.variant) {
|
|
112
110
|
case "standard": return {
|
|
113
111
|
"--fs-chip-height" : sizeToVar(props.height),
|
|
@@ -125,13 +123,13 @@ export default defineComponent({
|
|
|
125
123
|
"--fs-chip-height" : sizeToVar(props.height),
|
|
126
124
|
"--fs-chip-background-color" : colors.value.base,
|
|
127
125
|
"--fs-chip-border-color" : colors.value.base,
|
|
128
|
-
"--fs-chip-color" : colors.value.baseContrast
|
|
126
|
+
"--fs-chip-color" : colors.value.baseContrast!,
|
|
129
127
|
"--fs-chip-hover-background-color" : colors.value.base,
|
|
130
128
|
"--fs-chip-hover-border-color" : colors.value.base,
|
|
131
|
-
"--fs-chip-hover-color" : colors.value.baseContrast
|
|
129
|
+
"--fs-chip-hover-color" : colors.value.baseContrast!,
|
|
132
130
|
"--fs-chip-active-background-color": colors.value.dark,
|
|
133
|
-
"--fs-chip-active-border-color" : colors.value.darkContrast
|
|
134
|
-
"--fs-chip-active-color" : colors.value.darkContrast
|
|
131
|
+
"--fs-chip-active-border-color" : colors.value.darkContrast!,
|
|
132
|
+
"--fs-chip-active-color" : colors.value.darkContrast!
|
|
135
133
|
};
|
|
136
134
|
case "borderless": return {
|
|
137
135
|
"--fs-chip-height" : sizeToVar(props.height),
|
|
@@ -157,9 +155,9 @@ export default defineComponent({
|
|
|
157
155
|
});
|
|
158
156
|
|
|
159
157
|
return {
|
|
158
|
+
classes,
|
|
160
159
|
colors,
|
|
161
|
-
style
|
|
162
|
-
classes
|
|
160
|
+
style
|
|
163
161
|
};
|
|
164
162
|
}
|
|
165
163
|
});
|