@operato/gantt 2.0.0-beta.5 → 7.0.0-rc.2

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 (47) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/dist/src/gantt-chart-controller.d.ts +32 -0
  3. package/dist/src/gantt-chart-controller.js +395 -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 +11 -20
  9. package/dist/src/ox-gantt-chart.js +141 -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 +17 -3
  15. package/dist/src/ox-gantt.js +169 -29
  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 +11 -4
  21. package/dist/src/types.js.map +1 -1
  22. package/dist/src/utils.d.ts +3 -3
  23. package/dist/src/utils.js.map +1 -1
  24. package/dist/stories/ox-gantt.stories.d.ts +19 -2
  25. package/dist/stories/ox-gantt.stories.js +104 -90
  26. package/dist/stories/ox-gantt.stories.js.map +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -1
  28. package/package.json +7 -4
  29. package/src/gantt-chart-controller.ts +473 -0
  30. package/src/locales.ts +78 -0
  31. package/src/ox-gantt-chart.ts +151 -484
  32. package/src/ox-gantt-resize-splitter.ts +18 -25
  33. package/src/ox-gantt.ts +174 -31
  34. package/src/ox-task-tooltip.ts +120 -0
  35. package/src/types.ts +13 -5
  36. package/src/utils.ts +4 -4
  37. package/stories/ox-gantt.stories.ts +118 -91
  38. package/themes/grist-theme.css +0 -2
  39. package/translations/en.json +11 -1
  40. package/translations/ja.json +11 -1
  41. package/translations/ko.json +11 -1
  42. package/translations/ms.json +11 -1
  43. package/translations/zh.json +11 -1
  44. package/dist/src/locale.d.ts +0 -1
  45. package/dist/src/locale.js +0 -49
  46. package/dist/src/locale.js.map +0 -1
  47. package/src/locale.ts +0 -51
@@ -4,14 +4,18 @@ import '../src/ox-gantt.js'
4
4
  import { html, TemplateResult } from 'lit'
5
5
  import { styles as MDTypeScaleStyles } from '@material/web/typography/md-typescale-styles'
6
6
 
7
- import { Task, Section } from '../src/types.js'
7
+ import { Task, Section, TimeScale } from '../src/types.js'
8
8
 
9
9
  export default {
10
10
  title: 'ox-gantt',
11
11
  component: 'ox-gantt',
12
12
  argTypes: {
13
- tasks: { control: 'object' },
14
- theme: { control: 'select', options: ['light', 'dark'] }
13
+ fromDate: { control: 'date' },
14
+ toDate: { control: 'date' },
15
+ timeScale: { control: 'select', options: ['year-quarter', 'year-month', 'quarter-week', 'week-day'] },
16
+ extendGridLines: { control: 'boolean' },
17
+ theme: { control: 'select', options: ['light', 'dark'] },
18
+ tasks: { control: 'object' }
15
19
  }
16
20
  }
17
21
 
@@ -23,10 +27,21 @@ interface Story<T> {
23
27
 
24
28
  interface ArgTypes {
25
29
  tasks: Task[]
30
+ fromDate: number | string
31
+ toDate: number | string
32
+ extendGridLines: boolean
33
+ timeScale: TimeScale
26
34
  theme: 'light' | 'dark'
27
35
  }
28
36
 
29
- const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html`
37
+ const Template: Story<ArgTypes> = ({
38
+ theme = 'light',
39
+ tasks,
40
+ fromDate,
41
+ toDate,
42
+ extendGridLines,
43
+ timeScale = 'week-day'
44
+ }: ArgTypes) => html`
30
45
  <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap" rel="stylesheet" />
31
46
 
32
47
  <link href="/themes/light.css" rel="stylesheet" />
@@ -80,8 +95,9 @@ const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html
80
95
  </script>
81
96
 
82
97
  <ox-gantt
83
- from-date="2022-12-27"
84
- to-date="2024-12-31"
98
+ from-date=${new Date(fromDate).toISOString().split('T')[0]}
99
+ to-date=${new Date(toDate).toISOString().split('T')[0]}
100
+ .timeScale=${timeScale}
85
101
  .tasks=${tasks}
86
102
  @date-range-selected=${(e: CustomEvent) => {
87
103
  console.log('date-range-selected', e.detail)
@@ -89,26 +105,37 @@ const Template: Story<ArgTypes> = ({ theme = 'light', tasks }: ArgTypes) => html
89
105
  @task-clicked=${(e: CustomEvent) => {
90
106
  console.log('task-clicked', e.detail)
91
107
  }}
108
+ ?extend-grid-lines=${extendGridLines}
92
109
  >
93
110
  </ox-gantt>
94
111
  `
95
112
 
96
- const exampleSection: Section = {
113
+ const developmentSection: Section = {
97
114
  name: 'Development'
98
115
  }
99
116
 
117
+ const testSection: Section = {
118
+ name: 'Test'
119
+ }
120
+
121
+ const releaseSection: Section = {
122
+ name: 'Release'
123
+ }
124
+
100
125
  export const Regular = Template.bind({})
101
126
  Regular.args = {
127
+ fromDate: '2022-12-27',
128
+ toDate: '2024-12-31',
102
129
  tasks: [
103
130
  {
104
131
  id: '1',
105
132
  title: 'Design',
106
133
  type: 'task',
107
- section: exampleSection,
108
- startTime: new Date('2023-01-01'),
109
- endTime: new Date('2023-01-05'),
134
+ // section: developmentSection,
135
+ startDate: '2023-01-01',
136
+ endDate: '2023-01-05',
110
137
  progress: 60,
111
- after: '',
138
+ dependsOn: '',
112
139
  length: '5d',
113
140
  tags: ['active'],
114
141
  children: []
@@ -117,11 +144,11 @@ Regular.args = {
117
144
  id: '2',
118
145
  title: 'Development',
119
146
  type: 'milestone',
120
- section: exampleSection,
121
- startTime: new Date('2023-01-06'),
122
- endTime: new Date('2023-01-06'),
147
+ // section: developmentSection,
148
+ startDate: '2023-01-06',
149
+ endDate: '2023-01-06',
123
150
  progress: 30,
124
- after: '1',
151
+ dependsOn: '1',
125
152
  length: '1d',
126
153
  tags: ['milestone'],
127
154
  children: []
@@ -130,11 +157,11 @@ Regular.args = {
130
157
  id: '3',
131
158
  title: 'Coding',
132
159
  type: 'phase',
133
- section: exampleSection,
134
- startTime: new Date('2023-01-07'),
135
- endTime: new Date('2023-01-15'),
160
+ // section: developmentSection,
161
+ startDate: '2023-01-07',
162
+ endDate: '2023-01-15',
136
163
  progress: 10,
137
- after: '2',
164
+ dependsOn: '2',
138
165
  length: '9d',
139
166
  tags: ['critical'],
140
167
  children: [
@@ -142,11 +169,11 @@ Regular.args = {
142
169
  id: '3-1',
143
170
  title: 'Coding-A',
144
171
  type: 'task',
145
- section: exampleSection,
146
- startTime: new Date('2023-01-07'),
147
- endTime: new Date('2023-01-10'),
172
+ // section: developmentSection,
173
+ startDate: '2023-01-07',
174
+ endDate: '2023-01-10',
148
175
  progress: 60,
149
- after: '',
176
+ dependsOn: '',
150
177
  length: '4d',
151
178
  tags: ['done'],
152
179
  children: []
@@ -155,10 +182,10 @@ Regular.args = {
155
182
  id: '3-2',
156
183
  title: 'Coding-B',
157
184
  type: 'task',
158
- section: exampleSection,
159
- startTime: new Date('2023-01-11'),
160
- endTime: new Date('2023-01-15'),
161
- after: '3-1',
185
+ // section: developmentSection,
186
+ startDate: '2023-01-11',
187
+ endDate: '2023-01-15',
188
+ dependsOn: '3-1',
162
189
  length: '5d',
163
190
  tags: ['active'],
164
191
  children: []
@@ -169,11 +196,11 @@ Regular.args = {
169
196
  id: '4',
170
197
  title: 'Test',
171
198
  type: 'milestone',
172
- section: exampleSection,
173
- startTime: new Date('2023-01-07'),
174
- endTime: new Date('2023-01-10'),
199
+ // section: developmentSection,
200
+ startDate: '2023-01-07',
201
+ endDate: '2023-01-10',
175
202
  progress: 100,
176
- after: '1',
203
+ dependsOn: '1',
177
204
  length: '1d',
178
205
  tags: ['done'],
179
206
  children: []
@@ -182,10 +209,10 @@ Regular.args = {
182
209
  id: '5',
183
210
  title: 'Deploy',
184
211
  type: 'milestone',
185
- section: exampleSection,
186
- startTime: new Date('2023-01-15'),
187
- endTime: new Date('2023-01-21'),
188
- after: '4',
212
+ // section: developmentSection,
213
+ startDate: '2023-01-15',
214
+ endDate: '2023-01-21',
215
+ dependsOn: '4',
189
216
  length: '1d',
190
217
  tags: ['milestone'],
191
218
  children: []
@@ -194,10 +221,10 @@ Regular.args = {
194
221
  id: '6',
195
222
  title: 'Publishing',
196
223
  type: 'milestone',
197
- section: exampleSection,
198
- startTime: new Date('2023-01-11'),
199
- endTime: new Date('2023-01-15'),
200
- after: '5',
224
+ // section: developmentSection,
225
+ startDate: '2023-01-11',
226
+ endDate: '2023-01-15',
227
+ dependsOn: '5',
201
228
  length: '1d',
202
229
  tags: ['milestone'],
203
230
  children: []
@@ -206,10 +233,10 @@ Regular.args = {
206
233
  id: '7',
207
234
  title: 'Provisioning',
208
235
  type: 'milestone',
209
- section: exampleSection,
210
- startTime: new Date('2023-01-12'),
211
- endTime: new Date('2023-01-15'),
212
- after: '6',
236
+ // section: developmentSection,
237
+ startDate: '2023-01-12',
238
+ endDate: '2023-01-15',
239
+ dependsOn: '6',
213
240
  length: '1d',
214
241
  tags: ['milestone'],
215
242
  children: []
@@ -218,10 +245,10 @@ Regular.args = {
218
245
  id: '8',
219
246
  title: 'Alpha Test',
220
247
  type: 'milestone',
221
- section: exampleSection,
222
- startTime: new Date('2023-01-15'),
223
- endTime: new Date('2023-01-17'),
224
- after: '7',
248
+ // section: testSection,
249
+ startDate: '2023-01-15',
250
+ endDate: '2023-01-17',
251
+ dependsOn: '7',
225
252
  length: '1d',
226
253
  tags: ['critical'],
227
254
  children: []
@@ -230,10 +257,10 @@ Regular.args = {
230
257
  id: '9',
231
258
  title: 'Beta Task',
232
259
  type: 'milestone',
233
- section: exampleSection,
234
- startTime: new Date('2023-01-15'),
235
- endTime: new Date('2023-01-18'),
236
- after: '8',
260
+ // section: testSection,
261
+ startDate: '2023-01-15',
262
+ endDate: '2023-01-18',
263
+ dependsOn: '8',
237
264
  length: '1d',
238
265
  tags: ['active'],
239
266
  children: []
@@ -242,10 +269,10 @@ Regular.args = {
242
269
  id: '10',
243
270
  title: 'Gamma Test',
244
271
  type: 'milestone',
245
- section: exampleSection,
246
- startTime: new Date('2023-01-18'),
247
- endTime: new Date('2023-01-19'),
248
- after: '9',
272
+ // section: testSection,
273
+ startDate: '2023-01-18',
274
+ endDate: '2023-01-19',
275
+ dependsOn: '9',
249
276
  length: '1d',
250
277
  tags: ['critical'],
251
278
  children: []
@@ -254,10 +281,10 @@ Regular.args = {
254
281
  id: '11',
255
282
  title: 'Zeta Test',
256
283
  type: 'milestone',
257
- section: exampleSection,
258
- startTime: new Date('2023-01-18'),
259
- endTime: new Date('2023-01-22'),
260
- after: '9',
284
+ // section: testSection,
285
+ startDate: '2023-01-18',
286
+ endDate: '2023-01-22',
287
+ dependsOn: '9',
261
288
  length: '1d',
262
289
  tags: ['milestone'],
263
290
  children: []
@@ -266,10 +293,10 @@ Regular.args = {
266
293
  id: '12',
267
294
  title: 'Release',
268
295
  type: 'milestone',
269
- section: exampleSection,
270
- startTime: new Date('2023-01-18'),
271
- endTime: new Date('2023-01-23'),
272
- after: '9',
296
+ // section: releaseSection,
297
+ startDate: '2023-01-18',
298
+ endDate: '2023-01-23',
299
+ dependsOn: '9',
273
300
  length: '1d',
274
301
  tags: ['milestone'],
275
302
  children: []
@@ -278,10 +305,10 @@ Regular.args = {
278
305
  id: '13',
279
306
  title: 'Release',
280
307
  type: 'milestone',
281
- section: exampleSection,
282
- startTime: new Date('2023-01-22'),
283
- endTime: new Date('2023-01-27'),
284
- after: '12',
308
+ // section: releaseSection,
309
+ startDate: '2023-01-22',
310
+ endDate: '2023-01-27',
311
+ dependsOn: '12',
285
312
  length: '1d',
286
313
  tags: ['done'],
287
314
  children: []
@@ -290,10 +317,10 @@ Regular.args = {
290
317
  id: '14',
291
318
  title: 'Release',
292
319
  type: 'milestone',
293
- section: exampleSection,
294
- startTime: new Date('2023-01-27'),
295
- endTime: new Date('2023-01-30'),
296
- after: '13',
320
+ // section: releaseSection,
321
+ startDate: '2023-01-27',
322
+ endDate: '2023-01-30',
323
+ dependsOn: '13',
297
324
  length: '1d',
298
325
  tags: ['milestone'],
299
326
  children: []
@@ -302,10 +329,10 @@ Regular.args = {
302
329
  id: '15',
303
330
  title: 'Release',
304
331
  type: 'milestone',
305
- section: exampleSection,
306
- startTime: new Date('2023-01-30'),
307
- endTime: new Date('2023-01-31'),
308
- after: '14',
332
+ // section: releaseSection,
333
+ startDate: '2023-01-30',
334
+ endDate: '2023-01-31',
335
+ dependsOn: '14',
309
336
  length: '1d',
310
337
  tags: ['milestone'],
311
338
  children: []
@@ -314,10 +341,10 @@ Regular.args = {
314
341
  id: '16',
315
342
  title: 'Release',
316
343
  type: 'milestone',
317
- section: exampleSection,
318
- startTime: new Date('2023-01-31'),
319
- endTime: new Date('2023-02-05'),
320
- after: '15',
344
+ // section: releaseSection,
345
+ startDate: '2023-01-31',
346
+ endDate: '2023-02-05',
347
+ dependsOn: '15',
321
348
  length: '1d',
322
349
  tags: ['active'],
323
350
  children: []
@@ -326,10 +353,10 @@ Regular.args = {
326
353
  id: '17',
327
354
  title: 'Release',
328
355
  type: 'milestone',
329
- section: exampleSection,
330
- startTime: new Date('2023-02-06'),
331
- endTime: new Date('2023-02-07'),
332
- after: '16',
356
+ // section: releaseSection,
357
+ startDate: '2023-02-06',
358
+ endDate: '2023-02-07',
359
+ dependsOn: '16',
333
360
  length: '1d',
334
361
  tags: ['milestone'],
335
362
  children: []
@@ -338,10 +365,10 @@ Regular.args = {
338
365
  id: '18',
339
366
  title: 'Release',
340
367
  type: 'milestone',
341
- section: exampleSection,
342
- startTime: new Date('2023-02-08'),
343
- endTime: new Date('2023-02-09'),
344
- after: '17',
368
+ // section: releaseSection,
369
+ startDate: '2023-02-08',
370
+ endDate: '2023-02-09',
371
+ dependsOn: '17',
345
372
  length: '1d',
346
373
  tags: ['critical'],
347
374
  children: []
@@ -350,10 +377,10 @@ Regular.args = {
350
377
  id: '19',
351
378
  title: 'Release',
352
379
  type: 'milestone',
353
- section: exampleSection,
354
- startTime: new Date('2023-02-10'),
355
- endTime: new Date('2023-02-25'),
356
- after: '18',
380
+ // section: releaseSection,
381
+ startDate: '2023-02-10',
382
+ endDate: '2023-02-25',
383
+ dependsOn: '18',
357
384
  length: '1d',
358
385
  tags: ['milestone'],
359
386
  children: []
@@ -48,11 +48,9 @@ body {
48
48
  --grid-record-wide-fontsize: var(--md-sys-typescale-label-medium-size);
49
49
  --grid-record-selected-background-color: var(--md-sys-color-primary-container);
50
50
  --grid-record-selected-color: var(--md-sys-color-primary);
51
- --grid-record-focused-background-color: var(--md-sys-color-secondary-container);
52
51
  --grid-record-focused-border: 1px solid var(--md-sys-color-outline-variant);
53
52
  --grid-record-focused-cell-background-color: var(--md-sys-color-secondary-container);
54
53
  --grid-record-focused-cell-border: 1px dashed var(--md-sys-color-outline);
55
- --grid-record-focused-color: var(--md-sys-color-secondary);
56
54
  --grid-record-focused-box-shadow: 0px 2px 0px 0px rgb(0 0 0 / 10%);
57
55
  --grid-record-emphasized-background-color: var(--md-sys-color-tertiary-container);
58
56
  --grid-record-emphasized-color: var(--md-sys-color-tertiary);
@@ -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)