@rainbow-oh/yee-c 0.8.1 → 0.8.2
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 +38 -30
- package/dist/cjs/Cascader/column.js +17 -9
- package/dist/cjs/Cascader/search-list.js +30 -22
- package/dist/cjs/Cascader/utils/index.js +1 -5
- package/dist/cjs/Checkbox/checkbox-group.js +23 -14
- package/dist/cjs/Dialog/dialog.js +1 -1
- package/dist/cjs/Dialog/interface.d.ts +1 -1
- package/dist/cjs/Dialog/style/index.less +2 -1
- package/dist/cjs/Drawer/drawer.js +9 -1
- package/dist/cjs/Form/Group.js +1 -1
- package/dist/cjs/Form/demo/tooltip.js +1 -3
- package/dist/cjs/List/hooks/useListKeyboard.js +3 -1
- package/dist/cjs/Menu/menu.js +18 -2
- package/dist/cjs/Pagination/items.js +54 -26
- package/dist/cjs/Pagination/pagination.js +25 -9
- package/dist/cjs/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/cjs/PickerPanel/panels/MonthPanel/MonthHeader.js +7 -1
- package/dist/cjs/Rate/star.js +27 -3
- package/dist/cjs/Segmented/demo/variant.js +15 -1
- package/dist/cjs/Segmented/index.d.ts +1 -1
- package/dist/cjs/Segmented/segmented.js +12 -15
- package/dist/cjs/Select/option.js +8 -1
- package/dist/cjs/Select/options.js +9 -1
- package/dist/cjs/Select/select.js +3 -1
- package/dist/cjs/Steps/step.js +14 -2
- package/dist/cjs/Steps/steps.js +11 -1
- package/dist/cjs/Table/demo/components-override.js +31 -2
- package/dist/cjs/Table/demo/grouping.js +7 -1
- package/dist/cjs/Table/hooks/useColumns.d.ts +3 -3
- package/dist/cjs/Table/hooks/useColumns.js +11 -14
- package/dist/cjs/Table/index.d.ts +1 -1
- package/dist/cjs/Table/style/index.less +2 -4
- package/dist/cjs/Table/tbody/row.js +1 -4
- package/dist/cjs/Table/theader/index.js +12 -4
- package/dist/cjs/Tour/index.d.ts +1 -1
- package/dist/cjs/Tree/style/index.less +1 -5
- package/dist/cjs/Tree/tree.js +38 -35
- package/dist/cjs/hooks/useEvent.js +1 -4
- package/dist/cjs/style/size.css +2 -0
- package/dist/cjs/style/themes.css +1 -1
- package/dist/cjs/style/variables.css +3 -1
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Dialog/dialog.js +2 -2
- package/dist/esm/Dialog/interface.d.ts +1 -1
- package/dist/esm/Dialog/style/index.less +2 -1
- package/dist/esm/Form/Group.js +1 -1
- package/dist/esm/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/esm/Segmented/index.d.ts +1 -1
- package/dist/esm/Segmented/segmented.js +1 -1
- package/dist/esm/Table/demo/components-override.js +1 -0
- package/dist/esm/Table/hooks/useColumns.d.ts +3 -3
- package/dist/esm/Table/hooks/useColumns.js +13 -16
- package/dist/esm/Table/index.d.ts +1 -1
- package/dist/esm/Table/style/index.less +2 -4
- package/dist/esm/Tour/index.d.ts +1 -1
- package/dist/esm/Tree/style/index.less +1 -5
- package/dist/esm/Tree/tree.js +1 -1
- package/dist/esm/style/size.css +2 -0
- package/dist/esm/style/themes.css +1 -1
- package/dist/esm/style/variables.css +3 -1
- 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/Anchor/anchor.tsx +2 -2
- package/src/Carousel/carousel.tsx +1 -2
- package/src/Cascader/cascader.tsx +5 -1
- package/src/Cascader/column.tsx +5 -1
- package/src/Cascader/search-list.tsx +10 -3
- package/src/Cascader/utils/index.ts +3 -6
- package/src/Checkbox/checkbox-group.tsx +6 -1
- package/src/Dialog/dialog.tsx +7 -3
- package/src/Dialog/interface.ts +1 -1
- package/src/Dialog/style/index.less +2 -1
- package/src/Drawer/drawer.tsx +7 -1
- package/src/Form/Group.tsx +2 -4
- package/src/Form/demo/tooltip.tsx +2 -11
- package/src/Form/utils/validate.ts +1 -4
- package/src/List/hooks/useListKeyboard.ts +3 -3
- package/src/List/list.tsx +2 -1
- package/src/Menu/menu.tsx +14 -3
- package/src/Pagination/items.tsx +16 -4
- package/src/Pagination/pagination.tsx +18 -4
- package/src/PickerPanel/panels/DatePanel/DateBody.tsx +1 -1
- package/src/PickerPanel/panels/DateTimePanel/index.tsx +1 -1
- package/src/PickerPanel/panels/MonthPanel/MonthHeader.tsx +7 -2
- package/src/PickerPanel/panels/PanelBody.tsx +1 -1
- package/src/PickerPanel/panels/QuarterPanel/QuarterHeader.tsx +1 -1
- package/src/PickerPanel/panels/RangePanel/index.tsx +1 -1
- package/src/PickerPanel/panels/TimePanel/TimeBody.tsx +1 -1
- package/src/PickerPanel/panels/YearPanel/YearHeader.tsx +1 -1
- package/src/PickerPanel/utils/pickerUtils.ts +2 -1
- package/src/RangePicker/range-picker-mobile.tsx +1 -3
- package/src/Rate/star.tsx +16 -4
- package/src/Segmented/demo/variant.tsx +10 -2
- package/src/Segmented/index.ts +2 -2
- package/src/Segmented/segmented.tsx +4 -11
- package/src/Select/interface.ts +0 -1
- package/src/Select/option.tsx +8 -2
- package/src/Select/options.tsx +11 -4
- package/src/Select/select.tsx +4 -4
- package/src/Steps/step.tsx +11 -3
- package/src/Steps/steps.tsx +8 -1
- package/src/Table/demo/components-override.tsx +34 -7
- package/src/Table/demo/grouping.tsx +8 -4
- package/src/Table/hooks/useColumns.ts +14 -18
- package/src/Table/index.ts +3 -3
- package/src/Table/style/index.less +2 -4
- package/src/Table/table.tsx +2 -4
- package/src/Table/tbody/row.tsx +1 -3
- package/src/Table/theader/index.tsx +9 -10
- package/src/Tour/demo/placement.tsx +2 -1
- package/src/Tour/index.ts +1 -1
- package/src/Tree/style/index.less +1 -5
- package/src/Tree/tree.tsx +16 -11
- package/src/Tree/utils/tree-tools.ts +4 -1
- package/src/hooks/useEvent.ts +1 -3
- package/src/locale/context.tsx +5 -1
- package/src/locale/interface.ts +3 -1
- package/src/style/size.css +2 -0
- package/src/utils/debounce.ts +1 -3
- package/src/version.ts +1 -1
|
@@ -62,8 +62,8 @@ __export(segmented_exports, {
|
|
|
62
62
|
});
|
|
63
63
|
module.exports = __toCommonJS(segmented_exports);
|
|
64
64
|
var import_clsx = __toESM(require("clsx"));
|
|
65
|
-
var import_react =
|
|
66
|
-
var import_react2 = require("
|
|
65
|
+
var import_react = require("motion/react");
|
|
66
|
+
var import_react2 = __toESM(require("react"));
|
|
67
67
|
var import_Config_Provider = require("../Config-Provider");
|
|
68
68
|
var import_useMergedState = __toESM(require("../hooks/useMergedState"));
|
|
69
69
|
var import_mergeContextToProps = __toESM(require("../utils/mergeContextToProps"));
|
|
@@ -74,12 +74,12 @@ var normalizeOption = (option) => {
|
|
|
74
74
|
}
|
|
75
75
|
return option;
|
|
76
76
|
};
|
|
77
|
-
var Segmented =
|
|
77
|
+
var Segmented = import_react2.default.forwardRef(
|
|
78
78
|
(baseprops, ref) => {
|
|
79
79
|
var _b;
|
|
80
|
-
const { segmented } = (0,
|
|
80
|
+
const { segmented } = (0, import_react2.useContext)(import_Config_Provider.GlobalContext);
|
|
81
81
|
const props = (0, import_mergeContextToProps.default)(baseprops, segmented);
|
|
82
|
-
const uid = (0,
|
|
82
|
+
const uid = (0, import_react2.useId)();
|
|
83
83
|
const _a = props, {
|
|
84
84
|
prefixCls = "yee-segmented",
|
|
85
85
|
className,
|
|
@@ -111,10 +111,7 @@ var Segmented = import_react.default.forwardRef(
|
|
|
111
111
|
"name",
|
|
112
112
|
"onChange"
|
|
113
113
|
]);
|
|
114
|
-
const items = (0,
|
|
115
|
-
() => options.map(normalizeOption),
|
|
116
|
-
[options]
|
|
117
|
-
);
|
|
114
|
+
const items = (0, import_react2.useMemo)(() => options.map(normalizeOption), [options]);
|
|
118
115
|
const firstValue = (_b = items[0]) == null ? void 0 : _b.value;
|
|
119
116
|
const [mergedValue, setMergedValue] = (0, import_useMergedState.default)(firstValue, {
|
|
120
117
|
value,
|
|
@@ -134,10 +131,10 @@ var Segmented = import_react.default.forwardRef(
|
|
|
134
131
|
setMergedValue(itemValue);
|
|
135
132
|
onChange == null ? void 0 : onChange(itemValue);
|
|
136
133
|
};
|
|
137
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ import_react2.default.createElement("div", __spreadProps(__spreadValues({}, rest), { ref, className: cls, style, role: "radiogroup" }), items.map((item) => {
|
|
138
135
|
const selected = item.value === mergedValue;
|
|
139
136
|
const itemDisabled = disabled || item.disabled;
|
|
140
|
-
return /* @__PURE__ */
|
|
137
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
141
138
|
"label",
|
|
142
139
|
{
|
|
143
140
|
key: item.value,
|
|
@@ -146,8 +143,8 @@ var Segmented = import_react.default.forwardRef(
|
|
|
146
143
|
[`${prefixCls}-item-disabled`]: itemDisabled
|
|
147
144
|
})
|
|
148
145
|
},
|
|
149
|
-
selected ? /* @__PURE__ */
|
|
150
|
-
|
|
146
|
+
selected ? /* @__PURE__ */ import_react2.default.createElement(
|
|
147
|
+
import_react.motion.span,
|
|
151
148
|
{
|
|
152
149
|
layoutId: `${prefixCls}-thumb-${uid}`,
|
|
153
150
|
className: (0, import_clsx.default)(`${prefixCls}-thumb`, classNames == null ? void 0 : classNames.thumb),
|
|
@@ -159,8 +156,8 @@ var Segmented = import_react.default.forwardRef(
|
|
|
159
156
|
}
|
|
160
157
|
}
|
|
161
158
|
) : null,
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ import_react2.default.createElement("span", { className: `${prefixCls}-item-inner` }, item.icon ? /* @__PURE__ */ import_react2.default.createElement("span", { className: `${prefixCls}-item-icon` }, item.icon) : null, item.label !== void 0 && item.label !== null ? /* @__PURE__ */ import_react2.default.createElement("span", { className: `${prefixCls}-item-label` }, item.label) : null),
|
|
160
|
+
/* @__PURE__ */ import_react2.default.createElement(
|
|
164
161
|
"input",
|
|
165
162
|
{
|
|
166
163
|
type: "radio",
|
|
@@ -38,7 +38,14 @@ var import_react = __toESM(require("react"));
|
|
|
38
38
|
var import_options = require("./options");
|
|
39
39
|
var Option = (props) => {
|
|
40
40
|
const { label, value, disabled, title, dataTestId, style } = props;
|
|
41
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
prefixCls,
|
|
43
|
+
selectedKeys,
|
|
44
|
+
focusedKey,
|
|
45
|
+
multiple,
|
|
46
|
+
looseMatch,
|
|
47
|
+
onSelect
|
|
48
|
+
} = (0, import_react.useContext)(import_options.OptionsCtx);
|
|
42
49
|
const handleClick = (e) => {
|
|
43
50
|
if (!disabled) {
|
|
44
51
|
onSelect(value, e);
|
|
@@ -170,7 +170,15 @@ var Options = (0, import_react.forwardRef)(
|
|
|
170
170
|
container.scrollTop -= containerRect.top - targetRect.top;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
|
-
}, [
|
|
173
|
+
}, [
|
|
174
|
+
focusedKey,
|
|
175
|
+
virtual,
|
|
176
|
+
options,
|
|
177
|
+
scrollToIndex,
|
|
178
|
+
rootRef,
|
|
179
|
+
multiColumn,
|
|
180
|
+
columns
|
|
181
|
+
]);
|
|
174
182
|
const isEmpty = options.length === 0;
|
|
175
183
|
const ctxValue = {
|
|
176
184
|
prefixCls,
|
|
@@ -173,7 +173,9 @@ var Select = (baseprops) => {
|
|
|
173
173
|
setOpen(false);
|
|
174
174
|
} else {
|
|
175
175
|
if (keysIncludes(mergedValue, key, looseMatch)) {
|
|
176
|
-
keys = mergedValue.filter(
|
|
176
|
+
keys = mergedValue.filter(
|
|
177
|
+
(k) => !matchValue(k, key, looseMatch)
|
|
178
|
+
);
|
|
177
179
|
} else {
|
|
178
180
|
keys = [...mergedValue, key];
|
|
179
181
|
}
|
package/dist/cjs/Steps/step.js
CHANGED
|
@@ -101,7 +101,13 @@ var Step = (props) => {
|
|
|
101
101
|
className
|
|
102
102
|
);
|
|
103
103
|
const ribbonStatus = index < current ? "done" : index === current ? "doing" : "undo";
|
|
104
|
-
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, type === "ribbon" && /* @__PURE__ */ import_react.default.createElement(
|
|
104
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, type === "ribbon" && /* @__PURE__ */ import_react.default.createElement(
|
|
105
|
+
"div",
|
|
106
|
+
{
|
|
107
|
+
className: `${prefixCls}-item-ribbon-end ${ribbonStatus}`,
|
|
108
|
+
"aria-hidden": "true"
|
|
109
|
+
}
|
|
110
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
105
111
|
"div",
|
|
106
112
|
{
|
|
107
113
|
className: cls,
|
|
@@ -116,6 +122,12 @@ var Step = (props) => {
|
|
|
116
122
|
},
|
|
117
123
|
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-icon`, "aria-hidden": "true" }, renderIcon),
|
|
118
124
|
/* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-content` }, /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-title` }, /* @__PURE__ */ import_react.default.createElement("span", { title: typeof title === "string" ? title : void 0 }, title), subTitle && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-sub-title` }, subTitle)), type !== "ribbon" && description && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-description` }, description))
|
|
119
|
-
), type === "navigation" && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-navi-arrow`, "aria-hidden": "true" }, /* @__PURE__ */ import_react.default.createElement(import_lucide_react.ChevronRight, null)), type === "ribbon" && /* @__PURE__ */ import_react.default.createElement(
|
|
125
|
+
), type === "navigation" && /* @__PURE__ */ import_react.default.createElement("div", { className: `${prefixCls}-item-navi-arrow`, "aria-hidden": "true" }, /* @__PURE__ */ import_react.default.createElement(import_lucide_react.ChevronRight, null)), type === "ribbon" && /* @__PURE__ */ import_react.default.createElement(
|
|
126
|
+
"div",
|
|
127
|
+
{
|
|
128
|
+
className: `${prefixCls}-item-ribbon-head ${ribbonStatus}`,
|
|
129
|
+
"aria-hidden": "true"
|
|
130
|
+
}
|
|
131
|
+
));
|
|
120
132
|
};
|
|
121
133
|
var step_default = Step;
|
package/dist/cjs/Steps/steps.js
CHANGED
|
@@ -135,7 +135,17 @@ var Steps = (0, import_react.forwardRef)((baseprops, ref) => {
|
|
|
135
135
|
}
|
|
136
136
|
return items.map((item, index) => /* @__PURE__ */ import_react.default.createElement(import_step.default, __spreadProps(__spreadValues({}, item), { index, key: index })));
|
|
137
137
|
};
|
|
138
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
138
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
"div",
|
|
140
|
+
__spreadProps(__spreadValues({}, rest), {
|
|
141
|
+
className: cls,
|
|
142
|
+
style,
|
|
143
|
+
ref,
|
|
144
|
+
role: "list",
|
|
145
|
+
"aria-label": "Steps"
|
|
146
|
+
}),
|
|
147
|
+
/* @__PURE__ */ import_react.default.createElement(StepsContext.Provider, { value: contextValue }, renderSteps())
|
|
148
|
+
);
|
|
139
149
|
});
|
|
140
150
|
Steps.displayName = "Steps";
|
|
141
151
|
var steps_default = Steps;
|
|
@@ -35,7 +35,31 @@ module.exports = __toCommonJS(components_override_exports);
|
|
|
35
35
|
var import_yee_c = require("../..");
|
|
36
36
|
var import_react = __toESM(require("react"));
|
|
37
37
|
var CustomTbody = (props) => /* @__PURE__ */ import_react.default.createElement("tbody", { className: props.className, "data-custom-tbody": true }, props.children);
|
|
38
|
-
var CustomRow = ({
|
|
38
|
+
var CustomRow = ({
|
|
39
|
+
record,
|
|
40
|
+
index,
|
|
41
|
+
columns,
|
|
42
|
+
rowKey
|
|
43
|
+
}) => /* @__PURE__ */ import_react.default.createElement(
|
|
44
|
+
"tr",
|
|
45
|
+
{
|
|
46
|
+
"data-row-key": rowKey,
|
|
47
|
+
style: { background: index % 2 === 0 ? "#f8fafc" : void 0 }
|
|
48
|
+
},
|
|
49
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
50
|
+
"td",
|
|
51
|
+
{
|
|
52
|
+
style: {
|
|
53
|
+
width: 40,
|
|
54
|
+
textAlign: "center",
|
|
55
|
+
color: "#2563eb",
|
|
56
|
+
fontWeight: 700
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
index + 1
|
|
60
|
+
),
|
|
61
|
+
columns.map((col) => /* @__PURE__ */ import_react.default.createElement("td", { key: String(col.key) }, record[col.dataIndex || ""]))
|
|
62
|
+
);
|
|
39
63
|
var components_override_default = () => {
|
|
40
64
|
const columns = [
|
|
41
65
|
{ title: "Name", dataIndex: "name", key: "name" },
|
|
@@ -43,7 +67,12 @@ var components_override_default = () => {
|
|
|
43
67
|
{ title: "Address", dataIndex: "address", key: "address" }
|
|
44
68
|
];
|
|
45
69
|
const dataSource = [
|
|
46
|
-
{
|
|
70
|
+
{
|
|
71
|
+
key: "1",
|
|
72
|
+
name: "John Brown",
|
|
73
|
+
age: 32,
|
|
74
|
+
address: "New York No. 1 Lake Park"
|
|
75
|
+
},
|
|
47
76
|
{ key: "2", name: "Jim Green", age: 42, address: "London No. 1 Lake Park" },
|
|
48
77
|
{ key: "3", name: "Joe Black", age: 32, address: "Sidney No. 1 Lake Park" }
|
|
49
78
|
];
|
|
@@ -49,7 +49,13 @@ var grouping_default = () => {
|
|
|
49
49
|
title: "Info",
|
|
50
50
|
key: "info",
|
|
51
51
|
children: [
|
|
52
|
-
{
|
|
52
|
+
{
|
|
53
|
+
title: "Age",
|
|
54
|
+
dataIndex: "age",
|
|
55
|
+
key: "age",
|
|
56
|
+
width: 100,
|
|
57
|
+
sorter: true
|
|
58
|
+
},
|
|
53
59
|
{
|
|
54
60
|
title: "Address",
|
|
55
61
|
dataIndex: "address",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type { ColumnProps, ExpandableType, RowSelectionType } from '../interface';
|
|
2
|
+
import type { ColumnProps, ExpandableType, RowSelectionType, WrapedColumnProps } from '../interface';
|
|
3
3
|
export default function useColumns({ children, columns, rowSelection, expandable, }: {
|
|
4
4
|
children?: React.ReactElement<ColumnProps> | React.ReactElement<ColumnProps>[];
|
|
5
5
|
columns: ColumnProps[];
|
|
6
6
|
rowSelection?: RowSelectionType;
|
|
7
7
|
expandable?: ExpandableType;
|
|
8
8
|
}): {
|
|
9
|
-
wrapedColumns:
|
|
10
|
-
headerRows:
|
|
9
|
+
wrapedColumns: WrapedColumnProps[];
|
|
10
|
+
headerRows: import("../interface").HeaderCell[][];
|
|
11
11
|
};
|
|
@@ -47,38 +47,35 @@ __export(useColumns_exports, {
|
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(useColumns_exports);
|
|
49
49
|
var import_react = __toESM(require("react"));
|
|
50
|
-
var import_useDeepCompareMemo = __toESM(require("../../hooks/useDeepCompareMemo"));
|
|
51
50
|
var import_deepClone = __toESM(require("../../utils/deepClone"));
|
|
52
51
|
var import_util = require("../util");
|
|
53
52
|
var import_header = require("../util/header");
|
|
53
|
+
var getColumnsFromChild = (childs) => {
|
|
54
|
+
const cols = [];
|
|
55
|
+
import_react.default.Children.forEach(childs, (child) => {
|
|
56
|
+
if (child) {
|
|
57
|
+
cols.push(__spreadValues({}, child.props));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return cols.length ? cols : null;
|
|
61
|
+
};
|
|
54
62
|
function useColumns({
|
|
55
63
|
children,
|
|
56
64
|
columns,
|
|
57
65
|
rowSelection,
|
|
58
66
|
expandable
|
|
59
67
|
}) {
|
|
60
|
-
const shouldRenderSelection = !!rowSelection;
|
|
61
|
-
const shouldRenderExpand = !!expandable;
|
|
62
|
-
const getColumnsFromChild = (childs) => {
|
|
63
|
-
const cols = [];
|
|
64
|
-
import_react.default.Children.forEach(childs, (child) => {
|
|
65
|
-
if (child) {
|
|
66
|
-
cols.push(__spreadValues({}, child.props));
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
return cols.length ? cols : null;
|
|
70
|
-
};
|
|
71
68
|
const childColumns = (0, import_react.useMemo)(() => {
|
|
72
69
|
return children ? getColumnsFromChild(children) : null;
|
|
73
70
|
}, [children]);
|
|
74
|
-
const { wrapedColumns, headerRows } = (0,
|
|
71
|
+
const { wrapedColumns, headerRows } = (0, import_react.useMemo)(() => {
|
|
75
72
|
const base = (0, import_deepClone.default)(childColumns || columns || []) || [];
|
|
76
73
|
const tree = (0, import_header.injectSelectionExpand)(base, rowSelection, expandable);
|
|
77
74
|
const leaves = (0, import_header.flattenLeafColumns)(tree);
|
|
78
75
|
const wraped = (0, import_util.handleColumns)(leaves);
|
|
79
76
|
const rows = (0, import_header.parseHeaderRows)(tree, wraped);
|
|
80
77
|
return { wrapedColumns: wraped, headerRows: rows };
|
|
81
|
-
}, [childColumns, columns,
|
|
78
|
+
}, [childColumns, columns, rowSelection, expandable]);
|
|
82
79
|
return {
|
|
83
80
|
wrapedColumns,
|
|
84
81
|
headerRows
|
|
@@ -2,7 +2,7 @@ import Column from './column';
|
|
|
2
2
|
import Summary from './summary';
|
|
3
3
|
import InternalTable from './table';
|
|
4
4
|
import Head from './theader';
|
|
5
|
-
export type { ColumnProps, PaginationType, RowSelectionType,
|
|
5
|
+
export type { ColumnProps, HeaderCell, PaginationType, RowSelectionType, TableBodyComponents, TableComponents, TableProps, TableRowRendererProps, onChangeParams, } from './interface';
|
|
6
6
|
type TableType = typeof InternalTable & {
|
|
7
7
|
Column: typeof Column;
|
|
8
8
|
Summary: typeof Summary;
|
|
@@ -92,13 +92,11 @@
|
|
|
92
92
|
width: 100%;
|
|
93
93
|
|
|
94
94
|
&-scroll-left @{pls}-cell-fixed-left-last {
|
|
95
|
-
box-shadow: 6px 0 6px -4px
|
|
96
|
-
var(--yee-table-fixed-left-after-bs-color);
|
|
95
|
+
box-shadow: 6px 0 6px -4px var(--yee-table-fixed-left-after-bs-color);
|
|
97
96
|
}
|
|
98
97
|
|
|
99
98
|
&-scroll-right @{pls}-cell-fixed-right-first {
|
|
100
|
-
box-shadow: -6px 0 6px -4px
|
|
101
|
-
var(--yee-table-fixed-right-after-bs-color);
|
|
99
|
+
box-shadow: -6px 0 6px -4px var(--yee-table-fixed-right-after-bs-color);
|
|
102
100
|
}
|
|
103
101
|
}
|
|
104
102
|
|
|
@@ -139,10 +139,7 @@ var TableRow = (props) => {
|
|
|
139
139
|
disabled
|
|
140
140
|
}, props2);
|
|
141
141
|
if (type === "checkbox") {
|
|
142
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
143
|
-
import_Checkbox.default,
|
|
144
|
-
__spreadValues({}, commonProps)
|
|
145
|
-
);
|
|
142
|
+
return /* @__PURE__ */ import_react.default.createElement(import_Checkbox.default, __spreadValues({}, commonProps));
|
|
146
143
|
}
|
|
147
144
|
return /* @__PURE__ */ import_react.default.createElement(import_Radio.default, __spreadValues({}, commonProps));
|
|
148
145
|
};
|
|
@@ -67,7 +67,17 @@ var import_Checkbox = __toESM(require("../../Checkbox"));
|
|
|
67
67
|
var import_table = require("../table");
|
|
68
68
|
var import_cell = __toESM(require("./cell"));
|
|
69
69
|
var TableHead = (props) => {
|
|
70
|
-
const _a = props, {
|
|
70
|
+
const _a = props, {
|
|
71
|
+
headerRows = [],
|
|
72
|
+
onCheckAll,
|
|
73
|
+
checkedAll,
|
|
74
|
+
onHeaderRow
|
|
75
|
+
} = _a, rest = __objRest(_a, [
|
|
76
|
+
"headerRows",
|
|
77
|
+
"onCheckAll",
|
|
78
|
+
"checkedAll",
|
|
79
|
+
"onHeaderRow"
|
|
80
|
+
]);
|
|
71
81
|
const { prefixCls } = (0, import_react.useContext)(import_table.TableCtx);
|
|
72
82
|
const renderCell = (cell, rowIndex, colIndex) => {
|
|
73
83
|
const { column, colSpan, rowSpan } = cell;
|
|
@@ -110,9 +120,7 @@ var TableHead = (props) => {
|
|
|
110
120
|
return /* @__PURE__ */ import_react.default.createElement("thead", { className: (0, import_clsx.default)(`${prefixCls}-thead`) }, headerRows.map((row, rowIndex) => {
|
|
111
121
|
const rowColumns = row.map((cell) => cell.column);
|
|
112
122
|
const rowProps = onHeaderRow ? onHeaderRow(rowColumns) : {};
|
|
113
|
-
return /* @__PURE__ */ import_react.default.createElement("tr", __spreadProps(__spreadValues({}, rowProps), { key: `thead-row-${rowIndex}` }), row.map(
|
|
114
|
-
(cell, colIndex) => renderCell(cell, rowIndex, colIndex)
|
|
115
|
-
));
|
|
123
|
+
return /* @__PURE__ */ import_react.default.createElement("tr", __spreadProps(__spreadValues({}, rowProps), { key: `thead-row-${rowIndex}` }), row.map((cell, colIndex) => renderCell(cell, rowIndex, colIndex)));
|
|
116
124
|
}));
|
|
117
125
|
};
|
|
118
126
|
var Row = (props) => {
|
package/dist/cjs/Tour/index.d.ts
CHANGED
package/dist/cjs/Tree/tree.js
CHANGED
|
@@ -48,8 +48,8 @@ __export(tree_exports, {
|
|
|
48
48
|
});
|
|
49
49
|
module.exports = __toCommonJS(tree_exports);
|
|
50
50
|
var import_clsx = __toESM(require("clsx"));
|
|
51
|
-
var import_react =
|
|
52
|
-
var import_react2 = require("
|
|
51
|
+
var import_react = require("motion/react");
|
|
52
|
+
var import_react2 = __toESM(require("react"));
|
|
53
53
|
var import_Config_Provider = require("../Config-Provider");
|
|
54
54
|
var import_useEvent = __toESM(require("../hooks/useEvent"));
|
|
55
55
|
var import_useMergedState = __toESM(require("../hooks/useMergedState"));
|
|
@@ -63,7 +63,7 @@ var DEFAULTFIELDNAMES = {
|
|
|
63
63
|
label: "label",
|
|
64
64
|
children: "children"
|
|
65
65
|
};
|
|
66
|
-
var TreeContext = (0,
|
|
66
|
+
var TreeContext = (0, import_react2.createContext)({
|
|
67
67
|
showIcon: true,
|
|
68
68
|
selectedUids: /* @__PURE__ */ new Set(),
|
|
69
69
|
checkedUids: /* @__PURE__ */ new Set(),
|
|
@@ -103,11 +103,11 @@ function keysToUidArray(keys, flatItems) {
|
|
|
103
103
|
return uids;
|
|
104
104
|
}
|
|
105
105
|
function useStableUidArray(keys, flatItems) {
|
|
106
|
-
const ref = (0,
|
|
106
|
+
const ref = (0, import_react2.useRef)({
|
|
107
107
|
keys: void 0,
|
|
108
108
|
result: void 0
|
|
109
109
|
});
|
|
110
|
-
const computed = (0,
|
|
110
|
+
const computed = (0, import_react2.useMemo)(
|
|
111
111
|
() => keysToUidArray(keys, flatItems),
|
|
112
112
|
[keys, flatItems]
|
|
113
113
|
);
|
|
@@ -144,7 +144,7 @@ function setToArray(s) {
|
|
|
144
144
|
return arr;
|
|
145
145
|
}
|
|
146
146
|
var Tree = (baseprops) => {
|
|
147
|
-
const { tree } = (0,
|
|
147
|
+
const { tree } = (0, import_react2.useContext)(import_Config_Provider.GlobalContext);
|
|
148
148
|
const props = (0, import_mergeContextToProps.default)(baseprops, tree);
|
|
149
149
|
const {
|
|
150
150
|
prefixCls = "yee-tree",
|
|
@@ -175,11 +175,11 @@ var Tree = (baseprops) => {
|
|
|
175
175
|
height,
|
|
176
176
|
itemHeight = 28
|
|
177
177
|
} = props;
|
|
178
|
-
const [flatItems, itemMap] = (0,
|
|
178
|
+
const [flatItems, itemMap] = (0, import_react2.useMemo)(
|
|
179
179
|
() => (0, import_tree_tools.tree2array)(dataSource != null ? dataSource : [], fieldNames),
|
|
180
180
|
[dataSource, fieldNames]
|
|
181
181
|
);
|
|
182
|
-
const allParentUidArray = (0,
|
|
182
|
+
const allParentUidArray = (0, import_react2.useMemo)(() => {
|
|
183
183
|
const uids = [];
|
|
184
184
|
for (const item of flatItems) {
|
|
185
185
|
if (!item.isLeaf)
|
|
@@ -188,9 +188,15 @@ var Tree = (baseprops) => {
|
|
|
188
188
|
return uids;
|
|
189
189
|
}, [flatItems]);
|
|
190
190
|
const stableExpandedValue = useStableUidArray(expandedKeys, flatItems);
|
|
191
|
-
const stableExpandedDefault = useStableUidArray(
|
|
191
|
+
const stableExpandedDefault = useStableUidArray(
|
|
192
|
+
defaultExpandedKeys,
|
|
193
|
+
flatItems
|
|
194
|
+
);
|
|
192
195
|
const stableSelectedValue = useStableUidArray(selectedKeys, flatItems);
|
|
193
|
-
const stableSelectedDefault = useStableUidArray(
|
|
196
|
+
const stableSelectedDefault = useStableUidArray(
|
|
197
|
+
defaultSelectedKeys,
|
|
198
|
+
flatItems
|
|
199
|
+
);
|
|
194
200
|
const stableCheckedValue = useStableUidArray(checkedKeys, flatItems);
|
|
195
201
|
const stableCheckedDefault = useStableUidArray(defaultCheckedKeys, flatItems);
|
|
196
202
|
const [expandedUidArray, setExpandedUidArray] = (0, import_useMergedState.default)(
|
|
@@ -200,18 +206,15 @@ var Tree = (baseprops) => {
|
|
|
200
206
|
defaultValue: stableExpandedDefault
|
|
201
207
|
}
|
|
202
208
|
);
|
|
203
|
-
const expandedUidSet = (0,
|
|
209
|
+
const expandedUidSet = (0, import_react2.useMemo)(
|
|
204
210
|
() => arrayToSet(expandedUidArray),
|
|
205
211
|
[expandedUidArray]
|
|
206
212
|
);
|
|
207
|
-
const [selectedUidArray, setSelectedUidArray] = (0, import_useMergedState.default)(
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
const selectedUidSet = (0, import_react.useMemo)(
|
|
213
|
+
const [selectedUidArray, setSelectedUidArray] = (0, import_useMergedState.default)([], {
|
|
214
|
+
value: stableSelectedValue,
|
|
215
|
+
defaultValue: stableSelectedDefault
|
|
216
|
+
});
|
|
217
|
+
const selectedUidSet = (0, import_react2.useMemo)(
|
|
215
218
|
() => arrayToSet(selectedUidArray),
|
|
216
219
|
[selectedUidArray]
|
|
217
220
|
);
|
|
@@ -219,11 +222,11 @@ var Tree = (baseprops) => {
|
|
|
219
222
|
value: stableCheckedValue,
|
|
220
223
|
defaultValue: stableCheckedDefault
|
|
221
224
|
});
|
|
222
|
-
const checkedUidSet = (0,
|
|
225
|
+
const checkedUidSet = (0, import_react2.useMemo)(
|
|
223
226
|
() => arrayToSet(checkedUidArray),
|
|
224
227
|
[checkedUidArray]
|
|
225
228
|
);
|
|
226
|
-
const indeterminateUidSet = (0,
|
|
229
|
+
const indeterminateUidSet = (0, import_react2.useMemo)(() => {
|
|
227
230
|
const result = /* @__PURE__ */ new Set();
|
|
228
231
|
for (const item of flatItems) {
|
|
229
232
|
if (!item.isLeaf && !checkedUidSet.has(item.uid) && item.childUids && item.childUids.some((cuid) => checkedUidSet.has(cuid))) {
|
|
@@ -232,7 +235,7 @@ var Tree = (baseprops) => {
|
|
|
232
235
|
}
|
|
233
236
|
return result;
|
|
234
237
|
}, [flatItems, checkedUidSet]);
|
|
235
|
-
const visibleItems = (0,
|
|
238
|
+
const visibleItems = (0, import_react2.useMemo)(() => {
|
|
236
239
|
const visibleSet = /* @__PURE__ */ new Set();
|
|
237
240
|
const result = [];
|
|
238
241
|
for (const item of flatItems) {
|
|
@@ -326,9 +329,9 @@ var Tree = (baseprops) => {
|
|
|
326
329
|
});
|
|
327
330
|
}
|
|
328
331
|
});
|
|
329
|
-
const dragUidRef = (0,
|
|
330
|
-
const [draggingUid, setDraggingUid] = (0,
|
|
331
|
-
const [dropState, setDropState] = (0,
|
|
332
|
+
const dragUidRef = (0, import_react2.useRef)(null);
|
|
333
|
+
const [draggingUid, setDraggingUid] = (0, import_react2.useState)(null);
|
|
334
|
+
const [dropState, setDropState] = (0, import_react2.useState)(null);
|
|
332
335
|
const resolvePosition = (rect, clientY) => {
|
|
333
336
|
const offset = (clientY - rect.top) / rect.height;
|
|
334
337
|
if (offset < 0.25)
|
|
@@ -445,7 +448,7 @@ var Tree = (baseprops) => {
|
|
|
445
448
|
setDraggingUid(null);
|
|
446
449
|
setDropState(null);
|
|
447
450
|
});
|
|
448
|
-
const contextValue = (0,
|
|
451
|
+
const contextValue = (0, import_react2.useMemo)(
|
|
449
452
|
() => ({
|
|
450
453
|
prefixCls,
|
|
451
454
|
checkable,
|
|
@@ -500,21 +503,21 @@ var Tree = (baseprops) => {
|
|
|
500
503
|
});
|
|
501
504
|
if (useVirtual) {
|
|
502
505
|
const slicedItems = visibleItems.slice(start, end);
|
|
503
|
-
return /* @__PURE__ */
|
|
506
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
504
507
|
"div",
|
|
505
508
|
{
|
|
506
509
|
className: (0, import_clsx.default)(prefixCls, className),
|
|
507
510
|
style,
|
|
508
511
|
onDragEnd: handleDragEnd
|
|
509
512
|
},
|
|
510
|
-
/* @__PURE__ */
|
|
513
|
+
/* @__PURE__ */ import_react2.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react2.default.createElement(
|
|
511
514
|
"div",
|
|
512
515
|
{
|
|
513
516
|
ref: viewportRef,
|
|
514
517
|
onScroll,
|
|
515
518
|
style: { height, overflowY: "auto" }
|
|
516
519
|
},
|
|
517
|
-
/* @__PURE__ */
|
|
520
|
+
/* @__PURE__ */ import_react2.default.createElement("div", { style: { height: totalHeight, position: "relative" } }, slicedItems.map((node, i) => /* @__PURE__ */ import_react2.default.createElement(
|
|
518
521
|
import_tree_node.default,
|
|
519
522
|
{
|
|
520
523
|
node,
|
|
@@ -555,19 +558,19 @@ var Tree = (baseprops) => {
|
|
|
555
558
|
if (currentGroup) {
|
|
556
559
|
segments.push(__spreadValues({ type: "group" }, currentGroup));
|
|
557
560
|
}
|
|
558
|
-
return /* @__PURE__ */
|
|
561
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
559
562
|
"div",
|
|
560
563
|
{
|
|
561
564
|
className: (0, import_clsx.default)(prefixCls, className),
|
|
562
565
|
style,
|
|
563
566
|
onDragEnd: handleDragEnd
|
|
564
567
|
},
|
|
565
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ import_react2.default.createElement(TreeContext.Provider, { value: contextValue }, /* @__PURE__ */ import_react2.default.createElement(import_react.AnimatePresence, { initial: false }, segments.map((segment) => {
|
|
566
569
|
if (segment.type === "node") {
|
|
567
|
-
return /* @__PURE__ */
|
|
570
|
+
return /* @__PURE__ */ import_react2.default.createElement(import_tree_node.default, { node: segment.node, key: segment.node.uid });
|
|
568
571
|
}
|
|
569
|
-
return /* @__PURE__ */
|
|
570
|
-
|
|
572
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
573
|
+
import_react.motion.div,
|
|
571
574
|
{
|
|
572
575
|
key: segment.pUid + "children",
|
|
573
576
|
initial: { height: 0, opacity: 0 },
|
|
@@ -576,7 +579,7 @@ var Tree = (baseprops) => {
|
|
|
576
579
|
transition: { duration: 0.15 },
|
|
577
580
|
style: { overflow: "hidden" }
|
|
578
581
|
},
|
|
579
|
-
segment.nodes.map((node) => /* @__PURE__ */
|
|
582
|
+
segment.nodes.map((node) => /* @__PURE__ */ import_react2.default.createElement(import_tree_node.default, { node, key: node.uid }))
|
|
580
583
|
);
|
|
581
584
|
})))
|
|
582
585
|
);
|
|
@@ -39,10 +39,7 @@ function useEvent(callback) {
|
|
|
39
39
|
const memoFn = import_react.default.useCallback(
|
|
40
40
|
(...args) => {
|
|
41
41
|
var _a;
|
|
42
|
-
return (_a = ref.current) == null ? void 0 : _a.call(
|
|
43
|
-
ref,
|
|
44
|
-
...args
|
|
45
|
-
);
|
|
42
|
+
return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
|
|
46
43
|
},
|
|
47
44
|
[]
|
|
48
45
|
);
|
package/dist/cjs/style/size.css
CHANGED
|
@@ -224,6 +224,8 @@
|
|
|
224
224
|
/* --Dialog-- */
|
|
225
225
|
--yee-dialog-z-index: var(--yee-z-index-overlay);
|
|
226
226
|
--yee-dialog-mask-z-index: var(--yee-z-index-mask);
|
|
227
|
+
--yee-dialog-title-font-size: 18px;
|
|
228
|
+
--yee-dialog-title-font-weight: 600;
|
|
227
229
|
--yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
|
|
228
230
|
--yee-dialog-header-margin-bottom: 12px;
|
|
229
231
|
--yee-dialog-content-margin-top: 10%;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @rainbow-oh/yee-c CSS Variables
|
|
3
3
|
* Auto-generated, do not edit manually
|
|
4
|
-
* Generated on 2026-07-
|
|
4
|
+
* Generated on 2026-07-23T09:42:21.552Z
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
/* ========== color.css ========== */
|
|
@@ -1346,6 +1346,8 @@
|
|
|
1346
1346
|
/* --Dialog-- */
|
|
1347
1347
|
--yee-dialog-z-index: var(--yee-z-index-overlay);
|
|
1348
1348
|
--yee-dialog-mask-z-index: var(--yee-z-index-mask);
|
|
1349
|
+
--yee-dialog-title-font-size: 18px;
|
|
1350
|
+
--yee-dialog-title-font-weight: 600;
|
|
1349
1351
|
--yee-dialog-content-wrapper-z-index: var(--yee-z-index-overlay);
|
|
1350
1352
|
--yee-dialog-header-margin-bottom: 12px;
|
|
1351
1353
|
--yee-dialog-content-margin-top: 10%;
|
package/dist/cjs/version.d.ts
CHANGED