@gx-design-vue/pro-utils 0.0.24 → 0.0.26
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/components/FieldLabel/index.d.ts +77 -0
- package/dist/components/FieldLabel/index.less +107 -0
- package/dist/index.d.ts +3 -2
- package/dist/pro-utils.mjs +389 -277
- package/dist/pro-utils.umd.js +1 -1
- package/dist/proUtils.less +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { CSSProperties, PropType } from 'vue';
|
|
2
|
+
import type { SizeType, VueNode } from '../../typings';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export declare 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) => string;
|
|
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) => string>;
|
|
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) => string>;
|
|
71
|
+
value: import("vue-types").VueTypeValidableDef<any>;
|
|
72
|
+
}>>, {
|
|
73
|
+
id: string;
|
|
74
|
+
size: SizeType;
|
|
75
|
+
allowClear: boolean;
|
|
76
|
+
}>;
|
|
77
|
+
export default FieldLabel;
|
|
@@ -0,0 +1,107 @@
|
|
|
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
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { isScroll, getScrollContainer, isInContainer } from './scroll';
|
|
|
9
9
|
import scrollTo from './scroll/scrollTo';
|
|
10
10
|
import getScroll from './scroll/getScroll';
|
|
11
11
|
import throttleByAnimationFrame from './scroll/throttleByAnimationFrame';
|
|
12
|
+
import FieldLabel, { type FieldLabelProps } from './components/FieldLabel';
|
|
12
13
|
import LabelIconTip, { type LabelTooltipType } from './components/LabelIconTip';
|
|
13
14
|
export * from './isBrowser';
|
|
14
15
|
export * from './omitBoolean';
|
|
@@ -17,5 +18,5 @@ export * from './slots';
|
|
|
17
18
|
export * from './utils';
|
|
18
19
|
export * from './utils/validate';
|
|
19
20
|
export * from './typings';
|
|
20
|
-
export type { LabelTooltipType };
|
|
21
|
-
export { isServer, LabelIconTip, isScroll, isInContainer, getScrollContainer, scrollTo, getScroll, throttleByAnimationFrame };
|
|
21
|
+
export type { LabelTooltipType, FieldLabelProps };
|
|
22
|
+
export { isServer, FieldLabel, LabelIconTip, isScroll, isInContainer, getScrollContainer, scrollTo, getScroll, throttleByAnimationFrame };
|