@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.
@@ -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": "이름을 입력하세요.",
60
- "pleaseEnterTelNumber": "전화번호를 입력해주세요."
60
+ "pleaseEnterTelNumber": "전화번호를 입력해주세요.",
61
+ "dupliEmail": "중복된 이메일이 있습니다."
61
62
  },
62
63
  "extraServiceType": {
63
64
  "BABY": "베이비 시트",
@@ -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é",
@@ -57,7 +57,8 @@
57
57
  },
58
58
  "error": {
59
59
  "pleaseEnterGuestName": "请输入客人姓名",
60
- "pleaseEnterTelNumber": "请输入电话号码。"
60
+ "pleaseEnterTelNumber": "请输入电话号码。",
61
+ "dupliEmail": "存在重复的电子邮件。"
61
62
  },
62
63
  "extraServiceType": {
63
64
  "BABY": "儿童安全座椅",
@@ -57,7 +57,8 @@
57
57
  },
58
58
  "error": {
59
59
  "pleaseEnterGuestName": "請輸入客人姓名",
60
- "pleaseEnterTelNumber": "請輸入電話號碼。"
60
+ "pleaseEnterTelNumber": "請輸入電話號碼。",
61
+ "dupliEmail": "存在重複的電子郵件。"
61
62
  },
62
63
  "extraServiceType": {
63
64
  "BABY": "兒童安全座椅",
@@ -285,13 +285,15 @@ function openCalender() {
285
285
  <th>E-mail</th>
286
286
  <td>
287
287
  {#if !$isEdit}
288
- <p class="value-txt">{$originalBooking.email}</p>
288
+ <div class="scroll_box">
289
+ <p>{$originalBooking.email}</p>
289
290
 
290
- {#each $originalBooking.emailList || [] as email}
291
- {#if email?.trim()}
292
- <p class="value-txt">{email}</p>
293
- {/if}
294
- {/each}
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="add_email_list">
22
- {#each emailList as email, index}
23
- <div class="item">
24
- <input type="text" class="text_nor w100" placeholder="email" value={email} on:input={e => updateEmail(index, e.currentTarget.value)} />
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
- {#if index === 0}
27
- <button type="button" class="button_add" on:click={addEmail}> 추가 </button>
28
- {:else}
29
- <button type="button" class="button_minus" on:click={() => removeEmail(index)}> 삭제 </button>
30
- {/if}
31
- </div>
32
- {/each}
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);
@@ -11,6 +11,7 @@ export interface InitOption {
11
11
  viewOnly?: boolean;
12
12
  }
13
13
  import './assets/scss/indie_booking.scss';
14
+ import './assets/css/indie_booking.css';
14
15
  import type { Locale, Target } from './types';
15
16
  declare const __propDef: {
16
17
  props: {