@movvjs/svelte-schedule-view 0.4.18 → 0.4.19
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 -0
- 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";
|
|
@@ -193,6 +194,10 @@ async function edit() {
|
|
|
193
194
|
function reset() {
|
|
194
195
|
$copiedBooking = cloneDeep($originalBooking);
|
|
195
196
|
}
|
|
197
|
+
function hasDuplicateEmail(emailList) {
|
|
198
|
+
const filtered = emailList.map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
199
|
+
return new Set(filtered).size !== filtered.length;
|
|
200
|
+
}
|
|
196
201
|
async function save() {
|
|
197
202
|
try {
|
|
198
203
|
if (!$fullName) {
|
|
@@ -201,6 +206,8 @@ async function save() {
|
|
|
201
206
|
if (!$copiedBooking.tel) {
|
|
202
207
|
throw new Error($t("error.pleaseEnterTelNumber"));
|
|
203
208
|
}
|
|
209
|
+
if (hasDuplicateEmail($copiedBooking.emailList))
|
|
210
|
+
throw new Error("\uC911\uBCF5\uB41C \uC774\uBA54\uC77C\uC774 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
204
211
|
const cleaned = $copiedBooking.emailList.map((e) => e?.trim()).filter(Boolean);
|
|
205
212
|
$copiedBooking.email = cleaned[0] ?? "";
|
|
206
213
|
$copiedBooking.emailList = cleaned.slice(1);
|