@kayak-sj/design 1.0.49 → 1.0.51
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/assets/Complex-2LP9XsDR.css +1 -0
- package/dist/assets/{components-crJ55-Y9.css → componentRegistry-BhoC2OWH.css} +1 -1
- package/dist/assets/index-Biv6Btn_.css +1 -0
- package/dist/chunks/{Complex-C7w3K3P5.js → Complex-CijuFsnI.js} +3 -3
- package/dist/chunks/componentRegistry-BCjeWYov.js +2389 -0
- package/dist/components/k-editor/utils/editorValue.d.ts +50 -10
- package/dist/components/k-form/composables/useFormSchema.d.ts +16 -0
- package/dist/components/k-form/composables/useKFormFields.d.ts +7 -2
- package/dist/components/k-form/composables/useKFormModel.d.ts +20 -3
- package/dist/components/k-form/composables/useKFormTemplateRef.d.ts +4 -0
- package/dist/components/k-form/formComponent/componentRegistry.d.ts +10 -3
- package/dist/components/k-form/utils/fieldValue.d.ts +51 -4
- package/dist/components/k-form/utils/formRules.d.ts +6 -0
- package/dist/components/k-form/utils/resolveFormFieldComponent.d.ts +15 -2
- package/dist/components/k-handle-page/useHandlePageInit.d.ts +13 -1
- package/dist/components/k-icon/resolveLucideIcon.d.ts +23 -4
- package/dist/components/k-table/composables/useColumnDisplay.d.ts +4 -0
- package/dist/components/k-table/composables/useKTable.d.ts +27 -2
- package/dist/components/k-table/composables/useKTableCrossPageSelection.d.ts +26 -0
- package/dist/components/k-table/composables/useKTableTemplateRef.d.ts +10 -0
- package/dist/components/k-table/composables/useTableColumns.d.ts +14 -2
- package/dist/components/k-table/composables/useTableData.d.ts +28 -5
- package/dist/components/k-table/composables/useTablePagination.d.ts +3 -0
- package/dist/components/k-table/composables/useTableRadio.d.ts +9 -0
- package/dist/components/k-table/composables/useTableRowSort.d.ts +9 -0
- package/dist/components/k-table/composables/useTableTreeLoad.d.ts +12 -0
- package/dist/components/k-table/dictOptions.d.ts +6 -1
- package/dist/components/k-table/report/exportKTableReport.d.ts +30 -5
- package/dist/components/k-table/types.d.ts +4 -0
- package/dist/components/k-upload/utils/uploadFileValue.d.ts +40 -12
- package/dist/config/uploadConfig.d.ts +11 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.js +2641 -50
- package/dist/theme/index.d.ts +7 -3
- package/dist/utils/createStubComponent.d.ts +12 -1
- package/dist/utils/validators.d.ts +38 -6
- package/package.json +2 -7
- package/src/styles/components/_k-handle-page.scss +7 -4
- package/dist/assets/Complex-DIKmdv9F.css +0 -1
- package/dist/chunks/components-MlPbHyef.js +0 -4976
- package/dist/components/index.js +0 -3
package/dist/theme/index.d.ts
CHANGED
|
@@ -6,15 +6,19 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export type DesignTheme = 'kayak' | 'blue-pro' | 'dark';
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* 获取当前设计主题(读 `html[data-theme]`)。
|
|
10
|
+
*
|
|
11
|
+
* @returns 当前主题标识;未设置或未知时回退 `'kayak'`
|
|
10
12
|
*/
|
|
11
13
|
export declare function getDesignTheme(): DesignTheme;
|
|
12
14
|
/**
|
|
13
|
-
* 切换设计主题(写入 html[data-theme] 并持久化到 localStorage
|
|
15
|
+
* 切换设计主题(写入 `html[data-theme]` 并持久化到 localStorage)。
|
|
16
|
+
*
|
|
17
|
+
* @param theme - 目标主题,见 {@link DesignTheme}
|
|
14
18
|
*/
|
|
15
19
|
export declare function setDesignTheme(theme: DesignTheme): void;
|
|
16
20
|
/**
|
|
17
21
|
* 从 localStorage 恢复上次选择的主题;无记录时使用 kayak 默认主题。
|
|
18
|
-
* 应用启动时尽早调用(建议在 main.ts 顶部)。
|
|
22
|
+
* 应用启动时尽早调用(建议在 `main.ts` 顶部)。
|
|
19
23
|
*/
|
|
20
24
|
export declare function initDesignTheme(): void;
|
|
@@ -1,7 +1,18 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* 创建迁移占位组件,业务页接入后可逐个替换为真实实现。
|
|
3
|
+
*
|
|
4
|
+
* @param name - 组件名(同时作为 `defineComponent.name` 与 `data-component`)
|
|
5
|
+
* @returns 仅渲染占位文案的 Vue 组件
|
|
6
|
+
*/
|
|
2
7
|
export declare function createStubComponent(name: string): import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
3
8
|
[key: string]: any;
|
|
4
9
|
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
10
|
+
/**
|
|
11
|
+
* Lucide 图标未命中时的占位组件(显示首字母虚线框)。
|
|
12
|
+
*
|
|
13
|
+
* @param name - 原始图标 slug,用于 `title` / `data-icon`
|
|
14
|
+
* @returns 占位 span 组件
|
|
15
|
+
*/
|
|
5
16
|
export declare function createLucideStubComponent(name?: string): import('vue').DefineComponent<{}, () => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
6
17
|
[key: string]: any;
|
|
7
18
|
}>, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
@@ -23,9 +23,10 @@ export declare const DECIMAL_MONEY_PATTERN: RegExp;
|
|
|
23
23
|
/**
|
|
24
24
|
* 正则校验器工厂(对齐 legacy createValidator / cms-base 同名函数)。
|
|
25
25
|
*
|
|
26
|
-
* @param pattern
|
|
27
|
-
* @param message
|
|
28
|
-
* @param required 为 false 时,空值直接通过;为 true 时空值也报错
|
|
26
|
+
* @param pattern - 待测正则
|
|
27
|
+
* @param message - 校验失败提示
|
|
28
|
+
* @param required - 为 false 时,空值直接通过;为 true 时空值也报错
|
|
29
|
+
* @returns Element Plus `FormItemRule['validator']`
|
|
29
30
|
*/
|
|
30
31
|
export declare function createPatternValidator(pattern: RegExp, message: string, required?: boolean): NonNullable<FormItemRule['validator']>;
|
|
31
32
|
/**
|
|
@@ -42,21 +43,39 @@ export declare function cnAlphaNumRule(max: number, label: string, required?: bo
|
|
|
42
43
|
* 比 `cnAlphaNumRule` 宽松,适用于权益名、合同名、商品名等允许标点的情况。
|
|
43
44
|
*
|
|
44
45
|
* 通常与 `{ required: true, message: '...' }` 组合使用。
|
|
46
|
+
*
|
|
47
|
+
* @param max - 最大长度
|
|
48
|
+
* @param label - 字段名,用于失败提示
|
|
49
|
+
* @param required - 是否必填(空值是否报错)
|
|
45
50
|
*/
|
|
46
51
|
export declare function mixedNameRule(max: number, label: string, required?: boolean): FormItemRule;
|
|
47
52
|
/**
|
|
48
53
|
* 字母 / 数字 / 下划线编码,长度 1–max。
|
|
49
54
|
* 适用于商品编号、微信批次号、支付宝活动 ID 等。
|
|
55
|
+
*
|
|
56
|
+
* @param max - 最大长度
|
|
57
|
+
* @param label - 字段名,用于失败提示
|
|
58
|
+
* @param required - 是否必填(空值是否报错)
|
|
50
59
|
*/
|
|
51
60
|
export declare function alphaNumCodeRule(max: number, label: string, required?: boolean): FormItemRule;
|
|
52
61
|
/**
|
|
53
62
|
* 手机号校验(`PHONE_PATTERN`)。
|
|
54
63
|
* 仅含 validator,required 提示需由调用方另配 `{ required: true, message: '...' }`。
|
|
64
|
+
*
|
|
65
|
+
* @param message - 校验失败提示
|
|
55
66
|
*/
|
|
56
67
|
export declare function phoneRule(message?: string): FormItemRule;
|
|
57
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* 统一社会信用代码校验(`USC_CODE_PATTERN`)。
|
|
70
|
+
*
|
|
71
|
+
* @param message - 校验失败提示
|
|
72
|
+
*/
|
|
58
73
|
export declare function uscCodeRule(message?: string): FormItemRule;
|
|
59
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* 银行打款账号校验(`BANK_ACCOUNT_PATTERN`),1–20 位数字。
|
|
76
|
+
*
|
|
77
|
+
* @param message - 校验失败提示
|
|
78
|
+
*/
|
|
60
79
|
export declare function bankAccountRule(message?: string): FormItemRule;
|
|
61
80
|
/**
|
|
62
81
|
* HTTP/HTTPS 链接校验(`HTTP_URL_PATTERN`)。
|
|
@@ -71,14 +90,22 @@ export declare function positiveIntRule(message?: string, required?: boolean): F
|
|
|
71
90
|
/**
|
|
72
91
|
* 非负整数(含 0);空值不校验。
|
|
73
92
|
* 适用于必填的数量类字段,如「同业合作案例数量」。
|
|
93
|
+
*
|
|
94
|
+
* @param message - 校验失败提示
|
|
74
95
|
*/
|
|
75
96
|
export declare function nonNegativeIntRule(message: string): FormItemRule;
|
|
76
97
|
/**
|
|
77
98
|
* 非负整数或空串;空值通过。
|
|
78
99
|
* 适用于选填的数量类字段,如「人员数量」「分公司数量」。
|
|
100
|
+
*
|
|
101
|
+
* @param message - 校验失败提示
|
|
79
102
|
*/
|
|
80
103
|
export declare function optionalNonNegativeIntRule(message: string): FormItemRule;
|
|
81
|
-
/**
|
|
104
|
+
/**
|
|
105
|
+
* 18 位二代居民身份证(`ID_CODE_PATTERN`)。
|
|
106
|
+
*
|
|
107
|
+
* @param required - 是否必填
|
|
108
|
+
*/
|
|
82
109
|
export declare function idCodeRule(required?: boolean): FormItemRule;
|
|
83
110
|
/**
|
|
84
111
|
* 金额校验规则组(返回 `[required, validator]` 两条,直接赋给 `rules`)。
|
|
@@ -87,6 +114,11 @@ export declare function idCodeRule(required?: boolean): FormItemRule;
|
|
|
87
114
|
* - 整数位最多 `maxInt`(默认 11),小数最多 2 位
|
|
88
115
|
* - `required: false` 时空值跳过格式校验(对客优惠价等选填场景)
|
|
89
116
|
*
|
|
117
|
+
* @param label - 字段名,用于「请输入{label}」等提示
|
|
118
|
+
* @param opts.required - 是否必填,默认 `true`
|
|
119
|
+
* @param opts.maxInt - 整数最大位数,默认 `11`
|
|
120
|
+
* @returns Element Plus `FormItemRule[]`
|
|
121
|
+
*
|
|
90
122
|
* @example
|
|
91
123
|
* rules: moneyRule('成本价')
|
|
92
124
|
* rules: moneyRule('对客优惠价', { required: false })
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kayak-sj/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.51",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "PC 组件库(Vue3 + Element Plus,对应旧 @kayak/kayak-design-vue2)",
|
|
6
6
|
"license": "ISC",
|
|
@@ -24,11 +24,6 @@
|
|
|
24
24
|
"types": "./src/types/design-subpaths.d.ts",
|
|
25
25
|
"default": "./src/styles/tokens/_index.scss"
|
|
26
26
|
},
|
|
27
|
-
"./components": {
|
|
28
|
-
"types": "./dist/components/index.d.ts",
|
|
29
|
-
"import": "./dist/components/index.js",
|
|
30
|
-
"default": "./dist/components/index.js"
|
|
31
|
-
},
|
|
32
27
|
"./echarts": {
|
|
33
28
|
"types": "./dist/components/k-echarts/index.d.ts",
|
|
34
29
|
"import": "./dist/components/k-echarts/index.js",
|
|
@@ -73,7 +68,7 @@
|
|
|
73
68
|
"element-plus": "2.14.4",
|
|
74
69
|
"lucide-vue-next": "^1.0.0",
|
|
75
70
|
"sass": "^1.89.2",
|
|
76
|
-
"typescript": "^
|
|
71
|
+
"typescript": "^6.0.3",
|
|
77
72
|
"vite": "^8.1.5",
|
|
78
73
|
"vitest": "^4.1.10",
|
|
79
74
|
"vue": "^3.5.13",
|
|
@@ -5,13 +5,16 @@
|
|
|
5
5
|
min-height: 100%;
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* 叠层约定(与 AdminTags 对齐):
|
|
9
|
+
* 2 — sticky 壳(本页 header/footer、页签),只压文档流
|
|
10
|
+
* 10 — 活动等业务面板(如右侧抽屉)
|
|
11
|
+
* 12 — 本页 loading
|
|
12
|
+
* 勿把 header/footer 提到 ≥10,否则会盖住面板内 ElImageViewer 预览
|
|
10
13
|
*/
|
|
11
14
|
&__header {
|
|
12
15
|
position: sticky;
|
|
13
16
|
top: var(--k-handle-page-inset-y, var(--k-page-padding-y));
|
|
14
|
-
z-index:
|
|
17
|
+
z-index: 2;
|
|
15
18
|
flex-shrink: 0;
|
|
16
19
|
background: var(--k-color-bg-surface);
|
|
17
20
|
|
|
@@ -93,7 +96,7 @@
|
|
|
93
96
|
&__footer {
|
|
94
97
|
position: sticky;
|
|
95
98
|
bottom: 0;
|
|
96
|
-
z-index:
|
|
99
|
+
z-index: 2;
|
|
97
100
|
flex-shrink: 0;
|
|
98
101
|
display: flex;
|
|
99
102
|
justify-content: center;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.k-form-complex[data-v-f767d9ba]{flex-wrap:nowrap;align-items:center;gap:8px;width:100%;display:flex}.k-form-complex[data-v-f767d9ba] .k-form-input,.k-form-complex[data-v-f767d9ba] .k-form-select{flex:none;min-width:0}.k-form-complex[data-v-f767d9ba] .k-form-select .el-select{width:var(--k-form-complex-select-width,120px)}.k-form-complex[data-v-f767d9ba] .k-form-input .el-input{width:var(--k-form-complex-input-width,120px)}.k-form-complex--stretch[data-v-f767d9ba] .k-form-input,.k-form-complex--stretch[data-v-f767d9ba] .k-form-select{flex:1 1 0}.k-form-complex--stretch[data-v-f767d9ba] .k-form-select .el-select,.k-form-complex--stretch[data-v-f767d9ba] .k-form-input .el-input{width:100%}
|