@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
package/components/FSImageUI.vue
CHANGED
|
@@ -42,9 +42,8 @@
|
|
|
42
42
|
import { computed, defineComponent, type PropType, ref, type StyleValue, watch } from "vue";
|
|
43
43
|
import { decode, isBlurhashValid } from "blurhash";
|
|
44
44
|
|
|
45
|
-
import type { ImageDetails } from "@dative-gpi/foundation-shared-domain/models";
|
|
46
|
-
|
|
47
45
|
import { sizeToVar, varToSize } from "@dative-gpi/foundation-shared-components/utils";
|
|
46
|
+
import { type ImageDetails } from "@dative-gpi/foundation-shared-domain/models";
|
|
48
47
|
|
|
49
48
|
import FSLoader from "./FSLoader.vue";
|
|
50
49
|
|
|
@@ -64,6 +63,11 @@ export default defineComponent({
|
|
|
64
63
|
required: false,
|
|
65
64
|
default: null
|
|
66
65
|
},
|
|
66
|
+
aspectRatio: {
|
|
67
|
+
type: Number as PropType<number | null>,
|
|
68
|
+
required: false,
|
|
69
|
+
default: 1
|
|
70
|
+
},
|
|
67
71
|
imageB64: {
|
|
68
72
|
type: String as PropType<string | null>,
|
|
69
73
|
required: false,
|
|
@@ -79,11 +83,6 @@ export default defineComponent({
|
|
|
79
83
|
required: false,
|
|
80
84
|
default: null
|
|
81
85
|
},
|
|
82
|
-
aspectRatio: {
|
|
83
|
-
type: String as PropType<string | null>,
|
|
84
|
-
required: false,
|
|
85
|
-
default: null
|
|
86
|
-
},
|
|
87
86
|
borderRadius: {
|
|
88
87
|
type: [String, Number],
|
|
89
88
|
required: false,
|
|
@@ -127,10 +126,7 @@ export default defineComponent({
|
|
|
127
126
|
return undefined;
|
|
128
127
|
}
|
|
129
128
|
if (props.aspectRatio) {
|
|
130
|
-
|
|
131
|
-
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
132
|
-
return sizeToVar(varToSize(props.width) * (parseFloat(split[1]) / parseFloat(split[0])));
|
|
133
|
-
}
|
|
129
|
+
return sizeToVar(varToSize(props.width) / props.aspectRatio);
|
|
134
130
|
}
|
|
135
131
|
return sizeToVar(props.width);
|
|
136
132
|
}
|
|
@@ -146,10 +142,7 @@ export default defineComponent({
|
|
|
146
142
|
return undefined;
|
|
147
143
|
}
|
|
148
144
|
if (props.aspectRatio) {
|
|
149
|
-
|
|
150
|
-
if (split.length === 2 && !isNaN(parseFloat(split[0])) && !isNaN(parseFloat(split[1]))) {
|
|
151
|
-
return sizeToVar(varToSize(props.height) * (parseFloat(split[0]) / parseFloat(split[1])));
|
|
152
|
-
}
|
|
145
|
+
return sizeToVar(varToSize(props.height) * props.aspectRatio);
|
|
153
146
|
}
|
|
154
147
|
return sizeToVar(props.height);
|
|
155
148
|
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSMenu
|
|
3
|
+
:location="$props.location"
|
|
4
|
+
:closeOnContentClick="false"
|
|
5
|
+
minWidth="0"
|
|
6
|
+
v-model="modelValue"
|
|
7
|
+
v-bind="$attrs"
|
|
8
|
+
>
|
|
9
|
+
<template
|
|
10
|
+
#activator="{ props }"
|
|
11
|
+
>
|
|
12
|
+
<slot
|
|
13
|
+
name="activator"
|
|
14
|
+
v-bind="props"
|
|
15
|
+
>
|
|
16
|
+
<FSButton
|
|
17
|
+
v-bind="props"
|
|
18
|
+
:color="$props.iconColor"
|
|
19
|
+
:iconSize="$props.iconSize"
|
|
20
|
+
variant="icon"
|
|
21
|
+
icon="mdi-information-outline"
|
|
22
|
+
/>
|
|
23
|
+
</slot>
|
|
24
|
+
</template>
|
|
25
|
+
<slot
|
|
26
|
+
name="menuContent"
|
|
27
|
+
>
|
|
28
|
+
<FSCard
|
|
29
|
+
:maxWidth="$props.maxWidth"
|
|
30
|
+
:width="$props.width"
|
|
31
|
+
:padding="$props.padding"
|
|
32
|
+
:elevation="true"
|
|
33
|
+
align="center"
|
|
34
|
+
>
|
|
35
|
+
<slot
|
|
36
|
+
name="cardContent"
|
|
37
|
+
>
|
|
38
|
+
<FSRow
|
|
39
|
+
align="center-center"
|
|
40
|
+
>
|
|
41
|
+
<FSText
|
|
42
|
+
font="text-body"
|
|
43
|
+
:lineClamp="$props.lineClamp"
|
|
44
|
+
>
|
|
45
|
+
{{ $props.content }}
|
|
46
|
+
</FSText>
|
|
47
|
+
</FSRow>
|
|
48
|
+
</slot>
|
|
49
|
+
<template
|
|
50
|
+
v-if="$props.showCloseButton"
|
|
51
|
+
#top-right
|
|
52
|
+
>
|
|
53
|
+
<FSButton
|
|
54
|
+
variant="icon"
|
|
55
|
+
icon="mdi-close"
|
|
56
|
+
iconSize="18px"
|
|
57
|
+
:color="lightColors.dark"
|
|
58
|
+
@click="modelValue = false"
|
|
59
|
+
/>
|
|
60
|
+
</template>
|
|
61
|
+
</FSCard>
|
|
62
|
+
</slot>
|
|
63
|
+
</FSMenu>
|
|
64
|
+
</template>
|
|
65
|
+
|
|
66
|
+
<script lang="ts">
|
|
67
|
+
import { defineComponent, ref, type PropType } from "vue";
|
|
68
|
+
|
|
69
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
70
|
+
|
|
71
|
+
import { ColorEnum } from '@dative-gpi/foundation-shared-components/models';
|
|
72
|
+
|
|
73
|
+
import FSRow from '@dative-gpi/foundation-shared-components/components/FSRow.vue';
|
|
74
|
+
import FSMenu from '@dative-gpi/foundation-shared-components/components/FSMenu.vue';
|
|
75
|
+
import FSCard from '@dative-gpi/foundation-shared-components/components/FSCard.vue';
|
|
76
|
+
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
77
|
+
import FSButton from '@dative-gpi/foundation-shared-components/components/FSButton.vue';
|
|
78
|
+
|
|
79
|
+
export default defineComponent({
|
|
80
|
+
name: "FSInformationsMenu",
|
|
81
|
+
components: {
|
|
82
|
+
FSMenu,
|
|
83
|
+
FSCard,
|
|
84
|
+
FSRow,
|
|
85
|
+
FSText,
|
|
86
|
+
FSButton
|
|
87
|
+
},
|
|
88
|
+
props: {
|
|
89
|
+
content: {
|
|
90
|
+
type: String as PropType<string | null>,
|
|
91
|
+
required: false,
|
|
92
|
+
default: null
|
|
93
|
+
},
|
|
94
|
+
location: {
|
|
95
|
+
type: String,
|
|
96
|
+
default: "top"
|
|
97
|
+
},
|
|
98
|
+
width: {
|
|
99
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
100
|
+
default: null
|
|
101
|
+
},
|
|
102
|
+
maxWidth: {
|
|
103
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
104
|
+
default: null
|
|
105
|
+
},
|
|
106
|
+
padding: {
|
|
107
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
108
|
+
default: "16px 8px"
|
|
109
|
+
},
|
|
110
|
+
iconSize: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "18px"
|
|
113
|
+
},
|
|
114
|
+
iconColor: {
|
|
115
|
+
type: String as PropType<ColorBase>,
|
|
116
|
+
default: ColorEnum.Primary
|
|
117
|
+
},
|
|
118
|
+
showCloseButton: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true
|
|
121
|
+
},
|
|
122
|
+
lineClamp: {
|
|
123
|
+
type: Number,
|
|
124
|
+
default: 4
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
emits: ["update:modelValue"],
|
|
128
|
+
setup() {
|
|
129
|
+
const modelValue = ref(false);
|
|
130
|
+
|
|
131
|
+
const { getColors } = useColors();
|
|
132
|
+
|
|
133
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
134
|
+
|
|
135
|
+
return {
|
|
136
|
+
ColorEnum,
|
|
137
|
+
modelValue,
|
|
138
|
+
lightColors
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
</script>
|
|
@@ -0,0 +1,269 @@
|
|
|
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
|
+
>
|
|
9
|
+
<FSRow
|
|
10
|
+
align="bottom-center"
|
|
11
|
+
gap="32px"
|
|
12
|
+
>
|
|
13
|
+
<FSTermField
|
|
14
|
+
width="430px"
|
|
15
|
+
:label="$tr('ui.instant-picker.analyze-period', 'Analyze Period')"
|
|
16
|
+
:startDate="$props.startDate"
|
|
17
|
+
:endDate="$props.endDate"
|
|
18
|
+
:disabled="$props.disabled"
|
|
19
|
+
@update:startDate="$emit('update:startDate', $event)"
|
|
20
|
+
@update:endDate="$emit('update:endDate', $event)"
|
|
21
|
+
/>
|
|
22
|
+
<FSRow
|
|
23
|
+
padding="0 0 2px 0"
|
|
24
|
+
align="center-center"
|
|
25
|
+
>
|
|
26
|
+
<FSCol
|
|
27
|
+
width="fill"
|
|
28
|
+
>
|
|
29
|
+
<FSSlider
|
|
30
|
+
minWidth='min(300px, 90vw)'
|
|
31
|
+
:disabled="$props.disabled"
|
|
32
|
+
:color="ColorEnum.Light"
|
|
33
|
+
:thumbColor="ColorEnum.Primary"
|
|
34
|
+
:thumbSize="18"
|
|
35
|
+
:trackSize="8"
|
|
36
|
+
thumb-label="always"
|
|
37
|
+
:step="$props.stepTime"
|
|
38
|
+
:min="startTimestamp"
|
|
39
|
+
:max="endTimestamp"
|
|
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, index }"
|
|
56
|
+
>
|
|
57
|
+
<FSRow
|
|
58
|
+
v-if="index % Math.trunc(ticks.length / maximumTickToShow) === 0 || ticks.length < maximumTickToShow"
|
|
59
|
+
>
|
|
60
|
+
<FSText
|
|
61
|
+
:color="lightColors.dark"
|
|
62
|
+
font="text-overline"
|
|
63
|
+
>
|
|
64
|
+
{{ intervalTime <= 3600000
|
|
65
|
+
?
|
|
66
|
+
epochToShortTimeOnlyFormat(tick.value)
|
|
67
|
+
:
|
|
68
|
+
epochToDayMonthShortOnly(tick.value)
|
|
69
|
+
}}
|
|
70
|
+
</FSText>
|
|
71
|
+
</FSRow>
|
|
72
|
+
</template>
|
|
73
|
+
</FSSlider>
|
|
74
|
+
</FSCol>
|
|
75
|
+
<FSPlayButtons
|
|
76
|
+
v-if="$props.playable"
|
|
77
|
+
:disabled="$props.disabled"
|
|
78
|
+
:modelValue="playing"
|
|
79
|
+
@click:backward="onClickBackward"
|
|
80
|
+
@click:forward="onClickForward"
|
|
81
|
+
@update:modelValue="onPlayingChange"
|
|
82
|
+
/>
|
|
83
|
+
</FSRow>
|
|
84
|
+
</FSRow>
|
|
85
|
+
</FSBaseField>
|
|
86
|
+
</template>
|
|
87
|
+
|
|
88
|
+
<script lang="ts">
|
|
89
|
+
import { computed, defineComponent, ref, watch } from "vue";
|
|
90
|
+
|
|
91
|
+
import { useDateFormat, useDateExpression } from "@dative-gpi/foundation-shared-services/composables";
|
|
92
|
+
|
|
93
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
94
|
+
import { useBreakpoints, useColors } from '@dative-gpi/foundation-shared-components/composables';
|
|
95
|
+
|
|
96
|
+
import FSCol from '@dative-gpi/foundation-shared-components/components/FSCol.vue';
|
|
97
|
+
import FSSpan from '@dative-gpi/foundation-shared-components/components/FSSpan.vue';
|
|
98
|
+
import FSText from '@dative-gpi/foundation-shared-components/components/FSText.vue';
|
|
99
|
+
import FSSlider from '@dative-gpi/foundation-shared-components/components/FSSlider.vue';
|
|
100
|
+
import FSBaseField from '@dative-gpi/foundation-shared-components/components/fields/FSBaseField.vue';
|
|
101
|
+
import FSTermField from '@dative-gpi/foundation-shared-components/components/fields/FSTermField.vue';
|
|
102
|
+
import FSPlayButtons from '@dative-gpi/foundation-shared-components/components/FSPlayButtons.vue';
|
|
103
|
+
|
|
104
|
+
export default defineComponent({
|
|
105
|
+
name: "FSInstantPicker",
|
|
106
|
+
components: {
|
|
107
|
+
FSCol,
|
|
108
|
+
FSSpan,
|
|
109
|
+
FSText,
|
|
110
|
+
FSSlider,
|
|
111
|
+
FSTermField,
|
|
112
|
+
FSBaseField,
|
|
113
|
+
FSPlayButtons
|
|
114
|
+
},
|
|
115
|
+
props: {
|
|
116
|
+
label: {
|
|
117
|
+
type: String,
|
|
118
|
+
required: false,
|
|
119
|
+
},
|
|
120
|
+
modelValue: {
|
|
121
|
+
type: Number,
|
|
122
|
+
required: false,
|
|
123
|
+
default: 0,
|
|
124
|
+
},
|
|
125
|
+
startDate: {
|
|
126
|
+
type: String,
|
|
127
|
+
required: true
|
|
128
|
+
},
|
|
129
|
+
endDate: {
|
|
130
|
+
type: String,
|
|
131
|
+
required: true
|
|
132
|
+
},
|
|
133
|
+
description: {
|
|
134
|
+
type: String,
|
|
135
|
+
required: false,
|
|
136
|
+
default: null
|
|
137
|
+
},
|
|
138
|
+
hideHeader: {
|
|
139
|
+
type: Boolean,
|
|
140
|
+
required: false,
|
|
141
|
+
default: false
|
|
142
|
+
},
|
|
143
|
+
required: {
|
|
144
|
+
type: Boolean,
|
|
145
|
+
required: false,
|
|
146
|
+
default: false
|
|
147
|
+
},
|
|
148
|
+
disabled: {
|
|
149
|
+
type: Boolean,
|
|
150
|
+
required: false,
|
|
151
|
+
default: false
|
|
152
|
+
},
|
|
153
|
+
playable: {
|
|
154
|
+
type: Boolean,
|
|
155
|
+
required: false,
|
|
156
|
+
default: true
|
|
157
|
+
},
|
|
158
|
+
stepTime: {
|
|
159
|
+
type: Number,
|
|
160
|
+
required: false,
|
|
161
|
+
default: 60000
|
|
162
|
+
},
|
|
163
|
+
playingStepDuration: {
|
|
164
|
+
type: Number,
|
|
165
|
+
required: false,
|
|
166
|
+
default: 50
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
emits: ['update:modelValue', 'update:startDate', 'update:endDate'],
|
|
170
|
+
setup(props, { emit }) {
|
|
171
|
+
const { epochToShortTimeOnlyFormat, epochToShortDateFormat, epochToDayMonthShortOnly, epochToISO, epochToMonthShortTimeFormat } = useDateFormat();
|
|
172
|
+
const { convert : convertTermToEpoch } = useDateExpression();
|
|
173
|
+
const { isMobileSized, isExtraSmall } = useBreakpoints();
|
|
174
|
+
const { getColors } = useColors();
|
|
175
|
+
|
|
176
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
177
|
+
const playing = ref(false);
|
|
178
|
+
const playingInterval = ref();
|
|
179
|
+
|
|
180
|
+
const startTimestamp = computed(() => convertTermToEpoch(props.startDate));
|
|
181
|
+
const endTimestamp = computed(() => convertTermToEpoch(props.endDate));
|
|
182
|
+
|
|
183
|
+
const intervalTime = computed(() => {
|
|
184
|
+
const possibleIntervals = [60000, 3600000, 86400000];
|
|
185
|
+
|
|
186
|
+
const interval = possibleIntervals.find(interval => {
|
|
187
|
+
return (endTimestamp.value - startTimestamp.value) / interval < 100;
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
if (interval) {
|
|
191
|
+
return interval;
|
|
192
|
+
}
|
|
193
|
+
return 86400000;
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
const ticks = computed(() => {
|
|
197
|
+
const ticks: number[] = [];
|
|
198
|
+
|
|
199
|
+
const firstTick = Math.ceil(startTimestamp.value / intervalTime.value) * intervalTime.value;
|
|
200
|
+
for (let i = firstTick; i <= endTimestamp.value; i += intervalTime.value) {
|
|
201
|
+
ticks.push(i);
|
|
202
|
+
}
|
|
203
|
+
return ticks;
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
const maximumTickToShow = computed(() => {
|
|
207
|
+
if (isMobileSized.value) {
|
|
208
|
+
return 5;
|
|
209
|
+
}
|
|
210
|
+
if (isExtraSmall.value) {
|
|
211
|
+
return 4;
|
|
212
|
+
}
|
|
213
|
+
return 6;
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
const onPlayingChange = (value: boolean) => {
|
|
217
|
+
playing.value = value;
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const onClickBackward = () => {
|
|
221
|
+
emit('update:modelValue', startTimestamp.value);
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
const onClickForward = () => {
|
|
225
|
+
emit('update:modelValue', endTimestamp.value);
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
watch(() => [props.startDate, props.endDate], () => {
|
|
229
|
+
if(props.modelValue < startTimestamp.value || props.modelValue > endTimestamp.value) {
|
|
230
|
+
emit('update:modelValue', endTimestamp.value);
|
|
231
|
+
}
|
|
232
|
+
}, { immediate: true });
|
|
233
|
+
|
|
234
|
+
watch(playing, (value) => {
|
|
235
|
+
if(!value && playingInterval.value) {
|
|
236
|
+
clearInterval(playingInterval.value);
|
|
237
|
+
} else {
|
|
238
|
+
playingInterval.value = setInterval(() => {
|
|
239
|
+
if(props.modelValue + props.stepTime <= endTimestamp.value) {
|
|
240
|
+
emit('update:modelValue', props.modelValue + props.stepTime);
|
|
241
|
+
} else {
|
|
242
|
+
emit('update:modelValue', endTimestamp.value);
|
|
243
|
+
playing.value = false;
|
|
244
|
+
}
|
|
245
|
+
}, props.playingStepDuration);
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
return {
|
|
250
|
+
ticks,
|
|
251
|
+
playing,
|
|
252
|
+
ColorEnum,
|
|
253
|
+
lightColors,
|
|
254
|
+
intervalTime,
|
|
255
|
+
endTimestamp,
|
|
256
|
+
startTimestamp,
|
|
257
|
+
maximumTickToShow,
|
|
258
|
+
epochToISO,
|
|
259
|
+
onPlayingChange,
|
|
260
|
+
onClickForward,
|
|
261
|
+
onClickBackward,
|
|
262
|
+
epochToShortDateFormat,
|
|
263
|
+
epochToShortTimeOnlyFormat,
|
|
264
|
+
epochToDayMonthShortOnly,
|
|
265
|
+
epochToMonthShortTimeFormat
|
|
266
|
+
};
|
|
267
|
+
},
|
|
268
|
+
});
|
|
269
|
+
</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>
|