@movvjs/svelte-schedule-view 0.4.17-beta-4 → 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 +8 -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";
|
|
@@ -178,6 +179,7 @@ async function edit() {
|
|
|
178
179
|
...preview,
|
|
179
180
|
emailList: mergedEmailList
|
|
180
181
|
};
|
|
182
|
+
console.log(">>>>>>>>>>>>", $copiedBooking.emailList);
|
|
181
183
|
$originalBooking = cloneDeep($copiedBooking);
|
|
182
184
|
$isEdit = true;
|
|
183
185
|
} catch (e) {
|
|
@@ -192,6 +194,10 @@ async function edit() {
|
|
|
192
194
|
function reset() {
|
|
193
195
|
$copiedBooking = cloneDeep($originalBooking);
|
|
194
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
|
+
}
|
|
195
201
|
async function save() {
|
|
196
202
|
try {
|
|
197
203
|
if (!$fullName) {
|
|
@@ -200,6 +206,8 @@ async function save() {
|
|
|
200
206
|
if (!$copiedBooking.tel) {
|
|
201
207
|
throw new Error($t("error.pleaseEnterTelNumber"));
|
|
202
208
|
}
|
|
209
|
+
if (hasDuplicateEmail($copiedBooking.emailList))
|
|
210
|
+
throw new Error("\uC911\uBCF5\uB41C \uC774\uBA54\uC77C\uC774 \uC788\uC2B5\uB2C8\uB2E4.");
|
|
203
211
|
const cleaned = $copiedBooking.emailList.map((e) => e?.trim()).filter(Boolean);
|
|
204
212
|
$copiedBooking.email = cleaned[0] ?? "";
|
|
205
213
|
$copiedBooking.emailList = cleaned.slice(1);
|