@dative-gpi/foundation-shared-components 1.0.70 → 1.0.71-groupings-2
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 +11 -9
- 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/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 +23 -13
- package/components/FSDialogRemove.vue +7 -8
- package/components/FSDialogSubmit.vue +20 -11
- package/components/FSEditImageUI.vue +13 -5
- package/components/FSFadeOut.vue +53 -21
- package/components/FSForm.vue +10 -8
- package/components/FSGrid.vue +0 -1
- package/components/FSIcon.vue +2 -2
- package/components/FSIconCard.vue +68 -12
- package/components/FSInformationsMenu.vue +142 -0
- package/components/FSInstantPicker.vue +268 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -10
- package/components/FSMenu.vue +47 -0
- package/components/FSOptionGroup.vue +8 -8
- package/components/FSOptionItem.vue +4 -4
- package/components/FSOptionsMenu.vue +165 -0
- 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/FSRangePicker.vue +275 -0
- package/components/FSRangeSlider.vue +84 -0
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +9 -7
- package/components/FSSlider.vue +44 -79
- package/components/FSSpan.vue +22 -8
- package/components/FSSwitch.vue +44 -48
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +5 -2
- package/components/FSTag.vue +3 -3
- package/components/FSTagGroup.vue +6 -4
- package/components/FSText.vue +21 -8
- package/components/FSToggleSet.vue +7 -7
- package/components/FSTreeView.vue +107 -0
- package/components/FSWindow.vue +122 -5
- package/components/agenda/FSAgenda.vue +26 -7
- 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 +0 -1
- package/components/agenda/FSMonthAgenda.vue +1 -6
- package/components/agenda/FSSelectAgendaMode.vue +2 -2
- package/components/agenda/FSWeekAgenda.vue +5 -10
- 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/carousels/FSCarousel.vue +23 -0
- package/components/carousels/FSCarouselItem.vue +14 -0
- package/components/deviceOrganisations/FSConnectivity.vue +5 -3
- package/components/deviceOrganisations/FSStatus.vue +5 -3
- package/components/deviceOrganisations/FSStatusCard.vue +7 -9
- package/components/deviceOrganisations/FSStatusRichCard.vue +171 -0
- package/components/deviceOrganisations/FSWorstAlert.vue +24 -36
- package/components/deviceOrganisations/FSWorstAlertCard.vue +8 -47
- package/components/fields/FSAutocompleteField.vue +85 -82
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +42 -25
- package/components/fields/FSClosableSearchField.vue +83 -0
- package/components/fields/FSColorField.vue +12 -10
- 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 +19 -16
- package/components/fields/FSGradientField.vue +5 -5
- package/components/fields/FSIconField.vue +16 -9
- package/components/fields/FSMapAddressField.vue +187 -0
- package/components/fields/FSNumberField.vue +8 -4
- package/components/fields/FSPasswordField.vue +7 -7
- package/components/fields/FSPoliciesValidationField.vue +101 -0
- 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 +9 -9
- package/components/fields/FSTermField.vue +69 -46
- 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 +117 -187
- 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 +21 -19
- 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 +194 -119
- 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 +95 -88
- package/components/lists/FSSimpleListItem.vue +131 -0
- package/components/map/FSMap.vue +144 -158
- package/components/map/FSMapFeatureGroup.vue +7 -1
- package/components/map/FSMapLayerButton.vue +3 -3
- package/components/map/FSMapMarker.vue +103 -42
- 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/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 +0 -6
- package/components/tiles/FSEntityCountBadge.vue +83 -0
- package/components/tiles/FSFolderTileUI.vue +38 -4
- package/components/tiles/FSGroupTileUI.vue +32 -136
- package/components/tiles/FSGroupingTileUI.vue +52 -0
- package/components/tiles/FSLoadTile.vue +16 -10
- package/components/tiles/FSLocationTileUI.vue +50 -80
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +0 -6
- package/components/tiles/FSSimpleTileUI.vue +32 -27
- package/components/tiles/FSTile.vue +46 -39
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -7
- package/components/tiles/FSUserTileUI.vue +119 -0
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSBaseView.vue +64 -0
- package/components/views/FSEntityView.vue +12 -146
- 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 -1
- package/composables/useAddress.ts +40 -8
- package/composables/useBreakpoints.ts +40 -4
- package/composables/useColors.ts +16 -7
- package/composables/useMapLayers.ts +69 -0
- package/composables/useSlots.ts +2 -1
- package/models/colors.ts +2 -1
- package/models/deviceAlerts.ts +1 -0
- package/models/index.ts +0 -1
- package/models/map.ts +12 -10
- package/models/rules.ts +5 -2
- package/models/tables.ts +2 -1
- 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 +0 -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_fade_out.scss +10 -2
- package/styles/components/fs_filter_button.scss +1 -1
- 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_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 +3 -1
- package/styles/components/fs_slider.scss +0 -40
- package/styles/components/fs_span.scss +17 -5
- package/styles/components/fs_status_rich_card.scss +6 -0
- package/styles/components/fs_tabs.scss +18 -37
- 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 +3 -0
- package/styles/components/index.scss +2 -6
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +26 -44
- 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 +94 -18
- package/tools/chartsTools.ts +156 -16
- package/tools/index.ts +1 -0
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +99 -40
- package/utils/badge.ts +9 -5
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +108 -0
- package/utils/picker.ts +40 -0
- package/utils/sort.ts +2 -2
- package/utils/time.ts +13 -13
- package/components/fields/FSMagicConfigField.vue +0 -163
- package/components/fields/FSMagicField.vue +0 -193
- package/components/fields/FSTimeSlotField.vue +0 -250
- package/components/views/FSEntityHeader.vue +0 -343
- package/components/views/FSListHeader.vue +0 -83
- package/components/views/FSListView.vue +0 -83
- package/components/views/FSSkeletonView.vue +0 -100
- package/composables/useMagicFieldProvider.ts +0 -23
- package/models/magicFields.ts +0 -10
- 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
|
@@ -0,0 +1,268 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSBaseField
|
|
3
|
+
:description="$props.description"
|
|
4
|
+
:hideHeader="$props.hideHeader"
|
|
5
|
+
:required="$props.required"
|
|
6
|
+
:disabled="$props.disabled"
|
|
7
|
+
:label="$props.label"
|
|
8
|
+
:maxWidth="$props.maxWidth"
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
align="bottom-center"
|
|
12
|
+
gap="32px"
|
|
13
|
+
>
|
|
14
|
+
<FSTermField
|
|
15
|
+
width="430px"
|
|
16
|
+
:label="$tr('ui.instant-picker.analyze-period', 'Analyze Period')"
|
|
17
|
+
:startDate="$props.startDate"
|
|
18
|
+
:endDate="$props.endDate"
|
|
19
|
+
:disabled="$props.disabled"
|
|
20
|
+
@update:startDate="$emit('update:startDate', $event)"
|
|
21
|
+
@update:endDate="$emit('update:endDate', $event)"
|
|
22
|
+
/>
|
|
23
|
+
<FSRow
|
|
24
|
+
padding="0 0 2px 0"
|
|
25
|
+
align="center-center"
|
|
26
|
+
>
|
|
27
|
+
<FSCol>
|
|
28
|
+
<FSSlider
|
|
29
|
+
minWidth='min(300px, 90vw)'
|
|
30
|
+
:disabled="$props.disabled"
|
|
31
|
+
:color="ColorEnum.Light"
|
|
32
|
+
:thumbColor="ColorEnum.Primary"
|
|
33
|
+
:trackSize="8"
|
|
34
|
+
thumb-label="always"
|
|
35
|
+
:step="$props.stepTime"
|
|
36
|
+
:min="startTimestamp"
|
|
37
|
+
:max="endTimestamp"
|
|
38
|
+
:hideHeader="true"
|
|
39
|
+
:maxWidth="null"
|
|
40
|
+
:ticks="ticks"
|
|
41
|
+
showTicks="always"
|
|
42
|
+
:modelValue="$props.modelValue"
|
|
43
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
44
|
+
>
|
|
45
|
+
<template
|
|
46
|
+
#thumb-label="{ modelValue }"
|
|
47
|
+
>
|
|
48
|
+
<FSSpan
|
|
49
|
+
font="text-overline"
|
|
50
|
+
>
|
|
51
|
+
{{ epochToMonthShortTimeFormat(modelValue) }}
|
|
52
|
+
</FSSpan>
|
|
53
|
+
</template>
|
|
54
|
+
<template
|
|
55
|
+
#tick-label="{ tick }"
|
|
56
|
+
>
|
|
57
|
+
<FSRow>
|
|
58
|
+
<FSText
|
|
59
|
+
:color="lightColors.dark"
|
|
60
|
+
font="text-overline"
|
|
61
|
+
>
|
|
62
|
+
{{ tickPrecision === TimePrecision.Hours ? epochToShortTimeOnlyFormat(tick.value) : epochToDayMonthShortOnly(tick.value)
|
|
63
|
+
}}
|
|
64
|
+
</FSText>
|
|
65
|
+
</FSRow>
|
|
66
|
+
</template>
|
|
67
|
+
</FSSlider>
|
|
68
|
+
</FSCol>
|
|
69
|
+
<FSPlayButtons
|
|
70
|
+
v-if="$props.playable"
|
|
71
|
+
:disabled="$props.disabled"
|
|
72
|
+
:modelValue="playing"
|
|
73
|
+
@click:backward="onClickBackward"
|
|
74
|
+
@click:forward="onClickForward"
|
|
75
|
+
@update:modelValue="onPlayingChange"
|
|
76
|
+
/>
|
|
77
|
+
</FSRow>
|
|
78
|
+
</FSRow>
|
|
79
|
+
</FSBaseField>
|
|
80
|
+
</template>
|
|
81
|
+
|
|
82
|
+
<script lang="ts">
|
|
83
|
+
import { computed, defineComponent, ref, watch, type PropType } from "vue";
|
|
84
|
+
|
|
85
|
+
import { useBreakpoints, useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
86
|
+
import { useDateFormat, useDateExpression } from "@dative-gpi/foundation-shared-services/composables";
|
|
87
|
+
|
|
88
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
89
|
+
import { computeTicks, TimePrecision } from '@dative-gpi/foundation-shared-components/utils';
|
|
90
|
+
|
|
91
|
+
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
92
|
+
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
93
|
+
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
94
|
+
import FSSlider from '@dative-gpi/foundation-shared-components/components/FSSlider.vue';
|
|
95
|
+
import FSPlayButtons from '@dative-gpi/foundation-shared-components/components/FSPlayButtons.vue';
|
|
96
|
+
import FSBaseField from '@dative-gpi/foundation-shared-components/components/fields/FSBaseField.vue';
|
|
97
|
+
import FSTermField from '@dative-gpi/foundation-shared-components/components/fields/FSTermField.vue';
|
|
98
|
+
|
|
99
|
+
export default defineComponent({
|
|
100
|
+
name: "FSInstantPicker",
|
|
101
|
+
components: {
|
|
102
|
+
FSCol,
|
|
103
|
+
FSSpan,
|
|
104
|
+
FSText,
|
|
105
|
+
FSSlider,
|
|
106
|
+
FSTermField,
|
|
107
|
+
FSBaseField,
|
|
108
|
+
FSPlayButtons,
|
|
109
|
+
},
|
|
110
|
+
props: {
|
|
111
|
+
label: {
|
|
112
|
+
type: String,
|
|
113
|
+
required: false,
|
|
114
|
+
},
|
|
115
|
+
modelValue: {
|
|
116
|
+
type: Number,
|
|
117
|
+
required: false
|
|
118
|
+
},
|
|
119
|
+
startDate: {
|
|
120
|
+
type: String,
|
|
121
|
+
required: true
|
|
122
|
+
},
|
|
123
|
+
endDate: {
|
|
124
|
+
type: String,
|
|
125
|
+
required: true
|
|
126
|
+
},
|
|
127
|
+
description: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: false,
|
|
130
|
+
default: null
|
|
131
|
+
},
|
|
132
|
+
hideHeader: {
|
|
133
|
+
type: Boolean,
|
|
134
|
+
required: false,
|
|
135
|
+
default: false
|
|
136
|
+
},
|
|
137
|
+
required: {
|
|
138
|
+
type: Boolean,
|
|
139
|
+
required: false,
|
|
140
|
+
default: false
|
|
141
|
+
},
|
|
142
|
+
disabled: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
required: false,
|
|
145
|
+
default: false
|
|
146
|
+
},
|
|
147
|
+
playable: {
|
|
148
|
+
type: Boolean,
|
|
149
|
+
required: false,
|
|
150
|
+
default: true
|
|
151
|
+
},
|
|
152
|
+
stepTime: {
|
|
153
|
+
type: Number,
|
|
154
|
+
required: false,
|
|
155
|
+
default: 60000
|
|
156
|
+
},
|
|
157
|
+
playingStepDuration: {
|
|
158
|
+
type: Number,
|
|
159
|
+
required: false,
|
|
160
|
+
default: 50
|
|
161
|
+
},
|
|
162
|
+
maxWidth: {
|
|
163
|
+
type: String as PropType<string | null>,
|
|
164
|
+
required: false,
|
|
165
|
+
default: null
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
emits: ['update:modelValue', 'update:startDate', 'update:endDate'],
|
|
169
|
+
setup(props, { emit, expose }) {
|
|
170
|
+
const { epochToShortTimeOnlyFormat, epochToShortDateFormat, epochToDayMonthShortOnly, epochToISO, epochToMonthShortTimeFormat } = useDateFormat();
|
|
171
|
+
const { convert : convertTermToEpoch } = useDateExpression();
|
|
172
|
+
const { isMobileSized, isExtraSmall } = useBreakpoints();
|
|
173
|
+
const { getColors } = useColors();
|
|
174
|
+
|
|
175
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
176
|
+
const playing = ref(false);
|
|
177
|
+
const playingInterval = ref();
|
|
178
|
+
const startTimestamp = ref(convertTermToEpoch(props.startDate));
|
|
179
|
+
const endTimestamp = ref(convertTermToEpoch(props.endDate));
|
|
180
|
+
|
|
181
|
+
const tickCount = computed(() => {
|
|
182
|
+
if (isExtraSmall.value) { return 3; }
|
|
183
|
+
if (isMobileSized.value) { return 4; }
|
|
184
|
+
return 5;
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Pour la précision, on peut rester sur l'heure ou le jour selon la plage
|
|
188
|
+
const tickPrecision = computed(() => {
|
|
189
|
+
const rangeDuration = endTimestamp.value - startTimestamp.value;
|
|
190
|
+
if (rangeDuration <= 86400000 * tickCount.value) { return TimePrecision.Hours; }
|
|
191
|
+
if (rangeDuration <= 2592000000 * tickCount.value) { return TimePrecision.Days; }
|
|
192
|
+
return TimePrecision.Months;
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
const ticks = computed(() => computeTicks({
|
|
196
|
+
start: startTimestamp.value,
|
|
197
|
+
end: endTimestamp.value,
|
|
198
|
+
tickCount: tickCount.value,
|
|
199
|
+
precision: tickPrecision.value
|
|
200
|
+
}));
|
|
201
|
+
|
|
202
|
+
const refresh = () => {
|
|
203
|
+
startTimestamp.value = convertTermToEpoch(props.startDate);
|
|
204
|
+
endTimestamp.value = convertTermToEpoch(props.endDate);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
const onPlayingChange = (value: boolean) => {
|
|
208
|
+
playing.value = value;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const onClickBackward = () => {
|
|
212
|
+
emit('update:modelValue', startTimestamp.value);
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const onClickForward = () => {
|
|
216
|
+
emit('update:modelValue', endTimestamp.value);
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
watch([() => props.startDate, () => props.endDate, () => props.modelValue], () => {
|
|
220
|
+
if(!props.modelValue || props.modelValue < startTimestamp.value || props.modelValue > endTimestamp.value) {
|
|
221
|
+
emit('update:modelValue', endTimestamp.value);
|
|
222
|
+
}
|
|
223
|
+
}, { immediate: true });
|
|
224
|
+
|
|
225
|
+
watch([() => props.startDate, () => props.endDate], () => {
|
|
226
|
+
refresh();
|
|
227
|
+
}, { immediate: true });
|
|
228
|
+
|
|
229
|
+
watch(playing, (value) => {
|
|
230
|
+
if(!value && playingInterval.value) {
|
|
231
|
+
clearInterval(playingInterval.value);
|
|
232
|
+
} else {
|
|
233
|
+
playingInterval.value = setInterval(() => {
|
|
234
|
+
if(props.modelValue && props.modelValue + props.stepTime <= endTimestamp.value) {
|
|
235
|
+
emit('update:modelValue', props.modelValue + props.stepTime);
|
|
236
|
+
} else {
|
|
237
|
+
emit('update:modelValue', endTimestamp.value);
|
|
238
|
+
playing.value = false;
|
|
239
|
+
}
|
|
240
|
+
}, props.playingStepDuration);
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
|
|
244
|
+
expose({
|
|
245
|
+
refresh,
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
return {
|
|
249
|
+
ticks,
|
|
250
|
+
playing,
|
|
251
|
+
ColorEnum,
|
|
252
|
+
lightColors,
|
|
253
|
+
endTimestamp,
|
|
254
|
+
TimePrecision,
|
|
255
|
+
tickPrecision,
|
|
256
|
+
startTimestamp,
|
|
257
|
+
epochToISO,
|
|
258
|
+
onPlayingChange,
|
|
259
|
+
onClickForward,
|
|
260
|
+
onClickBackward,
|
|
261
|
+
epochToShortDateFormat,
|
|
262
|
+
epochToShortTimeOnlyFormat,
|
|
263
|
+
epochToDayMonthShortOnly,
|
|
264
|
+
epochToMonthShortTimeFormat
|
|
265
|
+
};
|
|
266
|
+
},
|
|
267
|
+
});
|
|
268
|
+
</script>
|
package/components/FSLink.vue
CHANGED
|
@@ -2,13 +2,16 @@
|
|
|
2
2
|
<a
|
|
3
3
|
v-if="$props.href"
|
|
4
4
|
:href="$props.href"
|
|
5
|
+
:class="classes"
|
|
5
6
|
:style="style"
|
|
6
7
|
>
|
|
7
8
|
<slot>
|
|
8
|
-
|
|
9
|
+
<FSSpan>
|
|
10
|
+
{{ $props.label }}
|
|
11
|
+
</FSSpan>
|
|
9
12
|
</slot>
|
|
10
13
|
</a>
|
|
11
|
-
<
|
|
14
|
+
<FSRouterLink
|
|
12
15
|
v-else-if="$props.to"
|
|
13
16
|
:to="$props.to"
|
|
14
17
|
:class="classes"
|
|
@@ -19,20 +22,29 @@
|
|
|
19
22
|
<slot
|
|
20
23
|
v-bind="props"
|
|
21
24
|
>
|
|
22
|
-
|
|
25
|
+
<FSSpan>
|
|
26
|
+
{{ $props.label }}
|
|
27
|
+
</FSSpan>
|
|
23
28
|
</slot>
|
|
24
|
-
</
|
|
29
|
+
</FSRouterLink>
|
|
25
30
|
</template>
|
|
26
31
|
|
|
27
32
|
<script lang="ts">
|
|
28
33
|
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
29
34
|
import { type RouteLocation } from "vue-router";
|
|
30
35
|
|
|
36
|
+
import { useBreakpoints, useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
31
37
|
import { type ColorBase, ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
32
|
-
|
|
38
|
+
|
|
39
|
+
import FSRouterLink from "./FSRouterLink.vue";
|
|
40
|
+
import FSSpan from "./FSSpan.vue";
|
|
33
41
|
|
|
34
42
|
export default defineComponent({
|
|
35
43
|
name: "FSLink",
|
|
44
|
+
components: {
|
|
45
|
+
FSRouterLink,
|
|
46
|
+
FSSpan
|
|
47
|
+
},
|
|
36
48
|
props: {
|
|
37
49
|
label: {
|
|
38
50
|
type: String as PropType<string | null>,
|
|
@@ -40,7 +52,7 @@ export default defineComponent({
|
|
|
40
52
|
default: null
|
|
41
53
|
},
|
|
42
54
|
to: {
|
|
43
|
-
type:
|
|
55
|
+
type: Object as PropType<RouteLocation | null>,
|
|
44
56
|
required: false,
|
|
45
57
|
default: null
|
|
46
58
|
},
|
|
@@ -76,6 +88,7 @@ export default defineComponent({
|
|
|
76
88
|
}
|
|
77
89
|
},
|
|
78
90
|
setup(props) {
|
|
91
|
+
const { fontStyles } = useBreakpoints();
|
|
79
92
|
const { getColors } = useColors();
|
|
80
93
|
const { slots } = useSlots();
|
|
81
94
|
|
|
@@ -85,15 +98,18 @@ export default defineComponent({
|
|
|
85
98
|
switch (props.variant) {
|
|
86
99
|
case "base": return {
|
|
87
100
|
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
88
|
-
"--fs-link-color" : colors.value.base
|
|
101
|
+
"--fs-link-color" : colors.value.base,
|
|
102
|
+
...fontStyles.value
|
|
89
103
|
};
|
|
90
104
|
case "light": return {
|
|
91
105
|
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
92
|
-
"--fs-link-color" : colors.value.light
|
|
106
|
+
"--fs-link-color" : colors.value.light,
|
|
107
|
+
...fontStyles.value
|
|
93
108
|
};
|
|
94
109
|
case "dark": return {
|
|
95
110
|
"--fs-span-line-clamp": props.lineClamp.toString(),
|
|
96
|
-
"--fs-link-color" : colors.value.dark
|
|
111
|
+
"--fs-link-color" : colors.value.dark,
|
|
112
|
+
...fontStyles.value
|
|
97
113
|
};
|
|
98
114
|
}
|
|
99
115
|
});
|
package/components/FSLoader.vue
CHANGED
|
@@ -32,7 +32,7 @@ export default defineComponent({
|
|
|
32
32
|
default: "0"
|
|
33
33
|
},
|
|
34
34
|
variant: {
|
|
35
|
-
type: String as PropType<"standard" | "button" | "input" | "field" | "chip" | "text-h1" | "text-h2" | "text-h3" | "text-
|
|
35
|
+
type: String as PropType<"standard" | "button" | "input" | "field" | "chip" | "text-h1" | "text-h2" | "text-h3" | "text-body" | "text-button" | "text-overline">,
|
|
36
36
|
required: false,
|
|
37
37
|
default: "standard"
|
|
38
38
|
},
|
|
@@ -51,7 +51,7 @@ export default defineComponent({
|
|
|
51
51
|
const style = computed((): StyleValue => ({
|
|
52
52
|
"--fs-loader-background-color": backgrounds.base,
|
|
53
53
|
"--fs-loader-border-radius" : ["chip"].includes(props.variant) ? "50px" : sizeToVar(props.borderRadius),
|
|
54
|
-
"--fs-loader-padding" : sizeToVar(
|
|
54
|
+
"--fs-loader-padding" : sizeToVar(getPadding.value),
|
|
55
55
|
"--fs-loader-height" : sizeToVar(getHeight.value),
|
|
56
56
|
"--fs-loader-width" : sizeToVar(getWidth.value)
|
|
57
57
|
}));
|
|
@@ -63,21 +63,24 @@ export default defineComponent({
|
|
|
63
63
|
case "input" :
|
|
64
64
|
case "field" : return isMobileSized.value ? "36px" : "40px";
|
|
65
65
|
case "chip" : return isMobileSized.value ? "20px" : "24px";
|
|
66
|
-
|
|
67
|
-
case "text-
|
|
68
|
-
case "text-
|
|
69
|
-
case "text-
|
|
66
|
+
|
|
67
|
+
case "text-h1" : return isMobileSized.value ? "28px" : "36px";
|
|
68
|
+
case "text-h2" : return isMobileSized.value ? "22px" : "26px";
|
|
69
|
+
case "text-h3" : return isMobileSized.value ? "16px" : "20px";
|
|
70
70
|
case "text-body" :
|
|
71
|
-
case "text-button" : return isMobileSized.value ? "
|
|
72
|
-
case "text-overline" : return "
|
|
71
|
+
case "text-button" : return isMobileSized.value ? "12px" : "14px";
|
|
72
|
+
case "text-overline" : return isMobileSized.value ? "10px" : "12px";
|
|
73
73
|
}
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
const getWidth = computed((): string | number => {
|
|
77
|
+
if (props.width != null) {
|
|
78
|
+
return sizeToVar(props.width);
|
|
79
|
+
}
|
|
77
80
|
switch (props.variant) {
|
|
78
81
|
case "standard": return sizeToVar(props.width);
|
|
79
|
-
case "button" : return isMobileSized ? "36px" : "40px";
|
|
80
|
-
case "input" : return isMobileSized ? "calc(50% - 124px)" : "calc(50% - 132px)";
|
|
82
|
+
case "button" : return isMobileSized.value ? "36px" : "40px";
|
|
83
|
+
case "input" : return isMobileSized.value ? "calc(50% - 124px)" : "calc(50% - 132px)";
|
|
81
84
|
case "field" : return "100%";
|
|
82
85
|
case "chip" : return "8vw";
|
|
83
86
|
case "text-h1" : return "calc(50% - 32px)";
|
|
@@ -87,6 +90,21 @@ export default defineComponent({
|
|
|
87
90
|
}
|
|
88
91
|
});
|
|
89
92
|
|
|
93
|
+
const getPadding = computed((): string | number => {
|
|
94
|
+
if (props.padding !== "0") {
|
|
95
|
+
return sizeToVar(props.padding);
|
|
96
|
+
}
|
|
97
|
+
switch (props.variant) {
|
|
98
|
+
case "text-h1" : return "2px 0";
|
|
99
|
+
case "text-h2" : return isMobileSized.value ? "1px 0" : "3px 0";
|
|
100
|
+
case "text-h3" : return "2px 0";
|
|
101
|
+
case "text-body" :
|
|
102
|
+
case "text-button" : return isMobileSized.value ? "2px 0" : "3px 0";;
|
|
103
|
+
case "text-overline" : return isMobileSized.value ? "3px 0" : "2px 0";
|
|
104
|
+
default : return sizeToVar(props.padding);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
90
108
|
return {
|
|
91
109
|
style
|
|
92
110
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<v-menu
|
|
3
|
+
:modelValue="$props.modelValue"
|
|
4
|
+
:scrollStrategy="$props.scrollStrategy"
|
|
5
|
+
:offset="$props.offset"
|
|
6
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
7
|
+
>
|
|
8
|
+
<template
|
|
9
|
+
v-for="(_, name) in $slots"
|
|
10
|
+
v-slot:[name]="slotData"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
:name="name"
|
|
14
|
+
v-bind="slotData"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
<slot />
|
|
18
|
+
</v-menu>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script lang="ts">
|
|
22
|
+
import { defineComponent, type PropType } from "vue";
|
|
23
|
+
|
|
24
|
+
export default defineComponent({
|
|
25
|
+
name: "FSMenu",
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
scrollStrategy: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: "close"
|
|
34
|
+
},
|
|
35
|
+
offset: {
|
|
36
|
+
type: [String, Number] as PropType<string | number | null>,
|
|
37
|
+
default: "4px"
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
emits: ["update:modelValue"],
|
|
41
|
+
setup() {
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
</script>
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
:style="style"
|
|
8
8
|
>
|
|
9
9
|
<template
|
|
10
|
-
v-if="props.values.length"
|
|
10
|
+
v-if="props.values && props.values.length"
|
|
11
11
|
>
|
|
12
12
|
<template
|
|
13
13
|
v-if="!$slots.item"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<FSOptionItem
|
|
16
16
|
v-for="(item, index) in props.values"
|
|
17
17
|
:padding="props.optionPadding"
|
|
18
|
-
:
|
|
18
|
+
:disabled="props.disabled"
|
|
19
19
|
:prependIcon="item.prependIcon"
|
|
20
20
|
:appendIcon="item.appendIcon"
|
|
21
21
|
:variant="getVariant(item)"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
:style="style"
|
|
54
54
|
>
|
|
55
55
|
<template
|
|
56
|
-
v-if="props.values.length"
|
|
56
|
+
v-if="props.values && props.values.length"
|
|
57
57
|
>
|
|
58
58
|
<template
|
|
59
59
|
v-if="!$slots.item"
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
<FSOptionItem
|
|
62
62
|
v-for="(item, index) in props.values"
|
|
63
63
|
:padding="props.optionPadding"
|
|
64
|
-
:
|
|
64
|
+
:disabled="props.disabled"
|
|
65
65
|
:prependIcon="item.prependIcon"
|
|
66
66
|
:appendIcon="item.appendIcon"
|
|
67
67
|
:variant="getVariant(item)"
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
:wrap="false"
|
|
102
102
|
>
|
|
103
103
|
<template
|
|
104
|
-
v-if="props.values.length"
|
|
104
|
+
v-if="props.values && props.values.length"
|
|
105
105
|
>
|
|
106
106
|
<template
|
|
107
107
|
v-if="!$slots.item"
|
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
<FSOptionItem
|
|
110
110
|
v-for="(item, index) in props.values"
|
|
111
111
|
:padding="props.optionPadding"
|
|
112
|
-
:
|
|
112
|
+
:disabled="props.disabled"
|
|
113
113
|
:prependIcon="item.prependIcon"
|
|
114
114
|
:appendIcon="item.appendIcon"
|
|
115
115
|
:variant="getVariant(item)"
|
|
@@ -245,10 +245,10 @@ export default defineComponent({
|
|
|
245
245
|
required: false,
|
|
246
246
|
default: true
|
|
247
247
|
},
|
|
248
|
-
|
|
248
|
+
disabled: {
|
|
249
249
|
type: Boolean,
|
|
250
250
|
required: false,
|
|
251
|
-
default:
|
|
251
|
+
default: false
|
|
252
252
|
}
|
|
253
253
|
},
|
|
254
254
|
emits: ["update:modelValue"],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSClickable
|
|
3
|
-
:
|
|
3
|
+
:disabled="$props.disabled"
|
|
4
4
|
:height="['32px', '28px']"
|
|
5
5
|
:padding="$props.padding"
|
|
6
6
|
:variant="$props.variant"
|
|
@@ -110,10 +110,10 @@ export default defineComponent({
|
|
|
110
110
|
required: false,
|
|
111
111
|
default: false
|
|
112
112
|
},
|
|
113
|
-
|
|
113
|
+
disabled: {
|
|
114
114
|
type: Boolean,
|
|
115
115
|
required: false,
|
|
116
|
-
default:
|
|
116
|
+
default: false
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
emits: ["click"],
|
|
@@ -123,7 +123,7 @@ export default defineComponent({
|
|
|
123
123
|
const colors = computed(() => getColors(props.color));
|
|
124
124
|
|
|
125
125
|
const onClick = (event: MouseEvent) => {
|
|
126
|
-
if (props.
|
|
126
|
+
if (!props.disabled && !props.load) {
|
|
127
127
|
emit("click", event);
|
|
128
128
|
}
|
|
129
129
|
};
|