@dative-gpi/foundation-shared-components 1.0.56 → 1.0.58-groupings
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/assets/images/map/snow.png +0 -0
- package/components/FSAccordionPanel.vue +40 -21
- package/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +16 -16
- package/components/FSCalendar.vue +50 -12
- package/components/FSCalendarTwin.vue +95 -43
- package/components/FSCard.vue +61 -9
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSCheckbox.vue +5 -4
- package/components/FSChip.vue +73 -45
- package/components/FSChipGroup.vue +69 -0
- package/components/FSClickable.vue +11 -9
- package/components/FSClock.vue +30 -12
- package/components/FSCol.vue +11 -5
- package/components/FSColorIcon.vue +23 -5
- package/components/FSDialog.vue +2 -1
- package/components/FSDialogContent.vue +12 -11
- package/components/FSDialogForm.vue +22 -2
- package/components/FSDialogFormBody.vue +50 -31
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +79 -56
- package/components/FSDialogRemove.vue +7 -8
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImage.vue +1 -1
- package/components/FSEditImageUI.vue +20 -10
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +1 -1
- package/components/FSIcon.vue +4 -3
- package/components/FSIconCard.vue +68 -12
- package/components/FSImage.vue +9 -2
- package/components/FSImageUI.vue +8 -15
- package/components/FSInformationsMenu.vue +142 -0
- package/components/FSInstantPicker.vue +269 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -10
- package/components/FSMenu.vue +47 -0
- package/components/FSOptionGroup.vue +57 -9
- package/components/FSOptionItem.vue +4 -4
- package/components/FSPagination.vue +1 -1
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRadio.vue +5 -4
- package/components/FSRadioGroup.vue +3 -3
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSlider.vue +6 -5
- package/components/FSSpan.vue +12 -7
- package/components/FSSwitch.vue +47 -21
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +16 -5
- package/components/FSTagGroup.vue +4 -4
- package/components/FSText.vue +11 -7
- package/components/FSToggleSet.vue +7 -7
- package/components/FSWindow.vue +122 -5
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +50 -37
- package/components/agenda/FSAgendaDialogCalendar.vue +2 -2
- package/components/agenda/FSAgendaHeader.vue +35 -10
- package/components/agenda/FSAgendaHorizontalEvent.vue +18 -6
- package/components/agenda/FSAgendaHoursRow.vue +48 -8
- package/components/agenda/FSAgendaVerticalEvent.vue +1 -1
- package/components/agenda/FSDayAgenda.vue +1 -2
- package/components/agenda/FSMonthAgenda.vue +3 -9
- package/components/agenda/FSSelectAgendaMode.vue +2 -2
- package/components/agenda/FSWeekAgenda.vue +7 -13
- package/components/autocompletes/FSAutoCompleteAddress.vue +25 -20
- package/components/autocompletes/FSAutocompleteLanguage.vue +7 -1
- package/components/autocompletes/FSAutocompleteTimeZone.vue +7 -1
- package/components/buttons/FSButtonAdd.vue +1 -1
- package/components/buttons/FSButtonAddLabel.vue +1 -1
- package/components/buttons/FSButtonCancel.vue +1 -1
- package/components/buttons/FSButtonCancelLabel.vue +1 -1
- package/components/buttons/FSButtonCheckbox.vue +4 -4
- package/components/buttons/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- package/components/buttons/FSButtonDuplicate.vue +1 -1
- package/components/buttons/FSButtonDuplicateLabel.vue +1 -1
- package/components/buttons/FSButtonEdit.vue +1 -1
- package/components/buttons/FSButtonEditLabel.vue +1 -1
- package/components/buttons/FSButtonFile.vue +1 -1
- package/components/buttons/FSButtonFileLabel.vue +1 -1
- package/components/buttons/FSButtonNext.vue +1 -1
- package/components/buttons/FSButtonNextLabel.vue +1 -1
- package/components/buttons/FSButtonPrevious.vue +1 -1
- package/components/buttons/FSButtonPreviousLabel.vue +1 -1
- package/components/buttons/FSButtonRedo.vue +1 -1
- package/components/buttons/FSButtonRedoLabel.vue +1 -1
- package/components/buttons/FSButtonRemove.vue +1 -1
- package/components/buttons/FSButtonRemoveLabel.vue +1 -1
- package/components/buttons/FSButtonSave.vue +1 -1
- package/components/buttons/FSButtonSaveLabel.vue +1 -1
- package/components/buttons/FSButtonSearch.vue +1 -1
- package/components/buttons/FSButtonSearchLabel.vue +1 -1
- package/components/buttons/FSButtonUndo.vue +1 -1
- package/components/buttons/FSButtonUndoLabel.vue +1 -1
- package/components/buttons/FSButtonUpdate.vue +1 -1
- package/components/buttons/FSButtonUpdateLabel.vue +1 -1
- package/components/buttons/FSButtonValidate.vue +1 -1
- package/components/buttons/FSButtonValidateLabel.vue +1 -1
- package/components/calendar/FSSimpleCalendar.vue +145 -0
- package/components/calendar/FSSimpleCalendarHeader.vue +60 -0
- package/components/calendar/FSSimpleMonthSelector.vue +138 -0
- package/components/deviceOrganisations/FSConnectivity.vue +16 -4
- package/components/deviceOrganisations/FSConnectivityCard.vue +17 -45
- package/components/deviceOrganisations/FSStatus.vue +16 -4
- package/components/deviceOrganisations/FSStatusCard.vue +33 -59
- package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +8 -2
- package/components/deviceOrganisations/FSWorstAlert.vue +37 -42
- package/components/deviceOrganisations/FSWorstAlertCard.vue +35 -84
- package/components/fields/FSAutocompleteField.vue +85 -82
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +54 -30
- package/components/fields/FSClosableSearchField.vue +83 -0
- package/components/fields/FSColorField.vue +48 -44
- package/components/fields/FSCommentField.vue +28 -16
- package/components/fields/FSDateField.vue +13 -10
- package/components/fields/FSDateRangeField.vue +6 -5
- package/components/fields/FSDateTimeField.vue +14 -11
- package/components/fields/FSDateTimeRangeDialog.vue +160 -0
- package/components/fields/FSDateTimeRangeField.vue +23 -115
- package/components/fields/FSEntityFieldUI.vue +36 -19
- package/components/fields/FSGradientField.vue +5 -5
- package/components/fields/FSIconField.vue +16 -9
- package/components/fields/FSMagicConfigField.vue +15 -7
- package/components/fields/FSMagicField.vue +7 -2
- package/components/fields/FSNumberField.vue +9 -4
- package/components/fields/FSPasswordField.vue +7 -7
- package/components/fields/FSRichTextField.vue +78 -58
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +69 -71
- package/components/fields/FSTagField.vue +10 -10
- package/components/fields/FSTermField.vue +72 -47
- package/components/fields/FSTextArea.vue +17 -11
- package/components/fields/FSTextField.vue +15 -10
- package/components/fields/FSTimeField.vue +14 -10
- package/components/fields/FSTimeRangeField.vue +310 -0
- package/components/fields/FSTimeStepField.vue +5 -5
- package/components/fields/FSTranslateField.vue +10 -10
- package/components/fields/FSTranslateRichTextField.vue +41 -20
- package/components/fields/FSTranslateTextArea.vue +10 -10
- package/components/fields/FSTreeViewField.vue +15 -13
- package/components/fields/periodicField/FSPeriodicDailyField.vue +7 -7
- package/components/fields/periodicField/FSPeriodicField.vue +15 -15
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +16 -16
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +28 -18
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +12 -12
- package/components/lists/FSDataIteratorItem.vue +23 -67
- package/components/lists/FSDataTableUI.vue +220 -137
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +14 -16
- package/components/lists/FSHeaderButton.vue +11 -9
- package/components/lists/FSHiddenButton.vue +9 -9
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +96 -102
- package/components/lists/FSSimpleListItem.vue +131 -0
- package/components/map/FSMap.vue +146 -158
- package/components/map/FSMapFeatureGroup.vue +7 -1
- package/components/map/FSMapLayerButton.vue +4 -3
- package/components/map/FSMapMarker.vue +70 -48
- package/components/map/FSMapMarkerClusterGroup.vue +32 -7
- package/components/map/FSMapOverlay.vue +44 -24
- package/components/map/FSMapPolygon.vue +16 -4
- package/components/map/FSMapTileLayer.vue +26 -9
- package/components/map/layers.ts +0 -0
- package/components/selects/FSSelectAutoRefresh.vue +8 -8
- package/components/selects/FSSelectDashboardVariableType.vue +4 -3
- package/components/selects/FSSelectDateSetting.vue +2 -2
- package/components/selects/FSSelectDays.vue +8 -8
- package/components/selects/FSSelectListMode.vue +2 -2
- package/components/selects/FSSelectMapLayer.vue +68 -0
- package/components/selects/FSSelectMonths.vue +13 -13
- package/components/selects/chartSelectors/FSAggregationSelector.vue +52 -0
- package/components/selects/chartSelectors/FSAxisTypeSelector.vue +49 -0
- package/components/selects/chartSelectors/FSDisplayAsSelector.vue +53 -0
- package/components/selects/chartSelectors/FSFilterTypeSelector.vue +54 -0
- package/components/selects/chartSelectors/FSHeatmapRuleSelector.vue +54 -0
- package/components/selects/chartSelectors/FSOperationOnSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlanningTypeSelector.vue +53 -0
- package/components/selects/chartSelectors/FSPlotPerSelector.vue +52 -0
- package/components/selects/chartSelectors/FSSelectEntityType.vue +59 -0
- package/components/selects/chartSelectors/FSSerieTypeSelector.vue +53 -0
- package/components/tiles/FSAlertTileUI.vue +90 -0
- package/components/tiles/FSChartTileUI.vue +61 -52
- package/components/tiles/FSCommentTileUI.vue +38 -13
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +14 -2
- package/components/tiles/FSDashboardShallowTileUI.vue +14 -2
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -6
- package/components/tiles/FSGroupTileUI.vue +58 -110
- package/components/tiles/FSGroupingTileUI.vue +115 -0
- package/components/tiles/FSLoadTile.vue +16 -10
- package/components/tiles/FSLocationTileUI.vue +63 -55
- package/components/tiles/FSModelTileUI.vue +5 -46
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
- package/components/tiles/FSSimpleTileUI.vue +34 -29
- package/components/tiles/FSTile.vue +46 -39
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -140
- package/components/views/FSSimpleView.vue +29 -0
- package/components/views/desktop/FSBaseDefaultDesktopView.vue +135 -0
- package/components/views/desktop/FSBaseDesktopView.vue +53 -0
- package/components/views/desktop/FSBaseEntityDesktopView.vue +211 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +206 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/index.ts +1 -0
- package/composables/useAddress.ts +40 -8
- package/composables/useBreakpoints.ts +40 -4
- package/composables/useColors.ts +16 -7
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useMapLayers.ts +62 -0
- package/composables/useSlots.ts +2 -1
- package/models/colors.ts +2 -1
- package/models/deviceAlerts.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +12 -10
- package/models/rules.ts +6 -3
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +4 -0
- package/styles/components/fs_agenda_event.scss +1 -1
- package/styles/components/fs_agenda_hours_row.scss +0 -8
- package/styles/components/fs_autocomplete_field.scss +0 -13
- package/styles/components/fs_breadcrumbs.scss +18 -36
- package/styles/components/fs_button.scss +7 -5
- package/styles/components/fs_calendar.scss +1 -0
- package/styles/components/fs_card.scss +9 -0
- package/styles/components/fs_chip.scss +13 -7
- package/styles/components/fs_clickable.scss +16 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_col.scss +1 -1
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +4 -10
- package/styles/components/fs_dialog_menu.scss +4 -2
- package/styles/components/fs_draggable.scss +0 -5
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_hidden_button.scss +2 -7
- package/styles/components/fs_image_card.scss +6 -4
- package/styles/components/fs_magic_config_field.scss +1 -2
- package/styles/components/fs_map.scss +57 -17
- package/styles/components/fs_meta_field.scss +3 -5
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_password_field.scss +4 -2
- package/styles/components/fs_progress_bar.scss +14 -0
- package/styles/components/fs_radio.scss +0 -11
- package/styles/components/fs_rich_text_field.scss +1 -10
- package/styles/components/fs_select_field.scss +4 -13
- package/styles/components/fs_slide_group.scss +7 -0
- package/styles/components/fs_span.scss +13 -5
- package/styles/components/fs_status_rich_card.scss +6 -0
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +19 -33
- package/styles/components/fs_tag.scss +8 -22
- package/styles/components/fs_text_area.scss +2 -21
- package/styles/components/fs_tile.scss +0 -19
- package/styles/components/fs_window.scss +3 -1
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +2 -6
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +28 -61
- package/styles/globals/scrollbars.scss +8 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/styles/globals/touchscreen.scss +2 -2
- package/tools/alertsTools.ts +87 -12
- package/tools/chartsTools.ts +143 -16
- package/tools/index.ts +3 -1
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/badge.ts +9 -5
- package/utils/filter.ts +7 -4
- package/utils/index.ts +1 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +108 -0
- package/utils/sort.ts +2 -2
- package/utils/time.ts +16 -16
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -350
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/styles/components/fs_data_iterator_item.scss +0 -33
- package/styles/components/fs_icon_field.scss +0 -12
- package/styles/components/fs_search_field.scss +0 -3
- package/styles/components/fs_tag_field.scss +0 -8
- package/styles/components/fs_time_field.scss +0 -12
- package/styles/components/fs_timeslot_field.scss +0 -12
- package/styles/globals/breakpoints.scss +0 -20
- package/styles/globals/fixes.scss +0 -5
|
Binary file
|
|
@@ -6,32 +6,47 @@
|
|
|
6
6
|
:disabled="false"
|
|
7
7
|
:elevation="0"
|
|
8
8
|
:style="style"
|
|
9
|
+
:hideActions="$props.actionPosition === 'start'"
|
|
9
10
|
v-bind="$attrs"
|
|
10
11
|
>
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
<slot
|
|
15
|
-
name="title"
|
|
12
|
+
<v-expansion-panel-title>
|
|
13
|
+
<template
|
|
14
|
+
v-slot:default="{ expanded, collapseIcon, expandIcon }"
|
|
16
15
|
>
|
|
17
|
-
<FSRow
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
<FSRow
|
|
17
|
+
gap="4px"
|
|
18
|
+
>
|
|
19
|
+
<FSCol
|
|
20
|
+
v-if="$props.actionPosition === 'start'"
|
|
21
|
+
width="hug"
|
|
22
|
+
align="center-center"
|
|
20
23
|
>
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
<FSIcon
|
|
25
|
+
size="22.5px"
|
|
26
|
+
:icon="expanded ? collapseIcon : expandIcon"
|
|
27
|
+
/>
|
|
28
|
+
</FSCol>
|
|
29
|
+
<slot
|
|
30
|
+
name="title"
|
|
26
31
|
>
|
|
27
|
-
|
|
28
|
-
|
|
32
|
+
<FSRow>
|
|
33
|
+
<FSIcon
|
|
34
|
+
v-if="$props.prependIcon"
|
|
35
|
+
>
|
|
36
|
+
{{ $props.prependIcon }}
|
|
37
|
+
</FSIcon>
|
|
38
|
+
<FSSpan
|
|
39
|
+
class="fs-accordion-panel-title"
|
|
40
|
+
:lineClamp="$props.lineClampTitle"
|
|
41
|
+
>
|
|
42
|
+
{{ $props.title }}
|
|
43
|
+
</FSSpan>
|
|
44
|
+
</FSRow>
|
|
45
|
+
</slot>
|
|
29
46
|
</FSRow>
|
|
30
|
-
</
|
|
31
|
-
</
|
|
32
|
-
<
|
|
33
|
-
#text
|
|
34
|
-
>
|
|
47
|
+
</template>
|
|
48
|
+
</v-expansion-panel-title>
|
|
49
|
+
<v-expansion-panel-text>
|
|
35
50
|
<slot
|
|
36
51
|
name="content"
|
|
37
52
|
>
|
|
@@ -47,7 +62,7 @@
|
|
|
47
62
|
:modelValue="$props.content"
|
|
48
63
|
/>
|
|
49
64
|
</slot>
|
|
50
|
-
</
|
|
65
|
+
</v-expansion-panel-text>
|
|
51
66
|
</v-expansion-panel>
|
|
52
67
|
</template>
|
|
53
68
|
|
|
@@ -128,6 +143,10 @@ export default defineComponent({
|
|
|
128
143
|
type: String as PropType<"standard" | "rich-text">,
|
|
129
144
|
required: false,
|
|
130
145
|
default: "standard"
|
|
146
|
+
},
|
|
147
|
+
actionPosition: {
|
|
148
|
+
type: String as () => "start" | "end",
|
|
149
|
+
default: "end"
|
|
131
150
|
}
|
|
132
151
|
},
|
|
133
152
|
setup(props) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<v-breadcrumbs
|
|
3
|
-
|
|
3
|
+
class="fs-breadcrumbs"
|
|
4
|
+
:items="items"
|
|
4
5
|
:style="style"
|
|
5
6
|
v-bind="$attrs"
|
|
6
7
|
>
|
|
@@ -8,7 +9,7 @@
|
|
|
8
9
|
#title="{ item }"
|
|
9
10
|
>
|
|
10
11
|
<FSSpan
|
|
11
|
-
|
|
12
|
+
class="fs-breadcrumbs-label"
|
|
12
13
|
>
|
|
13
14
|
{{ item.title }}
|
|
14
15
|
</FSSpan>
|
|
@@ -30,7 +31,9 @@
|
|
|
30
31
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
31
32
|
|
|
32
33
|
import { ColorEnum, type FSBreadcrumbItem } from "@dative-gpi/foundation-shared-components/models";
|
|
33
|
-
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
34
|
+
import { useBreakpoints, useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
35
|
+
|
|
36
|
+
import { sizeToVar } from "../utils";
|
|
34
37
|
|
|
35
38
|
import FSSpan from "./FSSpan.vue";
|
|
36
39
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -48,28 +51,34 @@ export default defineComponent({
|
|
|
48
51
|
default: () => []
|
|
49
52
|
}
|
|
50
53
|
},
|
|
51
|
-
setup() {
|
|
54
|
+
setup(props) {
|
|
55
|
+
const { isExtraSmall } = useBreakpoints();
|
|
52
56
|
const { getColors } = useColors();
|
|
53
57
|
|
|
54
58
|
const darks = getColors(ColorEnum.Dark);
|
|
55
59
|
|
|
56
60
|
const style = computed((): StyleValue => ({
|
|
61
|
+
"--fs-breadcrumbs-height" : sizeToVar(["20px", "16px"]),
|
|
57
62
|
"--fs-breadcrumbs-color" : darks.dark,
|
|
58
63
|
"--fs-breadcrumbs-active-color" : darks.base,
|
|
59
64
|
"--fs-breadcrumbs-disabled-color": darks.soft
|
|
60
65
|
}));
|
|
61
66
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
67
|
+
const items = computed((): FSBreadcrumbItem[] => {
|
|
68
|
+
if (isExtraSmall.value && props.items.length > 3) {
|
|
69
|
+
const mobileItems: FSBreadcrumbItem[] = [0, -2, -1].map((index) => props.items.at(index)!)
|
|
70
|
+
mobileItems.splice(1, 0, {
|
|
71
|
+
title : "...",
|
|
72
|
+
disabled : true
|
|
73
|
+
});
|
|
74
|
+
return mobileItems;
|
|
66
75
|
}
|
|
67
|
-
return
|
|
68
|
-
};
|
|
76
|
+
return props.items;
|
|
77
|
+
});
|
|
69
78
|
|
|
70
79
|
return {
|
|
71
|
-
|
|
72
|
-
|
|
80
|
+
items,
|
|
81
|
+
style
|
|
73
82
|
};
|
|
74
83
|
}
|
|
75
84
|
});
|
package/components/FSButton.vue
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSClickable
|
|
3
3
|
v-if="$props.variant !== 'icon'"
|
|
4
|
-
:
|
|
4
|
+
:disabled="$props.disabled"
|
|
5
5
|
:padding="padding"
|
|
6
6
|
:variant="$props.variant"
|
|
7
7
|
:color="$props.color"
|
|
@@ -129,7 +129,7 @@
|
|
|
129
129
|
<template
|
|
130
130
|
v-else-if="$props.to"
|
|
131
131
|
>
|
|
132
|
-
<
|
|
132
|
+
<FSRouterLink
|
|
133
133
|
:to="$props.to"
|
|
134
134
|
>
|
|
135
135
|
<FSIcon
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
>
|
|
144
144
|
{{ $props.label }}
|
|
145
145
|
</FSSpan>
|
|
146
|
-
</
|
|
146
|
+
</FSRouterLink>
|
|
147
147
|
</template>
|
|
148
148
|
<template
|
|
149
149
|
v-else
|
|
@@ -170,6 +170,7 @@ import { type RouteLocation } from "vue-router";
|
|
|
170
170
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
171
171
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
172
172
|
|
|
173
|
+
import FSRouterLink from "./FSRouterLink.vue";
|
|
173
174
|
import FSClickable from "./FSClickable.vue";
|
|
174
175
|
import FSSpan from "./FSSpan.vue";
|
|
175
176
|
import FSIcon from "./FSIcon.vue";
|
|
@@ -185,6 +186,7 @@ const DEFAULT_PADDING = PADDING_ICON_LABEL;
|
|
|
185
186
|
export default defineComponent({
|
|
186
187
|
name: "FSButton",
|
|
187
188
|
components: {
|
|
189
|
+
FSRouterLink,
|
|
188
190
|
FSClickable,
|
|
189
191
|
FSSpan,
|
|
190
192
|
FSIcon,
|
|
@@ -198,7 +200,7 @@ export default defineComponent({
|
|
|
198
200
|
default: DEFAULT_PADDING
|
|
199
201
|
},
|
|
200
202
|
to: {
|
|
201
|
-
type:
|
|
203
|
+
type: Object as PropType<RouteLocation | null>,
|
|
202
204
|
required: false,
|
|
203
205
|
default: null
|
|
204
206
|
},
|
|
@@ -230,7 +232,7 @@ export default defineComponent({
|
|
|
230
232
|
iconSize: {
|
|
231
233
|
type: [Array, String, Number] as PropType<"s" | "m" | "l" | string[] | number[] | string | number | null>,
|
|
232
234
|
required: false,
|
|
233
|
-
default: () => ["
|
|
235
|
+
default: () => ["24px", "20px"]
|
|
234
236
|
},
|
|
235
237
|
variant: {
|
|
236
238
|
type: String as PropType<"standard" | "full" | "icon">,
|
|
@@ -252,10 +254,10 @@ export default defineComponent({
|
|
|
252
254
|
required: false,
|
|
253
255
|
default: false
|
|
254
256
|
},
|
|
255
|
-
|
|
257
|
+
disabled: {
|
|
256
258
|
type: Boolean,
|
|
257
259
|
required: false,
|
|
258
|
-
default:
|
|
260
|
+
default: false
|
|
259
261
|
}
|
|
260
262
|
},
|
|
261
263
|
emits: ["click"],
|
|
@@ -268,7 +270,7 @@ export default defineComponent({
|
|
|
268
270
|
const slots = useSlots();
|
|
269
271
|
|
|
270
272
|
const style = computed((): StyleValue => {
|
|
271
|
-
if (
|
|
273
|
+
if (props.disabled) {
|
|
272
274
|
switch (props.variant) {
|
|
273
275
|
case "icon": return {
|
|
274
276
|
"--fs-button-color": lights.dark,
|
|
@@ -293,7 +295,7 @@ export default defineComponent({
|
|
|
293
295
|
|
|
294
296
|
const iconClasses = computed((): string[] => {
|
|
295
297
|
const classNames = ["fs-button-icon"];
|
|
296
|
-
if (
|
|
298
|
+
if (props.disabled) {
|
|
297
299
|
classNames.push("fs-button-disabled");
|
|
298
300
|
}
|
|
299
301
|
return classNames;
|
|
@@ -310,7 +312,7 @@ export default defineComponent({
|
|
|
310
312
|
});
|
|
311
313
|
|
|
312
314
|
const padding = computed(() => {
|
|
313
|
-
if(props.padding !== DEFAULT_PADDING){
|
|
315
|
+
if (props.padding !== DEFAULT_PADDING) {
|
|
314
316
|
return props.padding;
|
|
315
317
|
}
|
|
316
318
|
|
|
@@ -319,19 +321,17 @@ export default defineComponent({
|
|
|
319
321
|
|
|
320
322
|
const hasLabel = props.label || !!slots.default;
|
|
321
323
|
|
|
322
|
-
if(!hasLabel && hasIcon){
|
|
324
|
+
if (!hasLabel && hasIcon) {
|
|
323
325
|
return PADDING_ICON_ONLY;
|
|
324
326
|
}
|
|
325
|
-
else if(hasLabel && !hasIcon)
|
|
326
|
-
{
|
|
327
|
+
else if (hasLabel && !hasIcon) {
|
|
327
328
|
return PADDING_LABEL_ONLY;
|
|
328
329
|
}
|
|
329
|
-
|
|
330
330
|
return DEFAULT_PADDING;
|
|
331
|
-
})
|
|
331
|
+
});
|
|
332
332
|
|
|
333
333
|
const onClick = (event: MouseEvent) => {
|
|
334
|
-
if (!props.to && !props.href && props.
|
|
334
|
+
if (!props.to && !props.href && !props.disabled && !props.load) {
|
|
335
335
|
emit("click", event);
|
|
336
336
|
}
|
|
337
337
|
};
|
|
@@ -3,13 +3,20 @@
|
|
|
3
3
|
width="hug"
|
|
4
4
|
>
|
|
5
5
|
<FSRow>
|
|
6
|
-
<
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
<FSSelectField
|
|
7
|
+
:hideHeader="true"
|
|
8
|
+
:clearable="false"
|
|
9
|
+
:items="years"
|
|
10
|
+
v-model="innerYear"
|
|
11
|
+
/>
|
|
12
|
+
<FSRow
|
|
13
|
+
align="center-right"
|
|
10
14
|
>
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
<FSButton
|
|
16
|
+
:label="$tr('ui.common.today', 'Today')"
|
|
17
|
+
@click="onClickToday"
|
|
18
|
+
/>
|
|
19
|
+
</FSRow>
|
|
13
20
|
</FSRow>
|
|
14
21
|
<FSCol
|
|
15
22
|
class="fs-calendar"
|
|
@@ -71,6 +78,7 @@ import { useDateFormat, useAppLanguageCode } from "@dative-gpi/foundation-shared
|
|
|
71
78
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
72
79
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
73
80
|
|
|
81
|
+
import FSSelectField from "./fields/FSSelectField.vue";
|
|
74
82
|
import FSButton from "./FSButton.vue";
|
|
75
83
|
import FSSpan from "./FSSpan.vue";
|
|
76
84
|
import FSCol from "./FSCol.vue";
|
|
@@ -79,17 +87,13 @@ import FSRow from "./FSRow.vue";
|
|
|
79
87
|
export default defineComponent({
|
|
80
88
|
name: "FSCalendar",
|
|
81
89
|
components: {
|
|
90
|
+
FSSelectField,
|
|
82
91
|
FSButton,
|
|
83
92
|
FSSpan,
|
|
84
93
|
FSCol,
|
|
85
94
|
FSRow
|
|
86
95
|
},
|
|
87
96
|
props: {
|
|
88
|
-
label: {
|
|
89
|
-
type: String as PropType<string | null>,
|
|
90
|
-
required: false,
|
|
91
|
-
default: null
|
|
92
|
-
},
|
|
93
97
|
modelValue: {
|
|
94
98
|
type: Number as PropType<number | null>,
|
|
95
99
|
required: false,
|
|
@@ -117,13 +121,14 @@ export default defineComponent({
|
|
|
117
121
|
|
|
118
122
|
const colors = computed(() => getColors(props.color));
|
|
119
123
|
const backgrounds = getColors(ColorEnum.Background);
|
|
124
|
+
const lights = getColors(ColorEnum.Light);
|
|
120
125
|
const darks = getColors(ColorEnum.Dark);
|
|
121
126
|
|
|
122
127
|
const style = computed((): StyleValue => ({
|
|
123
128
|
"--fs-calendar-background-color" : backgrounds.base,
|
|
124
129
|
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
125
130
|
"--fs-calendar-active-background-color": colors.value.base,
|
|
126
|
-
"--fs-calendar-border-color" :
|
|
131
|
+
"--fs-calendar-border-color" : lights.dark,
|
|
127
132
|
"--fs-calendar-hover-border-color" : colors.value.base,
|
|
128
133
|
"--fs-calendar-active-border-color" : colors.value.base,
|
|
129
134
|
"--fs-calendar-color" : darks.base,
|
|
@@ -138,6 +143,28 @@ export default defineComponent({
|
|
|
138
143
|
return new Intl.DateTimeFormat(languageCode.value, { month: "long", year: "numeric" }).format(date);
|
|
139
144
|
});
|
|
140
145
|
|
|
146
|
+
const years = computed((): any[] => {
|
|
147
|
+
const years = [];
|
|
148
|
+
switch (props.limit) {
|
|
149
|
+
case "past":
|
|
150
|
+
for (let i = 1900; i < new Date().getFullYear(); i++) {
|
|
151
|
+
years.push({ label: i.toString(), id: i });
|
|
152
|
+
}
|
|
153
|
+
break;
|
|
154
|
+
case "future":
|
|
155
|
+
for (let i = new Date().getFullYear(); i < 2100; i++) {
|
|
156
|
+
years.push({ label: i.toString(), id: i });
|
|
157
|
+
}
|
|
158
|
+
break;
|
|
159
|
+
default:
|
|
160
|
+
for (let i = 1900; i < 2100; i++) {
|
|
161
|
+
years.push({ label: i.toString(), id: i });
|
|
162
|
+
}
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
return years;
|
|
166
|
+
});
|
|
167
|
+
|
|
141
168
|
const onClickPrevious = (): void => {
|
|
142
169
|
if (innerMonth.value > 0) {
|
|
143
170
|
innerMonth.value--;
|
|
@@ -165,6 +192,15 @@ export default defineComponent({
|
|
|
165
192
|
emit("update:modelValue", pickerToEpoch(value[0]));
|
|
166
193
|
};
|
|
167
194
|
|
|
195
|
+
const onClickToday = (): void => {
|
|
196
|
+
const today = new Date();
|
|
197
|
+
innerMonth.value = today.getMonth();
|
|
198
|
+
innerYear.value = today.getFullYear();
|
|
199
|
+
|
|
200
|
+
today.setHours(0, 0, 0, 0);
|
|
201
|
+
emit("update:modelValue", pickerToEpoch(today));
|
|
202
|
+
};
|
|
203
|
+
|
|
168
204
|
const allowedDates = (value: unknown): boolean => {
|
|
169
205
|
if (!(value instanceof Date)) {
|
|
170
206
|
return false;
|
|
@@ -190,11 +226,13 @@ export default defineComponent({
|
|
|
190
226
|
text,
|
|
191
227
|
innerMonth,
|
|
192
228
|
innerYear,
|
|
229
|
+
years,
|
|
193
230
|
epochToPicker,
|
|
194
231
|
pickerToEpoch,
|
|
195
232
|
onClickPrevious,
|
|
196
233
|
onClickNext,
|
|
197
234
|
onClickDate,
|
|
235
|
+
onClickToday,
|
|
198
236
|
allowedDates
|
|
199
237
|
};
|
|
200
238
|
}
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<FSCol
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
<FSCol>
|
|
3
|
+
<FSRow>
|
|
4
|
+
<FSSelectField
|
|
5
|
+
:hideHeader="true"
|
|
6
|
+
:clearable="false"
|
|
7
|
+
:items="years"
|
|
8
|
+
:modelValue="innerLeftYear"
|
|
9
|
+
@update:modelValue="onChangeYear"
|
|
10
|
+
/>
|
|
11
|
+
<FSRow
|
|
12
|
+
align="center-right"
|
|
11
13
|
>
|
|
12
|
-
|
|
13
|
-
|
|
14
|
+
<FSButton
|
|
15
|
+
:label="$tr('ui.common.today', 'Today')"
|
|
16
|
+
@click="onClickToday"
|
|
17
|
+
/>
|
|
18
|
+
</FSRow>
|
|
14
19
|
</FSRow>
|
|
15
20
|
<FSRow
|
|
16
21
|
class="fs-calendar-twin"
|
|
17
22
|
align="top-center"
|
|
18
|
-
width="hug"
|
|
19
|
-
:height="['380px', '375px']"
|
|
20
23
|
:style="style"
|
|
21
24
|
>
|
|
22
25
|
<FSCol
|
|
@@ -118,6 +121,7 @@ import { useDateFormat, useAppLanguageCode } from "@dative-gpi/foundation-shared
|
|
|
118
121
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
119
122
|
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
120
123
|
|
|
124
|
+
import FSSelectField from "./fields/FSSelectField.vue";
|
|
121
125
|
import FSButton from "./FSButton.vue";
|
|
122
126
|
import FSSpan from "./FSSpan.vue";
|
|
123
127
|
import FSCol from "./FSCol.vue";
|
|
@@ -126,17 +130,13 @@ import FSRow from "./FSRow.vue";
|
|
|
126
130
|
export default defineComponent({
|
|
127
131
|
name: "FSCalendarTwin",
|
|
128
132
|
components: {
|
|
133
|
+
FSSelectField,
|
|
129
134
|
FSButton,
|
|
130
135
|
FSSpan,
|
|
131
136
|
FSCol,
|
|
132
137
|
FSRow
|
|
133
138
|
},
|
|
134
139
|
props: {
|
|
135
|
-
label: {
|
|
136
|
-
type: String as PropType<string | null>,
|
|
137
|
-
required: false,
|
|
138
|
-
default: null
|
|
139
|
-
},
|
|
140
140
|
modelValue: {
|
|
141
141
|
type: Array as PropType<number[] | null>,
|
|
142
142
|
required: false,
|
|
@@ -165,17 +165,16 @@ export default defineComponent({
|
|
|
165
165
|
const innerRightMonth = ref(new Date().getMonth());
|
|
166
166
|
const innerRightYear = ref(new Date().getFullYear());
|
|
167
167
|
|
|
168
|
-
const toggle = ref((props.modelValue?.length ?? 0) % 2);
|
|
169
|
-
|
|
170
168
|
const colors = computed(() => getColors(props.color));
|
|
171
169
|
const backgrounds = getColors(ColorEnum.Background);
|
|
170
|
+
const lights = getColors(ColorEnum.Light);
|
|
172
171
|
const darks = getColors(ColorEnum.Dark);
|
|
173
172
|
|
|
174
173
|
const style = computed((): StyleValue => ({
|
|
175
174
|
"--fs-calendar-background-color" : backgrounds.base,
|
|
176
175
|
"--fs-calendar-hover-background-color" : colors.value.light,
|
|
177
176
|
"--fs-calendar-active-background-color": colors.value.base,
|
|
178
|
-
"--fs-calendar-border-color" :
|
|
177
|
+
"--fs-calendar-border-color" : lights.dark,
|
|
179
178
|
"--fs-calendar-hover-border-color" : colors.value.base,
|
|
180
179
|
"--fs-calendar-active-border-color" : colors.value.base,
|
|
181
180
|
"--fs-calendar-color" : darks.base,
|
|
@@ -261,6 +260,28 @@ export default defineComponent({
|
|
|
261
260
|
return classNames;
|
|
262
261
|
});
|
|
263
262
|
|
|
263
|
+
const years = computed((): any[] => {
|
|
264
|
+
const years = [];
|
|
265
|
+
switch (props.limit) {
|
|
266
|
+
case "past":
|
|
267
|
+
for (let i = 1900; i < new Date().getFullYear(); i++) {
|
|
268
|
+
years.push({ label: i.toString(), id: i });
|
|
269
|
+
}
|
|
270
|
+
break;
|
|
271
|
+
case "future":
|
|
272
|
+
for (let i = new Date().getFullYear(); i < 2100; i++) {
|
|
273
|
+
years.push({ label: i.toString(), id: i });
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
default:
|
|
277
|
+
for (let i = 1900; i < 2100; i++) {
|
|
278
|
+
years.push({ label: i.toString(), id: i });
|
|
279
|
+
}
|
|
280
|
+
break;
|
|
281
|
+
}
|
|
282
|
+
return years;
|
|
283
|
+
});
|
|
284
|
+
|
|
264
285
|
const compare = (operator: "before" | "during" | "after", side: "left" | "right", date: { d: number, m: number, y: number }): boolean => {
|
|
265
286
|
switch (operator) {
|
|
266
287
|
case "before":
|
|
@@ -323,45 +344,73 @@ export default defineComponent({
|
|
|
323
344
|
|
|
324
345
|
const onClickLeft = (value: unknown): void => {
|
|
325
346
|
const dates = value as Date[];
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
347
|
+
|
|
348
|
+
// Click on the same date while only one date is selected on the left calendar
|
|
349
|
+
if (dates.length === 0) {
|
|
350
|
+
if (props.modelValue && props.modelValue.length > 0) {
|
|
351
|
+
emit("update:modelValue", [props.modelValue[0], props.modelValue[0]]);
|
|
352
|
+
}
|
|
353
|
+
return;
|
|
329
354
|
}
|
|
330
|
-
|
|
355
|
+
|
|
356
|
+
const clicked = pickerToEpoch(dates[dates.length - 1]);
|
|
357
|
+
if (props.modelValue && props.modelValue[0] === props.modelValue[1]) {
|
|
331
358
|
emit("update:modelValue", [props.modelValue[0], clicked].sort());
|
|
332
359
|
}
|
|
333
360
|
else {
|
|
334
|
-
|
|
335
|
-
emit("update:modelValue", [clicked, props.modelValue[1]]);
|
|
336
|
-
}
|
|
337
|
-
else {
|
|
338
|
-
emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
|
|
339
|
-
toggle.value = (++toggle.value) % 2;
|
|
340
|
-
}
|
|
361
|
+
emit("update:modelValue", [clicked, clicked]);
|
|
341
362
|
}
|
|
342
363
|
};
|
|
343
364
|
|
|
344
365
|
const onClickRight = (value: unknown): void => {
|
|
345
366
|
const dates = value as Date[];
|
|
367
|
+
|
|
368
|
+
// Click on the same date while only one date is selected on the right calendar
|
|
369
|
+
if (dates.length === 0) {
|
|
370
|
+
if (props.modelValue && props.modelValue.length > 0) {
|
|
371
|
+
emit("update:modelValue", [props.modelValue[props.modelValue.length - 1], props.modelValue[props.modelValue.length - 1]]);
|
|
372
|
+
}
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
|
|
346
376
|
const clicked = pickerToEpoch(dates[dates.length - 1]);
|
|
347
|
-
if (
|
|
377
|
+
if (props.modelValue && props.modelValue[0] === props.modelValue[1]) {
|
|
378
|
+
emit("update:modelValue", [props.modelValue[0], clicked].sort());
|
|
379
|
+
}
|
|
380
|
+
else {
|
|
348
381
|
emit("update:modelValue", [clicked, clicked]);
|
|
349
382
|
}
|
|
350
|
-
|
|
351
|
-
|
|
383
|
+
};
|
|
384
|
+
|
|
385
|
+
const onClickToday = (): void => {
|
|
386
|
+
const today = new Date();
|
|
387
|
+
innerLeftMonth.value = today.getMonth();
|
|
388
|
+
innerLeftYear.value = today.getFullYear();
|
|
389
|
+
|
|
390
|
+
if (innerLeftMonth.value === 11) {
|
|
391
|
+
innerRightMonth.value = 0;
|
|
392
|
+
innerRightYear.value = innerLeftYear.value + 1;
|
|
352
393
|
}
|
|
353
394
|
else {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
else {
|
|
358
|
-
emit("update:modelValue", [clicked, props.modelValue[toggle.value]].sort());
|
|
359
|
-
toggle.value = (++toggle.value) % 2;
|
|
360
|
-
}
|
|
395
|
+
innerRightMonth.value = innerLeftMonth.value + 1;
|
|
396
|
+
innerRightYear.value = innerLeftYear.value;
|
|
361
397
|
}
|
|
362
|
-
|
|
398
|
+
|
|
399
|
+
today.setHours(0, 0, 0, 0);
|
|
400
|
+
emit("update:modelValue", [pickerToEpoch(today), pickerToEpoch(today)]);
|
|
363
401
|
};
|
|
364
402
|
|
|
403
|
+
const onChangeYear = (value: number): void => {
|
|
404
|
+
if (innerRightYear.value !== innerLeftYear.value) {
|
|
405
|
+
innerLeftYear.value = value;
|
|
406
|
+
innerRightYear.value = value + 1;
|
|
407
|
+
}
|
|
408
|
+
else {
|
|
409
|
+
innerLeftYear.value = value;
|
|
410
|
+
innerRightYear.value = value;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
|
|
365
414
|
const allowedDates = (value: unknown): boolean => {
|
|
366
415
|
if (!(value instanceof Date)) {
|
|
367
416
|
return false;
|
|
@@ -414,11 +463,14 @@ export default defineComponent({
|
|
|
414
463
|
innerRightMonth,
|
|
415
464
|
innerRightYear,
|
|
416
465
|
innerRightValue,
|
|
466
|
+
years,
|
|
417
467
|
epochToPicker,
|
|
418
468
|
onClickPrevious,
|
|
419
469
|
onClickNext,
|
|
420
470
|
onClickLeft,
|
|
421
471
|
onClickRight,
|
|
472
|
+
onClickToday,
|
|
473
|
+
onChangeYear,
|
|
422
474
|
allowedDates
|
|
423
475
|
};
|
|
424
476
|
}
|