@rainbow-oh/yee-c 0.8.19 → 0.8.20
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/anchor.js +4 -1
- package/dist/cjs/Checkbox/checkbox.js +2 -1
- package/dist/cjs/Checkbox/style/index.less +3 -0
- package/dist/cjs/Progress/circle.js +46 -35
- package/dist/cjs/Progress/line.js +20 -11
- package/dist/cjs/Search/demo/basic.js +38 -3
- package/dist/cjs/Search/interface.d.ts +2 -2
- package/dist/cjs/Search/search.js +52 -32
- package/dist/cjs/Search/style/index.less +20 -3
- package/dist/cjs/Table/style/index.less +4 -2
- package/dist/cjs/Table/tbody/cell.js +2 -2
- package/dist/cjs/Transfer/interface.d.ts +0 -1
- package/dist/cjs/Transfer/style/index.less +4 -0
- package/dist/cjs/Transfer/transfer-list.js +1 -0
- package/dist/cjs/message/use-message.js +1 -3
- package/dist/cjs/notice/notice.js +1 -1
- 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/Checkbox/checkbox.js +2 -1
- package/dist/esm/Checkbox/style/index.less +3 -0
- package/dist/esm/Search/demo/basic.js +61 -7
- package/dist/esm/Search/interface.d.ts +2 -2
- package/dist/esm/Search/search.js +22 -15
- package/dist/esm/Search/style/index.less +20 -3
- package/dist/esm/Table/style/index.less +4 -2
- package/dist/esm/Table/tbody/cell.js +2 -2
- package/dist/esm/Transfer/interface.d.ts +0 -1
- package/dist/esm/Transfer/style/index.less +4 -0
- package/dist/esm/Transfer/transfer-list.js +1 -0
- package/dist/esm/notice/notice.js +1 -1
- 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/Anchor/anchor.tsx +9 -5
- package/src/Checkbox/checkbox.tsx +1 -0
- package/src/Checkbox/style/index.less +3 -0
- package/src/Progress/circle.tsx +5 -1
- package/src/Progress/line.tsx +5 -1
- package/src/Progress/progress.tsx +5 -1
- package/src/Search/demo/basic.tsx +43 -7
- package/src/Search/index.en-US.md +1 -1
- package/src/Search/index.zh-CN.md +1 -1
- package/src/Search/interface.ts +2 -2
- package/src/Search/search.tsx +40 -23
- package/src/Search/style/index.less +20 -3
- package/src/Spin/indicator.tsx +1 -1
- package/src/Table/style/index.less +4 -2
- package/src/Table/tbody/cell.tsx +2 -2
- package/src/Transfer/interface.ts +0 -1
- package/src/Transfer/style/index.less +4 -0
- package/src/Transfer/transfer-list.tsx +1 -0
- package/src/Tree/interface.ts +6 -1
- package/src/Tree/tree-node.tsx +7 -6
- package/src/Tree/utils/tree-tools.ts +4 -1
- package/src/Trigger/interface.ts +2 -1
- package/src/message/demo/base.tsx +1 -1
- package/src/message/interface.ts +1 -5
- package/src/message/message.test.tsx +15 -5
- package/src/message/message.tsx +10 -4
- package/src/message/use-message.tsx +2 -8
- package/src/message/wrapper.tsx +1 -2
- package/src/notice/interface.ts +1 -5
- package/src/notice/notice.test.tsx +14 -6
- package/src/notice/notice.tsx +12 -6
- package/src/notice/wrapper.tsx +1 -2
- package/src/version.ts +1 -1
- package/dist/cjs/Search/style/index.d.ts +0 -1
- package/dist/cjs/Search/style/index.js +0 -2
- package/dist/esm/Search/style/index.d.ts +0 -1
- package/dist/esm/Search/style/index.js +0 -1
- package/src/Search/style/index.ts +0 -1
|
@@ -13,7 +13,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
13
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
14
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
15
15
|
import clsx from 'clsx';
|
|
16
|
-
import { X } from 'lucide-react';
|
|
16
|
+
import { Search as SearchIcon, X } from 'lucide-react';
|
|
17
17
|
import React, { startTransition, useContext, useEffect, useId, useRef, useState } from 'react';
|
|
18
18
|
import { GlobalContext } from "../Config-Provider";
|
|
19
19
|
import useMergedState from "../hooks/useMergedState";
|
|
@@ -92,20 +92,12 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
92
92
|
(_popupRef$current = popupRef.current) === null || _popupRef$current === void 0 || _popupRef$current.focus();
|
|
93
93
|
} else {}
|
|
94
94
|
}, [open]);
|
|
95
|
-
var handleSearch = function handleSearch(e) {
|
|
96
|
-
if (disabled) return;
|
|
97
|
-
onSearch === null || onSearch === void 0 || onSearch(searchValue);
|
|
98
|
-
if ((e === null || e === void 0 ? void 0 : e.type) === 'click') {
|
|
99
|
-
var _blur, _ref;
|
|
100
|
-
(_blur = (_ref = e.target).blur) === null || _blur === void 0 || _blur.call(_ref);
|
|
101
|
-
}
|
|
102
|
-
};
|
|
103
95
|
var handleChange = function handleChange(e) {
|
|
104
96
|
var newValue = e.target.value;
|
|
105
97
|
setSearchValue(newValue);
|
|
106
98
|
startTransition(function () {
|
|
107
99
|
if (searchOnAction === 'typing') {
|
|
108
|
-
|
|
100
|
+
onSearch === null || onSearch === void 0 || onSearch(newValue);
|
|
109
101
|
}
|
|
110
102
|
});
|
|
111
103
|
};
|
|
@@ -115,10 +107,24 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
115
107
|
onChange === null || onChange === void 0 || onChange(null);
|
|
116
108
|
onSearch === null || onSearch === void 0 || onSearch('');
|
|
117
109
|
};
|
|
110
|
+
var handleSearchClick = function handleSearchClick(e) {
|
|
111
|
+
e.stopPropagation();
|
|
112
|
+
if (searchOnAction === 'button') {
|
|
113
|
+
onSearch === null || onSearch === void 0 || onSearch(searchValue);
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
var renderSearchIcon = function renderSearchIcon() {
|
|
117
|
+
if (suffix === false) return null;
|
|
118
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
119
|
+
className: "".concat(prefixCls, "-search-icon"),
|
|
120
|
+
onClick: handleSearchClick
|
|
121
|
+
}, suffix || /*#__PURE__*/React.createElement(SearchIcon, {
|
|
122
|
+
size: 14
|
|
123
|
+
}));
|
|
124
|
+
};
|
|
118
125
|
var renderSuffix = function renderSuffix() {
|
|
119
|
-
var
|
|
120
|
-
var
|
|
121
|
-
var showSuffix = suffix || showClearIcon;
|
|
126
|
+
var showClearIcon = allowClear && !disabled && !rest.readOnly;
|
|
127
|
+
var showSuffix = suffix !== false || suffix !== null || showClearIcon;
|
|
122
128
|
if (!showSuffix) {
|
|
123
129
|
return null;
|
|
124
130
|
}
|
|
@@ -141,7 +147,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
141
147
|
}, /*#__PURE__*/React.createElement(X, {
|
|
142
148
|
size: 14,
|
|
143
149
|
"aria-hidden": "true"
|
|
144
|
-
})),
|
|
150
|
+
})), renderSearchIcon());
|
|
145
151
|
};
|
|
146
152
|
var renderPrefix = function renderPrefix() {
|
|
147
153
|
if (!prefix) return null;
|
|
@@ -154,7 +160,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
154
160
|
return clsx("".concat(prefixCls, "-input"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-input-small"), size === 'small'), "".concat(prefixCls, "-input-large"), size === 'large'), "".concat(prefixCls, "-input-disabled"), disabled), classNames === null || classNames === void 0 ? void 0 : classNames.input);
|
|
155
161
|
};
|
|
156
162
|
var getRootClassName = function getRootClassName() {
|
|
157
|
-
return clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-small"), size === 'small'), "".concat(prefixCls, "-large"), size === 'large'), className);
|
|
163
|
+
return clsx(prefixCls, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-with-clear"), allowClear && searchValue), "".concat(prefixCls, "-borderless"), !bordered), "".concat(prefixCls, "-small"), size === 'small'), "".concat(prefixCls, "-large"), size === 'large'), className);
|
|
158
164
|
};
|
|
159
165
|
var hasPopup = Array.isArray(options) || Array.isArray(suggestions);
|
|
160
166
|
var popup = /*#__PURE__*/React.createElement("div", {
|
|
@@ -176,6 +182,7 @@ var Search = /*#__PURE__*/React.forwardRef(function (baseProps, ref) {
|
|
|
176
182
|
return /*#__PURE__*/React.createElement(Trigger, {
|
|
177
183
|
popup: popup,
|
|
178
184
|
open: open,
|
|
185
|
+
stretch: "width",
|
|
179
186
|
onOpenChange: setOpen
|
|
180
187
|
}, /*#__PURE__*/React.createElement("div", {
|
|
181
188
|
className: getRootClassName(),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @import '../../style/index.less';
|
|
2
2
|
|
|
3
|
-
@
|
|
3
|
+
@cls: ~'yee-search';
|
|
4
4
|
|
|
5
|
-
.@{
|
|
5
|
+
.@{cls} {
|
|
6
6
|
position: relative;
|
|
7
7
|
display: inline-flex;
|
|
8
8
|
align-items: center;
|
|
@@ -69,9 +69,10 @@
|
|
|
69
69
|
border: none;
|
|
70
70
|
outline: none;
|
|
71
71
|
transition: all 0.2s;
|
|
72
|
+
line-height: var(--yee-input-line-height);
|
|
72
73
|
|
|
73
74
|
&::placeholder {
|
|
74
|
-
color: var(--yee-
|
|
75
|
+
color: var(--yee-placeholder-color);
|
|
75
76
|
}
|
|
76
77
|
|
|
77
78
|
&-disabled {
|
|
@@ -99,7 +100,17 @@
|
|
|
99
100
|
color: var(--yee-input-fix-icon-color);
|
|
100
101
|
}
|
|
101
102
|
|
|
103
|
+
&-search-icon {
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
}
|
|
106
|
+
|
|
102
107
|
&-clear-icon {
|
|
108
|
+
display: inline-flex;
|
|
109
|
+
padding: var(--yee-input-clear-padding);
|
|
110
|
+
color: var(--yee-input-clear-color);
|
|
111
|
+
background-color: var(--yee-input-clear-bg-color);
|
|
112
|
+
border-radius: 50%;
|
|
113
|
+
visibility: hidden;
|
|
103
114
|
cursor: pointer;
|
|
104
115
|
transition: color 0.2s;
|
|
105
116
|
|
|
@@ -108,6 +119,12 @@
|
|
|
108
119
|
}
|
|
109
120
|
}
|
|
110
121
|
|
|
122
|
+
&&-with-clear:not(.@{cls}-disabled):hover {
|
|
123
|
+
.@{cls}-clear-icon {
|
|
124
|
+
visibility: visible;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
111
128
|
&-button {
|
|
112
129
|
display: flex;
|
|
113
130
|
align-items: center;
|
|
@@ -97,7 +97,8 @@
|
|
|
97
97
|
width: 15px;
|
|
98
98
|
right: -15px;
|
|
99
99
|
top: 0;
|
|
100
|
-
box-shadow: inset 4px 0 8px -4px
|
|
100
|
+
box-shadow: inset 4px 0 8px -4px
|
|
101
|
+
var(--yee-table-fixed-left-after-bs-color);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
|
|
@@ -111,7 +112,8 @@
|
|
|
111
112
|
width: 15px;
|
|
112
113
|
left: -15px;
|
|
113
114
|
top: 0;
|
|
114
|
-
box-shadow: inset -4px 0 8px -4px
|
|
115
|
+
box-shadow: inset -4px 0 8px -4px
|
|
116
|
+
var(--yee-table-fixed-right-after-bs-color);
|
|
115
117
|
}
|
|
116
118
|
}
|
|
117
119
|
}
|
|
@@ -43,7 +43,7 @@ var TableCell = function TableCell(props) {
|
|
|
43
43
|
var getTdProps = function getTdProps() {
|
|
44
44
|
var title = render ? undefined : record[dataIndex || ''];
|
|
45
45
|
var cls = clsx("".concat(prefixCls, "-cell"), _defineProperty(_defineProperty(_defineProperty({}, "".concat(prefixCls, "-cell-fixed-").concat(fixed), fixed), "".concat(prefixCls, "-cell-fixed-").concat(fixed, "-first"), isFixedRightFirst), "".concat(prefixCls, "-cell-fixed-").concat(fixed, "-last"), isFixedLeftLast), className);
|
|
46
|
-
var
|
|
46
|
+
var _style = _objectSpread(_objectSpread({}, style), {}, {
|
|
47
47
|
width: width,
|
|
48
48
|
maxWidth: width,
|
|
49
49
|
textAlign: align
|
|
@@ -51,7 +51,7 @@ var TableCell = function TableCell(props) {
|
|
|
51
51
|
var _title = typeof title === 'string' ? title : undefined;
|
|
52
52
|
return _objectSpread(_objectSpread({}, cellProperty), {}, {
|
|
53
53
|
className: cls,
|
|
54
|
-
style:
|
|
54
|
+
style: _style,
|
|
55
55
|
title: _title
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -115,7 +115,6 @@ export interface TransferListProps {
|
|
|
115
115
|
total?: number;
|
|
116
116
|
};
|
|
117
117
|
draggable?: boolean;
|
|
118
|
-
targetMinCountLimit?: number;
|
|
119
118
|
onDrop?: (dropObj: Record<string, any>, dataSource: DataSource[]) => void;
|
|
120
119
|
onDelete?: (key: string | number) => void;
|
|
121
120
|
onItemSelect: (keys: Array<string | number>) => void;
|
|
@@ -66,6 +66,10 @@
|
|
|
66
66
|
line-height: var(--yee-transfer-list-item-height, 32px);
|
|
67
67
|
padding: var(--yee-transfer-list-item-padding, 0 11px);
|
|
68
68
|
|
|
69
|
+
&-checkbox {
|
|
70
|
+
width: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
69
73
|
&:hover:not(.yee-one-way):not(.disabled) {
|
|
70
74
|
color: var(--yee-transfer-list-content-item-hover-color);
|
|
71
75
|
background-color: var(--yee-transfer-list-content-item-hover-bg-color);
|
|
@@ -192,6 +192,7 @@ var TransferList = function TransferList(props) {
|
|
|
192
192
|
className: "".concat(prefixCls, "-list-item"),
|
|
193
193
|
key: option.value || index
|
|
194
194
|
}, /*#__PURE__*/React.createElement(Checkbox, {
|
|
195
|
+
className: "".concat(prefixCls, "-list-item-checkbox"),
|
|
195
196
|
value: option.value,
|
|
196
197
|
disabled: option.disabled || disabled,
|
|
197
198
|
checked: checkedKeys.includes(option.value),
|
|
@@ -9,9 +9,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
9
9
|
import clsx from 'clsx';
|
|
10
10
|
import { CircleAlert, CircleCheck, CircleX, Info, X } from 'lucide-react';
|
|
11
11
|
import React from 'react';
|
|
12
|
+
import Button from "../Button";
|
|
12
13
|
import Progress from "../Progress";
|
|
13
14
|
import useCountdown from "../hooks/useCountdown";
|
|
14
|
-
import Button from "../Button";
|
|
15
15
|
var icons = {
|
|
16
16
|
info: /*#__PURE__*/React.createElement(Info, {
|
|
17
17
|
size: 22,
|
package/dist/esm/version.d.ts
CHANGED
package/dist/esm/version.js
CHANGED