kb-ui-vue 0.2.0 → 0.4.0
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/LICENSE +21 -0
- package/dist/components/Affix/Affix.vue.d.ts +36 -0
- package/dist/components/Affix/index.d.ts +4 -0
- package/dist/components/Anchor/Anchor.vue.d.ts +25 -0
- package/dist/components/Anchor/index.d.ts +4 -0
- package/dist/components/AutoComplete/AutoComplete.vue.d.ts +52 -0
- package/dist/components/AutoComplete/index.d.ts +4 -0
- package/dist/components/BackTop/BackTop.vue.d.ts +35 -0
- package/dist/components/BackTop/index.d.ts +4 -0
- package/dist/components/Calendar/Calendar.vue.d.ts +17 -0
- package/dist/components/Calendar/index.d.ts +1 -1
- package/dist/components/Cascader/Cascader.vue.d.ts +22 -5
- package/dist/components/Checkbox/Checkbox.vue.d.ts +3 -0
- package/dist/components/ConfigProvider/ConfigProvider.vue.d.ts +30 -0
- package/dist/components/ConfigProvider/index.d.ts +4 -0
- package/dist/components/ContextMenu/ContextMenu.vue.d.ts +42 -0
- package/dist/components/ContextMenu/index.d.ts +4 -0
- package/dist/components/DatePicker/DatePicker.vue.d.ts +18 -4
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/Empty/Empty.vue.d.ts +1 -1
- package/dist/components/FloatButton/FloatButton.vue.d.ts +48 -0
- package/dist/components/FloatButton/FloatButtonGroup.vue.d.ts +38 -0
- package/dist/components/FloatButton/index.d.ts +5 -0
- package/dist/components/Image/Image.vue.d.ts +37 -0
- package/dist/components/Image/index.d.ts +4 -0
- package/dist/components/ImagePreview/ImagePreview.vue.d.ts +28 -0
- package/dist/components/ImagePreview/index.d.ts +4 -0
- package/dist/components/Layout/Content.vue.d.ts +13 -0
- package/dist/components/Layout/Footer.vue.d.ts +13 -0
- package/dist/components/Layout/Header.vue.d.ts +13 -0
- package/dist/components/Layout/Layout.vue.d.ts +19 -0
- package/dist/components/Layout/Sider.vue.d.ts +37 -0
- package/dist/components/Layout/constants.d.ts +7 -0
- package/dist/components/Layout/index.d.ts +8 -0
- package/dist/components/List/List.vue.d.ts +1 -0
- package/dist/components/Mentions/Mentions.vue.d.ts +37 -0
- package/dist/components/Mentions/index.d.ts +5 -0
- package/dist/components/Mentions/types.d.ts +10 -0
- package/dist/components/Popconfirm/Popconfirm.vue.d.ts +2 -1
- package/dist/components/QRCode/QRCode.vue.d.ts +36 -0
- package/dist/components/QRCode/index.d.ts +4 -0
- package/dist/components/QRCode/qrcode.d.ts +34 -0
- package/dist/components/Search/Search.vue.d.ts +4 -0
- package/dist/components/Splitter/Splitter.vue.d.ts +34 -0
- package/dist/components/Splitter/index.d.ts +4 -0
- package/dist/components/Table/Table.vue.d.ts +41 -3
- package/dist/components/TimePicker/TimePicker.vue.d.ts +28 -0
- package/dist/components/TimePicker/index.d.ts +4 -0
- package/dist/components/Tour/Tour.vue.d.ts +37 -0
- package/dist/components/Tour/index.d.ts +4 -0
- package/dist/components/Transfer/Transfer.vue.d.ts +17 -1
- package/dist/components/Tree/Tree.vue.d.ts +25 -1
- package/dist/components/TreeSelect/TreeSelect.vue.d.ts +32 -0
- package/dist/components/TreeSelect/index.d.ts +4 -0
- package/dist/components/Upload/Upload.vue.d.ts +1 -1
- package/dist/components/VirtualList/VirtualList.vue.d.ts +29 -0
- package/dist/components/VirtualList/index.d.ts +4 -0
- package/dist/components/VirtualList/types.d.ts +12 -0
- package/dist/composables/useGlobalConfig.d.ts +45 -0
- package/dist/global.d.ts +90 -0
- package/dist/index.cjs +3 -1
- package/dist/index.d.ts +40 -0
- package/dist/index.js +4303 -921
- package/dist/locale/en-US.d.ts +2 -0
- package/dist/locale/index.d.ts +23 -0
- package/dist/locale/types.d.ts +227 -0
- package/dist/locale/zh-CN.d.ts +2 -0
- package/dist/resolver-map.d.ts +14 -0
- package/dist/resolver.cjs +1 -0
- package/dist/resolver.d.ts +36 -0
- package/dist/resolver.js +32 -0
- package/dist/styles/Affix.css +8 -0
- package/dist/styles/Alert.css +68 -68
- package/dist/styles/Anchor.css +56 -0
- package/dist/styles/AutoComplete.css +102 -0
- package/dist/styles/Avatar.css +31 -31
- package/dist/styles/BackTop.css +39 -0
- package/dist/styles/Badge.css +49 -49
- package/dist/styles/Breadcrumb.css +28 -28
- package/dist/styles/Button.css +108 -108
- package/dist/styles/Calendar.css +89 -79
- package/dist/styles/Card.css +40 -40
- package/dist/styles/Carousel.css +87 -87
- package/dist/styles/Cascader.css +121 -75
- package/dist/styles/Checkbox.css +77 -62
- package/dist/styles/Collapse.css +49 -49
- package/dist/styles/ColorPicker.css +36 -36
- package/dist/styles/ContextMenu.css +58 -0
- package/dist/styles/CountUp.css +4 -4
- package/dist/styles/DatePicker.css +63 -33
- package/dist/styles/Descriptions.css +44 -44
- package/dist/styles/Dialog.css +42 -42
- package/dist/styles/Divider.css +37 -37
- package/dist/styles/Drawer.css +81 -81
- package/dist/styles/Dropdown.css +40 -40
- package/dist/styles/Empty.css +24 -24
- package/dist/styles/FloatButton.css +214 -0
- package/dist/styles/Form.css +33 -33
- package/dist/styles/Grid.css +194 -194
- package/dist/styles/Icon.css +5 -5
- package/dist/styles/Image.css +48 -0
- package/dist/styles/ImagePreview.css +99 -0
- package/dist/styles/Input.css +79 -79
- package/dist/styles/InputNumber.css +40 -40
- package/dist/styles/InputPassword.css +42 -42
- package/dist/styles/Layout.css +83 -0
- package/dist/styles/List.css +29 -29
- package/dist/styles/Loading.css +27 -27
- package/dist/styles/Mentions.css +74 -0
- package/dist/styles/Message.css +32 -32
- package/dist/styles/Notification.css +50 -50
- package/dist/styles/Pagination.css +57 -57
- package/dist/styles/Popconfirm.css +53 -53
- package/dist/styles/Popover.css +54 -54
- package/dist/styles/Progress.css +38 -38
- package/dist/styles/QRCode.css +37 -0
- package/dist/styles/Radio.css +60 -60
- package/dist/styles/Rate.css +21 -21
- package/dist/styles/Result.css +41 -41
- package/dist/styles/Search.css +46 -46
- package/dist/styles/Segmented.css +32 -32
- package/dist/styles/Select.css +108 -108
- package/dist/styles/Skeleton.css +40 -40
- package/dist/styles/Slider.css +46 -46
- package/dist/styles/Space.css +27 -27
- package/dist/styles/Splitter.css +59 -0
- package/dist/styles/Statistic.css +31 -31
- package/dist/styles/Steps.css +83 -83
- package/dist/styles/Switch.css +39 -39
- package/dist/styles/Table.css +132 -43
- package/dist/styles/Tabs.css +41 -41
- package/dist/styles/Tag.css +71 -71
- package/dist/styles/Textarea.css +43 -43
- package/dist/styles/TimePicker.css +98 -0
- package/dist/styles/Timeline.css +70 -70
- package/dist/styles/Tooltip.css +42 -42
- package/dist/styles/Tour.css +102 -0
- package/dist/styles/Transfer.css +142 -64
- package/dist/styles/Tree.css +89 -50
- package/dist/styles/TreeSelect.css +121 -0
- package/dist/styles/Upload.css +66 -66
- package/dist/styles/VirtualList.css +42 -0
- package/dist/styles/Watermark.css +17 -17
- package/dist/styles/all.css +110 -103
- package/dist/styles/dark.css +10 -10
- package/dist/styles/index.css +4520 -2953
- package/dist/styles/themes/amber.css +14 -14
- package/dist/styles/themes/aurora.css +15 -15
- package/dist/styles/themes/autumn.css +18 -18
- package/dist/styles/themes/business.css +20 -20
- package/dist/styles/themes/candy.css +21 -21
- package/dist/styles/themes/cartoon.css +31 -31
- package/dist/styles/themes/coffee.css +18 -18
- package/dist/styles/themes/cyber.css +37 -37
- package/dist/styles/themes/cyberpunk.css +32 -32
- package/dist/styles/themes/danqing.css +27 -27
- package/dist/styles/themes/flat.css +18 -18
- package/dist/styles/themes/forest.css +20 -20
- package/dist/styles/themes/gameboy.css +33 -33
- package/dist/styles/themes/glass.css +39 -39
- package/dist/styles/themes/gold.css +26 -26
- package/dist/styles/themes/gothic.css +20 -20
- package/dist/styles/themes/gradient.css +18 -18
- package/dist/styles/themes/ink.css +16 -16
- package/dist/styles/themes/lava.css +15 -15
- package/dist/styles/themes/macaron.css +27 -27
- package/dist/styles/themes/matcha.css +18 -18
- package/dist/styles/themes/memphis.css +25 -25
- package/dist/styles/themes/midnight.css +27 -27
- package/dist/styles/themes/minimal.css +36 -36
- package/dist/styles/themes/mint.css +20 -20
- package/dist/styles/themes/mono.css +36 -36
- package/dist/styles/themes/morandi.css +18 -18
- package/dist/styles/themes/neon.css +16 -16
- package/dist/styles/themes/neonlight.css +20 -20
- package/dist/styles/themes/ocean.css +20 -20
- package/dist/styles/themes/pastel.css +21 -21
- package/dist/styles/themes/pop.css +33 -33
- package/dist/styles/themes/retro.css +35 -35
- package/dist/styles/themes/rose.css +14 -14
- package/dist/styles/themes/rounded.css +18 -18
- package/dist/styles/themes/sakura.css +20 -20
- package/dist/styles/themes/sky.css +20 -20
- package/dist/styles/themes/spring.css +18 -18
- package/dist/styles/themes/starry.css +15 -15
- package/dist/styles/themes/sunset.css +18 -18
- package/dist/styles/themes/teal.css +14 -14
- package/dist/styles/themes/terminal.css +44 -44
- package/dist/styles/themes/vaporwave.css +27 -27
- package/dist/styles/themes/violet.css +14 -14
- package/dist/styles/themes/wabi.css +27 -27
- package/dist/styles/themes/winter.css +20 -20
- package/dist/styles/tokens.css +59 -55
- package/package.json +78 -45
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
|
+
import { getLocale, ProjectLocale } from '../locale';
|
|
3
|
+
import { LocalePath } from '../locale/types';
|
|
4
|
+
/** 组件统一尺寸 */
|
|
5
|
+
export type ComponentSize = 'small' | 'medium' | 'large';
|
|
6
|
+
/** 主题模式 */
|
|
7
|
+
export type ThemeMode = 'light' | 'dark';
|
|
8
|
+
/** 全局配置结构 */
|
|
9
|
+
export interface GlobalConfig {
|
|
10
|
+
/** 语言包 */
|
|
11
|
+
locale: ProjectLocale;
|
|
12
|
+
/** 组件默认尺寸 */
|
|
13
|
+
size: ComponentSize;
|
|
14
|
+
/** 弹层基础层级,实际层级在此基础上累加 */
|
|
15
|
+
zIndex: number;
|
|
16
|
+
/** 主题模式 */
|
|
17
|
+
theme: ThemeMode;
|
|
18
|
+
}
|
|
19
|
+
export declare const defaultGlobalConfig: GlobalConfig;
|
|
20
|
+
export declare const configKey: InjectionKey<GlobalConfig>;
|
|
21
|
+
/** 由 ConfigProvider 调用,向其子树注入配置 */
|
|
22
|
+
export declare function provideGlobalConfig(config: GlobalConfig): void;
|
|
23
|
+
/** 读取全局配置,未包裹 ConfigProvider 时返回默认配置 */
|
|
24
|
+
export declare function useGlobalConfig(): GlobalConfig;
|
|
25
|
+
/** 读取当前尺寸,允许组件自身的 size prop 优先覆盖 */
|
|
26
|
+
export declare function useSize(local?: ComponentSize): ComponentSize;
|
|
27
|
+
/** 读取弹层基础层级 */
|
|
28
|
+
export declare function useZIndex(): number;
|
|
29
|
+
export type Translate = (path: LocalePath, ...args: unknown[]) => string;
|
|
30
|
+
/**
|
|
31
|
+
* 读取语言包与取值函数
|
|
32
|
+
*
|
|
33
|
+
* 组件内置文案一律走 t(),这样 ConfigProvider 只需换 locale 即可整站切换语言。
|
|
34
|
+
*
|
|
35
|
+
* 两个返回值的响应式语义:
|
|
36
|
+
* - `t` 每次调用时才读取当前语言包,因此可安全地在 computed / 模板中使用,
|
|
37
|
+
* ConfigProvider 切换语言后会自动重渲染;
|
|
38
|
+
* - `locale` 是 ref,读取具体字段需写 `locale.value.xxx`(同样具备响应性)。
|
|
39
|
+
*/
|
|
40
|
+
export declare function useLocale(): {
|
|
41
|
+
t: Translate;
|
|
42
|
+
locale: Ref<ProjectLocale>;
|
|
43
|
+
};
|
|
44
|
+
/** 按名称解析语言包,未知名称回退到默认语言 */
|
|
45
|
+
export { getLocale };
|
package/dist/global.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/* 由 scripts/build-global-types.mjs 自动生成,请勿手动修改 */
|
|
3
|
+
import type * as KB from './index'
|
|
4
|
+
|
|
5
|
+
declare module 'vue' {
|
|
6
|
+
export interface GlobalComponents {
|
|
7
|
+
KbAffix: typeof KB.KbAffix
|
|
8
|
+
KbAlert: typeof KB.KbAlert
|
|
9
|
+
KbAnchor: typeof KB.KbAnchor
|
|
10
|
+
KbAutoComplete: typeof KB.KbAutoComplete
|
|
11
|
+
KbAvatar: typeof KB.KbAvatar
|
|
12
|
+
KbBackTop: typeof KB.KbBackTop
|
|
13
|
+
KbBadge: typeof KB.KbBadge
|
|
14
|
+
KbBreadcrumb: typeof KB.KbBreadcrumb
|
|
15
|
+
KbButton: typeof KB.KbButton
|
|
16
|
+
KbCalendar: typeof KB.KbCalendar
|
|
17
|
+
KbCard: typeof KB.KbCard
|
|
18
|
+
KbCarousel: typeof KB.KbCarousel
|
|
19
|
+
KbCascader: typeof KB.KbCascader
|
|
20
|
+
KbCheckbox: typeof KB.KbCheckbox
|
|
21
|
+
KbCol: typeof KB.KbCol
|
|
22
|
+
KbCollapse: typeof KB.KbCollapse
|
|
23
|
+
KbColorPicker: typeof KB.KbColorPicker
|
|
24
|
+
KbConfigProvider: typeof KB.KbConfigProvider
|
|
25
|
+
KbContent: typeof KB.KbContent
|
|
26
|
+
KbContextMenu: typeof KB.KbContextMenu
|
|
27
|
+
KbCountUp: typeof KB.KbCountUp
|
|
28
|
+
KbDatePicker: typeof KB.KbDatePicker
|
|
29
|
+
KbDescriptions: typeof KB.KbDescriptions
|
|
30
|
+
KbDialog: typeof KB.KbDialog
|
|
31
|
+
KbDivider: typeof KB.KbDivider
|
|
32
|
+
KbDrawer: typeof KB.KbDrawer
|
|
33
|
+
KbDropdown: typeof KB.KbDropdown
|
|
34
|
+
KbEmpty: typeof KB.KbEmpty
|
|
35
|
+
KbFloatButton: typeof KB.KbFloatButton
|
|
36
|
+
KbFloatButtonGroup: typeof KB.KbFloatButtonGroup
|
|
37
|
+
KbFooter: typeof KB.KbFooter
|
|
38
|
+
KbForm: typeof KB.KbForm
|
|
39
|
+
KbFormItem: typeof KB.KbFormItem
|
|
40
|
+
KbHeader: typeof KB.KbHeader
|
|
41
|
+
KbIcon: typeof KB.KbIcon
|
|
42
|
+
KbImage: typeof KB.KbImage
|
|
43
|
+
KbImagePreview: typeof KB.KbImagePreview
|
|
44
|
+
KbInput: typeof KB.KbInput
|
|
45
|
+
KbInputNumber: typeof KB.KbInputNumber
|
|
46
|
+
KbInputPassword: typeof KB.KbInputPassword
|
|
47
|
+
KbLayout: typeof KB.KbLayout
|
|
48
|
+
KbList: typeof KB.KbList
|
|
49
|
+
KbLoading: typeof KB.KbLoading
|
|
50
|
+
KbMentions: typeof KB.KbMentions
|
|
51
|
+
KbMessage: typeof KB.KbMessage
|
|
52
|
+
KbNotification: typeof KB.KbNotification
|
|
53
|
+
KbPagination: typeof KB.KbPagination
|
|
54
|
+
KbPopconfirm: typeof KB.KbPopconfirm
|
|
55
|
+
KbPopover: typeof KB.KbPopover
|
|
56
|
+
KbProgress: typeof KB.KbProgress
|
|
57
|
+
KbQRCode: typeof KB.KbQRCode
|
|
58
|
+
KbRadio: typeof KB.KbRadio
|
|
59
|
+
KbRate: typeof KB.KbRate
|
|
60
|
+
KbResult: typeof KB.KbResult
|
|
61
|
+
KbRow: typeof KB.KbRow
|
|
62
|
+
KbSearch: typeof KB.KbSearch
|
|
63
|
+
KbSegmented: typeof KB.KbSegmented
|
|
64
|
+
KbSelect: typeof KB.KbSelect
|
|
65
|
+
KbSider: typeof KB.KbSider
|
|
66
|
+
KbSkeleton: typeof KB.KbSkeleton
|
|
67
|
+
KbSlider: typeof KB.KbSlider
|
|
68
|
+
KbSpace: typeof KB.KbSpace
|
|
69
|
+
KbSplitter: typeof KB.KbSplitter
|
|
70
|
+
KbStatistic: typeof KB.KbStatistic
|
|
71
|
+
KbSteps: typeof KB.KbSteps
|
|
72
|
+
KbSwitch: typeof KB.KbSwitch
|
|
73
|
+
KbTable: typeof KB.KbTable
|
|
74
|
+
KbTabs: typeof KB.KbTabs
|
|
75
|
+
KbTag: typeof KB.KbTag
|
|
76
|
+
KbTextarea: typeof KB.KbTextarea
|
|
77
|
+
KbTimePicker: typeof KB.KbTimePicker
|
|
78
|
+
KbTimeline: typeof KB.KbTimeline
|
|
79
|
+
KbTooltip: typeof KB.KbTooltip
|
|
80
|
+
KbTour: typeof KB.KbTour
|
|
81
|
+
KbTransfer: typeof KB.KbTransfer
|
|
82
|
+
KbTree: typeof KB.KbTree
|
|
83
|
+
KbTreeSelect: typeof KB.KbTreeSelect
|
|
84
|
+
KbUpload: typeof KB.KbUpload
|
|
85
|
+
KbVirtualList: typeof KB.KbVirtualList
|
|
86
|
+
KbWatermark: typeof KB.KbWatermark
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export {}
|