@movvjs/svelte-schedule-view 0.2.4 → 0.2.6-beta-1

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.
Files changed (46) hide show
  1. package/.svelte-kit/__package__/i18n/locales/en.json +3 -1
  2. package/.svelte-kit/__package__/i18n/locales/ko.json +3 -1
  3. package/.svelte-kit/__package__/i18n/locales/vi.json +3 -1
  4. package/.svelte-kit/__package__/i18n/locales/zh-cn.json +3 -1
  5. package/.svelte-kit/__package__/i18n/locales/zh-tw.json +3 -1
  6. package/.svelte-kit/__package__/schedule-view/BookingInfo.svelte +49 -14
  7. package/.svelte-kit/__package__/schedule-view/PlaceSearch.svelte +21 -2
  8. package/.svelte-kit/__package__/schedule-view/api/common/index.d.ts +5 -1
  9. package/.svelte-kit/__package__/schedule-view/api/common/index.js +17 -3
  10. package/.svelte-kit/__package__/schedule-view/assets/scss/indie_booking.scss +58 -1
  11. package/.svelte-kit/__package__/schedule-view/components/flight-search/FlightSearch.svelte +193 -120
  12. package/.svelte-kit/__package__/schedule-view/components/flight-search/FlightSearch.svelte.d.ts +10 -2
  13. package/.svelte-kit/__package__/schedule-view/stores/booking.d.ts +2 -0
  14. package/.svelte-kit/__package__/schedule-view/stores/booking.js +2 -0
  15. package/.svelte-kit/__package__/schedule-view/types/flight.d.ts +1 -1
  16. package/.svelte-kit/ambient.d.ts +4 -0
  17. package/.svelte-kit/generated/server/internal.js +1 -1
  18. package/dist/i18n/locales/en.json +3 -1
  19. package/dist/i18n/locales/ko.json +3 -1
  20. package/dist/i18n/locales/vi.json +3 -1
  21. package/dist/i18n/locales/zh-cn.json +3 -1
  22. package/dist/i18n/locales/zh-tw.json +3 -1
  23. package/dist/schedule-view/BookingInfo.svelte +49 -14
  24. package/dist/schedule-view/PlaceSearch.svelte +21 -2
  25. package/dist/schedule-view/api/common/index.d.ts +5 -1
  26. package/dist/schedule-view/api/common/index.js +17 -3
  27. package/dist/schedule-view/assets/scss/indie_booking.scss +58 -1
  28. package/dist/schedule-view/components/flight-search/FlightSearch.svelte +193 -120
  29. package/dist/schedule-view/components/flight-search/FlightSearch.svelte.d.ts +10 -2
  30. package/dist/schedule-view/stores/booking.d.ts +2 -0
  31. package/dist/schedule-view/stores/booking.js +2 -0
  32. package/dist/schedule-view/types/flight.d.ts +1 -1
  33. package/package.json +3 -1
  34. package/src/lib/i18n/locales/en.json +3 -1
  35. package/src/lib/i18n/locales/ko.json +3 -1
  36. package/src/lib/i18n/locales/vi.json +3 -1
  37. package/src/lib/i18n/locales/zh-cn.json +3 -1
  38. package/src/lib/i18n/locales/zh-tw.json +3 -1
  39. package/src/lib/schedule-view/BookingInfo.svelte +51 -15
  40. package/src/lib/schedule-view/PlaceSearch.svelte +24 -1
  41. package/src/lib/schedule-view/api/common/index.ts +21 -3
  42. package/src/lib/schedule-view/assets/scss/indie_booking.scss +58 -1
  43. package/src/lib/schedule-view/components/flight-search/FlightSearch.svelte +208 -126
  44. package/src/lib/schedule-view/stores/booking.ts +6 -0
  45. package/src/lib/schedule-view/types/flight.ts +1 -1
  46. package/yarn.lock +334 -6
@@ -7,7 +7,7 @@
7
7
  import { t } from '$lib/i18n'
8
8
  import { env } from '$lib/store/env'
9
9
 
10
- import { BookingServiceType, FileType } from '$scheduleView/types'
10
+ import { BookingServiceType, FileType, type Flight } from '$scheduleView/types'
11
11
  import { isEdit } from '$scheduleView/Schedule.svelte'
12
12
  import { getCarName } from '$scheduleView/utils'
13
13
  import { PhoneNumberBiz } from '$scheduleView/biz'
@@ -21,7 +21,7 @@
21
21
  import FileUploader from '$scheduleView/FileUploader.svelte'
22
22
  import CarSearch from '$scheduleView/CarSearch.svelte'
23
23
 
24
- const { stdt, fullName, pax, extraServices, files, plans } = originalBooking
24
+ const { stdt, fullName, pax, extraServices, files, plans, isFlightService } = originalBooking
25
25
  const {
26
26
  withPreserveAndPreview,
27
27
  hour,
@@ -52,9 +52,11 @@
52
52
  texts.push(`${$t('booking.startTime')} : ${dayjs($stdt).format('HH:mm')}`)
53
53
  texts.push(`${$t('booking.carInfo')} : ${getCarName($originalBooking.carInfo, { seat: true, seatPostfix: $t('booking.seater') })}`)
54
54
  texts.push(`${$t('booking.pax')} : ${$pax}`)
55
- texts.push(
56
- `${$t('booking.flight')} : ${$originalBooking.flight?.name || '- -'} ${$originalBooking.flight?.selectType === 'AUTO' && $originalBooking.flight?.arrivalTerminal ? `/ ${$t('flight.terminal', { values: { number: $originalBooking.flight.arrivalTerminal } })}` : ''}`
57
- )
55
+ if ($isFlightService) {
56
+ texts.push(
57
+ `${$t('booking.flight')} : ${$originalBooking.flight ? [$originalBooking.flight?.name, getTerminalName($originalBooking.flight)].filter(Boolean).join(' / ') || '- -' : '- -'}`
58
+ )
59
+ }
58
60
  texts.push(`${$t('booking.guestName')} : ${$fullName}`)
59
61
  // texts.push(`Email : ${$originalBooking.email || '- -'}`) // 제외
60
62
  texts.push(`${$t('booking.telNo')} : ${PhoneNumberBiz.format($originalBooking.countryCode, $originalBooking.tel) || '- -'}`)
@@ -123,7 +125,22 @@
123
125
  flightSearch$
124
126
  .open({
125
127
  dateTime: $copiedBooking.ymd,
126
- iata: $copiedBooking.origin?.iata
128
+ airport: (() => {
129
+ if ($copiedBooking.serviceType === BookingServiceType.pickup) {
130
+ return {
131
+ iata: $copiedBooking.origin?.iata || null,
132
+ code: $copiedBooking.origin?.code || null
133
+ }
134
+ } else if ($copiedBooking.serviceType === BookingServiceType.sending) {
135
+ return {
136
+ iata: $copiedBooking.dest?.iata || null,
137
+ code: $copiedBooking.dest?.code || null
138
+ }
139
+ } else {
140
+ return null
141
+ }
142
+ })(),
143
+ terminalOnly: $copiedBooking.serviceType === BookingServiceType.sending
127
144
  })
128
145
  .then(flight => {
129
146
  $copiedBooking.flight = flight
@@ -132,6 +149,25 @@
132
149
  alert.open({ title: $t('alert.error'), text: e.message })
133
150
  })
134
151
  }
152
+
153
+ function getTerminalName(flight: Flight) {
154
+ if (!flight?.arrivalTerminal) return null
155
+
156
+ if (flight.selectType === 'AUTO') {
157
+ switch (flight.arrivalTerminal) {
158
+ case 'I':
159
+ return 'International'
160
+ case 'D':
161
+ return 'Domestic'
162
+ default:
163
+ return `Terminal ${flight.arrivalTerminal}`
164
+ }
165
+ } else if (flight.selectType === 'MANUAL') {
166
+ return flight.arrivalTerminal
167
+ } else {
168
+ return null
169
+ }
170
+ }
135
171
  </script>
136
172
 
137
173
  <Translation bind:this={translation$} />
@@ -189,17 +225,17 @@
189
225
  </td>
190
226
  </tr>
191
227
 
192
- {#if $originalBooking.serviceType === BookingServiceType.pickup}
228
+ {#if $isFlightService}
193
229
  <tr>
194
230
  <th>{$t('booking.flight')}</th>
195
231
  <td>
196
232
  {#if !$isEdit}
197
233
  {#if $originalBooking.flight}
198
234
  <p class="indie_value-text flight">
199
- <b>{$originalBooking.flight.name}</b>
200
- {#if $originalBooking.flight.selectType === 'AUTO' && $originalBooking.flight.arrivalTerminal}
201
- / {$t('flight.terminal', { values: { number: $originalBooking.flight.arrivalTerminal } })}
202
- {/if}
235
+ {@html [$originalBooking.flight.name, getTerminalName($originalBooking.flight)]
236
+ .map((value, i) => (value ? (i === 0 ? `<b>${value}</b>` : value) : null))
237
+ .filter(Boolean)
238
+ .join(' / ')}
203
239
  </p>
204
240
  {#if $originalBooking.flight.selectType === 'MANUAL'}
205
241
  <div class="indie_exclamation_mark_box sm black">
@@ -213,10 +249,10 @@
213
249
  <!-- -->
214
250
  {#if $copiedBooking.flight}
215
251
  <p class="indie_value-text flight">
216
- <b>{$copiedBooking.flight.name}</b>
217
- {#if $copiedBooking.flight.selectType === 'AUTO' && $copiedBooking.flight.arrivalTerminal}
218
- / {$t('flight.terminal', { values: { number: $copiedBooking.flight.arrivalTerminal } })}
219
- {/if}
252
+ {@html [$copiedBooking.flight.name, getTerminalName($copiedBooking.flight)]
253
+ .map((value, i) => (value ? (i === 0 ? `<b>${value}</b>` : value) : null))
254
+ .filter(Boolean)
255
+ .join(' / ')}
220
256
  </p>
221
257
  <button type="button" class="indie_btn_squre only refresh_black mgl10" on:click={() => openFlightSearch()}>다시선택</button>
222
258
  {#if $copiedBooking.flight.selectType !== 'AUTO'}
@@ -1,13 +1,36 @@
1
1
  <script lang="ts">
2
+ import center from '@turf/center'
3
+ import { points } from '@turf/helpers'
4
+
2
5
  import { CommonAPI } from '$scheduleView/api'
3
6
  import { loader } from '$scheduleView/components/loader'
4
7
 
5
8
  import BaseSearchInput, { type SearchListItem } from '$scheduleView/BaseSearchInput.svelte'
9
+ import { copiedBooking } from './stores/booking'
6
10
 
7
11
  export let placeholder = 'Title / Detailed address'
8
12
  export let inputId: string
9
13
  export let title: string // 적용된 대상의 제목
10
14
 
15
+ /**
16
+ * 장소 검색시 중심좌표 = 모든 일정의 중심좌표
17
+ */
18
+ const { coordinates } = copiedBooking
19
+ $: centerCoordinate = (() => {
20
+ if ($coordinates.length === 0) {
21
+ return null
22
+ } else {
23
+ try {
24
+ const features = points($coordinates.map(({ lng, lat }) => [lng, lat]))
25
+ const centerFeature = center(features)
26
+ const [lng, lat] = centerFeature?.geometry?.coordinates
27
+ return { lng, lat }
28
+ } catch (e) {
29
+ return null
30
+ }
31
+ }
32
+ })()
33
+
11
34
  let list: SearchListItem[] = []
12
35
 
13
36
  async function search(keyword: string) {
@@ -15,7 +38,7 @@
15
38
 
16
39
  try {
17
40
  loader.show()
18
- const data = await CommonAPI.searchPlace(keyword)
41
+ const data = await CommonAPI.searchPlace(keyword, centerCoordinate)
19
42
  list = data.map(item => ({
20
43
  title: item.title,
21
44
  subTitle: item.address,
@@ -3,6 +3,7 @@ import type { BookingLocation, TranslateLanguage } from '$scheduleView/types'
3
3
  import { get } from 'svelte/store'
4
4
  import type { PickupPointDTO } from './dto'
5
5
  import { env } from '$lib/store/env'
6
+ import QS from 'qs'
6
7
 
7
8
  export class CommonAPI {
8
9
  static async getPickupPoint(ppno: number): Promise<PickupPointDTO> {
@@ -89,17 +90,24 @@ export class CommonAPI {
89
90
  }
90
91
  }
91
92
 
92
- static async searchPlace(keyword: string): Promise<BookingLocation[]> {
93
+ static async searchPlace(keyword: string, center: { lat: number; lng: number }): Promise<BookingLocation[]> {
93
94
  const { target } = get(env)
95
+ const queryString = QS.stringify(
96
+ {
97
+ title: keyword,
98
+ ...(center ? { lat: center.lat, lng: center.lng } : {})
99
+ },
100
+ { skipNulls: true }
101
+ )
94
102
  if (target === 'B2B') {
95
- const { data } = await axios.get(`/booking/scheduleView/place?title=${keyword}`)
103
+ const { data } = await axios.get(`/booking/scheduleView/place?${queryString}`)
96
104
  if (data.mode === false) {
97
105
  throw new Error(data.msg || data.message || JSON.stringify(data))
98
106
  } else {
99
107
  return data.result
100
108
  }
101
109
  } else if (target === 'FMS' || target === 'MOVV') {
102
- const { data } = await axios.get(`/common/v2/place?title=${keyword}`)
110
+ const { data } = await axios.get(`/common/v2/place?${queryString}`)
103
111
  if (data.mode === false) {
104
112
  throw new Error(data.msg || data.message || JSON.stringify(data))
105
113
  } else {
@@ -109,4 +117,14 @@ export class CommonAPI {
109
117
  throw Error('Invalid target')
110
118
  }
111
119
  }
120
+
121
+ static async getPoiTerminals(code: string): Promise<string[]> {
122
+ const { data } = await axios.get(`/common/poiTerminal/list/${code}`)
123
+
124
+ if (data.mode === false) {
125
+ throw new Error(data.msg)
126
+ } else {
127
+ return data.list
128
+ }
129
+ }
112
130
  }
@@ -3038,8 +3038,9 @@
3038
3038
 
3039
3039
  .map_box{
3040
3040
  flex-grow: 1;
3041
- background-color: Azure;
3041
+ background-color: royalblue;
3042
3042
  position: relative;
3043
+ overflow: hidden;
3043
3044
 
3044
3045
  .indie_ic_map_loca{
3045
3046
  position: relative;
@@ -4611,5 +4612,61 @@
4611
4612
  }
4612
4613
  }
4613
4614
 
4615
+
4616
+
4617
+
4618
+ //마진 값
4619
+ .mg{
4620
+ @for $i from 0 through 40{
4621
+ @if(($i % 5) == 0){
4622
+ &t#{$i}{margin-top: #{$i}px;}
4623
+ &l#{$i}{margin-left: #{$i}px;}
4624
+ &r#{$i}{margin-right: #{$i}px;}
4625
+ &b#{$i}{margin-bottom: #{$i}px;}
4626
+ }
4627
+ }
4628
+
4629
+ &TMinus{
4630
+ margin-top: -1px;
4631
+ }
4632
+
4633
+ &-l-auto{
4634
+ margin-left: auto;
4635
+ }
4636
+ &-r-auto{
4637
+ margin-right: auto;
4638
+ }
4639
+ }
4640
+
4641
+ //패딩 값
4642
+ .pd{
4643
+ @for $i from 0 through 40{
4644
+ @if(($i % 5) == 0){
4645
+ &t#{$i}{padding-top: #{$i}px;}
4646
+ &l#{$i}{padding-left: #{$i}px;}
4647
+ &r#{$i}{padding-right: #{$i}px;}
4648
+ &b#{$i}{padding-bottom: #{$i}px;}
4649
+ }
4650
+ }
4651
+ }
4652
+
4653
+ // 넓이 값 - 퍼센트
4654
+ .w{
4655
+ @for $i from 0 through 100{
4656
+ @if(($i % 5) == 0){
4657
+ &#{$i}{width: #{$i + '%'};}
4658
+ }
4659
+ }
4660
+ }
4661
+
4662
+ // 넓이 값 - 픽셀
4663
+ .w{
4664
+ @for $i from 0 through 500{
4665
+ @if(($i % 10) == 0){
4666
+ &#{$i}px{width: #{$i + 'px'};}
4667
+ }
4668
+ }
4669
+ }
4670
+
4614
4671
  }
4615
4672