@kine-design/core 0.0.1-beta.1 → 0.0.1-beta.11
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/.vlaude/last-session-id +1 -0
- package/assets/style/global.css +1 -0
- package/assets/style/var/Wuxing.css +71 -0
- package/assets/style/var.css +23 -0
- package/components/base/affix/api.ts +16 -0
- package/components/base/affix/index.ts +17 -0
- package/components/base/affix/props.d.ts +34 -0
- package/components/base/affix/useAffix.ts +124 -0
- package/components/base/alert/api.ts +18 -0
- package/components/base/alert/index.ts +15 -0
- package/components/base/alert/props.d.ts +50 -0
- package/components/base/anchor/api.ts +20 -0
- package/components/base/anchor/index.ts +18 -0
- package/components/base/anchor/props.d.ts +46 -0
- package/components/base/anchor/useAnchor.ts +84 -0
- package/components/base/autoComplete/api.ts +24 -0
- package/components/base/autoComplete/index.ts +17 -0
- package/components/base/autoComplete/props.d.ts +75 -0
- package/components/base/autoComplete/useAutoComplete.ts +157 -0
- package/components/base/avatar/api.ts +17 -0
- package/components/base/avatar/avatar.css +61 -0
- package/components/base/avatar/index.ts +15 -0
- package/components/base/avatar/props.d.ts +37 -0
- package/components/base/backTop/api.ts +17 -0
- package/components/base/backTop/index.ts +17 -0
- package/components/base/backTop/props.d.ts +38 -0
- package/components/base/backTop/useBackTop.ts +62 -0
- package/components/base/badge/api.ts +22 -0
- package/components/base/badge/index.ts +15 -0
- package/components/base/badge/props.d.ts +50 -0
- package/components/base/button/api.ts +28 -0
- package/components/base/button/button.css +34 -0
- package/components/base/button/index.ts +17 -0
- package/components/base/button/props.d.ts +66 -0
- package/components/base/button/useButton.ts +37 -0
- package/components/base/card/api.ts +17 -0
- package/components/base/card/index.ts +15 -0
- package/components/base/card/props.d.ts +37 -0
- package/components/base/carousel/api.ts +28 -0
- package/components/base/carousel/index.ts +17 -0
- package/components/base/carousel/props.d.ts +72 -0
- package/components/base/carousel/useCarousel.ts +150 -0
- package/components/base/cascader/api.ts +23 -0
- package/components/base/cascader/index.ts +18 -0
- package/components/base/cascader/props.d.ts +103 -0
- package/components/base/cascader/useCascader.ts +335 -0
- package/components/base/checkbox/api.ts +24 -0
- package/components/base/checkbox/checkbox.css +0 -0
- package/components/base/checkbox/index.ts +17 -0
- package/components/base/checkbox/props.d.ts +77 -0
- package/components/base/checkbox/useCheckbox.ts +43 -0
- package/components/base/collapse/api.ts +21 -0
- package/components/base/collapse/index.ts +18 -0
- package/components/base/collapse/props.d.ts +45 -0
- package/components/base/collapse/useCollapse.ts +81 -0
- package/components/base/datePicker/__tests__/useDatePicker.test.ts +235 -0
- package/components/base/datePicker/api.ts +22 -0
- package/components/base/datePicker/index.ts +19 -0
- package/components/base/datePicker/props.d.ts +86 -0
- package/components/base/datePicker/useDatePicker.ts +375 -0
- package/components/base/divider/api.ts +15 -0
- package/components/base/divider/divider.css +11 -0
- package/components/base/divider/index.ts +15 -0
- package/components/base/divider/props.d.ts +30 -0
- package/components/base/dropdown/api.ts +33 -0
- package/components/base/dropdown/index.ts +18 -0
- package/components/base/dropdown/props.d.ts +60 -0
- package/components/base/dropdown/useDropdown.ts +124 -0
- package/components/base/empty/api.ts +15 -0
- package/components/base/empty/index.ts +15 -0
- package/components/base/empty/props.d.ts +26 -0
- package/components/base/image/__tests__/useImage.test.ts +176 -0
- package/components/base/image/api.ts +25 -0
- package/components/base/image/index.ts +18 -0
- package/components/base/image/props.d.ts +67 -0
- package/components/base/image/useImage.ts +119 -0
- package/components/base/input/api.ts +23 -0
- package/components/base/input/index.ts +17 -0
- package/components/base/input/input.css +19 -0
- package/components/base/input/props.d.ts +85 -0
- package/components/base/input/useInput.ts +63 -0
- package/components/base/inputNumber/__tests__/useInputNumber.test.ts +189 -0
- package/components/base/inputNumber/api.ts +23 -0
- package/components/base/inputNumber/index.ts +17 -0
- package/components/base/inputNumber/props.d.ts +78 -0
- package/components/base/inputNumber/useInputNumber.ts +182 -0
- package/components/base/li/api.ts +15 -0
- package/components/base/li/index.ts +15 -0
- package/components/base/li/props.d.ts +30 -0
- package/components/base/list/api.ts +16 -0
- package/components/base/list/index.ts +17 -0
- package/components/base/list/props.d.ts +33 -0
- package/components/base/list/useList.ts +36 -0
- package/components/base/loading/api.ts +17 -0
- package/components/base/loading/index.ts +15 -0
- package/components/base/loading/props.d.ts +40 -0
- package/components/base/popover/api.ts +28 -0
- package/components/base/popover/index.ts +17 -0
- package/components/base/popover/props.d.ts +73 -0
- package/components/base/popover/usePopover.ts +193 -0
- package/components/base/progress/api.ts +20 -0
- package/components/base/progress/index.ts +17 -0
- package/components/base/progress/props.d.ts +68 -0
- package/components/base/progress/useProgress.ts +28 -0
- package/components/base/radio/api.ts +19 -0
- package/components/base/radio/index.ts +19 -0
- package/components/base/radio/props.d.ts +59 -0
- package/components/base/radio/useRadio.ts +11 -0
- package/components/base/rate/api.ts +18 -0
- package/components/base/rate/index.ts +17 -0
- package/components/base/rate/props.d.ts +49 -0
- package/components/base/rate/useRate.ts +76 -0
- package/components/base/result/api.ts +20 -0
- package/components/base/result/index.ts +15 -0
- package/components/base/result/props.d.ts +36 -0
- package/components/base/select/api.ts +34 -0
- package/components/base/select/index.ts +18 -0
- package/components/base/select/props.d.ts +152 -0
- package/components/base/select/select.css +7 -0
- package/components/base/select/useSelect.ts +281 -0
- package/components/base/select/useSelectTools.ts +60 -0
- package/components/base/skeleton/api.ts +18 -0
- package/components/base/skeleton/index.ts +15 -0
- package/components/base/skeleton/props.d.ts +41 -0
- package/components/base/slider/api.ts +22 -0
- package/components/base/slider/index.ts +17 -0
- package/components/base/slider/props.d.ts +79 -0
- package/components/base/slider/useSlider.ts +87 -0
- package/components/base/space/api.ts +17 -0
- package/components/base/space/index.ts +15 -0
- package/components/base/space/props.d.ts +39 -0
- package/components/base/steps/__tests__/useSteps.test.ts +46 -0
- package/components/base/steps/api.ts +30 -0
- package/components/base/steps/index.ts +22 -0
- package/components/base/steps/props.d.ts +88 -0
- package/components/base/steps/useSteps.ts +101 -0
- package/components/base/switch/api.ts +22 -0
- package/components/base/switch/index.ts +19 -0
- package/components/base/switch/props.d.ts +66 -0
- package/components/base/switch/useSwitch.tsx +80 -0
- package/components/base/tabs/api.ts +23 -0
- package/components/base/tabs/index.ts +18 -0
- package/components/base/tabs/props.d.ts +41 -0
- package/components/base/tabs/useTabs.ts +67 -0
- package/components/base/tag/api.ts +17 -0
- package/components/base/tag/index.ts +15 -0
- package/components/base/tag/props.d.ts +51 -0
- package/components/base/timePicker/__tests__/useTimePicker.test.ts +125 -0
- package/components/base/timePicker/api.ts +24 -0
- package/components/base/timePicker/index.ts +18 -0
- package/components/base/timePicker/props.d.ts +86 -0
- package/components/base/timePicker/useTimePicker.ts +161 -0
- package/components/base/timeline/api.ts +24 -0
- package/components/base/timeline/index.ts +16 -0
- package/components/base/timeline/props.d.ts +60 -0
- package/components/base/tooltip/api.ts +20 -0
- package/components/base/tooltip/index.ts +17 -0
- package/components/base/tooltip/props.d.ts +40 -0
- package/components/base/tooltip/useTooltip.ts +89 -0
- package/components/base/transfer/api.ts +18 -0
- package/components/base/transfer/index.ts +17 -0
- package/components/base/transfer/props.d.ts +63 -0
- package/components/base/transfer/useTransfer.ts +208 -0
- package/components/base/tree/__tests__/tree.test.ts +223 -0
- package/components/base/tree/api.ts +47 -0
- package/components/base/tree/index.ts +29 -0
- package/components/base/tree/props.d.ts +108 -0
- package/components/base/tree/tree.ts +263 -0
- package/components/base/tree/useTree.ts +114 -0
- package/components/message/confirm/api.ts +21 -0
- package/components/message/confirm/index.ts +15 -0
- package/components/message/confirm/props.d.ts +69 -0
- package/components/message/dialog/api.ts +20 -0
- package/components/message/dialog/index.ts +15 -0
- package/components/message/dialog/props.d.ts +62 -0
- package/components/message/drawer/api.ts +33 -0
- package/components/message/drawer/index.ts +15 -0
- package/components/message/drawer/props.d.ts +80 -0
- package/components/message/message/api.ts +27 -0
- package/components/message/message/index.ts +20 -0
- package/components/message/message/props.d.ts +54 -0
- package/components/message/message/useMessage.ts +61 -0
- package/components/message/notification/__tests__/useNotification.test.ts +129 -0
- package/components/message/notification/api.ts +23 -0
- package/components/message/notification/index.ts +19 -0
- package/components/message/notification/props.d.ts +64 -0
- package/components/message/notification/useNotification.ts +79 -0
- package/components/message/popover/MPopover.tsx +94 -0
- package/components/message/popover/api.ts +54 -0
- package/components/message/popover/index.ts +17 -0
- package/components/message/popover/popover.css +21 -0
- package/components/message/popover/props.d.ts +76 -0
- package/components/message/popover/usePopover.ts +234 -0
- package/components/other/darkMode/api.ts +17 -0
- package/components/other/darkMode/index.ts +17 -0
- package/components/other/darkMode/props.d.ts +37 -0
- package/components/other/darkMode/useDarkMode.ts +129 -0
- package/components/template/border/api.ts +18 -0
- package/components/template/border/index.ts +15 -0
- package/components/template/border/props.d.ts +41 -0
- package/components/template/breadcrumb/api.ts +15 -0
- package/components/template/breadcrumb/index.ts +15 -0
- package/components/template/breadcrumb/props.d.ts +45 -0
- package/components/template/descriptions/api.ts +23 -0
- package/components/template/descriptions/index.ts +16 -0
- package/components/template/descriptions/props.d.ts +54 -0
- package/components/template/form/api.ts +23 -0
- package/components/template/form/index.ts +20 -0
- package/components/template/form/props.d.ts +60 -0
- package/components/template/grid/api.ts +20 -0
- package/components/template/grid/index.ts +15 -0
- package/components/template/grid/props.d.ts +48 -0
- package/components/template/menu/__tests__/useMenu.test.ts +157 -0
- package/components/template/menu/api.ts +26 -0
- package/components/template/menu/index.ts +18 -0
- package/components/template/menu/props.d.ts +93 -0
- package/components/template/menu/useMenu.ts +155 -0
- package/components/template/pagination/__tests__/usePagination.test.ts +138 -0
- package/components/template/pagination/api.ts +22 -0
- package/components/template/pagination/index.ts +19 -0
- package/components/template/pagination/props.d.ts +65 -0
- package/components/template/pagination/usePagination.ts +186 -0
- package/components/template/table/__tests__/useTable.test.ts +138 -0
- package/components/template/table/api.ts +18 -0
- package/components/template/table/index.ts +18 -0
- package/components/template/table/props.d.ts +36 -0
- package/components/template/table/useTable.ts +136 -0
- package/components/template/tableColumn/api.ts +17 -0
- package/components/template/tableColumn/index.ts +15 -0
- package/components/template/tableColumn/props.d.ts +32 -0
- package/components/template/virtualList/api.ts +16 -0
- package/components/template/virtualList/index.ts +17 -0
- package/components/template/virtualList/props.d.ts +25 -0
- package/components/template/virtualList/useVirtualList.ts +237 -0
- package/components/types/hook.d.ts +24 -0
- package/components/types/props.d.ts +57 -0
- package/components/types/template.d.ts +59 -0
- package/compositions/common/__tests__/useDebounceFn.test.ts +62 -0
- package/compositions/common/__tests__/useEventListener.test.ts +98 -0
- package/compositions/common/__tests__/usePopover.test.ts +43 -0
- package/compositions/common/__tests__/useTeleport.test.ts +32 -0
- package/compositions/common/defineCore.ts +55 -0
- package/compositions/common/testAnchor.ts +211 -0
- package/compositions/common/useComponentSize.ts +17 -0
- package/compositions/common/useDebounceFn.ts +27 -0
- package/compositions/common/useDrag.ts +65 -0
- package/compositions/common/useElementSize.ts +37 -0
- package/compositions/common/useEventListener.ts +48 -0
- package/compositions/common/useLocale.ts +53 -0
- package/compositions/common/usePopover.ts +45 -0
- package/compositions/common/useResizeObserver.ts +47 -0
- package/compositions/common/useTeleport.ts +24 -0
- package/compositions/input/__tests__/useBooleanInput.test.ts +73 -0
- package/compositions/input/useBooleanInput.ts +52 -0
- package/compositions/modal/__tests__/useModal.test.ts +110 -0
- package/compositions/modal/useModal.ts +72 -0
- package/compositions/popper/useClickAway.ts +41 -0
- package/compositions/popper/usePopper.ts +63 -0
- package/compositions/utils/__tests__/filters.test.ts +136 -0
- package/compositions/utils/filters.ts +135 -0
- package/compositions/virtualList/__tests__/useHeightCache.test.ts +97 -0
- package/compositions/virtualList/enums.ts +52 -0
- package/compositions/virtualList/useContainerObserver.ts +89 -0
- package/compositions/virtualList/useEntries.ts +248 -0
- package/compositions/virtualList/useHeightCache.ts +83 -0
- package/compositions/virtualList/useSentinelObserver.ts +81 -0
- package/dist/components/base/affix/index.d.ts +2 -1
- package/dist/components/base/affix/useAffix.d.ts +7 -5
- package/dist/components/base/anchor/index.d.ts +2 -1
- package/dist/components/base/anchor/useAnchor.d.ts +3 -2
- package/dist/components/base/autoComplete/useAutoComplete.d.ts +14 -5
- package/dist/components/base/avatar/index.d.ts +1 -0
- package/dist/components/base/backTop/index.d.ts +2 -1
- package/dist/components/base/backTop/useBackTop.d.ts +2 -2
- package/dist/components/base/button/index.d.ts +3 -21
- package/dist/components/base/button/useButton.d.ts +5 -2
- package/dist/components/base/carousel/useCarousel.d.ts +7 -3
- package/dist/components/base/cascader/useCascader.d.ts +25 -12
- package/dist/components/base/checkbox/index.d.ts +2 -1
- package/dist/components/base/checkbox/useCheckbox.d.ts +5 -3
- package/dist/components/base/collapse/index.d.ts +2 -1
- package/dist/components/base/collapse/useCollapse.d.ts +4 -3
- package/dist/components/base/datePicker/__tests__/useDatePicker.test.d.ts +1 -0
- package/dist/components/base/datePicker/index.d.ts +1 -1
- package/dist/components/base/datePicker/useDatePicker.d.ts +140 -15
- package/dist/components/base/dropdown/index.d.ts +2 -1
- package/dist/components/base/dropdown/useDropdown.d.ts +13 -6
- package/dist/components/base/image/__tests__/useImage.test.d.ts +1 -0
- package/dist/components/base/image/useImage.d.ts +5 -5
- package/dist/components/base/input/index.d.ts +2 -1
- package/dist/components/base/input/useInput.d.ts +4 -2
- package/dist/components/base/inputNumber/__tests__/useInputNumber.test.d.ts +1 -0
- package/dist/components/base/inputNumber/index.d.ts +2 -1
- package/dist/components/base/inputNumber/useInputNumber.d.ts +4 -3
- package/dist/components/base/li/index.d.ts +1 -0
- package/dist/components/base/list/index.d.ts +2 -1
- package/dist/components/base/list/useList.d.ts +1 -1
- package/dist/components/base/popover/index.d.ts +2 -1
- package/dist/components/base/popover/usePopover.d.ts +10 -9
- package/dist/components/base/progress/index.d.ts +2 -1
- package/dist/components/base/progress/useProgress.d.ts +2 -2
- package/dist/components/base/rate/index.d.ts +2 -1
- package/dist/components/base/rate/useRate.d.ts +3 -2
- package/dist/components/base/select/useSelect.d.ts +10 -9
- package/dist/components/base/slider/index.d.ts +2 -1
- package/dist/components/base/slider/useSlider.d.ts +5 -4
- package/dist/components/base/steps/__tests__/useSteps.test.d.ts +1 -0
- package/dist/components/base/steps/index.d.ts +1 -1
- package/dist/components/base/steps/useSteps.d.ts +5 -5
- package/dist/components/base/switch/index.d.ts +2 -1
- package/dist/components/base/switch/useSwitch.d.ts +9 -3
- package/dist/components/base/tabs/index.d.ts +1 -1
- package/dist/components/base/tabs/useTabs.d.ts +4 -3
- package/dist/components/base/tag/index.d.ts +1 -0
- package/dist/components/base/timePicker/__tests__/useTimePicker.test.d.ts +1 -0
- package/dist/components/base/timePicker/useTimePicker.d.ts +14 -6
- package/dist/components/base/tooltip/index.d.ts +1 -1
- package/dist/components/base/tooltip/useTooltip.d.ts +15 -5
- package/dist/components/base/transfer/useTransfer.d.ts +17 -16
- package/dist/components/base/tree/__tests__/tree.test.d.ts +1 -0
- package/dist/components/base/tree/index.d.ts +1 -1
- package/dist/components/base/tree/useTree.d.ts +2 -1
- package/dist/components/message/drawer/index.d.ts +2 -2
- package/dist/components/message/message/useMessage.d.ts +11 -1
- package/dist/components/message/notification/__tests__/useNotification.test.d.ts +1 -0
- package/dist/components/message/notification/useNotification.d.ts +17 -1
- package/dist/components/message/popover/MPopover.d.ts +6 -1
- package/dist/components/message/popover/index.d.ts +1 -1
- package/dist/components/message/popover/usePopover.d.ts +7 -7
- package/dist/components/other/darkMode/useDarkMode.d.ts +3 -4
- package/dist/components/template/menu/__tests__/useMenu.test.d.ts +1 -0
- package/dist/components/template/menu/index.d.ts +0 -1
- package/dist/components/template/menu/useMenu.d.ts +2 -1
- package/dist/components/template/pagination/__tests__/usePagination.test.d.ts +1 -0
- package/dist/components/template/pagination/index.d.ts +2 -1
- package/dist/components/template/table/__tests__/useTable.test.d.ts +1 -0
- package/dist/components/template/virtualList/index.d.ts +0 -1
- package/dist/components/template/virtualList/useVirtualList.d.ts +10 -7
- package/dist/compositions/common/__tests__/useDebounceFn.test.d.ts +1 -0
- package/dist/compositions/common/__tests__/useEventListener.test.d.ts +1 -0
- package/dist/compositions/common/__tests__/usePopover.test.d.ts +1 -0
- package/dist/compositions/common/__tests__/useTeleport.test.d.ts +1 -0
- package/dist/compositions/common/testAnchor.d.ts +40 -0
- package/dist/compositions/common/useComponentSize.d.ts +6 -0
- package/dist/compositions/common/useDrag.d.ts +1 -1
- package/dist/compositions/common/useElementSize.d.ts +2 -2
- package/dist/compositions/common/useEventListener.d.ts +2 -2
- package/dist/compositions/common/useLocale.d.ts +14 -0
- package/dist/compositions/common/useTeleport.d.ts +4 -2
- package/dist/compositions/input/__tests__/useBooleanInput.test.d.ts +1 -0
- package/dist/compositions/modal/__tests__/useModal.test.d.ts +1 -0
- package/dist/compositions/modal/useModal.d.ts +3 -2
- package/dist/compositions/popper/useClickAway.d.ts +3 -3
- package/dist/compositions/utils/__tests__/filters.test.d.ts +1 -0
- package/dist/compositions/virtualList/__tests__/useHeightCache.test.d.ts +1 -0
- package/dist/core.js +6697 -4188
- package/dist/index.d.ts +2 -0
- package/dist/locale/en.d.ts +3 -0
- package/dist/locale/index.d.ts +9 -0
- package/dist/locale/types.d.ts +222 -0
- package/dist/locale/zh.d.ts +3 -0
- package/dist/runtime/defineHook.d.ts +1 -1
- package/dist/tools/__tests__/empty.test.d.ts +1 -0
- package/dist/tools/empty.d.ts +2 -2
- package/dist/tools/types.d.ts +1 -1
- package/dist/vitest.config.d.ts +10 -0
- package/index.css +1 -0
- package/index.ts +81 -0
- package/locale/.vlaude/last-session-id +1 -0
- package/locale/en.ts +187 -0
- package/locale/index.ts +29 -0
- package/locale/types.ts +214 -0
- package/locale/zh.ts +190 -0
- package/package.json +23 -17
- package/runtime/defineHook.ts +21 -0
- package/tools/__tests__/empty.test.ts +91 -0
- package/tools/empty.ts +81 -0
- package/tools/index.ts +15 -0
- package/tools/types.ts +11 -0
- package/tsconfig.json +8 -0
- package/types/common/common.d.ts +25 -0
- package/types/common/model.d.ts +25 -0
- package/types/index.d.ts +11 -0
- package/types/props.d.ts +13 -0
- package/vite.config.build.ts +41 -0
- package/vitest.config.ts +17 -0
- package/dist/vite.config.build.d.ts +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -63,3 +63,5 @@ export * from './components/base/rate';
|
|
|
63
63
|
export * from './components/base/backTop';
|
|
64
64
|
export * from './components/base/affix';
|
|
65
65
|
export * from './components/base/anchor';
|
|
66
|
+
export * from './locale';
|
|
67
|
+
export { useLocale, KINE_LOCALE_KEY, setActiveLocaleMessages, getActiveLocaleMessages, type KineLocaleConfig, } from './compositions/common/useLocale';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { default as zh } from './zh';
|
|
2
|
+
import { default as en } from './en';
|
|
3
|
+
import { KineLocaleName, KineLocaleMessages } from './types';
|
|
4
|
+
export type { KineLocaleName, KineLocaleMessages };
|
|
5
|
+
/** Built-in language packs, keyed by locale name. */
|
|
6
|
+
export declare const locales: Record<KineLocaleName, KineLocaleMessages>;
|
|
7
|
+
/** Fallback locale used when none is provided / an unknown name is passed. */
|
|
8
|
+
export declare const DEFAULT_LOCALE: KineLocaleName;
|
|
9
|
+
export { zh, en };
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description kine-design locale message contract.
|
|
3
|
+
* The single source of truth for every user-facing string in the component
|
|
4
|
+
* library. Each language pack (zh / en) must implement this interface in
|
|
5
|
+
* full — a missing key is a compile error, which is exactly the guarantee we
|
|
6
|
+
* want so translations never silently drift out of sync.
|
|
7
|
+
* @author kine-design
|
|
8
|
+
* @version v1.0.0
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Built-in language pack identifiers. The library ships only the two general
|
|
12
|
+
* languages (zh / en). App-specific languages — e.g. Bengali in the factory —
|
|
13
|
+
* are supplied by the consumer as a full `KineLocaleMessages` object passed to
|
|
14
|
+
* `<KConfigProvider :locale="...">`, not bundled here.
|
|
15
|
+
*/
|
|
16
|
+
export type KineLocaleName = 'zh' | 'en';
|
|
17
|
+
/** Full message dictionary consumed by components via `useLocale()`. */
|
|
18
|
+
export interface KineLocaleMessages {
|
|
19
|
+
/** Shared atoms reused across many components. */
|
|
20
|
+
common: {
|
|
21
|
+
confirm: string;
|
|
22
|
+
cancel: string;
|
|
23
|
+
close: string;
|
|
24
|
+
search: string;
|
|
25
|
+
reset: string;
|
|
26
|
+
all: string;
|
|
27
|
+
noData: string;
|
|
28
|
+
loading: string;
|
|
29
|
+
save: string;
|
|
30
|
+
};
|
|
31
|
+
pagination: {
|
|
32
|
+
/** Text before the count, e.g. "共 " (en: ""). The count renders in its
|
|
33
|
+
* own <span> between prefix and suffix so per-language word order works. */
|
|
34
|
+
totalPrefix: string;
|
|
35
|
+
/** Text after the count, e.g. " 条" (en: " items"). */
|
|
36
|
+
totalSuffix: string;
|
|
37
|
+
};
|
|
38
|
+
datePicker: {
|
|
39
|
+
placeholder: string;
|
|
40
|
+
/** e.g. "2026年" / "2026" */
|
|
41
|
+
year: (year: number | string) => string;
|
|
42
|
+
/** e.g. "6月" / "Jun" */
|
|
43
|
+
month: (month: number | string) => string;
|
|
44
|
+
hour: string;
|
|
45
|
+
minute: string;
|
|
46
|
+
second: string;
|
|
47
|
+
confirm: string;
|
|
48
|
+
/** 7 entries, Sun→Sat ordering as rendered in the calendar header. */
|
|
49
|
+
weekNames: readonly [string, string, string, string, string, string, string];
|
|
50
|
+
/** 12 entries, Jan→Dec. */
|
|
51
|
+
monthNames: readonly [
|
|
52
|
+
string,
|
|
53
|
+
string,
|
|
54
|
+
string,
|
|
55
|
+
string,
|
|
56
|
+
string,
|
|
57
|
+
string,
|
|
58
|
+
string,
|
|
59
|
+
string,
|
|
60
|
+
string,
|
|
61
|
+
string,
|
|
62
|
+
string,
|
|
63
|
+
string
|
|
64
|
+
];
|
|
65
|
+
};
|
|
66
|
+
timePicker: {
|
|
67
|
+
placeholder: string;
|
|
68
|
+
hour: string;
|
|
69
|
+
minute: string;
|
|
70
|
+
second: string;
|
|
71
|
+
};
|
|
72
|
+
select: {
|
|
73
|
+
placeholder: string;
|
|
74
|
+
clear: string;
|
|
75
|
+
noData: string;
|
|
76
|
+
loading: string;
|
|
77
|
+
};
|
|
78
|
+
autoComplete: {
|
|
79
|
+
placeholder: string;
|
|
80
|
+
loading: string;
|
|
81
|
+
clear: string;
|
|
82
|
+
noData: string;
|
|
83
|
+
};
|
|
84
|
+
cascader: {
|
|
85
|
+
placeholder: string;
|
|
86
|
+
noMatch: string;
|
|
87
|
+
};
|
|
88
|
+
image: {
|
|
89
|
+
loadError: string;
|
|
90
|
+
zoomOut: string;
|
|
91
|
+
zoomIn: string;
|
|
92
|
+
rotate: string;
|
|
93
|
+
close: string;
|
|
94
|
+
};
|
|
95
|
+
transfer: {
|
|
96
|
+
sourceTitle: string;
|
|
97
|
+
targetTitle: string;
|
|
98
|
+
noData: string;
|
|
99
|
+
filterPlaceholder: string;
|
|
100
|
+
};
|
|
101
|
+
empty: {
|
|
102
|
+
description: string;
|
|
103
|
+
};
|
|
104
|
+
/** Accessibility labels (screen-reader / title text). */
|
|
105
|
+
a11y: {
|
|
106
|
+
rate: string;
|
|
107
|
+
tagClose: string;
|
|
108
|
+
anchorNav: string;
|
|
109
|
+
backTop: string;
|
|
110
|
+
carouselPrev: string;
|
|
111
|
+
carouselNext: string;
|
|
112
|
+
toLightMode: string;
|
|
113
|
+
toDarkMode: string;
|
|
114
|
+
expandSider: string;
|
|
115
|
+
collapseSider: string;
|
|
116
|
+
};
|
|
117
|
+
upload: {
|
|
118
|
+
trigger: string;
|
|
119
|
+
triggerSimple: string;
|
|
120
|
+
/** e.g. 文件 "a.png" 超过大小限制(最大 2MB) */
|
|
121
|
+
oversize: (name: string, max?: string) => string;
|
|
122
|
+
uploadFailed: string;
|
|
123
|
+
statusWaiting: string;
|
|
124
|
+
statusUploading: string;
|
|
125
|
+
statusDone: string;
|
|
126
|
+
statusFailed: string;
|
|
127
|
+
};
|
|
128
|
+
searchTable: {
|
|
129
|
+
search: string;
|
|
130
|
+
reset: string;
|
|
131
|
+
};
|
|
132
|
+
editableTable: {
|
|
133
|
+
summary: string;
|
|
134
|
+
addRow: string;
|
|
135
|
+
addFirstRow: string;
|
|
136
|
+
confirmDelete: string;
|
|
137
|
+
delete: string;
|
|
138
|
+
cancel: string;
|
|
139
|
+
noData: string;
|
|
140
|
+
};
|
|
141
|
+
formPage: {
|
|
142
|
+
loading: string;
|
|
143
|
+
cancel: string;
|
|
144
|
+
saveDraft: string;
|
|
145
|
+
save: string;
|
|
146
|
+
saving: string;
|
|
147
|
+
submit: string;
|
|
148
|
+
submitting: string;
|
|
149
|
+
basicInfo: string;
|
|
150
|
+
/** e.g. "编辑订单" / "Edit Order" */
|
|
151
|
+
editTitle: (title: string) => string;
|
|
152
|
+
/** e.g. "新建订单" / "New Order" */
|
|
153
|
+
createTitle: (title: string) => string;
|
|
154
|
+
};
|
|
155
|
+
approvalDialog: {
|
|
156
|
+
submitTitle: string;
|
|
157
|
+
submitConfirm: string;
|
|
158
|
+
approveTitle: string;
|
|
159
|
+
approveConfirm: string;
|
|
160
|
+
rejectTitle: string;
|
|
161
|
+
rejectConfirm: string;
|
|
162
|
+
rejectPlaceholder: string;
|
|
163
|
+
remarkPlaceholder: string;
|
|
164
|
+
required: string;
|
|
165
|
+
cancel: string;
|
|
166
|
+
processing: string;
|
|
167
|
+
};
|
|
168
|
+
crudPage: {
|
|
169
|
+
all: string;
|
|
170
|
+
/** e.g. "请输入名称" / "Enter Name" */
|
|
171
|
+
fieldPlaceholder: (label: string) => string;
|
|
172
|
+
};
|
|
173
|
+
login: {
|
|
174
|
+
username: string;
|
|
175
|
+
usernamePlaceholder: string;
|
|
176
|
+
password: string;
|
|
177
|
+
passwordPlaceholder: string;
|
|
178
|
+
remember: string;
|
|
179
|
+
login: string;
|
|
180
|
+
loggingIn: string;
|
|
181
|
+
};
|
|
182
|
+
form: {
|
|
183
|
+
inputPlaceholder: (label: string) => string;
|
|
184
|
+
selectPlaceholder: (label: string) => string;
|
|
185
|
+
};
|
|
186
|
+
routes: {
|
|
187
|
+
createSuffix: string;
|
|
188
|
+
editSuffix: string;
|
|
189
|
+
detailSuffix: string;
|
|
190
|
+
};
|
|
191
|
+
/** User-facing request / error feedback (dev-only throws stay hardcoded). */
|
|
192
|
+
request: {
|
|
193
|
+
success: string;
|
|
194
|
+
opFailed: string;
|
|
195
|
+
failed: string;
|
|
196
|
+
failedWithStatus: (status: number | string) => string;
|
|
197
|
+
failedWithMsg: (msg: string) => string;
|
|
198
|
+
timeout: string;
|
|
199
|
+
timeoutRetry: string;
|
|
200
|
+
canceled: string;
|
|
201
|
+
permissionDenied: string;
|
|
202
|
+
invalidUrl: (url: string) => string;
|
|
203
|
+
decodeFailed: (reason: string) => string;
|
|
204
|
+
parseFailed: string;
|
|
205
|
+
networkError: string;
|
|
206
|
+
networkException: string;
|
|
207
|
+
unknownError: (error: string) => string;
|
|
208
|
+
unknown: string;
|
|
209
|
+
uploadFailed: string;
|
|
210
|
+
uploadCanceled: string;
|
|
211
|
+
};
|
|
212
|
+
aiChat: {
|
|
213
|
+
inputPlaceholder: string;
|
|
214
|
+
send: string;
|
|
215
|
+
/** e.g. "对话 3" / "Chat 3" */
|
|
216
|
+
defaultTitle: (n: number) => string;
|
|
217
|
+
phaseTyping: string;
|
|
218
|
+
phaseThinking: string;
|
|
219
|
+
phaseReplying: string;
|
|
220
|
+
phaseSending: string;
|
|
221
|
+
};
|
|
222
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { EmitsOptions, SetupContext, SlotsType } from '
|
|
1
|
+
import { EmitsOptions, SetupContext, SlotsType } from 'vue';
|
|
2
2
|
import { UseHookResult } from '../components/types/hook';
|
|
3
3
|
export declare const defineHook: <Props extends Record<string, any>, E extends EmitsOptions = {}, S extends SlotsType = {}, Return = any>(hook: (props: Props, ctx: SetupContext<E, S>) => Return) => (props: Props, ctx: SetupContext<E, S>) => UseHookResult<Props, S, Return>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/empty.d.ts
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* 支持稍多类型的判断非空的方法
|
|
11
11
|
* @param value
|
|
12
12
|
*/
|
|
13
|
-
export declare const notEmpty: (value:
|
|
13
|
+
export declare const notEmpty: (value: unknown) => number | boolean | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* 判断为空的方法,即notEmpty的取反
|
|
16
16
|
* @param value
|
|
17
17
|
*/
|
|
18
|
-
export declare const isEmpty: (value:
|
|
18
|
+
export declare const isEmpty: (value: unknown) => boolean;
|
package/dist/tools/types.d.ts
CHANGED
package/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "assets/style/global.css";
|
package/index.ts
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description
|
|
3
|
+
* @author 阿怪
|
|
4
|
+
* @date 2024/10/9 00:12
|
|
5
|
+
* @version v1.0.0
|
|
6
|
+
*
|
|
7
|
+
* 江湖的业务千篇一律,复杂的代码好几百行。
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
export * from './components/base/avatar';
|
|
12
|
+
export * from './components/base/input';
|
|
13
|
+
export * from './components/base/button';
|
|
14
|
+
export * from './components/base/select';
|
|
15
|
+
export * from './components/base/checkbox';
|
|
16
|
+
export * from './components/base/switch';
|
|
17
|
+
export * from './components/base/tag';
|
|
18
|
+
export * from './components/base/progress';
|
|
19
|
+
export * from './components/base/list';
|
|
20
|
+
export * from './components/base/radio';
|
|
21
|
+
export * from './components/base/li';
|
|
22
|
+
export * from './components/base/inputNumber';
|
|
23
|
+
export * from './components/base/slider';
|
|
24
|
+
export * from './components/message/message';
|
|
25
|
+
export * from './components/template/form';
|
|
26
|
+
|
|
27
|
+
export * from './components/base/popover';
|
|
28
|
+
export * from './components/base/tooltip';
|
|
29
|
+
export * from './components/base/divider';
|
|
30
|
+
export * from './components/base/loading';
|
|
31
|
+
|
|
32
|
+
export * from './components/message/dialog';
|
|
33
|
+
export * from './components/message/drawer';
|
|
34
|
+
export * from './components/message/confirm';
|
|
35
|
+
|
|
36
|
+
export * from './components/other/darkMode';
|
|
37
|
+
|
|
38
|
+
export * from './components/template/breadcrumb';
|
|
39
|
+
export * from './components/template/grid';
|
|
40
|
+
export * from './components/template/pagination';
|
|
41
|
+
export * from './components/template/menu';
|
|
42
|
+
export * from './components/base/datePicker';
|
|
43
|
+
export * from './components/base/tree';
|
|
44
|
+
export * from './components/template/table';
|
|
45
|
+
export * from './components/template/tableColumn';
|
|
46
|
+
export * from './components/template/border';
|
|
47
|
+
export * from './components/template/virtualList';
|
|
48
|
+
export * from './components/message/popover';
|
|
49
|
+
export * from './components/base/tabs';
|
|
50
|
+
export * from './components/base/dropdown';
|
|
51
|
+
export * from './components/base/collapse';
|
|
52
|
+
export * from './components/base/steps';
|
|
53
|
+
export * from './components/message/notification';
|
|
54
|
+
export * from './components/base/skeleton';
|
|
55
|
+
export * from './components/base/timeline';
|
|
56
|
+
export * from './components/template/descriptions';
|
|
57
|
+
export * from './components/base/card';
|
|
58
|
+
export * from './components/base/alert';
|
|
59
|
+
export * from './components/base/badge';
|
|
60
|
+
export * from './components/base/empty';
|
|
61
|
+
export * from './components/base/space';
|
|
62
|
+
export * from './components/base/autoComplete';
|
|
63
|
+
export * from './components/base/carousel';
|
|
64
|
+
export * from './components/base/image';
|
|
65
|
+
export * from './components/base/result';
|
|
66
|
+
export * from './components/base/cascader';
|
|
67
|
+
export * from './components/base/transfer';
|
|
68
|
+
export * from './components/base/rate';
|
|
69
|
+
export * from './components/base/backTop';
|
|
70
|
+
export * from './components/base/affix';
|
|
71
|
+
export * from './components/base/anchor';
|
|
72
|
+
|
|
73
|
+
// i18n / locale
|
|
74
|
+
export * from './locale';
|
|
75
|
+
export {
|
|
76
|
+
useLocale,
|
|
77
|
+
KINE_LOCALE_KEY,
|
|
78
|
+
setActiveLocaleMessages,
|
|
79
|
+
getActiveLocaleMessages,
|
|
80
|
+
type KineLocaleConfig,
|
|
81
|
+
} from './compositions/common/useLocale';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
4c9b1c27-b707-4b0b-98d7-fde5d511ce47
|
package/locale/en.ts
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description English (en) language pack.
|
|
3
|
+
* @author kine-design
|
|
4
|
+
* @version v1.0.0
|
|
5
|
+
*/
|
|
6
|
+
import type { KineLocaleMessages } from './types';
|
|
7
|
+
|
|
8
|
+
const en: KineLocaleMessages = {
|
|
9
|
+
common: {
|
|
10
|
+
confirm: 'OK',
|
|
11
|
+
cancel: 'Cancel',
|
|
12
|
+
close: 'Close',
|
|
13
|
+
search: 'Search',
|
|
14
|
+
reset: 'Reset',
|
|
15
|
+
all: 'All',
|
|
16
|
+
noData: 'No data',
|
|
17
|
+
loading: 'Loading...',
|
|
18
|
+
save: 'Save',
|
|
19
|
+
},
|
|
20
|
+
pagination: {
|
|
21
|
+
totalPrefix: '',
|
|
22
|
+
totalSuffix: ' items',
|
|
23
|
+
},
|
|
24
|
+
datePicker: {
|
|
25
|
+
placeholder: 'Select date...',
|
|
26
|
+
year: (year) => `${year}`,
|
|
27
|
+
month: (month) => `${month}`,
|
|
28
|
+
hour: 'Hour',
|
|
29
|
+
minute: 'Min',
|
|
30
|
+
second: 'Sec',
|
|
31
|
+
confirm: 'OK',
|
|
32
|
+
weekNames: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
33
|
+
monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
|
34
|
+
},
|
|
35
|
+
timePicker: {
|
|
36
|
+
placeholder: 'Select time...',
|
|
37
|
+
hour: 'Hour',
|
|
38
|
+
minute: 'Min',
|
|
39
|
+
second: 'Sec',
|
|
40
|
+
},
|
|
41
|
+
select: {
|
|
42
|
+
placeholder: 'Select...',
|
|
43
|
+
clear: 'Clear',
|
|
44
|
+
noData: 'No data',
|
|
45
|
+
loading: 'Loading...',
|
|
46
|
+
},
|
|
47
|
+
autoComplete: {
|
|
48
|
+
placeholder: 'Enter...',
|
|
49
|
+
loading: 'Loading',
|
|
50
|
+
clear: 'Clear',
|
|
51
|
+
noData: 'No suggestions',
|
|
52
|
+
},
|
|
53
|
+
cascader: {
|
|
54
|
+
placeholder: 'Select',
|
|
55
|
+
noMatch: 'No matching data',
|
|
56
|
+
},
|
|
57
|
+
image: {
|
|
58
|
+
loadError: 'Load failed',
|
|
59
|
+
zoomOut: 'Zoom out',
|
|
60
|
+
zoomIn: 'Zoom in',
|
|
61
|
+
rotate: 'Rotate',
|
|
62
|
+
close: 'Close',
|
|
63
|
+
},
|
|
64
|
+
transfer: {
|
|
65
|
+
sourceTitle: 'Source',
|
|
66
|
+
targetTitle: 'Target',
|
|
67
|
+
noData: 'No data',
|
|
68
|
+
filterPlaceholder: 'Search...',
|
|
69
|
+
},
|
|
70
|
+
empty: {
|
|
71
|
+
description: 'No data',
|
|
72
|
+
},
|
|
73
|
+
a11y: {
|
|
74
|
+
rate: 'Rating',
|
|
75
|
+
tagClose: 'Close',
|
|
76
|
+
anchorNav: 'Anchor navigation',
|
|
77
|
+
backTop: 'Back to top',
|
|
78
|
+
carouselPrev: 'Previous',
|
|
79
|
+
carouselNext: 'Next',
|
|
80
|
+
toLightMode: 'Switch to light mode',
|
|
81
|
+
toDarkMode: 'Switch to dark mode',
|
|
82
|
+
expandSider: 'Expand sidebar',
|
|
83
|
+
collapseSider: 'Collapse sidebar',
|
|
84
|
+
},
|
|
85
|
+
upload: {
|
|
86
|
+
trigger: 'Click or drag file here to upload',
|
|
87
|
+
triggerSimple: 'Click to upload',
|
|
88
|
+
oversize: (name, max) =>
|
|
89
|
+
max ? `File "${name}" exceeds size limit (max ${max})` : `File "${name}" exceeds size limit`,
|
|
90
|
+
uploadFailed: 'Upload failed',
|
|
91
|
+
statusWaiting: 'Waiting',
|
|
92
|
+
statusUploading: 'Uploading',
|
|
93
|
+
statusDone: 'Done',
|
|
94
|
+
statusFailed: 'Failed',
|
|
95
|
+
},
|
|
96
|
+
searchTable: {
|
|
97
|
+
search: 'Search',
|
|
98
|
+
reset: 'Reset',
|
|
99
|
+
},
|
|
100
|
+
editableTable: {
|
|
101
|
+
summary: 'Total',
|
|
102
|
+
addRow: '+ Add row',
|
|
103
|
+
addFirstRow: 'Add first row',
|
|
104
|
+
confirmDelete: 'Delete this row?',
|
|
105
|
+
delete: 'Delete',
|
|
106
|
+
cancel: 'Cancel',
|
|
107
|
+
noData: 'No data',
|
|
108
|
+
},
|
|
109
|
+
formPage: {
|
|
110
|
+
loading: 'Loading...',
|
|
111
|
+
cancel: 'Cancel',
|
|
112
|
+
saveDraft: 'Save draft',
|
|
113
|
+
save: 'Save',
|
|
114
|
+
saving: 'Saving...',
|
|
115
|
+
submit: 'Submit',
|
|
116
|
+
submitting: 'Submitting...',
|
|
117
|
+
basicInfo: 'Basic info',
|
|
118
|
+
editTitle: (title) => `Edit ${title}`,
|
|
119
|
+
createTitle: (title) => `New ${title}`,
|
|
120
|
+
},
|
|
121
|
+
approvalDialog: {
|
|
122
|
+
submitTitle: 'Submit for approval',
|
|
123
|
+
submitConfirm: 'Confirm submission',
|
|
124
|
+
approveTitle: 'Approve',
|
|
125
|
+
approveConfirm: 'Confirm approval',
|
|
126
|
+
rejectTitle: 'Reject',
|
|
127
|
+
rejectConfirm: 'Confirm rejection',
|
|
128
|
+
rejectPlaceholder: 'Enter rejection reason...',
|
|
129
|
+
remarkPlaceholder: 'Add remark (optional)...',
|
|
130
|
+
required: '* Required',
|
|
131
|
+
cancel: 'Cancel',
|
|
132
|
+
processing: 'Processing...',
|
|
133
|
+
},
|
|
134
|
+
crudPage: {
|
|
135
|
+
all: 'All',
|
|
136
|
+
fieldPlaceholder: (label) => `Enter ${label}`,
|
|
137
|
+
},
|
|
138
|
+
login: {
|
|
139
|
+
username: 'Username',
|
|
140
|
+
usernamePlaceholder: 'Enter username',
|
|
141
|
+
password: 'Password',
|
|
142
|
+
passwordPlaceholder: 'Enter password',
|
|
143
|
+
remember: 'Remember me',
|
|
144
|
+
login: 'Log in',
|
|
145
|
+
loggingIn: 'Logging in...',
|
|
146
|
+
},
|
|
147
|
+
form: {
|
|
148
|
+
inputPlaceholder: (label) => `Enter ${label}`,
|
|
149
|
+
selectPlaceholder: (label) => `Select ${label}`,
|
|
150
|
+
},
|
|
151
|
+
routes: {
|
|
152
|
+
createSuffix: ' - New',
|
|
153
|
+
editSuffix: ' - Edit',
|
|
154
|
+
detailSuffix: ' - Details',
|
|
155
|
+
},
|
|
156
|
+
request: {
|
|
157
|
+
success: 'Success',
|
|
158
|
+
opFailed: 'Operation failed',
|
|
159
|
+
failed: 'Request failed',
|
|
160
|
+
failedWithStatus: (status) => `Request failed (${status})`,
|
|
161
|
+
failedWithMsg: (msg) => `Request failed: ${msg}`,
|
|
162
|
+
timeout: 'Request timed out',
|
|
163
|
+
timeoutRetry: 'Request timed out, please try again',
|
|
164
|
+
canceled: 'Request canceled',
|
|
165
|
+
permissionDenied: 'Permission denied',
|
|
166
|
+
invalidUrl: (url) => `Invalid request URL: ${url}`,
|
|
167
|
+
decodeFailed: (reason) => `Decode failed: ${reason}`,
|
|
168
|
+
parseFailed: 'Failed to parse data',
|
|
169
|
+
networkError: 'Network error',
|
|
170
|
+
networkException: 'Network error, please check your connection',
|
|
171
|
+
unknownError: (error) => `Unknown error: ${error}`,
|
|
172
|
+
unknown: 'An unknown error occurred',
|
|
173
|
+
uploadFailed: 'Upload failed',
|
|
174
|
+
uploadCanceled: 'Upload canceled',
|
|
175
|
+
},
|
|
176
|
+
aiChat: {
|
|
177
|
+
inputPlaceholder: 'Type a message…',
|
|
178
|
+
send: 'Send',
|
|
179
|
+
defaultTitle: (n) => `Chat ${n}`,
|
|
180
|
+
phaseTyping: 'Typing…',
|
|
181
|
+
phaseThinking: 'Thinking…',
|
|
182
|
+
phaseReplying: 'Replying…',
|
|
183
|
+
phaseSending: 'Sending…',
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export default en;
|
package/locale/index.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description kine-design locale entry — built-in language packs + types.
|
|
3
|
+
*
|
|
4
|
+
* The library ships only the two general languages (zh / en). To use another
|
|
5
|
+
* language, build a full dictionary that satisfies `KineLocaleMessages` in the
|
|
6
|
+
* consuming app and pass it straight to the provider:
|
|
7
|
+
*
|
|
8
|
+
* import type { KineLocaleMessages } from '@kine-design/core';
|
|
9
|
+
* const bn: KineLocaleMessages = { ...full Bengali dictionary... };
|
|
10
|
+
* // <KConfigProvider :locale="bn"> ... </KConfigProvider>
|
|
11
|
+
*
|
|
12
|
+
* TypeScript enforces full key coverage, so a partial/forgotten key is a
|
|
13
|
+
* compile error in the app — the same guarantee the built-in packs enjoy.
|
|
14
|
+
* @author kine-design
|
|
15
|
+
* @version v1.0.0
|
|
16
|
+
*/
|
|
17
|
+
import zh from './zh';
|
|
18
|
+
import en from './en';
|
|
19
|
+
import type { KineLocaleName, KineLocaleMessages } from './types';
|
|
20
|
+
|
|
21
|
+
export type { KineLocaleName, KineLocaleMessages };
|
|
22
|
+
|
|
23
|
+
/** Built-in language packs, keyed by locale name. */
|
|
24
|
+
export const locales: Record<KineLocaleName, KineLocaleMessages> = { zh, en };
|
|
25
|
+
|
|
26
|
+
/** Fallback locale used when none is provided / an unknown name is passed. */
|
|
27
|
+
export const DEFAULT_LOCALE: KineLocaleName = 'zh';
|
|
28
|
+
|
|
29
|
+
export { zh, en };
|