@movvjs/svelte-schedule-view 0.0.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 (98) hide show
  1. package/README.md +26 -0
  2. package/dist/alert/component.svelte +23 -0
  3. package/dist/alert/component.svelte.d.ts +14 -0
  4. package/dist/alert/index.d.ts +7 -0
  5. package/dist/alert/index.js +20 -0
  6. package/dist/alert/types.d.ts +9 -0
  7. package/dist/alert/types.js +1 -0
  8. package/dist/api/booking/dto.d.ts +60 -0
  9. package/dist/api/booking/dto.js +1 -0
  10. package/dist/api/booking/index.d.ts +28 -0
  11. package/dist/api/booking/index.js +159 -0
  12. package/dist/api/common/dto.d.ts +11 -0
  13. package/dist/api/common/dto.js +1 -0
  14. package/dist/api/common/index.d.ts +18 -0
  15. package/dist/api/common/index.js +117 -0
  16. package/dist/assets/icon/dest.png +0 -0
  17. package/dist/assets/icon/place.png +0 -0
  18. package/dist/assets/icon/start.png +0 -0
  19. package/dist/assets/icon/transparent.png +0 -0
  20. package/dist/assets/scss/indie_booking.scss +4464 -0
  21. package/dist/axios/index.d.ts +1 -0
  22. package/dist/axios/index.js +71 -0
  23. package/dist/components/BaseSearchInput.svelte +115 -0
  24. package/dist/components/BaseSearchInput.svelte.d.ts +31 -0
  25. package/dist/components/Layout.svelte +33 -0
  26. package/dist/components/Layout.svelte.d.ts +17 -0
  27. package/dist/confirm/component.svelte +35 -0
  28. package/dist/confirm/component.svelte.d.ts +14 -0
  29. package/dist/confirm/index.d.ts +8 -0
  30. package/dist/confirm/index.js +32 -0
  31. package/dist/confirm/types.d.ts +14 -0
  32. package/dist/confirm/types.js +1 -0
  33. package/dist/constant/index.d.ts +58 -0
  34. package/dist/constant/index.js +58 -0
  35. package/dist/contents/telCodes.json +235 -0
  36. package/dist/dayjs/index.d.ts +11 -0
  37. package/dist/dayjs/index.js +30 -0
  38. package/dist/i18n/index.js +8 -0
  39. package/dist/i18n/locales/en.json +116 -0
  40. package/dist/i18n/locales/ko.json +92 -0
  41. package/dist/i18n/locales/vi.json +92 -0
  42. package/dist/i18n/locales/zh-cn.json +92 -0
  43. package/dist/i18n/locales/zh-tw.json +92 -0
  44. package/dist/index.d.ts +3 -0
  45. package/dist/index.js +3 -0
  46. package/dist/init.d.ts +11 -0
  47. package/dist/init.js +14 -0
  48. package/dist/loaders/component.svelte +7 -0
  49. package/dist/loaders/component.svelte.d.ts +16 -0
  50. package/dist/loaders/index.d.ts +6 -0
  51. package/dist/loaders/index.js +16 -0
  52. package/dist/schedule/BookingInfo.svelte +547 -0
  53. package/dist/schedule/BookingInfo.svelte.d.ts +14 -0
  54. package/dist/schedule/CarSearch.svelte +22 -0
  55. package/dist/schedule/CarSearch.svelte.d.ts +23 -0
  56. package/dist/schedule/FileUploader.svelte +76 -0
  57. package/dist/schedule/FileUploader.svelte.d.ts +23 -0
  58. package/dist/schedule/FlightSearch.svelte +261 -0
  59. package/dist/schedule/FlightSearch.svelte.d.ts +24 -0
  60. package/dist/schedule/Map.svelte +132 -0
  61. package/dist/schedule/Map.svelte.d.ts +14 -0
  62. package/dist/schedule/PhoneNumberInput.svelte +82 -0
  63. package/dist/schedule/PhoneNumberInput.svelte.d.ts +19 -0
  64. package/dist/schedule/PickupPointView.svelte +88 -0
  65. package/dist/schedule/PickupPointView.svelte.d.ts +17 -0
  66. package/dist/schedule/PlaceSearch.svelte +27 -0
  67. package/dist/schedule/PlaceSearch.svelte.d.ts +21 -0
  68. package/dist/schedule/Plan.svelte +175 -0
  69. package/dist/schedule/Plan.svelte.d.ts +14 -0
  70. package/dist/schedule/PlanItem.svelte +174 -0
  71. package/dist/schedule/PlanItem.svelte.d.ts +34 -0
  72. package/dist/schedule/Schedule.svelte +183 -0
  73. package/dist/schedule/Schedule.svelte.d.ts +45 -0
  74. package/dist/schedule/ServiceZone.svelte +76 -0
  75. package/dist/schedule/ServiceZone.svelte.d.ts +14 -0
  76. package/dist/schedule/ServiceZoneItem.svelte +73 -0
  77. package/dist/schedule/ServiceZoneItem.svelte.d.ts +33 -0
  78. package/dist/schedule/Translation.svelte +136 -0
  79. package/dist/schedule/Translation.svelte.d.ts +17 -0
  80. package/dist/schedule/booking.d.ts +114 -0
  81. package/dist/schedule/booking.js +150 -0
  82. package/dist/store/env.d.ts +16 -0
  83. package/dist/store/env.js +33 -0
  84. package/dist/types/booking.d.ts +88 -0
  85. package/dist/types/booking.js +40 -0
  86. package/dist/types/common.d.ts +28 -0
  87. package/dist/types/common.js +14 -0
  88. package/dist/types/file.d.ts +13 -0
  89. package/dist/types/file.js +5 -0
  90. package/dist/types/flight.d.ts +25 -0
  91. package/dist/types/flight.js +1 -0
  92. package/dist/types/index.d.ts +5 -0
  93. package/dist/types/index.js +5 -0
  94. package/dist/types/price.d.ts +18 -0
  95. package/dist/types/price.js +1 -0
  96. package/dist/utils/index.d.ts +14 -0
  97. package/dist/utils/index.js +48 -0
  98. package/package.json +62 -0
package/README.md ADDED
@@ -0,0 +1,26 @@
1
+ # Schedule View
2
+
3
+ ```bash
4
+ yarn add @movvjs/schedule-view
5
+ ```
6
+
7
+ ```svelte
8
+
9
+ <script lang='ts'>
10
+ import { Schedule } from 'schedule-view'
11
+
12
+ let schedule$: Schedule
13
+
14
+ function open(){
15
+ schedule$.init({
16
+ isDev: true, // 개발서버 여부
17
+
18
+ }).open({
19
+ code: "Booking Code"
20
+ })
21
+ }
22
+ </script>
23
+
24
+ <button on:click={() => open()}>스케쥴 열기</button>
25
+ <Schedule bind:this={schedule$} />
26
+ ```
@@ -0,0 +1,23 @@
1
+ <script>import { alert } from "./index";
2
+ import { t } from "../i18n";
3
+ const success = () => {
4
+ $alert?.success();
5
+ close();
6
+ };
7
+ const close = () => {
8
+ alert.close();
9
+ };
10
+ </script>
11
+
12
+ <!-- alert 창 - 클래스 on 추가시 나타남 -->
13
+ <section class="indie_pop_alert" class:on={$alert?.isShow}>
14
+ <div class="pop_base">
15
+ <div class="contents">
16
+ <p class="sbj">{$alert?.title || $t('alert.defaultTitle')}</p>
17
+ <p class="txt">{@html $alert?.text}</p>
18
+ </div>
19
+ <div class="btns">
20
+ <button type="button" class="btn_alert primary" on:click={success}>{$alert?.successButtonLabel || $t('alert.defaultButtonLabel')}</button>
21
+ </div>
22
+ </div>
23
+ </section>
@@ -0,0 +1,14 @@
1
+ import { SvelteComponent } from "svelte";
2
+ declare const __propDef: {
3
+ props: Record<string, never>;
4
+ events: {
5
+ [evt: string]: CustomEvent<any>;
6
+ };
7
+ slots: {};
8
+ };
9
+ export type ComponentProps = typeof __propDef.props;
10
+ export type ComponentEvents = typeof __propDef.events;
11
+ export type ComponentSlots = typeof __propDef.slots;
12
+ export default class Component extends SvelteComponent<ComponentProps, ComponentEvents, ComponentSlots> {
13
+ }
14
+ export {};
@@ -0,0 +1,7 @@
1
+ /// <reference types="svelte" />
2
+ import type { Message } from './types';
3
+ export declare const alert: {
4
+ subscribe: (this: void, run: import("svelte/store").Subscriber<any>, invalidate?: import("svelte/store").Invalidator<any>) => import("svelte/store").Unsubscriber;
5
+ open: (item: Message) => Promise<void>;
6
+ close: () => void;
7
+ };
@@ -0,0 +1,20 @@
1
+ import { writable } from 'svelte/store';
2
+ function createAlertStore() {
3
+ const _alert = writable(undefined);
4
+ function open(msg) {
5
+ return new Promise(resolve => {
6
+ const item = {
7
+ ...msg,
8
+ success: resolve,
9
+ isShow: true
10
+ };
11
+ _alert.set(item);
12
+ });
13
+ }
14
+ return {
15
+ subscribe: _alert.subscribe,
16
+ open: (item) => open(item),
17
+ close: () => _alert.set(undefined)
18
+ };
19
+ }
20
+ export const alert = createAlertStore();
@@ -0,0 +1,9 @@
1
+ export interface Alert extends Message {
2
+ isShow: boolean;
3
+ success?: () => void;
4
+ }
5
+ export interface Message {
6
+ title?: string;
7
+ text: string;
8
+ successButtonLabel?: string;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,60 @@
1
+ import type { BookingExtraService, BookingLocation, BookingManualType, BookingPlanItem, BookingRentalType, BookingServiceType, BookingServiceZone, BookingStatus, CarInfo, Currency, ExtraPoi, ExtraServiceType, Person, UploadFile, Flight, SearchPriceV2 } from '../../types';
2
+ export type BookingViewDTO = {
3
+ code: string;
4
+ bookingCode: string;
5
+ itemCode: string;
6
+ ymd: string;
7
+ useTime: number;
8
+ origin: BookingLocation;
9
+ dest: BookingLocation;
10
+ wayPoints: BookingLocation[];
11
+ person: Person;
12
+ price: number;
13
+ forex: Currency;
14
+ extra: BookingExtraService[];
15
+ plan: BookingPlanItem[];
16
+ name: string;
17
+ tel: string;
18
+ email: string;
19
+ serviceType: BookingServiceType;
20
+ carInfo: CarInfo;
21
+ status: BookingStatus;
22
+ addInfo: {
23
+ korName: string;
24
+ engName: string;
25
+ birth: string;
26
+ gender: 'M' | 'F';
27
+ }[];
28
+ ptno: number;
29
+ serviceZone: BookingServiceZone[];
30
+ partnerName: string;
31
+ supplierName: string;
32
+ manual: BookingManualType;
33
+ authCode: string;
34
+ rentalType: BookingRentalType;
35
+ reason: object;
36
+ newPrice: number;
37
+ addPrice: number;
38
+ addNewPrice: number;
39
+ hstyYn: boolean;
40
+ files: UploadFile[];
41
+ extraPoi: ExtraPoi[];
42
+ firstName: string;
43
+ lastName: string;
44
+ addTime: number;
45
+ addInfoType: 'NONE';
46
+ ppno?: number;
47
+ memo: string;
48
+ flight: Flight;
49
+ defaultExtra: {
50
+ type: ExtraServiceType;
51
+ price: number;
52
+ file: UploadFile[];
53
+ }[];
54
+ defaultExtraPoi: {
55
+ pickup: ExtraPoi[];
56
+ sending: ExtraPoi[];
57
+ };
58
+ carList: SearchPriceV2[];
59
+ psno?: string;
60
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,28 @@
1
+ import type { BookingViewDTO } from './dto';
2
+ import type { BookingLocation, BookingServiceType, Coordinate } from '../../types';
3
+ export declare class BookingAPI {
4
+ static getBooking(code: string): Promise<BookingViewDTO>;
5
+ static modifyPreview(payload: BookingViewDTO): Promise<BookingViewDTO>;
6
+ static modify(payload: BookingViewDTO): Promise<BookingViewDTO>;
7
+ static searchWaypoints({ type, coordinate, keyword }: {
8
+ type: BookingServiceType;
9
+ coordinate: Coordinate;
10
+ keyword: string;
11
+ }): Promise<BookingLocation[]>;
12
+ static searchDestinations({ type, coordinate, keyword }: {
13
+ type: BookingServiceType;
14
+ coordinate: Coordinate;
15
+ keyword: string;
16
+ }): Promise<BookingLocation[]>;
17
+ /**
18
+ *
19
+ * @param payload.iata IATA code
20
+ * @param payload.ymd YYYY-MM-DD
21
+ * @param payload.time number
22
+ */
23
+ static searchFlights(payload: {
24
+ iata: string;
25
+ ymd: string;
26
+ time: number;
27
+ }): Promise<any>;
28
+ }
@@ -0,0 +1,159 @@
1
+ import { axios } from '../../axios';
2
+ import QS from 'qs';
3
+ import { get } from 'svelte/store';
4
+ import { env } from '../../store/env';
5
+ export class BookingAPI {
6
+ static async getBooking(code) {
7
+ const { target } = get(env);
8
+ const payload = { code };
9
+ if (target === 'B2B') {
10
+ const { data } = await axios.post('/booking/scheduleView/view', payload);
11
+ if (data.mode === false) {
12
+ throw Error(data.message);
13
+ }
14
+ else {
15
+ return data.data;
16
+ }
17
+ }
18
+ else if (target === 'FMS') {
19
+ const { data } = await axios.post('/partner/booking/view', payload);
20
+ if (data.mode === false) {
21
+ throw Error(data.msg);
22
+ }
23
+ else {
24
+ return data.data;
25
+ }
26
+ }
27
+ else {
28
+ throw Error('Invalid target');
29
+ }
30
+ }
31
+ static async modifyPreview(payload) {
32
+ const { target } = get(env);
33
+ if (target === 'B2B') {
34
+ const { data } = await axios.post('/booking/scheduleView/modifyPreview', payload);
35
+ if (data.mode === false) {
36
+ throw Error(data.message);
37
+ }
38
+ else {
39
+ return data.data;
40
+ }
41
+ }
42
+ else if (target === 'FMS') {
43
+ const { data } = await axios.post('/partner/booking/modifyPreview', payload);
44
+ if (data.mode === false) {
45
+ throw Error(data.message);
46
+ }
47
+ else {
48
+ return data.data;
49
+ }
50
+ }
51
+ else {
52
+ throw Error('Invalid target');
53
+ }
54
+ }
55
+ static async modify(payload) {
56
+ const { target } = get(env);
57
+ if (target === 'B2B') {
58
+ const { data } = await axios.post('/booking/scheduleView/modify', payload);
59
+ if (data.mode === false) {
60
+ throw Error(data.message);
61
+ }
62
+ else {
63
+ return data.data;
64
+ }
65
+ }
66
+ else if (target === 'FMS') {
67
+ const { data } = await axios.post('/partner/booking/modify', payload);
68
+ if (data.mode === false) {
69
+ throw Error(data.message);
70
+ }
71
+ else {
72
+ return data.data;
73
+ }
74
+ }
75
+ else {
76
+ throw Error('Invalid target');
77
+ }
78
+ }
79
+ static async searchWaypoints({ type, coordinate, keyword }) {
80
+ const { target } = get(env);
81
+ const query = QS.stringify({ serviceType: type, 'loc.lat': coordinate.lat, 'loc.lng': coordinate.lng, title: keyword });
82
+ if (target === 'B2B') {
83
+ const { data } = await axios.get(`/booking/scheduleView/waypoint?${query}`);
84
+ if (data.mode === false) {
85
+ throw Error(data.message);
86
+ }
87
+ else {
88
+ return data;
89
+ }
90
+ }
91
+ else if (target === 'FMS') {
92
+ const { data } = await axios.get(`/common/waypoint?${query}`);
93
+ if (data.mode === false) {
94
+ throw Error(data.message);
95
+ }
96
+ else {
97
+ return data;
98
+ }
99
+ }
100
+ else {
101
+ throw Error('Invalid target');
102
+ }
103
+ }
104
+ static async searchDestinations({ type, coordinate, keyword }) {
105
+ const { target } = get(env);
106
+ const query = QS.stringify({ serviceType: type, 'loc.lat': coordinate.lat, 'loc.lng': coordinate.lng, title: keyword });
107
+ if (target === 'B2B') {
108
+ const { data } = await axios.get(`/booking/scheduleView/dest?${query}`);
109
+ if (data.mode === false) {
110
+ throw Error(data.message);
111
+ }
112
+ else {
113
+ return data;
114
+ }
115
+ }
116
+ else if (target === 'FMS') {
117
+ const { data } = await axios.get(`/common/dest?${query}`);
118
+ if (data.mode === false) {
119
+ throw Error(data.message);
120
+ }
121
+ else {
122
+ return data;
123
+ }
124
+ }
125
+ else {
126
+ throw Error('Invalid target');
127
+ }
128
+ }
129
+ /**
130
+ *
131
+ * @param payload.iata IATA code
132
+ * @param payload.ymd YYYY-MM-DD
133
+ * @param payload.time number
134
+ */
135
+ static async searchFlights(payload) {
136
+ const { target } = get(env);
137
+ if (target === 'B2B') {
138
+ const { data } = await axios.get(`/booking/scheduleView/flightInfo?${QS.stringify(payload)}`);
139
+ if (data.mode === false) {
140
+ throw new Error(data.message);
141
+ }
142
+ else {
143
+ return data.flightList;
144
+ }
145
+ }
146
+ else if (target === 'FMS') {
147
+ const { data } = await axios.get(`/common/v2/flightInfo?${QS.stringify(payload)}`);
148
+ if (data.mode === false) {
149
+ throw new Error(data.message);
150
+ }
151
+ else {
152
+ return data.flightList;
153
+ }
154
+ }
155
+ else {
156
+ throw Error('Invalid target');
157
+ }
158
+ }
159
+ }
@@ -0,0 +1,11 @@
1
+ import type { Coordinate } from '../../types';
2
+ export type PickupPointDTO = {
3
+ code: string;
4
+ address: string;
5
+ content: string;
6
+ loc: Coordinate;
7
+ img: {
8
+ src: string;
9
+ }[];
10
+ title: string;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { BookingLocation, TranslateLanguage } from '../../types';
2
+ import type { PickupPointDTO } from './dto';
3
+ export declare class CommonAPI {
4
+ static getPickupPoint(ppno: number): Promise<PickupPointDTO>;
5
+ /**
6
+ * 문장을 번역한 결과를 얻습니다.
7
+ * @param sourceLanguage 원본 언어셋
8
+ * @param targetLanguage 번역할 언어셋
9
+ * @param text 번역할 문장
10
+ * @returns
11
+ */
12
+ static translate(sourceLanguage: TranslateLanguage, targetLanguage: TranslateLanguage, text: string): Promise<string>;
13
+ static upload(formData: FormData): Promise<{
14
+ name: string;
15
+ url: string;
16
+ }>;
17
+ static searchPlace(keyword: string): Promise<BookingLocation[]>;
18
+ }
@@ -0,0 +1,117 @@
1
+ import { axios } from '../../axios';
2
+ import { get } from 'svelte/store';
3
+ import { env } from '../../store/env';
4
+ export class CommonAPI {
5
+ static async getPickupPoint(ppno) {
6
+ const { target } = get(env);
7
+ if (target === 'B2B') {
8
+ const { data } = await axios.get(`/booking/scheduleView/poiPoint/${ppno}`);
9
+ if (data.mode === false) {
10
+ throw new Error(data.msg);
11
+ }
12
+ else {
13
+ return data.data;
14
+ }
15
+ }
16
+ else if (target === 'FMS') {
17
+ const { data } = await axios.get(`/common/poiPoint/data/${ppno}`);
18
+ if (data.mode === false) {
19
+ throw new Error(data.msg);
20
+ }
21
+ else {
22
+ return data.data;
23
+ }
24
+ }
25
+ else {
26
+ throw Error('Invalid target');
27
+ }
28
+ }
29
+ /**
30
+ * 문장을 번역한 결과를 얻습니다.
31
+ * @param sourceLanguage 원본 언어셋
32
+ * @param targetLanguage 번역할 언어셋
33
+ * @param text 번역할 문장
34
+ * @returns
35
+ */
36
+ static async translate(sourceLanguage, targetLanguage, text) {
37
+ const { target } = get(env);
38
+ const payload = {
39
+ srcLang: sourceLanguage,
40
+ tarLang: targetLanguage,
41
+ orgTxt: text
42
+ };
43
+ if (target === 'B2B') {
44
+ const { data } = await axios.post('/booking/scheduleView/translate', payload);
45
+ if (data.mode === false) {
46
+ throw new Error(data.msg);
47
+ }
48
+ else {
49
+ return data.result;
50
+ }
51
+ }
52
+ else if (target === 'FMS') {
53
+ const { data } = await axios.post('/common/v2/translate', payload);
54
+ if (data.mode === false) {
55
+ throw new Error(data.msg);
56
+ }
57
+ else {
58
+ return data.result;
59
+ }
60
+ }
61
+ else {
62
+ throw Error('Invalid target');
63
+ }
64
+ }
65
+ static async upload(formData) {
66
+ const { target } = get(env);
67
+ if (target === 'B2B') {
68
+ const { data } = await axios.post('/common/upload', formData, {
69
+ headers: { 'Content-Type': 'multipart/form-data' }
70
+ });
71
+ if (data.mode === false) {
72
+ throw Error(data.msg);
73
+ }
74
+ else {
75
+ return data;
76
+ }
77
+ }
78
+ else if (target === 'FMS') {
79
+ const { data } = await axios.post('/upload', formData, {
80
+ headers: { 'Content-Type': 'multipart/form-data' }
81
+ });
82
+ if (data.mode === false) {
83
+ throw Error(data.msg);
84
+ }
85
+ else {
86
+ return data;
87
+ }
88
+ }
89
+ else {
90
+ throw Error('Invalid target');
91
+ }
92
+ }
93
+ static async searchPlace(keyword) {
94
+ const { target } = get(env);
95
+ if (target === 'B2B') {
96
+ const { data } = await axios.get(`/booking/scheduleView/place?title=${keyword}`);
97
+ if (data.mode === false) {
98
+ throw new Error(data.message);
99
+ }
100
+ else {
101
+ return data.result;
102
+ }
103
+ }
104
+ else if (target === 'FMS') {
105
+ const { data } = await axios.get(`/common/v2/place?title=${keyword}`);
106
+ if (data.mode === false) {
107
+ throw new Error(data.message);
108
+ }
109
+ else {
110
+ return data;
111
+ }
112
+ }
113
+ else {
114
+ throw Error('Invalid target');
115
+ }
116
+ }
117
+ }
Binary file
Binary file
Binary file
Binary file