@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
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSAgendaVerticalEvent
|
|
3
|
+
v-if="$props.variant === 'current'"
|
|
4
|
+
:key="$props.id"
|
|
5
|
+
variant="future"
|
|
6
|
+
:now="$props.now"
|
|
7
|
+
:dayStart="$props.dayStart"
|
|
8
|
+
:label="$props.label"
|
|
9
|
+
:start="$props.start"
|
|
10
|
+
:end="$props.end"
|
|
11
|
+
:icon="$props.icon"
|
|
12
|
+
:iconBis="$props.iconBis"
|
|
13
|
+
:id="$props.id"
|
|
14
|
+
:color="$props.color"
|
|
15
|
+
@click="$emit('click', $props.id)"
|
|
16
|
+
>
|
|
17
|
+
<template
|
|
18
|
+
#default="{ label, icon, timeStart, timeEnd, iconBis, variant }"
|
|
19
|
+
>
|
|
20
|
+
<slot
|
|
21
|
+
name="default"
|
|
22
|
+
:label="label"
|
|
23
|
+
:icon="icon"
|
|
24
|
+
:iconBis="iconBis"
|
|
25
|
+
:timeStart="timeStart"
|
|
26
|
+
:timeEnd="timeEnd"
|
|
27
|
+
:variant="variant"
|
|
28
|
+
/>
|
|
29
|
+
</template>
|
|
30
|
+
</FSAgendaVerticalEvent>
|
|
31
|
+
<FSClickable
|
|
32
|
+
v-if="$props.variant !== 'current' || $props.dayStart < $props.now"
|
|
33
|
+
:class="`fs-agenda-event fs-agenda-vertical-event fs-agenda-event-${$props.variant}`"
|
|
34
|
+
:variant="$props.variant === 'current' ? 'full' : 'standard'"
|
|
35
|
+
:style="style"
|
|
36
|
+
:color="$props.color"
|
|
37
|
+
:height="`${height}%`"
|
|
38
|
+
width="100%"
|
|
39
|
+
:border="false"
|
|
40
|
+
@click="$emit('click', $props.id)"
|
|
41
|
+
>
|
|
42
|
+
<slot
|
|
43
|
+
name="default"
|
|
44
|
+
:label="label"
|
|
45
|
+
:icon="icon"
|
|
46
|
+
:iconBis="iconBis"
|
|
47
|
+
:timeStart="epochToShortTimeOnlyFormat($props.start)"
|
|
48
|
+
:timeEnd="epochToShortTimeOnlyFormat($props.end)"
|
|
49
|
+
:variant="$props.variant"
|
|
50
|
+
/>
|
|
51
|
+
</FSClickable>
|
|
52
|
+
</template>
|
|
53
|
+
|
|
54
|
+
<script lang="ts">
|
|
55
|
+
import { defineComponent, computed, type StyleValue, type PropType } from 'vue';
|
|
56
|
+
|
|
57
|
+
import { useDateFormat } from "@dative-gpi/foundation-shared-services/composables";
|
|
58
|
+
|
|
59
|
+
import FSClickable from '../FSClickable.vue';
|
|
60
|
+
|
|
61
|
+
export default defineComponent({
|
|
62
|
+
name: 'FSAgendaVerticalEvent',
|
|
63
|
+
components: {
|
|
64
|
+
FSClickable
|
|
65
|
+
},
|
|
66
|
+
emits: ['click'],
|
|
67
|
+
props: {
|
|
68
|
+
variant: {
|
|
69
|
+
type: String as PropType<'past' | 'current' | 'future'>,
|
|
70
|
+
default: 'future'
|
|
71
|
+
},
|
|
72
|
+
label: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: true
|
|
75
|
+
},
|
|
76
|
+
start: {
|
|
77
|
+
type: Number,
|
|
78
|
+
required: true
|
|
79
|
+
},
|
|
80
|
+
end: {
|
|
81
|
+
type: Number,
|
|
82
|
+
required: true
|
|
83
|
+
},
|
|
84
|
+
icon: {
|
|
85
|
+
type: String,
|
|
86
|
+
required: false
|
|
87
|
+
},
|
|
88
|
+
iconBis: {
|
|
89
|
+
type: String,
|
|
90
|
+
required: false
|
|
91
|
+
},
|
|
92
|
+
id: {
|
|
93
|
+
type: String,
|
|
94
|
+
required: true
|
|
95
|
+
},
|
|
96
|
+
color: {
|
|
97
|
+
type: String,
|
|
98
|
+
required: true
|
|
99
|
+
},
|
|
100
|
+
dayStart: {
|
|
101
|
+
type: Number,
|
|
102
|
+
required: true
|
|
103
|
+
},
|
|
104
|
+
now: {
|
|
105
|
+
type: Number,
|
|
106
|
+
required: true
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
setup(props) {
|
|
110
|
+
const { dayToMillisecond, epochToShortTimeOnlyFormat, millisecondToDay } = useDateFormat();
|
|
111
|
+
|
|
112
|
+
const dayEnd = computed(() => {
|
|
113
|
+
return new Date(props.dayStart).setHours(23, 59, 59, 999);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const dayDuration = computed(() => {
|
|
117
|
+
return dayEnd.value - props.dayStart;
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const dayDurationOffset = computed(() => {
|
|
121
|
+
return dayDuration.value - dayToMillisecond(1);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const topPosition = computed(() => {
|
|
125
|
+
if (props.start < props.dayStart) {
|
|
126
|
+
return 0;
|
|
127
|
+
}
|
|
128
|
+
return millisecondToDay(props.start - props.dayStart - dayDurationOffset.value) * 100;
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
const height = computed(() => {
|
|
132
|
+
let start = props.start - dayDurationOffset.value;
|
|
133
|
+
let end = props.end - dayDurationOffset.value;
|
|
134
|
+
if (props.variant === 'current' && dayEnd.value > props.now) {
|
|
135
|
+
end = props.now;
|
|
136
|
+
} else if (props.end > dayEnd.value) {
|
|
137
|
+
end = dayEnd.value - dayDurationOffset.value;
|
|
138
|
+
}
|
|
139
|
+
if (props.start < props.dayStart) {
|
|
140
|
+
start = props.dayStart;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const duration = millisecondToDay(end - start);
|
|
144
|
+
return duration > 0 ? (duration * 100) : 0;
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const style = computed((): StyleValue => {
|
|
148
|
+
return {
|
|
149
|
+
'--fs-agenda-event-top': `${topPosition.value}%`,
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
style,
|
|
155
|
+
height,
|
|
156
|
+
epochToShortTimeOnlyFormat
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
</script>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="fs-agenda-vertical-time-line-marker"
|
|
4
|
+
:style="style"
|
|
5
|
+
>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script lang="ts">
|
|
10
|
+
import { defineComponent, computed, type StyleValue } from 'vue';
|
|
11
|
+
|
|
12
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
13
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
14
|
+
|
|
15
|
+
export default defineComponent({
|
|
16
|
+
name: 'FSAgendaVerticalTimeLineMarker',
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: Number,
|
|
20
|
+
required: true,
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
setup(props) {
|
|
24
|
+
const { getColors } = useColors();
|
|
25
|
+
|
|
26
|
+
const primaryColor = getColors(ColorEnum.Primary);
|
|
27
|
+
|
|
28
|
+
const nowDate = computed(() => {
|
|
29
|
+
return new Date(props.modelValue);
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const topOffset = computed(() => {
|
|
33
|
+
return nowDate.value.getHours() * 100 / 24 + nowDate.value.getMinutes() * 100 / 24 / 60;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const style = computed((): StyleValue => ({
|
|
37
|
+
"--fs-agenda-vertical-time-line-marker-top": `${topOffset.value}%`,
|
|
38
|
+
"--fs-agenda-vertical-time-line-marker-color": primaryColor.base
|
|
39
|
+
}));
|
|
40
|
+
|
|
41
|
+
return {
|
|
42
|
+
style,
|
|
43
|
+
};
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
</script>
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRow
|
|
3
|
+
class="fs-day-agenda"
|
|
4
|
+
height="100%"
|
|
5
|
+
:wrap="false"
|
|
6
|
+
gap="0px"
|
|
7
|
+
:style="style"
|
|
8
|
+
>
|
|
9
|
+
<FSLoader
|
|
10
|
+
v-if="$props.loading"
|
|
11
|
+
width="100%"
|
|
12
|
+
height="100%"
|
|
13
|
+
/>
|
|
14
|
+
<FSRow
|
|
15
|
+
v-else
|
|
16
|
+
height="100%"
|
|
17
|
+
gap="0"
|
|
18
|
+
:wrap="false"
|
|
19
|
+
>
|
|
20
|
+
<FSAgendaHoursCol
|
|
21
|
+
:displayNow="$props.nowIsInSelectedRange"
|
|
22
|
+
:modelValue="nowHour"
|
|
23
|
+
/>
|
|
24
|
+
<FSCol
|
|
25
|
+
height="100%"
|
|
26
|
+
width="fill"
|
|
27
|
+
class="fs-agenda-body"
|
|
28
|
+
gap="0"
|
|
29
|
+
>
|
|
30
|
+
<span
|
|
31
|
+
v-for="hour in 24"
|
|
32
|
+
class="fs-day-agenda-hour-line"
|
|
33
|
+
:key="hour"
|
|
34
|
+
/>
|
|
35
|
+
<FSCol
|
|
36
|
+
style="position: absolute;"
|
|
37
|
+
height="100%"
|
|
38
|
+
padding="0 0 0 3px"
|
|
39
|
+
width="calc(100% - 32px)"
|
|
40
|
+
>
|
|
41
|
+
<slot />
|
|
42
|
+
<FSCol
|
|
43
|
+
style="position: relative;"
|
|
44
|
+
height="100%"
|
|
45
|
+
>
|
|
46
|
+
<FSAgendaVerticalEvent
|
|
47
|
+
v-for="event in dayEvents"
|
|
48
|
+
:key="event.id"
|
|
49
|
+
:variant="event.end < now ? 'past' : event.start > now ? 'future' : 'current'"
|
|
50
|
+
:now="now"
|
|
51
|
+
:dayStart="$props.start"
|
|
52
|
+
:label="event.label"
|
|
53
|
+
:start="event.start"
|
|
54
|
+
:end="event.end"
|
|
55
|
+
:icon="event.icon"
|
|
56
|
+
:iconBis="event.iconBis"
|
|
57
|
+
:id="event.id"
|
|
58
|
+
:color="event.color"
|
|
59
|
+
@click="() => $emit('click:eventId', event.id)"
|
|
60
|
+
>
|
|
61
|
+
<template
|
|
62
|
+
#default="{ label, icon, timeStart, timeEnd, iconBis }"
|
|
63
|
+
>
|
|
64
|
+
<FSCol>
|
|
65
|
+
<FSRow
|
|
66
|
+
class="fs-agenda-event-day-label-container"
|
|
67
|
+
align="center-left"
|
|
68
|
+
gap="4px"
|
|
69
|
+
:wrap="false"
|
|
70
|
+
>
|
|
71
|
+
<FSCol
|
|
72
|
+
height="hug"
|
|
73
|
+
width="fill"
|
|
74
|
+
align="center-left"
|
|
75
|
+
padding="8px 8px 0 8px"
|
|
76
|
+
>
|
|
77
|
+
<FSSpan>
|
|
78
|
+
{{ `${timeStart} - ${timeEnd}` }}
|
|
79
|
+
</FSSpan>
|
|
80
|
+
<FSRow
|
|
81
|
+
align="center-left"
|
|
82
|
+
:wrap="false"
|
|
83
|
+
>
|
|
84
|
+
<FSIcon
|
|
85
|
+
v-if="icon"
|
|
86
|
+
:icon="icon"
|
|
87
|
+
/>
|
|
88
|
+
<FSSpan
|
|
89
|
+
font="text-button"
|
|
90
|
+
>
|
|
91
|
+
{{ label }}
|
|
92
|
+
</FSSpan>
|
|
93
|
+
</FSRow>
|
|
94
|
+
</FSCol>
|
|
95
|
+
<FSCol
|
|
96
|
+
v-if="iconBis"
|
|
97
|
+
align="center-right"
|
|
98
|
+
padding="8px 8px 8px 0"
|
|
99
|
+
width="hug"
|
|
100
|
+
>
|
|
101
|
+
<FSIcon
|
|
102
|
+
v-if="iconBis"
|
|
103
|
+
:icon="iconBis"
|
|
104
|
+
/>
|
|
105
|
+
</FSCol>
|
|
106
|
+
</FSRow>
|
|
107
|
+
</FSCol>
|
|
108
|
+
</template>
|
|
109
|
+
</FSAgendaVerticalEvent>
|
|
110
|
+
</FSCol>
|
|
111
|
+
</FSCol>
|
|
112
|
+
</FSCol>
|
|
113
|
+
</FSRow>
|
|
114
|
+
</FSRow>
|
|
115
|
+
</template>
|
|
116
|
+
|
|
117
|
+
<script lang="ts">
|
|
118
|
+
import { defineComponent, type PropType, computed, type StyleValue } from 'vue';
|
|
119
|
+
|
|
120
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
121
|
+
import { ColorEnum, type FSAgendaEvent } from "@dative-gpi/foundation-shared-components/models";
|
|
122
|
+
|
|
123
|
+
import FSCol from '../FSCol.vue';
|
|
124
|
+
import FSRow from '../FSRow.vue';
|
|
125
|
+
import FSAgendaHoursCol from './FSAgendaHoursCol.vue';
|
|
126
|
+
import FSAgendaVerticalEvent from './FSAgendaVerticalEvent.vue';
|
|
127
|
+
import FSIcon from '../FSIcon.vue';
|
|
128
|
+
import FSSpan from '../FSSpan.vue';
|
|
129
|
+
import FSLoader from '../FSLoader.vue';
|
|
130
|
+
|
|
131
|
+
export default defineComponent({
|
|
132
|
+
name: 'FSDayAgenda',
|
|
133
|
+
components: {
|
|
134
|
+
FSAgendaHoursCol,
|
|
135
|
+
FSAgendaVerticalEvent,
|
|
136
|
+
FSCol,
|
|
137
|
+
FSIcon,
|
|
138
|
+
FSLoader,
|
|
139
|
+
FSRow,
|
|
140
|
+
FSSpan
|
|
141
|
+
},
|
|
142
|
+
props: {
|
|
143
|
+
now: {
|
|
144
|
+
type: Number,
|
|
145
|
+
required: true
|
|
146
|
+
},
|
|
147
|
+
start: {
|
|
148
|
+
type: Number,
|
|
149
|
+
required: true
|
|
150
|
+
},
|
|
151
|
+
end: {
|
|
152
|
+
type: Number,
|
|
153
|
+
required: true
|
|
154
|
+
},
|
|
155
|
+
firstColumnWidth: {
|
|
156
|
+
type: String,
|
|
157
|
+
required: true
|
|
158
|
+
},
|
|
159
|
+
loading: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: false
|
|
162
|
+
},
|
|
163
|
+
events: {
|
|
164
|
+
type: Array as PropType<FSAgendaEvent[]>,
|
|
165
|
+
default: () => []
|
|
166
|
+
},
|
|
167
|
+
nowIsInSelectedRange: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
emits: ['click:eventId'],
|
|
173
|
+
setup(props) {
|
|
174
|
+
const { getColors } = useColors();
|
|
175
|
+
|
|
176
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
177
|
+
|
|
178
|
+
const nowHour = computed(() => new Date(props.now).getHours());
|
|
179
|
+
|
|
180
|
+
const dayEvents = computed(() => {
|
|
181
|
+
return props.events.filter((event) => {
|
|
182
|
+
return event.start < props.end && event.end > props.start;
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const style = computed((): StyleValue => {
|
|
187
|
+
return {
|
|
188
|
+
'--fs-day-agenda-hour-line-color': lightColors.light,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
dayEvents,
|
|
194
|
+
nowHour,
|
|
195
|
+
style
|
|
196
|
+
};
|
|
197
|
+
},
|
|
198
|
+
});
|
|
199
|
+
</script>
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSCol
|
|
3
|
+
class="fs-agenda-month-container"
|
|
4
|
+
height="100%"
|
|
5
|
+
width="100%"
|
|
6
|
+
gap="0"
|
|
7
|
+
>
|
|
8
|
+
<FSRow
|
|
9
|
+
gap="0"
|
|
10
|
+
:wrap="false"
|
|
11
|
+
>
|
|
12
|
+
<FSAgendaHoursRow
|
|
13
|
+
:firstColumnWidth="$props.firstColumnWidth"
|
|
14
|
+
:displayNow="$props.nowIsInSelectedRange"
|
|
15
|
+
:modelValue="nowHour"
|
|
16
|
+
/>
|
|
17
|
+
</FSRow>
|
|
18
|
+
<FSRow
|
|
19
|
+
class="fs-agenda-month"
|
|
20
|
+
:style="style"
|
|
21
|
+
height="100%"
|
|
22
|
+
:wrap="false"
|
|
23
|
+
gap="0px"
|
|
24
|
+
>
|
|
25
|
+
<FSCol
|
|
26
|
+
class="fs-agenda-label-day-container"
|
|
27
|
+
height="100%"
|
|
28
|
+
gap="0"
|
|
29
|
+
:width="$props.firstColumnWidth"
|
|
30
|
+
>
|
|
31
|
+
<FSCol
|
|
32
|
+
v-for="day in monthDays"
|
|
33
|
+
class="fs-agenda-label-day"
|
|
34
|
+
:style="getDayLabelStyle(day.isNowDay)"
|
|
35
|
+
:key="day.dayNumber"
|
|
36
|
+
height="100%"
|
|
37
|
+
width="100%"
|
|
38
|
+
align="center-center"
|
|
39
|
+
>
|
|
40
|
+
<FSCard
|
|
41
|
+
height="100%"
|
|
42
|
+
width="100%"
|
|
43
|
+
:borderRadius="0"
|
|
44
|
+
:border="false"
|
|
45
|
+
variant="standard"
|
|
46
|
+
:color="day.isNowDay ? 'primary' : 'background'"
|
|
47
|
+
>
|
|
48
|
+
<FSCol
|
|
49
|
+
align="center-center"
|
|
50
|
+
>
|
|
51
|
+
<FSSpan
|
|
52
|
+
:color="day.isNowDay ? 'primary' : 'dark'"
|
|
53
|
+
font="text-overline"
|
|
54
|
+
>
|
|
55
|
+
{{ day.dayNumber }}
|
|
56
|
+
</FSSpan>
|
|
57
|
+
</FSCol>
|
|
58
|
+
</FSCard>
|
|
59
|
+
</FSCol>
|
|
60
|
+
</FSCol>
|
|
61
|
+
<FSCol
|
|
62
|
+
class="fs-agenda-body"
|
|
63
|
+
gap="0"
|
|
64
|
+
height="100%"
|
|
65
|
+
width="100%"
|
|
66
|
+
>
|
|
67
|
+
<slot />
|
|
68
|
+
<template
|
|
69
|
+
v-if="loading"
|
|
70
|
+
>
|
|
71
|
+
<FSLoader
|
|
72
|
+
height="100%"
|
|
73
|
+
width="100%"
|
|
74
|
+
padding="2px"
|
|
75
|
+
/>
|
|
76
|
+
</template>
|
|
77
|
+
<template
|
|
78
|
+
v-else
|
|
79
|
+
>
|
|
80
|
+
<FSRow
|
|
81
|
+
v-for="day in monthDays"
|
|
82
|
+
:key="day.dayNumber"
|
|
83
|
+
class="fs-agenda-row-day"
|
|
84
|
+
height="100%"
|
|
85
|
+
width="fill"
|
|
86
|
+
align="center-left"
|
|
87
|
+
>
|
|
88
|
+
<FSAgendaHorizontalEvent
|
|
89
|
+
v-for="event in getDayEvents(day.dayStartEpoch)"
|
|
90
|
+
:key="event.id"
|
|
91
|
+
:now="$props.now"
|
|
92
|
+
:variant="event.end < now ? 'past' : event.start > now ? 'future' : 'current'"
|
|
93
|
+
:dayStart="day.dayStartEpoch"
|
|
94
|
+
:label="event.label"
|
|
95
|
+
:start="event.start"
|
|
96
|
+
:end="event.end"
|
|
97
|
+
:icon="event.icon"
|
|
98
|
+
:id="event.id"
|
|
99
|
+
:color="event.color"
|
|
100
|
+
@click="() => $emit('click:eventId', event.id)"
|
|
101
|
+
>
|
|
102
|
+
<template
|
|
103
|
+
#default="{ label, icon }"
|
|
104
|
+
>
|
|
105
|
+
<FSRow
|
|
106
|
+
align="center-left"
|
|
107
|
+
:wrap="false"
|
|
108
|
+
padding="0 0 0 4px"
|
|
109
|
+
gap="4px"
|
|
110
|
+
>
|
|
111
|
+
<FSIcon
|
|
112
|
+
v-if="icon"
|
|
113
|
+
:icon="icon"
|
|
114
|
+
size="16px"
|
|
115
|
+
/>
|
|
116
|
+
<FSSpan
|
|
117
|
+
font="text-overline"
|
|
118
|
+
>
|
|
119
|
+
{{ label }}
|
|
120
|
+
</FSSpan>
|
|
121
|
+
</FSRow>
|
|
122
|
+
</template>
|
|
123
|
+
</FSAgendaHorizontalEvent>
|
|
124
|
+
</FSRow>
|
|
125
|
+
</template>
|
|
126
|
+
</FSCol>
|
|
127
|
+
</FSRow>
|
|
128
|
+
</FSCol>
|
|
129
|
+
</template>
|
|
130
|
+
|
|
131
|
+
<script lang="ts">
|
|
132
|
+
import { defineComponent, computed, type PropType, type StyleValue } from 'vue';
|
|
133
|
+
|
|
134
|
+
import { useColors } from "@dative-gpi/foundation-shared-components/composables";
|
|
135
|
+
import { ColorEnum, type FSAgendaEvent } from "@dative-gpi/foundation-shared-components/models";
|
|
136
|
+
|
|
137
|
+
import FSAgendaHorizontalEvent from './FSAgendaHorizontalEvent.vue';
|
|
138
|
+
import FSAgendaHoursRow from './FSAgendaHoursRow.vue';
|
|
139
|
+
import FSCol from '../FSCol.vue';
|
|
140
|
+
import FSRow from '../FSRow.vue';
|
|
141
|
+
import FSLoader from '../FSLoader.vue';
|
|
142
|
+
import FSIcon from '../FSIcon.vue';
|
|
143
|
+
import FSSpan from '../FSSpan.vue';
|
|
144
|
+
import FSCard from '../FSCard.vue';
|
|
145
|
+
|
|
146
|
+
export default defineComponent({
|
|
147
|
+
name: 'FSMonthAgenda',
|
|
148
|
+
components: {
|
|
149
|
+
FSAgendaHorizontalEvent,
|
|
150
|
+
FSAgendaHoursRow,
|
|
151
|
+
FSCard,
|
|
152
|
+
FSCol,
|
|
153
|
+
FSIcon,
|
|
154
|
+
FSLoader,
|
|
155
|
+
FSRow,
|
|
156
|
+
FSSpan
|
|
157
|
+
},
|
|
158
|
+
props: {
|
|
159
|
+
now: {
|
|
160
|
+
type: Number,
|
|
161
|
+
required: true
|
|
162
|
+
},
|
|
163
|
+
start: {
|
|
164
|
+
type: Number,
|
|
165
|
+
required: true
|
|
166
|
+
},
|
|
167
|
+
end: {
|
|
168
|
+
type: Number,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
nowIsInSelectedRange: {
|
|
172
|
+
type: Boolean,
|
|
173
|
+
required: true
|
|
174
|
+
},
|
|
175
|
+
firstColumnWidth: {
|
|
176
|
+
type: String,
|
|
177
|
+
required: true
|
|
178
|
+
},
|
|
179
|
+
loading: {
|
|
180
|
+
type: Boolean,
|
|
181
|
+
default: false
|
|
182
|
+
},
|
|
183
|
+
events: {
|
|
184
|
+
type: Array as PropType<FSAgendaEvent[]>,
|
|
185
|
+
default: () => []
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
emits: ['update:start', 'update:end', 'click:eventId'],
|
|
189
|
+
setup(props) {
|
|
190
|
+
const { getColors } = useColors();
|
|
191
|
+
|
|
192
|
+
const primaryColors = getColors(ColorEnum.Primary);
|
|
193
|
+
const lightColors = getColors(ColorEnum.Light);
|
|
194
|
+
|
|
195
|
+
const nowHour = computed(() => new Date(props.now).getHours());
|
|
196
|
+
|
|
197
|
+
const monthDays = computed(() => {
|
|
198
|
+
const monthDaysArray = [];
|
|
199
|
+
const nowDate = new Date(props.now);
|
|
200
|
+
|
|
201
|
+
let currentDay = new Date(props.start);
|
|
202
|
+
const endDate = new Date(props.end);
|
|
203
|
+
|
|
204
|
+
while (currentDay <= endDate) {
|
|
205
|
+
monthDaysArray.push({
|
|
206
|
+
dayNumber: currentDay.getDate(),
|
|
207
|
+
dayStartEpoch: currentDay.getTime(),
|
|
208
|
+
isNowDay: currentDay.toDateString() === nowDate.toDateString(),
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
currentDay.setDate(currentDay.getDate() + 1);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return monthDaysArray;
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
const style = computed((): StyleValue => {
|
|
218
|
+
return {
|
|
219
|
+
'--fs-agenda-row-day-border-bottom-color': lightColors.base,
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
const getDayLabelStyle = (isNowDay: boolean = false) => {
|
|
224
|
+
if (isNowDay) {
|
|
225
|
+
return {
|
|
226
|
+
'--fs-agenda-label-day-border-bottom-color': primaryColors.base,
|
|
227
|
+
'--fs-agenda-label-day-border-right-color': lightColors.base,
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
'--fs-agenda-label-day-border-bottom-color': lightColors.base,
|
|
232
|
+
'--fs-agenda-label-day-border-right-color': lightColors.base,
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
|
|
236
|
+
const getDayEvents = (dayStartEpoch: number) => {
|
|
237
|
+
return props.events.filter((event) => {
|
|
238
|
+
const dayEndEpoch = dayStartEpoch + 1000 * 60 * 60 * 24;
|
|
239
|
+
return event.start < dayEndEpoch && event.end > dayStartEpoch;
|
|
240
|
+
});
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
return {
|
|
244
|
+
nowHour,
|
|
245
|
+
monthDays,
|
|
246
|
+
style,
|
|
247
|
+
getDayEvents,
|
|
248
|
+
getDayLabelStyle
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
</script>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSSelectField
|
|
3
|
+
:items="items"
|
|
4
|
+
:modelValue="$props.modelValue"
|
|
5
|
+
:clearable="false"
|
|
6
|
+
v-bind="$attrs"
|
|
7
|
+
@update:modelValue="$emit('update:modelValue', $event)"
|
|
8
|
+
>
|
|
9
|
+
<template
|
|
10
|
+
#item-prepend="{ item }"
|
|
11
|
+
>
|
|
12
|
+
<FSIcon
|
|
13
|
+
:icon="item.icon"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
|
+
</FSSelectField>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<script lang="ts">
|
|
20
|
+
import { defineComponent, type PropType } from 'vue';
|
|
21
|
+
|
|
22
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
23
|
+
import { AgendaMode } from '@dative-gpi/foundation-shared-domain/enums/agendas';
|
|
24
|
+
|
|
25
|
+
import FSSelectField from '../fields/FSSelectField.vue';
|
|
26
|
+
import FSIcon from '../FSIcon.vue';
|
|
27
|
+
|
|
28
|
+
export default defineComponent({
|
|
29
|
+
name: 'FSSelectAgendaMode',
|
|
30
|
+
components: {
|
|
31
|
+
FSIcon,
|
|
32
|
+
FSSelectField
|
|
33
|
+
},
|
|
34
|
+
props: {
|
|
35
|
+
modelValue: {
|
|
36
|
+
type: Number as PropType<AgendaMode>,
|
|
37
|
+
default: AgendaMode.Week,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
emits: ['update:modelValue'],
|
|
41
|
+
setup() {
|
|
42
|
+
const { $tr } = useTranslationsProvider();
|
|
43
|
+
|
|
44
|
+
const items = [
|
|
45
|
+
{ id: AgendaMode.Week, label: $tr('ui.common.week', 'Week'), icon: 'mdi-calendar-week' },
|
|
46
|
+
{ id: AgendaMode.Month, label: $tr('ui.common.month', 'Month'), icon: 'mdi-calendar-month' },
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
items
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
</script>
|