@dative-gpi/foundation-shared-components 0.0.229 → 0.1.68
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/FSAccordionPanel.vue +8 -10
- package/components/FSBadge.vue +2 -4
- package/components/FSBreadcrumbs.vue +9 -10
- package/components/FSButton.vue +81 -31
- package/components/FSCalendar.vue +35 -33
- package/components/FSCalendarTwin.vue +77 -84
- package/components/FSCard.vue +29 -16
- package/components/FSCardPlaceholder.vue +1 -2
- package/components/FSCheckbox.vue +5 -7
- package/components/FSChip.vue +9 -11
- package/components/FSClickable.vue +67 -57
- package/components/FSClock.vue +4 -4
- package/components/FSCol.vue +2 -3
- package/components/FSColor.vue +13 -31
- package/components/FSColorIcon.vue +25 -9
- package/components/FSDialog.vue +1 -2
- package/components/FSDialogFormBody.vue +4 -4
- package/components/FSDialogMenu.vue +2 -4
- package/components/FSDialogMultiFormBody.vue +63 -50
- package/components/FSDialogRemove.vue +1 -0
- package/components/FSDialogSubmit.vue +5 -7
- package/components/FSDivider.vue +7 -9
- package/components/FSEditImage.vue +27 -274
- package/components/FSEditImageUI.vue +303 -0
- package/components/FSErrorToast.vue +3 -4
- package/components/FSFadeOut.vue +18 -13
- package/components/FSGrid.vue +6 -9
- package/components/FSGridMosaic.vue +1 -2
- package/components/FSIcon.vue +7 -8
- package/components/FSIconCard.vue +23 -30
- package/components/FSIconCheck.vue +1 -2
- package/components/FSImage.vue +21 -193
- package/components/FSImageCard.vue +2 -2
- package/components/FSImageUI.vue +212 -0
- package/components/FSLabel.vue +18 -20
- package/components/FSLink.vue +19 -21
- package/components/FSLoader.vue +10 -14
- package/components/FSOptionGroup.vue +58 -12
- package/components/FSPagination.vue +3 -5
- package/components/FSRadio.vue +5 -7
- package/components/FSRadioGroup.vue +2 -4
- package/components/FSRow.vue +3 -4
- package/components/FSSlideGroup.vue +15 -4
- package/components/FSSlider.vue +9 -11
- package/components/FSSpan.vue +11 -9
- package/components/FSSwitch.vue +65 -37
- package/components/FSTab.vue +2 -4
- package/components/FSTabs.vue +36 -16
- package/components/FSTag.vue +23 -14
- package/components/FSTagGroup.vue +3 -5
- package/components/FSText.vue +8 -12
- package/components/FSWindow.vue +11 -5
- package/components/FSWrapGroup.vue +15 -4
- package/components/agenda/FSAgenda.vue +204 -0
- package/components/agenda/FSAgendaDialogCalendar.vue +76 -0
- package/components/agenda/FSAgendaHeader.vue +190 -0
- package/components/agenda/FSAgendaHorizontalEvent.vue +162 -0
- package/components/agenda/FSAgendaHorizontalTimeLineMarker.vue +46 -0
- package/components/agenda/FSAgendaHoursCol.vue +103 -0
- package/components/agenda/FSAgendaHoursRow.vue +124 -0
- package/components/agenda/FSAgendaVerticalEvent.vue +160 -0
- package/components/agenda/FSAgendaVerticalTimeLineMarker.vue +46 -0
- package/components/agenda/FSDayAgenda.vue +200 -0
- package/components/agenda/FSMonthAgenda.vue +257 -0
- package/components/agenda/FSSelectAgendaMode.vue +54 -0
- package/components/agenda/FSWeekAgenda.vue +328 -0
- package/components/autocompletes/FSAutocompleteLanguage.vue +18 -39
- package/components/autocompletes/FSAutocompleteTimeZone.vue +20 -38
- package/components/buttons/FSButtonCancelMini.vue +1 -0
- package/components/buttons/FSButtonCopy.vue +28 -0
- package/components/buttons/FSButtonCopyIcon.vue +28 -0
- package/components/buttons/FSButtonCopyLabel.vue +27 -0
- package/components/buttons/FSButtonCopyMini.vue +28 -0
- package/components/buttons/FSButtonDragIcon.vue +27 -0
- package/components/buttons/FSButtonDuplicateMini.vue +1 -0
- package/components/buttons/FSButtonEditMini.vue +1 -0
- package/components/buttons/FSButtonFileMini.vue +1 -0
- package/components/buttons/FSButtonNextMini.vue +1 -0
- package/components/buttons/FSButtonPreviousMini.vue +1 -0
- package/components/buttons/FSButtonRedoMini.vue +1 -0
- package/components/buttons/FSButtonRemoveMini.vue +1 -0
- package/components/buttons/FSButtonSaveMini.vue +1 -0
- package/components/buttons/FSButtonSearchMini.vue +1 -0
- package/components/buttons/FSButtonUndoMini.vue +1 -0
- package/components/buttons/FSButtonUpdateMini.vue +1 -0
- package/components/buttons/FSButtonValidateMini.vue +1 -0
- package/components/deviceOrganisations/FSConnectivity.vue +11 -1
- package/components/deviceOrganisations/FSConnectivityCard.vue +20 -49
- package/components/deviceOrganisations/FSStatus.vue +11 -1
- package/components/deviceOrganisations/FSStatusCard.vue +40 -60
- package/components/deviceOrganisations/FSStatusesCarousel.vue +1 -0
- package/components/deviceOrganisations/FSStatusesRow.vue +10 -5
- package/components/deviceOrganisations/FSWorstAlert.vue +19 -13
- package/components/deviceOrganisations/FSWorstAlertCard.vue +36 -47
- package/components/fields/FSAutocompleteField.vue +501 -323
- package/components/fields/FSAutocompleteTag.vue +100 -0
- package/components/fields/FSBaseField.vue +26 -16
- package/components/fields/FSColorField.vue +63 -55
- package/components/fields/FSCommentField.vue +93 -0
- package/components/fields/FSDateField.vue +2 -2
- package/components/fields/FSDateRangeField.vue +2 -2
- package/components/fields/FSDateTimeField.vue +4 -3
- package/components/fields/FSDateTimeRangeField.vue +7 -6
- package/components/fields/FSEntityFieldUI.vue +271 -0
- package/components/fields/FSGradientField.vue +27 -33
- package/components/fields/FSIconField.vue +2 -3
- package/components/fields/FSMagicConfigField.vue +28 -19
- package/components/fields/FSMagicField.vue +25 -17
- package/components/fields/FSNumberField.vue +9 -7
- package/components/fields/FSPasswordField.vue +2 -3
- package/components/fields/FSRichTextField.vue +32 -5
- package/components/fields/FSSearchField.vue +2 -2
- package/components/fields/FSSelectField.vue +483 -251
- package/components/fields/FSTagField.vue +4 -6
- package/components/fields/FSTermField.vue +25 -13
- package/components/fields/FSTextArea.vue +18 -6
- package/components/fields/FSTextField.vue +13 -10
- package/components/fields/FSTimeField.vue +1 -1
- package/components/fields/FSTimeSlotField.vue +3 -4
- package/components/fields/FSTimeStepField.vue +157 -0
- package/components/fields/FSTranslateField.vue +3 -2
- package/components/fields/FSTranslateRichTextField.vue +4 -3
- package/components/fields/FSTranslateTextArea.vue +233 -0
- package/components/fields/FSTreeViewField.vue +7 -9
- package/components/fields/periodicField/FSPeriodicDailyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicField.vue +131 -0
- package/components/fields/periodicField/FSPeriodicMonthlyField.vue +222 -0
- package/components/fields/periodicField/FSPeriodicWeeklyField.vue +120 -0
- package/components/fields/periodicField/FSPeriodicYearlyField.vue +144 -0
- package/components/lists/FSDataIteratorItem.vue +8 -10
- package/components/lists/FSDataTableUI.vue +47 -39
- package/components/lists/FSFilterButton.vue +20 -22
- package/components/lists/FSHiddenButton.vue +10 -12
- package/components/lists/FSLoadDataTable.vue +4 -6
- package/components/lists/FSSimpleList.vue +229 -0
- package/components/map/FSMap.vue +256 -405
- package/components/map/FSMapFeatureGroup.vue +51 -0
- package/components/map/FSMapLayerButton.vue +6 -3
- package/components/map/FSMapMarker.vue +116 -0
- package/components/map/FSMapMarkerClusterGroup.vue +72 -0
- package/components/map/FSMapOverlay.vue +69 -83
- package/components/map/FSMapPolygon.vue +81 -0
- package/components/map/FSMapTileLayer.vue +50 -0
- package/components/map/keys.ts +4 -0
- package/components/selects/FSSelectAutoRefresh.vue +1 -1
- package/components/selects/FSSelectDashboardVariableType.vue +1 -1
- package/components/selects/FSSelectDateSetting.vue +3 -3
- package/components/selects/FSSelectDays.vue +1 -1
- package/components/selects/FSSelectListMode.vue +51 -0
- package/components/selects/FSSelectMonths.vue +67 -0
- package/components/tiles/FSChartTileUI.vue +116 -0
- package/components/tiles/FSCommentTileUI.vue +149 -0
- package/components/tiles/FSDashboardOrganisationTileUI.vue +6 -8
- package/components/tiles/FSDashboardOrganisationTypeTileUI.vue +6 -8
- package/components/tiles/FSDashboardShallowTileUI.vue +6 -8
- package/components/tiles/FSDeviceOrganisationTileUI.vue +30 -18
- package/components/tiles/FSFolderTileUI.vue +6 -6
- package/components/tiles/FSGroupTileUI.vue +31 -22
- package/components/tiles/FSLoadTile.vue +5 -7
- package/components/tiles/FSLocationTileUI.vue +157 -0
- package/components/tiles/FSModelTileUI.vue +18 -0
- package/components/tiles/FSServiceAccountOrganisationTileUI.vue +142 -0
- package/components/tiles/FSSimpleTileUI.vue +57 -36
- package/components/tiles/FSTile.vue +115 -55
- package/components/tiles/FSUserOrganisationTileUI.vue +25 -35
- package/components/toggleSets/FSToggleSetPosition.vue +1 -1
- package/components/views/FSEntityHeader.vue +343 -0
- package/components/views/FSEntityView.vue +163 -0
- package/components/views/FSListHeader.vue +83 -0
- package/components/views/FSListView.vue +83 -0
- package/components/views/FSSkeletonView.vue +100 -0
- package/composables/useAddress.ts +2 -2
- package/composables/useColors.ts +15 -5
- package/composables/useMagicFieldProvider.ts +7 -6
- package/composables/useSlots.ts +51 -28
- 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 +10 -5
- package/models/tables.ts +3 -1
- package/package.json +4 -4
- package/styles/components/fs_agenda.scss +32 -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 +13 -0
- package/styles/components/fs_agenda_time_line_marker.scss +19 -0
- package/styles/components/fs_card.scss +0 -1
- package/styles/components/fs_clickable.scss +5 -3
- package/styles/components/fs_color_field.scss +1 -0
- package/styles/components/fs_data_table.scss +2 -0
- package/styles/components/fs_dialog.scss +11 -15
- package/styles/components/fs_edit_image.scss +8 -0
- package/styles/components/fs_fade_out.scss +2 -1
- package/styles/components/fs_filter_button.scss +1 -6
- package/styles/components/fs_gradient_field.scss +11 -11
- package/styles/components/fs_magic_config_field.scss +2 -2
- package/styles/components/fs_map.scss +36 -30
- package/styles/components/fs_option_group.scss +15 -5
- package/styles/components/fs_radio.scss +11 -0
- package/styles/components/fs_rich_text_field.scss +2 -1
- package/styles/components/fs_search_field.scss +3 -0
- package/styles/components/fs_select_date_settings.scss +3 -0
- package/styles/components/fs_slide_group.scss +5 -0
- package/styles/components/fs_span.scss +2 -1
- package/styles/components/fs_switch.scss +1 -0
- package/styles/components/fs_tabs.scss +9 -0
- package/styles/components/fs_text_area.scss +15 -1
- package/styles/components/fs_tile.scss +22 -6
- package/styles/components/fs_window.scss +5 -0
- package/styles/components/fs_wrap_group.scss +4 -0
- package/styles/components/index.scss +6 -1
- package/styles/globals/overrides.scss +22 -19
- package/styles/globals/text_fonts.scss +17 -55
- package/tools/alertsTools.ts +54 -0
- package/tools/chartsTools.ts +300 -0
- package/tools/index.ts +2 -0
- package/utils/badge.ts +9 -0
- package/utils/filter.ts +18 -0
- package/utils/index.ts +2 -0
- package/utils/leafletMarkers.ts +8 -2
- package/utils/statuses.ts +1 -1
- package/utils/time.ts +27 -1
- package/components/autocompletes/FSAutocompleteTag.vue +0 -138
- package/components/map/FSMapEditPointAddressOverlay.vue +0 -164
- package/styles/components/fs_map_overlay.scss +0 -38
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRadioGroup
|
|
3
|
+
:values="availableConfigurations"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
v-model="selectedConfiguration"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#label="{ item, font }"
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
v-if="item.value === 'customDayNumber'"
|
|
12
|
+
align="center-left"
|
|
13
|
+
>
|
|
14
|
+
<FSSpan
|
|
15
|
+
:font="font"
|
|
16
|
+
>
|
|
17
|
+
{{ $tr("ui.periodicfield.monthly.day", "Day") }}
|
|
18
|
+
</FSSpan>
|
|
19
|
+
<FSSelectField
|
|
20
|
+
:editable="$props.editable"
|
|
21
|
+
:items="dayNumbers"
|
|
22
|
+
:hideHeader="true"
|
|
23
|
+
:clearable="false"
|
|
24
|
+
:modelValue="dayNumber"
|
|
25
|
+
@update:modelValue="onUpdateDayNumber($event)"
|
|
26
|
+
/>
|
|
27
|
+
<FSSpan
|
|
28
|
+
:font="font"
|
|
29
|
+
>
|
|
30
|
+
{{ $tr("ui.periodicfield.monthly.every-month-at", "every month at") }}
|
|
31
|
+
</FSSpan>
|
|
32
|
+
<FSClock
|
|
33
|
+
:editable="$props.editable"
|
|
34
|
+
:color="ColorEnum.Light"
|
|
35
|
+
:hideHeader="true"
|
|
36
|
+
:slider="false"
|
|
37
|
+
:modelValue="time"
|
|
38
|
+
@update:modelValue="onUpdateHours($event)"
|
|
39
|
+
/>
|
|
40
|
+
</FSRow>
|
|
41
|
+
<FSRow
|
|
42
|
+
v-else-if="item.value === 'customDayWeek'"
|
|
43
|
+
align="center-left"
|
|
44
|
+
>
|
|
45
|
+
<FSSpan
|
|
46
|
+
:font="font"
|
|
47
|
+
>
|
|
48
|
+
{{ $tr("ui.periodicfield.monthly.every", "Every") }}
|
|
49
|
+
</FSSpan>
|
|
50
|
+
<FSSelectField
|
|
51
|
+
:editable="$props.editable"
|
|
52
|
+
:items="dayWeekNumbers"
|
|
53
|
+
:hideHeader="true"
|
|
54
|
+
:clearable="false"
|
|
55
|
+
:modelValue="dayWeekNumber"
|
|
56
|
+
@update:modelValue="onUpdateDayWeekNumber($event)"
|
|
57
|
+
/>
|
|
58
|
+
<FSSelectDays
|
|
59
|
+
:editable="$props.editable"
|
|
60
|
+
:useAllDays="false"
|
|
61
|
+
:hideHeader="true"
|
|
62
|
+
:modelValue="dayWeek"
|
|
63
|
+
@update:modelValue="onUpdateDayWeek($event)"
|
|
64
|
+
/>
|
|
65
|
+
<FSSpan
|
|
66
|
+
:font="font"
|
|
67
|
+
>
|
|
68
|
+
{{ $tr("ui.periodicfield.monthly.at", "at") }}
|
|
69
|
+
</FSSpan>
|
|
70
|
+
<FSClock
|
|
71
|
+
:editable="$props.editable"
|
|
72
|
+
:color="ColorEnum.Light"
|
|
73
|
+
:hideHeader="true"
|
|
74
|
+
:slider="false"
|
|
75
|
+
:modelValue="time"
|
|
76
|
+
@update:modelValue="onUpdateHours($event)"
|
|
77
|
+
/>
|
|
78
|
+
</FSRow>
|
|
79
|
+
</template>
|
|
80
|
+
</FSRadioGroup>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script lang="ts">
|
|
84
|
+
import { ref, defineComponent, watch, computed } from "vue";
|
|
85
|
+
|
|
86
|
+
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui";
|
|
87
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
88
|
+
|
|
89
|
+
import FSSelectField from "../../fields/FSSelectField.vue";
|
|
90
|
+
import FSSelectDays from "../../selects/FSSelectDays.vue";
|
|
91
|
+
import FSRadioGroup from "../../FSRadioGroup.vue";
|
|
92
|
+
import FSClock from "../../FSClock.vue";
|
|
93
|
+
import FSSpan from "../../FSSpan.vue";
|
|
94
|
+
import FSRow from "../../FSRow.vue";
|
|
95
|
+
|
|
96
|
+
export default defineComponent({
|
|
97
|
+
name: "FSPeriodicMonthlyField",
|
|
98
|
+
components: {
|
|
99
|
+
FSSelectField,
|
|
100
|
+
FSRadioGroup,
|
|
101
|
+
FSSelectDays,
|
|
102
|
+
FSClock,
|
|
103
|
+
FSSpan,
|
|
104
|
+
FSRow
|
|
105
|
+
},
|
|
106
|
+
props: {
|
|
107
|
+
modelValue: {
|
|
108
|
+
type: Array<string>,
|
|
109
|
+
required: true
|
|
110
|
+
},
|
|
111
|
+
editable: {
|
|
112
|
+
type: Boolean,
|
|
113
|
+
required: false,
|
|
114
|
+
default: true
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
emits: ["update:modelValue"],
|
|
118
|
+
setup(props, { emit }) {
|
|
119
|
+
const { $tr } = useTranslationsProvider();
|
|
120
|
+
|
|
121
|
+
const dayWeekNumbers = [
|
|
122
|
+
{ id: 1, label: $tr("ui.periodicfield.monthly.first" , "First") },
|
|
123
|
+
{ id: 2, label: $tr("ui.periodicfield.monthly.second", "Second") },
|
|
124
|
+
{ id: 3, label: $tr("ui.periodicfield.monthly.third" , "Third") },
|
|
125
|
+
{ id: 4, label: $tr("ui.periodicfield.monthly.fourth", "Fourth") },
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
const availableConfigurations = [
|
|
129
|
+
{ value: "customDayNumber", item: { value: "customDayNumber" } },
|
|
130
|
+
{ value: "customDayWeek" , item: { value: "customDayWeek" } }
|
|
131
|
+
];
|
|
132
|
+
|
|
133
|
+
const dayNumbers = Array.from({ length: 31 }, (_, index) => ({ id: index + 1, label: String(index + 1) }));
|
|
134
|
+
|
|
135
|
+
const selectedConfiguration = ref(props.modelValue[4] !== "*" ? "customDayWeek" : "customDayNumber");
|
|
136
|
+
|
|
137
|
+
const dayNumber = computed((): number => {
|
|
138
|
+
if (props.modelValue[4] !== "*" || isNaN(parseInt(props.modelValue[2]))) {
|
|
139
|
+
return 1;
|
|
140
|
+
}
|
|
141
|
+
return parseInt(props.modelValue[2]);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const dayWeek = computed((): number => {
|
|
145
|
+
if (props.modelValue[4] !== "*" || isNaN(parseInt(props.modelValue[4]))) {
|
|
146
|
+
return 0;
|
|
147
|
+
}
|
|
148
|
+
return parseInt(props.modelValue[4]) - 1;
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const dayWeekNumber = computed((): number => {
|
|
152
|
+
if (!props.modelValue[2].includes("-") || isNaN(parseInt(props.modelValue[2].split("-")[1]))) {
|
|
153
|
+
return 1;
|
|
154
|
+
}
|
|
155
|
+
return Math.floor(parseInt(props.modelValue[2].split("-")[1]) / 7);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const time = computed((): number => {
|
|
159
|
+
if (isNaN(parseInt(props.modelValue[0])) || isNaN(parseInt(props.modelValue[1]))) {
|
|
160
|
+
return 0;
|
|
161
|
+
}
|
|
162
|
+
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
const onUpdateDayNumber = (value: number): void => {
|
|
166
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
167
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
168
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${value}`, `*`, `*`]);
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
const onUpdateDayWeekNumber = (value: number): void => {
|
|
172
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
173
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
174
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${(value - 1) * 7 + 1}-${value * 7}`, `*`, `${dayWeek.value + 1}`]);
|
|
175
|
+
};
|
|
176
|
+
|
|
177
|
+
const onUpdateDayWeek = (value: number): void => {
|
|
178
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
179
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
180
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${(dayWeekNumber.value - 1) * 7 + 1}-${dayWeekNumber.value * 7}`, `*`, `${value + 1}`]);
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
const onUpdateHours = (value: number): void => {
|
|
184
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
185
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
186
|
+
if (selectedConfiguration.value === "customDayNumber") {
|
|
187
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${dayNumber.value}`, `*`, `*`]);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${(dayWeekNumber.value - 1) * 7 + 1}-${dayWeekNumber.value * 7}`, `*`, `${dayWeek.value + 1}`]);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
watch(() => selectedConfiguration.value, (value: string): void => {
|
|
195
|
+
const hours = Math.floor(time.value / (60 * 60 * 1000));
|
|
196
|
+
const minutes = Math.floor(time.value / (60 * 1000) % 60);
|
|
197
|
+
if(value === "customDayNumber") {
|
|
198
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${dayNumber.value}`, `*`, `*`]);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${(dayWeekNumber.value - 1) * 7 + 1}-${dayWeekNumber.value * 7}`, `*`, `${dayWeek.value + 1}`]);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
return {
|
|
206
|
+
availableConfigurations,
|
|
207
|
+
selectedConfiguration,
|
|
208
|
+
dayWeekNumbers,
|
|
209
|
+
dayWeekNumber,
|
|
210
|
+
dayNumbers,
|
|
211
|
+
ColorEnum,
|
|
212
|
+
dayNumber,
|
|
213
|
+
dayWeek,
|
|
214
|
+
time,
|
|
215
|
+
onUpdateDayWeekNumber,
|
|
216
|
+
onUpdateDayNumber,
|
|
217
|
+
onUpdateDayWeek,
|
|
218
|
+
onUpdateHours
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
</script>
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRadioGroup
|
|
3
|
+
:values="availableConfigurations"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
v-model="selectedConfiguration"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#label="{ item, font }"
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
v-if="item.value === 'custom'"
|
|
12
|
+
align="center-left"
|
|
13
|
+
>
|
|
14
|
+
<FSSpan
|
|
15
|
+
:font="font"
|
|
16
|
+
>
|
|
17
|
+
{{ $tr("ui.periodicfield.weekly.every", "Every") }}
|
|
18
|
+
</FSSpan>
|
|
19
|
+
<FSSelectDays
|
|
20
|
+
:editable="$props.editable"
|
|
21
|
+
:useAllDays="false"
|
|
22
|
+
:hideHeader="true"
|
|
23
|
+
:modelValue="day"
|
|
24
|
+
@update:modelValue="onUpdateDay($event)"
|
|
25
|
+
/>
|
|
26
|
+
<FSSpan
|
|
27
|
+
:font="font"
|
|
28
|
+
>
|
|
29
|
+
{{ $tr("ui.periodicfield.weekly.at", "at") }}
|
|
30
|
+
</FSSpan>
|
|
31
|
+
<FSClock
|
|
32
|
+
:editable="$props.editable"
|
|
33
|
+
:color="ColorEnum.Light"
|
|
34
|
+
:hideHeader="true"
|
|
35
|
+
:slider="false"
|
|
36
|
+
:modelValue="time"
|
|
37
|
+
@update:modelValue="onUpdateHours($event)"
|
|
38
|
+
/>
|
|
39
|
+
</FSRow>
|
|
40
|
+
</template>
|
|
41
|
+
</FSRadioGroup>
|
|
42
|
+
</template>
|
|
43
|
+
|
|
44
|
+
<script lang="ts">
|
|
45
|
+
import { ref, defineComponent, computed } from "vue";
|
|
46
|
+
|
|
47
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
48
|
+
|
|
49
|
+
import FSSelectDays from "../../selects/FSSelectDays.vue";
|
|
50
|
+
import FSRadioGroup from "../../FSRadioGroup.vue";
|
|
51
|
+
import FSClock from "../../FSClock.vue";
|
|
52
|
+
import FSSpan from "../../FSSpan.vue";
|
|
53
|
+
import FSRow from "../../FSRow.vue";
|
|
54
|
+
|
|
55
|
+
export default defineComponent({
|
|
56
|
+
name: "FSPeriodicWeeklyField",
|
|
57
|
+
components: {
|
|
58
|
+
FSRadioGroup,
|
|
59
|
+
FSSelectDays,
|
|
60
|
+
FSClock,
|
|
61
|
+
FSSpan,
|
|
62
|
+
FSRow
|
|
63
|
+
},
|
|
64
|
+
props: {
|
|
65
|
+
modelValue: {
|
|
66
|
+
type: Array<string>,
|
|
67
|
+
required: true
|
|
68
|
+
},
|
|
69
|
+
editable: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
required: false,
|
|
72
|
+
default: true
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
emits: ["update:modelValue"],
|
|
76
|
+
setup(props, { emit }) {
|
|
77
|
+
const availableConfigurations = [
|
|
78
|
+
{ value: "custom", item: { value: "custom" } }
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
const selectedConfiguration = ref("custom");
|
|
82
|
+
|
|
83
|
+
const day = computed((): number => {
|
|
84
|
+
if (isNaN(parseInt(props.modelValue[4]))) {
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
return parseInt(props.modelValue[4]) - 1;
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const time = computed((): number => {
|
|
91
|
+
if (isNaN(parseInt(props.modelValue[0])) || isNaN(parseInt(props.modelValue[1]))) {
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
const onUpdateDay = (value: number): void => {
|
|
98
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
99
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
100
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${value + 1}`]);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
const onUpdateHours = (value: number): void => {
|
|
104
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
105
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
106
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `*`, `*`, `${day.value + 1}`]);
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
return {
|
|
110
|
+
availableConfigurations,
|
|
111
|
+
selectedConfiguration,
|
|
112
|
+
ColorEnum,
|
|
113
|
+
time,
|
|
114
|
+
day,
|
|
115
|
+
onUpdateHours,
|
|
116
|
+
onUpdateDay
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
</script>
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<FSRadioGroup
|
|
3
|
+
:values="availableConfigurations"
|
|
4
|
+
:editable="$props.editable"
|
|
5
|
+
v-model="selectedConfiguration"
|
|
6
|
+
>
|
|
7
|
+
<template
|
|
8
|
+
#label="{ item, font }"
|
|
9
|
+
>
|
|
10
|
+
<FSRow
|
|
11
|
+
v-if="item.value === 'custom'"
|
|
12
|
+
align="center-left"
|
|
13
|
+
>
|
|
14
|
+
<FSSpan
|
|
15
|
+
:font="font"
|
|
16
|
+
>
|
|
17
|
+
{{ $tr("ui.periodicfield.yearly.everyyear", "Every year") }}
|
|
18
|
+
</FSSpan>
|
|
19
|
+
<FSSelectMonths
|
|
20
|
+
:editable="$props.editable"
|
|
21
|
+
:useAllMonths="false"
|
|
22
|
+
:hideHeader="true"
|
|
23
|
+
:modelValue="month"
|
|
24
|
+
@update:modelValue="onUpdateMonth($event)"
|
|
25
|
+
/>
|
|
26
|
+
<FSNumberField
|
|
27
|
+
:editable="$props.editable"
|
|
28
|
+
:hideHeader="true"
|
|
29
|
+
:clearable="false"
|
|
30
|
+
:modelValue="day"
|
|
31
|
+
@update:modelValue="onUpdateDay($event)"
|
|
32
|
+
/>
|
|
33
|
+
<FSSpan
|
|
34
|
+
:font="font"
|
|
35
|
+
>
|
|
36
|
+
{{ $tr("ui.periodicfield.yearly.at", "at") }}
|
|
37
|
+
</FSSpan>
|
|
38
|
+
<FSClock
|
|
39
|
+
:editable="$props.editable"
|
|
40
|
+
:color="ColorEnum.Light"
|
|
41
|
+
:hideHeader="true"
|
|
42
|
+
:slider="false"
|
|
43
|
+
:modelValue="time"
|
|
44
|
+
@update:modelValue="onUpdateHours($event)"
|
|
45
|
+
/>
|
|
46
|
+
</FSRow>
|
|
47
|
+
</template>
|
|
48
|
+
</FSRadioGroup>
|
|
49
|
+
</template>
|
|
50
|
+
|
|
51
|
+
<script lang="ts">
|
|
52
|
+
import { ref, defineComponent, computed } from "vue";
|
|
53
|
+
|
|
54
|
+
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
55
|
+
|
|
56
|
+
import FSSelectMonths from "../../selects/FSSelectMonths.vue";
|
|
57
|
+
import FSRadioGroup from "../../FSRadioGroup.vue";
|
|
58
|
+
import FSNumberField from "../FSNumberField.vue";
|
|
59
|
+
import FSClock from "../../FSClock.vue";
|
|
60
|
+
import FSSpan from "../../FSSpan.vue";
|
|
61
|
+
import FSRow from "../../FSRow.vue";
|
|
62
|
+
|
|
63
|
+
export default defineComponent({
|
|
64
|
+
name: "FSPeriodicDailyField",
|
|
65
|
+
components: {
|
|
66
|
+
FSSelectMonths,
|
|
67
|
+
FSNumberField,
|
|
68
|
+
FSRadioGroup,
|
|
69
|
+
FSClock,
|
|
70
|
+
FSSpan,
|
|
71
|
+
FSRow
|
|
72
|
+
},
|
|
73
|
+
props: {
|
|
74
|
+
modelValue: {
|
|
75
|
+
type: Array<string>,
|
|
76
|
+
required: true
|
|
77
|
+
},
|
|
78
|
+
editable: {
|
|
79
|
+
type: Boolean,
|
|
80
|
+
required: false,
|
|
81
|
+
default: true
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
emits: ["update:modelValue"],
|
|
85
|
+
setup(props, { emit }) {
|
|
86
|
+
const availableConfigurations = [
|
|
87
|
+
{ value: "custom", item: { value: "custom" } }
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
const selectedConfiguration = ref("custom");
|
|
91
|
+
|
|
92
|
+
const day = computed((): number => {
|
|
93
|
+
if (isNaN(parseInt(props.modelValue[2]))) {
|
|
94
|
+
return 0;
|
|
95
|
+
}
|
|
96
|
+
return parseInt(props.modelValue[2]);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const month = computed((): number => {
|
|
100
|
+
if (isNaN(parseInt(props.modelValue[3]))) {
|
|
101
|
+
return 0;
|
|
102
|
+
}
|
|
103
|
+
return parseInt(props.modelValue[3]) - 1;
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const time = computed((): number => {
|
|
107
|
+
if (isNaN(parseInt(props.modelValue[0])) || isNaN(parseInt(props.modelValue[1]))) {
|
|
108
|
+
return 0;
|
|
109
|
+
}
|
|
110
|
+
return ((parseInt(props.modelValue[0])) + (parseInt(props.modelValue[1]) * 60)) * 60 * 1000;
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const onUpdateDay = (value: number): void => {
|
|
114
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
115
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
116
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${value}`, `${month.value + 1}`, "*"]);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const onUpdateHours = (value: number): void => {
|
|
120
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
121
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
122
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${month.value + 1}`, "*"]);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const onUpdateMonth = (value: number): void => {
|
|
126
|
+
const hours = Math.floor(value / (60 * 60 * 1000));
|
|
127
|
+
const minutes = Math.floor(value / (60 * 1000) % 60);
|
|
128
|
+
emit("update:modelValue", [`${minutes}`, `${hours}`, `${day.value}`, `${value + 1}`, "*"]);
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
return {
|
|
132
|
+
availableConfigurations,
|
|
133
|
+
selectedConfiguration,
|
|
134
|
+
ColorEnum,
|
|
135
|
+
month,
|
|
136
|
+
time,
|
|
137
|
+
day,
|
|
138
|
+
onUpdateHours,
|
|
139
|
+
onUpdateMonth,
|
|
140
|
+
onUpdateDay
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
</script>
|
|
@@ -39,7 +39,9 @@
|
|
|
39
39
|
<FSRow
|
|
40
40
|
align="center-left"
|
|
41
41
|
>
|
|
42
|
-
<FSText
|
|
42
|
+
<FSText
|
|
43
|
+
v-if="header.value"
|
|
44
|
+
>
|
|
43
45
|
{{ $props.item[header.value] }}
|
|
44
46
|
</FSText>
|
|
45
47
|
</FSRow>
|
|
@@ -67,11 +69,9 @@
|
|
|
67
69
|
</template>
|
|
68
70
|
|
|
69
71
|
<script lang="ts">
|
|
70
|
-
import type
|
|
71
|
-
import { computed, defineComponent } from "vue";
|
|
72
|
+
import { computed, defineComponent, type PropType, type StyleValue } from "vue";
|
|
72
73
|
|
|
73
|
-
import type
|
|
74
|
-
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
74
|
+
import { ColorEnum, type FSDataTableColumn } from "@dative-gpi/foundation-shared-components/models";
|
|
75
75
|
|
|
76
76
|
import FSCheckbox from "../FSCheckbox.vue";
|
|
77
77
|
import FSCard from "../FSCard.vue";
|
|
@@ -135,11 +135,9 @@ export default defineComponent({
|
|
|
135
135
|
}
|
|
136
136
|
});
|
|
137
137
|
|
|
138
|
-
const style = computed(():
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
});
|
|
138
|
+
const style = computed((): StyleValue => ({
|
|
139
|
+
"--fs-data-iterator-item-cursor": props.clickable ? "pointer" : "default"
|
|
140
|
+
}));
|
|
143
141
|
|
|
144
142
|
return {
|
|
145
143
|
variant,
|