@rainbow-oh/yee-c 0.8.0 → 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/LICENSE +1 -1
- package/README.md +40 -25
- package/dist/cjs/Card/card.js +7 -3
- package/dist/cjs/Carousel/carousel-item.js +7 -2
- package/dist/cjs/Carousel/carousel.js +31 -4
- package/dist/cjs/Cascader/cascader.js +38 -30
- package/dist/cjs/Cascader/column.js +17 -9
- package/dist/cjs/Cascader/node.js +16 -4
- package/dist/cjs/Cascader/search-list.js +31 -14
- package/dist/cjs/Cascader/utils/index.js +1 -5
- package/dist/cjs/Checkbox/checkbox-group.js +23 -14
- package/dist/cjs/Checkbox/checkbox.js +6 -3
- package/dist/cjs/Collapse/panel.js +10 -1
- package/dist/cjs/Dialog/dialog.js +22 -7
- package/dist/cjs/Dialog/interface.d.ts +1 -1
- package/dist/cjs/Dialog/style/index.less +2 -1
- package/dist/cjs/Drawer/drawer.js +22 -5
- 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-item.js +14 -5
- package/dist/cjs/Menu/menu.js +26 -2
- package/dist/cjs/Pagination/items.js +60 -27
- package/dist/cjs/Pagination/pagination.js +33 -11
- package/dist/cjs/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/cjs/PickerPanel/panels/MonthPanel/MonthHeader.js +7 -1
- package/dist/cjs/Radio/radio-group.js +6 -5
- package/dist/cjs/Radio/radio.js +39 -29
- package/dist/cjs/Rate/rate.js +6 -1
- package/dist/cjs/Rate/star.js +31 -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 +19 -5
- 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/Tabs/tab-content.js +3 -1
- package/dist/cjs/Tabs/tab-header/index.js +3 -1
- package/dist/cjs/Tabs/tab-header/tab-header-title.js +3 -1
- 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/useDelayState.js +3 -2
- package/dist/cjs/hooks/useEvent.js +1 -4
- package/dist/cjs/hooks/useFocusManage.d.ts +1 -1
- package/dist/cjs/hooks/useFocusManage.js +27 -22
- 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/utils/focusStack.d.ts +6 -2
- package/dist/cjs/utils/focusStack.js +40 -11
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Card/card.js +7 -3
- package/dist/esm/Carousel/carousel-item.js +7 -2
- package/dist/esm/Carousel/carousel.js +31 -4
- package/dist/esm/Cascader/cascader.js +3 -1
- package/dist/esm/Cascader/column.js +2 -1
- package/dist/esm/Cascader/node.js +18 -4
- package/dist/esm/Cascader/search-list.js +18 -4
- package/dist/esm/Checkbox/checkbox-group.js +3 -1
- package/dist/esm/Checkbox/checkbox.js +6 -3
- package/dist/esm/Collapse/panel.js +11 -2
- package/dist/esm/Dialog/dialog.js +28 -11
- package/dist/esm/Dialog/interface.d.ts +1 -1
- package/dist/esm/Dialog/style/index.less +2 -1
- package/dist/esm/Drawer/drawer.js +16 -7
- package/dist/esm/Form/Group.js +1 -1
- package/dist/esm/Menu/menu-item.js +16 -5
- package/dist/esm/Menu/menu.js +11 -5
- package/dist/esm/Pagination/items.js +14 -5
- package/dist/esm/Pagination/pagination.js +16 -4
- package/dist/esm/PickerPanel/panels/DateTimePanel/index.d.ts +1 -1
- package/dist/esm/Radio/radio-group.js +5 -4
- package/dist/esm/Radio/radio.js +5 -4
- package/dist/esm/Rate/rate.js +6 -1
- package/dist/esm/Rate/star.js +12 -4
- package/dist/esm/Segmented/index.d.ts +1 -1
- package/dist/esm/Segmented/segmented.js +1 -1
- package/dist/esm/Steps/step.js +12 -6
- package/dist/esm/Steps/steps.js +3 -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/Tabs/tab-content.js +3 -1
- package/dist/esm/Tabs/tab-header/index.js +3 -1
- package/dist/esm/Tabs/tab-header/tab-header-title.js +3 -1
- 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/hooks/useDelayState.js +5 -2
- package/dist/esm/hooks/useFocusManage.d.ts +1 -1
- package/dist/esm/hooks/useFocusManage.js +31 -13
- 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/utils/focusStack.d.ts +6 -2
- package/dist/esm/utils/focusStack.js +37 -14
- 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 +10 -6
- package/src/Anchor/anchor.tsx +2 -2
- package/src/Card/card.tsx +5 -1
- package/src/Carousel/carousel-item.tsx +7 -1
- package/src/Carousel/carousel.tsx +29 -3
- package/src/Cascader/cascader.tsx +5 -1
- package/src/Cascader/column.tsx +5 -1
- package/src/Cascader/node.tsx +14 -2
- package/src/Cascader/search-list.tsx +19 -3
- package/src/Cascader/utils/index.ts +3 -6
- package/src/Checkbox/checkbox-group.tsx +6 -1
- package/src/Checkbox/checkbox.tsx +3 -0
- package/src/Collapse/panel.tsx +11 -1
- package/src/Dialog/dialog.tsx +35 -6
- package/src/Dialog/interface.ts +1 -1
- package/src/Dialog/style/index.less +2 -1
- package/src/Drawer/drawer.tsx +18 -3
- 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-item.tsx +12 -3
- package/src/Menu/menu.tsx +22 -5
- package/src/Pagination/items.tsx +21 -4
- package/src/Pagination/pagination.tsx +24 -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/Radio/radio-group.tsx +2 -1
- package/src/Radio/radio.tsx +7 -2
- package/src/RangePicker/range-picker-mobile.tsx +1 -3
- package/src/Rate/rate.tsx +5 -0
- package/src/Rate/star.tsx +20 -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 +23 -5
- 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/Tabs/tab-content.tsx +2 -0
- package/src/Tabs/tab-header/index.tsx +2 -0
- package/src/Tabs/tab-header/tab-header-title.tsx +3 -1
- 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/useDelayState.ts +4 -2
- package/src/hooks/useEvent.ts +1 -3
- package/src/hooks/useFocusManage.ts +33 -17
- 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/utils/focusStack.ts +55 -12
- package/src/version.ts +1 -1
package/dist/esm/Steps/step.js
CHANGED
|
@@ -37,6 +37,7 @@ var Step = function Step(props) {
|
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
39
|
var mergedStatus = (_ref = itemStatus !== null && itemStatus !== void 0 ? itemStatus : status) !== null && _ref !== void 0 ? _ref : index < current ? 'finish' : index === current ? 'process' : 'wait';
|
|
40
|
+
var statusLabel = mergedStatus === 'finish' ? 'completed' : mergedStatus === 'process' ? 'in progress' : mergedStatus === 'error' ? 'error' : 'pending';
|
|
40
41
|
var renderIcon = useMemo(function () {
|
|
41
42
|
if (dot) return /*#__PURE__*/React.createElement("span", {
|
|
42
43
|
className: "".concat(prefixCls, "-item-dot")
|
|
@@ -64,18 +65,21 @@ var Step = function Step(props) {
|
|
|
64
65
|
var cls = clsx("".concat(prefixCls, "-item"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-item-").concat(mergedStatus), mergedStatus), "".concat(prefixCls, "-item-active"), index === current), "".concat(prefixCls, "-item-click"), onChange), "".concat(prefixCls, "-item-disabled"), disabled), "".concat(prefixCls, "-item-has-cus-icon"), icon), className);
|
|
65
66
|
var ribbonStatus = index < current ? 'done' : index === current ? 'doing' : 'undo';
|
|
66
67
|
return /*#__PURE__*/React.createElement(React.Fragment, null, type === 'ribbon' && /*#__PURE__*/React.createElement("div", {
|
|
67
|
-
className: "".concat(prefixCls, "-item-ribbon-end ").concat(ribbonStatus)
|
|
68
|
+
className: "".concat(prefixCls, "-item-ribbon-end ").concat(ribbonStatus),
|
|
69
|
+
"aria-hidden": "true"
|
|
68
70
|
}), /*#__PURE__*/React.createElement("div", {
|
|
69
71
|
className: cls,
|
|
70
72
|
style: style,
|
|
71
73
|
onClick: handleClick,
|
|
72
74
|
onKeyDown: handleKeyDown,
|
|
73
75
|
tabIndex: disabled ? -1 : onChange ? 0 : undefined,
|
|
74
|
-
role: onChange ? 'button' :
|
|
76
|
+
role: onChange ? 'button' : 'listitem',
|
|
75
77
|
"aria-disabled": disabled,
|
|
76
|
-
"aria-current": index === current ? 'step' : undefined
|
|
78
|
+
"aria-current": index === current ? 'step' : undefined,
|
|
79
|
+
"aria-label": "Step ".concat(index + 1).concat(typeof title === 'string' ? ": ".concat(title) : '', ", ").concat(statusLabel)
|
|
77
80
|
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: "".concat(prefixCls, "-item-icon")
|
|
81
|
+
className: "".concat(prefixCls, "-item-icon"),
|
|
82
|
+
"aria-hidden": "true"
|
|
79
83
|
}, renderIcon), /*#__PURE__*/React.createElement("div", {
|
|
80
84
|
className: "".concat(prefixCls, "-item-content")
|
|
81
85
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -87,9 +91,11 @@ var Step = function Step(props) {
|
|
|
87
91
|
}, subTitle)), type !== 'ribbon' && description && /*#__PURE__*/React.createElement("div", {
|
|
88
92
|
className: "".concat(prefixCls, "-item-description")
|
|
89
93
|
}, description))), type === 'navigation' && /*#__PURE__*/React.createElement("div", {
|
|
90
|
-
className: "".concat(prefixCls, "-item-navi-arrow")
|
|
94
|
+
className: "".concat(prefixCls, "-item-navi-arrow"),
|
|
95
|
+
"aria-hidden": "true"
|
|
91
96
|
}, /*#__PURE__*/React.createElement(ChevronRight, null)), type === 'ribbon' && /*#__PURE__*/React.createElement("div", {
|
|
92
|
-
className: "".concat(prefixCls, "-item-ribbon-head ").concat(ribbonStatus)
|
|
97
|
+
className: "".concat(prefixCls, "-item-ribbon-head ").concat(ribbonStatus),
|
|
98
|
+
"aria-hidden": "true"
|
|
93
99
|
}));
|
|
94
100
|
};
|
|
95
101
|
export default Step;
|
package/dist/esm/Steps/steps.js
CHANGED
|
@@ -64,7 +64,9 @@ var Steps = /*#__PURE__*/forwardRef(function (baseprops, ref) {
|
|
|
64
64
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
65
65
|
className: cls,
|
|
66
66
|
style: style,
|
|
67
|
-
ref: ref
|
|
67
|
+
ref: ref,
|
|
68
|
+
role: "list",
|
|
69
|
+
"aria-label": "Steps"
|
|
68
70
|
}), /*#__PURE__*/React.createElement(StepsContext.Provider, {
|
|
69
71
|
value: contextValue
|
|
70
72
|
}, renderSteps()));
|
|
@@ -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
|
};
|
|
@@ -5,26 +5,23 @@ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key i
|
|
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
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
7
|
import React, { useMemo } from 'react';
|
|
8
|
-
import useDeepCompareMemo from "../../hooks/useDeepCompareMemo";
|
|
9
8
|
import deepClone from "../../utils/deepClone";
|
|
10
9
|
import { handleColumns } from "../util";
|
|
11
10
|
import { flattenLeafColumns, injectSelectionExpand, parseHeaderRows } from "../util/header";
|
|
11
|
+
var getColumnsFromChild = function getColumnsFromChild(childs) {
|
|
12
|
+
var cols = [];
|
|
13
|
+
React.Children.forEach(childs, function (child) {
|
|
14
|
+
if (child) {
|
|
15
|
+
cols.push(_objectSpread({}, child.props));
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return cols.length ? cols : null;
|
|
19
|
+
};
|
|
12
20
|
export default function useColumns(_ref) {
|
|
13
21
|
var children = _ref.children,
|
|
14
22
|
columns = _ref.columns,
|
|
15
23
|
rowSelection = _ref.rowSelection,
|
|
16
24
|
expandable = _ref.expandable;
|
|
17
|
-
var shouldRenderSelection = !!rowSelection;
|
|
18
|
-
var shouldRenderExpand = !!expandable;
|
|
19
|
-
var getColumnsFromChild = function getColumnsFromChild(childs) {
|
|
20
|
-
var cols = [];
|
|
21
|
-
React.Children.forEach(childs, function (child) {
|
|
22
|
-
if (child) {
|
|
23
|
-
cols.push(_objectSpread({}, child.props));
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
return cols.length ? cols : null;
|
|
27
|
-
};
|
|
28
25
|
var childColumns = useMemo(function () {
|
|
29
26
|
return children ? getColumnsFromChild(children) : null;
|
|
30
27
|
}, [children]);
|
|
@@ -32,7 +29,7 @@ export default function useColumns(_ref) {
|
|
|
32
29
|
// Build the column tree (with selection/expand injected at the top level),
|
|
33
30
|
// then derive both the flat leaf columns (body/colgroup/summary/sorter) and
|
|
34
31
|
// the 2D header rows (thead multi-level rendering).
|
|
35
|
-
var
|
|
32
|
+
var _useMemo = useMemo(function () {
|
|
36
33
|
var base = deepClone(childColumns || columns || []) || [];
|
|
37
34
|
var tree = injectSelectionExpand(base, rowSelection, expandable);
|
|
38
35
|
var leaves = flattenLeafColumns(tree);
|
|
@@ -42,9 +39,9 @@ export default function useColumns(_ref) {
|
|
|
42
39
|
wrapedColumns: wraped,
|
|
43
40
|
headerRows: rows
|
|
44
41
|
};
|
|
45
|
-
}, [childColumns, columns,
|
|
46
|
-
wrapedColumns =
|
|
47
|
-
headerRows =
|
|
42
|
+
}, [childColumns, columns, rowSelection, expandable]),
|
|
43
|
+
wrapedColumns = _useMemo.wrapedColumns,
|
|
44
|
+
headerRows = _useMemo.headerRows;
|
|
48
45
|
return {
|
|
49
46
|
wrapedColumns: wrapedColumns,
|
|
50
47
|
headerRows: 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
|
|
|
@@ -73,9 +73,11 @@ var TabContent = function TabContent(_ref) {
|
|
|
73
73
|
display: activeKey === key ? 'block' : 'none'
|
|
74
74
|
},
|
|
75
75
|
key: key,
|
|
76
|
+
id: "tabpanel-".concat(key),
|
|
76
77
|
role: "tabpanel",
|
|
77
78
|
"aria-labelledby": "tab-".concat(key),
|
|
78
|
-
"aria-hidden": activeKey !== key
|
|
79
|
+
"aria-hidden": activeKey !== key,
|
|
80
|
+
tabIndex: activeKey === key ? 0 : -1
|
|
79
81
|
}, children);
|
|
80
82
|
}));
|
|
81
83
|
};
|
|
@@ -129,7 +129,9 @@ var TabHeader = function TabHeader(props) {
|
|
|
129
129
|
}, /*#__PURE__*/React.createElement("div", {
|
|
130
130
|
className: clsx("".concat(prefixCls, "-nav-list"), classNames === null || classNames === void 0 ? void 0 : classNames.list),
|
|
131
131
|
style: styles === null || styles === void 0 ? void 0 : styles.list,
|
|
132
|
-
ref: navList
|
|
132
|
+
ref: navList,
|
|
133
|
+
role: "tablist",
|
|
134
|
+
"aria-orientation": direction
|
|
133
135
|
}, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
134
136
|
return /*#__PURE__*/React.createElement(TabHeaderTitle, _extends({}, item, {
|
|
135
137
|
$key: item.key,
|
|
@@ -149,10 +149,12 @@ var TabHeaderTitle = function TabHeaderTitle(props) {
|
|
|
149
149
|
return /*#__PURE__*/React.createElement("div", _extends({}, rest, {
|
|
150
150
|
ref: tabRef,
|
|
151
151
|
role: "tab",
|
|
152
|
+
id: "tab-".concat($key),
|
|
152
153
|
"aria-selected": activeKey === $key,
|
|
153
154
|
"aria-disabled": disabled,
|
|
155
|
+
"aria-controls": "tabpanel-".concat($key),
|
|
154
156
|
className: cls,
|
|
155
|
-
tabIndex: disabled ? -1 : 0,
|
|
157
|
+
tabIndex: disabled ? -1 : activeKey === $key ? 0 : -1,
|
|
156
158
|
onClick: handleTabClick,
|
|
157
159
|
onKeyDown: handleKeyDown
|
|
158
160
|
}), icon && /*#__PURE__*/React.createElement("span", {
|
package/dist/esm/Tour/index.d.ts
CHANGED
package/dist/esm/Tree/tree.js
CHANGED
|
@@ -16,8 +16,8 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
16
16
|
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); }
|
|
17
17
|
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; }
|
|
18
18
|
import clsx from 'clsx';
|
|
19
|
-
import React, { createContext, useContext, useMemo, useRef, useState } from 'react';
|
|
20
19
|
import { AnimatePresence, motion } from 'motion/react';
|
|
20
|
+
import React, { createContext, useContext, useMemo, useRef, useState } from 'react';
|
|
21
21
|
import { GlobalContext } from "../Config-Provider";
|
|
22
22
|
import useEvent from "../hooks/useEvent";
|
|
23
23
|
import useMergedState from "../hooks/useMergedState";
|
|
@@ -12,9 +12,12 @@ export default function useDelayState(state) {
|
|
|
12
12
|
delayState = _useState2[0],
|
|
13
13
|
setDelayState = _useState2[1];
|
|
14
14
|
useEffect(function () {
|
|
15
|
-
setTimeout(function () {
|
|
15
|
+
var timer = window.setTimeout(function () {
|
|
16
16
|
setDelayState(state);
|
|
17
17
|
}, delay * 1000);
|
|
18
|
-
|
|
18
|
+
return function () {
|
|
19
|
+
return window.clearTimeout(timer);
|
|
20
|
+
};
|
|
21
|
+
}, [delay, state]);
|
|
19
22
|
return delayState;
|
|
20
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function useFocusManage(
|
|
1
|
+
export default function useFocusManage(element: HTMLElement | null, open: boolean): void;
|
|
@@ -1,17 +1,35 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
2
|
import { popFocus, pushFocus } from "../utils/focusStack";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var
|
|
3
|
+
export default function useFocusManage(element, open) {
|
|
4
|
+
var entryRef = useRef(null);
|
|
5
|
+
var previousFocusRef = useRef(null);
|
|
6
|
+
var openCycleRef = useRef(false);
|
|
7
|
+
var releaseEntry = function releaseEntry() {
|
|
8
|
+
if (entryRef.current) {
|
|
9
|
+
popFocus(entryRef.current);
|
|
10
|
+
entryRef.current = null;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var endOpenCycle = function endOpenCycle() {
|
|
14
|
+
releaseEntry();
|
|
15
|
+
previousFocusRef.current = null;
|
|
16
|
+
openCycleRef.current = false;
|
|
17
|
+
};
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
if (open && !openCycleRef.current) {
|
|
20
|
+
openCycleRef.current = true;
|
|
21
|
+
previousFocusRef.current = document.activeElement;
|
|
22
|
+
} else if (!open && openCycleRef.current) {
|
|
23
|
+
endOpenCycle();
|
|
24
|
+
}
|
|
25
|
+
}, [open]);
|
|
6
26
|
useEffect(function () {
|
|
7
|
-
if (!
|
|
8
|
-
|
|
9
|
-
pushFocus(ele);
|
|
10
|
-
} else {
|
|
11
|
-
popFocus();
|
|
27
|
+
if (!open || !openCycleRef.current || !element || entryRef.current) {
|
|
28
|
+
return;
|
|
12
29
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
30
|
+
entryRef.current = pushFocus(element, previousFocusRef.current);
|
|
31
|
+
}, [element, open]);
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
return releaseEntry;
|
|
34
|
+
}, []);
|
|
17
35
|
}
|
package/dist/esm/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%;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
type Focusable = HTMLElement | null;
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export interface FocusStackEntry {
|
|
3
|
+
container: HTMLElement;
|
|
4
|
+
previous: Focusable;
|
|
5
|
+
}
|
|
6
|
+
export declare const pushFocus: (container: HTMLElement, previous?: Focusable) => FocusStackEntry;
|
|
7
|
+
export declare const popFocus: (entry: FocusStackEntry) => void;
|
|
4
8
|
export {};
|
|
@@ -1,20 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
var focusableSelector = ['a[href]', 'button:not([disabled])', 'textarea:not([disabled])', 'input:not([disabled])', 'select:not([disabled])', 'details', '[tabindex]:not([tabindex="-1"])'].join(',');
|
|
3
2
|
var stack = [];
|
|
4
3
|
var raf = 0;
|
|
5
|
-
var schedule = function schedule(
|
|
4
|
+
var schedule = function schedule(callback) {
|
|
6
5
|
cancelAnimationFrame(raf);
|
|
7
|
-
raf = requestAnimationFrame(
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
raf = requestAnimationFrame(callback);
|
|
7
|
+
};
|
|
8
|
+
var focusInitialElement = function focusInitialElement(entry) {
|
|
9
|
+
if (stack[stack.length - 1] !== entry || !entry.container.isConnected) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
var activeElement = document.activeElement;
|
|
13
|
+
if (activeElement && entry.container.contains(activeElement)) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
var firstFocusable = entry.container.querySelector(focusableSelector);
|
|
17
|
+
(firstFocusable !== null && firstFocusable !== void 0 ? firstFocusable : entry.container).focus();
|
|
10
18
|
};
|
|
11
|
-
export var pushFocus = function pushFocus(
|
|
12
|
-
var
|
|
13
|
-
|
|
14
|
-
|
|
19
|
+
export var pushFocus = function pushFocus(container) {
|
|
20
|
+
var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.activeElement;
|
|
21
|
+
var entry = {
|
|
22
|
+
container: container,
|
|
23
|
+
previous: previous
|
|
24
|
+
};
|
|
25
|
+
stack.push(entry);
|
|
26
|
+
schedule(function () {
|
|
27
|
+
return focusInitialElement(entry);
|
|
28
|
+
});
|
|
29
|
+
return entry;
|
|
15
30
|
};
|
|
16
|
-
export var popFocus = function popFocus() {
|
|
17
|
-
var
|
|
18
|
-
if (
|
|
19
|
-
|
|
31
|
+
export var popFocus = function popFocus(entry) {
|
|
32
|
+
var index = stack.lastIndexOf(entry);
|
|
33
|
+
if (index === -1) return;
|
|
34
|
+
var isTopEntry = index === stack.length - 1;
|
|
35
|
+
stack.splice(index, 1);
|
|
36
|
+
if (!isTopEntry) return;
|
|
37
|
+
schedule(function () {
|
|
38
|
+
var _entry$previous;
|
|
39
|
+
if ((_entry$previous = entry.previous) !== null && _entry$previous !== void 0 && _entry$previous.isConnected) {
|
|
40
|
+
entry.previous.focus();
|
|
41
|
+
}
|
|
42
|
+
});
|
|
20
43
|
};
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED