knt-shared 1.0.0 → 1.1.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.
Files changed (46) hide show
  1. package/README.md +390 -135
  2. package/dist/components/Description/BasicDescription.vue.d.ts +63 -0
  3. package/dist/components/Description/BasicDescription.vue.d.ts.map +1 -0
  4. package/dist/components/Description/index.d.ts +5 -0
  5. package/dist/components/Description/index.d.ts.map +1 -0
  6. package/dist/components/Description/types.d.ts +97 -0
  7. package/dist/components/Description/types.d.ts.map +1 -0
  8. package/dist/components/Description/useDescription.d.ts +10 -0
  9. package/dist/components/Description/useDescription.d.ts.map +1 -0
  10. package/dist/components/Form/componentMap.d.ts +691 -5
  11. package/dist/components/Form/componentMap.d.ts.map +1 -1
  12. package/dist/components/Form/types.d.ts +6 -3
  13. package/dist/components/Form/types.d.ts.map +1 -1
  14. package/dist/components/Form/useForm.d.ts.map +1 -1
  15. package/dist/components/Modal/BasicModal.vue.d.ts +118 -0
  16. package/dist/components/Modal/BasicModal.vue.d.ts.map +1 -0
  17. package/dist/components/Modal/index.d.ts +5 -0
  18. package/dist/components/Modal/index.d.ts.map +1 -0
  19. package/dist/components/Modal/types.d.ts +163 -0
  20. package/dist/components/Modal/types.d.ts.map +1 -0
  21. package/dist/components/Modal/useModal.d.ts +10 -0
  22. package/dist/components/Modal/useModal.d.ts.map +1 -0
  23. package/dist/components/Modal/useModalInner.d.ts +10 -0
  24. package/dist/components/Modal/useModalInner.d.ts.map +1 -0
  25. package/dist/components/Table/BasicTable.vue.d.ts +123 -0
  26. package/dist/components/Table/BasicTable.vue.d.ts.map +1 -0
  27. package/dist/components/Table/index.d.ts +7 -0
  28. package/dist/components/Table/index.d.ts.map +1 -0
  29. package/dist/components/Table/types.d.ts +337 -0
  30. package/dist/components/Table/types.d.ts.map +1 -0
  31. package/dist/components/Table/useTable.d.ts +23 -0
  32. package/dist/components/Table/useTable.d.ts.map +1 -0
  33. package/dist/components/index.d.ts +3 -0
  34. package/dist/components/index.d.ts.map +1 -1
  35. package/dist/index.cjs.js +2845 -121
  36. package/dist/index.cjs.js.map +1 -1
  37. package/dist/index.esm.js +2847 -123
  38. package/dist/index.esm.js.map +1 -1
  39. package/dist/style.css +98 -0
  40. package/dist/utils/debounce.d.ts +23 -0
  41. package/dist/utils/debounce.d.ts.map +1 -0
  42. package/dist/utils/index.d.ts +1 -0
  43. package/dist/utils/index.d.ts.map +1 -1
  44. package/package.json +12 -11
  45. package/dist/components/Form/BasicForm.vue.d.ts +0 -117
  46. package/dist/components/Form/BasicForm.vue.d.ts.map +0 -1
package/dist/style.css ADDED
@@ -0,0 +1,98 @@
1
+
2
+ .basic-table-wrapper[data-v-a77f6f35] {
3
+ background: var(--color-bg-2);
4
+ border-radius: 4px;
5
+ padding: 16px;
6
+ }
7
+ .basic-table-toolbar[data-v-a77f6f35] {
8
+ display: flex;
9
+ justify-content: space-between;
10
+ align-items: center;
11
+ /* padding: 12px 0; */
12
+ margin-bottom: 12px;
13
+ }
14
+ .toolbar-left[data-v-a77f6f35] {
15
+ display: flex;
16
+ align-items: center;
17
+ }
18
+ .toolbar-title[data-v-a77f6f35] {
19
+ font-size: 16px;
20
+ font-weight: 600;
21
+ color: var(--color-text-1);
22
+ }
23
+ .toolbar-right[data-v-a77f6f35] {
24
+ display: flex;
25
+ align-items: center;
26
+ }
27
+ .basic-table-search[data-v-a77f6f35] {
28
+ /* margin-bottom: 16px; */
29
+ /* padding: 16px; */
30
+ background: var(--color-bg-1);
31
+ border-radius: 4px;
32
+ }
33
+ .column-setting[data-v-a77f6f35] {
34
+ width: 200px;
35
+ max-height: 400px;
36
+ overflow-y: auto;
37
+ }
38
+ .column-setting-item[data-v-a77f6f35] {
39
+ padding: 8px 0;
40
+ }
41
+
42
+ .modal-wrapper[data-v-e288f849] {
43
+ padding: 0;
44
+ }
45
+ .modal-title-actions[data-v-e288f849] {
46
+ position: absolute;
47
+ right: 0;
48
+ top: 50%;
49
+ transform: translateY(-50%);
50
+ display: flex;
51
+ align-items: center;
52
+ gap: 0.5rem;
53
+ pointer-events: auto;
54
+ }
55
+ .modal-title-actions.has-close[data-v-e288f849] {
56
+ right: 1.5rem;
57
+ }
58
+ .cursor-help[data-v-e288f849] {
59
+ cursor: help;
60
+ }
61
+ .cursor-pointer[data-v-e288f849] {
62
+ cursor: pointer;
63
+ }
64
+ .text-gray-400[data-v-e288f849] {
65
+ color: #9ca3af;
66
+ }
67
+ .w-full[data-v-e288f849] {
68
+ width: 100%;
69
+ }
70
+
71
+ .basic-description[data-v-7c27763b] {
72
+ width: 100%;
73
+ }
74
+ .description-header[data-v-7c27763b] {
75
+ display: flex;
76
+ justify-content: space-between;
77
+ align-items: center;
78
+ margin-bottom: 16px;
79
+ }
80
+ .description-title[data-v-7c27763b] {
81
+ font-size: 16px;
82
+ font-weight: 600;
83
+ display: flex;
84
+ align-items: center;
85
+ }
86
+ .description-extra[data-v-7c27763b] {
87
+ font-size: 14px;
88
+ color: var(--color-text-3, #86909c);
89
+ }
90
+ .ml-2[data-v-7c27763b] {
91
+ margin-left: 8px;
92
+ }
93
+ .cursor-help[data-v-7c27763b] {
94
+ cursor: help;
95
+ }
96
+ .text-gray-400[data-v-7c27763b] {
97
+ color: var(--color-text-3, #86909c);
98
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * 防抖函数返回类型(带 cancel 方法)
3
+ */
4
+ export interface DebouncedFunction<T extends (...args: any[]) => any> {
5
+ (...args: Parameters<T>): void;
6
+ cancel: () => void;
7
+ }
8
+ /**
9
+ * 防抖函数
10
+ * @param func 需要防抖的函数
11
+ * @param wait 延迟时间(毫秒)
12
+ * @param immediate 是否立即执行
13
+ * @returns 防抖后的函数(带 cancel 方法)
14
+ */
15
+ export declare function debounce<T extends (...args: any[]) => any>(func: T, wait?: number, immediate?: boolean): DebouncedFunction<T>;
16
+ /**
17
+ * 节流函数
18
+ * @param func 需要节流的函数
19
+ * @param wait 延迟时间(毫秒)
20
+ * @returns 节流后的函数
21
+ */
22
+ export declare function throttle<T extends (...args: any[]) => any>(func: T, wait?: number): (...args: Parameters<T>) => void;
23
+ //# sourceMappingURL=debounce.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.d.ts","sourceRoot":"","sources":["../../src/utils/debounce.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG;IAClE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,GAAE,MAAY,EAClB,SAAS,GAAE,OAAe,GACzB,iBAAiB,CAAC,CAAC,CAAC,CAmCtB;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EACxD,IAAI,EAAE,CAAC,EACP,IAAI,GAAE,MAAY,GACjB,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,KAAK,IAAI,CAwBlC"}
@@ -1,3 +1,4 @@
1
1
  export * from './format';
2
2
  export * from './validate';
3
+ export * from './debounce';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,21 @@
1
1
  {
2
2
  "name": "knt-shared",
3
- "version": "1.0.0",
3
+ "version": "1.1.1",
4
4
  "description": "KNT共享组件库和工具函数",
5
5
  "author": "hss",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/Noah-Neverland/knt-shard.git"
9
- },
10
- "homepage": "https://github.com/Noah-Neverland/knt-shard.git#readme",
11
- "bugs": {
12
- "url": "https://github.com/Noah-Neverland/knt-shard/issues"
13
- },
14
- "main": "dist/index.js",
6
+ "main": "dist/index.cjs.js",
15
7
  "module": "dist/index.esm.js",
16
8
  "types": "dist/index.d.ts",
9
+ "style": "dist/style.css",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.esm.js",
13
+ "require": "./dist/index.cjs.js",
14
+ "types": "./dist/index.d.ts"
15
+ },
16
+ "./style.css": "./dist/style.css",
17
+ "./dist/style.css": "./dist/style.css"
18
+ },
17
19
  "files": [
18
20
  "dist"
19
21
  ],
@@ -51,4 +53,3 @@
51
53
  }
52
54
  }
53
55
  }
54
-
@@ -1,117 +0,0 @@
1
- import { FormSchema, BasicFormProps } from './types';
2
-
3
- declare function __VLS_template(): {
4
- actions?(_: {}): any;
5
- };
6
- declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BasicFormProps>, {
7
- schemas: () => never[];
8
- layout: string;
9
- labelAlign: string;
10
- autoSetPlaceHolder: boolean;
11
- showSubmitButton: boolean;
12
- showResetButton: boolean;
13
- submitButtonText: string;
14
- resetButtonText: string;
15
- showActionButtons: boolean;
16
- disabled: boolean;
17
- baseColProps: () => {
18
- span: number;
19
- };
20
- actionColOptions: () => {
21
- span: number;
22
- };
23
- }>>, {
24
- formRef: import('vue').Ref<any, any>;
25
- formModel: Record<string, any>;
26
- handleSubmit: (values: Record<string, any>) => Promise<void>;
27
- getVisibleSchemas: () => FormSchema[];
28
- getColProps: (schema: FormSchema) => Record<string, any>;
29
- getFormItemBindValue: (schema: FormSchema) => {
30
- field: string;
31
- label: string;
32
- labelColProps: Record<string, any> | undefined;
33
- wrapperColProps: Record<string, any> | undefined;
34
- rules: any[] | undefined;
35
- disabled: boolean | undefined;
36
- help: string | undefined;
37
- extra: string | undefined;
38
- required: boolean | undefined;
39
- };
40
- getPlaceholderText: (schema: FormSchema) => any;
41
- getFieldsValue: () => Record<string, any>;
42
- setFieldsValue: (values: Record<string, any>) => void;
43
- resetFields: () => void;
44
- validate: () => Promise<any>;
45
- clearValidate: (field?: string | string[]) => void;
46
- updateSchema: (schema: Partial<FormSchema> | Partial<FormSchema>[]) => void;
47
- removeSchema: (field: string | string[]) => void;
48
- getSchema: (field?: string) => FormSchema | FormSchema[] | undefined;
49
- resetSchema: (schemas: FormSchema[]) => void;
50
- setProps: (formProps: Partial<BasicFormProps>) => void;
51
- scrollToField: (name: string, options?: ScrollIntoViewOptions) => void;
52
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
53
- register: (formInstance: any) => void;
54
- submit: (values: Record<string, any>) => void;
55
- reset: () => void;
56
- validate: (field: string, valid: boolean, message: string) => void;
57
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<BasicFormProps>, {
58
- schemas: () => never[];
59
- layout: string;
60
- labelAlign: string;
61
- autoSetPlaceHolder: boolean;
62
- showSubmitButton: boolean;
63
- showResetButton: boolean;
64
- submitButtonText: string;
65
- resetButtonText: string;
66
- showActionButtons: boolean;
67
- disabled: boolean;
68
- baseColProps: () => {
69
- span: number;
70
- };
71
- actionColOptions: () => {
72
- span: number;
73
- };
74
- }>>> & Readonly<{
75
- onRegister?: ((formInstance: any) => any) | undefined;
76
- onSubmit?: ((values: Record<string, any>) => any) | undefined;
77
- onReset?: (() => any) | undefined;
78
- onValidate?: ((field: string, valid: boolean, message: string) => any) | undefined;
79
- }>, {
80
- disabled: boolean;
81
- schemas: FormSchema[];
82
- layout: "horizontal" | "vertical" | "inline";
83
- labelAlign: "left" | "right";
84
- baseColProps: Record<string, any>;
85
- actionColOptions: Record<string, any>;
86
- autoSetPlaceHolder: boolean;
87
- showSubmitButton: boolean;
88
- showResetButton: boolean;
89
- submitButtonText: string;
90
- resetButtonText: string;
91
- showActionButtons: boolean;
92
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
93
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
94
- export default _default;
95
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
96
- type __VLS_TypePropsToRuntimeProps<T> = {
97
- [K in keyof T]-?: {} extends Pick<T, K> ? {
98
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
99
- } : {
100
- type: import('vue').PropType<T[K]>;
101
- required: true;
102
- };
103
- };
104
- type __VLS_WithDefaults<P, D> = {
105
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
106
- default: D[K];
107
- }> : P[K];
108
- };
109
- type __VLS_Prettify<T> = {
110
- [K in keyof T]: T[K];
111
- } & {};
112
- type __VLS_WithTemplateSlots<T, S> = T & {
113
- new (): {
114
- $slots: S;
115
- };
116
- };
117
- //# sourceMappingURL=BasicForm.vue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BasicForm.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Form/BasicForm.vue"],"names":[],"mappings":"AAyDA;AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAkB,MAAM,SAAS,CAAC;AAuW1E,iBAAS,cAAc;qBA+MO,GAAG;EAGhC;AAsBD,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;2BA7be,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;0BApD1B,UAAU;mCAMD,UAAU;;;;;;;;;;;iCA2BZ,UAAU;0BAsCnB,MAAM,CAAC,MAAM,EAAE,GAAG,CA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