@godxjp/ui 6.0.0 → 6.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.
- package/dist/app/index.d.ts +140 -0
- package/dist/app/index.js +38 -0
- package/dist/app.prop-IobwLwaM.d.ts +90 -0
- package/dist/checkbox-NkFkqsQ8.d.ts +13 -0
- package/dist/chunk-2XW7J3EI.js +226 -0
- package/dist/chunk-3F2AKYRD.js +416 -0
- package/dist/chunk-3KPEZ5CF.js +37 -0
- package/dist/chunk-3UGU5TYP.js +89 -0
- package/{src/props/registry.ts → dist/chunk-6RA3KSVK.js} +118 -133
- package/dist/chunk-7NZFVD24.js +122 -0
- package/dist/chunk-7PWBC4BY.js +25 -0
- package/dist/chunk-7S7MYFXE.js +61 -0
- package/dist/chunk-7WRZG2IG.js +71 -0
- package/dist/chunk-B775Y6BE.js +1 -0
- package/dist/chunk-BHV2FUOA.js +111 -0
- package/dist/chunk-BI3HERR7.js +70 -0
- package/dist/chunk-BPSKQUL2.js +68 -0
- package/dist/chunk-CDWPQ5RP.js +187 -0
- package/dist/chunk-CP2LET6N.js +244 -0
- package/dist/chunk-CQBADMFG.js +20 -0
- package/dist/chunk-CRERCLIZ.js +33 -0
- package/dist/chunk-DU6ZYZRP.js +238 -0
- package/dist/chunk-DY5C44UP.js +55 -0
- package/dist/chunk-E4HJNQ62.js +117 -0
- package/dist/chunk-E76QIYSY.js +93 -0
- package/dist/chunk-F7PG4OEV.js +37 -0
- package/dist/chunk-GDSVW62T.js +171 -0
- package/dist/chunk-H2FHJOLU.js +178 -0
- package/dist/chunk-HJEBRCXL.js +55 -0
- package/dist/chunk-ICM6XBST.js +16 -0
- package/{src/components/data-entry/calendar.tsx → dist/chunk-IK7I3ABN.js} +33 -35
- package/dist/chunk-L6J44O74.js +144 -0
- package/dist/chunk-LDSLS6HE.js +1 -0
- package/dist/chunk-LVNUHUEZ.js +191 -0
- package/dist/chunk-M64MVRLS.js +92 -0
- package/dist/chunk-NGQW3KEM.js +402 -0
- package/dist/chunk-NZ4FOC5N.js +559 -0
- package/dist/chunk-PIIRNAXA.js +26 -0
- package/dist/chunk-S66TJXJU.js +33 -0
- package/dist/chunk-SMLKNECP.js +133 -0
- package/dist/chunk-TAHBM3F2.js +66 -0
- package/dist/chunk-TO33OY4L.js +150 -0
- package/dist/chunk-TO7URV7U.js +51 -0
- package/dist/chunk-TOO5AEKL.js +81 -0
- package/dist/chunk-U3GHAOIJ.js +299 -0
- package/dist/chunk-U7N2A7A3.js +9 -0
- package/dist/chunk-UX634MYF.js +123 -0
- package/dist/chunk-V6UWJKZF.js +28 -0
- package/{src/components/data-entry/input.tsx → dist/chunk-VOHTRR5X.js} +18 -16
- package/dist/chunk-WRFKVUPW.js +332 -0
- package/dist/chunk-WXW43RK5.js +24 -0
- package/{src/components/navigation/tabs.tsx → dist/chunk-XG7XDYIM.js} +46 -53
- package/dist/chunk-YFCQKO3B.js +842 -0
- package/dist/chunk-ZDWXGWLY.js +73 -0
- package/dist/chunk-ZLK5SPT6.js +11 -0
- package/dist/chunk-ZS6DTAM2.js +31 -0
- package/dist/chunk-ZT5UEUBO.js +1 -0
- package/dist/components/admin/index.d.ts +80 -0
- package/dist/components/admin/index.js +38 -0
- package/dist/components/data-display/badge.d.ts +12 -0
- package/dist/components/data-display/badge.js +3 -0
- package/dist/components/data-display/card.d.ts +87 -0
- package/dist/components/data-display/card.js +2 -0
- package/dist/components/data-display/index.d.ts +72 -0
- package/dist/components/data-display/index.js +89 -0
- package/dist/components/data-display/popover.d.ts +13 -0
- package/dist/components/data-display/popover.js +2 -0
- package/dist/components/data-display/scroll-area.d.ts +7 -0
- package/dist/components/data-display/scroll-area.js +2 -0
- package/dist/components/data-display/table.d.ts +10 -0
- package/dist/components/data-display/table.js +3 -0
- package/dist/components/data-entry/autocomplete.d.ts +16 -0
- package/dist/components/data-entry/autocomplete.js +8 -0
- package/dist/components/data-entry/calendar.d.ts +16 -0
- package/dist/components/data-entry/calendar.js +4 -0
- package/dist/components/data-entry/cascader.d.ts +32 -0
- package/dist/components/data-entry/cascader.js +13 -0
- package/dist/components/data-entry/checkbox.d.ts +13 -0
- package/dist/components/data-entry/checkbox.js +4 -0
- package/dist/components/data-entry/color-picker.d.ts +16 -0
- package/dist/components/data-entry/color-picker.js +6 -0
- package/dist/components/data-entry/command.d.ts +69 -0
- package/dist/components/data-entry/command.js +3 -0
- package/dist/components/data-entry/date-picker.d.ts +16 -0
- package/dist/components/data-entry/date-picker.js +8 -0
- package/dist/components/data-entry/date-range-picker.d.ts +16 -0
- package/dist/components/data-entry/date-range-picker.js +8 -0
- package/dist/components/data-entry/index.d.ts +53 -0
- package/dist/components/data-entry/index.js +152 -0
- package/dist/components/data-entry/input.d.ts +6 -0
- package/dist/components/data-entry/input.js +2 -0
- package/dist/components/data-entry/label.d.ts +8 -0
- package/dist/components/data-entry/label.js +2 -0
- package/dist/components/data-entry/radio.d.ts +24 -0
- package/dist/components/data-entry/radio.js +4 -0
- package/dist/components/data-entry/select.d.ts +18 -0
- package/dist/components/data-entry/select.js +3 -0
- package/dist/components/data-entry/slider.d.ts +16 -0
- package/dist/components/data-entry/slider.js +2 -0
- package/dist/components/data-entry/switch.d.ts +17 -0
- package/dist/components/data-entry/switch.js +2 -0
- package/dist/components/data-entry/textarea.d.ts +6 -0
- package/dist/components/data-entry/textarea.js +3 -0
- package/dist/components/data-entry/time-picker.d.ts +16 -0
- package/dist/components/data-entry/time-picker.js +7 -0
- package/dist/components/data-entry/transfer.d.ts +17 -0
- package/dist/components/data-entry/transfer.js +11 -0
- package/dist/components/data-entry/tree-select.d.ts +26 -0
- package/dist/components/data-entry/tree-select.js +13 -0
- package/dist/components/data-entry/upload.d.ts +42 -0
- package/dist/components/data-entry/upload.js +11 -0
- package/dist/components/feedback/alert.d.ts +60 -0
- package/dist/components/feedback/alert.js +7 -0
- package/dist/components/feedback/dialog.d.ts +64 -0
- package/dist/components/feedback/dialog.js +7 -0
- package/dist/components/feedback/index.d.ts +16 -0
- package/dist/components/feedback/index.js +14 -0
- package/dist/components/feedback/sheet.d.ts +24 -0
- package/dist/components/feedback/sheet.js +2 -0
- package/dist/components/feedback/sonner.d.ts +6 -0
- package/dist/components/feedback/sonner.js +1 -0
- package/dist/components/general/button.d.ts +20 -0
- package/dist/components/general/button.js +2 -0
- package/dist/components/general/index.d.ts +6 -0
- package/dist/components/general/index.js +2 -0
- package/dist/components/layout/index.d.ts +71 -0
- package/dist/components/layout/index.js +5 -0
- package/dist/components/navigation/dropdown-menu.d.ts +28 -0
- package/dist/components/navigation/dropdown-menu.js +2 -0
- package/dist/components/navigation/index.d.ts +32 -0
- package/dist/components/navigation/index.js +12 -0
- package/dist/components/navigation/pagination.d.ts +11 -0
- package/dist/components/navigation/pagination.js +7 -0
- package/dist/components/navigation/steps.d.ts +12 -0
- package/dist/components/navigation/steps.js +3 -0
- package/dist/components/navigation/tabs-items.d.ts +12 -0
- package/dist/components/navigation/tabs-items.js +3 -0
- package/dist/components/navigation/tabs.d.ts +12 -0
- package/dist/components/navigation/tabs.js +2 -0
- package/dist/components/query/index.d.ts +43 -0
- package/dist/components/query/index.js +8 -0
- package/dist/components/ui/index.d.ts +57 -0
- package/dist/components/ui/index.js +37 -0
- package/{src/props/vocabulary/content.prop.ts → dist/content.prop-D1Dd3TAc.d.ts} +16 -20
- package/dist/data-display.prop-DNTAzmDy.d.ts +58 -0
- package/dist/data-entry.prop-BEGA1lTq.d.ts +323 -0
- package/dist/data-table-D1u_rKLK.d.ts +83 -0
- package/dist/data.prop-BVvfKC_g.d.ts +41 -0
- package/dist/feedback.prop-BmxUlpAW.d.ts +64 -0
- package/dist/filter-bar-B7OGFO9S.d.ts +10 -0
- package/dist/form/index.d.ts +21 -0
- package/dist/form/index.js +4 -0
- package/dist/form.prop-BHgpuFFm.d.ts +41 -0
- package/dist/format-date-ByyZoqI5.d.ts +51 -0
- package/dist/general.prop-D7brMPNL.d.ts +16 -0
- package/dist/i18n/index.d.ts +217 -0
- package/dist/i18n/index.js +2 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.js +39 -0
- package/dist/inline-C5u6ptJV.d.ts +10 -0
- package/dist/interaction.prop-Cdn7wOtq.d.ts +25 -0
- package/{src/props/vocabulary/layout.prop.ts → dist/layout.prop-4TCNvyQZ.d.ts} +9 -14
- package/dist/layout.prop-C795F0qg.d.ts +112 -0
- package/dist/lib/datetime/index.d.ts +31 -0
- package/dist/lib/datetime/index.js +1 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +1 -0
- package/dist/navigation.prop-DpZqcXey.d.ts +78 -0
- package/dist/navigation.prop-DxBiClEH.d.ts +20 -0
- package/dist/props/components/index.d.ts +27 -0
- package/dist/props/components/index.js +1 -0
- package/dist/props/index.d.ts +28 -0
- package/dist/props/index.js +3 -0
- package/dist/props/registry.d.ts +649 -0
- package/dist/props/registry.js +1 -0
- package/dist/props/vocabulary/index.d.ts +7 -0
- package/dist/props/vocabulary/index.js +1 -0
- package/dist/query.prop-hIPrk2zI.d.ts +71 -0
- package/dist/search-input-uP01rY1L.d.ts +22 -0
- package/dist/shared.prop-BNRJc9K0.d.ts +45 -0
- package/dist/types-mvzYGrma.d.ts +37 -0
- package/dist/use-toast-Dol5bdY3.d.ts +34 -0
- package/package.json +233 -67
- package/src/app/__tests__/app-provider.test.tsx +0 -232
- package/src/app/__tests__/date-format-labels.test.ts +0 -36
- package/src/app/__tests__/date-formats.test.ts +0 -44
- package/src/app/__tests__/timezones.test.ts +0 -65
- package/src/app/app-provider.tsx +0 -227
- package/src/app/date-format-labels.ts +0 -21
- package/src/app/date-formats.ts +0 -30
- package/src/app/index.ts +0 -40
- package/src/app/locales.ts +0 -32
- package/src/app/request-headers.ts +0 -31
- package/src/app/storage.ts +0 -44
- package/src/app/time-format-labels.ts +0 -19
- package/src/app/time-formats.ts +0 -15
- package/src/app/timezones.ts +0 -208
- package/src/app/types.ts +0 -39
- package/src/app/use-formatting.ts +0 -47
- package/src/components/__tests__/accessibility-primitives.test.tsx +0 -65
- package/src/components/__tests__/docs-parity.test.ts +0 -41
- package/src/components/__tests__/shadcn-release-guardrails.test.ts +0 -71
- package/src/components/__tests__/theme-axes-integration.test.tsx +0 -242
- package/src/components/admin/index.ts +0 -76
- package/src/components/data-display/__tests__/card-table.test.tsx +0 -328
- package/src/components/data-display/__tests__/data-display.test.tsx +0 -73
- package/src/components/data-display/__tests__/data-table.test.tsx +0 -84
- package/src/components/data-display/__tests__/popover.test.tsx +0 -92
- package/src/components/data-display/__tests__/scroll-area-collapsible.test.tsx +0 -66
- package/src/components/data-display/badge.tsx +0 -27
- package/src/components/data-display/card.tsx +0 -194
- package/src/components/data-display/code-badge.tsx +0 -28
- package/src/components/data-display/collapsible.tsx +0 -5
- package/src/components/data-display/data-table.tsx +0 -476
- package/src/components/data-display/empty-state.tsx +0 -22
- package/src/components/data-display/index.ts +0 -41
- package/src/components/data-display/key-value-grid.tsx +0 -46
- package/src/components/data-display/popover.tsx +0 -62
- package/src/components/data-display/progress-meter.tsx +0 -20
- package/src/components/data-display/scan-panel.tsx +0 -16
- package/src/components/data-display/scroll-area.tsx +0 -42
- package/src/components/data-display/status-badge.tsx +0 -83
- package/src/components/data-display/table.tsx +0 -59
- package/src/components/data-display/timeline.tsx +0 -42
- package/src/components/data-display/tree-list.tsx +0 -42
- package/src/components/data-entry/__fixtures__/tree-options.ts +0 -80
- package/src/components/data-entry/__tests__/cascader-tree-transfer.test.tsx +0 -417
- package/src/components/data-entry/__tests__/checkbox-group.test.tsx +0 -40
- package/src/components/data-entry/__tests__/checkbox.test.tsx +0 -20
- package/src/components/data-entry/__tests__/date-autocomplete.test.tsx +0 -94
- package/src/components/data-entry/__tests__/form-field.test.tsx +0 -49
- package/src/components/data-entry/__tests__/input-textarea.test.tsx +0 -38
- package/src/components/data-entry/__tests__/label-select.test.tsx +0 -62
- package/src/components/data-entry/__tests__/pickers.test.tsx +0 -74
- package/src/components/data-entry/__tests__/radio.test.tsx +0 -46
- package/src/components/data-entry/__tests__/search-input.test.tsx +0 -32
- package/src/components/data-entry/__tests__/switch-field.test.tsx +0 -52
- package/src/components/data-entry/__tests__/upload.test.tsx +0 -125
- package/src/components/data-entry/autocomplete.tsx +0 -91
- package/src/components/data-entry/cascader.tsx +0 -305
- package/src/components/data-entry/checkbox-group.tsx +0 -90
- package/src/components/data-entry/checkbox.tsx +0 -30
- package/src/components/data-entry/choice-field.tsx +0 -27
- package/src/components/data-entry/choice-option.ts +0 -20
- package/src/components/data-entry/color-picker.tsx +0 -75
- package/src/components/data-entry/command.tsx +0 -56
- package/src/components/data-entry/country-select.tsx +0 -88
- package/src/components/data-entry/date-picker.tsx +0 -69
- package/src/components/data-entry/date-range-picker.tsx +0 -75
- package/src/components/data-entry/form-field.tsx +0 -59
- package/src/components/data-entry/index.ts +0 -62
- package/src/components/data-entry/label.tsx +0 -25
- package/src/components/data-entry/radio.tsx +0 -109
- package/src/components/data-entry/search-input.tsx +0 -103
- package/src/components/data-entry/select.tsx +0 -149
- package/src/components/data-entry/slider.tsx +0 -38
- package/src/components/data-entry/switch-field.tsx +0 -91
- package/src/components/data-entry/switch.tsx +0 -24
- package/src/components/data-entry/textarea.tsx +0 -12
- package/src/components/data-entry/time-picker.tsx +0 -214
- package/src/components/data-entry/transfer.tsx +0 -231
- package/src/components/data-entry/tree-select-strategy.ts +0 -6
- package/src/components/data-entry/tree-select.tsx +0 -279
- package/src/components/data-entry/tree-utils.ts +0 -221
- package/src/components/data-entry/upload-crop-dialog.tsx +0 -109
- package/src/components/data-entry/upload-types.ts +0 -86
- package/src/components/data-entry/upload.tsx +0 -498
- package/src/components/data-entry/use-upload-draft.ts +0 -93
- package/src/components/feedback/__tests__/alert.test.tsx +0 -127
- package/src/components/feedback/__tests__/dialog.test.tsx +0 -290
- package/src/components/feedback/__tests__/sheet.test.tsx +0 -94
- package/src/components/feedback/__tests__/skeleton.test.tsx +0 -25
- package/src/components/feedback/__tests__/toast.test.tsx +0 -52
- package/src/components/feedback/alert.tsx +0 -167
- package/src/components/feedback/dialog.tsx +0 -325
- package/src/components/feedback/index.ts +0 -53
- package/src/components/feedback/sheet.tsx +0 -130
- package/src/components/feedback/skeleton.tsx +0 -95
- package/src/components/feedback/sonner.tsx +0 -54
- package/src/components/feedback/toaster.tsx +0 -1
- package/src/components/feedback/use-toast.ts +0 -62
- package/src/components/general/__tests__/button.test.tsx +0 -71
- package/src/components/general/button.tsx +0 -61
- package/src/components/general/index.ts +0 -2
- package/src/components/layout/__tests__/page-container.test.tsx +0 -69
- package/src/components/layout/__tests__/page-inset.test.tsx +0 -14
- package/src/components/layout/__tests__/stack-inline.test.tsx +0 -39
- package/src/components/layout/app-shell.tsx +0 -42
- package/src/components/layout/breadcrumb.tsx +0 -35
- package/src/components/layout/index.ts +0 -31
- package/src/components/layout/inline.tsx +0 -13
- package/src/components/layout/menu.tsx +0 -34
- package/src/components/layout/mobile-frame.tsx +0 -57
- package/src/components/layout/page-container.tsx +0 -81
- package/src/components/layout/page-inset.tsx +0 -16
- package/src/components/layout/responsive-grid.tsx +0 -14
- package/src/components/layout/shell-app.tsx +0 -30
- package/src/components/layout/sidebar.tsx +0 -98
- package/src/components/layout/split-pane.tsx +0 -16
- package/src/components/layout/stack.tsx +0 -13
- package/src/components/layout/topbar.tsx +0 -108
- package/src/components/navigation/__tests__/app-pickers.test.tsx +0 -118
- package/src/components/navigation/__tests__/dropdown-menu.test.tsx +0 -104
- package/src/components/navigation/__tests__/navigation.test.tsx +0 -61
- package/src/components/navigation/__tests__/pagination-steps-tabs.test.tsx +0 -76
- package/src/components/navigation/date-format-picker.tsx +0 -55
- package/src/components/navigation/dropdown-menu.tsx +0 -190
- package/src/components/navigation/filter-bar.tsx +0 -38
- package/src/components/navigation/index.ts +0 -28
- package/src/components/navigation/locale-picker.tsx +0 -49
- package/src/components/navigation/page-header.tsx +0 -50
- package/src/components/navigation/pagination-utils.ts +0 -35
- package/src/components/navigation/pagination.tsx +0 -168
- package/src/components/navigation/steps.tsx +0 -163
- package/src/components/navigation/tabs-items.tsx +0 -69
- package/src/components/navigation/time-format-picker.tsx +0 -55
- package/src/components/navigation/timezone-picker.tsx +0 -63
- package/src/components/query/__tests__/data-state.test.tsx +0 -214
- package/src/components/query/__tests__/infinite-prefetch.test.tsx +0 -105
- package/src/components/query/__tests__/query-helpers.test.tsx +0 -61
- package/src/components/query/data-state.tsx +0 -58
- package/src/components/query/index.ts +0 -10
- package/src/components/query/infinite-query-state.tsx +0 -99
- package/src/components/query/mutation-feedback.tsx +0 -31
- package/src/components/query/prefetch-link.tsx +0 -45
- package/src/components/query/query-refetch-button.tsx +0 -41
- package/src/components/ui/alert-dialog.tsx +0 -1
- package/src/components/ui/alert.tsx +0 -1
- package/src/components/ui/autocomplete.tsx +0 -1
- package/src/components/ui/badge.tsx +0 -1
- package/src/components/ui/button.tsx +0 -1
- package/src/components/ui/calendar.tsx +0 -1
- package/src/components/ui/card.tsx +0 -1
- package/src/components/ui/checkbox.tsx +0 -1
- package/src/components/ui/color-picker.tsx +0 -1
- package/src/components/ui/command.tsx +0 -1
- package/src/components/ui/date-picker.tsx +0 -1
- package/src/components/ui/date-range-picker.tsx +0 -1
- package/src/components/ui/dialog.tsx +0 -1
- package/src/components/ui/dropdown-menu.tsx +0 -1
- package/src/components/ui/index.tsx +0 -31
- package/src/components/ui/input.tsx +0 -1
- package/src/components/ui/label.tsx +0 -1
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +0 -1
- package/src/components/ui/radio.tsx +0 -1
- package/src/components/ui/scroll-area.tsx +0 -1
- package/src/components/ui/select.tsx +0 -1
- package/src/components/ui/sheet.tsx +0 -1
- package/src/components/ui/slider.tsx +0 -1
- package/src/components/ui/sonner.tsx +0 -1
- package/src/components/ui/switch.tsx +0 -1
- package/src/components/ui/table.tsx +0 -1
- package/src/components/ui/tabs-items.tsx +0 -1
- package/src/components/ui/tabs.tsx +0 -1
- package/src/components/ui/textarea.tsx +0 -1
- package/src/components/ui/time-picker.tsx +0 -1
- package/src/components/ui/upload.tsx +0 -1
- package/src/form/__tests__/use-zod-form.test.tsx +0 -97
- package/src/form/form-field-control.tsx +0 -44
- package/src/form/form-root.tsx +0 -29
- package/src/form/index.ts +0 -7
- package/src/form/use-zod-form.ts +0 -29
- package/src/i18n/__tests__/translate.test.ts +0 -23
- package/src/i18n/index.ts +0 -9
- package/src/i18n/messages/en.json +0 -171
- package/src/i18n/messages/ja.json +0 -171
- package/src/i18n/messages/vi.json +0 -171
- package/src/i18n/translate.ts +0 -74
- package/src/i18n/use-translation.ts +0 -53
- package/src/index.ts +0 -3
- package/src/lib/__tests__/control-styles.test.ts +0 -78
- package/src/lib/__tests__/datetime.test.ts +0 -77
- package/src/lib/__tests__/format-date.test.ts +0 -97
- package/src/lib/__tests__/format.test.ts +0 -62
- package/src/lib/__tests__/theme-tokens-audit.test.ts +0 -176
- package/src/lib/__tests__/theme-tokens-css.test.ts +0 -118
- package/src/lib/__tests__/token-governance.test.ts +0 -191
- package/src/lib/__tests__/variants.test.ts +0 -18
- package/src/lib/control-styles.ts +0 -33
- package/src/lib/datetime/detect.ts +0 -25
- package/src/lib/datetime/format-date.ts +0 -100
- package/src/lib/datetime/format.ts +0 -140
- package/src/lib/datetime/index.ts +0 -25
- package/src/lib/datetime/parse.ts +0 -51
- package/src/lib/datetime/sync.ts +0 -48
- package/src/lib/format.ts +0 -114
- package/src/lib/hooks.ts +0 -54
- package/src/lib/utils.ts +0 -6
- package/src/lib/variants.ts +0 -40
- package/src/props/components/app.prop.ts +0 -99
- package/src/props/components/data-display.prop.ts +0 -73
- package/src/props/components/data-entry.prop.ts +0 -334
- package/src/props/components/feedback.prop.ts +0 -80
- package/src/props/components/form.prop.ts +0 -46
- package/src/props/components/general.prop.ts +0 -18
- package/src/props/components/index.ts +0 -99
- package/src/props/components/layout.prop.ts +0 -130
- package/src/props/components/navigation.prop.ts +0 -88
- package/src/props/components/query.prop.ts +0 -94
- package/src/props/index.ts +0 -17
- package/src/props/vocabulary/data.prop.ts +0 -46
- package/src/props/vocabulary/index.ts +0 -73
- package/src/props/vocabulary/interaction.prop.ts +0 -42
- package/src/props/vocabulary/navigation.prop.ts +0 -19
- package/src/props/vocabulary/shared.prop.ts +0 -59
- package/src/test/__tests__/render-loop-guard.test.tsx +0 -38
- package/src/test/jest-dom.d.ts +0 -4
- package/src/test/render-loop-guard.tsx +0 -50
- package/src/test/render.tsx +0 -29
- package/src/test/theme-globals.test.ts +0 -77
- package/src/test/theme-globals.ts +0 -134
- package/src/test/theme-test-utils.tsx +0 -67
- /package/{src → dist}/styles/alert-layout.css +0 -0
- /package/{src → dist}/styles/badge-layout.css +0 -0
- /package/{src → dist}/styles/card-layout.css +0 -0
- /package/{src → dist}/styles/control.css +0 -0
- /package/{src → dist}/styles/data-display-layout.css +0 -0
- /package/{src → dist}/styles/density.css +0 -0
- /package/{src → dist}/styles/dialog-layout.css +0 -0
- /package/{src → dist}/styles/index.css +0 -0
- /package/{src → dist}/styles/layout.css +0 -0
- /package/{src → dist}/styles/shell-layout.css +0 -0
- /package/{src → dist}/styles/table-layout.css +0 -0
- /package/{src → dist}/theme/example.service.css +0 -0
- /package/{src → dist}/tokens/base.css +0 -0
- /package/{src → dist}/tokens/foundation.css +0 -0
- /package/{src → dist}/tokens/primitives/badge.css +0 -0
- /package/{src → dist}/tokens/primitives/card.css +0 -0
- /package/{src → dist}/tokens/primitives/control.css +0 -0
- /package/{src → dist}/tokens/primitives/feedback.css +0 -0
- /package/{src → dist}/tokens/primitives/layout.css +0 -0
- /package/{src → dist}/tokens/primitives/navigation.css +0 -0
- /package/{src → dist}/tokens/primitives/table.css +0 -0
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
import { ja as ja$1, enUS as enUS$1, vi as vi$1 } from 'date-fns/locale';
|
|
2
|
+
import { ja, enUS, vi } from 'react-day-picker/locale';
|
|
3
|
+
import { TZDate } from '@date-fns/tz';
|
|
4
|
+
import { parseISO, formatDistanceToNow, format } from 'date-fns';
|
|
5
|
+
|
|
6
|
+
// src/app/locales.ts
|
|
7
|
+
var APP_LOCALE_CONFIG = {
|
|
8
|
+
vi: { code: "vi", dateFns: vi$1, dayPicker: vi },
|
|
9
|
+
en: { code: "en", dateFns: enUS$1, dayPicker: enUS },
|
|
10
|
+
ja: { code: "ja", dateFns: ja$1, dayPicker: ja }
|
|
11
|
+
};
|
|
12
|
+
function isAppLocale(value) {
|
|
13
|
+
return value === "vi" || value === "en" || value === "ja";
|
|
14
|
+
}
|
|
15
|
+
function getDateFnsLocale(locale) {
|
|
16
|
+
return APP_LOCALE_CONFIG[locale].dateFns;
|
|
17
|
+
}
|
|
18
|
+
function getDayPickerLocale(locale) {
|
|
19
|
+
return APP_LOCALE_CONFIG[locale].dayPicker;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// src/app/time-formats.ts
|
|
23
|
+
var APP_TIME_FORMATS = ["24h", "12h"];
|
|
24
|
+
var APP_REQUEST_HEADER_TIME_FORMAT = "x-time-format";
|
|
25
|
+
function getTimePattern(timeFormat) {
|
|
26
|
+
return timeFormat === "24h" ? "HH:mm" : "h:mm a";
|
|
27
|
+
}
|
|
28
|
+
function isAppTimeFormat(value) {
|
|
29
|
+
return value === "24h" || value === "12h";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
// src/app/date-formats.ts
|
|
33
|
+
var APP_DATE_FORMATS = ["iso", "dmy", "mdy"];
|
|
34
|
+
var APP_REQUEST_HEADER_DATE_FORMAT = "x-date-format";
|
|
35
|
+
function getDatePattern(dateFormat) {
|
|
36
|
+
switch (dateFormat) {
|
|
37
|
+
case "dmy":
|
|
38
|
+
return "dd/MM/yyyy";
|
|
39
|
+
case "mdy":
|
|
40
|
+
return "MM/dd/yyyy";
|
|
41
|
+
case "iso":
|
|
42
|
+
default:
|
|
43
|
+
return "yyyy-MM-dd";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function getDateTimePattern(timeFormat, dateFormat) {
|
|
47
|
+
return `${getDatePattern(dateFormat)} ${getTimePattern(timeFormat)}`;
|
|
48
|
+
}
|
|
49
|
+
function isAppDateFormat(value) {
|
|
50
|
+
return value === "iso" || value === "dmy" || value === "mdy";
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// src/i18n/messages/en.json
|
|
54
|
+
var en_default = {
|
|
55
|
+
common: {
|
|
56
|
+
cancel: "Cancel",
|
|
57
|
+
continue: "Continue",
|
|
58
|
+
delete: "Delete",
|
|
59
|
+
error: "Something went wrong",
|
|
60
|
+
working: "Working\u2026",
|
|
61
|
+
retry: "Retry",
|
|
62
|
+
search: "Search",
|
|
63
|
+
clearSearch: "Clear search",
|
|
64
|
+
clearFilters: "Clear filters",
|
|
65
|
+
first: "First",
|
|
66
|
+
next: "Next \u2192",
|
|
67
|
+
selectedCount: "{count} selected",
|
|
68
|
+
typeToConfirm: "Type {phrase} to confirm"
|
|
69
|
+
},
|
|
70
|
+
dataEntry: {
|
|
71
|
+
datePicker: {
|
|
72
|
+
placeholder: "Select date"
|
|
73
|
+
},
|
|
74
|
+
dateRangePicker: {
|
|
75
|
+
placeholder: "Select date range"
|
|
76
|
+
},
|
|
77
|
+
timePicker: {
|
|
78
|
+
placeholder: "Select time",
|
|
79
|
+
hour: "Hour",
|
|
80
|
+
minute: "Minute",
|
|
81
|
+
typeLabel: "Type time HH:mm"
|
|
82
|
+
},
|
|
83
|
+
searchInput: {
|
|
84
|
+
placeholder: "Search\u2026"
|
|
85
|
+
},
|
|
86
|
+
autocomplete: {
|
|
87
|
+
placeholder: "Search or select\u2026",
|
|
88
|
+
empty: "No results found"
|
|
89
|
+
},
|
|
90
|
+
colorPicker: {
|
|
91
|
+
ariaLabel: "Pick color"
|
|
92
|
+
},
|
|
93
|
+
upload: {
|
|
94
|
+
dropzoneLabel: "Upload files",
|
|
95
|
+
dropzoneHint: "Drag and drop files here, or click to browse",
|
|
96
|
+
dropzoneMeta: "Uploads go to temp storage \u2014 promote on form save",
|
|
97
|
+
buttonLabel: "Choose file",
|
|
98
|
+
addImage: "Add image",
|
|
99
|
+
uploading: "Uploading\u2026",
|
|
100
|
+
pendingReplace: "New image",
|
|
101
|
+
pendingReplaceHint: "New image staged \u2014 save form to apply",
|
|
102
|
+
avatarLabel: "Profile photo",
|
|
103
|
+
change: "Change",
|
|
104
|
+
removeAvatar: "Remove photo",
|
|
105
|
+
markedForDelete: "Photo will be removed when you save",
|
|
106
|
+
undo: "Undo",
|
|
107
|
+
cropTitle: "Crop photo",
|
|
108
|
+
cropZoom: "Zoom",
|
|
109
|
+
cropConfirm: "Use photo"
|
|
110
|
+
},
|
|
111
|
+
cascader: {
|
|
112
|
+
placeholder: "Select\u2026",
|
|
113
|
+
searchPlaceholder: "Search\u2026",
|
|
114
|
+
empty: "No results"
|
|
115
|
+
},
|
|
116
|
+
treeSelect: {
|
|
117
|
+
placeholder: "Select\u2026",
|
|
118
|
+
searchPlaceholder: "Search\u2026",
|
|
119
|
+
empty: "No data",
|
|
120
|
+
expand: "Expand",
|
|
121
|
+
collapse: "Collapse"
|
|
122
|
+
},
|
|
123
|
+
transfer: {
|
|
124
|
+
source: "Source",
|
|
125
|
+
target: "Target",
|
|
126
|
+
searchPlaceholder: "Search\u2026",
|
|
127
|
+
empty: "No data",
|
|
128
|
+
moveRight: "Move to target",
|
|
129
|
+
moveLeft: "Move to source"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
feedback: {
|
|
133
|
+
errorPanel: {
|
|
134
|
+
title: "Couldn't load this section"
|
|
135
|
+
},
|
|
136
|
+
genericError: "Something went wrong. Please retry."
|
|
137
|
+
},
|
|
138
|
+
navigation: {
|
|
139
|
+
localePicker: {
|
|
140
|
+
ariaLabel: "Language"
|
|
141
|
+
},
|
|
142
|
+
timezonePicker: {
|
|
143
|
+
ariaLabel: "Timezone"
|
|
144
|
+
},
|
|
145
|
+
timeFormatPicker: {
|
|
146
|
+
ariaLabel: "Time format"
|
|
147
|
+
},
|
|
148
|
+
dateFormatPicker: {
|
|
149
|
+
ariaLabel: "Date format"
|
|
150
|
+
},
|
|
151
|
+
pagination: {
|
|
152
|
+
ariaLabel: "Pagination",
|
|
153
|
+
prev: "Previous page",
|
|
154
|
+
next: "Next page",
|
|
155
|
+
page: "Page {page}",
|
|
156
|
+
pageSize: "Page size",
|
|
157
|
+
pageSizeOption: "{size} / page",
|
|
158
|
+
total: "Total {total} items"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
locale: {
|
|
162
|
+
vi: "Ti\u1EBFng Vi\u1EC7t",
|
|
163
|
+
en: "English",
|
|
164
|
+
ja: "\u65E5\u672C\u8A9E"
|
|
165
|
+
},
|
|
166
|
+
timeFormat: {
|
|
167
|
+
"24h": "24-hour",
|
|
168
|
+
"12h": "12-hour (AM/PM)"
|
|
169
|
+
},
|
|
170
|
+
dateFormat: {
|
|
171
|
+
iso: "ISO (yyyy-MM-dd)",
|
|
172
|
+
dmy: "Day / Month / Year",
|
|
173
|
+
mdy: "Month / Day / Year"
|
|
174
|
+
},
|
|
175
|
+
timezone: {
|
|
176
|
+
"Asia/Ho_Chi_Minh": "Vietnam (Ho Chi Minh)",
|
|
177
|
+
"Asia/Tokyo": "Japan (Tokyo)",
|
|
178
|
+
"Asia/Bangkok": "Thailand (Bangkok)",
|
|
179
|
+
"Asia/Singapore": "Singapore",
|
|
180
|
+
"Asia/Seoul": "Korea (Seoul)",
|
|
181
|
+
"Asia/Shanghai": "China (Shanghai)",
|
|
182
|
+
"Asia/Taipei": "Taiwan (Taipei)",
|
|
183
|
+
"Asia/Hong_Kong": "Hong Kong",
|
|
184
|
+
UTC: "UTC",
|
|
185
|
+
"Europe/London": "UK (London)",
|
|
186
|
+
"America/Los_Angeles": "US (Los Angeles)",
|
|
187
|
+
"America/New_York": "US (New York)"
|
|
188
|
+
},
|
|
189
|
+
dataTable: {
|
|
190
|
+
selectAll: "Select all rows",
|
|
191
|
+
selectRow: "Select row {id}",
|
|
192
|
+
bulkActions: "Bulk actions",
|
|
193
|
+
densityCompact: "Compact",
|
|
194
|
+
densityComfortable: "Comfortable",
|
|
195
|
+
densitySwitch: "Switch to {density} density",
|
|
196
|
+
rowActions: "Row actions"
|
|
197
|
+
},
|
|
198
|
+
status: {
|
|
199
|
+
active: "Active",
|
|
200
|
+
completed: "Completed",
|
|
201
|
+
delivered: "Delivered",
|
|
202
|
+
done: "Done",
|
|
203
|
+
permanent: "Permanent",
|
|
204
|
+
succeeded: "Succeeded",
|
|
205
|
+
draft: "Draft",
|
|
206
|
+
pending: "Pending",
|
|
207
|
+
scheduled: "Scheduled",
|
|
208
|
+
sending: "Sending",
|
|
209
|
+
temporary: "Temporary",
|
|
210
|
+
bounced: "Bounced",
|
|
211
|
+
cancelled: "Cancelled",
|
|
212
|
+
deleted: "Deleted",
|
|
213
|
+
failed: "Failed",
|
|
214
|
+
private: "Private",
|
|
215
|
+
internal: "Internal",
|
|
216
|
+
public: "Public",
|
|
217
|
+
ASSIGNMENT_STATUS_ACTIVE: "Active",
|
|
218
|
+
ASSIGNMENT_STATUS_SUSPENDED: "Suspended",
|
|
219
|
+
ASSIGNMENT_STATUS_TERMINATED: "Terminated"
|
|
220
|
+
},
|
|
221
|
+
query: {
|
|
222
|
+
loadMore: "Load more"
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// src/i18n/messages/ja.json
|
|
227
|
+
var ja_default = {
|
|
228
|
+
common: {
|
|
229
|
+
cancel: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
230
|
+
continue: "\u7D9A\u884C",
|
|
231
|
+
delete: "\u524A\u9664",
|
|
232
|
+
error: "\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F",
|
|
233
|
+
working: "\u51E6\u7406\u4E2D\u2026",
|
|
234
|
+
retry: "\u518D\u8A66\u884C",
|
|
235
|
+
search: "\u691C\u7D22",
|
|
236
|
+
clearSearch: "\u691C\u7D22\u3092\u30AF\u30EA\u30A2",
|
|
237
|
+
clearFilters: "\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u30AF\u30EA\u30A2",
|
|
238
|
+
first: "\u6700\u521D",
|
|
239
|
+
next: "\u6B21\u3078 \u2192",
|
|
240
|
+
selectedCount: "{count} \u4EF6\u9078\u629E",
|
|
241
|
+
typeToConfirm: "\u78BA\u8A8D\u306E\u305F\u3081 {phrase} \u3068\u5165\u529B"
|
|
242
|
+
},
|
|
243
|
+
dataEntry: {
|
|
244
|
+
datePicker: {
|
|
245
|
+
placeholder: "\u65E5\u4ED8\u3092\u9078\u629E"
|
|
246
|
+
},
|
|
247
|
+
dateRangePicker: {
|
|
248
|
+
placeholder: "\u671F\u9593\u3092\u9078\u629E"
|
|
249
|
+
},
|
|
250
|
+
timePicker: {
|
|
251
|
+
placeholder: "\u6642\u523B\u3092\u9078\u629E",
|
|
252
|
+
hour: "\u6642",
|
|
253
|
+
minute: "\u5206",
|
|
254
|
+
typeLabel: "HH:mm \u3092\u5165\u529B"
|
|
255
|
+
},
|
|
256
|
+
searchInput: {
|
|
257
|
+
placeholder: "\u691C\u7D22\u2026"
|
|
258
|
+
},
|
|
259
|
+
autocomplete: {
|
|
260
|
+
placeholder: "\u691C\u7D22\u307E\u305F\u306F\u9078\u629E\u2026",
|
|
261
|
+
empty: "\u7D50\u679C\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093"
|
|
262
|
+
},
|
|
263
|
+
colorPicker: {
|
|
264
|
+
ariaLabel: "\u8272\u3092\u9078\u629E"
|
|
265
|
+
},
|
|
266
|
+
upload: {
|
|
267
|
+
dropzoneLabel: "\u30D5\u30A1\u30A4\u30EB\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9",
|
|
268
|
+
dropzoneHint: "\u3053\u3053\u306B\u30C9\u30E9\u30C3\u30B0\uFF06\u30C9\u30ED\u30C3\u30D7\u3001\u307E\u305F\u306F\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u9078\u629E",
|
|
269
|
+
dropzoneMeta: "\u4E00\u6642\u30B9\u30C8\u30EC\u30FC\u30B8\u306B\u4FDD\u5B58 \u2014 \u30D5\u30A9\u30FC\u30E0\u4FDD\u5B58\u6642\u306B promote",
|
|
270
|
+
buttonLabel: "\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E",
|
|
271
|
+
addImage: "\u753B\u50CF\u3092\u8FFD\u52A0",
|
|
272
|
+
uploading: "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u4E2D\u2026",
|
|
273
|
+
pendingReplace: "\u65B0\u3057\u3044\u753B\u50CF",
|
|
274
|
+
pendingReplaceHint: "\u65B0\u3057\u3044\u753B\u50CF\u3092\u4FDD\u7559\u4E2D \u2014 \u4FDD\u5B58\u3067\u53CD\u6620",
|
|
275
|
+
avatarLabel: "\u30D7\u30ED\u30D5\u30A3\u30FC\u30EB\u5199\u771F",
|
|
276
|
+
change: "\u5909\u66F4",
|
|
277
|
+
removeAvatar: "\u5199\u771F\u3092\u524A\u9664",
|
|
278
|
+
markedForDelete: "\u4FDD\u5B58\u6642\u306B\u5199\u771F\u304C\u524A\u9664\u3055\u308C\u307E\u3059",
|
|
279
|
+
undo: "\u5143\u306B\u623B\u3059",
|
|
280
|
+
cropTitle: "\u5199\u771F\u3092\u5207\u308A\u629C\u304D",
|
|
281
|
+
cropZoom: "\u30BA\u30FC\u30E0",
|
|
282
|
+
cropConfirm: "\u3053\u306E\u5199\u771F\u3092\u4F7F\u7528"
|
|
283
|
+
},
|
|
284
|
+
cascader: {
|
|
285
|
+
placeholder: "\u9078\u629E\u2026",
|
|
286
|
+
searchPlaceholder: "\u691C\u7D22\u2026",
|
|
287
|
+
empty: "\u7D50\u679C\u306A\u3057"
|
|
288
|
+
},
|
|
289
|
+
treeSelect: {
|
|
290
|
+
placeholder: "\u9078\u629E\u2026",
|
|
291
|
+
searchPlaceholder: "\u691C\u7D22\u2026",
|
|
292
|
+
empty: "\u30C7\u30FC\u30BF\u306A\u3057",
|
|
293
|
+
expand: "\u5C55\u958B",
|
|
294
|
+
collapse: "\u6298\u308A\u305F\u305F\u3080"
|
|
295
|
+
},
|
|
296
|
+
transfer: {
|
|
297
|
+
source: "\u30BD\u30FC\u30B9",
|
|
298
|
+
target: "\u30BF\u30FC\u30B2\u30C3\u30C8",
|
|
299
|
+
searchPlaceholder: "\u691C\u7D22\u2026",
|
|
300
|
+
empty: "\u30C7\u30FC\u30BF\u306A\u3057",
|
|
301
|
+
moveRight: "\u30BF\u30FC\u30B2\u30C3\u30C8\u3078\u79FB\u52D5",
|
|
302
|
+
moveLeft: "\u30BD\u30FC\u30B9\u3078\u623B\u3059"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
305
|
+
feedback: {
|
|
306
|
+
errorPanel: {
|
|
307
|
+
title: "\u3053\u306E\u30BB\u30AF\u30B7\u30E7\u30F3\u3092\u8AAD\u307F\u8FBC\u3081\u307E\u305B\u3093\u3067\u3057\u305F"
|
|
308
|
+
},
|
|
309
|
+
genericError: "\u554F\u984C\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002\u3082\u3046\u4E00\u5EA6\u304A\u8A66\u3057\u304F\u3060\u3055\u3044\u3002"
|
|
310
|
+
},
|
|
311
|
+
navigation: {
|
|
312
|
+
localePicker: {
|
|
313
|
+
ariaLabel: "\u8A00\u8A9E"
|
|
314
|
+
},
|
|
315
|
+
timezonePicker: {
|
|
316
|
+
ariaLabel: "\u30BF\u30A4\u30E0\u30BE\u30FC\u30F3"
|
|
317
|
+
},
|
|
318
|
+
timeFormatPicker: {
|
|
319
|
+
ariaLabel: "\u6642\u523B\u5F62\u5F0F"
|
|
320
|
+
},
|
|
321
|
+
dateFormatPicker: {
|
|
322
|
+
ariaLabel: "\u65E5\u4ED8\u5F62\u5F0F"
|
|
323
|
+
},
|
|
324
|
+
pagination: {
|
|
325
|
+
ariaLabel: "\u30DA\u30FC\u30B8\u30CD\u30FC\u30B7\u30E7\u30F3",
|
|
326
|
+
prev: "\u524D\u306E\u30DA\u30FC\u30B8",
|
|
327
|
+
next: "\u6B21\u306E\u30DA\u30FC\u30B8",
|
|
328
|
+
page: "\u30DA\u30FC\u30B8 {page}",
|
|
329
|
+
pageSize: "\u30DA\u30FC\u30B8\u30B5\u30A4\u30BA",
|
|
330
|
+
pageSizeOption: "{size} / \u30DA\u30FC\u30B8",
|
|
331
|
+
total: "\u5168 {total} \u4EF6"
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
locale: {
|
|
335
|
+
vi: "Ti\u1EBFng Vi\u1EC7t",
|
|
336
|
+
en: "English",
|
|
337
|
+
ja: "\u65E5\u672C\u8A9E"
|
|
338
|
+
},
|
|
339
|
+
timeFormat: {
|
|
340
|
+
"24h": "24\u6642\u9593",
|
|
341
|
+
"12h": "12\u6642\u9593 (\u5348\u524D/\u5348\u5F8C)"
|
|
342
|
+
},
|
|
343
|
+
dateFormat: {
|
|
344
|
+
iso: "YYYY-MM-DD\uFF08\u5E74-\u6708-\u65E5\uFF09",
|
|
345
|
+
dmy: "\u65E5/\u6708/\u5E74",
|
|
346
|
+
mdy: "\u6708/\u65E5/\u5E74"
|
|
347
|
+
},
|
|
348
|
+
timezone: {
|
|
349
|
+
"Asia/Ho_Chi_Minh": "\u30D9\u30C8\u30CA\u30E0\uFF08\u30DB\u30FC\u30C1\u30DF\u30F3\uFF09",
|
|
350
|
+
"Asia/Tokyo": "\u65E5\u672C\uFF08\u6771\u4EAC\uFF09",
|
|
351
|
+
"Asia/Bangkok": "\u30BF\u30A4\uFF08\u30D0\u30F3\u30B3\u30AF\uFF09",
|
|
352
|
+
"Asia/Singapore": "\u30B7\u30F3\u30AC\u30DD\u30FC\u30EB",
|
|
353
|
+
"Asia/Seoul": "\u97D3\u56FD\uFF08\u30BD\u30A6\u30EB\uFF09",
|
|
354
|
+
"Asia/Shanghai": "\u4E2D\u56FD\uFF08\u4E0A\u6D77\uFF09",
|
|
355
|
+
"Asia/Taipei": "\u53F0\u6E7E\uFF08\u53F0\u5317\uFF09",
|
|
356
|
+
"Asia/Hong_Kong": "\u9999\u6E2F",
|
|
357
|
+
UTC: "UTC",
|
|
358
|
+
"Europe/London": "\u82F1\u56FD\uFF08\u30ED\u30F3\u30C9\u30F3\uFF09",
|
|
359
|
+
"America/Los_Angeles": "\u7C73\u56FD\uFF08\u30ED\u30B5\u30F3\u30BC\u30EB\u30B9\uFF09",
|
|
360
|
+
"America/New_York": "\u7C73\u56FD\uFF08\u30CB\u30E5\u30FC\u30E8\u30FC\u30AF\uFF09"
|
|
361
|
+
},
|
|
362
|
+
dataTable: {
|
|
363
|
+
selectAll: "\u3059\u3079\u3066\u306E\u884C\u3092\u9078\u629E",
|
|
364
|
+
selectRow: "\u884C {id} \u3092\u9078\u629E",
|
|
365
|
+
bulkActions: "\u4E00\u62EC\u64CD\u4F5C",
|
|
366
|
+
densityCompact: "\u30B3\u30F3\u30D1\u30AF\u30C8",
|
|
367
|
+
densityComfortable: "\u5FEB\u9069",
|
|
368
|
+
densitySwitch: "{density} \u8868\u793A\u306B\u5207\u308A\u66FF\u3048",
|
|
369
|
+
rowActions: "\u884C\u306E\u64CD\u4F5C"
|
|
370
|
+
},
|
|
371
|
+
status: {
|
|
372
|
+
active: "\u6709\u52B9",
|
|
373
|
+
completed: "\u5B8C\u4E86",
|
|
374
|
+
delivered: "\u914D\u9054\u6E08\u307F",
|
|
375
|
+
done: "\u5B8C\u4E86",
|
|
376
|
+
permanent: "\u6C38\u4E45",
|
|
377
|
+
succeeded: "\u6210\u529F",
|
|
378
|
+
draft: "\u4E0B\u66F8\u304D",
|
|
379
|
+
pending: "\u4FDD\u7559",
|
|
380
|
+
scheduled: "\u4E88\u5B9A",
|
|
381
|
+
sending: "\u9001\u4FE1\u4E2D",
|
|
382
|
+
temporary: "\u4E00\u6642",
|
|
383
|
+
bounced: "\u30D0\u30A6\u30F3\u30B9",
|
|
384
|
+
cancelled: "\u30AD\u30E3\u30F3\u30BB\u30EB",
|
|
385
|
+
deleted: "\u524A\u9664\u6E08\u307F",
|
|
386
|
+
failed: "\u5931\u6557",
|
|
387
|
+
private: "\u975E\u516C\u958B",
|
|
388
|
+
internal: "\u5185\u90E8",
|
|
389
|
+
public: "\u516C\u958B",
|
|
390
|
+
ASSIGNMENT_STATUS_ACTIVE: "\u6709\u52B9",
|
|
391
|
+
ASSIGNMENT_STATUS_SUSPENDED: "\u505C\u6B62",
|
|
392
|
+
ASSIGNMENT_STATUS_TERMINATED: "\u7D42\u4E86"
|
|
393
|
+
},
|
|
394
|
+
query: {
|
|
395
|
+
loadMore: "\u3055\u3089\u306B\u8AAD\u307F\u8FBC\u3080"
|
|
396
|
+
}
|
|
397
|
+
};
|
|
398
|
+
|
|
399
|
+
// src/i18n/messages/vi.json
|
|
400
|
+
var vi_default = {
|
|
401
|
+
common: {
|
|
402
|
+
cancel: "H\u1EE7y",
|
|
403
|
+
continue: "Ti\u1EBFp t\u1EE5c",
|
|
404
|
+
delete: "X\xF3a",
|
|
405
|
+
error: "\u0110\xE3 x\u1EA3y ra l\u1ED7i",
|
|
406
|
+
working: "\u0110ang x\u1EED l\xFD\u2026",
|
|
407
|
+
retry: "Th\u1EED l\u1EA1i",
|
|
408
|
+
search: "T\xECm ki\u1EBFm",
|
|
409
|
+
clearSearch: "X\xF3a t\xECm ki\u1EBFm",
|
|
410
|
+
clearFilters: "X\xF3a b\u1ED9 l\u1ECDc",
|
|
411
|
+
first: "\u0110\u1EA7u",
|
|
412
|
+
next: "Ti\u1EBFp \u2192",
|
|
413
|
+
selectedCount: "{count} \u0111\xE3 ch\u1ECDn",
|
|
414
|
+
typeToConfirm: "Nh\u1EADp {phrase} \u0111\u1EC3 x\xE1c nh\u1EADn"
|
|
415
|
+
},
|
|
416
|
+
dataEntry: {
|
|
417
|
+
datePicker: {
|
|
418
|
+
placeholder: "Ch\u1ECDn ng\xE0y"
|
|
419
|
+
},
|
|
420
|
+
dateRangePicker: {
|
|
421
|
+
placeholder: "Ch\u1ECDn kho\u1EA3ng ng\xE0y"
|
|
422
|
+
},
|
|
423
|
+
timePicker: {
|
|
424
|
+
placeholder: "Ch\u1ECDn gi\u1EDD",
|
|
425
|
+
hour: "Gi\u1EDD",
|
|
426
|
+
minute: "Ph\xFAt",
|
|
427
|
+
typeLabel: "Nh\u1EADp gi\u1EDD HH:mm"
|
|
428
|
+
},
|
|
429
|
+
searchInput: {
|
|
430
|
+
placeholder: "T\xECm ki\u1EBFm\u2026"
|
|
431
|
+
},
|
|
432
|
+
autocomplete: {
|
|
433
|
+
placeholder: "T\xECm ho\u1EB7c ch\u1ECDn\u2026",
|
|
434
|
+
empty: "Kh\xF4ng t\xECm th\u1EA5y k\u1EBFt qu\u1EA3"
|
|
435
|
+
},
|
|
436
|
+
colorPicker: {
|
|
437
|
+
ariaLabel: "Ch\u1ECDn m\xE0u"
|
|
438
|
+
},
|
|
439
|
+
upload: {
|
|
440
|
+
dropzoneLabel: "T\u1EA3i file l\xEAn",
|
|
441
|
+
dropzoneHint: "K\xE9o th\u1EA3 file v\xE0o \u0111\xE2y, ho\u1EB7c b\u1EA5m \u0111\u1EC3 ch\u1ECDn",
|
|
442
|
+
dropzoneMeta: "Upload v\xE0o temp \u2014 promote khi l\u01B0u form",
|
|
443
|
+
buttonLabel: "Ch\u1ECDn file",
|
|
444
|
+
addImage: "Th\xEAm \u1EA3nh",
|
|
445
|
+
uploading: "\u0110ang t\u1EA3i l\xEAn\u2026",
|
|
446
|
+
pendingReplace: "\u1EA2nh m\u1EDBi",
|
|
447
|
+
pendingReplaceHint: "\u1EA2nh m\u1EDBi \u0111ang ch\u1EDD \u2014 l\u01B0u form \u0111\u1EC3 \xE1p d\u1EE5ng",
|
|
448
|
+
avatarLabel: "\u1EA2nh \u0111\u1EA1i di\u1EC7n",
|
|
449
|
+
change: "\u0110\u1ED5i",
|
|
450
|
+
removeAvatar: "X\xF3a \u1EA3nh",
|
|
451
|
+
markedForDelete: "\u1EA2nh s\u1EBD b\u1ECB x\xF3a khi b\u1EA1n l\u01B0u",
|
|
452
|
+
undo: "Ho\xE0n t\xE1c",
|
|
453
|
+
cropTitle: "C\u1EAFt \u1EA3nh",
|
|
454
|
+
cropZoom: "Thu ph\xF3ng",
|
|
455
|
+
cropConfirm: "D\xF9ng \u1EA3nh n\xE0y"
|
|
456
|
+
},
|
|
457
|
+
cascader: {
|
|
458
|
+
placeholder: "Ch\u1ECDn\u2026",
|
|
459
|
+
searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
|
|
460
|
+
empty: "Kh\xF4ng c\xF3 k\u1EBFt qu\u1EA3"
|
|
461
|
+
},
|
|
462
|
+
treeSelect: {
|
|
463
|
+
placeholder: "Ch\u1ECDn\u2026",
|
|
464
|
+
searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
|
|
465
|
+
empty: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",
|
|
466
|
+
expand: "M\u1EDF r\u1ED9ng",
|
|
467
|
+
collapse: "Thu g\u1ECDn"
|
|
468
|
+
},
|
|
469
|
+
transfer: {
|
|
470
|
+
source: "Ngu\u1ED3n",
|
|
471
|
+
target: "\u0110\xEDch",
|
|
472
|
+
searchPlaceholder: "T\xECm ki\u1EBFm\u2026",
|
|
473
|
+
empty: "Kh\xF4ng c\xF3 d\u1EEF li\u1EC7u",
|
|
474
|
+
moveRight: "Chuy\u1EC3n sang \u0111\xEDch",
|
|
475
|
+
moveLeft: "Chuy\u1EC3n v\u1EC1 ngu\u1ED3n"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
feedback: {
|
|
479
|
+
errorPanel: {
|
|
480
|
+
title: "Kh\xF4ng t\u1EA3i \u0111\u01B0\u1EE3c n\u1ED9i dung n\xE0y"
|
|
481
|
+
},
|
|
482
|
+
genericError: "\u0110\xE3 x\u1EA3y ra l\u1ED7i. Vui l\xF2ng th\u1EED l\u1EA1i."
|
|
483
|
+
},
|
|
484
|
+
navigation: {
|
|
485
|
+
localePicker: {
|
|
486
|
+
ariaLabel: "Ng\xF4n ng\u1EEF"
|
|
487
|
+
},
|
|
488
|
+
timezonePicker: {
|
|
489
|
+
ariaLabel: "M\xFAi gi\u1EDD"
|
|
490
|
+
},
|
|
491
|
+
timeFormatPicker: {
|
|
492
|
+
ariaLabel: "\u0110\u1ECBnh d\u1EA1ng gi\u1EDD"
|
|
493
|
+
},
|
|
494
|
+
dateFormatPicker: {
|
|
495
|
+
ariaLabel: "\u0110\u1ECBnh d\u1EA1ng ng\xE0y"
|
|
496
|
+
},
|
|
497
|
+
pagination: {
|
|
498
|
+
ariaLabel: "Ph\xE2n trang",
|
|
499
|
+
prev: "Trang tr\u01B0\u1EDBc",
|
|
500
|
+
next: "Trang sau",
|
|
501
|
+
page: "Trang {page}",
|
|
502
|
+
pageSize: "S\u1ED1 d\xF2ng m\u1ED7i trang",
|
|
503
|
+
pageSizeOption: "{size} / trang",
|
|
504
|
+
total: "T\u1ED5ng {total} m\u1EE5c"
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
locale: {
|
|
508
|
+
vi: "Ti\u1EBFng Vi\u1EC7t",
|
|
509
|
+
en: "English",
|
|
510
|
+
ja: "\u65E5\u672C\u8A9E"
|
|
511
|
+
},
|
|
512
|
+
timeFormat: {
|
|
513
|
+
"24h": "24 gi\u1EDD",
|
|
514
|
+
"12h": "12 gi\u1EDD (SA/CH)"
|
|
515
|
+
},
|
|
516
|
+
dateFormat: {
|
|
517
|
+
iso: "ISO (yyyy-MM-dd)",
|
|
518
|
+
dmy: "Ng\xE0y / Th\xE1ng / N\u0103m",
|
|
519
|
+
mdy: "Th\xE1ng / Ng\xE0y / N\u0103m"
|
|
520
|
+
},
|
|
521
|
+
timezone: {
|
|
522
|
+
"Asia/Ho_Chi_Minh": "Vi\u1EC7t Nam (HCM)",
|
|
523
|
+
"Asia/Tokyo": "Nh\u1EADt B\u1EA3n (Tokyo)",
|
|
524
|
+
"Asia/Bangkok": "Th\xE1i Lan (Bangkok)",
|
|
525
|
+
"Asia/Singapore": "Singapore",
|
|
526
|
+
"Asia/Seoul": "H\xE0n Qu\u1ED1c (Seoul)",
|
|
527
|
+
"Asia/Shanghai": "Trung Qu\u1ED1c (Shanghai)",
|
|
528
|
+
"Asia/Taipei": "\u0110\xE0i Loan (Taipei)",
|
|
529
|
+
"Asia/Hong_Kong": "H\u1ED3ng K\xF4ng",
|
|
530
|
+
UTC: "UTC",
|
|
531
|
+
"Europe/London": "Anh (London)",
|
|
532
|
+
"America/Los_Angeles": "M\u1EF9 (Los Angeles)",
|
|
533
|
+
"America/New_York": "M\u1EF9 (New York)"
|
|
534
|
+
},
|
|
535
|
+
dataTable: {
|
|
536
|
+
selectAll: "Ch\u1ECDn t\u1EA5t c\u1EA3 c\xE1c d\xF2ng",
|
|
537
|
+
selectRow: "Ch\u1ECDn d\xF2ng {id}",
|
|
538
|
+
bulkActions: "Thao t\xE1c h\xE0ng lo\u1EA1t",
|
|
539
|
+
densityCompact: "G\u1ECDn",
|
|
540
|
+
densityComfortable: "Tho\u1EA3i m\xE1i",
|
|
541
|
+
densitySwitch: "Chuy\u1EC3n sang m\u1EADt \u0111\u1ED9 {density}",
|
|
542
|
+
rowActions: "Thao t\xE1c d\xF2ng"
|
|
543
|
+
},
|
|
544
|
+
status: {
|
|
545
|
+
active: "\u0110ang ho\u1EA1t \u0111\u1ED9ng",
|
|
546
|
+
completed: "Ho\xE0n th\xE0nh",
|
|
547
|
+
delivered: "\u0110\xE3 giao",
|
|
548
|
+
done: "Xong",
|
|
549
|
+
permanent: "V\u0129nh vi\u1EC5n",
|
|
550
|
+
succeeded: "Th\xE0nh c\xF4ng",
|
|
551
|
+
draft: "Nh\xE1p",
|
|
552
|
+
pending: "Ch\u1EDD x\u1EED l\xFD",
|
|
553
|
+
scheduled: "\u0110\xE3 l\xEAn l\u1ECBch",
|
|
554
|
+
sending: "\u0110ang g\u1EEDi",
|
|
555
|
+
temporary: "T\u1EA1m th\u1EDDi",
|
|
556
|
+
bounced: "B\u1ECB tr\u1EA3 l\u1EA1i",
|
|
557
|
+
cancelled: "\u0110\xE3 h\u1EE7y",
|
|
558
|
+
deleted: "\u0110\xE3 x\xF3a",
|
|
559
|
+
failed: "Th\u1EA5t b\u1EA1i",
|
|
560
|
+
private: "Ri\xEAng t\u01B0",
|
|
561
|
+
internal: "N\u1ED9i b\u1ED9",
|
|
562
|
+
public: "C\xF4ng khai",
|
|
563
|
+
ASSIGNMENT_STATUS_ACTIVE: "\u0110ang ho\u1EA1t \u0111\u1ED9ng",
|
|
564
|
+
ASSIGNMENT_STATUS_SUSPENDED: "T\u1EA1m ng\u01B0ng",
|
|
565
|
+
ASSIGNMENT_STATUS_TERMINATED: "Ch\u1EA5m d\u1EE9t"
|
|
566
|
+
},
|
|
567
|
+
query: {
|
|
568
|
+
loadMore: "T\u1EA3i th\xEAm"
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
|
|
572
|
+
// src/i18n/translate.ts
|
|
573
|
+
var MESSAGE_CATALOG = {
|
|
574
|
+
vi: vi_default,
|
|
575
|
+
en: en_default,
|
|
576
|
+
ja: ja_default
|
|
577
|
+
};
|
|
578
|
+
function getNested(obj, path) {
|
|
579
|
+
const parts = path.split(".");
|
|
580
|
+
let current = obj;
|
|
581
|
+
for (const part of parts) {
|
|
582
|
+
if (current == null || typeof current !== "object") return void 0;
|
|
583
|
+
current = current[part];
|
|
584
|
+
}
|
|
585
|
+
return typeof current === "string" ? current : void 0;
|
|
586
|
+
}
|
|
587
|
+
function interpolate(template, params) {
|
|
588
|
+
if (!params) return template;
|
|
589
|
+
return Object.entries(params).reduce(
|
|
590
|
+
(text, [key, value]) => text.replaceAll(`{${key}}`, String(value)),
|
|
591
|
+
template
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
function translate(locale, fallbackLocale, key, params) {
|
|
595
|
+
const primary = getNested(MESSAGE_CATALOG[locale], key);
|
|
596
|
+
const fallback = getNested(MESSAGE_CATALOG[fallbackLocale], key);
|
|
597
|
+
const text = primary ?? fallback ?? key;
|
|
598
|
+
return interpolate(text, params);
|
|
599
|
+
}
|
|
600
|
+
function translateCurrent(key, params) {
|
|
601
|
+
return translate(getSyncedLocale(), getSyncedFallbackLocale(), key, params);
|
|
602
|
+
}
|
|
603
|
+
var syncedLocale = "vi";
|
|
604
|
+
var syncedFallbackLocale = "en";
|
|
605
|
+
function syncI18nLocale(locale, fallbackLocale) {
|
|
606
|
+
syncedLocale = locale;
|
|
607
|
+
syncedFallbackLocale = fallbackLocale;
|
|
608
|
+
}
|
|
609
|
+
function getSyncedLocale() {
|
|
610
|
+
return syncedLocale;
|
|
611
|
+
}
|
|
612
|
+
function getSyncedFallbackLocale() {
|
|
613
|
+
return syncedFallbackLocale;
|
|
614
|
+
}
|
|
615
|
+
function resetI18nLocale() {
|
|
616
|
+
syncedLocale = "vi";
|
|
617
|
+
syncedFallbackLocale = "en";
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
// src/app/date-format-labels.ts
|
|
621
|
+
var APP_DATE_FORMAT_OPTIONS = APP_DATE_FORMATS.map((value) => ({ value }));
|
|
622
|
+
function getDateFormatLabel(dateFormat, locale, fallbackLocale = "en") {
|
|
623
|
+
return translate(locale, fallbackLocale, `dateFormat.${dateFormat}`);
|
|
624
|
+
}
|
|
625
|
+
function resolveDefaultDateFormat(locale) {
|
|
626
|
+
if (locale === "en") return "mdy";
|
|
627
|
+
if (locale === "ja") return "iso";
|
|
628
|
+
return "dmy";
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
// src/lib/datetime/sync.ts
|
|
632
|
+
var DEFAULT_LOCALE = "vi";
|
|
633
|
+
var defaultContext = () => ({
|
|
634
|
+
locale: DEFAULT_LOCALE,
|
|
635
|
+
dateFnsLocale: getDateFnsLocale(DEFAULT_LOCALE),
|
|
636
|
+
timezone: "Asia/Ho_Chi_Minh",
|
|
637
|
+
timeFormat: "24h",
|
|
638
|
+
dateFormat: resolveDefaultDateFormat(DEFAULT_LOCALE)
|
|
639
|
+
});
|
|
640
|
+
var syncedContext = defaultContext();
|
|
641
|
+
function syncDatetimeContext(partial) {
|
|
642
|
+
syncedContext = {
|
|
643
|
+
locale: partial.locale,
|
|
644
|
+
timezone: partial.timezone,
|
|
645
|
+
timeFormat: partial.timeFormat,
|
|
646
|
+
dateFormat: partial.dateFormat,
|
|
647
|
+
dateFnsLocale: partial.dateFnsLocale ?? getDateFnsLocale(partial.locale)
|
|
648
|
+
};
|
|
649
|
+
}
|
|
650
|
+
function getDatetimeContext() {
|
|
651
|
+
return syncedContext;
|
|
652
|
+
}
|
|
653
|
+
function resetDatetimeContextForTests() {
|
|
654
|
+
syncedContext = defaultContext();
|
|
655
|
+
}
|
|
656
|
+
|
|
657
|
+
// src/lib/datetime/detect.ts
|
|
658
|
+
var DATE_ONLY_RE = /^\d{4}-\d{2}-\d{2}$/;
|
|
659
|
+
function detectFormatDateKind(value) {
|
|
660
|
+
if (value instanceof Date) return "datetime";
|
|
661
|
+
const trimmed = value.trim();
|
|
662
|
+
if (isValidHhmm(trimmed)) return "time";
|
|
663
|
+
if (DATE_ONLY_RE.test(trimmed)) return "date";
|
|
664
|
+
return "datetime";
|
|
665
|
+
}
|
|
666
|
+
function isDateOnlyString(value) {
|
|
667
|
+
return DATE_ONLY_RE.test(value.trim());
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
// src/lib/datetime/parse.ts
|
|
671
|
+
function parseDateInput(value) {
|
|
672
|
+
if (value == null) return null;
|
|
673
|
+
if (value instanceof Date) return Number.isNaN(value.getTime()) ? null : value;
|
|
674
|
+
const trimmed = value.trim();
|
|
675
|
+
if (isDateOnlyString(trimmed)) {
|
|
676
|
+
const [year, month, day] = trimmed.split("-").map(Number);
|
|
677
|
+
return new Date(year, month - 1, day);
|
|
678
|
+
}
|
|
679
|
+
const parsed = parseISO(trimmed);
|
|
680
|
+
return Number.isNaN(parsed.getTime()) ? null : parsed;
|
|
681
|
+
}
|
|
682
|
+
function calendarDateToTZDate(date, timezone) {
|
|
683
|
+
return new TZDate(date.getFullYear(), date.getMonth(), date.getDate(), timezone);
|
|
684
|
+
}
|
|
685
|
+
var HHMM_RE = /^([01]?\d|2[0-3]):([0-5]\d)$/;
|
|
686
|
+
function isValidHhmm(value) {
|
|
687
|
+
return HHMM_RE.test(value.trim());
|
|
688
|
+
}
|
|
689
|
+
function normalizeHhmm(value) {
|
|
690
|
+
const trimmed = value.trim();
|
|
691
|
+
if (isValidHhmm(trimmed)) {
|
|
692
|
+
const [h, m] = trimmed.split(":");
|
|
693
|
+
return `${h.padStart(2, "0")}:${m}`;
|
|
694
|
+
}
|
|
695
|
+
const loose = /^(\d{1,2}):(\d{2})$/.exec(trimmed);
|
|
696
|
+
if (!loose) return null;
|
|
697
|
+
const hours = Number(loose[1]);
|
|
698
|
+
const minutes = Number(loose[2]);
|
|
699
|
+
if (hours > 23 || minutes > 59) return null;
|
|
700
|
+
return `${String(hours).padStart(2, "0")}:${String(minutes).padStart(2, "0")}`;
|
|
701
|
+
}
|
|
702
|
+
function hhmmToTZDate(hhmm, timezone) {
|
|
703
|
+
const normalized = normalizeHhmm(hhmm);
|
|
704
|
+
if (!normalized) return null;
|
|
705
|
+
const [h, m] = normalized.split(":").map(Number);
|
|
706
|
+
const today = TZDate.tz(timezone);
|
|
707
|
+
return new TZDate(today.getFullYear(), today.getMonth(), today.getDate(), h, m, 0, 0, timezone);
|
|
708
|
+
}
|
|
709
|
+
function resolveLocale(locale) {
|
|
710
|
+
if (!locale) return getDatetimeContext().dateFnsLocale;
|
|
711
|
+
if (typeof locale === "string") return getDateFnsLocale(locale);
|
|
712
|
+
return locale;
|
|
713
|
+
}
|
|
714
|
+
function resolveOptions(options) {
|
|
715
|
+
const ctx = getDatetimeContext();
|
|
716
|
+
return {
|
|
717
|
+
locale: resolveLocale(options?.locale),
|
|
718
|
+
timezone: options?.timezone ?? ctx.timezone,
|
|
719
|
+
timeFormat: options?.timeFormat ?? ctx.timeFormat,
|
|
720
|
+
dateFormat: options?.dateFormat ?? ctx.dateFormat
|
|
721
|
+
};
|
|
722
|
+
}
|
|
723
|
+
function formatTZDate(zoned, pattern, options) {
|
|
724
|
+
return format(zoned, pattern, { locale: options.locale });
|
|
725
|
+
}
|
|
726
|
+
function instantToTZDate(value, timezone) {
|
|
727
|
+
return new TZDate(value, timezone);
|
|
728
|
+
}
|
|
729
|
+
var EMPTY = "\u2014";
|
|
730
|
+
function formatCalendarDate(value, options) {
|
|
731
|
+
if (!value) return EMPTY;
|
|
732
|
+
const resolved = resolveOptions(options);
|
|
733
|
+
const zoned = calendarDateToTZDate(value, resolved.timezone);
|
|
734
|
+
return formatTZDate(zoned, getDatePattern(resolved.dateFormat), resolved);
|
|
735
|
+
}
|
|
736
|
+
function formatAppDate(value, options) {
|
|
737
|
+
const resolved = resolveOptions(options);
|
|
738
|
+
if (typeof value === "string" && isDateOnlyString(value)) {
|
|
739
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
740
|
+
const zoned2 = new TZDate(year, month - 1, day, resolved.timezone);
|
|
741
|
+
return formatTZDate(zoned2, getDatePattern(resolved.dateFormat), resolved);
|
|
742
|
+
}
|
|
743
|
+
const parsed = parseDateInput(value);
|
|
744
|
+
if (!parsed) return EMPTY;
|
|
745
|
+
const zoned = instantToTZDate(parsed, resolved.timezone);
|
|
746
|
+
return formatTZDate(zoned, getDatePattern(resolved.dateFormat), resolved);
|
|
747
|
+
}
|
|
748
|
+
function formatAppDateTime(value, options) {
|
|
749
|
+
const parsed = parseDateInput(value);
|
|
750
|
+
if (!parsed) return EMPTY;
|
|
751
|
+
const resolved = resolveOptions(options);
|
|
752
|
+
const zoned = instantToTZDate(parsed, resolved.timezone);
|
|
753
|
+
return formatTZDate(
|
|
754
|
+
zoned,
|
|
755
|
+
getDateTimePattern(resolved.timeFormat, resolved.dateFormat),
|
|
756
|
+
resolved
|
|
757
|
+
);
|
|
758
|
+
}
|
|
759
|
+
function formatAppTime(value, options) {
|
|
760
|
+
const parsed = parseDateInput(value);
|
|
761
|
+
if (!parsed) return EMPTY;
|
|
762
|
+
const resolved = resolveOptions(options);
|
|
763
|
+
const zoned = instantToTZDate(parsed, resolved.timezone);
|
|
764
|
+
return formatTZDate(zoned, getTimePattern(resolved.timeFormat), resolved);
|
|
765
|
+
}
|
|
766
|
+
function formatAppDateLong(value, options) {
|
|
767
|
+
const parsed = parseDateInput(value);
|
|
768
|
+
if (!parsed) return EMPTY;
|
|
769
|
+
const resolved = resolveOptions(options);
|
|
770
|
+
const zoned = instantToTZDate(parsed, resolved.timezone);
|
|
771
|
+
return formatTZDate(zoned, "PPP", resolved);
|
|
772
|
+
}
|
|
773
|
+
function formatAppRelative(value, options) {
|
|
774
|
+
const parsed = parseDateInput(value);
|
|
775
|
+
if (!parsed) return EMPTY;
|
|
776
|
+
const locale = resolveLocale(options?.locale);
|
|
777
|
+
return formatDistanceToNow(parsed, { addSuffix: true, locale });
|
|
778
|
+
}
|
|
779
|
+
function formatTimeOfDay(hhmm, options) {
|
|
780
|
+
if (!hhmm) return EMPTY;
|
|
781
|
+
const resolved = resolveOptions(options);
|
|
782
|
+
const zoned = hhmmToTZDate(hhmm, resolved.timezone);
|
|
783
|
+
if (!zoned) return hhmm;
|
|
784
|
+
return formatTZDate(zoned, getTimePattern(resolved.timeFormat), resolved);
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
// src/lib/datetime/format-date.ts
|
|
788
|
+
var EMPTY2 = "\u2014";
|
|
789
|
+
function resolveKind(value, options) {
|
|
790
|
+
if (options?.kind && options.kind !== "auto") return options.kind;
|
|
791
|
+
if (options?.calendar && value instanceof Date) return "calendar";
|
|
792
|
+
return detectFormatDateKind(value);
|
|
793
|
+
}
|
|
794
|
+
function formatDate(value, options) {
|
|
795
|
+
if (value == null || value === "") return EMPTY2;
|
|
796
|
+
if (typeof value === "string") {
|
|
797
|
+
const trimmed = value.trim();
|
|
798
|
+
if (!trimmed) return EMPTY2;
|
|
799
|
+
const kind2 = resolveKind(trimmed, options);
|
|
800
|
+
switch (kind2) {
|
|
801
|
+
case "time":
|
|
802
|
+
return isValidHhmm(trimmed) ? formatTimeOfDay(trimmed, options) : formatAppTime(trimmed, options);
|
|
803
|
+
case "date":
|
|
804
|
+
return formatAppDate(trimmed, options);
|
|
805
|
+
case "long":
|
|
806
|
+
return formatAppDateLong(trimmed, options);
|
|
807
|
+
case "relative":
|
|
808
|
+
return formatAppRelative(trimmed, options);
|
|
809
|
+
case "calendar":
|
|
810
|
+
case "datetime":
|
|
811
|
+
default:
|
|
812
|
+
return formatAppDateTime(trimmed, options);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
if (!(value instanceof Date) || Number.isNaN(value.getTime())) return EMPTY2;
|
|
816
|
+
const kind = resolveKind(value, options);
|
|
817
|
+
switch (kind) {
|
|
818
|
+
case "calendar":
|
|
819
|
+
return formatCalendarDate(value, options);
|
|
820
|
+
case "date":
|
|
821
|
+
return formatCalendarDate(value, options);
|
|
822
|
+
case "time":
|
|
823
|
+
return formatAppTime(value, options);
|
|
824
|
+
case "long":
|
|
825
|
+
return formatAppDateLong(value, options);
|
|
826
|
+
case "relative":
|
|
827
|
+
return formatAppRelative(value, options);
|
|
828
|
+
case "datetime":
|
|
829
|
+
default:
|
|
830
|
+
return formatAppDateTime(value, options);
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
function isFormatDateValue(value) {
|
|
834
|
+
if (value instanceof Date) return !Number.isNaN(value.getTime());
|
|
835
|
+
if (typeof value !== "string") return false;
|
|
836
|
+
const trimmed = value.trim();
|
|
837
|
+
if (!trimmed) return false;
|
|
838
|
+
if (isValidHhmm(trimmed)) return true;
|
|
839
|
+
return parseDateInput(trimmed) != null;
|
|
840
|
+
}
|
|
841
|
+
|
|
842
|
+
export { APP_DATE_FORMATS, APP_DATE_FORMAT_OPTIONS, APP_LOCALE_CONFIG, APP_REQUEST_HEADER_DATE_FORMAT, APP_REQUEST_HEADER_TIME_FORMAT, APP_TIME_FORMATS, MESSAGE_CATALOG, calendarDateToTZDate, detectFormatDateKind, formatAppDate, formatAppDateLong, formatAppDateTime, formatAppRelative, formatAppTime, formatCalendarDate, formatDate, formatTimeOfDay, getDateFnsLocale, getDateFormatLabel, getDatePattern, getDateTimePattern, getDatetimeContext, getDayPickerLocale, getTimePattern, hhmmToTZDate, isAppDateFormat, isAppLocale, isAppTimeFormat, isDateOnlyString, isFormatDateValue, isValidHhmm, normalizeHhmm, parseDateInput, resetDatetimeContextForTests, resetI18nLocale, resolveDefaultDateFormat, syncDatetimeContext, syncI18nLocale, translate, translateCurrent };
|