@operato/gantt 2.0.0-beta.13 → 2.0.0-beta.15

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 (43) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/dist/src/gantt-chart-controller.d.ts +32 -0
  3. package/dist/src/gantt-chart-controller.js +393 -0
  4. package/dist/src/gantt-chart-controller.js.map +1 -0
  5. package/dist/src/locales.d.ts +52 -0
  6. package/dist/src/locales.js +79 -0
  7. package/dist/src/locales.js.map +1 -0
  8. package/dist/src/ox-gantt-chart.d.ts +10 -17
  9. package/dist/src/ox-gantt-chart.js +135 -435
  10. package/dist/src/ox-gantt-chart.js.map +1 -1
  11. package/dist/src/ox-gantt-resize-splitter.d.ts +2 -3
  12. package/dist/src/ox-gantt-resize-splitter.js +15 -22
  13. package/dist/src/ox-gantt-resize-splitter.js.map +1 -1
  14. package/dist/src/ox-gantt.d.ts +14 -1
  15. package/dist/src/ox-gantt.js +149 -28
  16. package/dist/src/ox-gantt.js.map +1 -1
  17. package/dist/src/ox-task-tooltip.d.ts +12 -0
  18. package/dist/src/ox-task-tooltip.js +132 -0
  19. package/dist/src/ox-task-tooltip.js.map +1 -0
  20. package/dist/src/types.d.ts +10 -3
  21. package/dist/src/types.js.map +1 -1
  22. package/dist/stories/ox-gantt.stories.d.ts +12 -0
  23. package/dist/stories/ox-gantt.stories.js +100 -88
  24. package/dist/stories/ox-gantt.stories.js.map +1 -1
  25. package/dist/tsconfig.tsbuildinfo +1 -1
  26. package/package.json +3 -2
  27. package/src/gantt-chart-controller.ts +470 -0
  28. package/src/locales.ts +78 -0
  29. package/src/ox-gantt-chart.ts +143 -481
  30. package/src/ox-gantt-resize-splitter.ts +18 -25
  31. package/src/ox-gantt.ts +153 -30
  32. package/src/ox-task-tooltip.ts +120 -0
  33. package/src/types.ts +11 -3
  34. package/stories/ox-gantt.stories.ts +105 -88
  35. package/translations/en.json +11 -1
  36. package/translations/ja.json +11 -1
  37. package/translations/ko.json +11 -1
  38. package/translations/ms.json +11 -1
  39. package/translations/zh.json +11 -1
  40. package/dist/src/locale.d.ts +0 -1
  41. package/dist/src/locale.js +0 -49
  42. package/dist/src/locale.js.map +0 -1
  43. package/src/locale.ts +0 -51
@@ -11,6 +11,9 @@ export default {
11
11
  component: 'ox-gantt',
12
12
  argTypes: {
13
13
  tasks: { control: 'object' },
14
+ fromDate: { control: 'date' },
15
+ toDate: { control: 'date' },
16
+ extendGridLines: { control: 'boolean' },
14
17
  theme: { control: 'select', options: ['light', 'dark'] }
15
18
  }
16
19
  }
@@ -23,10 +26,13 @@ interface Story<T> {
23
26
 
24
27
  interface ArgTypes {
25
28
  tasks: Task[]
29
+ fromDate: number | string
30
+ toDate: number | string
31
+ extendGridLines: boolean
26
32
  theme: 'light' | 'dark'
27
33
  }
28
34
 
29
- const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html`
35
+ const Template: Story<ArgTypes> = ({ theme = 'light', tasks, fromDate, toDate, extendGridLines }: ArgTypes) => html`
30
36
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
31
37
 
32
38
  <link href="/themes/light.css" rel="stylesheet" />
@@ -80,8 +86,8 @@ const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html
80
86
  </script>
81
87
 
82
88
  <ox-gantt
83
- from-date="2022-12-27"
84
- to-date="2024-12-31"
89
+ from-date=${new Date(fromDate).toISOString().split('T')[0]}
90
+ to-date=${new Date(toDate).toISOString().split('T')[0]}
85
91
  .tasks=${tasks}
86
92
  @date-range-selected=${(e: CustomEvent) => {
87
93
  console.log('date-range-selected', e.detail)
@@ -89,26 +95,37 @@ const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html
89
95
  @task-clicked=${(e: CustomEvent) => {
90
96
  console.log('task-clicked', e.detail)
91
97
  }}
98
+ ?extend-grid-lines=${extendGridLines}
92
99
  >
93
100
  </ox-gantt>
94
101
  `
95
102
 
96
- const exampleSection: Section = {
103
+ const developmentSection: Section = {
97
104
  name: 'Development'
98
105
  }
99
106
 
107
+ const testSection: Section = {
108
+ name: 'Test'
109
+ }
110
+
111
+ const releaseSection: Section = {
112
+ name: 'Release'
113
+ }
114
+
100
115
  export const Regular = Template.bind({})
101
116
  Regular.args = {
117
+ fromDate: '2022-12-27',
118
+ toDate: '2024-12-31',
102
119
  tasks: [
103
120
  {
104
121
  id: '1',
105
122
  title: 'Design',
106
123
  type: 'task',
107
- section: exampleSection,
108
- startTime: new Date('2023-01-01'),
109
- endTime: new Date('2023-01-05'),
124
+ section: developmentSection,
125
+ startDate: new Date('2023-01-01'),
126
+ endDate: new Date('2023-01-05'),
110
127
  progress: 60,
111
- after: '',
128
+ dependsOn: '',
112
129
  length: '5d',
113
130
  tags: ['active'],
114
131
  children: []
@@ -117,11 +134,11 @@ Regular.args = {
117
134
  id: '2',
118
135
  title: 'Development',
119
136
  type: 'milestone',
120
- section: exampleSection,
121
- startTime: new Date('2023-01-06'),
122
- endTime: new Date('2023-01-06'),
137
+ section: developmentSection,
138
+ startDate: new Date('2023-01-06'),
139
+ endDate: new Date('2023-01-06'),
123
140
  progress: 30,
124
- after: '1',
141
+ dependsOn: '1',
125
142
  length: '1d',
126
143
  tags: ['milestone'],
127
144
  children: []
@@ -130,11 +147,11 @@ Regular.args = {
130
147
  id: '3',
131
148
  title: 'Coding',
132
149
  type: 'phase',
133
- section: exampleSection,
134
- startTime: new Date('2023-01-07'),
135
- endTime: new Date('2023-01-15'),
150
+ section: developmentSection,
151
+ startDate: new Date('2023-01-07'),
152
+ endDate: new Date('2023-01-15'),
136
153
  progress: 10,
137
- after: '2',
154
+ dependsOn: '2',
138
155
  length: '9d',
139
156
  tags: ['critical'],
140
157
  children: [
@@ -142,11 +159,11 @@ Regular.args = {
142
159
  id: '3-1',
143
160
  title: 'Coding-A',
144
161
  type: 'task',
145
- section: exampleSection,
146
- startTime: new Date('2023-01-07'),
147
- endTime: new Date('2023-01-10'),
162
+ section: developmentSection,
163
+ startDate: new Date('2023-01-07'),
164
+ endDate: new Date('2023-01-10'),
148
165
  progress: 60,
149
- after: '',
166
+ dependsOn: '',
150
167
  length: '4d',
151
168
  tags: ['done'],
152
169
  children: []
@@ -155,10 +172,10 @@ Regular.args = {
155
172
  id: '3-2',
156
173
  title: 'Coding-B',
157
174
  type: 'task',
158
- section: exampleSection,
159
- startTime: new Date('2023-01-11'),
160
- endTime: new Date('2023-01-15'),
161
- after: '3-1',
175
+ section: developmentSection,
176
+ startDate: new Date('2023-01-11'),
177
+ endDate: new Date('2023-01-15'),
178
+ dependsOn: '3-1',
162
179
  length: '5d',
163
180
  tags: ['active'],
164
181
  children: []
@@ -169,11 +186,11 @@ Regular.args = {
169
186
  id: '4',
170
187
  title: 'Test',
171
188
  type: 'milestone',
172
- section: exampleSection,
173
- startTime: new Date('2023-01-07'),
174
- endTime: new Date('2023-01-10'),
189
+ section: developmentSection,
190
+ startDate: new Date('2023-01-07'),
191
+ endDate: new Date('2023-01-10'),
175
192
  progress: 100,
176
- after: '1',
193
+ dependsOn: '1',
177
194
  length: '1d',
178
195
  tags: ['done'],
179
196
  children: []
@@ -182,10 +199,10 @@ Regular.args = {
182
199
  id: '5',
183
200
  title: 'Deploy',
184
201
  type: 'milestone',
185
- section: exampleSection,
186
- startTime: new Date('2023-01-15'),
187
- endTime: new Date('2023-01-21'),
188
- after: '4',
202
+ section: developmentSection,
203
+ startDate: new Date('2023-01-15'),
204
+ endDate: new Date('2023-01-21'),
205
+ dependsOn: '4',
189
206
  length: '1d',
190
207
  tags: ['milestone'],
191
208
  children: []
@@ -194,10 +211,10 @@ Regular.args = {
194
211
  id: '6',
195
212
  title: 'Publishing',
196
213
  type: 'milestone',
197
- section: exampleSection,
198
- startTime: new Date('2023-01-11'),
199
- endTime: new Date('2023-01-15'),
200
- after: '5',
214
+ section: developmentSection,
215
+ startDate: new Date('2023-01-11'),
216
+ endDate: new Date('2023-01-15'),
217
+ dependsOn: '5',
201
218
  length: '1d',
202
219
  tags: ['milestone'],
203
220
  children: []
@@ -206,10 +223,10 @@ Regular.args = {
206
223
  id: '7',
207
224
  title: 'Provisioning',
208
225
  type: 'milestone',
209
- section: exampleSection,
210
- startTime: new Date('2023-01-12'),
211
- endTime: new Date('2023-01-15'),
212
- after: '6',
226
+ section: developmentSection,
227
+ startDate: new Date('2023-01-12'),
228
+ endDate: new Date('2023-01-15'),
229
+ dependsOn: '6',
213
230
  length: '1d',
214
231
  tags: ['milestone'],
215
232
  children: []
@@ -218,10 +235,10 @@ Regular.args = {
218
235
  id: '8',
219
236
  title: 'Alpha Test',
220
237
  type: 'milestone',
221
- section: exampleSection,
222
- startTime: new Date('2023-01-15'),
223
- endTime: new Date('2023-01-17'),
224
- after: '7',
238
+ section: testSection,
239
+ startDate: new Date('2023-01-15'),
240
+ endDate: new Date('2023-01-17'),
241
+ dependsOn: '7',
225
242
  length: '1d',
226
243
  tags: ['critical'],
227
244
  children: []
@@ -230,10 +247,10 @@ Regular.args = {
230
247
  id: '9',
231
248
  title: 'Beta Task',
232
249
  type: 'milestone',
233
- section: exampleSection,
234
- startTime: new Date('2023-01-15'),
235
- endTime: new Date('2023-01-18'),
236
- after: '8',
250
+ section: testSection,
251
+ startDate: new Date('2023-01-15'),
252
+ endDate: new Date('2023-01-18'),
253
+ dependsOn: '8',
237
254
  length: '1d',
238
255
  tags: ['active'],
239
256
  children: []
@@ -242,10 +259,10 @@ Regular.args = {
242
259
  id: '10',
243
260
  title: 'Gamma Test',
244
261
  type: 'milestone',
245
- section: exampleSection,
246
- startTime: new Date('2023-01-18'),
247
- endTime: new Date('2023-01-19'),
248
- after: '9',
262
+ section: testSection,
263
+ startDate: new Date('2023-01-18'),
264
+ endDate: new Date('2023-01-19'),
265
+ dependsOn: '9',
249
266
  length: '1d',
250
267
  tags: ['critical'],
251
268
  children: []
@@ -254,10 +271,10 @@ Regular.args = {
254
271
  id: '11',
255
272
  title: 'Zeta Test',
256
273
  type: 'milestone',
257
- section: exampleSection,
258
- startTime: new Date('2023-01-18'),
259
- endTime: new Date('2023-01-22'),
260
- after: '9',
274
+ section: testSection,
275
+ startDate: new Date('2023-01-18'),
276
+ endDate: new Date('2023-01-22'),
277
+ dependsOn: '9',
261
278
  length: '1d',
262
279
  tags: ['milestone'],
263
280
  children: []
@@ -266,10 +283,10 @@ Regular.args = {
266
283
  id: '12',
267
284
  title: 'Release',
268
285
  type: 'milestone',
269
- section: exampleSection,
270
- startTime: new Date('2023-01-18'),
271
- endTime: new Date('2023-01-23'),
272
- after: '9',
286
+ section: releaseSection,
287
+ startDate: new Date('2023-01-18'),
288
+ endDate: new Date('2023-01-23'),
289
+ dependsOn: '9',
273
290
  length: '1d',
274
291
  tags: ['milestone'],
275
292
  children: []
@@ -278,10 +295,10 @@ Regular.args = {
278
295
  id: '13',
279
296
  title: 'Release',
280
297
  type: 'milestone',
281
- section: exampleSection,
282
- startTime: new Date('2023-01-22'),
283
- endTime: new Date('2023-01-27'),
284
- after: '12',
298
+ section: releaseSection,
299
+ startDate: new Date('2023-01-22'),
300
+ endDate: new Date('2023-01-27'),
301
+ dependsOn: '12',
285
302
  length: '1d',
286
303
  tags: ['done'],
287
304
  children: []
@@ -290,10 +307,10 @@ Regular.args = {
290
307
  id: '14',
291
308
  title: 'Release',
292
309
  type: 'milestone',
293
- section: exampleSection,
294
- startTime: new Date('2023-01-27'),
295
- endTime: new Date('2023-01-30'),
296
- after: '13',
310
+ section: releaseSection,
311
+ startDate: new Date('2023-01-27'),
312
+ endDate: new Date('2023-01-30'),
313
+ dependsOn: '13',
297
314
  length: '1d',
298
315
  tags: ['milestone'],
299
316
  children: []
@@ -302,10 +319,10 @@ Regular.args = {
302
319
  id: '15',
303
320
  title: 'Release',
304
321
  type: 'milestone',
305
- section: exampleSection,
306
- startTime: new Date('2023-01-30'),
307
- endTime: new Date('2023-01-31'),
308
- after: '14',
322
+ section: releaseSection,
323
+ startDate: new Date('2023-01-30'),
324
+ endDate: new Date('2023-01-31'),
325
+ dependsOn: '14',
309
326
  length: '1d',
310
327
  tags: ['milestone'],
311
328
  children: []
@@ -314,10 +331,10 @@ Regular.args = {
314
331
  id: '16',
315
332
  title: 'Release',
316
333
  type: 'milestone',
317
- section: exampleSection,
318
- startTime: new Date('2023-01-31'),
319
- endTime: new Date('2023-02-05'),
320
- after: '15',
334
+ section: releaseSection,
335
+ startDate: new Date('2023-01-31'),
336
+ endDate: new Date('2023-02-05'),
337
+ dependsOn: '15',
321
338
  length: '1d',
322
339
  tags: ['active'],
323
340
  children: []
@@ -326,10 +343,10 @@ Regular.args = {
326
343
  id: '17',
327
344
  title: 'Release',
328
345
  type: 'milestone',
329
- section: exampleSection,
330
- startTime: new Date('2023-02-06'),
331
- endTime: new Date('2023-02-07'),
332
- after: '16',
346
+ section: releaseSection,
347
+ startDate: new Date('2023-02-06'),
348
+ endDate: new Date('2023-02-07'),
349
+ dependsOn: '16',
333
350
  length: '1d',
334
351
  tags: ['milestone'],
335
352
  children: []
@@ -338,10 +355,10 @@ Regular.args = {
338
355
  id: '18',
339
356
  title: 'Release',
340
357
  type: 'milestone',
341
- section: exampleSection,
342
- startTime: new Date('2023-02-08'),
343
- endTime: new Date('2023-02-09'),
344
- after: '17',
358
+ section: releaseSection,
359
+ startDate: new Date('2023-02-08'),
360
+ endDate: new Date('2023-02-09'),
361
+ dependsOn: '17',
345
362
  length: '1d',
346
363
  tags: ['critical'],
347
364
  children: []
@@ -350,10 +367,10 @@ Regular.args = {
350
367
  id: '19',
351
368
  title: 'Release',
352
369
  type: 'milestone',
353
- section: exampleSection,
354
- startTime: new Date('2023-02-10'),
355
- endTime: new Date('2023-02-25'),
356
- after: '18',
370
+ section: releaseSection,
371
+ startDate: new Date('2023-02-10'),
372
+ endDate: new Date('2023-02-25'),
373
+ dependsOn: '18',
357
374
  length: '1d',
358
375
  tags: ['milestone'],
359
376
  children: []
@@ -1 +1,11 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "ID",
3
+ "label.gantt-task-section": "section",
4
+ "label.gantt-task-title": "title",
5
+ "label.gantt-task-type": "type",
6
+ "label.gantt-task-start-date": "start date",
7
+ "label.gantt-task-end-date": "end date",
8
+ "label.gantt-task-tags": "tags",
9
+ "label.gantt-task-progress": "progress",
10
+ "label.gantt-task-previous": "previous"
11
+ }
@@ -1 +1,11 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "ID",
3
+ "label.gantt-task-section": "セクション",
4
+ "label.gantt-task-title": "タイトル",
5
+ "label.gantt-task-type": "タイプ",
6
+ "label.gantt-task-start-date": "開始日",
7
+ "label.gantt-task-end-date": "終了日",
8
+ "label.gantt-task-tags": "タグ",
9
+ "label.gantt-task-progress": "進捗",
10
+ "label.gantt-task-previous": "前"
11
+ }
@@ -1 +1,11 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "아이디",
3
+ "label.gantt-task-section": "섹션",
4
+ "label.gantt-task-title": "제목",
5
+ "label.gantt-task-type": "유형",
6
+ "label.gantt-task-start-date": "시작 날짜",
7
+ "label.gantt-task-end-date": "종료 날짜",
8
+ "label.gantt-task-tags": "태그",
9
+ "label.gantt-task-progress": "진행 상황",
10
+ "label.gantt-task-previous": "이전"
11
+ }
@@ -1 +1,11 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "id",
3
+ "label.gantt-task-section": "seksyen",
4
+ "label.gantt-task-title": "tajuk",
5
+ "label.gantt-task-type": "jenis",
6
+ "label.gantt-task-start-date": "tarikh mula",
7
+ "label.gantt-task-end-date": "tarikh tamat",
8
+ "label.gantt-task-tags": "tag",
9
+ "label.gantt-task-progress": "kemajuan",
10
+ "label.gantt-task-previous": "sebelumnya"
11
+ }
@@ -1 +1,11 @@
1
- {}
1
+ {
2
+ "label.gantt-task-id": "ID",
3
+ "label.gantt-task-section": "部分",
4
+ "label.gantt-task-title": "标题",
5
+ "label.gantt-task-type": "类型",
6
+ "label.gantt-task-start-date": "开始日期",
7
+ "label.gantt-task-end-date": "结束日期",
8
+ "label.gantt-task-tags": "标签",
9
+ "label.gantt-task-progress": "进度",
10
+ "label.gantt-task-previous": "以前"
11
+ }
@@ -1 +0,0 @@
1
- export declare function setLocale(locale: string): void;
@@ -1,49 +0,0 @@
1
- import { timeFormatDefaultLocale } from 'd3-time-format';
2
- // 한국어 로케일 정의
3
- const koKR = {
4
- dateTime: '%Y-%m-%d %a %X',
5
- date: '%Y-%m-%d',
6
- time: '%H:%M:%S',
7
- periods: ['AM', 'PM'],
8
- days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
9
- shortDays: ['일', '월', '화', '수', '목', '금', '토'],
10
- months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
11
- shortMonths: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
12
- };
13
- // 영어 로케일 정의
14
- const enUS = {
15
- dateTime: '%x, %X',
16
- date: '%-m/%-d/%Y',
17
- time: '%-I:%M:%S %p',
18
- periods: ['AM', 'PM'],
19
- days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
20
- shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
21
- months: [
22
- 'January',
23
- 'February',
24
- 'March',
25
- 'April',
26
- 'May',
27
- 'June',
28
- 'July',
29
- 'August',
30
- 'September',
31
- 'October',
32
- 'November',
33
- 'December'
34
- ],
35
- shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
36
- };
37
- // 로케일 설정 함수
38
- export function setLocale(locale) {
39
- if (locale === 'ko') {
40
- timeFormatDefaultLocale(koKR);
41
- }
42
- else if (locale === 'en') {
43
- timeFormatDefaultLocale(enUS);
44
- }
45
- }
46
- // 예제 언어 선택
47
- const selectedLocale = 'ko';
48
- setLocale(selectedLocale);
49
- //# sourceMappingURL=locale.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale.js","sourceRoot":"","sources":["../../src/locale.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAExD,aAAa;AACb,MAAM,IAAI,GAAG;IACX,QAAQ,EAAE,gBAAgB;IAC1B,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACvD,SAAS,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;IAC9C,MAAM,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IACnF,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;CAC9D,CAAA;AAE5B,YAAY;AACZ,MAAM,IAAI,GAAG;IACX,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;IACrB,IAAI,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC;IACpF,SAAS,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;IAC5D,MAAM,EAAE;QACN,SAAS;QACT,UAAU;QACV,OAAO;QACP,OAAO;QACP,KAAK;QACL,MAAM;QACN,MAAM;QACN,QAAQ;QACR,WAAW;QACX,SAAS;QACT,UAAU;QACV,UAAU;KACX;IACD,WAAW,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;CACvE,CAAA;AAE5B,YAAY;AACZ,MAAM,UAAU,SAAS,CAAC,MAAc;IACtC,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;SAAM,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QAC3B,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;AACH,CAAC;AAED,WAAW;AACX,MAAM,cAAc,GAAG,IAAI,CAAA;AAC3B,SAAS,CAAC,cAAc,CAAC,CAAA","sourcesContent":["import { timeFormatDefaultLocale } from 'd3-time-format'\n\n// 한국어 로케일 정의\nconst koKR = {\n dateTime: '%Y-%m-%d %a %X',\n date: '%Y-%m-%d',\n time: '%H:%M:%S',\n periods: ['AM', 'PM'],\n days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],\n shortDays: ['일', '월', '화', '수', '목', '금', '토'],\n months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],\n shortMonths: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']\n} as d3.TimeLocaleDefinition\n\n// 영어 로케일 정의\nconst enUS = {\n dateTime: '%x, %X',\n date: '%-m/%-d/%Y',\n time: '%-I:%M:%S %p',\n periods: ['AM', 'PM'],\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ],\n shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n} as d3.TimeLocaleDefinition\n\n// 로케일 설정 함수\nexport function setLocale(locale: string) {\n if (locale === 'ko') {\n timeFormatDefaultLocale(koKR)\n } else if (locale === 'en') {\n timeFormatDefaultLocale(enUS)\n }\n}\n\n// 예제 언어 선택\nconst selectedLocale = 'ko'\nsetLocale(selectedLocale)\n"]}
package/src/locale.ts DELETED
@@ -1,51 +0,0 @@
1
- import { timeFormatDefaultLocale } from 'd3-time-format'
2
-
3
- // 한국어 로케일 정의
4
- const koKR = {
5
- dateTime: '%Y-%m-%d %a %X',
6
- date: '%Y-%m-%d',
7
- time: '%H:%M:%S',
8
- periods: ['AM', 'PM'],
9
- days: ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'],
10
- shortDays: ['일', '월', '화', '수', '목', '금', '토'],
11
- months: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월'],
12
- shortMonths: ['1월', '2월', '3월', '4월', '5월', '6월', '7월', '8월', '9월', '10월', '11월', '12월']
13
- } as d3.TimeLocaleDefinition
14
-
15
- // 영어 로케일 정의
16
- const enUS = {
17
- dateTime: '%x, %X',
18
- date: '%-m/%-d/%Y',
19
- time: '%-I:%M:%S %p',
20
- periods: ['AM', 'PM'],
21
- days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
22
- shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
23
- months: [
24
- 'January',
25
- 'February',
26
- 'March',
27
- 'April',
28
- 'May',
29
- 'June',
30
- 'July',
31
- 'August',
32
- 'September',
33
- 'October',
34
- 'November',
35
- 'December'
36
- ],
37
- shortMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
38
- } as d3.TimeLocaleDefinition
39
-
40
- // 로케일 설정 함수
41
- export function setLocale(locale: string) {
42
- if (locale === 'ko') {
43
- timeFormatDefaultLocale(koKR)
44
- } else if (locale === 'en') {
45
- timeFormatDefaultLocale(enUS)
46
- }
47
- }
48
-
49
- // 예제 언어 선택
50
- const selectedLocale = 'ko'
51
- setLocale(selectedLocale)