@ozdao/martyrs 0.2.473 → 0.2.474
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/dist/{Media-DW8RLbfM.js → Media-_vz04tII.js} +1 -1
- package/dist/{Media-y_TX6us_.mjs → Media-sGk7Bp9b.mjs} +1 -1
- package/dist/auth.server.js +6 -2
- package/dist/auth.server.mjs +6 -2
- package/dist/authJwt-CELQKF2s.js +82 -0
- package/dist/authJwt-DnXu3BFq.mjs +83 -0
- package/dist/builder.js +7 -4
- package/dist/builder.mjs +7 -4
- package/dist/chats.server.js +1 -1
- package/dist/chats.server.mjs +1 -1
- package/dist/community.server.js +4 -4
- package/dist/community.server.mjs +4 -4
- package/dist/events.server.js +4 -4
- package/dist/events.server.mjs +4 -4
- package/dist/files.server.js +1 -1
- package/dist/files.server.mjs +1 -1
- package/dist/gallery.server.js +3 -3
- package/dist/gallery.server.mjs +3 -3
- package/dist/{globals.abac-DT0VjfaZ.js → globals.abac-Bn-4tbX8.js} +110 -16
- package/dist/{globals.abac-CvmZM8XG.mjs → globals.abac-DZpTRxKR.mjs} +110 -16
- package/dist/globals.server.js +70 -10
- package/dist/globals.server.mjs +70 -10
- package/dist/{globals.verifier-C_VZYebB.mjs → globals.verifier-BdJxc8-8.mjs} +34 -0
- package/dist/{globals.verifier-ChDpCdy_.js → globals.verifier-CKYpYfQl.js} +34 -0
- package/dist/{index-CVXl1rB5.js → index-BOmxJQ5W.js} +7 -86
- package/dist/{index-Df8vtZx7.mjs → index-C_Fw0Umg.mjs} +7 -86
- package/dist/{main-CgmHzhq5.mjs → main-CqMtW7Hq.mjs} +274 -276
- package/dist/{main-CCfQH-Dd.js → main-CsGkbSyK.js} +2 -2
- package/dist/martyrs/src/components/Select/Select.vue.cjs +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.cjs.map +1 -1
- package/dist/martyrs/src/components/Select/Select.vue.js +4 -4
- package/dist/martyrs/src/components/Select/Select.vue.js.map +1 -1
- package/dist/martyrs/src/modules/community/community.client.js +27 -27
- package/dist/martyrs/src/modules/community/community.client.js.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs +2 -3
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js +2 -3
- package/dist/martyrs/src/modules/community/components/sections/HotPosts.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs +88 -27
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js +89 -28
- package/dist/martyrs/src/modules/orders/components/pages/OrderCreate.vue.js.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.cjs.map +1 -1
- package/dist/martyrs/src/modules/orders/store/shopcart.js +1 -0
- package/dist/martyrs/src/modules/orders/store/shopcart.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs +19 -0
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js +19 -0
- package/dist/martyrs/src/modules/products/components/pages/CategoryEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js +1 -0
- package/dist/martyrs/src/modules/products/components/pages/Product.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js +2 -2
- package/dist/martyrs/src/modules/products/components/pages/ProductEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.cjs +2 -0
- package/dist/martyrs/src/modules/products/store/categories.cjs.map +1 -1
- package/dist/martyrs/src/modules/products/store/categories.js +2 -0
- package/dist/martyrs/src/modules/products/store/categories.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs +30 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js +30 -24
- package/dist/martyrs/src/modules/spots/components/pages/SpotEdit.vue.js.map +1 -1
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.cjs.map +1 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js +807 -0
- package/dist/martyrs/src/modules/spots/components/sections/WorktimeEdit.vue.js.map +1 -0
- package/dist/martyrs/src/modules/spots/store/spots.cjs +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.cjs.map +1 -1
- package/dist/martyrs/src/modules/spots/store/spots.js +4 -1
- package/dist/martyrs/src/modules/spots/store/spots.js.map +1 -1
- package/dist/martyrs.cjs.js +1 -1
- package/dist/martyrs.css +1 -1
- package/dist/martyrs.es.js +1 -1
- package/dist/notifications.server.js +1 -1
- package/dist/notifications.server.mjs +1 -1
- package/dist/orders.server.js +5 -4
- package/dist/orders.server.mjs +5 -4
- package/dist/organizations.server.js +120 -47
- package/dist/organizations.server.mjs +120 -47
- package/dist/{ownership.schema-C0w02Vw1.mjs → ownership.schema-CNCotD3D.mjs} +10 -4
- package/dist/{ownership.schema-Ck2H9clB.js → ownership.schema-MxfJlPtq.js} +10 -4
- package/dist/products.server.js +415 -149
- package/dist/products.server.mjs +415 -149
- package/dist/{profile.schema-h61hhB2w.js → profile.schema-BLSuV_VC.js} +0 -4
- package/dist/{profile.schema-kP_zKXNt.mjs → profile.schema-BRuvQ7QV.mjs} +0 -4
- package/dist/{queryProcessor-CWnMIe2U.mjs → queryProcessor-CVKI651_.mjs} +62 -8
- package/dist/{queryProcessor-D6GuKfTV.js → queryProcessor-DSUqSk3I.js} +62 -8
- package/dist/rents.server.js +4 -4
- package/dist/rents.server.mjs +4 -4
- package/dist/spots.server.js +162 -8
- package/dist/spots.server.mjs +162 -8
- package/dist/style.css +27 -4
- package/dist/wallet.server.js +2 -2
- package/dist/wallet.server.mjs +2 -2
- package/package.json +1 -1
- package/src/builder/rspack/rspack.config.base.js +1 -1
- package/src/builder/rspack/rspack.config.client.js +13 -5
- package/src/components/Select/Select.vue +4 -2
- package/src/modules/auth/models/user.model.js +4 -1
- package/src/modules/community/components/sections/HotPosts.vue +1 -1
- package/src/modules/globals/controllers/classes/globals.abac.js +148 -23
- package/src/modules/globals/controllers/classes/globals.validator.js +37 -0
- package/src/modules/globals/controllers/classes/globals.verifier.js +2 -0
- package/src/modules/globals/controllers/policies/globals.policies.js +91 -74
- package/src/modules/globals/controllers/utils/queryProcessor.js +59 -11
- package/src/modules/globals/models/schemas/ownership.schema.js +11 -6
- package/src/modules/globals/models/schemas/profile.schema.js +0 -4
- package/src/modules/music/components/layouts/MusicLayout.vue +10 -58
- package/src/modules/music/components/pages/MusicHome.vue +5 -5
- package/src/modules/orders/components/pages/OrderCreate.vue +85 -12
- package/src/modules/orders/controllers/orders.controller.js +3 -0
- package/src/modules/orders/store/shopcart.js +1 -0
- package/src/modules/organizations/models/schemas/accesses.schema.js +18 -0
- package/src/modules/organizations/policies/organizations.policies.js +117 -61
- package/src/modules/products/components/pages/CategoryEdit.vue +27 -2
- package/src/modules/products/components/pages/Product.vue +1 -0
- package/src/modules/products/components/pages/ProductEdit.vue +2 -2
- package/src/modules/products/controllers/categories.controller.js +297 -133
- package/src/modules/products/middlewares/categories.verifier.js +177 -0
- package/src/modules/products/models/category.model.js +12 -14
- package/src/modules/products/routes/categories.routes.js +50 -11
- package/src/modules/products/store/categories.js +2 -0
- package/src/modules/spots/components/pages/SpotEdit.vue +21 -17
- package/src/modules/spots/components/sections/WorktimeEdit.vue +840 -0
- package/src/modules/spots/controllers/queries/getIsOpenNowStage.js +109 -0
- package/src/modules/spots/controllers/spots.controller.js +2 -1
- package/src/modules/spots/models/spot.model.js +59 -13
- package/src/modules/spots/store/spots.js +4 -1
- package/src/modules/products/middlewares/index.js +0 -11
- package/src/modules/products/middlewares/verifyCategory.js +0 -25
|
@@ -0,0 +1,807 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const vueI18n = require("vue-i18n");
|
|
5
|
+
const Button = require("../../../../components/Button/Button.vue2.cjs");
|
|
6
|
+
const Field = require("../../../../components/Field/Field.vue.cjs");
|
|
7
|
+
const Select = require("../../../../components/Select/Select.vue.cjs");
|
|
8
|
+
const Checkbox = require("../../../../components/Checkbox/Checkbox.vue.cjs");
|
|
9
|
+
const Popup = require("../../../../components/Popup/Popup.vue.cjs");
|
|
10
|
+
const _pluginVue_exportHelper = require("../../../../../../_virtual/_plugin-vue_export-helper.cjs");
|
|
11
|
+
const _hoisted_1 = { class: "working-hours-editor w-100" };
|
|
12
|
+
const _hoisted_2 = { class: "mn-b-small flex flex-nowrap flex-v-center" };
|
|
13
|
+
const _hoisted_3 = { class: "mn-r-auto" };
|
|
14
|
+
const _hoisted_4 = { class: "bg-white radius-small pd-small mn-b-medium" };
|
|
15
|
+
const _hoisted_5 = { class: "mn-b-small" };
|
|
16
|
+
const _hoisted_6 = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "regular-schedule mn-b-small"
|
|
19
|
+
};
|
|
20
|
+
const _hoisted_7 = { class: "day-info flex-child-1" };
|
|
21
|
+
const _hoisted_8 = { class: "day-name t-semi" };
|
|
22
|
+
const _hoisted_9 = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "day-hours"
|
|
25
|
+
};
|
|
26
|
+
const _hoisted_10 = { class: "period t-small t-transp" };
|
|
27
|
+
const _hoisted_11 = {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: "t-small t-transp"
|
|
30
|
+
};
|
|
31
|
+
const _hoisted_12 = {
|
|
32
|
+
key: 1,
|
|
33
|
+
class: "day-hours t-small t-transp t-red"
|
|
34
|
+
};
|
|
35
|
+
const _hoisted_13 = { class: "day-actions flex-nowrap flex gap-small" };
|
|
36
|
+
const _hoisted_14 = {
|
|
37
|
+
key: 1,
|
|
38
|
+
class: "empty-schedule bg-light pd-medium radius-small t-center mn-b-small"
|
|
39
|
+
};
|
|
40
|
+
const _hoisted_15 = { class: "bg-white radius-small pd-small mn-b-small" };
|
|
41
|
+
const _hoisted_16 = { class: "mn-b-small flex flex-nowrap flex-v-center" };
|
|
42
|
+
const _hoisted_17 = { class: "mn-r-auto" };
|
|
43
|
+
const _hoisted_18 = {
|
|
44
|
+
key: 0,
|
|
45
|
+
class: "special-schedule mn-b-small"
|
|
46
|
+
};
|
|
47
|
+
const _hoisted_19 = { class: "day-info flex-child-1" };
|
|
48
|
+
const _hoisted_20 = { class: "flex flex-nowrap flex-v-center" };
|
|
49
|
+
const _hoisted_21 = { class: "day-name t-semi" };
|
|
50
|
+
const _hoisted_22 = {
|
|
51
|
+
key: 0,
|
|
52
|
+
class: "t-small t-transp mn-l-small"
|
|
53
|
+
};
|
|
54
|
+
const _hoisted_23 = {
|
|
55
|
+
key: 0,
|
|
56
|
+
class: "day-hours"
|
|
57
|
+
};
|
|
58
|
+
const _hoisted_24 = { class: "period t-small t-transp" };
|
|
59
|
+
const _hoisted_25 = {
|
|
60
|
+
key: 0,
|
|
61
|
+
class: "t-small t-transp"
|
|
62
|
+
};
|
|
63
|
+
const _hoisted_26 = {
|
|
64
|
+
key: 1,
|
|
65
|
+
class: "day-hours t-small t-transp t-red"
|
|
66
|
+
};
|
|
67
|
+
const _hoisted_27 = { class: "day-actions flex-nowrap flex gap-small" };
|
|
68
|
+
const _hoisted_28 = {
|
|
69
|
+
key: 1,
|
|
70
|
+
class: "empty-schedule bg-light pd-medium radius-small t-center"
|
|
71
|
+
};
|
|
72
|
+
const _hoisted_29 = { class: "schedule-editor" };
|
|
73
|
+
const _hoisted_30 = { key: 0 };
|
|
74
|
+
const _hoisted_31 = { class: "flex flex-nowrap flex-v-center mn-b-small" };
|
|
75
|
+
const _hoisted_32 = { class: "mn-r-auto" };
|
|
76
|
+
const _hoisted_33 = {
|
|
77
|
+
key: 0,
|
|
78
|
+
class: "error-message mn-b-small pd-small radius-small bg-fourth-nano"
|
|
79
|
+
};
|
|
80
|
+
const _hoisted_34 = { class: "flex-child-1 time-inputs cols-2 gap-small" };
|
|
81
|
+
const _hoisted_35 = { class: "button-group flex flex-nowrap gap-small mn-t-medium" };
|
|
82
|
+
const _hoisted_36 = { class: "schedule-editor" };
|
|
83
|
+
const _hoisted_37 = {
|
|
84
|
+
key: 0,
|
|
85
|
+
class: "error-message mn-b-small pd-small radius-small bg-fourth-nano"
|
|
86
|
+
};
|
|
87
|
+
const _hoisted_38 = { key: 1 };
|
|
88
|
+
const _hoisted_39 = { class: "flex flex-nowrap flex-v-center mn-b-small" };
|
|
89
|
+
const _hoisted_40 = { class: "mn-r-auto" };
|
|
90
|
+
const _hoisted_41 = {
|
|
91
|
+
key: 0,
|
|
92
|
+
class: "error-message mn-b-small pd-small radius-small bg-fourth-nano"
|
|
93
|
+
};
|
|
94
|
+
const _hoisted_42 = { class: "flex-child-1 time-inputs cols-2 gap-small" };
|
|
95
|
+
const _hoisted_43 = { class: "button-group flex flex-nowrap gap-small mn-t-medium" };
|
|
96
|
+
const _sfc_main = {
|
|
97
|
+
__name: "WorktimeEdit",
|
|
98
|
+
props: {
|
|
99
|
+
"worktime": {},
|
|
100
|
+
"worktimeModifiers": {}
|
|
101
|
+
},
|
|
102
|
+
emits: /* @__PURE__ */ vue.mergeModels(["update:worktime"], ["update:worktime"]),
|
|
103
|
+
setup(__props, { emit: __emit }) {
|
|
104
|
+
const worktime = vue.useModel(__props, "worktime");
|
|
105
|
+
const emit = __emit;
|
|
106
|
+
const { t, locale } = vueI18n.useI18n({
|
|
107
|
+
messages: {
|
|
108
|
+
en: {
|
|
109
|
+
workingHours: {
|
|
110
|
+
title: "Working Hours",
|
|
111
|
+
regularSchedule: "Regular Schedule",
|
|
112
|
+
specialDays: "Special Days",
|
|
113
|
+
addRegularDay: "Add Day",
|
|
114
|
+
addSpecialDay: "Add Day",
|
|
115
|
+
editRegularDay: "Edit Regular Day",
|
|
116
|
+
editSpecialDay: "Edit Special Day",
|
|
117
|
+
save: "Save",
|
|
118
|
+
cancel: "Cancel",
|
|
119
|
+
edit: "Edit",
|
|
120
|
+
remove: "Remove",
|
|
121
|
+
weekday: "Weekday",
|
|
122
|
+
date: "Date",
|
|
123
|
+
isOpen: "Open on this day",
|
|
124
|
+
description: "Description",
|
|
125
|
+
descriptionPlaceholder: "Holiday, Special event, etc.",
|
|
126
|
+
periods: "Operating Hours",
|
|
127
|
+
addPeriod: "Add Period",
|
|
128
|
+
opens: "Opens at",
|
|
129
|
+
closes: "Closes at",
|
|
130
|
+
closed: "Closed",
|
|
131
|
+
noRegularSchedule: "No regular schedule set. Add working days to define your regular hours.",
|
|
132
|
+
noSpecialDays: "No special days set. Add special days for holidays or events.",
|
|
133
|
+
errorDuplicateDate: "This date already exists in special days.",
|
|
134
|
+
errorOverlappingPeriods: "Time periods cannot overlap.",
|
|
135
|
+
selectDate: "Please select a date.",
|
|
136
|
+
errorInvalidPeriod: "Invalid time period. Closing time must be after opening time."
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
ru: {
|
|
140
|
+
workingHours: {
|
|
141
|
+
title: "Часы работы",
|
|
142
|
+
regularSchedule: "Регулярное расписание",
|
|
143
|
+
specialDays: "Особые дни",
|
|
144
|
+
addRegularDay: "Добавить день",
|
|
145
|
+
addSpecialDay: "Добавить особый день",
|
|
146
|
+
editRegularDay: "Изменить рабочий день",
|
|
147
|
+
editSpecialDay: "Изменить особый день",
|
|
148
|
+
save: "Сохранить",
|
|
149
|
+
cancel: "Отмена",
|
|
150
|
+
edit: "Изменить",
|
|
151
|
+
remove: "Удалить",
|
|
152
|
+
weekday: "День недели",
|
|
153
|
+
date: "Дата",
|
|
154
|
+
isOpen: "Открыто в этот день",
|
|
155
|
+
description: "Описание",
|
|
156
|
+
descriptionPlaceholder: "Праздник, особое событие и т.д.",
|
|
157
|
+
periods: "Часы работы",
|
|
158
|
+
addPeriod: "Добавить период",
|
|
159
|
+
opens: "Открывается в",
|
|
160
|
+
closes: "Закрывается в",
|
|
161
|
+
closed: "Закрыто",
|
|
162
|
+
noRegularSchedule: "Регулярное расписание не установлено. Добавьте рабочие дни для определения регулярных часов.",
|
|
163
|
+
noSpecialDays: "Особые дни не установлены. Добавьте особые дни для праздников или событий.",
|
|
164
|
+
errorDuplicateDate: "Эта дата уже существует в особых днях.",
|
|
165
|
+
errorOverlappingPeriods: "Временные периоды не могут пересекаться.",
|
|
166
|
+
selectDate: "Пожалуйста, выберите дату.",
|
|
167
|
+
errorInvalidPeriod: "Недопустимый временной период. Время закрытия должно быть после времени открытия."
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const formatDate = (date) => {
|
|
173
|
+
if (!date) return "";
|
|
174
|
+
const dateObj = new Date(date);
|
|
175
|
+
return new Intl.DateTimeFormat(locale.value, {
|
|
176
|
+
weekday: "long",
|
|
177
|
+
year: "numeric",
|
|
178
|
+
month: "long",
|
|
179
|
+
day: "numeric"
|
|
180
|
+
}).format(dateObj);
|
|
181
|
+
};
|
|
182
|
+
const getWeekdayName = (dayNumber) => {
|
|
183
|
+
if (dayNumber === void 0 || dayNumber === null) return "";
|
|
184
|
+
const date = new Date(2023, 0, 1 + dayNumber);
|
|
185
|
+
return new Intl.DateTimeFormat(locale.value, { weekday: "long" }).format(date);
|
|
186
|
+
};
|
|
187
|
+
const showRegularDayModal = vue.ref(false);
|
|
188
|
+
const showSpecialDayModal = vue.ref(false);
|
|
189
|
+
const editingRegularIndex = vue.ref(null);
|
|
190
|
+
const editingSpecialIndex = vue.ref(null);
|
|
191
|
+
const validationErrors = vue.ref({
|
|
192
|
+
overlappingPeriods: false,
|
|
193
|
+
duplicateDate: false,
|
|
194
|
+
invalidPeriod: false
|
|
195
|
+
});
|
|
196
|
+
const currentRegularDay = vue.ref({
|
|
197
|
+
dayOfWeek: 1,
|
|
198
|
+
// Понедельник по умолчанию
|
|
199
|
+
isOpen: true,
|
|
200
|
+
periods: [{
|
|
201
|
+
open: "09:00",
|
|
202
|
+
close: "18:00"
|
|
203
|
+
}]
|
|
204
|
+
});
|
|
205
|
+
const currentSpecialDay = vue.ref({
|
|
206
|
+
dateInput: "",
|
|
207
|
+
// Для ввода даты в формате YYYY-MM-DD
|
|
208
|
+
date: null,
|
|
209
|
+
description: "",
|
|
210
|
+
isOpen: false,
|
|
211
|
+
periods: [{
|
|
212
|
+
open: "09:00",
|
|
213
|
+
close: "18:00"
|
|
214
|
+
}]
|
|
215
|
+
});
|
|
216
|
+
const weekdays = [0, 1, 2, 3, 4, 5, 6];
|
|
217
|
+
const availableWeekdays = vue.computed(() => {
|
|
218
|
+
var _a;
|
|
219
|
+
const usedDays = new Set((((_a = worktime.value) == null ? void 0 : _a.regular) || []).map((d) => d.dayOfWeek));
|
|
220
|
+
return weekdays.filter(
|
|
221
|
+
(day) => {
|
|
222
|
+
var _a2, _b;
|
|
223
|
+
return !usedDays.has(day) || editingRegularIndex.value !== null && ((_b = (_a2 = worktime.value) == null ? void 0 : _a2.regular[editingRegularIndex.value]) == null ? void 0 : _b.dayOfWeek) === day;
|
|
224
|
+
}
|
|
225
|
+
).map((day) => ({
|
|
226
|
+
text: getWeekdayName(day),
|
|
227
|
+
value: day
|
|
228
|
+
}));
|
|
229
|
+
});
|
|
230
|
+
const isValidRegularDay = vue.computed(() => {
|
|
231
|
+
return !validationErrors.value.overlappingPeriods && !validationErrors.value.invalidPeriod;
|
|
232
|
+
});
|
|
233
|
+
const isValidSpecialDay = vue.computed(() => {
|
|
234
|
+
return !validationErrors.value.duplicateDate && !validationErrors.value.overlappingPeriods && !validationErrors.value.invalidPeriod && !!currentSpecialDay.value.dateInput;
|
|
235
|
+
});
|
|
236
|
+
const addRegularDay = () => {
|
|
237
|
+
var _a;
|
|
238
|
+
editingRegularIndex.value = null;
|
|
239
|
+
currentRegularDay.value = {
|
|
240
|
+
dayOfWeek: ((_a = availableWeekdays.value[0]) == null ? void 0 : _a.value) ?? 1,
|
|
241
|
+
isOpen: true,
|
|
242
|
+
periods: [{
|
|
243
|
+
open: "09:00",
|
|
244
|
+
close: "18:00"
|
|
245
|
+
}]
|
|
246
|
+
};
|
|
247
|
+
validationErrors.value = {
|
|
248
|
+
overlappingPeriods: false,
|
|
249
|
+
duplicateDate: false,
|
|
250
|
+
invalidPeriod: false
|
|
251
|
+
};
|
|
252
|
+
showRegularDayModal.value = true;
|
|
253
|
+
};
|
|
254
|
+
const addSpecialDay = () => {
|
|
255
|
+
editingSpecialIndex.value = null;
|
|
256
|
+
const today = /* @__PURE__ */ new Date();
|
|
257
|
+
const todayFormatted = `${today.getFullYear()}-${String(today.getMonth() + 1).padStart(2, "0")}-${String(today.getDate()).padStart(2, "0")}`;
|
|
258
|
+
currentSpecialDay.value = {
|
|
259
|
+
dateInput: todayFormatted,
|
|
260
|
+
date: today,
|
|
261
|
+
description: "",
|
|
262
|
+
isOpen: false,
|
|
263
|
+
periods: [{
|
|
264
|
+
open: "09:00",
|
|
265
|
+
close: "18:00"
|
|
266
|
+
}]
|
|
267
|
+
};
|
|
268
|
+
validationErrors.value = {
|
|
269
|
+
overlappingPeriods: false,
|
|
270
|
+
duplicateDate: false,
|
|
271
|
+
invalidPeriod: false
|
|
272
|
+
};
|
|
273
|
+
showSpecialDayModal.value = true;
|
|
274
|
+
validateSpecialDate();
|
|
275
|
+
};
|
|
276
|
+
const validatePeriods = () => {
|
|
277
|
+
const periods = showRegularDayModal.value ? currentRegularDay.value.periods : currentSpecialDay.value.periods;
|
|
278
|
+
if (!periods || periods.length <= 1) {
|
|
279
|
+
validationErrors.value.overlappingPeriods = false;
|
|
280
|
+
validationErrors.value.invalidPeriod = false;
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
validationErrors.value.invalidPeriod = periods.some(
|
|
284
|
+
(period) => period.open >= period.close
|
|
285
|
+
);
|
|
286
|
+
if (validationErrors.value.invalidPeriod) {
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
const sortedPeriods = [...periods].sort((a, b) => a.open.localeCompare(b.open));
|
|
290
|
+
for (let i = 0; i < sortedPeriods.length - 1; i++) {
|
|
291
|
+
if (sortedPeriods[i].close > sortedPeriods[i + 1].open) {
|
|
292
|
+
validationErrors.value.overlappingPeriods = true;
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
validationErrors.value.overlappingPeriods = false;
|
|
297
|
+
};
|
|
298
|
+
const validateSpecialDate = () => {
|
|
299
|
+
if (!currentSpecialDay.value.dateInput) {
|
|
300
|
+
validationErrors.value.duplicateDate = false;
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
const newDateObj = new Date(currentSpecialDay.value.dateInput);
|
|
304
|
+
newDateObj.setHours(0, 0, 0, 0);
|
|
305
|
+
const isDuplicate = worktime.value.special.some((specialDay, index) => {
|
|
306
|
+
if (editingSpecialIndex.value === index) return false;
|
|
307
|
+
const existingDate = new Date(specialDay.date);
|
|
308
|
+
existingDate.setHours(0, 0, 0, 0);
|
|
309
|
+
return existingDate.getTime() === newDateObj.getTime();
|
|
310
|
+
});
|
|
311
|
+
validationErrors.value.duplicateDate = isDuplicate;
|
|
312
|
+
};
|
|
313
|
+
const editRegularDay = (index) => {
|
|
314
|
+
editingRegularIndex.value = index;
|
|
315
|
+
const day = JSON.parse(JSON.stringify(worktime.value.regular[index]));
|
|
316
|
+
if (!day.periods || day.periods.length === 0) {
|
|
317
|
+
day.periods = [{
|
|
318
|
+
open: "09:00",
|
|
319
|
+
close: "18:00"
|
|
320
|
+
}];
|
|
321
|
+
}
|
|
322
|
+
currentRegularDay.value = day;
|
|
323
|
+
validationErrors.value = {
|
|
324
|
+
overlappingPeriods: false,
|
|
325
|
+
duplicateDate: false,
|
|
326
|
+
invalidPeriod: false
|
|
327
|
+
};
|
|
328
|
+
showRegularDayModal.value = true;
|
|
329
|
+
validatePeriods();
|
|
330
|
+
};
|
|
331
|
+
const removeRegularDay = (index) => {
|
|
332
|
+
const updatedWorktime = { ...worktime.value };
|
|
333
|
+
updatedWorktime.regular.splice(index, 1);
|
|
334
|
+
emit("update:worktime", updatedWorktime);
|
|
335
|
+
};
|
|
336
|
+
const saveRegularDay = () => {
|
|
337
|
+
validatePeriods();
|
|
338
|
+
if (!isValidRegularDay.value) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const updatedWorktime = JSON.parse(JSON.stringify(worktime.value));
|
|
342
|
+
if (!updatedWorktime.regular) {
|
|
343
|
+
updatedWorktime.regular = [];
|
|
344
|
+
}
|
|
345
|
+
const dayToSave = { ...currentRegularDay.value };
|
|
346
|
+
if (!dayToSave.isOpen) {
|
|
347
|
+
dayToSave.periods = [];
|
|
348
|
+
}
|
|
349
|
+
if (editingRegularIndex.value !== null) {
|
|
350
|
+
updatedWorktime.regular[editingRegularIndex.value] = dayToSave;
|
|
351
|
+
} else {
|
|
352
|
+
updatedWorktime.regular.push(dayToSave);
|
|
353
|
+
}
|
|
354
|
+
updatedWorktime.regular.sort((a, b) => a.dayOfWeek - b.dayOfWeek);
|
|
355
|
+
worktime.value = updatedWorktime;
|
|
356
|
+
emit("update:worktime", updatedWorktime);
|
|
357
|
+
showRegularDayModal.value = false;
|
|
358
|
+
};
|
|
359
|
+
const addPeriodToRegular = () => {
|
|
360
|
+
currentRegularDay.value.periods.push({
|
|
361
|
+
open: "09:00",
|
|
362
|
+
close: "18:00"
|
|
363
|
+
});
|
|
364
|
+
validatePeriods();
|
|
365
|
+
};
|
|
366
|
+
const removeRegularPeriod = (index) => {
|
|
367
|
+
currentRegularDay.value.periods.splice(index, 1);
|
|
368
|
+
validatePeriods();
|
|
369
|
+
};
|
|
370
|
+
const editSpecialDay = (index) => {
|
|
371
|
+
editingSpecialIndex.value = index;
|
|
372
|
+
const day = JSON.parse(JSON.stringify(worktime.value.special[index]));
|
|
373
|
+
const date = new Date(day.date);
|
|
374
|
+
const dateForInput = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, "0")}-${String(date.getDate()).padStart(2, "0")}`;
|
|
375
|
+
if (!day.periods || day.periods.length === 0) {
|
|
376
|
+
day.periods = [{
|
|
377
|
+
open: "09:00",
|
|
378
|
+
close: "18:00"
|
|
379
|
+
}];
|
|
380
|
+
}
|
|
381
|
+
currentSpecialDay.value = {
|
|
382
|
+
...day,
|
|
383
|
+
dateInput: dateForInput
|
|
384
|
+
};
|
|
385
|
+
validationErrors.value = {
|
|
386
|
+
overlappingPeriods: false,
|
|
387
|
+
duplicateDate: false,
|
|
388
|
+
invalidPeriod: false
|
|
389
|
+
};
|
|
390
|
+
showSpecialDayModal.value = true;
|
|
391
|
+
validatePeriods();
|
|
392
|
+
};
|
|
393
|
+
const removeSpecialDay = (index) => {
|
|
394
|
+
const updatedWorktime = { ...worktime.value };
|
|
395
|
+
updatedWorktime.special.splice(index, 1);
|
|
396
|
+
emit("update:worktime", updatedWorktime);
|
|
397
|
+
};
|
|
398
|
+
const saveSpecialDay = () => {
|
|
399
|
+
validateSpecialDate();
|
|
400
|
+
validatePeriods();
|
|
401
|
+
if (!isValidSpecialDay.value) {
|
|
402
|
+
if (!currentSpecialDay.value.dateInput) {
|
|
403
|
+
alert(t("workingHours.selectDate"));
|
|
404
|
+
}
|
|
405
|
+
return;
|
|
406
|
+
}
|
|
407
|
+
const updatedWorktime = JSON.parse(JSON.stringify(worktime.value));
|
|
408
|
+
if (!updatedWorktime.special) {
|
|
409
|
+
updatedWorktime.special = [];
|
|
410
|
+
}
|
|
411
|
+
const dateParts = currentSpecialDay.value.dateInput.split("-");
|
|
412
|
+
const specialDate = new Date(
|
|
413
|
+
parseInt(dateParts[0]),
|
|
414
|
+
parseInt(dateParts[1]) - 1,
|
|
415
|
+
parseInt(dateParts[2])
|
|
416
|
+
);
|
|
417
|
+
const dayToSave = {
|
|
418
|
+
...currentSpecialDay.value,
|
|
419
|
+
date: specialDate
|
|
420
|
+
};
|
|
421
|
+
delete dayToSave.dateInput;
|
|
422
|
+
if (!dayToSave.isOpen) {
|
|
423
|
+
dayToSave.periods = [];
|
|
424
|
+
}
|
|
425
|
+
if (editingSpecialIndex.value !== null) {
|
|
426
|
+
updatedWorktime.special[editingSpecialIndex.value] = dayToSave;
|
|
427
|
+
} else {
|
|
428
|
+
updatedWorktime.special.push(dayToSave);
|
|
429
|
+
}
|
|
430
|
+
updatedWorktime.special.sort((a, b) => new Date(a.date) - new Date(b.date));
|
|
431
|
+
emit("update:worktime", updatedWorktime);
|
|
432
|
+
showSpecialDayModal.value = false;
|
|
433
|
+
};
|
|
434
|
+
const addPeriodToSpecial = () => {
|
|
435
|
+
currentSpecialDay.value.periods.push({
|
|
436
|
+
open: "09:00",
|
|
437
|
+
close: "18:00"
|
|
438
|
+
});
|
|
439
|
+
validatePeriods();
|
|
440
|
+
};
|
|
441
|
+
const removeSpecialPeriod = (index) => {
|
|
442
|
+
currentSpecialDay.value.periods.splice(index, 1);
|
|
443
|
+
validatePeriods();
|
|
444
|
+
};
|
|
445
|
+
vue.onMounted(() => {
|
|
446
|
+
const initialValue = JSON.parse(JSON.stringify(worktime.value));
|
|
447
|
+
if (!initialValue.regular) initialValue.regular = [];
|
|
448
|
+
if (!initialValue.special) initialValue.special = [];
|
|
449
|
+
emit("update:worktime", initialValue);
|
|
450
|
+
});
|
|
451
|
+
return (_ctx, _cache) => {
|
|
452
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
453
|
+
vue.createElementVNode("div", _hoisted_2, [
|
|
454
|
+
vue.createElementVNode("h4", _hoisted_3, vue.toDisplayString(vue.unref(t)("workingHours.title")), 1),
|
|
455
|
+
vue.createVNode(Button.default, {
|
|
456
|
+
class: "bg-main",
|
|
457
|
+
submit: addRegularDay,
|
|
458
|
+
showSucces: false,
|
|
459
|
+
showLoader: false
|
|
460
|
+
}, {
|
|
461
|
+
default: vue.withCtx(() => [
|
|
462
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.addRegularDay")), 1)
|
|
463
|
+
]),
|
|
464
|
+
_: 1
|
|
465
|
+
})
|
|
466
|
+
]),
|
|
467
|
+
vue.createElementVNode("div", _hoisted_4, [
|
|
468
|
+
vue.createElementVNode("h5", _hoisted_5, vue.toDisplayString(vue.unref(t)("workingHours.regularSchedule")), 1),
|
|
469
|
+
worktime.value.regular && worktime.value.regular.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, [
|
|
470
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(worktime.value.regular, (day, index) => {
|
|
471
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
472
|
+
key: `regular-${index}`,
|
|
473
|
+
class: vue.normalizeClass(["schedule-item pd-small mn-b-small flex flex-v-center flex-nowrap", index % 2 === 0 ? "bg-light" : ""])
|
|
474
|
+
}, [
|
|
475
|
+
vue.createElementVNode("div", _hoisted_7, [
|
|
476
|
+
vue.createElementVNode("div", _hoisted_8, vue.toDisplayString(getWeekdayName(day.dayOfWeek)), 1),
|
|
477
|
+
day.isOpen && day.periods && day.periods.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_9, [
|
|
478
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(day.periods, (period, pIndex) => {
|
|
479
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
480
|
+
key: `period-${pIndex}`
|
|
481
|
+
}, [
|
|
482
|
+
vue.createElementVNode("span", _hoisted_10, vue.toDisplayString(period.open) + " - " + vue.toDisplayString(period.close), 1),
|
|
483
|
+
pIndex < day.periods.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_11, ", ")) : vue.createCommentVNode("", true)
|
|
484
|
+
], 64);
|
|
485
|
+
}), 128))
|
|
486
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_12, vue.toDisplayString(vue.unref(t)("workingHours.closed")), 1))
|
|
487
|
+
]),
|
|
488
|
+
vue.createElementVNode("div", _hoisted_13, [
|
|
489
|
+
vue.createVNode(Button.default, {
|
|
490
|
+
class: "pd-micro bg-light",
|
|
491
|
+
submit: () => editRegularDay(index),
|
|
492
|
+
showSucces: false,
|
|
493
|
+
showLoader: false
|
|
494
|
+
}, {
|
|
495
|
+
default: vue.withCtx(() => [
|
|
496
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.edit")), 1)
|
|
497
|
+
]),
|
|
498
|
+
_: 2
|
|
499
|
+
}, 1032, ["submit"]),
|
|
500
|
+
vue.createVNode(Button.default, {
|
|
501
|
+
class: "pd-micro bg-fourth-nano",
|
|
502
|
+
submit: () => removeRegularDay(index),
|
|
503
|
+
showSucces: false,
|
|
504
|
+
showLoader: false
|
|
505
|
+
}, {
|
|
506
|
+
default: vue.withCtx(() => [
|
|
507
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.remove")), 1)
|
|
508
|
+
]),
|
|
509
|
+
_: 2
|
|
510
|
+
}, 1032, ["submit"])
|
|
511
|
+
])
|
|
512
|
+
], 2);
|
|
513
|
+
}), 128))
|
|
514
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_14, vue.toDisplayString(vue.unref(t)("workingHours.noRegularSchedule")), 1))
|
|
515
|
+
]),
|
|
516
|
+
vue.createElementVNode("div", _hoisted_15, [
|
|
517
|
+
vue.createElementVNode("div", _hoisted_16, [
|
|
518
|
+
vue.createElementVNode("h5", _hoisted_17, vue.toDisplayString(vue.unref(t)("workingHours.specialDays")), 1),
|
|
519
|
+
vue.createVNode(Button.default, {
|
|
520
|
+
class: "bg-light mn-l-small",
|
|
521
|
+
submit: addSpecialDay,
|
|
522
|
+
showSucces: false,
|
|
523
|
+
showLoader: false
|
|
524
|
+
}, {
|
|
525
|
+
default: vue.withCtx(() => [
|
|
526
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.addSpecialDay")), 1)
|
|
527
|
+
]),
|
|
528
|
+
_: 1
|
|
529
|
+
})
|
|
530
|
+
]),
|
|
531
|
+
worktime.value.special && worktime.value.special.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_18, [
|
|
532
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(worktime.value.special, (day, index) => {
|
|
533
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
534
|
+
key: `special-${index}`,
|
|
535
|
+
class: vue.normalizeClass(["schedule-item pd-small mn-b-small flex flex-v-center flex-nowrap", index % 2 === 0 ? "bg-light" : ""])
|
|
536
|
+
}, [
|
|
537
|
+
vue.createElementVNode("div", _hoisted_19, [
|
|
538
|
+
vue.createElementVNode("div", _hoisted_20, [
|
|
539
|
+
vue.createElementVNode("div", _hoisted_21, vue.toDisplayString(formatDate(day.date)), 1),
|
|
540
|
+
day.description ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_22, "(" + vue.toDisplayString(day.description) + ")", 1)) : vue.createCommentVNode("", true)
|
|
541
|
+
]),
|
|
542
|
+
day.isOpen && day.periods && day.periods.length > 0 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_23, [
|
|
543
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(day.periods, (period, pIndex) => {
|
|
544
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
545
|
+
key: `special-period-${pIndex}`
|
|
546
|
+
}, [
|
|
547
|
+
vue.createElementVNode("span", _hoisted_24, vue.toDisplayString(period.open) + " - " + vue.toDisplayString(period.close), 1),
|
|
548
|
+
pIndex < day.periods.length - 1 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_25, ", ")) : vue.createCommentVNode("", true)
|
|
549
|
+
], 64);
|
|
550
|
+
}), 128))
|
|
551
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_26, vue.toDisplayString(vue.unref(t)("workingHours.closed")), 1))
|
|
552
|
+
]),
|
|
553
|
+
vue.createElementVNode("div", _hoisted_27, [
|
|
554
|
+
vue.createVNode(Button.default, {
|
|
555
|
+
class: "pd-micro bg-light",
|
|
556
|
+
submit: () => editSpecialDay(index),
|
|
557
|
+
showSucces: false,
|
|
558
|
+
showLoader: false
|
|
559
|
+
}, {
|
|
560
|
+
default: vue.withCtx(() => [
|
|
561
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.edit")), 1)
|
|
562
|
+
]),
|
|
563
|
+
_: 2
|
|
564
|
+
}, 1032, ["submit"]),
|
|
565
|
+
vue.createVNode(Button.default, {
|
|
566
|
+
class: "pd-micro bg-fourth-nano",
|
|
567
|
+
submit: () => removeSpecialDay(index),
|
|
568
|
+
showSucces: false,
|
|
569
|
+
showLoader: false
|
|
570
|
+
}, {
|
|
571
|
+
default: vue.withCtx(() => [
|
|
572
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.remove")), 1)
|
|
573
|
+
]),
|
|
574
|
+
_: 2
|
|
575
|
+
}, 1032, ["submit"])
|
|
576
|
+
])
|
|
577
|
+
], 2);
|
|
578
|
+
}), 128))
|
|
579
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_28, vue.toDisplayString(vue.unref(t)("workingHours.noSpecialDays")), 1))
|
|
580
|
+
]),
|
|
581
|
+
vue.createVNode(Popup.default, {
|
|
582
|
+
isPopupOpen: showRegularDayModal.value,
|
|
583
|
+
onClosePopup: _cache[2] || (_cache[2] = ($event) => showRegularDayModal.value = false),
|
|
584
|
+
title: editingRegularIndex.value !== null ? vue.unref(t)("workingHours.editRegularDay") : vue.unref(t)("workingHours.addRegularDay"),
|
|
585
|
+
class: "bg-white pd-semi w-m-33r radius-big"
|
|
586
|
+
}, {
|
|
587
|
+
default: vue.withCtx(() => [
|
|
588
|
+
vue.createElementVNode("div", _hoisted_29, [
|
|
589
|
+
vue.createVNode(Select.default, {
|
|
590
|
+
select: currentRegularDay.value.dayOfWeek,
|
|
591
|
+
"onUpdate:select": _cache[0] || (_cache[0] = ($event) => currentRegularDay.value.dayOfWeek = $event),
|
|
592
|
+
value: "text",
|
|
593
|
+
options: availableWeekdays.value,
|
|
594
|
+
property: "value",
|
|
595
|
+
class: "pos-relative w-100 mn-b-small bg-light radius-small pd-medium"
|
|
596
|
+
}, null, 8, ["select", "options"]),
|
|
597
|
+
vue.createVNode(Checkbox.default, {
|
|
598
|
+
label: vue.unref(t)("workingHours.isOpen"),
|
|
599
|
+
name: "isOpenRegular",
|
|
600
|
+
value: true,
|
|
601
|
+
radio: currentRegularDay.value.isOpen,
|
|
602
|
+
"onUpdate:radio": _cache[1] || (_cache[1] = (val) => currentRegularDay.value.isOpen = val),
|
|
603
|
+
class: "w-100 mn-b-small bg-light radius-small pd-small"
|
|
604
|
+
}, null, 8, ["label", "radio"]),
|
|
605
|
+
currentRegularDay.value.isOpen ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_30, [
|
|
606
|
+
vue.createElementVNode("div", _hoisted_31, [
|
|
607
|
+
vue.createElementVNode("h5", _hoisted_32, vue.toDisplayString(vue.unref(t)("workingHours.periods")), 1),
|
|
608
|
+
vue.createVNode(Button.default, {
|
|
609
|
+
class: "pd-micro bg-light",
|
|
610
|
+
submit: addPeriodToRegular,
|
|
611
|
+
showSucces: false,
|
|
612
|
+
showLoader: false
|
|
613
|
+
}, {
|
|
614
|
+
default: vue.withCtx(() => [
|
|
615
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.addPeriod")), 1)
|
|
616
|
+
]),
|
|
617
|
+
_: 1
|
|
618
|
+
})
|
|
619
|
+
]),
|
|
620
|
+
validationErrors.value.overlappingPeriods ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_33, vue.toDisplayString(vue.unref(t)("workingHours.errorOverlappingPeriods")), 1)) : vue.createCommentVNode("", true),
|
|
621
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentRegularDay.value.periods, (period, pIndex) => {
|
|
622
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
623
|
+
key: `edit-period-${pIndex}`,
|
|
624
|
+
class: "period-row mn-b-small flex flex-nowrap gap-small"
|
|
625
|
+
}, [
|
|
626
|
+
vue.createElementVNode("div", _hoisted_34, [
|
|
627
|
+
vue.createVNode(Field.default, {
|
|
628
|
+
field: period.open,
|
|
629
|
+
"onUpdate:field": ($event) => period.open = $event,
|
|
630
|
+
label: vue.unref(t)("workingHours.opens"),
|
|
631
|
+
type: "time",
|
|
632
|
+
class: "bg-light radius-small pd-medium",
|
|
633
|
+
onBlur: validatePeriods
|
|
634
|
+
}, null, 8, ["field", "onUpdate:field", "label"]),
|
|
635
|
+
vue.createVNode(Field.default, {
|
|
636
|
+
field: period.close,
|
|
637
|
+
"onUpdate:field": ($event) => period.close = $event,
|
|
638
|
+
label: vue.unref(t)("workingHours.closes"),
|
|
639
|
+
type: "time",
|
|
640
|
+
class: "bg-light radius-small pd-medium",
|
|
641
|
+
onBlur: validatePeriods
|
|
642
|
+
}, null, 8, ["field", "onUpdate:field", "label"])
|
|
643
|
+
]),
|
|
644
|
+
currentRegularDay.value.periods.length > 1 ? (vue.openBlock(), vue.createBlock(Button.default, {
|
|
645
|
+
key: 0,
|
|
646
|
+
class: "pd-micro bg-fourth-nano",
|
|
647
|
+
submit: () => removeRegularPeriod(pIndex),
|
|
648
|
+
showSucces: false,
|
|
649
|
+
showLoader: false
|
|
650
|
+
}, {
|
|
651
|
+
default: vue.withCtx(() => [
|
|
652
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.remove")), 1)
|
|
653
|
+
]),
|
|
654
|
+
_: 2
|
|
655
|
+
}, 1032, ["submit"])) : vue.createCommentVNode("", true)
|
|
656
|
+
]);
|
|
657
|
+
}), 128))
|
|
658
|
+
])) : vue.createCommentVNode("", true),
|
|
659
|
+
vue.createElementVNode("div", _hoisted_35, [
|
|
660
|
+
vue.createVNode(Button.default, {
|
|
661
|
+
class: "w-100 bg-light",
|
|
662
|
+
submit: () => showRegularDayModal.value = false,
|
|
663
|
+
showSucces: false,
|
|
664
|
+
showLoader: false
|
|
665
|
+
}, {
|
|
666
|
+
default: vue.withCtx(() => [
|
|
667
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.cancel")), 1)
|
|
668
|
+
]),
|
|
669
|
+
_: 1
|
|
670
|
+
}, 8, ["submit"]),
|
|
671
|
+
vue.createVNode(Button.default, {
|
|
672
|
+
class: "w-100 bg-main",
|
|
673
|
+
submit: saveRegularDay,
|
|
674
|
+
showSucces: false,
|
|
675
|
+
disabled: !isValidRegularDay.value
|
|
676
|
+
}, {
|
|
677
|
+
default: vue.withCtx(() => [
|
|
678
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.save")), 1)
|
|
679
|
+
]),
|
|
680
|
+
_: 1
|
|
681
|
+
}, 8, ["disabled"])
|
|
682
|
+
])
|
|
683
|
+
])
|
|
684
|
+
]),
|
|
685
|
+
_: 1
|
|
686
|
+
}, 8, ["isPopupOpen", "title"]),
|
|
687
|
+
vue.createVNode(Popup.default, {
|
|
688
|
+
isPopupOpen: showSpecialDayModal.value,
|
|
689
|
+
onClosePopup: _cache[6] || (_cache[6] = ($event) => showSpecialDayModal.value = false),
|
|
690
|
+
title: editingSpecialIndex.value !== null ? vue.unref(t)("workingHours.editSpecialDay") : vue.unref(t)("workingHours.addSpecialDay"),
|
|
691
|
+
class: "bg-white pd-semi w-m-33r radius-big"
|
|
692
|
+
}, {
|
|
693
|
+
default: vue.withCtx(() => [
|
|
694
|
+
vue.createElementVNode("div", _hoisted_36, [
|
|
695
|
+
vue.createVNode(Field.default, {
|
|
696
|
+
field: currentSpecialDay.value.dateInput,
|
|
697
|
+
"onUpdate:field": _cache[3] || (_cache[3] = ($event) => currentSpecialDay.value.dateInput = $event),
|
|
698
|
+
label: vue.unref(t)("workingHours.date"),
|
|
699
|
+
type: "date",
|
|
700
|
+
class: "bg-light radius-small pd-medium mn-b-small",
|
|
701
|
+
onBlur: validateSpecialDate
|
|
702
|
+
}, null, 8, ["field", "label"]),
|
|
703
|
+
validationErrors.value.duplicateDate ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_37, vue.toDisplayString(vue.unref(t)("workingHours.errorDuplicateDate")), 1)) : vue.createCommentVNode("", true),
|
|
704
|
+
vue.createVNode(Field.default, {
|
|
705
|
+
field: currentSpecialDay.value.description,
|
|
706
|
+
"onUpdate:field": _cache[4] || (_cache[4] = ($event) => currentSpecialDay.value.description = $event),
|
|
707
|
+
label: vue.unref(t)("workingHours.description"),
|
|
708
|
+
placeholder: vue.unref(t)("workingHours.descriptionPlaceholder"),
|
|
709
|
+
class: "bg-light radius-small pd-medium mn-b-small"
|
|
710
|
+
}, null, 8, ["field", "label", "placeholder"]),
|
|
711
|
+
vue.createVNode(Checkbox.default, {
|
|
712
|
+
label: vue.unref(t)("workingHours.isOpen"),
|
|
713
|
+
name: "isOpenSpecial",
|
|
714
|
+
value: true,
|
|
715
|
+
radio: currentSpecialDay.value.isOpen,
|
|
716
|
+
"onUpdate:radio": _cache[5] || (_cache[5] = (val) => currentSpecialDay.value.isOpen = val),
|
|
717
|
+
class: "w-100 mn-b-small bg-white radius-small pd-small"
|
|
718
|
+
}, null, 8, ["label", "radio"]),
|
|
719
|
+
currentSpecialDay.value.isOpen ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_38, [
|
|
720
|
+
vue.createElementVNode("div", _hoisted_39, [
|
|
721
|
+
vue.createElementVNode("h5", _hoisted_40, vue.toDisplayString(vue.unref(t)("workingHours.periods")), 1),
|
|
722
|
+
vue.createVNode(Button.default, {
|
|
723
|
+
class: "pd-micro bg-light",
|
|
724
|
+
submit: addPeriodToSpecial,
|
|
725
|
+
showSucces: false,
|
|
726
|
+
showLoader: false
|
|
727
|
+
}, {
|
|
728
|
+
default: vue.withCtx(() => [
|
|
729
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.addPeriod")), 1)
|
|
730
|
+
]),
|
|
731
|
+
_: 1
|
|
732
|
+
})
|
|
733
|
+
]),
|
|
734
|
+
validationErrors.value.overlappingPeriods ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_41, vue.toDisplayString(vue.unref(t)("workingHours.errorOverlappingPeriods")), 1)) : vue.createCommentVNode("", true),
|
|
735
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(currentSpecialDay.value.periods, (period, pIndex) => {
|
|
736
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
737
|
+
key: `edit-special-period-${pIndex}`,
|
|
738
|
+
class: "period-row mn-b-small flex flex-nowrap gap-small"
|
|
739
|
+
}, [
|
|
740
|
+
vue.createElementVNode("div", _hoisted_42, [
|
|
741
|
+
vue.createVNode(Field.default, {
|
|
742
|
+
field: period.open,
|
|
743
|
+
"onUpdate:field": ($event) => period.open = $event,
|
|
744
|
+
label: vue.unref(t)("workingHours.opens"),
|
|
745
|
+
type: "time",
|
|
746
|
+
class: "bg-light radius-small pd-medium",
|
|
747
|
+
onBlur: validatePeriods
|
|
748
|
+
}, null, 8, ["field", "onUpdate:field", "label"]),
|
|
749
|
+
vue.createVNode(Field.default, {
|
|
750
|
+
field: period.close,
|
|
751
|
+
"onUpdate:field": ($event) => period.close = $event,
|
|
752
|
+
label: vue.unref(t)("workingHours.closes"),
|
|
753
|
+
type: "time",
|
|
754
|
+
class: "bg-light radius-small pd-medium",
|
|
755
|
+
onBlur: validatePeriods
|
|
756
|
+
}, null, 8, ["field", "onUpdate:field", "label"])
|
|
757
|
+
]),
|
|
758
|
+
currentSpecialDay.value.periods.length > 1 ? (vue.openBlock(), vue.createBlock(Button.default, {
|
|
759
|
+
key: 0,
|
|
760
|
+
class: "pd-micro bg-fourth-nano",
|
|
761
|
+
submit: () => removeSpecialPeriod(pIndex),
|
|
762
|
+
showSucces: false,
|
|
763
|
+
showLoader: false
|
|
764
|
+
}, {
|
|
765
|
+
default: vue.withCtx(() => [
|
|
766
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.remove")), 1)
|
|
767
|
+
]),
|
|
768
|
+
_: 2
|
|
769
|
+
}, 1032, ["submit"])) : vue.createCommentVNode("", true)
|
|
770
|
+
]);
|
|
771
|
+
}), 128))
|
|
772
|
+
])) : vue.createCommentVNode("", true),
|
|
773
|
+
vue.createElementVNode("div", _hoisted_43, [
|
|
774
|
+
vue.createVNode(Button.default, {
|
|
775
|
+
class: "w-100 bg-light",
|
|
776
|
+
submit: () => showSpecialDayModal.value = false,
|
|
777
|
+
showSucces: false,
|
|
778
|
+
showLoader: false
|
|
779
|
+
}, {
|
|
780
|
+
default: vue.withCtx(() => [
|
|
781
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.cancel")), 1)
|
|
782
|
+
]),
|
|
783
|
+
_: 1
|
|
784
|
+
}, 8, ["submit"]),
|
|
785
|
+
vue.createVNode(Button.default, {
|
|
786
|
+
class: "w-100 bg-main",
|
|
787
|
+
submit: saveSpecialDay,
|
|
788
|
+
showSucces: false,
|
|
789
|
+
disabled: !isValidSpecialDay.value
|
|
790
|
+
}, {
|
|
791
|
+
default: vue.withCtx(() => [
|
|
792
|
+
vue.createTextVNode(vue.toDisplayString(vue.unref(t)("workingHours.save")), 1)
|
|
793
|
+
]),
|
|
794
|
+
_: 1
|
|
795
|
+
}, 8, ["disabled"])
|
|
796
|
+
])
|
|
797
|
+
])
|
|
798
|
+
]),
|
|
799
|
+
_: 1
|
|
800
|
+
}, 8, ["isPopupOpen", "title"])
|
|
801
|
+
]);
|
|
802
|
+
};
|
|
803
|
+
}
|
|
804
|
+
};
|
|
805
|
+
const WorktimeEdit = /* @__PURE__ */ _pluginVue_exportHelper.default(_sfc_main, [["__scopeId", "data-v-f62ccd5d"]]);
|
|
806
|
+
exports.default = WorktimeEdit;
|
|
807
|
+
//# sourceMappingURL=WorktimeEdit.vue.cjs.map
|