@dative-gpi/foundation-shared-components 0.0.229 → 0.1.68
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 +9 -10
- package/components/FSButton.vue +81 -31
- package/components/FSCalendar.vue +35 -33
- package/components/FSCalendarTwin.vue +77 -84
- package/components/FSCard.vue +29 -16
- package/components/FSCardPlaceholder.vue +1 -2
- package/components/FSCheckbox.vue +5 -7
- package/components/FSChip.vue +9 -11
- package/components/FSClickable.vue +67 -57
- package/components/FSClock.vue +4 -4
- package/components/FSCol.vue +2 -3
- package/components/FSColor.vue +13 -31
- package/components/FSColorIcon.vue +25 -9
- package/components/FSDialog.vue +1 -2
- package/components/FSDialogFormBody.vue +4 -4
- package/components/FSDialogMenu.vue +2 -4
- package/components/FSDialogMultiFormBody.vue +63 -50
- package/components/FSDialogRemove.vue +1 -0
- package/components/FSDialogSubmit.vue +5 -7
- package/components/FSDivider.vue +7 -9
- package/components/FSEditImage.vue +27 -274
- package/components/FSEditImageUI.vue +303 -0
- package/components/FSErrorToast.vue +3 -4
- package/components/FSFadeOut.vue +18 -13
- package/components/FSGrid.vue +6 -9
- package/components/FSGridMosaic.vue +1 -2
- package/components/FSIcon.vue +7 -8
- package/components/FSIconCard.vue +23 -30
- package/components/FSIconCheck.vue +1 -2
- package/components/FSImage.vue +21 -193
- package/components/FSImageCard.vue +2 -2
- package/components/FSImageUI.vue +212 -0
- package/components/FSLabel.vue +18 -20
- package/components/FSLink.vue +19 -21
- package/components/FSLoader.vue +10 -14
- package/components/FSOptionGroup.vue +58 -12
- package/components/FSPagination.vue +3 -5
- package/components/FSRadio.vue +5 -7
- package/components/FSRadioGroup.vue +2 -4
- package/components/FSRow.vue +3 -4
- package/components/FSSlideGroup.vue +15 -4
- package/components/FSSlider.vue +9 -11
- package/components/FSSpan.vue +11 -9
- package/components/FSSwitch.vue +65 -37
- package/components/FSTab.vue +2 -4
- package/components/FSTabs.vue +36 -16
- package/components/FSTag.vue +23 -14
- package/components/FSTagGroup.vue +3 -5
- package/components/FSText.vue +8 -12
- package/components/FSWindow.vue +11 -5
- package/components/FSWrapGroup.vue +15 -4
- package/components/agenda/FSAgenda.vue +204 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +190 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +162 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +124 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +200 -0
- package/components/agenda/FSMonthAgenda.vue +257 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +328 -0
- package/components/autocompletes/FSAutocompleteLanguage.vue +18 -39
- package/components/autocompletes/FSAutocompleteTimeZone.vue +20 -38
- package/components/buttons/FSButtonCancelMini.vue +1 -0
- package/components/buttons/FSButtonCopy.vue +28 -0
- package/components/buttons/FSButtonCopyIcon.vue +28 -0
- package/components/buttons/FSButtonCopyLabel.vue +27 -0
- package/components/buttons/FSButtonCopyMini.vue +28 -0
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicateMini.vue +1 -0
- package/components/buttons/FSButtonEditMini.vue +1 -0
- package/components/buttons/FSButtonFileMini.vue +1 -0
- package/components/buttons/FSButtonNextMini.vue +1 -0
- package/components/buttons/FSButtonPreviousMini.vue +1 -0
- package/components/buttons/FSButtonRedoMini.vue +1 -0
- package/components/buttons/FSButtonRemoveMini.vue +1 -0
- package/components/buttons/FSButtonSaveMini.vue +1 -0
- package/components/buttons/FSButtonSearchMini.vue +1 -0
- package/components/buttons/FSButtonUndoMini.vue +1 -0
- package/components/buttons/FSButtonUpdateMini.vue +1 -0
- package/components/buttons/FSButtonValidateMini.vue +1 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +20 -49
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +40 -60
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +10 -5
- package/components/deviceOrganisations/FSWorstAlert.vue +19 -13
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -47
- package/components/fields/FSAutocompleteField.vue +501 -323
- package/components/fields/FSAutocompleteTag.vue +100 -0
- package/components/fields/FSBaseField.vue +26 -16
- package/components/fields/FSColorField.vue +63 -55
- package/components/fields/FSCommentField.vue +93 -0
- package/components/fields/FSDateField.vue +2 -2
- package/components/fields/FSDateRangeField.vue +2 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +7 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +2 -3
- package/components/fields/FSMagicConfigField.vue +28 -19
- package/components/fields/FSMagicField.vue +25 -17
- package/components/fields/FSNumberField.vue +9 -7
- package/components/fields/FSPasswordField.vue +2 -3
- package/components/fields/FSRichTextField.vue +32 -5
- package/components/fields/FSSearchField.vue +2 -2
- package/components/fields/FSSelectField.vue +483 -251
- package/components/fields/FSTagField.vue +4 -6
- package/components/fields/FSTermField.vue +25 -13
- package/components/fields/FSTextArea.vue +18 -6
- package/components/fields/FSTextField.vue +13 -10
- package/components/fields/FSTimeField.vue +1 -1
- package/components/fields/FSTimeSlotField.vue +3 -4
- package/components/fields/FSTimeStepField.vue +157 -0
- package/components/fields/FSTranslateField.vue +3 -2
- package/components/fields/FSTranslateRichTextField.vue +4 -3
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/FSTreeViewField.vue +7 -9
- package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicField.vue +131 -0
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
- package/components/lists/FSDataIteratorItem.vue +8 -10
- package/components/lists/FSDataTableUI.vue +47 -39
- package/components/lists/FSFilterButton.vue +20 -22
- package/components/lists/FSHiddenButton.vue +10 -12
- package/components/lists/FSLoadDataTable.vue +4 -6
- package/components/lists/FSSimpleList.vue +229 -0
- package/components/map/FSMap.vue +256 -405
- package/components/map/FSMapFeatureGroup.vue +51 -0
- package/components/map/FSMapLayerButton.vue +6 -3
- package/components/map/FSMapMarker.vue +116 -0
- package/components/map/FSMapMarkerClusterGroup.vue +72 -0
- package/components/map/FSMapOverlay.vue +69 -83
- package/components/map/FSMapPolygon.vue +81 -0
- package/components/map/FSMapTileLayer.vue +50 -0
- package/components/map/keys.ts +4 -0
- package/components/selects/FSSelectAutoRefresh.vue +1 -1
- package/components/selects/FSSelectDashboardVariableType.vue +1 -1
- package/components/selects/FSSelectDateSetting.vue +3 -3
- package/components/selects/FSSelectDays.vue +1 -1
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +67 -0
- package/components/tiles/FSChartTileUI.vue +116 -0
- package/components/tiles/FSCommentTileUI.vue +149 -0
- package/components/tiles/FSDashboardOrganisationTileUI.vue +6 -8
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +6 -8
- package/components/tiles/FSDashboardShallowTileUI.vue +6 -8
- package/components/tiles/FSDeviceOrganisationTileUI.vue +30 -18
- package/components/tiles/FSFolderTileUI.vue +6 -6
- package/components/tiles/FSGroupTileUI.vue +31 -22
- package/components/tiles/FSLoadTile.vue +5 -7
- package/components/tiles/FSLocationTileUI.vue +157 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +142 -0
- package/components/tiles/FSSimpleTileUI.vue +57 -36
- package/components/tiles/FSTile.vue +115 -55
- package/components/tiles/FSUserOrganisationTileUI.vue +25 -35
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSEntityHeader.vue +343 -0
- package/components/views/FSEntityView.vue +163 -0
- package/components/views/FSListHeader.vue +83 -0
- package/components/views/FSListView.vue +83 -0
- package/components/views/FSSkeletonView.vue +100 -0
- package/composables/useAddress.ts +2 -2
- package/composables/useColors.ts +15 -5
- package/composables/useMagicFieldProvider.ts +7 -6
- package/composables/useSlots.ts +51 -28
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +10 -5
- package/models/tables.ts +3 -1
- package/package.json +4 -4
- package/styles/components/fs_agenda.scss +32 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +13 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_clickable.scss +5 -3
- package/styles/components/fs_color_field.scss +1 -0
- package/styles/components/fs_data_table.scss +2 -0
- package/styles/components/fs_dialog.scss +11 -15
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +2 -1
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_magic_config_field.scss +2 -2
- package/styles/components/fs_map.scss +36 -30
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_radio.scss +11 -0
- package/styles/components/fs_rich_text_field.scss +2 -1
- package/styles/components/fs_search_field.scss +3 -0
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_slide_group.scss +5 -0
- package/styles/components/fs_span.scss +2 -1
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +9 -0
- package/styles/components/fs_text_area.scss +15 -1
- package/styles/components/fs_tile.scss +22 -6
- package/styles/components/fs_window.scss +5 -0
- package/styles/components/fs_wrap_group.scss +4 -0
- package/styles/components/index.scss +6 -1
- package/styles/globals/overrides.scss +22 -19
- package/styles/globals/text_fonts.scss +17 -55
- package/tools/alertsTools.ts +54 -0
- package/tools/chartsTools.ts +300 -0
- package/tools/index.ts +2 -0
- package/utils/badge.ts +9 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +8 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +27 -1
- package/components/autocompletes/FSAutocompleteTag.vue +0 -138
- package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
- package/styles/components/fs_map_overlay.scss +0 -38
|
@@ -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,11 +27,9 @@
|
|
|
27
27
|
</template>
|
|
28
28
|
|
|
29
29
|
<script lang="ts">
|
|
30
|
-
import type
|
|
31
|
-
import { defineComponent, ref } from "vue";
|
|
30
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
32
31
|
|
|
33
|
-
import type
|
|
34
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
32
|
+
import { ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
35
33
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
36
34
|
|
|
37
35
|
import FSSpan from "./FSSpan.vue";
|
|
@@ -46,7 +44,8 @@ export default defineComponent({
|
|
|
46
44
|
props: {
|
|
47
45
|
items: {
|
|
48
46
|
type: Array as PropType<FSBreadcrumbItem[]>,
|
|
49
|
-
required:
|
|
47
|
+
required: false,
|
|
48
|
+
default: () => []
|
|
50
49
|
}
|
|
51
50
|
},
|
|
52
51
|
setup() {
|
|
@@ -54,11 +53,11 @@ export default defineComponent({
|
|
|
54
53
|
|
|
55
54
|
const darks = getColors(ColorEnum.Dark);
|
|
56
55
|
|
|
57
|
-
const style
|
|
58
|
-
"--fs-breadcrumbs-color": darks.dark,
|
|
59
|
-
"--fs-breadcrumbs-active-color": darks.base,
|
|
56
|
+
const style = computed((): StyleValue => ({
|
|
57
|
+
"--fs-breadcrumbs-color" : darks.dark,
|
|
58
|
+
"--fs-breadcrumbs-active-color" : darks.base,
|
|
60
59
|
"--fs-breadcrumbs-disabled-color": darks.soft
|
|
61
|
-
});
|
|
60
|
+
}));
|
|
62
61
|
|
|
63
62
|
const classes = (item: FSBreadcrumbItem): string[] => {
|
|
64
63
|
const classNames = ["fs-breadcrumbs-label"];
|
package/components/FSButton.vue
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSClickable
|
|
3
|
-
v-if="
|
|
3
|
+
v-if="$props.variant !== 'icon'"
|
|
4
4
|
:editable="$props.editable"
|
|
5
|
-
:
|
|
5
|
+
:padding="padding"
|
|
6
6
|
:variant="$props.variant"
|
|
7
7
|
:color="$props.color"
|
|
8
8
|
:load="$props.load"
|
|
9
9
|
:href="$props.href"
|
|
10
|
-
:padding="padding"
|
|
11
10
|
:to="$props.to"
|
|
12
11
|
:style="style"
|
|
13
|
-
:width="width"
|
|
14
12
|
@click.stop="onClick"
|
|
15
13
|
v-bind="$attrs"
|
|
16
14
|
>
|
|
17
15
|
<FSRow
|
|
16
|
+
v-if="$props.direction === 'row'"
|
|
18
17
|
align="center-center"
|
|
19
18
|
width="fill"
|
|
20
19
|
:wrap="false"
|
|
@@ -51,6 +50,43 @@
|
|
|
51
50
|
</FSIcon>
|
|
52
51
|
</slot>
|
|
53
52
|
</FSRow>
|
|
53
|
+
<FSCol
|
|
54
|
+
v-else
|
|
55
|
+
align="center-center"
|
|
56
|
+
width="fill"
|
|
57
|
+
>
|
|
58
|
+
<slot
|
|
59
|
+
name="prepend"
|
|
60
|
+
v-bind="{ color: $props.color, colors }"
|
|
61
|
+
>
|
|
62
|
+
<FSIcon
|
|
63
|
+
v-if="$props.prependIcon || $props.icon"
|
|
64
|
+
:size="$props.iconSize"
|
|
65
|
+
>
|
|
66
|
+
{{ $props.prependIcon ?? $props.icon }}
|
|
67
|
+
</FSIcon>
|
|
68
|
+
</slot>
|
|
69
|
+
<slot
|
|
70
|
+
v-bind="{ color: $props.color, colors }"
|
|
71
|
+
>
|
|
72
|
+
<FSSpan
|
|
73
|
+
v-if="$props.label"
|
|
74
|
+
>
|
|
75
|
+
{{ $props.label }}
|
|
76
|
+
</FSSpan>
|
|
77
|
+
</slot>
|
|
78
|
+
<slot
|
|
79
|
+
name="append"
|
|
80
|
+
v-bind="{ color: $props.color, colors }"
|
|
81
|
+
>
|
|
82
|
+
<FSIcon
|
|
83
|
+
v-if="$props.appendIcon"
|
|
84
|
+
:size="$props.iconSize"
|
|
85
|
+
>
|
|
86
|
+
{{ $props.appendIcon }}
|
|
87
|
+
</FSIcon>
|
|
88
|
+
</slot>
|
|
89
|
+
</FSCol>
|
|
54
90
|
</FSClickable>
|
|
55
91
|
<FSRow
|
|
56
92
|
v-else
|
|
@@ -128,28 +164,39 @@
|
|
|
128
164
|
</template>
|
|
129
165
|
|
|
130
166
|
<script lang="ts">
|
|
131
|
-
import type
|
|
132
|
-
import {
|
|
133
|
-
import type { RouteLocation } from "vue-router";
|
|
167
|
+
import { computed, defineComponent, type PropType, type StyleValue, useSlots } from "vue";
|
|
168
|
+
import { type RouteLocation } from "vue-router";
|
|
134
169
|
|
|
135
|
-
import {
|
|
136
|
-
import
|
|
137
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
170
|
+
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
171
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
138
172
|
|
|
139
173
|
import FSClickable from "./FSClickable.vue";
|
|
140
174
|
import FSSpan from "./FSSpan.vue";
|
|
141
175
|
import FSIcon from "./FSIcon.vue";
|
|
176
|
+
import FSCol from "./FSCol.vue";
|
|
142
177
|
import FSRow from "./FSRow.vue";
|
|
143
178
|
|
|
179
|
+
const PADDING_ICON_ONLY = "7px";
|
|
180
|
+
const PADDING_LABEL_ONLY = ["9px 16px", "9px 12px"];
|
|
181
|
+
const PADDING_ICON_LABEL = ["7px 16px", "7px 12px"];
|
|
182
|
+
|
|
183
|
+
const DEFAULT_PADDING = PADDING_ICON_LABEL;
|
|
184
|
+
|
|
144
185
|
export default defineComponent({
|
|
145
186
|
name: "FSButton",
|
|
146
187
|
components: {
|
|
147
188
|
FSClickable,
|
|
148
189
|
FSSpan,
|
|
149
190
|
FSIcon,
|
|
191
|
+
FSCol,
|
|
150
192
|
FSRow
|
|
151
193
|
},
|
|
152
194
|
props: {
|
|
195
|
+
padding: {
|
|
196
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
197
|
+
required: false,
|
|
198
|
+
default: DEFAULT_PADDING
|
|
199
|
+
},
|
|
153
200
|
to: {
|
|
154
201
|
type: [String, Object] as PropType<string | RouteLocation | null>,
|
|
155
202
|
required: false,
|
|
@@ -166,7 +213,7 @@ export default defineComponent({
|
|
|
166
213
|
default: null
|
|
167
214
|
},
|
|
168
215
|
label: {
|
|
169
|
-
type: [String, Function]
|
|
216
|
+
type: [String, Function] as PropType<string | Function | null>,
|
|
170
217
|
required: false,
|
|
171
218
|
default: null
|
|
172
219
|
},
|
|
@@ -183,23 +230,23 @@ export default defineComponent({
|
|
|
183
230
|
iconSize: {
|
|
184
231
|
type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
|
|
185
232
|
required: false,
|
|
186
|
-
default: "
|
|
233
|
+
default: () => ["24px", "20px"]
|
|
187
234
|
},
|
|
188
235
|
variant: {
|
|
189
236
|
type: String as PropType<"standard" | "full" | "icon">,
|
|
190
237
|
required: false,
|
|
191
238
|
default: "standard"
|
|
192
239
|
},
|
|
240
|
+
direction: {
|
|
241
|
+
type: String as PropType<"row" | "column">,
|
|
242
|
+
required: false,
|
|
243
|
+
default: "row"
|
|
244
|
+
},
|
|
193
245
|
color: {
|
|
194
246
|
type: String as PropType<ColorBase>,
|
|
195
247
|
required: false,
|
|
196
248
|
default: ColorEnum.Light
|
|
197
249
|
},
|
|
198
|
-
fullWidth: {
|
|
199
|
-
type: Boolean,
|
|
200
|
-
required: false,
|
|
201
|
-
default: false
|
|
202
|
-
},
|
|
203
250
|
load: {
|
|
204
251
|
type: Boolean,
|
|
205
252
|
required: false,
|
|
@@ -214,13 +261,13 @@ export default defineComponent({
|
|
|
214
261
|
emits: ["click"],
|
|
215
262
|
setup(props, { emit }) {
|
|
216
263
|
const { getColors } = useColors();
|
|
217
|
-
const { slots } = useSlots();
|
|
218
264
|
|
|
219
265
|
const colors = computed(() => getColors(props.color));
|
|
220
266
|
const lights = getColors(ColorEnum.Light);
|
|
221
267
|
const darks = getColors(ColorEnum.Dark);
|
|
268
|
+
const slots = useSlots();
|
|
222
269
|
|
|
223
|
-
const style = computed(():
|
|
270
|
+
const style = computed((): StyleValue => {
|
|
224
271
|
if (!props.editable) {
|
|
225
272
|
switch (props.variant) {
|
|
226
273
|
case "icon": return {
|
|
@@ -262,19 +309,23 @@ export default defineComponent({
|
|
|
262
309
|
}
|
|
263
310
|
});
|
|
264
311
|
|
|
265
|
-
const padding = computed(()
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
case "full": return (!slots.default && !props.label) ? "0 7px" : "0 16px";
|
|
269
|
-
default: return "0px";
|
|
312
|
+
const padding = computed(() => {
|
|
313
|
+
if (props.padding !== DEFAULT_PADDING) {
|
|
314
|
+
return props.padding;
|
|
270
315
|
}
|
|
271
|
-
});
|
|
272
316
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
317
|
+
const hasIcon = props.prependIcon || props.appendIcon || props.icon
|
|
318
|
+
|| !!slots.prepend || !!slots.append;
|
|
319
|
+
|
|
320
|
+
const hasLabel = props.label || !!slots.default;
|
|
321
|
+
|
|
322
|
+
if (!hasLabel && hasIcon) {
|
|
323
|
+
return PADDING_ICON_ONLY;
|
|
276
324
|
}
|
|
277
|
-
|
|
325
|
+
else if (hasLabel && !hasIcon) {
|
|
326
|
+
return PADDING_LABEL_ONLY;
|
|
327
|
+
}
|
|
328
|
+
return DEFAULT_PADDING;
|
|
278
329
|
});
|
|
279
330
|
|
|
280
331
|
const onClick = (event: MouseEvent) => {
|
|
@@ -286,10 +337,9 @@ export default defineComponent({
|
|
|
286
337
|
return {
|
|
287
338
|
iconClasses,
|
|
288
339
|
loadColor,
|
|
289
|
-
padding,
|
|
290
340
|
colors,
|
|
291
341
|
style,
|
|
292
|
-
|
|
342
|
+
padding,
|
|
293
343
|
onClick
|
|
294
344
|
};
|
|
295
345
|
}
|
|
@@ -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
|
-
import {
|
|
72
|
-
import type
|
|
73
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
70
|
+
import { useDateFormat, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
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";
|
|
@@ -110,30 +108,28 @@ export default defineComponent({
|
|
|
110
108
|
},
|
|
111
109
|
emits: ["update:modelValue"],
|
|
112
110
|
setup(props, { emit }) {
|
|
113
|
-
const { epochToPicker, pickerToEpoch, todayToEpoch } =
|
|
111
|
+
const { epochToPicker, pickerToEpoch, todayToEpoch } = useDateFormat();
|
|
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
|
-
import {
|
|
119
|
-
import type
|
|
120
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
117
|
+
import { useDateFormat, useAppLanguageCode } from "@dative-gpi/foundation-shared-services/composables";
|
|
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";
|
|
@@ -157,13 +155,9 @@ export default defineComponent({
|
|
|
157
155
|
},
|
|
158
156
|
emits: ["update:modelValue"],
|
|
159
157
|
setup(props, { emit }) {
|
|
160
|
-
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } =
|
|
158
|
+
const { epochToPicker, epochToPickerHeader, pickerToEpoch, todayToEpoch } = useDateFormat();
|
|
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,
|