@rainbow-oh/yee-c 0.10.0 → 0.12.0
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/Anchor/style/index.less +3 -3
- package/dist/cjs/Button/demo/icon.js +1 -1
- package/dist/cjs/Button/style/index.less +72 -52
- package/dist/cjs/DatePicker/style/mobile.less +1 -1
- package/dist/cjs/Descriptions/style/index.less +6 -6
- package/dist/cjs/FloatButton/style/index.less +2 -2
- package/dist/cjs/Form/style/index.less +21 -21
- package/dist/cjs/ImageViewer/style/index.less +13 -13
- package/dist/cjs/Input/style/index.less +1 -1
- package/dist/cjs/InputNumber/style/index.less +9 -9
- package/dist/cjs/Menu/style/index.less +1 -1
- package/dist/cjs/PickerPanel/style/index.less +5 -5
- package/dist/cjs/RangePicker/style/index.less +53 -52
- package/dist/cjs/Rate/style/index.less +1 -1
- package/dist/cjs/Search/style/index.less +10 -10
- package/dist/cjs/Segmented/style/index.less +2 -2
- package/dist/cjs/Selector/selector.js +1 -1
- package/dist/cjs/Selector/style/index.less +1 -1
- package/dist/cjs/Table/demo/resizable.d.ts +3 -0
- package/dist/cjs/Table/demo/resizable.js +143 -0
- package/dist/cjs/Table/hooks/useColumnResize.d.ts +30 -0
- package/dist/cjs/Table/hooks/useColumnResize.js +217 -0
- package/dist/cjs/Table/hooks/useColumns.d.ts +3 -1
- package/dist/cjs/Table/hooks/useColumns.js +14 -3
- package/dist/cjs/Table/interface.d.ts +49 -0
- package/dist/cjs/Table/style/index.less +43 -1
- package/dist/cjs/Table/table.js +62 -9
- package/dist/cjs/Table/theader/cell.js +46 -4
- package/dist/cjs/Table/util/index.d.ts +19 -1
- package/dist/cjs/Table/util/index.js +22 -0
- package/dist/cjs/Tabs/interface.d.ts +1 -1
- package/dist/cjs/Tabs/style/index.less +9 -9
- package/dist/cjs/Tabs/tab-header/index.js +5 -1
- package/dist/cjs/Tour/demo/indicators.js +1 -1
- package/dist/cjs/Tour/demo/placement.js +1 -1
- package/dist/cjs/Transfer/style/index.less +1 -1
- package/dist/cjs/Tree/style/index.less +3 -3
- package/dist/cjs/TreeSelect/style/index.less +1 -1
- package/dist/cjs/Upload/style/index.less +11 -12
- package/dist/cjs/WheelPicker/style/index.less +3 -3
- package/dist/cjs/locale/interface.d.ts +1 -0
- package/dist/cjs/locale/lang/en_US.js +2 -1
- package/dist/cjs/locale/lang/ja_JP.js +2 -1
- package/dist/cjs/locale/lang/zh_CN.js +2 -1
- package/dist/cjs/locale/lang/zh_TW.js +2 -1
- package/dist/cjs/message/style/index.less +4 -4
- package/dist/cjs/style/color.blue.css +254 -290
- package/dist/cjs/style/color.crimson.css +434 -471
- package/dist/cjs/style/color.css +736 -508
- package/dist/cjs/style/color.dark.css +464 -501
- package/dist/cjs/style/color.gemini.css +134 -0
- package/dist/cjs/style/color.green.css +459 -495
- package/dist/cjs/style/color.jam.css +463 -500
- package/dist/cjs/style/color.navy.css +466 -503
- package/dist/cjs/style/color.peach.css +464 -501
- package/dist/cjs/style/color.pine.css +462 -500
- package/dist/cjs/style/color.pitaya.css +465 -502
- package/dist/cjs/style/color.pumpkin.css +464 -501
- package/dist/cjs/style/color.ruby.css +466 -503
- package/dist/cjs/style/size.css +144 -2
- package/dist/cjs/style/themes.css +4999 -5268
- package/dist/cjs/style/variables.css +882 -512
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Anchor/style/index.less +3 -3
- package/dist/esm/Button/demo/icon.js +7 -4
- package/dist/esm/Button/style/index.less +72 -52
- package/dist/esm/DatePicker/style/mobile.less +1 -1
- package/dist/esm/Descriptions/style/index.less +6 -6
- package/dist/esm/FloatButton/style/index.less +2 -2
- package/dist/esm/Form/style/index.less +21 -21
- package/dist/esm/ImageViewer/style/index.less +13 -13
- package/dist/esm/Input/style/index.less +1 -1
- package/dist/esm/InputNumber/style/index.less +9 -9
- package/dist/esm/Menu/style/index.less +1 -1
- package/dist/esm/PickerPanel/style/index.less +5 -5
- package/dist/esm/RangePicker/style/index.less +53 -52
- package/dist/esm/Rate/style/index.less +1 -1
- package/dist/esm/Search/style/index.less +10 -10
- package/dist/esm/Segmented/style/index.less +2 -2
- package/dist/esm/Selector/selector.js +1 -1
- package/dist/esm/Selector/style/index.less +1 -1
- package/dist/esm/Table/demo/resizable.d.ts +3 -0
- package/dist/esm/Table/demo/resizable.js +110 -0
- package/dist/esm/Table/hooks/useColumnResize.d.ts +30 -0
- package/dist/esm/Table/hooks/useColumnResize.js +206 -0
- package/dist/esm/Table/hooks/useColumns.d.ts +3 -1
- package/dist/esm/Table/hooks/useColumns.js +9 -4
- package/dist/esm/Table/interface.d.ts +49 -0
- package/dist/esm/Table/style/index.less +43 -1
- package/dist/esm/Table/table.js +83 -13
- package/dist/esm/Table/theader/cell.js +38 -3
- package/dist/esm/Table/util/index.d.ts +19 -1
- package/dist/esm/Table/util/index.js +37 -0
- package/dist/esm/Tabs/interface.d.ts +1 -1
- package/dist/esm/Tabs/style/index.less +9 -9
- package/dist/esm/Tabs/tab-header/index.js +7 -2
- package/dist/esm/Tour/demo/indicators.js +1 -1
- package/dist/esm/Tour/demo/placement.js +1 -1
- package/dist/esm/Transfer/style/index.less +1 -1
- package/dist/esm/Tree/style/index.less +3 -3
- package/dist/esm/TreeSelect/style/index.less +1 -1
- package/dist/esm/Upload/style/index.less +11 -12
- package/dist/esm/WheelPicker/style/index.less +3 -3
- package/dist/esm/index.js +1 -0
- package/dist/esm/locale/interface.d.ts +1 -0
- package/dist/esm/locale/lang/en_US.js +2 -1
- package/dist/esm/locale/lang/ja_JP.js +2 -1
- package/dist/esm/locale/lang/zh_CN.js +2 -1
- package/dist/esm/locale/lang/zh_TW.js +2 -1
- package/dist/esm/message/style/index.less +4 -4
- package/dist/esm/style/color.blue.css +254 -290
- package/dist/esm/style/color.crimson.css +434 -471
- package/dist/esm/style/color.css +736 -508
- package/dist/esm/style/color.dark.css +464 -501
- package/dist/esm/style/color.gemini.css +134 -0
- package/dist/esm/style/color.green.css +459 -495
- package/dist/esm/style/color.jam.css +463 -500
- package/dist/esm/style/color.navy.css +466 -503
- package/dist/esm/style/color.peach.css +464 -501
- package/dist/esm/style/color.pine.css +462 -500
- package/dist/esm/style/color.pitaya.css +465 -502
- package/dist/esm/style/color.pumpkin.css +464 -501
- package/dist/esm/style/color.ruby.css +466 -503
- package/dist/esm/style/size.css +144 -2
- package/dist/esm/style/themes.css +4999 -5268
- package/dist/esm/style/variables.css +882 -512
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +80 -22
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +4 -2
- package/src/Anchor/style/index.less +3 -3
- package/src/Button/demo/icon.tsx +5 -3
- package/src/Button/style/index.less +72 -52
- package/src/DatePicker/style/mobile.less +1 -1
- package/src/Descriptions/style/index.less +6 -6
- package/src/FloatButton/style/index.less +2 -2
- package/src/Form/style/index.less +21 -21
- package/src/ImageViewer/style/index.less +13 -13
- package/src/Input/style/index.less +1 -1
- package/src/InputNumber/style/index.less +9 -9
- package/src/Menu/style/index.less +1 -1
- package/src/PickerPanel/style/index.less +5 -5
- package/src/RangePicker/style/index.less +53 -52
- package/src/Rate/style/index.less +1 -1
- package/src/Search/style/index.less +10 -10
- package/src/Segmented/style/index.less +2 -2
- package/src/Selector/selector.tsx +1 -1
- package/src/Selector/style/index.less +1 -1
- package/src/Table/demo/resizable.tsx +106 -0
- package/src/Table/hooks/useColumnResize.ts +224 -0
- package/src/Table/hooks/useColumns.ts +18 -3
- package/src/Table/index.en-US.md +7 -0
- package/src/Table/index.zh-CN.md +7 -0
- package/src/Table/interface.ts +52 -0
- package/src/Table/style/index.less +43 -1
- package/src/Table/table-resize.test.tsx +234 -0
- package/src/Table/table.tsx +90 -13
- package/src/Table/theader/cell.tsx +52 -2
- package/src/Table/util/index.ts +44 -1
- package/src/Tabs/interface.ts +1 -1
- package/src/Tabs/style/index.less +9 -9
- package/src/Tabs/tab-header/index.tsx +5 -1
- package/src/Tour/demo/indicators.tsx +2 -2
- package/src/Tour/demo/placement.tsx +1 -1
- package/src/Transfer/style/index.less +1 -1
- package/src/Tree/style/index.less +3 -3
- package/src/TreeSelect/style/index.less +1 -1
- package/src/Upload/style/index.less +11 -12
- package/src/WheelPicker/style/index.less +3 -3
- package/src/index.ts +1 -0
- package/src/locale/interface.ts +1 -0
- package/src/locale/lang/en_US.ts +1 -0
- package/src/locale/lang/ja_JP.ts +1 -0
- package/src/locale/lang/zh_CN.ts +1 -0
- package/src/locale/lang/zh_TW.ts +1 -0
- package/src/message/style/index.less +4 -4
- package/src/style/color.blue.css +254 -290
- package/src/style/color.crimson.css +434 -471
- package/src/style/color.css +736 -508
- package/src/style/color.dark.css +464 -501
- package/src/style/color.gemini.css +134 -0
- package/src/style/color.green.css +459 -495
- package/src/style/color.jam.css +463 -500
- package/src/style/color.navy.css +466 -503
- package/src/style/color.peach.css +464 -501
- package/src/style/color.pine.css +462 -500
- package/src/style/color.pitaya.css +465 -502
- package/src/style/color.pumpkin.css +464 -501
- package/src/style/color.ruby.css +466 -503
- package/src/style/size.css +144 -2
- package/src/version.ts +1 -1
|
@@ -5,14 +5,18 @@
|
|
|
5
5
|
display: flex;
|
|
6
6
|
align-items: center;
|
|
7
7
|
justify-content: space-between;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
padding:
|
|
8
|
+
box-sizing: border-box;
|
|
9
|
+
height: var(--yee-range-picker-trigger-height);
|
|
10
|
+
padding: var(--yee-range-picker-trigger-padding);
|
|
11
|
+
font-size: var(--yee-range-picker-trigger-font-size);
|
|
12
|
+
border: var(--yee-range-picker-trigger-border-width) solid
|
|
13
|
+
var(--yee-range-picker-trigger-border-color);
|
|
14
|
+
border-radius: var(--yee-range-picker-trigger-border-radius);
|
|
11
15
|
background-color: var(--yee-input-content-bg-color);
|
|
12
16
|
cursor: pointer;
|
|
13
17
|
|
|
14
18
|
&:hover:not(&-disabled) {
|
|
15
|
-
border-color: var(--yee-
|
|
19
|
+
border-color: var(--yee-range-picker-trigger-hover-border-color);
|
|
16
20
|
|
|
17
21
|
@{pls}-clear {
|
|
18
22
|
visibility: visible;
|
|
@@ -21,7 +25,7 @@
|
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
&-focused {
|
|
24
|
-
border-color: var(--yee-
|
|
28
|
+
border-color: var(--yee-range-picker-trigger-border-color);
|
|
25
29
|
box-shadow: 0 0 0 2px var(--yee-input-focus-bs-color);
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -31,47 +35,42 @@
|
|
|
31
35
|
opacity: 0.6;
|
|
32
36
|
}
|
|
33
37
|
|
|
38
|
+
// 盒模型(高度 / 圆角 / 内边距)全部由触发器承担,
|
|
39
|
+
// 内部 Input 只负责撑满,这样各尺寸都跟随 token,不再硬编码
|
|
40
|
+
@{pls}-start-input,
|
|
41
|
+
@{pls}-end-input {
|
|
42
|
+
height: 100%;
|
|
43
|
+
padding: 0;
|
|
44
|
+
font-size: inherit;
|
|
45
|
+
line-height: 1;
|
|
46
|
+
}
|
|
47
|
+
|
|
34
48
|
// Size variants
|
|
35
49
|
&-small {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
@{pls}-end-input {
|
|
40
|
-
font-size: 12px;
|
|
41
|
-
height: 24px;
|
|
42
|
-
line-height: 24px;
|
|
43
|
-
}
|
|
50
|
+
height: var(--yee-range-picker-trigger-small-height);
|
|
51
|
+
padding: var(--yee-range-picker-trigger-small-padding);
|
|
52
|
+
font-size: var(--yee-range-picker-trigger-small-font-size);
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
&-middle {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
@{pls}-end-input {
|
|
51
|
-
font-size: 14px;
|
|
52
|
-
height: 32px;
|
|
53
|
-
line-height: 32px;
|
|
54
|
-
}
|
|
56
|
+
height: var(--yee-range-picker-trigger-height);
|
|
57
|
+
padding: var(--yee-range-picker-trigger-padding);
|
|
58
|
+
font-size: var(--yee-range-picker-trigger-font-size);
|
|
55
59
|
}
|
|
56
60
|
|
|
57
61
|
&-large {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
@{pls}-end-input {
|
|
62
|
-
font-size: 16px;
|
|
63
|
-
height: 40px;
|
|
64
|
-
line-height: 40px;
|
|
65
|
-
}
|
|
62
|
+
height: var(--yee-range-picker-trigger-large-height);
|
|
63
|
+
padding: var(--yee-range-picker-trigger-large-padding);
|
|
64
|
+
font-size: var(--yee-range-picker-trigger-large-font-size);
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
// Status variants
|
|
69
68
|
&-error {
|
|
70
|
-
border-color: var(--yee-error
|
|
69
|
+
border-color: var(--yee-color-error);
|
|
71
70
|
|
|
72
71
|
&:hover,
|
|
73
72
|
&-focused {
|
|
74
|
-
border-color: var(--yee-error
|
|
73
|
+
border-color: var(--yee-color-error);
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
&-focused {
|
|
@@ -80,11 +79,11 @@
|
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
&-warning {
|
|
83
|
-
border-color: var(--yee-warning
|
|
82
|
+
border-color: var(--yee-color-warning);
|
|
84
83
|
|
|
85
84
|
&:hover,
|
|
86
85
|
&-focused {
|
|
87
|
-
border-color: var(--yee-warning
|
|
86
|
+
border-color: var(--yee-color-warning);
|
|
88
87
|
}
|
|
89
88
|
|
|
90
89
|
&-focused {
|
|
@@ -106,13 +105,13 @@
|
|
|
106
105
|
|
|
107
106
|
&-separator {
|
|
108
107
|
margin: 0 8px;
|
|
109
|
-
color: var(--yee-placeholder
|
|
108
|
+
color: var(--yee-color-placeholder);
|
|
110
109
|
}
|
|
111
110
|
|
|
112
111
|
&-suffix {
|
|
113
112
|
display: flex;
|
|
114
113
|
align-items: center;
|
|
115
|
-
color: var(--yee-text-
|
|
114
|
+
color: var(--yee-color-text-description);
|
|
116
115
|
margin-left: 8px;
|
|
117
116
|
flex-shrink: 0;
|
|
118
117
|
}
|
|
@@ -122,14 +121,14 @@
|
|
|
122
121
|
padding: var(--yee-input-clear-padding);
|
|
123
122
|
color: var(--yee-input-clear-color);
|
|
124
123
|
background-color: var(--yee-input-clear-bg-color);
|
|
125
|
-
border-radius:
|
|
124
|
+
border-radius: var(--yee-range-picker-clear-border-radius);
|
|
126
125
|
visibility: hidden;
|
|
127
126
|
z-index: 0;
|
|
128
127
|
cursor: pointer;
|
|
129
128
|
}
|
|
130
129
|
|
|
131
130
|
&-panel {
|
|
132
|
-
background-color: var(--yee-
|
|
131
|
+
background-color: var(--yee-range-picker-panel-bg-color);
|
|
133
132
|
|
|
134
133
|
&-now-btn {
|
|
135
134
|
margin-left: auto;
|
|
@@ -140,14 +139,14 @@
|
|
|
140
139
|
display: flex;
|
|
141
140
|
align-items: flex-start;
|
|
142
141
|
justify-content: space-between;
|
|
143
|
-
padding:
|
|
142
|
+
padding: var(--yee-range-picker-panel-footer-padding);
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
// Panel wrapper with ranges
|
|
147
146
|
&-panel-wrapper {
|
|
148
147
|
display: flex;
|
|
149
148
|
background: var(--yee-color-bg-elevated);
|
|
150
|
-
border-radius:
|
|
149
|
+
border-radius: var(--yee-range-picker-panel-wrapper-border-radius);
|
|
151
150
|
box-shadow:
|
|
152
151
|
0 3px 6px -4px var(--yee-notice-box-shadow-color-2),
|
|
153
152
|
0 6px 16px 0 var(--yee-notice-box-shadow-color-1),
|
|
@@ -167,11 +166,11 @@
|
|
|
167
166
|
transition: all 0.3s;
|
|
168
167
|
white-space: nowrap;
|
|
169
168
|
font-size: 14px;
|
|
170
|
-
color: var(--yee-text
|
|
169
|
+
color: var(--yee-color-text);
|
|
171
170
|
|
|
172
171
|
&:hover {
|
|
173
172
|
background-color: var(--yee-color-bg-rail);
|
|
174
|
-
color: var(--yee-primary
|
|
173
|
+
color: var(--yee-color-primary);
|
|
175
174
|
}
|
|
176
175
|
}
|
|
177
176
|
|
|
@@ -179,7 +178,7 @@
|
|
|
179
178
|
&-mobile-tabs {
|
|
180
179
|
display: flex;
|
|
181
180
|
margin-bottom: 12px;
|
|
182
|
-
border-bottom: 1px solid var(--yee-border
|
|
181
|
+
border-bottom: 1px solid var(--yee-color-border, #e5e5e5);
|
|
183
182
|
}
|
|
184
183
|
|
|
185
184
|
&-mobile-tab {
|
|
@@ -187,7 +186,7 @@
|
|
|
187
186
|
padding: 8px 0;
|
|
188
187
|
text-align: center;
|
|
189
188
|
font-size: 14px;
|
|
190
|
-
color: var(--yee-text-
|
|
189
|
+
color: var(--yee-color-text-description, #999);
|
|
191
190
|
background: none;
|
|
192
191
|
border: none;
|
|
193
192
|
border-bottom: 2px solid transparent;
|
|
@@ -195,8 +194,8 @@
|
|
|
195
194
|
transition: all 0.2s;
|
|
196
195
|
|
|
197
196
|
&-active {
|
|
198
|
-
color: var(--yee-primary
|
|
199
|
-
border-bottom-color: var(--yee-primary
|
|
197
|
+
color: var(--yee-color-primary);
|
|
198
|
+
border-bottom-color: var(--yee-color-primary);
|
|
200
199
|
}
|
|
201
200
|
}
|
|
202
201
|
}
|
|
@@ -215,9 +214,11 @@
|
|
|
215
214
|
left: 0;
|
|
216
215
|
z-index: 2;
|
|
217
216
|
width: 100%;
|
|
218
|
-
height:
|
|
219
|
-
border-top:
|
|
220
|
-
|
|
217
|
+
height: var(--yee-picker-range-hover-after-height);
|
|
218
|
+
border-top: var(--yee-picker-range-hover-after-border-width) dashed
|
|
219
|
+
var(--yee-range-picker-hover-border-color);
|
|
220
|
+
border-bottom: var(--yee-picker-range-hover-after-border-width) dashed
|
|
221
|
+
var(--yee-range-picker-hover-border-color);
|
|
221
222
|
transform: translateY(-50%);
|
|
222
223
|
content: '';
|
|
223
224
|
}
|
|
@@ -259,7 +260,7 @@
|
|
|
259
260
|
&-range-hover-end:not(&-not-in-view) {
|
|
260
261
|
&::after {
|
|
261
262
|
z-index: 2;
|
|
262
|
-
border-right: 1px dashed var(--yee-
|
|
263
|
+
border-right: 1px dashed var(--yee-range-picker-hover-border-color);
|
|
263
264
|
border-top-right-radius: 2px;
|
|
264
265
|
border-bottom-right-radius: 2px;
|
|
265
266
|
}
|
|
@@ -271,7 +272,7 @@
|
|
|
271
272
|
&-range-hover:first-child:not(&-not-in-view) {
|
|
272
273
|
&::after {
|
|
273
274
|
z-index: 2;
|
|
274
|
-
border-left: 1px dashed var(--yee-
|
|
275
|
+
border-left: 1px dashed var(--yee-range-picker-hover-border-color);
|
|
275
276
|
border-top-left-radius: 2px;
|
|
276
277
|
border-bottom-left-radius: 2px;
|
|
277
278
|
}
|
|
@@ -302,14 +303,14 @@
|
|
|
302
303
|
left: 0;
|
|
303
304
|
z-index: 1;
|
|
304
305
|
width: 100%;
|
|
305
|
-
height:
|
|
306
|
+
height: var(--yee-picker-in-range-before-height);
|
|
306
307
|
transform: translateY(-50%);
|
|
307
308
|
content: '';
|
|
308
309
|
}
|
|
309
310
|
|
|
310
311
|
&:not(@{cellPrefixCls}-not-in-view) {
|
|
311
312
|
&::before {
|
|
312
|
-
background-color: var(--yee-
|
|
313
|
+
background-color: var(--yee-range-picker-checked-bg-color);
|
|
313
314
|
}
|
|
314
315
|
}
|
|
315
316
|
}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
width: var(--yee-rate-star-width);
|
|
24
24
|
height: var(--yee-rate-star-height);
|
|
25
25
|
margin-right: var(--yee-rate-margin-right);
|
|
26
|
-
color: var(--yee-star-icon-color);
|
|
26
|
+
color: var(--yee-rate-star-icon-color);
|
|
27
27
|
font-size: var(--yee-rate-star-font-size);
|
|
28
28
|
cursor: pointer;
|
|
29
29
|
transition: font 0.1s ease-in;
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
align-items: center;
|
|
9
9
|
width: 100%;
|
|
10
10
|
padding: var(--yee-search-padding);
|
|
11
|
-
color: var(--yee-text
|
|
11
|
+
color: var(--yee-color-text);
|
|
12
12
|
font-size: var(--yee-search-font-size);
|
|
13
13
|
background-color: var(--yee-input-content-bg-color);
|
|
14
14
|
background-image: none;
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
&-disabled {
|
|
29
|
-
color: var(--yee-text-
|
|
29
|
+
color: var(--yee-color-text-disabled);
|
|
30
30
|
background-color: var(--yee-input-content-disabled-bg-color);
|
|
31
31
|
cursor: not-allowed;
|
|
32
32
|
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
input {
|
|
38
|
-
color: var(--yee-text-
|
|
38
|
+
color: var(--yee-color-text-disabled);
|
|
39
39
|
background-color: transparent;
|
|
40
40
|
cursor: not-allowed;
|
|
41
41
|
}
|
|
@@ -72,16 +72,16 @@
|
|
|
72
72
|
line-height: var(--yee-input-line-height);
|
|
73
73
|
|
|
74
74
|
&::placeholder {
|
|
75
|
-
color: var(--yee-placeholder
|
|
75
|
+
color: var(--yee-color-placeholder);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
&-disabled {
|
|
79
|
-
color: var(--yee-text-
|
|
79
|
+
color: var(--yee-color-text-disabled);
|
|
80
80
|
background-color: transparent;
|
|
81
81
|
cursor: not-allowed;
|
|
82
82
|
|
|
83
83
|
&::placeholder {
|
|
84
|
-
color: var(--yee-text-
|
|
84
|
+
color: var(--yee-color-text-disabled);
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
justify-content: center;
|
|
132
132
|
margin-left: var(--yee-search-button-margin-left);
|
|
133
133
|
padding: var(--yee-search-button-padding);
|
|
134
|
-
color: var(--yee-text
|
|
134
|
+
color: var(--yee-color-text);
|
|
135
135
|
font-weight: var(--yee-search-button-font-weight);
|
|
136
136
|
background-color: var(--yee-color-bg-head);
|
|
137
137
|
border-radius: var(--yee-search-button-border-radius);
|
|
@@ -139,15 +139,15 @@
|
|
|
139
139
|
transition: all 0.2s;
|
|
140
140
|
|
|
141
141
|
&:hover {
|
|
142
|
-
color: var(--yee-primary
|
|
142
|
+
color: var(--yee-color-primary);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
&-disabled {
|
|
146
|
-
color: var(--yee-text-
|
|
146
|
+
color: var(--yee-color-text-disabled);
|
|
147
147
|
cursor: not-allowed;
|
|
148
148
|
|
|
149
149
|
&:hover {
|
|
150
|
-
color: var(--yee-text-
|
|
150
|
+
color: var(--yee-color-text-disabled);
|
|
151
151
|
}
|
|
152
152
|
}
|
|
153
153
|
}
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
&-item:has(&-input:focus-visible) {
|
|
88
|
-
box-shadow: 0 0 0 2px var(--yee-primary
|
|
88
|
+
box-shadow: 0 0 0 2px var(--yee-color-primary);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
// 变体:胶囊风格,选中项以主色胶囊高亮,容器无底色
|
|
@@ -106,7 +106,7 @@
|
|
|
106
106
|
border-radius: 999px;
|
|
107
107
|
background-color: var(
|
|
108
108
|
--yee-segmented-pill-bg-color,
|
|
109
|
-
var(--yee-primary
|
|
109
|
+
var(--yee-color-primary)
|
|
110
110
|
);
|
|
111
111
|
box-shadow: none;
|
|
112
112
|
}
|
|
@@ -180,7 +180,7 @@ var Selector = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
180
180
|
variant: "ring",
|
|
181
181
|
size: "small",
|
|
182
182
|
style: {
|
|
183
|
-
'--m-indicator-dot-bg-color': 'var(--yee-text-
|
|
183
|
+
'--m-indicator-dot-bg-color': 'var(--yee-color-text-secondary)'
|
|
184
184
|
}
|
|
185
185
|
}) : suffix ? typeof suffix === 'function' ? suffix() : suffix : /*#__PURE__*/React.createElement(ChevronDown, {
|
|
186
186
|
size: 16,
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
position: absolute;
|
|
136
136
|
width: 100%;
|
|
137
137
|
overflow: hidden;
|
|
138
|
-
color: var(--yee-text-
|
|
138
|
+
color: var(--yee-color-text-secondary);
|
|
139
139
|
font-size: var(--yee-selector-placeholder-font-size);
|
|
140
140
|
white-space: nowrap;
|
|
141
141
|
text-overflow: ellipsis;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { Table } from "../..";
|
|
14
|
+
import React from 'react';
|
|
15
|
+
var columns = [{
|
|
16
|
+
title: 'Name',
|
|
17
|
+
dataIndex: 'name',
|
|
18
|
+
key: 'name',
|
|
19
|
+
fixed: 'left',
|
|
20
|
+
width: 140,
|
|
21
|
+
minWidth: 100
|
|
22
|
+
}, {
|
|
23
|
+
title: 'Age',
|
|
24
|
+
dataIndex: 'age',
|
|
25
|
+
key: 'age',
|
|
26
|
+
width: 100,
|
|
27
|
+
sorter: true
|
|
28
|
+
}, {
|
|
29
|
+
title: 'Address',
|
|
30
|
+
dataIndex: 'address',
|
|
31
|
+
key: 'address',
|
|
32
|
+
width: 240
|
|
33
|
+
}, {
|
|
34
|
+
title: 'Company',
|
|
35
|
+
dataIndex: 'company',
|
|
36
|
+
key: 'company',
|
|
37
|
+
width: 180
|
|
38
|
+
}, {
|
|
39
|
+
title: 'Email',
|
|
40
|
+
dataIndex: 'email',
|
|
41
|
+
key: 'email',
|
|
42
|
+
width: 240
|
|
43
|
+
}, {
|
|
44
|
+
// Opt this column out of resizing while the rest stay resizable.
|
|
45
|
+
title: 'Action',
|
|
46
|
+
key: 'action',
|
|
47
|
+
fixed: 'right',
|
|
48
|
+
width: 100,
|
|
49
|
+
resizable: false,
|
|
50
|
+
render: function render(record) {
|
|
51
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
52
|
+
onClick: function onClick() {
|
|
53
|
+
return console.log(record);
|
|
54
|
+
}
|
|
55
|
+
}, "View");
|
|
56
|
+
}
|
|
57
|
+
}];
|
|
58
|
+
var dataSource = [{
|
|
59
|
+
key: '1',
|
|
60
|
+
name: 'John Brown',
|
|
61
|
+
age: 32,
|
|
62
|
+
address: 'New York No. 1 Lake Park',
|
|
63
|
+
company: 'Acme Inc.',
|
|
64
|
+
email: 'john.brown@example.com'
|
|
65
|
+
}, {
|
|
66
|
+
key: '2',
|
|
67
|
+
name: 'Jim Green',
|
|
68
|
+
age: 42,
|
|
69
|
+
address: 'London No. 1 Lake Park',
|
|
70
|
+
company: 'Globex',
|
|
71
|
+
email: 'jim.green@example.com'
|
|
72
|
+
}, {
|
|
73
|
+
key: '3',
|
|
74
|
+
name: 'Joe Black',
|
|
75
|
+
age: 28,
|
|
76
|
+
address: 'Sidney No. 1 Lake Park',
|
|
77
|
+
company: 'Initech',
|
|
78
|
+
email: 'joe.black@example.com'
|
|
79
|
+
}];
|
|
80
|
+
export default (function () {
|
|
81
|
+
var _React$useState = React.useState({}),
|
|
82
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
83
|
+
widths = _React$useState2[0],
|
|
84
|
+
setWidths = _React$useState2[1];
|
|
85
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Table, {
|
|
86
|
+
resizable: true,
|
|
87
|
+
columns: columns,
|
|
88
|
+
dataSource: dataSource,
|
|
89
|
+
rowKey: "key",
|
|
90
|
+
pagination: false,
|
|
91
|
+
scroll: {
|
|
92
|
+
x: 1000
|
|
93
|
+
},
|
|
94
|
+
onColumnResizeEnd: function onColumnResizeEnd(width, column) {
|
|
95
|
+
return setWidths(function (current) {
|
|
96
|
+
var _column$key;
|
|
97
|
+
return _objectSpread(_objectSpread({}, current), {}, _defineProperty({}, String((_column$key = column.key) !== null && _column$key !== void 0 ? _column$key : column.dataIndex), width));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}), /*#__PURE__*/React.createElement("p", {
|
|
101
|
+
style: {
|
|
102
|
+
marginTop: 12
|
|
103
|
+
}
|
|
104
|
+
}, "\u6700\u8FD1\u8C03\u6574\uFF1A", Object.keys(widths).length ? Object.entries(widths).map(function (_ref) {
|
|
105
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
106
|
+
key = _ref2[0],
|
|
107
|
+
width = _ref2[1];
|
|
108
|
+
return "".concat(key, "=").concat(width, "px");
|
|
109
|
+
}).join(',') : '拖动表头右边缘试试'));
|
|
110
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { WrapedColumnProps } from '../interface';
|
|
3
|
+
interface UseColumnResizeOptions {
|
|
4
|
+
tableRef: React.RefObject<HTMLTableElement | null>;
|
|
5
|
+
/**
|
|
6
|
+
* Latest leaf columns. Passed as a ref because the columns are themselves
|
|
7
|
+
* derived from `resizedWidths`; depending on the array would make every
|
|
8
|
+
* width change rebuild the drag handlers mid-drag.
|
|
9
|
+
*/
|
|
10
|
+
columnsRef: React.RefObject<WrapedColumnProps[]>;
|
|
11
|
+
onColumnResize?: (width: number, column: WrapedColumnProps) => void;
|
|
12
|
+
onColumnResizeEnd?: (width: number, column: WrapedColumnProps) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Pointer (and keyboard) driven column resizing.
|
|
16
|
+
*
|
|
17
|
+
* The table normally lets the browser distribute widths (`width: 100%` with an
|
|
18
|
+
* `auto` layout), which means writing a width onto one column would silently
|
|
19
|
+
* steal space from its neighbours. So the first resize interaction snapshots the
|
|
20
|
+
* rendered width of *every* column; from then on the table is fully px
|
|
21
|
+
* controlled and a drag only moves the column it grabbed.
|
|
22
|
+
*/
|
|
23
|
+
export default function useColumnResize({ tableRef, columnsRef, onColumnResize, onColumnResizeEnd, }: UseColumnResizeOptions): {
|
|
24
|
+
resizedWidths: Record<string, number>;
|
|
25
|
+
resizingKey: string | null;
|
|
26
|
+
onResizeStart: (event: React.PointerEvent<HTMLElement>, resizeKey: string) => void;
|
|
27
|
+
onResizeStep: (resizeKey: string, direction: number) => void;
|
|
28
|
+
resetResizedWidths: () => void;
|
|
29
|
+
};
|
|
30
|
+
export {};
|