@gx-design-vue/pro-utils 0.1.4 → 0.2.0-alpha.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/LICENSE +21 -0
- package/README.md +73 -2
- package/dist/array/index.d.ts +5 -0
- package/dist/array/index.js +6 -0
- package/dist/array/slice.d.ts +11 -0
- package/dist/array/slice.js +29 -0
- package/dist/array/sort.d.ts +41 -0
- package/dist/array/sort.js +65 -0
- package/dist/array/tree.d.ts +83 -0
- package/dist/array/tree.js +157 -0
- package/dist/array/unique.d.ts +12 -0
- package/dist/array/unique.js +14 -0
- package/dist/base64/index.d.ts +26 -0
- package/dist/base64/index.js +106 -0
- package/dist/class/index.d.ts +2 -0
- package/dist/class/index.js +3 -0
- package/dist/class/prefix.d.ts +25 -0
- package/dist/class/prefix.js +15 -0
- package/dist/clone/cloneDeep.d.ts +30 -0
- package/dist/clone/cloneDeep.js +35 -0
- package/dist/clone/cloneDeepWith.d.ts +14 -0
- package/dist/clone/cloneDeepWith.js +150 -0
- package/dist/clone/getTag.d.ts +10 -0
- package/dist/clone/getTag.js +13 -0
- package/dist/clone/index.d.ts +3 -0
- package/dist/clone/index.js +4 -0
- package/dist/clone/symbols.d.ts +10 -0
- package/dist/clone/symbols.js +13 -0
- package/dist/clone/tags.d.ts +47 -0
- package/dist/clone/tags.js +48 -0
- package/dist/dom/event.d.ts +21 -0
- package/dist/dom/event.js +26 -0
- package/dist/dom/index.d.ts +5 -0
- package/dist/dom/index.js +6 -0
- package/dist/dom/measure.d.ts +19 -0
- package/dist/dom/measure.js +42 -0
- package/dist/dom/raf.d.ts +14 -0
- package/dist/dom/raf.js +44 -0
- package/dist/dom/scroll.d.ts +20 -0
- package/dist/dom/scroll.js +97 -0
- package/dist/file/config.d.ts +13 -0
- package/dist/file/config.js +81 -0
- package/dist/file/convert.d.ts +41 -0
- package/dist/file/convert.js +69 -0
- package/dist/file/index.d.ts +5 -0
- package/dist/file/index.js +6 -0
- package/dist/file/media.d.ts +35 -0
- package/dist/file/media.js +161 -0
- package/dist/file/type.d.ts +25 -0
- package/dist/file/type.js +58 -0
- package/dist/function/copy.d.ts +12 -0
- package/dist/function/copy.js +13 -0
- package/dist/function/getValue.d.ts +12 -0
- package/dist/function/getValue.js +19 -0
- package/dist/function/index.d.ts +5 -0
- package/dist/function/index.js +6 -0
- package/dist/function/object.d.ts +24 -0
- package/dist/function/object.js +33 -0
- package/dist/function/run.d.ts +11 -0
- package/dist/function/run.js +15 -0
- package/dist/index.d.ts +59 -26
- package/dist/index.js +61 -0
- package/dist/is/base64.d.ts +17 -0
- package/dist/is/base64.js +27 -0
- package/dist/is/browser.d.ts +9 -0
- package/dist/is/browser.js +14 -0
- package/dist/is/deepEqual.d.ts +13 -0
- package/dist/is/deepEqual.js +62 -0
- package/dist/is/device.d.ts +21 -0
- package/dist/is/device.js +37 -0
- package/dist/is/equal.d.ts +12 -0
- package/dist/is/equal.js +34 -0
- package/dist/is/img.d.ts +10 -0
- package/dist/is/img.js +13 -0
- package/dist/is/index.d.ts +16 -0
- package/dist/is/index.js +17 -0
- package/dist/is/nil.d.ts +17 -0
- package/dist/is/nil.js +22 -0
- package/dist/is/plainObject.d.ts +17 -0
- package/dist/is/plainObject.js +30 -0
- package/dist/is/primitive.d.ts +10 -0
- package/dist/is/primitive.js +13 -0
- package/dist/is/server.d.ts +9 -0
- package/dist/is/server.js +10 -0
- package/dist/is/type.d.ts +60 -0
- package/dist/is/type.js +84 -0
- package/dist/is/typedArray.d.ts +30 -0
- package/dist/is/typedArray.js +33 -0
- package/dist/is/unsafeProperty.d.ts +10 -0
- package/dist/is/unsafeProperty.js +18 -0
- package/dist/is/url.d.ts +10 -0
- package/dist/is/url.js +20 -0
- package/dist/is/valid.d.ts +17 -0
- package/dist/is/valid.js +23 -0
- package/dist/merge/index.d.ts +19 -5
- package/dist/merge/index.js +42 -0
- package/dist/merge/mergeWith.d.ts +12 -0
- package/dist/merge/mergeWith.js +31 -0
- package/dist/merge/useDeepMege.d.ts +46 -0
- package/dist/merge/useDeepMege.js +56 -0
- package/dist/number/chinese.d.ts +10 -0
- package/dist/number/chinese.js +46 -0
- package/dist/number/format.d.ts +27 -0
- package/dist/number/format.js +72 -0
- package/dist/number/index.d.ts +3 -0
- package/dist/number/index.js +4 -0
- package/dist/object/classNames.d.ts +10 -0
- package/dist/object/classNames.js +30 -0
- package/dist/object/index.d.ts +5 -0
- package/dist/object/index.js +6 -0
- package/dist/object/omitBoolean.d.ts +10 -0
- package/dist/object/omitBoolean.js +13 -0
- package/dist/object/omitUndefined.d.ts +12 -0
- package/dist/object/omitUndefined.js +18 -0
- package/dist/object/omitUndefinedAndEmptyArr.d.ts +10 -0
- package/dist/object/omitUndefinedAndEmptyArr.js +19 -0
- package/dist/pro-utils.esm.js +948 -0
- package/dist/pro-utils.js +1 -0
- package/dist/string/duration.d.ts +10 -0
- package/dist/string/duration.js +25 -0
- package/dist/string/empty.d.ts +14 -0
- package/dist/string/empty.js +26 -0
- package/dist/string/index.d.ts +5 -0
- package/dist/string/index.js +6 -0
- package/dist/string/nanoid.d.ts +9 -0
- package/dist/string/nanoid.js +32 -0
- package/dist/string/uuid.d.ts +34 -0
- package/dist/string/uuid.js +57 -0
- package/dist/table/column.d.ts +27 -0
- package/dist/table/column.js +42 -0
- package/dist/table/index.d.ts +3 -0
- package/dist/table/index.js +4 -0
- package/dist/table/page.d.ts +13 -0
- package/dist/table/page.js +23 -0
- package/dist/typing.d.ts +262 -0
- package/dist/typing.js +1 -0
- package/dist/vue/index.d.ts +2 -0
- package/dist/vue/index.js +3 -0
- package/dist/vue/slots.d.ts +56 -0
- package/dist/vue/slots.js +89 -0
- package/package.json +45 -64
- package/dist/classNames/index.d.ts +0 -2
- package/dist/components/FieldLabel/index.d.ts +0 -77
- package/dist/components/FieldLabel/index.less +0 -107
- package/dist/components/LabelIconTip/index.d.ts +0 -20
- package/dist/components/LabelIconTip/index.less +0 -38
- package/dist/design/ant-design-theme.less +0 -4
- package/dist/design/ant-design-vue.less +0 -1
- package/dist/design/config.less +0 -2
- package/dist/isBrowser/index.d.ts +0 -1
- package/dist/isDeepEqualReact/index.d.ts +0 -1
- package/dist/isServer.d.ts +0 -2
- package/dist/omitBoolean/index.d.ts +0 -6
- package/dist/omitUndefined/index.d.ts +0 -5
- package/dist/pro-utils.es.js +0 -1044
- package/dist/pro-utils.umd.js +0 -1
- package/dist/proUtils.less +0 -4
- package/dist/scroll/easings.d.ts +0 -1
- package/dist/scroll/getScroll.d.ts +0 -2
- package/dist/scroll/index.d.ts +0 -4
- package/dist/scroll/raf.d.ts +0 -9
- package/dist/scroll/scrollTo.d.ts +0 -10
- package/dist/scroll/throttleByAnimationFrame.d.ts +0 -5
- package/dist/slots/index.d.ts +0 -9
- package/dist/style/index.less +0 -2
- package/dist/style.css +0 -1
- package/dist/style.less +0 -3
- package/dist/typings/index.d.ts +0 -30
- package/dist/utils/config.d.ts +0 -8
- package/dist/utils/index.d.ts +0 -208
- package/dist/utils/validate.d.ts +0 -25
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { CustomRender, WithFalse } from "../typing.js";
|
|
2
|
+
import * as vue0 from "vue";
|
|
3
|
+
import { VNode } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/vue/slots.d.ts
|
|
6
|
+
type SlotsPropsResult<S extends object, K extends keyof S, R extends boolean, D = any> = { [P in K]: R extends true ? D extends undefined ? WithFalse<CustomRender> : CustomRender : D extends undefined ? (S[P] | false) : CustomRender };
|
|
7
|
+
type RenderResult<S extends object, K extends keyof S, R extends boolean, D = any> = R extends true ? D extends undefined ? WithFalse<CustomRender> : CustomRender : D extends undefined ? (S[K] | false) : CustomRender;
|
|
8
|
+
declare function getKeys(keys: string | string[]): string;
|
|
9
|
+
declare function isEmptyElement(c: any): boolean;
|
|
10
|
+
declare function getSlotsChildren<T extends object = Record<string, any>>(slots: T, key: keyof T): VNode[];
|
|
11
|
+
declare function filterEmpty(vnode?: any, isEmpty?: boolean): VNode<vue0.RendererNode, vue0.RendererElement, {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}>[];
|
|
14
|
+
declare function slotRender({
|
|
15
|
+
vnode,
|
|
16
|
+
defaultVNode
|
|
17
|
+
}: {
|
|
18
|
+
vnode: any;
|
|
19
|
+
defaultVNode?: any;
|
|
20
|
+
}, ...arg: any): any;
|
|
21
|
+
declare function getSlot<S extends object, K extends keyof S = keyof S, R extends boolean = false>(options: {
|
|
22
|
+
slots: S;
|
|
23
|
+
props: Record<string, any>;
|
|
24
|
+
key: K;
|
|
25
|
+
render?: R;
|
|
26
|
+
defaultChildren?: undefined;
|
|
27
|
+
}, ...arg: any): RenderResult<S, K, R, undefined>;
|
|
28
|
+
declare function getSlot<S extends object, K extends keyof S = keyof S, R extends boolean = false>(options: {
|
|
29
|
+
slots: S;
|
|
30
|
+
props: Record<string, any>;
|
|
31
|
+
key: K;
|
|
32
|
+
render?: R;
|
|
33
|
+
defaultChildren: any;
|
|
34
|
+
}, ...arg: any): RenderResult<S, K, R>;
|
|
35
|
+
declare function getSlotVNode<S extends object, K extends keyof S = keyof S>(options: {
|
|
36
|
+
slots: S;
|
|
37
|
+
props: Record<string, any>;
|
|
38
|
+
key: K;
|
|
39
|
+
defaultChildren?: any;
|
|
40
|
+
}, ...arg: any): WithFalse<CustomRender>;
|
|
41
|
+
declare function getSlotsProps<S extends object, K extends keyof S = keyof S, R extends boolean = false>(options: {
|
|
42
|
+
slots: S;
|
|
43
|
+
props: Record<string, any>;
|
|
44
|
+
keys: K[];
|
|
45
|
+
render?: R;
|
|
46
|
+
defaultVNodes?: undefined;
|
|
47
|
+
}, ...arg: any): SlotsPropsResult<S, K, R, undefined>;
|
|
48
|
+
declare function getSlotsProps<S extends object, K extends keyof S = keyof S, R extends boolean = false>(options: {
|
|
49
|
+
slots: S;
|
|
50
|
+
props: Record<string, any>;
|
|
51
|
+
keys: K[];
|
|
52
|
+
render?: R;
|
|
53
|
+
defaultVNodes?: any;
|
|
54
|
+
}, ...arg: any): SlotsPropsResult<S, K, R>;
|
|
55
|
+
//#endregion
|
|
56
|
+
export { RenderResult, SlotsPropsResult, filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { isBoolean, isObject } from "../is/type.js";
|
|
2
|
+
import { isValid } from "../is/valid.js";
|
|
3
|
+
import "../is/index.js";
|
|
4
|
+
import { Comment, Fragment, isVNode } from "vue";
|
|
5
|
+
|
|
6
|
+
//#region src/vue/slots.ts
|
|
7
|
+
function getKeys(keys) {
|
|
8
|
+
if (typeof keys !== "string" && !Array.isArray(keys)) return;
|
|
9
|
+
return Array.isArray(keys) ? keys[keys.length - 1] : keys.split(":")?.slice(-1)[0];
|
|
10
|
+
}
|
|
11
|
+
function isEmptyElement(c) {
|
|
12
|
+
return c && (c.type === Comment || c.type === Fragment && c.children.length === 0 || c.type === Text && c.children.trim() === "");
|
|
13
|
+
}
|
|
14
|
+
function getSlotsChildren(slots, key) {
|
|
15
|
+
return filterEmpty(typeof slots[key] === "function" ? slots[key]?.() : []);
|
|
16
|
+
}
|
|
17
|
+
function filterEmpty(vnode = [], isEmpty = true) {
|
|
18
|
+
const temp = Array.isArray(vnode) ? vnode : [vnode];
|
|
19
|
+
const children = [];
|
|
20
|
+
temp.forEach((child) => {
|
|
21
|
+
if (Array.isArray(child)) children.push(...filterEmpty(child, isEmpty));
|
|
22
|
+
else if (child?.type === Fragment || child?.type === "template") children.push(...filterEmpty(child.children, isEmpty));
|
|
23
|
+
else if (child && isVNode(child)) {
|
|
24
|
+
if (isEmpty && !isEmptyElement(child)) children.push(child);
|
|
25
|
+
else if (!isEmpty) children.push(child);
|
|
26
|
+
} else if (isValid(child)) children.push(child);
|
|
27
|
+
});
|
|
28
|
+
return children;
|
|
29
|
+
}
|
|
30
|
+
function slotRender({ vnode, defaultVNode }, ...arg) {
|
|
31
|
+
return vnode === false ? null : typeof vnode === "function" ? vnode?.(...arg) : vnode || defaultVNode;
|
|
32
|
+
}
|
|
33
|
+
function getSlot(options, ...arg) {
|
|
34
|
+
const { slots, key = "default", render, props, defaultChildren } = options;
|
|
35
|
+
let result;
|
|
36
|
+
const value = props[key];
|
|
37
|
+
const slotsValue = slots?.[key];
|
|
38
|
+
const defaultVNode = typeof defaultChildren === "function" ? defaultChildren?.() : defaultChildren;
|
|
39
|
+
if (value === false) result = false;
|
|
40
|
+
else if (value === true) result = slotsValue ?? defaultVNode;
|
|
41
|
+
else if (isObject(value)) if (render) if (isVNode(value)) result = value;
|
|
42
|
+
else result = slotsValue;
|
|
43
|
+
else result = value || slotsValue;
|
|
44
|
+
else result = value || slotsValue;
|
|
45
|
+
return result === false ? false : render ? slotRender({
|
|
46
|
+
vnode: result,
|
|
47
|
+
defaultVNode
|
|
48
|
+
}, ...arg) : result;
|
|
49
|
+
}
|
|
50
|
+
function getSlotVNode(options, ...arg) {
|
|
51
|
+
const { slots, key = "default", props, defaultChildren } = options;
|
|
52
|
+
let result;
|
|
53
|
+
const value = props[key];
|
|
54
|
+
const slotsValue = slots?.[key]?.(...arg);
|
|
55
|
+
const defaultVNode = typeof defaultChildren === "function" ? defaultChildren?.() : defaultChildren;
|
|
56
|
+
if (value === false) result = false;
|
|
57
|
+
else if (value === true) result = slotsValue ?? defaultVNode;
|
|
58
|
+
else if (isObject(value)) if (isVNode(value)) result = value;
|
|
59
|
+
else result = slotsValue;
|
|
60
|
+
else result = value || slotsValue;
|
|
61
|
+
return result === false ? false : slotRender({
|
|
62
|
+
vnode: result,
|
|
63
|
+
defaultVNode
|
|
64
|
+
}, ...arg);
|
|
65
|
+
}
|
|
66
|
+
function getSlotsProps(options, ...arg) {
|
|
67
|
+
const { slots, props, keys, render, defaultVNodes } = options;
|
|
68
|
+
const renderMap = {};
|
|
69
|
+
keys.forEach((key, index) => {
|
|
70
|
+
const defaultChildren = defaultVNodes ? defaultVNodes[index] : null;
|
|
71
|
+
const slotComponents = render ? getSlotVNode({
|
|
72
|
+
slots,
|
|
73
|
+
props,
|
|
74
|
+
key,
|
|
75
|
+
defaultChildren
|
|
76
|
+
}, ...arg) : getSlot({
|
|
77
|
+
slots,
|
|
78
|
+
props,
|
|
79
|
+
key,
|
|
80
|
+
render: false,
|
|
81
|
+
defaultChildren
|
|
82
|
+
}, ...arg);
|
|
83
|
+
if (isBoolean(slotComponents) || slotComponents) renderMap[key] = slotComponents;
|
|
84
|
+
});
|
|
85
|
+
return renderMap;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender };
|
package/package.json
CHANGED
|
@@ -1,72 +1,53 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gx-design-vue/pro-utils",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.2.0-alpha.1",
|
|
5
|
+
"description": "Gx Design Pro Utils",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "gx12358",
|
|
8
|
+
"email": "gx12358@gmail.com",
|
|
9
|
+
"url": "https://github.com/gx12358"
|
|
10
|
+
},
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/gx12358/pro-components-next.git",
|
|
15
|
+
"directory": "packages/pro-utils"
|
|
12
16
|
},
|
|
13
|
-
"files": [
|
|
14
|
-
"dist"
|
|
15
|
-
],
|
|
16
|
-
"types": "./dist",
|
|
17
|
-
"main": "./dist/pro-utils.umd.js",
|
|
18
|
-
"module": "./dist/pro-utils.es.js",
|
|
19
17
|
"exports": {
|
|
20
18
|
".": {
|
|
21
|
-
"
|
|
22
|
-
"
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js",
|
|
21
|
+
"default": "./dist/index.js"
|
|
23
22
|
},
|
|
24
|
-
"./dist
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@vueuse/core": "^9.10.0",
|
|
32
|
-
"ant-design-vue": "^3.2.17",
|
|
33
|
-
"dayjs": "^1.11.0",
|
|
34
|
-
"lodash-es": "^4.17.21",
|
|
35
|
-
"vue": "^3.2.45",
|
|
36
|
-
"vue-types": "^4.1.1"
|
|
23
|
+
"./dist/*": {
|
|
24
|
+
"types": "./dist/*.d.ts",
|
|
25
|
+
"import": "./dist/*.js",
|
|
26
|
+
"default": "./dist/*.js"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
37
29
|
},
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
"@vitejs/plugin-vue-jsx": "^1.3.10",
|
|
47
|
-
"@vue/eslint-config-prettier": "^7.0.0",
|
|
48
|
-
"@vue/eslint-config-typescript": "^10.0.0",
|
|
49
|
-
"@vue/tsconfig": "^0.1.3",
|
|
50
|
-
"eslint": "^8.13.0",
|
|
51
|
-
"eslint-plugin-prettier": "^4.0.0",
|
|
52
|
-
"eslint-plugin-vue": "^8.6.0",
|
|
53
|
-
"jsdom": "^19.0.0",
|
|
54
|
-
"less": "^4.1.2",
|
|
55
|
-
"postcss": "^8.4.12",
|
|
56
|
-
"postcss-html": "^1.4.1",
|
|
57
|
-
"postcss-less": "^6.0.0",
|
|
58
|
-
"prettier": "^2.6.2",
|
|
59
|
-
"rollup": "^2.70.2",
|
|
60
|
-
"stylelint": "^14.7.1",
|
|
61
|
-
"stylelint-config-prettier": "^9.0.3",
|
|
62
|
-
"stylelint-config-recommended": "^7.0.0",
|
|
63
|
-
"stylelint-config-recommended-vue": "^1.4.0",
|
|
64
|
-
"stylelint-config-standard": "^25.0.0",
|
|
65
|
-
"stylelint-order": "^5.0.0",
|
|
66
|
-
"typescript": "^4.6.4",
|
|
67
|
-
"vite": "^2.9.14",
|
|
68
|
-
"vue-eslint-parser": "^9.0.3",
|
|
69
|
-
"vue-tsc": "^1.0.24"
|
|
30
|
+
"unpkg": "dist/pro-utils.js",
|
|
31
|
+
"jsdelivr": "dist/pro-utils.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"dist",
|
|
34
|
+
"package.json"
|
|
35
|
+
],
|
|
36
|
+
"peerDependencies": {
|
|
37
|
+
"vue": ">=3.2.0"
|
|
70
38
|
},
|
|
71
|
-
"
|
|
72
|
-
|
|
39
|
+
"browserslist": [
|
|
40
|
+
"> 1%",
|
|
41
|
+
"not ie 11",
|
|
42
|
+
"not op_mini all"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"build": "run-s build:esm build:vite:parallel",
|
|
47
|
+
"build:esm": "tsdown",
|
|
48
|
+
"build:vite:parallel": "run-p build:umd build:full-esm",
|
|
49
|
+
"build:full-esm": "vite build --config ./vite.esm.config.ts",
|
|
50
|
+
"build:umd": "vite build",
|
|
51
|
+
"prepublish": "pnpm build"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue';
|
|
2
|
-
import type { SizeType, VueNode } from '../../typings';
|
|
3
|
-
import './index.less';
|
|
4
|
-
export type FieldLabelProps = {
|
|
5
|
-
label?: VueNode;
|
|
6
|
-
value?: any;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
onClear?: () => void;
|
|
9
|
-
size?: SizeType;
|
|
10
|
-
ellipsis?: boolean;
|
|
11
|
-
placeholder?: VueNode;
|
|
12
|
-
expanded?: boolean;
|
|
13
|
-
id?: string;
|
|
14
|
-
class?: string;
|
|
15
|
-
formatter?: (value: any) => VueNode;
|
|
16
|
-
style?: CSSProperties;
|
|
17
|
-
bordered?: boolean;
|
|
18
|
-
allowClear?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* 点击标签的事件,用来唤醒 down menu 状态
|
|
21
|
-
*/
|
|
22
|
-
onLabelClick?: () => void;
|
|
23
|
-
};
|
|
24
|
-
declare const FieldLabel: import("vue").DefineComponent<{
|
|
25
|
-
id: import("vue-types").VueTypeValidableDef<string> & {
|
|
26
|
-
default: string;
|
|
27
|
-
};
|
|
28
|
-
style: import("vue-types").VueTypeValidableDef<CSSProperties>;
|
|
29
|
-
size: {
|
|
30
|
-
type: PropType<SizeType>;
|
|
31
|
-
default: string;
|
|
32
|
-
};
|
|
33
|
-
label: PropType<VueNode>;
|
|
34
|
-
placeholder: PropType<VueNode>;
|
|
35
|
-
class: PropType<string>;
|
|
36
|
-
ellipsis: PropType<boolean>;
|
|
37
|
-
allowClear: {
|
|
38
|
-
type: PropType<boolean>;
|
|
39
|
-
default: boolean;
|
|
40
|
-
};
|
|
41
|
-
bordered: PropType<boolean>;
|
|
42
|
-
expanded: PropType<boolean>;
|
|
43
|
-
disabled: PropType<boolean>;
|
|
44
|
-
onClear: PropType<() => void>;
|
|
45
|
-
onLabelClick: PropType<() => void>;
|
|
46
|
-
formatter: PropType<((value: any) => VueNode) | undefined>;
|
|
47
|
-
value: import("vue-types").VueTypeValidableDef<any>;
|
|
48
|
-
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
49
|
-
id: import("vue-types").VueTypeValidableDef<string> & {
|
|
50
|
-
default: string;
|
|
51
|
-
};
|
|
52
|
-
style: import("vue-types").VueTypeValidableDef<CSSProperties>;
|
|
53
|
-
size: {
|
|
54
|
-
type: PropType<SizeType>;
|
|
55
|
-
default: string;
|
|
56
|
-
};
|
|
57
|
-
label: PropType<VueNode>;
|
|
58
|
-
placeholder: PropType<VueNode>;
|
|
59
|
-
class: PropType<string>;
|
|
60
|
-
ellipsis: PropType<boolean>;
|
|
61
|
-
allowClear: {
|
|
62
|
-
type: PropType<boolean>;
|
|
63
|
-
default: boolean;
|
|
64
|
-
};
|
|
65
|
-
bordered: PropType<boolean>;
|
|
66
|
-
expanded: PropType<boolean>;
|
|
67
|
-
disabled: PropType<boolean>;
|
|
68
|
-
onClear: PropType<() => void>;
|
|
69
|
-
onLabelClick: PropType<() => void>;
|
|
70
|
-
formatter: PropType<((value: any) => VueNode) | undefined>;
|
|
71
|
-
value: import("vue-types").VueTypeValidableDef<any>;
|
|
72
|
-
}>>, {
|
|
73
|
-
id: string;
|
|
74
|
-
size: SizeType;
|
|
75
|
-
allowClear: boolean;
|
|
76
|
-
}>;
|
|
77
|
-
export default FieldLabel;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
@import '../../design/config.less';
|
|
2
|
-
@import '../../design/ant-design-theme.less';
|
|
3
|
-
|
|
4
|
-
@pro-core-field-label: ~'@{gx-prefix}-pro-core-field-label';
|
|
5
|
-
|
|
6
|
-
.@{pro-core-field-label} {
|
|
7
|
-
display: inline-flex;
|
|
8
|
-
gap: 4px;
|
|
9
|
-
align-items: center;
|
|
10
|
-
height: 30px;
|
|
11
|
-
padding-block: 0;
|
|
12
|
-
padding-inline: 8px;
|
|
13
|
-
font-size: 14px;
|
|
14
|
-
line-height: 30px;
|
|
15
|
-
border-radius: 2px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
|
|
18
|
-
&:hover {
|
|
19
|
-
background-color: fade(@black, 6%);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
&-active {
|
|
23
|
-
padding: 0 12px;
|
|
24
|
-
background-color: fade(@black, 6%);
|
|
25
|
-
|
|
26
|
-
&.@{pro-core-field-label}-allow-clear:hover:not(.@{pro-core-field-label}-disabled) {
|
|
27
|
-
.@{pro-core-field-label}-arrow {
|
|
28
|
-
display: none;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.@{pro-core-field-label}-close {
|
|
32
|
-
display: inline-flex;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
.@{pro-core-field-label}-icon {
|
|
38
|
-
height: 12px;
|
|
39
|
-
padding-block: 1px;
|
|
40
|
-
padding-inline: 1px;
|
|
41
|
-
color: fade(@black, 45%);
|
|
42
|
-
font-size: 12px;
|
|
43
|
-
vertical-align: middle;
|
|
44
|
-
|
|
45
|
-
&.@{pro-core-field-label}-close {
|
|
46
|
-
display: none;
|
|
47
|
-
height: 14px;
|
|
48
|
-
align-items: center;
|
|
49
|
-
justify-content: center;
|
|
50
|
-
width: 14px;
|
|
51
|
-
color: #ffffff;
|
|
52
|
-
font-size: 8px;
|
|
53
|
-
background-color: fade(@black, 25%);
|
|
54
|
-
border-radius: 50%;
|
|
55
|
-
|
|
56
|
-
&:hover {
|
|
57
|
-
color: fade(@black, 45%);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
&-disabled {
|
|
63
|
-
color: fade(@black, 25%);
|
|
64
|
-
cursor: not-allowed;
|
|
65
|
-
|
|
66
|
-
.@{pro-core-field-label}-icon {
|
|
67
|
-
color: fade(@black, 25%);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
&-small {
|
|
72
|
-
height: 24px;
|
|
73
|
-
padding: 0 4px;
|
|
74
|
-
font-size: @font-size-sm;
|
|
75
|
-
line-height: 24px;
|
|
76
|
-
|
|
77
|
-
&.@{pro-core-field-label}-active {
|
|
78
|
-
padding: 0 8px;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
.@{pro-core-field-label}-icon {
|
|
82
|
-
padding: 0;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.@{pro-core-field-label}-close {
|
|
86
|
-
padding: 3px;
|
|
87
|
-
margin-top: -2px;
|
|
88
|
-
font-size: 6px;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&-bordered {
|
|
93
|
-
height: 32px;
|
|
94
|
-
padding: 0 12px;
|
|
95
|
-
border: @border-width-base solid #d9d9d9;
|
|
96
|
-
border-radius: @border-radius-base;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
&-bordered&-small {
|
|
100
|
-
height: 24px;
|
|
101
|
-
padding: 0 8px;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
&-bordered&-active {
|
|
105
|
-
background-color: @white;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { FunctionalComponent, VueElement } from 'vue';
|
|
2
|
-
import { type TooltipProps } from 'ant-design-vue';
|
|
3
|
-
import type { VueNode } from '../../typings';
|
|
4
|
-
import './index.less';
|
|
5
|
-
export type WrapperTooltipProps = TooltipProps & {
|
|
6
|
-
icon?: VueElement;
|
|
7
|
-
};
|
|
8
|
-
export type LabelTooltipType = WrapperTooltipProps | VueNode;
|
|
9
|
-
/**
|
|
10
|
-
* 在 form 的 label 后面增加一个 tips 来展示一些说明文案
|
|
11
|
-
*
|
|
12
|
-
* @param props
|
|
13
|
-
*/
|
|
14
|
-
declare const LabelIconTip: FunctionalComponent<{
|
|
15
|
-
label: VueNode;
|
|
16
|
-
subTitle?: VueNode;
|
|
17
|
-
tooltip?: string | LabelTooltipType;
|
|
18
|
-
ellipsis?: boolean;
|
|
19
|
-
}>;
|
|
20
|
-
export default LabelIconTip;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import '../../design/config.less';
|
|
2
|
-
@import '../../design/ant-design-theme.less';
|
|
3
|
-
|
|
4
|
-
@root-entry-name: 'default';
|
|
5
|
-
|
|
6
|
-
@pro-core-label-tip: ~'@{gx-prefix-pro}-core-label-tip';
|
|
7
|
-
|
|
8
|
-
.@{pro-core-label-tip} {
|
|
9
|
-
display: inline-flex;
|
|
10
|
-
align-items: center;
|
|
11
|
-
max-width: 100%;
|
|
12
|
-
|
|
13
|
-
&-icon {
|
|
14
|
-
display: block;
|
|
15
|
-
margin-left: 4px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
&-title {
|
|
20
|
-
display: inline-flex;
|
|
21
|
-
flex: 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&-subtitle {
|
|
25
|
-
margin-left: 8px;
|
|
26
|
-
color: @text-color-secondary;
|
|
27
|
-
font-weight: normal;
|
|
28
|
-
font-size: @font-size-base;
|
|
29
|
-
white-space: nowrap;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
&-title-ellipsis {
|
|
33
|
-
overflow: hidden;
|
|
34
|
-
white-space: nowrap;
|
|
35
|
-
text-overflow: ellipsis;
|
|
36
|
-
word-break: keep-all;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
@import 'ant-design-vue/es/tooltip/style/index.less';
|
package/dist/design/config.less
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const isBrowser: () => boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isDeepEqualReact(a: any, b: any, ignoreKeys?: string[], debug?: boolean): boolean;
|
package/dist/isServer.d.ts
DELETED