@rainbow-oh/yee-c 0.8.14 → 0.8.16
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/Progress/circle.js +1 -1
- package/dist/cjs/Progress/line.js +1 -1
- package/dist/cjs/Progress/progress.js +2 -0
- package/dist/cjs/Progress/steps.js +1 -1
- package/dist/cjs/Search/search.js +45 -16
- package/dist/cjs/Select/interface.d.ts +2 -1
- package/dist/cjs/Spin/demo/types.js +1 -1
- package/dist/cjs/Spin/indicator.d.ts +1 -1
- package/dist/cjs/Spin/indicator.js +144 -0
- package/dist/cjs/Spin/interface.d.ts +1 -1
- package/dist/cjs/Spin/style/index.less +86 -0
- package/dist/cjs/Table/demo/fixed.d.ts +3 -0
- package/dist/cjs/Table/demo/fixed.js +123 -0
- package/dist/cjs/Table/hooks/useColumns.d.ts +2 -1
- package/dist/cjs/Table/hooks/useColumns.js +4 -3
- package/dist/cjs/Table/style/index.less +23 -3
- package/dist/cjs/Table/table.js +67 -21
- package/dist/cjs/Table/util/index.d.ts +1 -1
- package/dist/cjs/Table/util/index.js +16 -3
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +1 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Progress/circle.js +2 -1
- package/dist/esm/Progress/line.js +2 -1
- package/dist/esm/Progress/progress.js +2 -0
- package/dist/esm/Progress/steps.js +6 -1
- package/dist/esm/Search/search.js +31 -7
- package/dist/esm/Select/interface.d.ts +2 -1
- package/dist/esm/Spin/demo/types.js +10 -7
- package/dist/esm/Spin/indicator.d.ts +1 -1
- package/dist/esm/Spin/indicator.js +137 -0
- package/dist/esm/Spin/interface.d.ts +1 -1
- package/dist/esm/Spin/style/index.less +86 -0
- package/dist/esm/Table/demo/fixed.d.ts +3 -0
- package/dist/esm/Table/demo/fixed.js +84 -0
- package/dist/esm/Table/hooks/useColumns.d.ts +2 -1
- package/dist/esm/Table/hooks/useColumns.js +4 -3
- package/dist/esm/Table/style/index.less +23 -3
- package/dist/esm/Table/table.js +85 -26
- package/dist/esm/Table/util/index.d.ts +1 -1
- package/dist/esm/Table/util/index.js +16 -3
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/umd/yee-c.min.css +1 -1
- package/dist/umd/yee-c.min.js +1 -1
- package/package.json +1 -1
- package/src/Progress/circle.tsx +1 -1
- package/src/Progress/line.tsx +1 -1
- package/src/Progress/progress.tsx +2 -0
- package/src/Progress/steps.tsx +3 -1
- package/src/Search/search.tsx +33 -4
- package/src/Select/interface.ts +2 -1
- package/src/Spin/demo/types.tsx +18 -3
- package/src/Spin/index.en-US.md +5 -2
- package/src/Spin/index.zh-CN.md +5 -2
- package/src/Spin/indicator.tsx +165 -1
- package/src/Spin/interface.ts +1 -1
- package/src/Spin/style/index.less +86 -0
- package/src/Table/demo/fixed.tsx +92 -0
- package/src/Table/hooks/useColumns.ts +4 -2
- package/src/Table/index.en-US.md +1 -0
- package/src/Table/index.zh-CN.md +1 -0
- package/src/Table/style/index.less +23 -3
- package/src/Table/table.tsx +88 -23
- package/src/Table/util/index.ts +32 -7
- package/src/version.ts +1 -1
|
@@ -148,7 +148,7 @@ var Circle = import_react.default.forwardRef((props, ref) => {
|
|
|
148
148
|
style: { width, height: width },
|
|
149
149
|
ref
|
|
150
150
|
},
|
|
151
|
-
/* @__PURE__ */ import_react.default.createElement("svg", { className: `${prefixCls}-circle`, viewBox: "0 0 120 120" }, /* @__PURE__ */ import_react.default.createElement(
|
|
151
|
+
/* @__PURE__ */ import_react.default.createElement("svg", { className: `${prefixCls}-circle`, viewBox: "0 0 120 120", "aria-hidden": "true" }, /* @__PURE__ */ import_react.default.createElement(
|
|
152
152
|
"circle",
|
|
153
153
|
{
|
|
154
154
|
className: `${prefixCls}-circle-trail`,
|
|
@@ -72,7 +72,7 @@ var Line = import_react.default.forwardRef((props, ref) => {
|
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-outer`, ref }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-inner`, style: { height: strokeWidth } }, /* @__PURE__ */ import_react.default.createElement(
|
|
75
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-outer`, ref }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-inner`, style: { height: strokeWidth }, "aria-hidden": "true" }, /* @__PURE__ */ import_react.default.createElement(
|
|
76
76
|
"div",
|
|
77
77
|
{
|
|
78
78
|
className: `${prefixCls}-bg`,
|
|
@@ -158,6 +158,8 @@ var Progress = import_react.default.forwardRef(
|
|
|
158
158
|
"aria-valuenow": percent,
|
|
159
159
|
"aria-valuemin": 0,
|
|
160
160
|
"aria-valuemax": 100,
|
|
161
|
+
"aria-valuetext": `${percent}%`,
|
|
162
|
+
"aria-label": status === "error" ? `Progress: ${percent}%, error` : `Progress: ${percent}%`,
|
|
161
163
|
ref
|
|
162
164
|
}, dataAttrs),
|
|
163
165
|
progress
|
|
@@ -75,7 +75,7 @@ var Steps = import_react.default.forwardRef((props, ref) => {
|
|
|
75
75
|
);
|
|
76
76
|
});
|
|
77
77
|
};
|
|
78
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-steps`, ref }, renderSteps(), showInfo && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-text` }, children));
|
|
78
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-steps`, ref }, /* @__PURE__ */ import_react.default.createElement("div", { "aria-hidden": "true", style: { display: "contents" } }, renderSteps()), showInfo && /* @__PURE__ */ import_react.default.createElement("span", { className: `${prefixCls}-text` }, children));
|
|
79
79
|
});
|
|
80
80
|
Steps.displayName = "Steps";
|
|
81
81
|
var steps_default = Steps;
|
|
@@ -128,6 +128,7 @@ var Search = import_react.default.forwardRef(
|
|
|
128
128
|
});
|
|
129
129
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
130
130
|
const popupRef = (0, import_react.useRef)(void 0);
|
|
131
|
+
const listboxId = (0, import_react.useId)();
|
|
131
132
|
const { focusedKey, onKeyDown } = (0, import_useSelectKeyboard.default)({
|
|
132
133
|
open,
|
|
133
134
|
options: options || suggestions,
|
|
@@ -187,9 +188,18 @@ var Search = import_react.default.forwardRef(
|
|
|
187
188
|
{
|
|
188
189
|
className: (0, import_clsx.default)(`${prefixCls}-clear-icon`, classNames == null ? void 0 : classNames.clear),
|
|
189
190
|
style: styles == null ? void 0 : styles.clear,
|
|
190
|
-
onClick: handleClear
|
|
191
|
+
onClick: handleClear,
|
|
192
|
+
role: "button",
|
|
193
|
+
"aria-label": "Clear search",
|
|
194
|
+
tabIndex: 0,
|
|
195
|
+
onKeyDown: (e) => {
|
|
196
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
handleClear(e);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
191
201
|
},
|
|
192
|
-
/* @__PURE__ */ import_react.default.createElement(import_lucide_react.X, { size: 14 })
|
|
202
|
+
/* @__PURE__ */ import_react.default.createElement(import_lucide_react.X, { size: 14, "aria-hidden": "true" })
|
|
193
203
|
), suffix);
|
|
194
204
|
};
|
|
195
205
|
const renderPrefix = () => {
|
|
@@ -220,7 +230,8 @@ var Search = import_react.default.forwardRef(
|
|
|
220
230
|
className
|
|
221
231
|
);
|
|
222
232
|
};
|
|
223
|
-
const
|
|
233
|
+
const hasPopup = Array.isArray(options) || Array.isArray(suggestions);
|
|
234
|
+
const popup = /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-popup`, tabIndex: 0, id: listboxId, role: "listbox" }, Array.isArray(options) ? /* @__PURE__ */ import_react.default.createElement(
|
|
224
235
|
import_List.default,
|
|
225
236
|
{
|
|
226
237
|
focusedKey,
|
|
@@ -237,19 +248,37 @@ var Search = import_react.default.forwardRef(
|
|
|
237
248
|
onClick: onChange
|
|
238
249
|
}
|
|
239
250
|
) : null);
|
|
240
|
-
return /* @__PURE__ */ import_react.default.createElement(import_Trigger.default, { popup, open, onOpenChange: setOpen }, /* @__PURE__ */ import_react.default.createElement(
|
|
241
|
-
"
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Trigger.default, { popup, open, onOpenChange: setOpen }, /* @__PURE__ */ import_react.default.createElement(
|
|
252
|
+
"div",
|
|
253
|
+
{
|
|
254
|
+
className: getRootClassName(),
|
|
255
|
+
style,
|
|
256
|
+
role: "combobox",
|
|
257
|
+
"aria-expanded": hasPopup ? open : void 0,
|
|
258
|
+
"aria-haspopup": hasPopup ? "listbox" : void 0,
|
|
259
|
+
"aria-owns": hasPopup && open ? listboxId : void 0,
|
|
260
|
+
"aria-disabled": disabled || void 0
|
|
261
|
+
},
|
|
262
|
+
renderPrefix(),
|
|
263
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
264
|
+
"input",
|
|
265
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
266
|
+
ref,
|
|
267
|
+
value: searchValue,
|
|
268
|
+
className: getInputClassName(),
|
|
269
|
+
style: styles == null ? void 0 : styles.input,
|
|
270
|
+
disabled,
|
|
271
|
+
placeholder,
|
|
272
|
+
onChange: handleChange,
|
|
273
|
+
onKeyDown,
|
|
274
|
+
role: "searchbox",
|
|
275
|
+
"aria-autocomplete": hasPopup ? "list" : void 0,
|
|
276
|
+
"aria-controls": hasPopup && open ? listboxId : void 0,
|
|
277
|
+
"aria-activedescendant": hasPopup && open && focusedKey !== null ? String(focusedKey) : void 0
|
|
278
|
+
})
|
|
279
|
+
),
|
|
280
|
+
loading ? /* @__PURE__ */ import_react.default.createElement(import_Spin.default, { variant: "ring", size: "small", "aria-label": "Loading" }) : renderSuffix()
|
|
281
|
+
));
|
|
253
282
|
}
|
|
254
283
|
);
|
|
255
284
|
var search_default = Search;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import type { TriggerProps } from '../Trigger';
|
|
2
3
|
import type { SelectorProps } from '../Selector';
|
|
3
4
|
import type { DataAttributeProps } from '../utils/types';
|
|
4
5
|
export type Option = {
|
|
@@ -23,7 +24,7 @@ export type Option = {
|
|
|
23
24
|
*/
|
|
24
25
|
[prop: string]: any;
|
|
25
26
|
};
|
|
26
|
-
export interface SelectProps extends DataAttributeProps, Pick<SelectorProps, 'size'> {
|
|
27
|
+
export interface SelectProps extends DataAttributeProps, Pick<SelectorProps, 'size'>, Omit<TriggerProps, 'popup' | 'children'> {
|
|
27
28
|
/**
|
|
28
29
|
* Custom class name prefix
|
|
29
30
|
* */
|
|
@@ -35,5 +35,5 @@ module.exports = __toCommonJS(types_exports);
|
|
|
35
35
|
var import_yee_c = require("../..");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var types_default = () => {
|
|
38
|
-
return /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, { direction: "vertical" }, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "dot",
|
|
38
|
+
return /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, { direction: "vertical" }, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "dot" }), /* @__PURE__ */ import_react.default.createElement("span", null, "dot")), /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "ring" }), /* @__PURE__ */ import_react.default.createElement("span", null, "ring")), /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "spokes" }), /* @__PURE__ */ import_react.default.createElement("span", null, "spokes")), /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "bounce" }), /* @__PURE__ */ import_react.default.createElement("span", null, "bounce")), /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "pulse" }), /* @__PURE__ */ import_react.default.createElement("span", null, "pulse")), /* @__PURE__ */ import_react.default.createElement(import_yee_c.Space, null, /* @__PURE__ */ import_react.default.createElement(import_yee_c.Spin, { variant: "wheel" }), /* @__PURE__ */ import_react.default.createElement("span", null, "wheel")));
|
|
39
39
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SpinProps } from './interface';
|
|
3
3
|
interface IndicatorProps extends SpinProps {
|
|
4
|
-
variant?: 'dot' | 'ring' | 'spokes';
|
|
4
|
+
variant?: 'dot' | 'ring' | 'spokes' | 'bounce' | 'pulse' | 'wheel';
|
|
5
5
|
}
|
|
6
6
|
declare const Indicator: React.FC<IndicatorProps>;
|
|
7
7
|
export default Indicator;
|
|
@@ -227,6 +227,141 @@ var DotSpinner = (props) => {
|
|
|
227
227
|
`)
|
|
228
228
|
);
|
|
229
229
|
};
|
|
230
|
+
var BounceSpinner = (props) => {
|
|
231
|
+
const {
|
|
232
|
+
prefixCls = "yee-spin",
|
|
233
|
+
size = "default",
|
|
234
|
+
classNames,
|
|
235
|
+
styles,
|
|
236
|
+
width,
|
|
237
|
+
height,
|
|
238
|
+
color
|
|
239
|
+
} = props;
|
|
240
|
+
const containerSize = sizeMap[size];
|
|
241
|
+
const dotSizeMap = { small: 4, default: 6, large: 10 };
|
|
242
|
+
const dotSize = dotSizeMap[size];
|
|
243
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
244
|
+
"div",
|
|
245
|
+
{
|
|
246
|
+
className: (0, import_clsx.default)(
|
|
247
|
+
`${prefixCls}-indicator`,
|
|
248
|
+
`${prefixCls}-indicator-bounce`,
|
|
249
|
+
classNames == null ? void 0 : classNames.indicator
|
|
250
|
+
),
|
|
251
|
+
style: __spreadValues({
|
|
252
|
+
width: width || containerSize,
|
|
253
|
+
height: height || containerSize
|
|
254
|
+
}, styles == null ? void 0 : styles.indicator)
|
|
255
|
+
},
|
|
256
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-bounce` }, [0, 1, 2].map((i) => /* @__PURE__ */ import_react.default.createElement(
|
|
257
|
+
"span",
|
|
258
|
+
{
|
|
259
|
+
key: i,
|
|
260
|
+
className: `${prefixCls}-bounce-dot`,
|
|
261
|
+
style: {
|
|
262
|
+
width: dotSize,
|
|
263
|
+
height: dotSize,
|
|
264
|
+
animationDelay: `${i * 0.15}s`,
|
|
265
|
+
backgroundColor: color
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
)))
|
|
269
|
+
);
|
|
270
|
+
};
|
|
271
|
+
var PulseSpinner = (props) => {
|
|
272
|
+
const {
|
|
273
|
+
prefixCls = "yee-spin",
|
|
274
|
+
size = "default",
|
|
275
|
+
classNames,
|
|
276
|
+
styles,
|
|
277
|
+
width,
|
|
278
|
+
height,
|
|
279
|
+
color
|
|
280
|
+
} = props;
|
|
281
|
+
const containerSize = sizeMap[size];
|
|
282
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
283
|
+
"div",
|
|
284
|
+
{
|
|
285
|
+
className: (0, import_clsx.default)(
|
|
286
|
+
`${prefixCls}-indicator`,
|
|
287
|
+
`${prefixCls}-indicator-pulse`,
|
|
288
|
+
classNames == null ? void 0 : classNames.indicator
|
|
289
|
+
),
|
|
290
|
+
style: __spreadValues({
|
|
291
|
+
width: width || containerSize,
|
|
292
|
+
height: height || containerSize
|
|
293
|
+
}, styles == null ? void 0 : styles.indicator)
|
|
294
|
+
},
|
|
295
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
296
|
+
"span",
|
|
297
|
+
{
|
|
298
|
+
className: `${prefixCls}-pulse-circle`,
|
|
299
|
+
style: { backgroundColor: color }
|
|
300
|
+
}
|
|
301
|
+
),
|
|
302
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
303
|
+
"span",
|
|
304
|
+
{
|
|
305
|
+
className: `${prefixCls}-pulse-circle ${prefixCls}-pulse-circle-delay`,
|
|
306
|
+
style: { backgroundColor: color }
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
);
|
|
310
|
+
};
|
|
311
|
+
var WheelSpinner = (props) => {
|
|
312
|
+
const {
|
|
313
|
+
prefixCls = "yee-spin",
|
|
314
|
+
size = "default",
|
|
315
|
+
classNames,
|
|
316
|
+
styles,
|
|
317
|
+
width,
|
|
318
|
+
height,
|
|
319
|
+
color
|
|
320
|
+
} = props;
|
|
321
|
+
const containerSize = sizeMap[size];
|
|
322
|
+
const count = 10;
|
|
323
|
+
const innerRadius = 0.38;
|
|
324
|
+
const spokeLength = containerSize * 0.22;
|
|
325
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
326
|
+
"div",
|
|
327
|
+
{
|
|
328
|
+
className: (0, import_clsx.default)(
|
|
329
|
+
`${prefixCls}-indicator`,
|
|
330
|
+
`${prefixCls}-indicator-wheel`,
|
|
331
|
+
classNames == null ? void 0 : classNames.indicator
|
|
332
|
+
),
|
|
333
|
+
style: __spreadValues({
|
|
334
|
+
width: width || containerSize,
|
|
335
|
+
height: height || containerSize
|
|
336
|
+
}, styles == null ? void 0 : styles.indicator)
|
|
337
|
+
},
|
|
338
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-wheel-spokes` }, Array.from({ length: count }, (_, i) => {
|
|
339
|
+
const angle = i * 360 / count;
|
|
340
|
+
const rad = angle * Math.PI / 180;
|
|
341
|
+
const cx = containerSize / 2;
|
|
342
|
+
const cy = containerSize / 2;
|
|
343
|
+
const x = cx + innerRadius * containerSize * Math.sin(rad);
|
|
344
|
+
const y = cy - innerRadius * containerSize * Math.cos(rad);
|
|
345
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
346
|
+
"div",
|
|
347
|
+
{
|
|
348
|
+
key: i,
|
|
349
|
+
className: `${prefixCls}-wheel-spoke`,
|
|
350
|
+
style: {
|
|
351
|
+
top: y,
|
|
352
|
+
left: x,
|
|
353
|
+
height: spokeLength,
|
|
354
|
+
marginLeft: -1,
|
|
355
|
+
transform: `rotate(${angle}deg)`,
|
|
356
|
+
transformOrigin: "top center",
|
|
357
|
+
animationDelay: `${i * 1.2 / count}s`,
|
|
358
|
+
backgroundColor: color
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
);
|
|
362
|
+
}))
|
|
363
|
+
);
|
|
364
|
+
};
|
|
230
365
|
var Indicator = (_a) => {
|
|
231
366
|
var _b = _a, { variant = "dot" } = _b, props = __objRest(_b, ["variant"]);
|
|
232
367
|
if (variant === "ring") {
|
|
@@ -235,6 +370,15 @@ var Indicator = (_a) => {
|
|
|
235
370
|
if (variant === "spokes") {
|
|
236
371
|
return /* @__PURE__ */ import_react.default.createElement(SpokesSpinner, __spreadValues({}, props));
|
|
237
372
|
}
|
|
373
|
+
if (variant === "bounce") {
|
|
374
|
+
return /* @__PURE__ */ import_react.default.createElement(BounceSpinner, __spreadValues({}, props));
|
|
375
|
+
}
|
|
376
|
+
if (variant === "pulse") {
|
|
377
|
+
return /* @__PURE__ */ import_react.default.createElement(PulseSpinner, __spreadValues({}, props));
|
|
378
|
+
}
|
|
379
|
+
if (variant === "wheel") {
|
|
380
|
+
return /* @__PURE__ */ import_react.default.createElement(WheelSpinner, __spreadValues({}, props));
|
|
381
|
+
}
|
|
238
382
|
return /* @__PURE__ */ import_react.default.createElement(DotSpinner, __spreadValues({}, props));
|
|
239
383
|
};
|
|
240
384
|
var indicator_default = Indicator;
|
|
@@ -69,6 +69,64 @@
|
|
|
69
69
|
animation: yee-spin-spokes-fade 1.2s linear infinite;
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
+
|
|
73
|
+
&-bounce {
|
|
74
|
+
@{pls}-bounce {
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
width: 100%;
|
|
79
|
+
height: 100%;
|
|
80
|
+
gap: 3px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
@{pls}-bounce-dot {
|
|
84
|
+
display: inline-block;
|
|
85
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
86
|
+
border-radius: 50%;
|
|
87
|
+
animation: yee-spin-bounce 0.6s ease-in-out infinite alternate;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
&-pulse {
|
|
92
|
+
@{pls}-pulse-circle {
|
|
93
|
+
position: absolute;
|
|
94
|
+
top: 0;
|
|
95
|
+
left: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
height: 100%;
|
|
98
|
+
border-radius: 50%;
|
|
99
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
100
|
+
opacity: 0.6;
|
|
101
|
+
animation: yee-spin-pulse 1.5s ease-in-out infinite;
|
|
102
|
+
|
|
103
|
+
&-delay {
|
|
104
|
+
animation-delay: 0.5s;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
&-wheel {
|
|
110
|
+
@{pls}-wheel-hub {
|
|
111
|
+
display: none;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@{pls}-wheel-spokes {
|
|
115
|
+
position: relative;
|
|
116
|
+
width: 100%;
|
|
117
|
+
height: 100%;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
@{pls}-wheel-spoke {
|
|
121
|
+
position: absolute;
|
|
122
|
+
left: 50%;
|
|
123
|
+
width: 2px;
|
|
124
|
+
margin-left: -1px;
|
|
125
|
+
background-color: var(--m-indicator-dot-bg-color);
|
|
126
|
+
border-radius: 1px;
|
|
127
|
+
animation: yee-spin-spokes-fade 1.2s linear infinite;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
72
130
|
}
|
|
73
131
|
|
|
74
132
|
&-tip {
|
|
@@ -168,3 +226,31 @@
|
|
|
168
226
|
opacity: 0.15;
|
|
169
227
|
}
|
|
170
228
|
}
|
|
229
|
+
|
|
230
|
+
@keyframes yee-spin-bounce {
|
|
231
|
+
0% {
|
|
232
|
+
transform: translateY(25%);
|
|
233
|
+
opacity: 0.4;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
100% {
|
|
237
|
+
transform: translateY(-25%);
|
|
238
|
+
opacity: 1;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
@keyframes yee-spin-pulse {
|
|
243
|
+
0% {
|
|
244
|
+
transform: scale(0);
|
|
245
|
+
opacity: 0.6;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
50% {
|
|
249
|
+
opacity: 0.3;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
100% {
|
|
253
|
+
transform: scale(1);
|
|
254
|
+
opacity: 0;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/Table/demo/fixed.tsx
|
|
30
|
+
var fixed_exports = {};
|
|
31
|
+
__export(fixed_exports, {
|
|
32
|
+
default: () => fixed_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(fixed_exports);
|
|
35
|
+
var import_yee_c = require("../..");
|
|
36
|
+
var import_react = __toESM(require("react"));
|
|
37
|
+
var columns = [
|
|
38
|
+
{
|
|
39
|
+
title: "Name",
|
|
40
|
+
dataIndex: "name",
|
|
41
|
+
key: "name",
|
|
42
|
+
fixed: "left",
|
|
43
|
+
width: 140
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: "Age",
|
|
47
|
+
dataIndex: "age",
|
|
48
|
+
key: "age",
|
|
49
|
+
fixed: "left",
|
|
50
|
+
width: 100
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
title: "Address",
|
|
54
|
+
dataIndex: "address",
|
|
55
|
+
key: "address",
|
|
56
|
+
width: 240
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
title: "Company",
|
|
60
|
+
dataIndex: "company",
|
|
61
|
+
key: "company",
|
|
62
|
+
width: 180
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
title: "Department",
|
|
66
|
+
dataIndex: "department",
|
|
67
|
+
key: "department",
|
|
68
|
+
width: 180
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
title: "Email",
|
|
72
|
+
dataIndex: "email",
|
|
73
|
+
key: "email",
|
|
74
|
+
width: 240
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
title: "Action",
|
|
78
|
+
key: "action",
|
|
79
|
+
fixed: "right",
|
|
80
|
+
width: 100,
|
|
81
|
+
render: (record) => /* @__PURE__ */ import_react.default.createElement("a", { onClick: () => console.log(record) }, "View")
|
|
82
|
+
}
|
|
83
|
+
];
|
|
84
|
+
var dataSource = [
|
|
85
|
+
{
|
|
86
|
+
key: "1",
|
|
87
|
+
name: "John Brown",
|
|
88
|
+
age: 32,
|
|
89
|
+
address: "New York No. 1 Lake Park",
|
|
90
|
+
company: "Acme Inc.",
|
|
91
|
+
department: "Engineering",
|
|
92
|
+
email: "john.brown@example.com"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: "2",
|
|
96
|
+
name: "Jim Green",
|
|
97
|
+
age: 42,
|
|
98
|
+
address: "London No. 1 Lake Park",
|
|
99
|
+
company: "Globex",
|
|
100
|
+
department: "Marketing",
|
|
101
|
+
email: "jim.green@example.com"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: "3",
|
|
105
|
+
name: "Joe Black",
|
|
106
|
+
age: 28,
|
|
107
|
+
address: "Sidney No. 1 Lake Park",
|
|
108
|
+
company: "Initech",
|
|
109
|
+
department: "Product",
|
|
110
|
+
email: "joe.black@example.com"
|
|
111
|
+
}
|
|
112
|
+
];
|
|
113
|
+
var fixed_default = () => /* @__PURE__ */ import_react.default.createElement(
|
|
114
|
+
import_yee_c.Table,
|
|
115
|
+
{
|
|
116
|
+
columns,
|
|
117
|
+
dataSource,
|
|
118
|
+
rowKey: "key",
|
|
119
|
+
pagination: false,
|
|
120
|
+
scroll: { x: 1180 },
|
|
121
|
+
tableLayout: "fixed"
|
|
122
|
+
}
|
|
123
|
+
);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ColumnProps, ExpandableType, RowSelectionType, WrapedColumnProps } from '../interface';
|
|
3
|
-
export default function useColumns({ children, columns, rowSelection, expandable, }: {
|
|
3
|
+
export default function useColumns({ children, columns, rowSelection, expandable, measuredColumnWidths, }: {
|
|
4
4
|
children?: React.ReactElement<ColumnProps> | React.ReactElement<ColumnProps>[];
|
|
5
5
|
columns: ColumnProps[];
|
|
6
6
|
rowSelection?: RowSelectionType;
|
|
7
7
|
expandable?: ExpandableType;
|
|
8
|
+
measuredColumnWidths?: number[];
|
|
8
9
|
}): {
|
|
9
10
|
wrapedColumns: WrapedColumnProps[];
|
|
10
11
|
headerRows: import("../interface").HeaderCell[][];
|
|
@@ -63,7 +63,8 @@ function useColumns({
|
|
|
63
63
|
children,
|
|
64
64
|
columns,
|
|
65
65
|
rowSelection,
|
|
66
|
-
expandable
|
|
66
|
+
expandable,
|
|
67
|
+
measuredColumnWidths
|
|
67
68
|
}) {
|
|
68
69
|
const childColumns = (0, import_react.useMemo)(() => {
|
|
69
70
|
return children ? getColumnsFromChild(children) : null;
|
|
@@ -72,10 +73,10 @@ function useColumns({
|
|
|
72
73
|
const base = (0, import_deepClone.default)(childColumns || columns || []) || [];
|
|
73
74
|
const tree = (0, import_header.injectSelectionExpand)(base, rowSelection, expandable);
|
|
74
75
|
const leaves = (0, import_header.flattenLeafColumns)(tree);
|
|
75
|
-
const wraped = (0, import_util.handleColumns)(leaves);
|
|
76
|
+
const wraped = (0, import_util.handleColumns)(leaves, measuredColumnWidths);
|
|
76
77
|
const rows = (0, import_header.parseHeaderRows)(tree, wraped);
|
|
77
78
|
return { wrapedColumns: wraped, headerRows: rows };
|
|
78
|
-
}, [childColumns, columns, rowSelection, expandable]);
|
|
79
|
+
}, [childColumns, columns, rowSelection, expandable, measuredColumnWidths]);
|
|
79
80
|
return {
|
|
80
81
|
wrapedColumns,
|
|
81
82
|
headerRows
|
|
@@ -85,15 +85,34 @@
|
|
|
85
85
|
overflow: auto;
|
|
86
86
|
|
|
87
87
|
&-wrapper {
|
|
88
|
-
overflow: auto;
|
|
89
88
|
width: 100%;
|
|
90
89
|
|
|
91
90
|
&-scroll-left @{pls}-cell-fixed-left-last {
|
|
92
|
-
|
|
91
|
+
&::after {
|
|
92
|
+
content: '';
|
|
93
|
+
pointer-events: none;
|
|
94
|
+
position: absolute;
|
|
95
|
+
display: block;
|
|
96
|
+
height: 100%;
|
|
97
|
+
width: 15px;
|
|
98
|
+
right: -15px;
|
|
99
|
+
top: 0;
|
|
100
|
+
box-shadow: inset 4px 0 8px -4px var(--yee-table-fixed-left-after-bs-color);
|
|
101
|
+
}
|
|
93
102
|
}
|
|
94
103
|
|
|
95
104
|
&-scroll-right @{pls}-cell-fixed-right-first {
|
|
96
|
-
|
|
105
|
+
&::after {
|
|
106
|
+
content: '';
|
|
107
|
+
pointer-events: none;
|
|
108
|
+
position: absolute;
|
|
109
|
+
display: block;
|
|
110
|
+
height: 100%;
|
|
111
|
+
width: 15px;
|
|
112
|
+
left: -15px;
|
|
113
|
+
top: 0;
|
|
114
|
+
box-shadow: inset -4px 0 8px -4px var(--yee-table-fixed-right-after-bs-color);
|
|
115
|
+
}
|
|
97
116
|
}
|
|
98
117
|
}
|
|
99
118
|
|
|
@@ -156,6 +175,7 @@
|
|
|
156
175
|
&-fixed-left,
|
|
157
176
|
&-fixed-right {
|
|
158
177
|
position: sticky;
|
|
178
|
+
z-index: 1;
|
|
159
179
|
background-color: var(--yee-table-fixed-column-bg-color);
|
|
160
180
|
}
|
|
161
181
|
}
|