@rainbow-oh/yee-c 0.4.3 → 0.4.4
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/cjs/Cascader/cascader.js +53 -62
- package/dist/cjs/Cascader/interface.d.ts +19 -2
- package/dist/cjs/Cascader/node.js +11 -6
- package/dist/cjs/Cascader/search-list.js +2 -1
- package/dist/cjs/Cascader/utils/index.d.ts +58 -14
- package/dist/cjs/Cascader/utils/index.js +57 -73
- package/dist/cjs/Input/style/index.less +19 -0
- package/dist/cjs/Popover/style/index.less +1 -0
- package/dist/cjs/Select/interface.d.ts +77 -0
- package/dist/cjs/Select/option.d.ts +2 -1
- package/dist/cjs/Select/option.js +6 -3
- package/dist/cjs/Select/options.d.ts +3 -2
- package/dist/cjs/Select/options.js +53 -47
- package/dist/cjs/Select/select.js +1 -1
- package/dist/cjs/Select/style/index.less +8 -0
- package/dist/cjs/Selector/interface.d.ts +4 -0
- package/dist/cjs/Selector/selector.js +3 -0
- package/dist/cjs/Selector/style/index.less +135 -116
- package/dist/cjs/Table/hooks/useFilter.js +1 -1
- package/dist/cjs/Table/interface.d.ts +4 -0
- package/dist/cjs/Table/style/index.less +2 -0
- package/dist/cjs/Table/theader/filter.js +2 -1
- package/dist/cjs/Tabs/demo/basic.js +8 -1
- package/dist/cjs/Tabs/tabs.js +3 -1
- package/dist/cjs/Tag/demo/checkable.js +1 -0
- package/dist/cjs/Tag/tag.js +1 -1
- package/dist/cjs/Trigger/trigger.js +1 -1
- package/dist/cjs/style/color.css +1 -1
- package/dist/cjs/style/size.css +10 -2
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +12 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Cascader/cascader.js +49 -56
- package/dist/esm/Cascader/interface.d.ts +19 -2
- package/dist/esm/Cascader/node.js +8 -11
- package/dist/esm/Cascader/search-list.js +2 -1
- package/dist/esm/Cascader/utils/index.d.ts +58 -14
- package/dist/esm/Cascader/utils/index.js +124 -75
- package/dist/esm/Input/style/index.less +19 -0
- package/dist/esm/Popover/style/index.less +1 -0
- package/dist/esm/Select/interface.d.ts +77 -0
- package/dist/esm/Select/option.d.ts +2 -1
- package/dist/esm/Select/option.js +11 -2
- package/dist/esm/Select/options.d.ts +3 -2
- package/dist/esm/Select/options.js +3 -1
- package/dist/esm/Select/select.js +1 -3
- package/dist/esm/Select/style/index.less +8 -0
- package/dist/esm/Selector/interface.d.ts +4 -0
- package/dist/esm/Selector/selector.js +4 -2
- package/dist/esm/Selector/style/index.less +135 -116
- package/dist/esm/Table/hooks/useFilter.js +1 -1
- package/dist/esm/Table/interface.d.ts +4 -0
- package/dist/esm/Table/style/index.less +2 -0
- package/dist/esm/Table/theader/filter.js +3 -4
- package/dist/esm/Tabs/demo/basic.js +4 -1
- package/dist/esm/Tabs/tabs.js +3 -1
- package/dist/esm/Tag/demo/checkable.js +1 -0
- package/dist/esm/Tag/tag.js +1 -1
- package/dist/esm/Trigger/trigger.js +1 -1
- package/dist/esm/style/color.css +1 -1
- package/dist/esm/style/size.css +10 -2
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +12 -4
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +2 -2
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Cascader/cascader.tsx +65 -62
- package/src/Cascader/interface.ts +19 -2
- package/src/Cascader/node.tsx +12 -7
- package/src/Cascader/search-list.tsx +1 -1
- package/src/Cascader/utils/index.ts +130 -68
- package/src/Input/style/index.less +19 -0
- package/src/Popover/style/index.less +1 -0
- package/src/Select/interface.ts +87 -0
- package/src/Select/option.tsx +13 -4
- package/src/Select/options.tsx +49 -43
- package/src/Select/select.tsx +5 -2
- package/src/Select/style/index.less +8 -0
- package/src/Selector/interface.ts +4 -0
- package/src/Selector/selector.tsx +2 -0
- package/src/Selector/style/index.less +135 -116
- package/src/Table/hooks/useFilter.ts +1 -1
- package/src/Table/interface.ts +4 -0
- package/src/Table/style/index.less +2 -0
- package/src/Table/theader/filter.tsx +2 -2
- package/src/Tabs/demo/basic.tsx +7 -1
- package/src/Tabs/tabs.tsx +3 -2
- package/src/Tag/demo/checkable.tsx +1 -0
- package/src/Tag/tag.tsx +1 -1
- package/src/Trigger/trigger.tsx +1 -1
- package/src/style/color.css +1 -1
- package/src/style/size.css +10 -2
- package/src/version.ts +1 -1
|
@@ -95,3 +95,80 @@ export interface SelectProps extends DataAttributeProps {
|
|
|
95
95
|
*/
|
|
96
96
|
onFilter?: (value: string, options: Array<Option>) => Array<Option>;
|
|
97
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* Props for the internal Option component (renders a single dropdown option).
|
|
100
|
+
*/
|
|
101
|
+
export interface OptionProps {
|
|
102
|
+
/**
|
|
103
|
+
* Display label
|
|
104
|
+
*/
|
|
105
|
+
label: string;
|
|
106
|
+
/**
|
|
107
|
+
* Value
|
|
108
|
+
*/
|
|
109
|
+
value: string | number;
|
|
110
|
+
/**
|
|
111
|
+
* Whether disabled
|
|
112
|
+
*/
|
|
113
|
+
disabled?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Native title attribute
|
|
116
|
+
*/
|
|
117
|
+
title?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Test id forwarded to the option element
|
|
120
|
+
*/
|
|
121
|
+
dataTestId?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Context value shared between Options and each Option.
|
|
125
|
+
*/
|
|
126
|
+
export interface OptionsContextValue {
|
|
127
|
+
prefixCls: string;
|
|
128
|
+
selectedKeys: Array<string | number>;
|
|
129
|
+
focusedKey: string | number;
|
|
130
|
+
multiple: boolean;
|
|
131
|
+
onSelect: (key: string | number, e?: React.MouseEvent | React.KeyboardEvent) => void;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Props for the internal Options (popup list) component.
|
|
135
|
+
*/
|
|
136
|
+
export interface OptionsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
137
|
+
/**
|
|
138
|
+
* Custom class name prefix
|
|
139
|
+
*/
|
|
140
|
+
prefixCls: string;
|
|
141
|
+
/**
|
|
142
|
+
* Dropdown options
|
|
143
|
+
*/
|
|
144
|
+
options: Array<Option>;
|
|
145
|
+
/**
|
|
146
|
+
* Popup container class name
|
|
147
|
+
*/
|
|
148
|
+
popupClassName?: string;
|
|
149
|
+
/**
|
|
150
|
+
* Popup container inline style
|
|
151
|
+
*/
|
|
152
|
+
popupStyle?: React.CSSProperties;
|
|
153
|
+
/**
|
|
154
|
+
* Selected option values
|
|
155
|
+
*/
|
|
156
|
+
selectedKeys: Array<string | number>;
|
|
157
|
+
/**
|
|
158
|
+
* Currently focused option value
|
|
159
|
+
*/
|
|
160
|
+
focusedKey: string | number;
|
|
161
|
+
/**
|
|
162
|
+
* Test id prefix used to generate each option's test id.
|
|
163
|
+
* Accepts any `data-*` attribute value (see DataAttributeProps).
|
|
164
|
+
*/
|
|
165
|
+
dataTestId?: string | number | boolean;
|
|
166
|
+
/**
|
|
167
|
+
* Whether multiple selection mode is active
|
|
168
|
+
*/
|
|
169
|
+
multiple: boolean;
|
|
170
|
+
/**
|
|
171
|
+
* Callback when an option is selected
|
|
172
|
+
*/
|
|
173
|
+
onSelect: (key: string | number, e?: React.MouseEvent | React.KeyboardEvent) => void;
|
|
174
|
+
}
|
|
@@ -33,22 +33,24 @@ __export(option_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(option_exports);
|
|
35
35
|
var import_clsx = __toESM(require("clsx"));
|
|
36
|
+
var import_lucide_react = require("lucide-react");
|
|
36
37
|
var import_react = __toESM(require("react"));
|
|
37
38
|
var import_options = require("./options");
|
|
38
39
|
var Option = (props) => {
|
|
39
40
|
const { label, value, disabled, title, dataTestId } = props;
|
|
40
|
-
const { prefixCls, selectedKeys, focusedKey, onSelect } = (0, import_react.useContext)(import_options.OptionsCtx);
|
|
41
|
+
const { prefixCls, selectedKeys, focusedKey, multiple, onSelect } = (0, import_react.useContext)(import_options.OptionsCtx);
|
|
41
42
|
const handleClick = (e) => {
|
|
42
43
|
if (!disabled) {
|
|
43
44
|
onSelect(value, e);
|
|
44
45
|
}
|
|
45
46
|
};
|
|
46
47
|
const htmlTitle = title ? title : typeof label === "string" ? label : void 0;
|
|
48
|
+
const selected = selectedKeys.includes(value);
|
|
47
49
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
48
50
|
"div",
|
|
49
51
|
{
|
|
50
52
|
className: (0, import_clsx.default)(`${prefixCls}-option`, {
|
|
51
|
-
[`${prefixCls}-option-selected`]:
|
|
53
|
+
[`${prefixCls}-option-selected`]: selected,
|
|
52
54
|
[`${prefixCls}-option-focused`]: focusedKey === value,
|
|
53
55
|
[`${prefixCls}-option-disabled`]: disabled
|
|
54
56
|
}),
|
|
@@ -64,7 +66,8 @@ var Option = (props) => {
|
|
|
64
66
|
title: htmlTitle,
|
|
65
67
|
"data-testid": dataTestId
|
|
66
68
|
},
|
|
67
|
-
label
|
|
69
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-option-content` }, label),
|
|
70
|
+
multiple && selected && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-option-state` }, /* @__PURE__ */ import_react.default.createElement(import_lucide_react.Check, { size: 16 }))
|
|
68
71
|
);
|
|
69
72
|
};
|
|
70
73
|
var option_default = Option;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
declare const
|
|
2
|
+
import type { OptionsContextValue, OptionsProps } from './interface';
|
|
3
|
+
export declare const OptionsCtx: React.Context<OptionsContextValue>;
|
|
4
|
+
declare const Options: React.ForwardRefExoticComponent<OptionsProps & React.RefAttributes<HTMLDivElement>>;
|
|
4
5
|
export default Options;
|
|
@@ -66,51 +66,57 @@ var import_clsx = __toESM(require("clsx"));
|
|
|
66
66
|
var import_react = __toESM(require("react"));
|
|
67
67
|
var import_locale = require("../locale");
|
|
68
68
|
var import_option = __toESM(require("./option"));
|
|
69
|
-
var OptionsCtx = (0, import_react.createContext)(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
options.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
69
|
+
var OptionsCtx = (0, import_react.createContext)(
|
|
70
|
+
{}
|
|
71
|
+
);
|
|
72
|
+
var Options = (0, import_react.forwardRef)(
|
|
73
|
+
(props, ref) => {
|
|
74
|
+
const { locale } = (0, import_locale.useLocale)();
|
|
75
|
+
const { select } = locale;
|
|
76
|
+
const _a = props, {
|
|
77
|
+
prefixCls,
|
|
78
|
+
options,
|
|
79
|
+
popupClassName,
|
|
80
|
+
popupStyle,
|
|
81
|
+
selectedKeys,
|
|
82
|
+
focusedKey,
|
|
83
|
+
dataTestId,
|
|
84
|
+
multiple,
|
|
85
|
+
onSelect
|
|
86
|
+
} = _a, rest = __objRest(_a, [
|
|
87
|
+
"prefixCls",
|
|
88
|
+
"options",
|
|
89
|
+
"popupClassName",
|
|
90
|
+
"popupStyle",
|
|
91
|
+
"selectedKeys",
|
|
92
|
+
"focusedKey",
|
|
93
|
+
"dataTestId",
|
|
94
|
+
"multiple",
|
|
95
|
+
"onSelect"
|
|
96
|
+
]);
|
|
97
|
+
const componentRef = ref || (0, import_react.useRef)(null);
|
|
98
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
99
|
+
"div",
|
|
100
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
101
|
+
className: (0, import_clsx.default)(`${prefixCls}-popup`, popupClassName),
|
|
102
|
+
style: popupStyle,
|
|
103
|
+
ref: componentRef,
|
|
104
|
+
tabIndex: -1
|
|
105
|
+
}),
|
|
106
|
+
options.length === 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-empty` }, select.noData) : /* @__PURE__ */ import_react.default.createElement(
|
|
107
|
+
OptionsCtx.Provider,
|
|
108
|
+
{
|
|
109
|
+
value: { prefixCls, selectedKeys, focusedKey, multiple, onSelect }
|
|
110
|
+
},
|
|
111
|
+
options.map((option, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
112
|
+
import_option.default,
|
|
113
|
+
__spreadProps(__spreadValues({}, option), {
|
|
114
|
+
key: option.value,
|
|
115
|
+
dataTestId: `${dataTestId}-${index}`
|
|
116
|
+
})
|
|
117
|
+
))
|
|
118
|
+
)
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
);
|
|
116
122
|
var options_default = Options;
|
|
@@ -190,12 +190,12 @@ var Select = (baseprops) => {
|
|
|
190
190
|
import_options.default,
|
|
191
191
|
{
|
|
192
192
|
prefixCls,
|
|
193
|
+
multiple: mode === "multiple" || mode === "tags",
|
|
193
194
|
options: filteredOpts,
|
|
194
195
|
focusedKey,
|
|
195
196
|
selectedKeys: mergedValue,
|
|
196
197
|
dataTestId: rest["data-testid"],
|
|
197
198
|
onSelect: handleSelect,
|
|
198
|
-
onClose: () => setOpen(false),
|
|
199
199
|
ref: popupRef
|
|
200
200
|
}
|
|
201
201
|
);
|
|
@@ -9,12 +9,20 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
&-option {
|
|
12
|
+
display: flex;
|
|
12
13
|
padding: var(--yee-select-option-padding);
|
|
13
14
|
overflow: hidden;
|
|
14
15
|
white-space: nowrap;
|
|
15
16
|
text-overflow: ellipsis;
|
|
16
17
|
cursor: pointer;
|
|
17
18
|
|
|
19
|
+
&-content {
|
|
20
|
+
flex: 1;
|
|
21
|
+
overflow: hidden;
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
text-overflow: ellipsis;
|
|
24
|
+
}
|
|
25
|
+
|
|
18
26
|
&:not(&-disabled):hover {
|
|
19
27
|
background-color: var(--yee-select-option-hover-bg-color);
|
|
20
28
|
}
|
|
@@ -105,6 +105,7 @@ var Selector = import_react.default.forwardRef(
|
|
|
105
105
|
value,
|
|
106
106
|
open,
|
|
107
107
|
loading,
|
|
108
|
+
size = "default",
|
|
108
109
|
onSearch,
|
|
109
110
|
onRemove,
|
|
110
111
|
onClear,
|
|
@@ -127,6 +128,7 @@ var Selector = import_react.default.forwardRef(
|
|
|
127
128
|
"value",
|
|
128
129
|
"open",
|
|
129
130
|
"loading",
|
|
131
|
+
"size",
|
|
130
132
|
"onSearch",
|
|
131
133
|
"onRemove",
|
|
132
134
|
"onClear",
|
|
@@ -165,6 +167,7 @@ var Selector = import_react.default.forwardRef(
|
|
|
165
167
|
};
|
|
166
168
|
const cls = (0, import_clsx.default)(
|
|
167
169
|
prefixCls,
|
|
170
|
+
[`${prefixCls}-${size}`],
|
|
168
171
|
[`${prefixCls}-searchable`],
|
|
169
172
|
[`${prefixCls}-${mode || "single"}`],
|
|
170
173
|
{
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
var(--yee-selector-border-color);
|
|
10
10
|
border-radius: var(--yee-selector-border-radius);
|
|
11
11
|
|
|
12
|
+
&-small {
|
|
13
|
+
padding: var(--yee-selector-small-padding);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&-large {
|
|
17
|
+
padding: var(--yee-selector-large-padding);
|
|
18
|
+
}
|
|
19
|
+
|
|
12
20
|
&:focus-visible {
|
|
13
21
|
outline: none;
|
|
14
22
|
}
|
|
@@ -31,6 +39,13 @@
|
|
|
31
39
|
line-height: var(--yee-selector-input-line-height);
|
|
32
40
|
}
|
|
33
41
|
|
|
42
|
+
@{pls}-selection-item {
|
|
43
|
+
white-space: nowrap;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
text-overflow: ellipsis;
|
|
46
|
+
padding-right: 16px;
|
|
47
|
+
}
|
|
48
|
+
|
|
34
49
|
&:focus-within,
|
|
35
50
|
&:focus {
|
|
36
51
|
@{pls}-input-wrapper {
|
|
@@ -39,6 +54,10 @@
|
|
|
39
54
|
|
|
40
55
|
&.with-input-value {
|
|
41
56
|
opacity: 1;
|
|
57
|
+
|
|
58
|
+
& + @{pls}-selection-item {
|
|
59
|
+
opacity: 0;
|
|
60
|
+
}
|
|
42
61
|
}
|
|
43
62
|
}
|
|
44
63
|
|
|
@@ -188,122 +207,122 @@
|
|
|
188
207
|
}
|
|
189
208
|
}
|
|
190
209
|
|
|
191
|
-
.yee-tags-searchable {
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
}
|
|
210
|
-
|
|
211
|
-
.yee-tags-single-mode {
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.yee-tags-multi-mode {
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
}
|
|
210
|
+
// .yee-tags-searchable {
|
|
211
|
+
// cursor: text;
|
|
212
|
+
|
|
213
|
+
// .yee-tags-input-wrapper {
|
|
214
|
+
// width: 100%;
|
|
215
|
+
// padding: 0;
|
|
216
|
+
// border: none;
|
|
217
|
+
// outline: none;
|
|
218
|
+
|
|
219
|
+
// &:focus {
|
|
220
|
+
// border: none;
|
|
221
|
+
// box-shadow: none;
|
|
222
|
+
// }
|
|
223
|
+
// }
|
|
224
|
+
|
|
225
|
+
// .yee-tags-icon {
|
|
226
|
+
// width: auto;
|
|
227
|
+
// }
|
|
228
|
+
// }
|
|
229
|
+
|
|
230
|
+
// .yee-tags-single-mode {
|
|
231
|
+
// height: var(--yee-tags-height);
|
|
232
|
+
|
|
233
|
+
// .yee-tags-input-container {
|
|
234
|
+
// position: absolute;
|
|
235
|
+
// z-index: -1;
|
|
236
|
+
// width: 100%;
|
|
237
|
+
// font-size: var(--yee-tags-input-font-size);
|
|
238
|
+
// line-height: var(--yee-tags-input-line-height);
|
|
239
|
+
|
|
240
|
+
// input {
|
|
241
|
+
// width: 100%;
|
|
242
|
+
// }
|
|
243
|
+
// }
|
|
244
|
+
|
|
245
|
+
// &.yee-tags-searchable {
|
|
246
|
+
// .yee-tags-single-option {
|
|
247
|
+
// width: 100%;
|
|
248
|
+
// }
|
|
249
|
+
|
|
250
|
+
// .yee-tags-container {
|
|
251
|
+
// &:focus-within,
|
|
252
|
+
// &:focus {
|
|
253
|
+
// .yee-tags-input-container {
|
|
254
|
+
// z-index: 1;
|
|
255
|
+
// opacity: var(--yee-tags-input-focus-opacity);
|
|
256
|
+
|
|
257
|
+
// &.has-value {
|
|
258
|
+
// opacity: 1;
|
|
259
|
+
|
|
260
|
+
// + .yee-tags-single-option {
|
|
261
|
+
// display: none;
|
|
262
|
+
// }
|
|
263
|
+
// }
|
|
264
|
+
// }
|
|
265
|
+
|
|
266
|
+
// .yee-tags-single-option {
|
|
267
|
+
// opacity: var(--yee-tags-single-option-focus-opacity);
|
|
268
|
+
// }
|
|
269
|
+
// }
|
|
270
|
+
// }
|
|
271
|
+
// }
|
|
272
|
+
// }
|
|
273
|
+
|
|
274
|
+
// .yee-tags-multi-mode {
|
|
275
|
+
// height: auto;
|
|
276
|
+
// min-height: var(--yee-tags-multi-min-height);
|
|
277
|
+
|
|
278
|
+
// &.yee-tags-searchable {
|
|
279
|
+
// .yee-tag {
|
|
280
|
+
// max-width: var(--yee-tags-multi-tag-max-width);
|
|
281
|
+
// height: var(--yee-tags-multi-tag-height);
|
|
282
|
+
// }
|
|
283
|
+
// }
|
|
284
|
+
|
|
285
|
+
// .yee-tags-container {
|
|
286
|
+
// flex-wrap: wrap;
|
|
287
|
+
// }
|
|
288
|
+
|
|
289
|
+
// .yee-tags-input-container {
|
|
290
|
+
// display: inline-grid;
|
|
291
|
+
// // color: var(--yee-tags-input-container-font-color);
|
|
292
|
+
// flex: 1 1 auto;
|
|
293
|
+
// grid-area: 1 / 1 / 2 / 3;
|
|
294
|
+
// grid-template-columns: 0 min-content;
|
|
295
|
+
// box-sizing: border-box;
|
|
296
|
+
// height: var(--yee-tags-multi-input-height);
|
|
297
|
+
|
|
298
|
+
// &::after {
|
|
299
|
+
// grid-area: 1 / 2 / auto / auto;
|
|
300
|
+
// min-width: var(--yee-tags-multi-input-after-min-width);
|
|
301
|
+
// margin: 0;
|
|
302
|
+
// padding: 0;
|
|
303
|
+
// font: inherit;
|
|
304
|
+
// white-space: pre;
|
|
305
|
+
// border: 0;
|
|
306
|
+
// outline: 0;
|
|
307
|
+
// visibility: hidden;
|
|
308
|
+
// content: attr(data-value) ' ';
|
|
309
|
+
// }
|
|
310
|
+
|
|
311
|
+
// & > input {
|
|
312
|
+
// grid-area: 1 / 2 / auto / auto;
|
|
313
|
+
// width: 100%;
|
|
314
|
+
// min-width: var(--yee-tags-multi-input-min-width);
|
|
315
|
+
// height: var(--yee-tags-multi-input-height);
|
|
316
|
+
// margin: 0;
|
|
317
|
+
// padding: 0;
|
|
318
|
+
// font: inherit;
|
|
319
|
+
// background-color: transparent;
|
|
320
|
+
// border: 0;
|
|
321
|
+
// outline: 0;
|
|
322
|
+
// opacity: 1;
|
|
323
|
+
// }
|
|
324
|
+
// }
|
|
325
|
+
// }
|
|
307
326
|
|
|
308
327
|
// form error status
|
|
309
328
|
.yee-form-item-error {
|
|
@@ -46,7 +46,7 @@ function useFilter({
|
|
|
46
46
|
const [filterRecords, setFilterRecords] = (0, import_react.useState)([]);
|
|
47
47
|
const onFilter = ({ value, dataIndex }) => {
|
|
48
48
|
let newFilterMap = [...filterRecords];
|
|
49
|
-
if (!value) {
|
|
49
|
+
if (!value || Array.isArray(value) && !value.length) {
|
|
50
50
|
newFilterMap = newFilterMap.filter(
|
|
51
51
|
(item) => item.dataIndex !== dataIndex
|
|
52
52
|
);
|
|
@@ -448,6 +448,10 @@ export interface TableProps extends FooterProps, Omit<HeaderProps, 'pageData'>,
|
|
|
448
448
|
* Row class name, unlike classNames, this prop can be set dynamically via a function
|
|
449
449
|
*/
|
|
450
450
|
rowClassName?: (record: object) => string;
|
|
451
|
+
/**
|
|
452
|
+
* Row style, unlike styles, this prop can be set dynamically via a function
|
|
453
|
+
*/
|
|
454
|
+
rowStyle?: (record: object) => React.CSSProperties;
|
|
451
455
|
/**
|
|
452
456
|
* Pagination config
|
|
453
457
|
*/
|
|
@@ -159,7 +159,7 @@ var HeaderFilter = import_react.default.memo((props) => {
|
|
|
159
159
|
import_Button.default,
|
|
160
160
|
{
|
|
161
161
|
icon: items ? /* @__PURE__ */ import_react.default.createElement(import_lucide_react.ListFilter, { size: 14, strokeWidth: 1.5 }) : /* @__PURE__ */ import_react.default.createElement(import_lucide_react.Search, { size: 14, strokeWidth: 1.5 }),
|
|
162
|
-
|
|
162
|
+
variant: selectNodes.length ? "filled" : void 0,
|
|
163
163
|
type: "text",
|
|
164
164
|
size: "small"
|
|
165
165
|
}
|
|
@@ -171,6 +171,7 @@ var HeaderFilter = import_react.default.memo((props) => {
|
|
|
171
171
|
{
|
|
172
172
|
trigger: "click",
|
|
173
173
|
placement: "bottomRight",
|
|
174
|
+
className: (0, import_clsx.default)(`${prefixCls}-filter`),
|
|
174
175
|
content: popup,
|
|
175
176
|
arrow: true,
|
|
176
177
|
open,
|
|
@@ -122,5 +122,12 @@ var basic_default = () => {
|
|
|
122
122
|
children: "Content of Tab Pane 17"
|
|
123
123
|
}
|
|
124
124
|
];
|
|
125
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
126
|
+
import_yee_c.Tabs,
|
|
127
|
+
{
|
|
128
|
+
defaultActiveKey: "1",
|
|
129
|
+
items,
|
|
130
|
+
onChange: (key) => console.log(key)
|
|
131
|
+
}
|
|
132
|
+
);
|
|
126
133
|
};
|
package/dist/cjs/Tabs/tabs.js
CHANGED
|
@@ -147,7 +147,9 @@ var Tabs = (baseprops) => {
|
|
|
147
147
|
return;
|
|
148
148
|
}
|
|
149
149
|
setMergedActiveKey(key);
|
|
150
|
-
|
|
150
|
+
if (key !== mergedActiveKey) {
|
|
151
|
+
onChange == null ? void 0 : onChange(key);
|
|
152
|
+
}
|
|
151
153
|
};
|
|
152
154
|
const contextValue = (0, import_react.useMemo)(
|
|
153
155
|
() => ({
|