@feedmepos/mf-order-setting 0.0.56-dev.1 → 0.0.56-dev.2
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/.tsbuildinfo +1 -1
- package/dist/{KioskDevicesView-CccsAZqK.js → KioskDevicesView-Qv-xd_kZ.js} +1 -1
- package/dist/{KioskDevicesView.vue_vue_type_script_setup_true_lang-dF1jgi53.js → KioskDevicesView.vue_vue_type_script_setup_true_lang-CCF1mKni.js} +2 -2
- package/dist/KioskSettingView-CvvrK6Bv.js +643 -0
- package/dist/{KioskView-DmaCjLcw.js → KioskView-CppTVBv-.js} +117 -117
- package/dist/OrderSettingsView-C38N61dM.js +36564 -0
- package/dist/{app-EGmxrjDM.js → app-Bss1GkKY.js} +4 -4
- package/dist/app.js +1 -1
- package/dist/{dayjs.min-lCwCAXUZ.js → dayjs.min-DZfxGUk4.js} +1 -1
- package/dist/frontend/mf-order/src/stores/order-setting/index.d.ts +3 -0
- package/dist/frontend/mf-order/src/stores/restaurant/index.d.ts +1 -1
- package/dist/frontend/mf-order/src/views/kiosk/settings/KioskPaymentTypeSection.vue.d.ts +13 -3
- package/dist/frontend/mf-order/src/views/order-settings/delivery/integrated-delivery/ExternalSetting.vue.d.ts +12 -4
- package/dist/frontend/mf-order/src/views/order-settings/dine-in/OfflinePaymentTypeDialog.vue.d.ts +4 -4
- package/dist/frontend/mf-order/src/views/order-settings/dine-in/PaymentType.vue.d.ts +38 -4
- package/dist/frontend/mf-order/src/views/order-settings/pickup/PaymentSidesheet.vue.d.ts +1 -0
- package/dist/frontend/mf-order/src/views/order-settings/reservation/CustomTimePicker.vue.d.ts +1 -0
- package/dist/{index-CWrX79Jg.js → index-B6AGCsrw.js} +6 -6
- package/dist/index-BpKR-Cxd.js +19757 -0
- package/dist/{menu.dto-CgymySda.js → menu.dto-C_B3M2fs.js} +44222 -46755
- package/dist/package/entity/incoming-order/incoming-order.do.d.ts +22443 -3
- package/dist/package/entity/incoming-order/incoming-order.dto.d.ts +3 -3
- package/dist/package/entity/incoming-order/incoming-order.enum.d.ts +1 -1
- package/dist/package/entity/index.d.ts +1 -0
- package/dist/package/entity/marketing/marketing.dto.d.ts +1 -1
- package/dist/package/entity/order/dine-in/qr.dto.d.ts +38 -0
- package/dist/package/entity/order/order.do.d.ts +6358 -2
- package/dist/package/entity/order/order.dto.d.ts +22 -0
- package/dist/package/entity/order-platform/deliveroo/deliveroo-dto.d.ts +3 -0
- package/dist/package/entity/order-platform/deliveroo/deliveroo-setting.do.d.ts +3 -0
- package/dist/package/entity/order-platform/external/order/external-order.do.d.ts +12 -12
- package/dist/package/entity/order-platform/external/order/external-order.dto.d.ts +32 -32
- package/dist/package/entity/order-platform/external/setting/external-setting.do.d.ts +21 -3
- package/dist/package/entity/order-platform/external/setting/external-setting.dto.d.ts +12 -2
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/foodpanda/foodpanda-settings.dto.d.ts +3 -0
- package/dist/package/entity/order-platform/grabfood/grabfood-edit-order.do.d.ts +9 -1
- package/dist/package/entity/order-platform/grabfood/grabfood-settings.do.d.ts +2 -2
- package/dist/package/entity/order-platform/grabfood/grabfood.dto.d.ts +3 -3
- package/dist/package/entity/order-platform/order-platform.dto.d.ts +2 -2
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.do.d.ts +3 -0
- package/dist/package/entity/order-platform/shopeefood/shopeefood-settings.dto.d.ts +3 -0
- package/dist/package/entity/order-setting/order-setting.do.d.ts +3 -0
- package/dist/package/entity/order-setting/order-setting.dto.d.ts +6 -0
- package/dist/package/entity/queue/queue.do.d.ts +3 -8
- package/dist/package/entity/queue/queue.dto.d.ts +10 -0
- package/dist/package/entity/reservation/reservation.do.d.ts +4 -0
- package/dist/package/entity/reservation/reservation.dto.d.ts +10 -0
- package/dist/package/entity/reservation/reservation.utils.d.ts +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/views/kiosk/KioskSummary.vue +3 -0
- package/src/views/kiosk/settings/KioskPaymentTypeSection.vue +99 -211
- package/src/views/kiosk/settings/KioskSettingView.vue +27 -11
- package/src/views/order-settings/dine-in/DineInSetting.vue +1 -0
- package/src/views/order-settings/dine-in/OfflinePaymentTypeDialog.vue +2 -3
- package/src/views/order-settings/dine-in/PaymentType.vue +151 -43
- package/src/views/order-settings/pickup/PaymentSidesheet.vue +33 -172
- package/src/views/order-settings/pickup/PickUpSettingDialogContent.vue +1 -0
- package/src/views/order-settings/reservation/CustomTimePicker.vue +129 -49
- package/src/views/order-settings/reservation/ReservationSetting.vue +547 -303
- package/dist/KioskSettingView-8GY7AT-N.js +0 -722
- package/dist/OrderSettingsView-BZcU4t9L.js +0 -56240
- package/dist/index-BXsnV_eO.js +0 -150
|
@@ -4,6 +4,7 @@ import { ref, computed, onMounted, onUnmounted, nextTick } from 'vue'
|
|
|
4
4
|
const props = defineProps<{
|
|
5
5
|
modelValue: string
|
|
6
6
|
minTime?: string // Optional minimum time (HH:MM format)
|
|
7
|
+
restrictMinTime?: boolean
|
|
7
8
|
}>()
|
|
8
9
|
|
|
9
10
|
const emit = defineEmits<{
|
|
@@ -11,7 +12,8 @@ const emit = defineEmits<{
|
|
|
11
12
|
}>()
|
|
12
13
|
|
|
13
14
|
const isOpen = ref(false)
|
|
14
|
-
const
|
|
15
|
+
const wrapperRef = ref<HTMLDivElement | null>(null)
|
|
16
|
+
const inputRef = ref<HTMLInputElement | null>(null)
|
|
15
17
|
const dropdownRef = ref<HTMLDivElement | null>(null)
|
|
16
18
|
|
|
17
19
|
// Generate time options in 30-minute intervals
|
|
@@ -27,7 +29,7 @@ const timeOptions = computed(() => {
|
|
|
27
29
|
options.push('23:59')
|
|
28
30
|
|
|
29
31
|
// Filter out times earlier than minTime if provided
|
|
30
|
-
if (props.minTime) {
|
|
32
|
+
if (props.minTime && props.restrictMinTime !== false) {
|
|
31
33
|
return options.filter((time) => isTimeGreaterOrEqual(time, props.minTime!))
|
|
32
34
|
}
|
|
33
35
|
|
|
@@ -59,7 +61,7 @@ function selectTime(time: string) {
|
|
|
59
61
|
|
|
60
62
|
function handleClickOutside(event: MouseEvent) {
|
|
61
63
|
const target = event.target as Node
|
|
62
|
-
const wrapperElement =
|
|
64
|
+
const wrapperElement = wrapperRef.value
|
|
63
65
|
|
|
64
66
|
if (
|
|
65
67
|
dropdownRef.value &&
|
|
@@ -77,15 +79,18 @@ function handleFocus() {
|
|
|
77
79
|
|
|
78
80
|
function toggleDropdown(event?: Event) {
|
|
79
81
|
event?.stopPropagation()
|
|
82
|
+
const willOpen = !isOpen.value
|
|
83
|
+
|
|
80
84
|
// Close all other open dropdowns by dispatching a global event
|
|
81
|
-
if (
|
|
85
|
+
if (willOpen) {
|
|
82
86
|
window.dispatchEvent(new CustomEvent('closeTimePickers'))
|
|
83
87
|
}
|
|
84
|
-
isOpen.value =
|
|
88
|
+
isOpen.value = willOpen
|
|
85
89
|
|
|
86
90
|
// Scroll to selected time when opening
|
|
87
|
-
if (
|
|
91
|
+
if (willOpen) {
|
|
88
92
|
nextTick(() => {
|
|
93
|
+
inputRef.value?.focus()
|
|
89
94
|
scrollToSelectedTime()
|
|
90
95
|
})
|
|
91
96
|
}
|
|
@@ -95,28 +100,101 @@ function scrollToSelectedTime() {
|
|
|
95
100
|
const scrollContainer = dropdownRef.value?.querySelector('.overflow-y-auto')
|
|
96
101
|
if (!scrollContainer) return
|
|
97
102
|
|
|
98
|
-
const selectedElement = scrollContainer.querySelector(
|
|
103
|
+
const selectedElement = scrollContainer.querySelector(
|
|
104
|
+
'[data-selected="true"]'
|
|
105
|
+
) as HTMLElement | null
|
|
99
106
|
if (selectedElement) {
|
|
100
|
-
|
|
107
|
+
const container = scrollContainer as HTMLElement
|
|
108
|
+
const targetScrollTop =
|
|
109
|
+
selectedElement.offsetTop - container.clientHeight / 2 + selectedElement.clientHeight / 2
|
|
110
|
+
container.scrollTop = Math.max(0, targetScrollTop)
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function formatTimeInput(value: string) {
|
|
115
|
+
const digits = value.replace(/\D/g, '').slice(0, 4)
|
|
116
|
+
|
|
117
|
+
if (!digits) {
|
|
118
|
+
return ''
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let hours = digits.slice(0, 2)
|
|
122
|
+
let minutes = digits.slice(2, 4)
|
|
123
|
+
|
|
124
|
+
if (hours.length === 2) {
|
|
125
|
+
hours = String(Math.min(Number(hours), 23)).padStart(2, '0')
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
if (minutes.length === 1) {
|
|
129
|
+
minutes = String(Math.min(Number(minutes), 5))
|
|
101
130
|
}
|
|
131
|
+
|
|
132
|
+
if (minutes.length === 2) {
|
|
133
|
+
minutes = String(Math.min(Number(minutes), 59)).padStart(2, '0')
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (digits.length <= 2) {
|
|
137
|
+
return digits.length === 2 ? `${hours}:` : hours
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return `${hours}:${minutes}`
|
|
102
141
|
}
|
|
103
142
|
|
|
104
|
-
function
|
|
105
|
-
|
|
143
|
+
function hasSelection(input: HTMLInputElement) {
|
|
144
|
+
return (input.selectionStart ?? 0) !== (input.selectionEnd ?? 0)
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function handleKeydown(event: KeyboardEvent) {
|
|
148
|
+
if (event.ctrlKey || event.metaKey || event.altKey) {
|
|
149
|
+
return
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
const allowedKeys = ['Backspace', 'Delete', 'Tab', 'ArrowLeft', 'ArrowRight', 'Home', 'End']
|
|
153
|
+
if (allowedKeys.includes(event.key)) {
|
|
154
|
+
return
|
|
155
|
+
}
|
|
106
156
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
157
|
+
if (!/^\d$/.test(event.key)) {
|
|
158
|
+
event.preventDefault()
|
|
159
|
+
return
|
|
110
160
|
}
|
|
111
161
|
|
|
112
|
-
|
|
113
|
-
if (
|
|
114
|
-
|
|
162
|
+
const input = event.target as HTMLInputElement | null
|
|
163
|
+
if (!input) {
|
|
164
|
+
return
|
|
115
165
|
}
|
|
116
166
|
|
|
167
|
+
const digitCount = input.value.replace(/\D/g, '').length
|
|
168
|
+
if (digitCount >= 4 && !hasSelection(input)) {
|
|
169
|
+
event.preventDefault()
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
function handleInput(event: Event) {
|
|
174
|
+
const input = event.target as HTMLInputElement | null
|
|
175
|
+
if (!input) {
|
|
176
|
+
return
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
const formattedValue = formatTimeInput(input.value)
|
|
180
|
+
input.value = formattedValue
|
|
181
|
+
displayValue.value = formattedValue
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function handlePaste(event: ClipboardEvent) {
|
|
185
|
+
event.preventDefault()
|
|
186
|
+
|
|
187
|
+
const pastedText = event.clipboardData?.getData('text') || ''
|
|
188
|
+
const formattedValue = formatTimeInput(pastedText)
|
|
189
|
+
|
|
117
190
|
displayValue.value = formattedValue
|
|
118
191
|
}
|
|
119
192
|
|
|
193
|
+
function focusInput() {
|
|
194
|
+
inputRef.value?.focus()
|
|
195
|
+
isOpen.value = true
|
|
196
|
+
}
|
|
197
|
+
|
|
120
198
|
function handleCloseTimePickers() {
|
|
121
199
|
isOpen.value = false
|
|
122
200
|
}
|
|
@@ -133,26 +211,32 @@ onUnmounted(() => {
|
|
|
133
211
|
</script>
|
|
134
212
|
|
|
135
213
|
<template>
|
|
136
|
-
<div class="relative
|
|
137
|
-
<div @click="
|
|
138
|
-
<
|
|
214
|
+
<div class="relative">
|
|
215
|
+
<div ref="wrapperRef" @click="focusInput" class="relative inline-flex w-[132px] max-w-full">
|
|
216
|
+
<input
|
|
139
217
|
ref="inputRef"
|
|
140
|
-
:
|
|
141
|
-
@
|
|
218
|
+
:value="displayValue"
|
|
219
|
+
@input="handleInput"
|
|
220
|
+
@keydown="handleKeydown"
|
|
221
|
+
@paste="handlePaste"
|
|
142
222
|
@focus="handleFocus"
|
|
143
223
|
placeholder="HH:MM"
|
|
144
224
|
class="time-picker-field"
|
|
145
|
-
:class="{
|
|
146
|
-
focused: isOpen
|
|
147
|
-
}"
|
|
148
225
|
maxlength="5"
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
<FmIcon
|
|
152
|
-
class="absolute right-1 transition-all duration-200"
|
|
153
|
-
name="chevron_right"
|
|
154
|
-
:class="{ 'rotate-[-90deg] top-[4px]': isOpen, 'rotate-[90deg] top-[5px]': !isOpen }"
|
|
226
|
+
inputmode="numeric"
|
|
227
|
+
autocomplete="off"
|
|
155
228
|
/>
|
|
229
|
+
<button
|
|
230
|
+
type="button"
|
|
231
|
+
@click.stop="toggleDropdown"
|
|
232
|
+
class="absolute inset-y-0 right-0 flex items-center pr-3 text-gray-500 hover:text-gray-700"
|
|
233
|
+
>
|
|
234
|
+
<FmIcon
|
|
235
|
+
class="text-[18px] transition-all duration-200"
|
|
236
|
+
name="chevron_right"
|
|
237
|
+
:class="{ 'rotate-[-90deg]': isOpen, 'rotate-[90deg]': !isOpen }"
|
|
238
|
+
/>
|
|
239
|
+
</button>
|
|
156
240
|
</div>
|
|
157
241
|
|
|
158
242
|
<div
|
|
@@ -199,33 +283,29 @@ onUnmounted(() => {
|
|
|
199
283
|
background: #9ca3af;
|
|
200
284
|
}
|
|
201
285
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
border-width:
|
|
206
|
-
border-
|
|
207
|
-
padding: 12px 16px;
|
|
208
|
-
font-size: 1.125rem;
|
|
209
|
-
transition: all 0.2s;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
.time-picker-field :deep(.fm-text-field-input):not(:focus):not(:focus-within) {
|
|
286
|
+
.time-picker-field {
|
|
287
|
+
width: 100%;
|
|
288
|
+
height: 40px;
|
|
289
|
+
border-width: 1.5px;
|
|
290
|
+
border-style: solid;
|
|
213
291
|
border-color: rgb(209 213 219);
|
|
214
|
-
|
|
292
|
+
border-radius: 0.625rem;
|
|
293
|
+
padding: 8px 36px 8px 12px;
|
|
294
|
+
font-size: 0.95rem;
|
|
295
|
+
line-height: 1.25rem;
|
|
296
|
+
font-weight: 500;
|
|
297
|
+
transition: all 0.2s;
|
|
215
298
|
background-color: white;
|
|
299
|
+
outline: none;
|
|
300
|
+
box-sizing: border-box;
|
|
216
301
|
}
|
|
217
302
|
|
|
218
|
-
.time-picker-field
|
|
303
|
+
.time-picker-field:hover {
|
|
219
304
|
border-color: rgb(156 163 175);
|
|
220
|
-
/* gray-400 */
|
|
221
305
|
}
|
|
222
306
|
|
|
223
|
-
.time-picker-field
|
|
224
|
-
.time-picker-field :deep(.fm-text-field-input):focus,
|
|
225
|
-
.time-picker-field :deep(.fm-text-field-input):focus-within {
|
|
307
|
+
.time-picker-field:focus {
|
|
226
308
|
border-color: rgb(249 115 22) !important;
|
|
227
|
-
/* orange-500 */
|
|
228
309
|
background-color: rgb(255 247 237) !important;
|
|
229
|
-
/* orange-50 */
|
|
230
310
|
}
|
|
231
311
|
</style>
|