@movvjs/svelte-schedule-view 0.4.18 → 0.4.20
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/i18n/locales/en.json +2 -1
- package/dist/i18n/locales/ko.json +2 -1
- package/dist/i18n/locales/vi.json +2 -1
- package/dist/i18n/locales/zh-cn.json +2 -1
- package/dist/i18n/locales/zh-tw.json +2 -1
- package/dist/schedule-view/BookingInfo.svelte +8 -6
- package/dist/schedule-view/EmailList.svelte +25 -11
- package/dist/schedule-view/Schedule.svelte +7 -1
- package/dist/schedule-view/Schedule.svelte.d.ts +1 -0
- package/dist/schedule-view/assets/css/indie_booking.css +4992 -0
- package/package.json +1 -1
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
},
|
|
71
71
|
"error": {
|
|
72
72
|
"pleaseEnterGuestName": "Please enter guest name",
|
|
73
|
-
"pleaseEnterTelNumber": "Please enter tel number."
|
|
73
|
+
"pleaseEnterTelNumber": "Please enter tel number.",
|
|
74
|
+
"dupliEmail": "There is a duplicate email."
|
|
74
75
|
},
|
|
75
76
|
"extraServiceType": {
|
|
76
77
|
"BABY": "Infant car seat",
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"error": {
|
|
59
59
|
"pleaseEnterGuestName": "Vui lòng nhập tên khách",
|
|
60
|
-
"pleaseEnterTelNumber": "Vui lòng nhập số điện thoại."
|
|
60
|
+
"pleaseEnterTelNumber": "Vui lòng nhập số điện thoại.",
|
|
61
|
+
"dupliEmail": "Có email trùng lặp."
|
|
61
62
|
},
|
|
62
63
|
"extraServiceType": {
|
|
63
64
|
"BABY": "Ghế cho em bé",
|
|
@@ -285,13 +285,15 @@ function openCalender() {
|
|
|
285
285
|
<th>E-mail</th>
|
|
286
286
|
<td>
|
|
287
287
|
{#if !$isEdit}
|
|
288
|
-
<
|
|
288
|
+
<div class="scroll_box">
|
|
289
|
+
<p>{$originalBooking.email}</p>
|
|
289
290
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
{#each $originalBooking.emailList || [] as email}
|
|
292
|
+
{#if email?.trim()}
|
|
293
|
+
<p>{email}</p>
|
|
294
|
+
{/if}
|
|
295
|
+
{/each}
|
|
296
|
+
</div>
|
|
295
297
|
{:else}
|
|
296
298
|
<!-- <input bind:value={$copiedBooking.email} type="email" class="indie_text_nor xs3 white w100" placeholder="E-mail" /> -->
|
|
297
299
|
{#if $copiedBooking}
|
|
@@ -16,18 +16,32 @@ function updateEmail(index, value) {
|
|
|
16
16
|
emailList[index] = value;
|
|
17
17
|
emailList = [...emailList];
|
|
18
18
|
}
|
|
19
|
+
function keyAdd(e) {
|
|
20
|
+
if (e.key === "Enter") {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
addEmail();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
19
25
|
</script>
|
|
20
26
|
|
|
21
|
-
<div class="
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<
|
|
27
|
+
<div class="add_email_wrap">
|
|
28
|
+
<div class="add_email_list">
|
|
29
|
+
{#each emailList as email, index}
|
|
30
|
+
<div class="item">
|
|
31
|
+
<input
|
|
32
|
+
type="text"
|
|
33
|
+
class="indie_text_nor w100"
|
|
34
|
+
placeholder="E-mail"
|
|
35
|
+
value={email}
|
|
36
|
+
on:input={e => updateEmail(index, e.currentTarget.value)}
|
|
37
|
+
on:keydown={keyAdd} />
|
|
25
38
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
39
|
+
{#if index === 0}
|
|
40
|
+
<button type="button" class="button_add" on:click={addEmail}> 추가 </button>
|
|
41
|
+
{:else}
|
|
42
|
+
<button type="button" class="button_minus" on:click={() => removeEmail(index)}> 삭제 </button>
|
|
43
|
+
{/if}
|
|
44
|
+
</div>
|
|
45
|
+
{/each}
|
|
46
|
+
</div>
|
|
33
47
|
</div>
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
</script>
|
|
3
3
|
|
|
4
4
|
<script>import "./assets/scss/indie_booking.scss";
|
|
5
|
+
import "./assets/css/indie_booking.css";
|
|
5
6
|
import { writable } from "svelte/store";
|
|
6
7
|
import { cloneDeep } from "lodash-es";
|
|
7
8
|
import consola from "consola";
|
|
@@ -178,7 +179,6 @@ async function edit() {
|
|
|
178
179
|
...preview,
|
|
179
180
|
emailList: mergedEmailList
|
|
180
181
|
};
|
|
181
|
-
console.log(">>>>>>>>>>>>", $copiedBooking.emailList);
|
|
182
182
|
$originalBooking = cloneDeep($copiedBooking);
|
|
183
183
|
$isEdit = true;
|
|
184
184
|
} catch (e) {
|
|
@@ -193,6 +193,10 @@ async function edit() {
|
|
|
193
193
|
function reset() {
|
|
194
194
|
$copiedBooking = cloneDeep($originalBooking);
|
|
195
195
|
}
|
|
196
|
+
function hasDuplicateEmail(emailList) {
|
|
197
|
+
const filtered = emailList.map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
198
|
+
return new Set(filtered).size !== filtered.length;
|
|
199
|
+
}
|
|
196
200
|
async function save() {
|
|
197
201
|
try {
|
|
198
202
|
if (!$fullName) {
|
|
@@ -201,6 +205,8 @@ async function save() {
|
|
|
201
205
|
if (!$copiedBooking.tel) {
|
|
202
206
|
throw new Error($t("error.pleaseEnterTelNumber"));
|
|
203
207
|
}
|
|
208
|
+
if (hasDuplicateEmail($copiedBooking.emailList))
|
|
209
|
+
throw new Error("error.dupliEmail");
|
|
204
210
|
const cleaned = $copiedBooking.emailList.map((e) => e?.trim()).filter(Boolean);
|
|
205
211
|
$copiedBooking.email = cleaned[0] ?? "";
|
|
206
212
|
$copiedBooking.emailList = cleaned.slice(1);
|