@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
|
@@ -69,6 +69,25 @@
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
// size
|
|
73
|
+
&-small {
|
|
74
|
+
height: var(--yee-input-small-height, 24px);
|
|
75
|
+
padding: var(--yee-input-small-padding, 0 6px);
|
|
76
|
+
font-size: var(--yee-input-small-font-size);
|
|
77
|
+
line-height: var(--yee-input-small-line-height);
|
|
78
|
+
|
|
79
|
+
&::placeholder {
|
|
80
|
+
font-size: var(--yee-input-small-font-size);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
&-large {
|
|
85
|
+
height: var(--yee-input-large-height, 40px);
|
|
86
|
+
padding: var(--yee-input-large-padding, 4px 12px);
|
|
87
|
+
font-size: var(--yee-input-large-font-size);
|
|
88
|
+
line-height: var(--yee-input-large-line-height);
|
|
89
|
+
}
|
|
90
|
+
|
|
72
91
|
&-password {
|
|
73
92
|
flex: 1;
|
|
74
93
|
outline: none;
|
package/src/Select/interface.ts
CHANGED
|
@@ -105,3 +105,90 @@ export interface SelectProps extends DataAttributeProps {
|
|
|
105
105
|
*/
|
|
106
106
|
onFilter?: (value: string, options: Array<Option>) => Array<Option>;
|
|
107
107
|
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Props for the internal Option component (renders a single dropdown option).
|
|
111
|
+
*/
|
|
112
|
+
export interface OptionProps {
|
|
113
|
+
/**
|
|
114
|
+
* Display label
|
|
115
|
+
*/
|
|
116
|
+
label: string;
|
|
117
|
+
/**
|
|
118
|
+
* Value
|
|
119
|
+
*/
|
|
120
|
+
value: string | number;
|
|
121
|
+
/**
|
|
122
|
+
* Whether disabled
|
|
123
|
+
*/
|
|
124
|
+
disabled?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Native title attribute
|
|
127
|
+
*/
|
|
128
|
+
title?: string;
|
|
129
|
+
/**
|
|
130
|
+
* Test id forwarded to the option element
|
|
131
|
+
*/
|
|
132
|
+
dataTestId?: string;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Context value shared between Options and each Option.
|
|
137
|
+
*/
|
|
138
|
+
export interface OptionsContextValue {
|
|
139
|
+
prefixCls: string;
|
|
140
|
+
selectedKeys: Array<string | number>;
|
|
141
|
+
focusedKey: string | number;
|
|
142
|
+
multiple: boolean;
|
|
143
|
+
onSelect: (
|
|
144
|
+
key: string | number,
|
|
145
|
+
e?: React.MouseEvent | React.KeyboardEvent,
|
|
146
|
+
) => void;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Props for the internal Options (popup list) component.
|
|
151
|
+
*/
|
|
152
|
+
export interface OptionsProps
|
|
153
|
+
extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
154
|
+
/**
|
|
155
|
+
* Custom class name prefix
|
|
156
|
+
*/
|
|
157
|
+
prefixCls: string;
|
|
158
|
+
/**
|
|
159
|
+
* Dropdown options
|
|
160
|
+
*/
|
|
161
|
+
options: Array<Option>;
|
|
162
|
+
/**
|
|
163
|
+
* Popup container class name
|
|
164
|
+
*/
|
|
165
|
+
popupClassName?: string;
|
|
166
|
+
/**
|
|
167
|
+
* Popup container inline style
|
|
168
|
+
*/
|
|
169
|
+
popupStyle?: React.CSSProperties;
|
|
170
|
+
/**
|
|
171
|
+
* Selected option values
|
|
172
|
+
*/
|
|
173
|
+
selectedKeys: Array<string | number>;
|
|
174
|
+
/**
|
|
175
|
+
* Currently focused option value
|
|
176
|
+
*/
|
|
177
|
+
focusedKey: string | number;
|
|
178
|
+
/**
|
|
179
|
+
* Test id prefix used to generate each option's test id.
|
|
180
|
+
* Accepts any `data-*` attribute value (see DataAttributeProps).
|
|
181
|
+
*/
|
|
182
|
+
dataTestId?: string | number | boolean;
|
|
183
|
+
/**
|
|
184
|
+
* Whether multiple selection mode is active
|
|
185
|
+
*/
|
|
186
|
+
multiple: boolean;
|
|
187
|
+
/**
|
|
188
|
+
* Callback when an option is selected
|
|
189
|
+
*/
|
|
190
|
+
onSelect: (
|
|
191
|
+
key: string | number,
|
|
192
|
+
e?: React.MouseEvent | React.KeyboardEvent,
|
|
193
|
+
) => void;
|
|
194
|
+
}
|
package/src/Select/option.tsx
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
|
+
import { Check } from 'lucide-react';
|
|
2
3
|
import React, { useContext } from 'react';
|
|
3
4
|
|
|
5
|
+
import type { OptionProps } from './interface';
|
|
4
6
|
import { OptionsCtx } from './options';
|
|
5
7
|
|
|
6
|
-
const Option = (props:
|
|
8
|
+
const Option = (props: OptionProps) => {
|
|
7
9
|
const { label, value, disabled, title, dataTestId } = props;
|
|
8
|
-
const { prefixCls, selectedKeys, focusedKey, onSelect } =
|
|
10
|
+
const { prefixCls, selectedKeys, focusedKey, multiple, onSelect } =
|
|
9
11
|
useContext(OptionsCtx);
|
|
10
12
|
|
|
11
13
|
const handleClick = (e: React.MouseEvent | React.KeyboardEvent) => {
|
|
@@ -20,10 +22,12 @@ const Option = (props: any) => {
|
|
|
20
22
|
? label
|
|
21
23
|
: undefined;
|
|
22
24
|
|
|
25
|
+
const selected = selectedKeys.includes(value);
|
|
26
|
+
|
|
23
27
|
return (
|
|
24
28
|
<div
|
|
25
29
|
className={clsx(`${prefixCls}-option`, {
|
|
26
|
-
[`${prefixCls}-option-selected`]:
|
|
30
|
+
[`${prefixCls}-option-selected`]: selected,
|
|
27
31
|
[`${prefixCls}-option-focused`]: focusedKey === value,
|
|
28
32
|
[`${prefixCls}-option-disabled`]: disabled,
|
|
29
33
|
})}
|
|
@@ -39,7 +43,12 @@ const Option = (props: any) => {
|
|
|
39
43
|
title={htmlTitle}
|
|
40
44
|
data-testid={dataTestId}
|
|
41
45
|
>
|
|
42
|
-
{label}
|
|
46
|
+
<div className={`${prefixCls}-option-content`}>{label}</div>
|
|
47
|
+
{multiple && selected && (
|
|
48
|
+
<span className={`${prefixCls}-option-state`}>
|
|
49
|
+
<Check size={16} />
|
|
50
|
+
</span>
|
|
51
|
+
)}
|
|
43
52
|
</div>
|
|
44
53
|
);
|
|
45
54
|
};
|
package/src/Select/options.tsx
CHANGED
|
@@ -1,54 +1,60 @@
|
|
|
1
1
|
import clsx from 'clsx';
|
|
2
2
|
import React, { createContext, forwardRef, useRef } from 'react';
|
|
3
3
|
import { useLocale } from '../locale';
|
|
4
|
+
import type { OptionsContextValue, OptionsProps } from './interface';
|
|
4
5
|
import Option from './option';
|
|
5
6
|
|
|
6
|
-
export const OptionsCtx = createContext(
|
|
7
|
+
export const OptionsCtx = createContext<OptionsContextValue>(
|
|
8
|
+
{} as OptionsContextValue,
|
|
9
|
+
);
|
|
7
10
|
|
|
8
|
-
const Options = forwardRef
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
const Options = forwardRef<HTMLDivElement, OptionsProps>(
|
|
12
|
+
(props, ref: React.Ref<HTMLDivElement>) => {
|
|
13
|
+
const { locale } = useLocale();
|
|
14
|
+
const { select } = locale;
|
|
11
15
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
const {
|
|
17
|
+
prefixCls,
|
|
18
|
+
options,
|
|
19
|
+
popupClassName,
|
|
20
|
+
popupStyle,
|
|
21
|
+
selectedKeys,
|
|
22
|
+
focusedKey,
|
|
23
|
+
dataTestId,
|
|
24
|
+
multiple,
|
|
25
|
+
onSelect,
|
|
26
|
+
...rest
|
|
27
|
+
} = props;
|
|
23
28
|
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
30
|
+
const componentRef = ref || useRef<HTMLDivElement>(null);
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
{...rest}
|
|
35
|
+
className={clsx(`${prefixCls}-popup`, popupClassName)}
|
|
36
|
+
style={popupStyle}
|
|
37
|
+
ref={componentRef}
|
|
38
|
+
tabIndex={-1}
|
|
39
|
+
>
|
|
40
|
+
{options.length === 0 ? (
|
|
41
|
+
<div className={`${prefixCls}-empty`}>{select.noData}</div>
|
|
42
|
+
) : (
|
|
43
|
+
<OptionsCtx.Provider
|
|
44
|
+
value={{ prefixCls, selectedKeys, focusedKey, multiple, onSelect }}
|
|
45
|
+
>
|
|
46
|
+
{options.map((option, index: number) => (
|
|
47
|
+
<Option
|
|
48
|
+
{...option}
|
|
49
|
+
key={option.value}
|
|
50
|
+
dataTestId={`${dataTestId}-${index}`}
|
|
51
|
+
/>
|
|
52
|
+
))}
|
|
53
|
+
</OptionsCtx.Provider>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
);
|
|
53
59
|
|
|
54
60
|
export default Options;
|
package/src/Select/select.tsx
CHANGED
|
@@ -65,7 +65,10 @@ const Select = (baseprops: SelectProps) => {
|
|
|
65
65
|
return options.find((opt) => opt.value === keys);
|
|
66
66
|
};
|
|
67
67
|
|
|
68
|
-
const handleSelect = (
|
|
68
|
+
const handleSelect = (
|
|
69
|
+
key: string | number,
|
|
70
|
+
e?: React.MouseEvent | React.KeyboardEvent,
|
|
71
|
+
) => {
|
|
69
72
|
let keys;
|
|
70
73
|
if (single) {
|
|
71
74
|
setMergedValue([key]);
|
|
@@ -137,12 +140,12 @@ const Select = (baseprops: SelectProps) => {
|
|
|
137
140
|
const popup = (
|
|
138
141
|
<Options
|
|
139
142
|
prefixCls={prefixCls}
|
|
143
|
+
multiple={mode === 'multiple' || mode === 'tags'}
|
|
140
144
|
options={filteredOpts}
|
|
141
145
|
focusedKey={focusedKey}
|
|
142
146
|
selectedKeys={mergedValue}
|
|
143
147
|
dataTestId={rest['data-testid']}
|
|
144
148
|
onSelect={handleSelect}
|
|
145
|
-
onClose={() => setOpen(false)}
|
|
146
149
|
ref={popupRef}
|
|
147
150
|
/>
|
|
148
151
|
);
|
|
@@ -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
|
}
|
|
@@ -44,6 +44,7 @@ const Selector = React.forwardRef(
|
|
|
44
44
|
value,
|
|
45
45
|
open,
|
|
46
46
|
loading,
|
|
47
|
+
size = 'default',
|
|
47
48
|
onSearch,
|
|
48
49
|
onRemove,
|
|
49
50
|
onClear,
|
|
@@ -104,6 +105,7 @@ const Selector = React.forwardRef(
|
|
|
104
105
|
|
|
105
106
|
const cls = clsx(
|
|
106
107
|
prefixCls,
|
|
108
|
+
[`${prefixCls}-${size}`],
|
|
107
109
|
[`${prefixCls}-searchable`],
|
|
108
110
|
[`${prefixCls}-${mode || 'single'}`],
|
|
109
111
|
{
|
|
@@ -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 {
|
|
@@ -18,7 +18,7 @@ export default function useFilter({
|
|
|
18
18
|
const [filterRecords, setFilterRecords] = useState<Array<FilterRecord>>([]);
|
|
19
19
|
const onFilter = ({ value, dataIndex }: FilterOptions) => {
|
|
20
20
|
let newFilterMap = [...filterRecords];
|
|
21
|
-
if (!value) {
|
|
21
|
+
if (!value || (Array.isArray(value) && !value.length)) {
|
|
22
22
|
newFilterMap = newFilterMap.filter(
|
|
23
23
|
(item) => item.dataIndex !== dataIndex,
|
|
24
24
|
);
|
package/src/Table/interface.ts
CHANGED
|
@@ -520,6 +520,10 @@ export interface TableProps
|
|
|
520
520
|
* Row class name, unlike classNames, this prop can be set dynamically via a function
|
|
521
521
|
*/
|
|
522
522
|
rowClassName?: (record: object) => string;
|
|
523
|
+
/**
|
|
524
|
+
* Row style, unlike styles, this prop can be set dynamically via a function
|
|
525
|
+
*/
|
|
526
|
+
rowStyle?: (record: object) => React.CSSProperties;
|
|
523
527
|
/**
|
|
524
528
|
* Pagination config
|
|
525
529
|
*/
|
|
@@ -175,8 +175,7 @@ const HeaderFilter = React.memo((props: any) => {
|
|
|
175
175
|
<Search size={14} strokeWidth={1.5} />
|
|
176
176
|
)
|
|
177
177
|
}
|
|
178
|
-
|
|
179
|
-
color="info"
|
|
178
|
+
variant={selectNodes.length ? 'filled' : undefined}
|
|
180
179
|
type="text"
|
|
181
180
|
size="small"
|
|
182
181
|
/>
|
|
@@ -188,6 +187,7 @@ const HeaderFilter = React.memo((props: any) => {
|
|
|
188
187
|
<Popover
|
|
189
188
|
trigger="click"
|
|
190
189
|
placement="bottomRight"
|
|
190
|
+
className={clsx(`${prefixCls}-filter`)}
|
|
191
191
|
content={popup}
|
|
192
192
|
arrow
|
|
193
193
|
open={open}
|