@dative-gpi/foundation-shared-components 1.0.35 → 1.0.37-report-v1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/FSBreadcrumbs.vue +21 -12
- package/components/FSButton.vue +10 -10
- package/components/FSCalendar.vue +52 -14
- package/components/FSCalendarTwin.vue +96 -40
- package/components/FSCard.vue +28 -7
- package/components/FSCardPlaceholder.vue +8 -5
- package/components/FSChip.vue +12 -2
- package/components/FSClickable.vue +12 -13
- package/components/FSClock.vue +16 -7
- 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 +47 -28
- package/components/FSDialogMenu.vue +17 -8
- package/components/FSDialogMultiFormBody.vue +77 -54
- package/components/FSDialogRemove.vue +8 -8
- package/components/FSDialogSubmit.vue +17 -8
- 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 +2 -1
- package/components/FSIconCard.vue +47 -7
- package/components/FSImage.vue +12 -4
- package/components/FSImageUI.vue +8 -15
- package/components/FSInstantPicker.vue +266 -0
- package/components/FSLink.vue +25 -9
- package/components/FSLoader.vue +28 -11
- package/components/FSOptionGroup.vue +51 -3
- package/components/FSPlayButtons.vue +72 -0
- package/components/FSProgressBar.vue +94 -0
- package/components/FSRouterLink.vue +42 -0
- package/components/FSSlideGroup.vue +19 -5
- package/components/FSSpan.vue +17 -7
- package/components/FSSwitch.vue +57 -27
- package/components/FSTab.vue +15 -13
- package/components/FSTabs.vue +32 -7
- package/components/FSTag.vue +14 -3
- package/components/FSTagGroup.vue +1 -1
- package/components/FSText.vue +11 -7
- package/components/FSWindow.vue +128 -4
- package/components/FSWrapGroup.vue +13 -1
- package/components/agenda/FSAgenda.vue +223 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +215 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +174 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +164 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +199 -0
- package/components/agenda/FSMonthAgenda.vue +252 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +323 -0
- package/components/autocompletes/FSAutoCompleteAddress.vue +22 -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/FSButtonCopy.vue +1 -1
- package/components/buttons/FSButtonCopyLabel.vue +1 -1
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- 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 +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +19 -47
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +35 -61
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +9 -3
- package/components/deviceOrganisations/FSWorstAlert.vue +30 -37
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -85
- package/components/fields/FSAutocompleteField.vue +445 -463
- package/components/fields/FSAutocompleteTag.vue +1 -1
- package/components/fields/FSBaseField.vue +44 -27
- package/components/fields/FSColorField.vue +42 -39
- package/components/fields/FSCommentField.vue +105 -0
- package/components/fields/FSDateField.vue +3 -2
- package/components/fields/FSDateRangeField.vue +3 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +8 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +0 -1
- package/components/fields/FSMagicConfigField.vue +10 -3
- package/components/fields/FSMagicField.vue +9 -4
- package/components/fields/FSNumberField.vue +6 -1
- package/components/fields/FSRichTextField.vue +102 -52
- package/components/fields/FSSearchField.vue +9 -115
- package/components/fields/FSSelectField.vue +477 -252
- package/components/fields/FSTagField.vue +1 -1
- package/components/fields/FSTermField.vue +42 -17
- package/components/fields/FSTextArea.vue +26 -7
- package/components/fields/FSTextField.vue +8 -3
- package/components/fields/FSTimeRangeField.vue +304 -0
- package/components/fields/FSTimeStepField.vue +3 -3
- package/components/fields/FSTranslateField.vue +4 -3
- package/components/fields/FSTranslateRichTextField.vue +32 -12
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/periodicField/FSPeriodicDailyField.vue +2 -2
- package/components/fields/periodicField/FSPeriodicField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +8 -8
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +23 -13
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +6 -6
- package/components/lists/FSDataTableUI.vue +173 -103
- package/components/lists/FSDraggable.vue +2 -2
- package/components/lists/FSFilterButton.vue +7 -11
- package/components/lists/FSHeaderButton.vue +4 -4
- package/components/lists/FSHiddenButton.vue +3 -5
- package/components/lists/FSLoadDataTable.vue +10 -7
- package/components/lists/FSSimpleList.vue +234 -0
- package/components/lists/FSSimpleListItem.vue +132 -0
- package/components/map/FSMap.vue +83 -33
- package/components/map/FSMapFeatureGroup.vue +2 -2
- package/components/map/FSMapLayerButton.vue +3 -3
- package/components/map/FSMapMarker.vue +11 -7
- package/components/map/FSMapMarkerClusterGroup.vue +8 -3
- package/components/map/FSMapOverlay.vue +37 -20
- package/components/map/FSMapPolygon.vue +5 -5
- package/components/map/FSMapTileLayer.vue +2 -2
- package/components/map/keys.ts +3 -3
- package/components/selects/FSSelectAutoRefresh.vue +9 -9
- package/components/selects/FSSelectDashboardVariableType.vue +5 -4
- package/components/selects/FSSelectDateSetting.vue +3 -2
- package/components/selects/FSSelectDays.vue +9 -9
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +14 -14
- 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 +111 -0
- package/components/tiles/FSCommentTileUI.vue +174 -0
- package/components/tiles/FSDeviceOrganisationTileUI.vue +6 -0
- package/components/tiles/FSGroupTileUI.vue +2 -2
- package/components/tiles/FSLoadTile.vue +2 -0
- package/components/tiles/FSLocationTileUI.vue +192 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSSimpleTileUI.vue +9 -4
- package/components/tiles/FSTile.vue +93 -74
- package/components/tiles/FSUserOrganisationTileUI.vue +1 -1
- package/components/toggleSets/FSToggleSetPosition.vue +2 -2
- 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 +209 -0
- package/components/views/mobile/FSBaseDefaultMobileView.vue +133 -0
- package/components/views/mobile/FSBaseEntityMobileView.vue +199 -0
- package/components/views/mobile/FSBaseMobileView.vue +53 -0
- package/composables/useBreakpoints.ts +39 -3
- package/composables/useColors.ts +3 -2
- package/composables/useMagicFieldProvider.ts +1 -0
- package/composables/useSlots.ts +2 -1
- package/models/agenda.ts +9 -0
- package/models/deviceAlerts.ts +1 -1
- package/models/deviceConnectivities.ts +1 -1
- package/models/index.ts +1 -0
- package/models/magicFields.ts +1 -0
- package/models/map.ts +2 -2
- package/models/rules.ts +8 -5
- package/models/tables.ts +5 -2
- package/models/variableNode.ts +8 -5
- package/package.json +5 -5
- package/styles/components/fs_agenda.scss +36 -0
- package/styles/components/fs_agenda_event.scss +41 -0
- package/styles/components/fs_agenda_hours_col.scss +4 -0
- package/styles/components/fs_agenda_hours_row.scss +5 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- 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_chip.scss +8 -6
- package/styles/components/fs_clickable.scss +18 -23
- package/styles/components/fs_clock.scss +0 -10
- package/styles/components/fs_color_field.scss +1 -4
- package/styles/components/fs_data_iterator_item.scss +12 -10
- package/styles/components/fs_data_table.scss +6 -9
- package/styles/components/fs_dialog.scss +7 -17
- package/styles/components/fs_dialog_menu.scss +4 -2
- 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_gradient_field.scss +11 -11
- 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 +11 -7
- 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 -9
- package/styles/components/fs_select_date_settings.scss +3 -0
- 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 -4
- 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 +13 -17
- package/styles/components/fs_tile.scss +21 -15
- package/styles/components/fs_window.scss +7 -0
- package/styles/components/fs_wrap_group.scss +7 -0
- package/styles/components/index.scss +6 -4
- package/styles/globals/index.scss +1 -5
- package/styles/globals/overrides.scss +28 -61
- package/styles/globals/scrollbars.scss +10 -0
- package/styles/globals/text_fonts.scss +18 -66
- package/tools/alertsTools.ts +69 -0
- package/tools/chartsTools.ts +427 -0
- package/tools/index.ts +4 -0
- package/tools/reportsTools.ts +38 -0
- package/tools/timeRangeTools.ts +125 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +4 -4
- package/utils/operations.ts +69 -0
- package/utils/sort.ts +2 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +17 -17
- 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_icon_field.scss +0 -12
- 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/FSWindow.vue
CHANGED
|
@@ -1,8 +1,54 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<template
|
|
3
|
+
v-if="showError"
|
|
4
|
+
>
|
|
5
|
+
<slot
|
|
6
|
+
name="error"
|
|
7
|
+
v-bind="{ goBack, width: $props.width, height: $props.height }"
|
|
8
|
+
>
|
|
9
|
+
<FSRow
|
|
10
|
+
padding="16px"
|
|
11
|
+
:width="$props.width"
|
|
12
|
+
>
|
|
13
|
+
<FSCol
|
|
14
|
+
align="center-center"
|
|
15
|
+
gap="16px"
|
|
16
|
+
>
|
|
17
|
+
<FSCol
|
|
18
|
+
align="center-center"
|
|
19
|
+
>
|
|
20
|
+
<FSIcon
|
|
21
|
+
size="42px"
|
|
22
|
+
:color="ColorEnum.Error"
|
|
23
|
+
>
|
|
24
|
+
mdi-alert-outline
|
|
25
|
+
</FSIcon>
|
|
26
|
+
<FSText
|
|
27
|
+
font="text-h3"
|
|
28
|
+
>
|
|
29
|
+
{{ $tr("window.no-access-title", "Nothing to see here") }}
|
|
30
|
+
</FSText>
|
|
31
|
+
</FSCol>
|
|
32
|
+
<FSText
|
|
33
|
+
:lineClamp="2"
|
|
34
|
+
>
|
|
35
|
+
{{ $tr("window.no-access-body", "It seems you either do not have access to this content, or there is nothing to display here") }}
|
|
36
|
+
</FSText>
|
|
37
|
+
<FSButton
|
|
38
|
+
:label="$tr('window.no-access-button', 'Go back')"
|
|
39
|
+
:color="ColorEnum.Primary"
|
|
40
|
+
@click="goBack"
|
|
41
|
+
/>
|
|
42
|
+
</FSCol>
|
|
43
|
+
</FSRow>
|
|
44
|
+
</slot>
|
|
45
|
+
</template>
|
|
2
46
|
<v-window
|
|
3
47
|
class="fs-window"
|
|
4
|
-
|
|
48
|
+
ref="windowRef"
|
|
5
49
|
:touch="false"
|
|
50
|
+
:style="style"
|
|
51
|
+
:modelValue="$props.modelValue"
|
|
6
52
|
v-bind="$attrs"
|
|
7
53
|
>
|
|
8
54
|
<template
|
|
@@ -16,6 +62,7 @@
|
|
|
16
62
|
</template>
|
|
17
63
|
<v-window-item
|
|
18
64
|
v-for="(component, index) in getChildren()"
|
|
65
|
+
class="fs-window-item"
|
|
19
66
|
:value="value(component, index)"
|
|
20
67
|
:key="index"
|
|
21
68
|
>
|
|
@@ -27,37 +74,114 @@
|
|
|
27
74
|
</template>
|
|
28
75
|
|
|
29
76
|
<script lang="ts">
|
|
30
|
-
import { computed, defineComponent, type PropType, type StyleValue, type VNode } from "vue";
|
|
77
|
+
import { computed, defineComponent, type PropType, ref, type StyleValue, type VNode, watch } from "vue";
|
|
31
78
|
|
|
32
79
|
import { useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
33
80
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
34
81
|
|
|
82
|
+
import { ColorEnum } from "../models";
|
|
83
|
+
|
|
84
|
+
import FSButton from "./FSButton.vue";
|
|
85
|
+
import FSCard from "./FSCard.vue";
|
|
86
|
+
import FSIcon from "./FSIcon.vue";
|
|
87
|
+
import FSText from "./FSText.vue";
|
|
88
|
+
import FSRow from "./FSRow.vue";
|
|
89
|
+
|
|
35
90
|
export default defineComponent({
|
|
36
91
|
name: "FSWindow",
|
|
92
|
+
components: {
|
|
93
|
+
FSButton,
|
|
94
|
+
FSCard,
|
|
95
|
+
FSIcon,
|
|
96
|
+
FSText,
|
|
97
|
+
FSRow
|
|
98
|
+
},
|
|
37
99
|
props: {
|
|
38
100
|
width: {
|
|
39
101
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
40
102
|
required: false,
|
|
41
103
|
default: null
|
|
104
|
+
},
|
|
105
|
+
height: {
|
|
106
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
107
|
+
required: false,
|
|
108
|
+
default: null
|
|
109
|
+
},
|
|
110
|
+
modelValue: {
|
|
111
|
+
type: [String, Number, Object] as PropType<any>,
|
|
112
|
+
required: false,
|
|
113
|
+
default: 0
|
|
42
114
|
}
|
|
43
115
|
},
|
|
44
|
-
|
|
116
|
+
emits: ["update:modelValue", "error"],
|
|
117
|
+
setup(props, { emit }) {
|
|
45
118
|
const { slots, getChildren } = useSlots();
|
|
46
119
|
|
|
47
120
|
delete slots.default;
|
|
48
121
|
|
|
122
|
+
const windowRef = ref<any | null>(null);
|
|
123
|
+
|
|
124
|
+
const showOverflow = ref(true);
|
|
125
|
+
const overflowTimeout = ref<NodeJS.Timeout | null>(null);
|
|
126
|
+
|
|
49
127
|
const style = computed((): StyleValue => ({
|
|
50
|
-
"--fs-window-
|
|
128
|
+
"--fs-window-overflow": showOverflow.value ? "visible" : "hidden",
|
|
129
|
+
"--fs-window-height" : sizeToVar(props.height),
|
|
130
|
+
"--fs-window-width" : sizeToVar(props.width)
|
|
51
131
|
}));
|
|
52
132
|
|
|
53
133
|
const value = (component: VNode, index: number): any => {
|
|
54
134
|
return component?.props?.value ?? index;
|
|
55
135
|
};
|
|
56
136
|
|
|
137
|
+
// Hide horizontal overflow when switching windows, otherwise let it visible for the FSFadeOut scrollbar
|
|
138
|
+
watch(() => props.modelValue, (): void => {
|
|
139
|
+
showOverflow.value = false;
|
|
140
|
+
if (overflowTimeout.value) {
|
|
141
|
+
clearTimeout(overflowTimeout.value);
|
|
142
|
+
}
|
|
143
|
+
overflowTimeout.value = setTimeout(() => {
|
|
144
|
+
showOverflow.value = true;
|
|
145
|
+
}, 560);
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
const showError = computed((): boolean => {
|
|
149
|
+
if (!windowRef.value) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/components/VWindow/VWindow.tsx
|
|
154
|
+
// https://github.com/vuetifyjs/vuetify/blob/master/packages/vuetify/src/composables/group.ts#L161
|
|
155
|
+
const group = windowRef.value.group;
|
|
156
|
+
|
|
157
|
+
if (!group.items.value.length) {
|
|
158
|
+
return false;
|
|
159
|
+
}
|
|
160
|
+
return !group.items.value.find((item: any) => item.value === props.modelValue);
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
const goBack = (): void => {
|
|
164
|
+
if (!windowRef.value) {
|
|
165
|
+
emit("error");
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const group = windowRef.value.group;
|
|
170
|
+
if (!group.items.value.length) {
|
|
171
|
+
emit("error");
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
emit("update:modelValue", group.items.value[0].value);
|
|
175
|
+
};
|
|
176
|
+
|
|
57
177
|
return {
|
|
178
|
+
ColorEnum,
|
|
179
|
+
windowRef,
|
|
180
|
+
showError,
|
|
58
181
|
slots,
|
|
59
182
|
style,
|
|
60
183
|
getChildren,
|
|
184
|
+
goBack,
|
|
61
185
|
value
|
|
62
186
|
};
|
|
63
187
|
}
|
|
@@ -29,6 +29,16 @@ import { uuidv4 } from "@dative-gpi/bones-ui/tools/uuid";
|
|
|
29
29
|
export default defineComponent({
|
|
30
30
|
name: "FSWrapGroup",
|
|
31
31
|
props: {
|
|
32
|
+
height: {
|
|
33
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
34
|
+
required: false,
|
|
35
|
+
default: "fit-content"
|
|
36
|
+
},
|
|
37
|
+
width: {
|
|
38
|
+
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
39
|
+
required: false,
|
|
40
|
+
default: "fit-content"
|
|
41
|
+
},
|
|
32
42
|
padding: {
|
|
33
43
|
type: [Array, String, Number] as PropType<string[] | number[] | string | number | null>,
|
|
34
44
|
required: false,
|
|
@@ -55,7 +65,9 @@ export default defineComponent({
|
|
|
55
65
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
56
66
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
57
67
|
"--fs-group-color" : darks.soft,
|
|
58
|
-
"--fs-group-hover-color": darks.dark
|
|
68
|
+
"--fs-group-hover-color": darks.dark,
|
|
69
|
+
"--fs-group-height" : sizeToVar(props.height),
|
|
70
|
+
"--fs-group-width" : sizeToVar(props.width)
|
|
59
71
|
}));
|
|
60
72
|
|
|
61
73
|
onMounted((): void => {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol
|
|
3
|
+
v-if="$props.start && $props.end"
|
|
4
|
+
:height="$props.height"
|
|
5
|
+
:width="$props.width"
|
|
6
|
+
gap="24px"
|
|
7
|
+
>
|
|
8
|
+
<FSAgendaHeader
|
|
9
|
+
:mode="$props.mode!"
|
|
10
|
+
:start="$props.start"
|
|
11
|
+
:end="$props.end"
|
|
12
|
+
:now="now"
|
|
13
|
+
@update:start="($event) => $emit('update:start', $event)"
|
|
14
|
+
@update:end="($event) => $emit('update:end', $event)"
|
|
15
|
+
@update:mode="($event) => $emit('update:mode', $event)"
|
|
16
|
+
/>
|
|
17
|
+
<FSCol
|
|
18
|
+
class="fs-agenda-view"
|
|
19
|
+
height="100%"
|
|
20
|
+
gap="0"
|
|
21
|
+
>
|
|
22
|
+
<FSWindow
|
|
23
|
+
v-if="$props.mode"
|
|
24
|
+
:modelValue="$props.mode"
|
|
25
|
+
width="100%"
|
|
26
|
+
height="100%"
|
|
27
|
+
>
|
|
28
|
+
<FSDayAgenda
|
|
29
|
+
:value="AgendaMode.Day"
|
|
30
|
+
:events="$props.events"
|
|
31
|
+
:firstColumnWidth="dayColumnWidth"
|
|
32
|
+
:start="$props.start"
|
|
33
|
+
:end="$props.end"
|
|
34
|
+
:now="now"
|
|
35
|
+
:nowIsInSelectedRange="nowIsInSelectedRange"
|
|
36
|
+
:loading="$props.loading"
|
|
37
|
+
@click:event-id="$emit('click:eventId', $event)"
|
|
38
|
+
>
|
|
39
|
+
<FSAgendaVerticalTimeLineMarker
|
|
40
|
+
v-if="nowIsInSelectedRange"
|
|
41
|
+
:modelValue="now"
|
|
42
|
+
/>
|
|
43
|
+
</FSDayAgenda>
|
|
44
|
+
<FSWeekAgenda
|
|
45
|
+
:value="AgendaMode.Week"
|
|
46
|
+
:events="$props.events"
|
|
47
|
+
:firstColumnWidth="dayColumnWidth"
|
|
48
|
+
:start="$props.start"
|
|
49
|
+
:end="$props.end"
|
|
50
|
+
:now="now"
|
|
51
|
+
:nowIsInSelectedRange="nowIsInSelectedRange"
|
|
52
|
+
:loading="$props.loading"
|
|
53
|
+
@click:event-id="$emit('click:eventId', $event)"
|
|
54
|
+
>
|
|
55
|
+
<FSAgendaHorizontalTimeLineMarker
|
|
56
|
+
v-if="nowIsInSelectedRange"
|
|
57
|
+
:modelValue="now"
|
|
58
|
+
/>
|
|
59
|
+
</FSWeekAgenda>
|
|
60
|
+
<FSMonthAgenda
|
|
61
|
+
:value="AgendaMode.Month"
|
|
62
|
+
:events="$props.events"
|
|
63
|
+
:firstColumnWidth="dayColumnWidth"
|
|
64
|
+
:start="$props.start"
|
|
65
|
+
:end="$props.end"
|
|
66
|
+
:now="now"
|
|
67
|
+
:nowIsInSelectedRange="nowIsInSelectedRange"
|
|
68
|
+
:loading="$props.loading"
|
|
69
|
+
@click:event-id="$emit('click:eventId', $event)"
|
|
70
|
+
>
|
|
71
|
+
<FSAgendaHorizontalTimeLineMarker
|
|
72
|
+
v-if="nowIsInSelectedRange"
|
|
73
|
+
:modelValue="now"
|
|
74
|
+
/>
|
|
75
|
+
</FSMonthAgenda>
|
|
76
|
+
</FSWindow>
|
|
77
|
+
</FSCol>
|
|
78
|
+
</FSCol>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script lang="ts">
|
|
82
|
+
import { defineComponent, type PropType, computed, ref, onUnmounted, watch, onMounted } from 'vue';
|
|
83
|
+
|
|
84
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
85
|
+
import { useBreakpoints } from "@dative-gpi/foundation-shared-components/composables";
|
|
86
|
+
|
|
87
|
+
import type { FSAgendaEvent } from "@dative-gpi/foundation-shared-components/models";
|
|
88
|
+
import { AgendaMode } from '@dative-gpi/foundation-shared-domain/enums/agendas';
|
|
89
|
+
|
|
90
|
+
import FSAgendaVerticalTimeLineMarker from './FSAgendaVerticalTimeLineMarker.vue';
|
|
91
|
+
import FSMonthAgenda from './FSMonthAgenda.vue';
|
|
92
|
+
import FSWeekAgenda from './FSWeekAgenda.vue';
|
|
93
|
+
import FSDayAgenda from './FSDayAgenda.vue';
|
|
94
|
+
import FSAgendaHorizontalTimeLineMarker from './FSAgendaHorizontalTimeLineMarker.vue';
|
|
95
|
+
import FSAgendaHeader from './FSAgendaHeader.vue';
|
|
96
|
+
import FSWindow from '../FSWindow.vue';
|
|
97
|
+
import FSCol from '../FSCol.vue';
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
export default defineComponent({
|
|
101
|
+
name: 'FSAgenda',
|
|
102
|
+
components: {
|
|
103
|
+
FSAgendaHeader,
|
|
104
|
+
FSAgendaHorizontalTimeLineMarker,
|
|
105
|
+
FSAgendaVerticalTimeLineMarker,
|
|
106
|
+
FSCol,
|
|
107
|
+
FSDayAgenda,
|
|
108
|
+
FSMonthAgenda,
|
|
109
|
+
FSWeekAgenda,
|
|
110
|
+
FSWindow
|
|
111
|
+
},
|
|
112
|
+
props: {
|
|
113
|
+
mode: {
|
|
114
|
+
type: Number as PropType<AgendaMode>,
|
|
115
|
+
default: AgendaMode.Week
|
|
116
|
+
},
|
|
117
|
+
height: {
|
|
118
|
+
type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
|
|
119
|
+
required: false,
|
|
120
|
+
default: "100%"
|
|
121
|
+
},
|
|
122
|
+
width: {
|
|
123
|
+
type: [Array, String, Number] as PropType<"hug" | "fill" | string[] | number[] | string | number | null>,
|
|
124
|
+
required: false,
|
|
125
|
+
default: "100%"
|
|
126
|
+
},
|
|
127
|
+
loading: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: false
|
|
130
|
+
},
|
|
131
|
+
events: {
|
|
132
|
+
type: Array as PropType<FSAgendaEvent[]>,
|
|
133
|
+
default: () => []
|
|
134
|
+
},
|
|
135
|
+
start: {
|
|
136
|
+
type: Number as PropType<number | null>,
|
|
137
|
+
required: false
|
|
138
|
+
},
|
|
139
|
+
end: {
|
|
140
|
+
type: Number as PropType<number | null>,
|
|
141
|
+
required: false
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
emits: ['update', 'update:mode', 'click:eventId', 'update:start', 'update:end'],
|
|
145
|
+
setup(props, { emit }) {
|
|
146
|
+
const { todayToEpoch, epochToLocalDayStart, epochToLocalDayEnd } = useDateFormat();
|
|
147
|
+
const { isExtraSmall } = useBreakpoints();
|
|
148
|
+
|
|
149
|
+
const dayColumnWidth = '46px';
|
|
150
|
+
|
|
151
|
+
const now = ref(todayToEpoch());
|
|
152
|
+
const defaultMode = ref(props.mode);
|
|
153
|
+
|
|
154
|
+
const nowIsInSelectedRange = computed(() => {
|
|
155
|
+
if (!props.start || !props.end) {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
return now.value >= props.start && now.value <= props.end;
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
const nowInterval = setInterval(() => {
|
|
162
|
+
now.value = todayToEpoch();
|
|
163
|
+
}, 10000);
|
|
164
|
+
|
|
165
|
+
onMounted(() => {
|
|
166
|
+
if(props.end && props.start) {
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
169
|
+
if (props.mode === AgendaMode.Week) {
|
|
170
|
+
const newStart = epochToLocalDayStart(now.value - (new Date(now.value).getDay() - 1) * 24 * 60 * 60 * 1000);
|
|
171
|
+
const newEnd = epochToLocalDayEnd(now.value + (7 - new Date(now.value).getDay()) * 24 * 60 * 60 * 1000);
|
|
172
|
+
emit("update:start", newStart);
|
|
173
|
+
emit("update:end", newEnd);
|
|
174
|
+
emit("update", { start: newStart, end: newEnd, mode: props.mode });
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (props.mode === AgendaMode.Month) {
|
|
178
|
+
const lastDayOfMonth = new Date(new Date(now.value).getFullYear(), new Date(now.value).getMonth() + 1, 0);
|
|
179
|
+
const newStart = epochToLocalDayStart(new Date(now.value).setDate(1));
|
|
180
|
+
const newEnd = lastDayOfMonth.getTime()
|
|
181
|
+
emit("update:start", newStart);
|
|
182
|
+
emit("update:end", newEnd );
|
|
183
|
+
emit("update", { start: newStart, end: newEnd, mode: props.mode });
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const newStart = epochToLocalDayStart(now.value);
|
|
187
|
+
const newEnd = epochToLocalDayEnd(now.value);
|
|
188
|
+
emit("update:start", newStart);
|
|
189
|
+
emit("update:end", newEnd);
|
|
190
|
+
emit("update", { start: newStart, end: newEnd, mode: props.mode });
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
onUnmounted(() => {
|
|
194
|
+
clearInterval(nowInterval);
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
watch(isExtraSmall, (value) => {
|
|
198
|
+
if (value && props.mode !== AgendaMode.Day) {
|
|
199
|
+
emit('update:mode', AgendaMode.Day);
|
|
200
|
+
emit("update", {
|
|
201
|
+
start: props.start,
|
|
202
|
+
end: props.end,
|
|
203
|
+
mode: AgendaMode.Day
|
|
204
|
+
});
|
|
205
|
+
} else if (!value && defaultMode.value !== AgendaMode.Day) {
|
|
206
|
+
emit('update:mode', defaultMode.value);
|
|
207
|
+
emit("update", {
|
|
208
|
+
start: props.start,
|
|
209
|
+
end: props.end,
|
|
210
|
+
mode: defaultMode.value
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
return {
|
|
216
|
+
AgendaMode,
|
|
217
|
+
dayColumnWidth,
|
|
218
|
+
now,
|
|
219
|
+
nowIsInSelectedRange
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
</script>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSDialog
|
|
3
|
+
:modelValue="$props.dialog"
|
|
4
|
+
@update:modelValue="$emit('update:dialog', $event)"
|
|
5
|
+
>
|
|
6
|
+
<FSCard
|
|
7
|
+
:elevation="true"
|
|
8
|
+
>
|
|
9
|
+
<FSCol
|
|
10
|
+
padding="16px"
|
|
11
|
+
gap="12px"
|
|
12
|
+
>
|
|
13
|
+
<FSCalendar
|
|
14
|
+
v-model="calendarValue"
|
|
15
|
+
/>
|
|
16
|
+
<FSButton
|
|
17
|
+
color="primary"
|
|
18
|
+
width="100%"
|
|
19
|
+
:label="$tr('ui.common.submit', 'Validate')"
|
|
20
|
+
@click="onSubmit"
|
|
21
|
+
/>
|
|
22
|
+
</FSCol>
|
|
23
|
+
</FSCard>
|
|
24
|
+
</FSDialog>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<script lang="ts">
|
|
28
|
+
import { defineComponent, ref, watch } from 'vue';
|
|
29
|
+
|
|
30
|
+
import FSCalendar from '../FSCalendar.vue';
|
|
31
|
+
import FSButton from '../FSButton.vue';
|
|
32
|
+
import FSCard from '../FSCard.vue';
|
|
33
|
+
import FSCol from '../FSCol.vue';
|
|
34
|
+
import FSDialog from '../FSDialog.vue';
|
|
35
|
+
|
|
36
|
+
export default defineComponent({
|
|
37
|
+
name: 'FSAgendaDialogCalendar',
|
|
38
|
+
components: {
|
|
39
|
+
FSCalendar,
|
|
40
|
+
FSButton,
|
|
41
|
+
FSCard,
|
|
42
|
+
FSCol,
|
|
43
|
+
FSDialog,
|
|
44
|
+
},
|
|
45
|
+
props: {
|
|
46
|
+
dialog: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
required: true,
|
|
49
|
+
},
|
|
50
|
+
modelValue: {
|
|
51
|
+
type: Number,
|
|
52
|
+
required: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
emits: ['update:modelValue', 'update:dialog'],
|
|
56
|
+
setup(props, { emit }) {
|
|
57
|
+
const calendarValue = ref<number>(props.modelValue);
|
|
58
|
+
|
|
59
|
+
const onSubmit = () => {
|
|
60
|
+
emit('update:modelValue', calendarValue.value);
|
|
61
|
+
emit('update:dialog', false);
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
watch(() => props.modelValue, (newValue) => {
|
|
65
|
+
if (newValue) {
|
|
66
|
+
calendarValue.value = newValue;
|
|
67
|
+
}
|
|
68
|
+
}, {immediate: true});
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
calendarValue,
|
|
72
|
+
onSubmit
|
|
73
|
+
};
|
|
74
|
+
},
|
|
75
|
+
});
|
|
76
|
+
</script>
|