@alicloud/console-components-search 0.2.33 → 0.2.35
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 +21 -0
- package/es/ComplexSearch/InputPrefix.js +6 -9
- package/es/ComplexSearch/index.js +46 -84
- package/es/constants.js +3 -1
- package/es/index.js +4 -4
- package/es/message.js +16 -17
- package/es/search.js +11 -18
- package/es/searchTagList/PureTag.js +10 -15
- package/es/searchTagList/index.js +27 -47
- package/es/style.js +13 -11
- package/es/types/IRcSearchOptions.type.js +1 -0
- package/es/types/IRcSearchProps.type.js +1 -0
- package/es/types/IRcSearchTagItemProps.type.js +1 -0
- package/es/types/IRcSearchTagListProps.type.js +1 -0
- package/es/useCssVar.js +6 -11
- package/es/utils.js +9 -41
- package/lib/ComplexSearch/InputPrefix.d.ts +2 -2
- package/lib/ComplexSearch/InputPrefix.js +7 -16
- package/lib/ComplexSearch/index.js +50 -107
- package/lib/constants.js +7 -9
- package/lib/index.d.ts +5 -5
- package/lib/index.js +10 -17
- package/lib/message.js +17 -22
- package/lib/search.d.ts +2 -2
- package/lib/search.js +9 -28
- package/lib/searchTagList/PureTag.js +11 -23
- package/lib/searchTagList/index.d.ts +1 -1
- package/lib/searchTagList/index.js +23 -57
- package/lib/style.d.ts +1 -1
- package/lib/style.js +13 -24
- package/lib/types/IRcSearchOptions.type.d.ts +13 -13
- package/lib/types/IRcSearchOptions.type.js +5 -1
- package/lib/types/IRcSearchProps.type.d.ts +2 -2
- package/lib/types/IRcSearchProps.type.js +5 -1
- package/lib/types/IRcSearchTagItemProps.type.js +5 -1
- package/lib/types/IRcSearchTagListProps.type.js +5 -1
- package/lib/useCssVar.js +6 -19
- package/lib/utils.d.ts +1 -3
- package/lib/utils.js +18 -72
- package/package.json +19 -16
- package/dist/index.css +0 -73
- package/dist/index.js +0 -135343
- package/doc-dist/0.js +0 -2094
- package/doc-dist/1.js +0 -27
- package/doc-dist/10.js +0 -6
- package/doc-dist/11.js +0 -6
- package/doc-dist/12.js +0 -6
- package/doc-dist/13.js +0 -6
- package/doc-dist/14.js +0 -6
- package/doc-dist/15.js +0 -6
- package/doc-dist/16.js +0 -6
- package/doc-dist/3.js +0 -89
- package/doc-dist/4.js +0 -6
- package/doc-dist/5.js +0 -13
- package/doc-dist/6.css +0 -1
- package/doc-dist/6.js +0 -6
- package/doc-dist/6.os.css +0 -1
- package/doc-dist/7.js +0 -6
- package/doc-dist/8.js +0 -6
- package/doc-dist/9.js +0 -6
- package/doc-dist/console-fe-test-rc-search-doc.manifest.json +0 -38
- package/doc-dist/deps/console-fe-test-rc-search-doc-deps.manifest.json +0 -33
- package/doc-dist/deps/index.html +0 -14
- package/doc-dist/deps/main.css +0 -1
- package/doc-dist/deps/main.js +0 -103
- package/doc-dist/deps/main.os.css +0 -1
- package/doc-dist/index.css +0 -1
- package/doc-dist/index.html +0 -14
- package/doc-dist/index.js +0 -19
- package/doc-dist/index.os.css +0 -1
- package/doc-dist/log-deps-build.log +0 -19
- package/es/provider/LoggerProvider.js +0 -37
- package/lib/provider/LoggerProvider.d.ts +0 -8
- package/lib/provider/LoggerProvider.js +0 -47
|
@@ -1,39 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
11
|
var _consoleComponents = require("@alicloud/console-components");
|
|
17
|
-
|
|
18
12
|
var _consoleComponentsTruncate = _interopRequireDefault(require("@alicloud/console-components-truncate"));
|
|
19
|
-
|
|
20
13
|
var _message = _interopRequireDefault(require("../message"));
|
|
21
|
-
|
|
14
|
+
var _excluded = ["intl", "tagKey", "disableTruncate", "showDot", "tagValue", "showLabel", "closable"];
|
|
22
15
|
var Empty = function Empty(_ref) {
|
|
23
16
|
var children = _ref.children;
|
|
24
17
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
|
|
25
18
|
};
|
|
26
|
-
|
|
27
19
|
var PureTag = function PureTag(props) {
|
|
28
20
|
var intl = props.intl,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
tagKey = props.tagKey,
|
|
22
|
+
disableTruncate = props.disableTruncate,
|
|
23
|
+
showDot = props.showDot,
|
|
24
|
+
tagValue = props.tagValue,
|
|
25
|
+
showLabel = props.showLabel,
|
|
26
|
+
_props$closable = props.closable,
|
|
27
|
+
closable = _props$closable === void 0 ? true : _props$closable,
|
|
28
|
+
resetProps = (0, _objectWithoutProperties2.default)(props, _excluded);
|
|
37
29
|
var defaultTruncateProps = {
|
|
38
30
|
threshold: 20,
|
|
39
31
|
showTooltip: false
|
|
@@ -42,16 +34,14 @@ var PureTag = function PureTag(props) {
|
|
|
42
34
|
var DotWrapper = showDot ? _consoleComponents.Badge : Empty;
|
|
43
35
|
var TagWrapper = closable ? _consoleComponents.Tag.Closeable : _consoleComponents.Tag;
|
|
44
36
|
var transformedTagValue = tagValue;
|
|
45
|
-
|
|
46
37
|
if (tagValue === '') {
|
|
47
38
|
transformedTagValue = _message.default.emptyValue;
|
|
48
39
|
} else if (tagValue === undefined || tagValue === null) {
|
|
49
40
|
transformedTagValue = _message.default.allValue;
|
|
50
41
|
}
|
|
51
|
-
|
|
52
42
|
return (
|
|
53
43
|
/*#__PURE__*/
|
|
54
|
-
|
|
44
|
+
// @ts-ignore
|
|
55
45
|
_react.default.createElement(DotWrapper, {
|
|
56
46
|
className: "search-tags-tag-dot",
|
|
57
47
|
dot: true
|
|
@@ -65,6 +55,4 @@ var PureTag = function PureTag(props) {
|
|
|
65
55
|
}, transformedTagValue)))
|
|
66
56
|
);
|
|
67
57
|
};
|
|
68
|
-
|
|
69
|
-
var _default = PureTag;
|
|
70
|
-
exports.default = _default;
|
|
58
|
+
var _default = exports.default = PureTag;
|
|
@@ -1,66 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
10
|
var _react = _interopRequireDefault(require("react"));
|
|
15
|
-
|
|
16
11
|
var _classnames = _interopRequireDefault(require("classnames"));
|
|
17
|
-
|
|
18
12
|
var _consoleComponents = require("@alicloud/console-components");
|
|
19
|
-
|
|
13
|
+
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
14
|
+
var _isObject = _interopRequireDefault(require("lodash/isObject"));
|
|
20
15
|
var _style = require("../style");
|
|
21
|
-
|
|
22
16
|
var _constants = require("../constants");
|
|
23
|
-
|
|
24
|
-
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
25
|
-
|
|
26
17
|
var _PureTag = _interopRequireDefault(require("./PureTag"));
|
|
27
|
-
|
|
28
18
|
var _useCssVar = require("../useCssVar");
|
|
29
|
-
|
|
30
19
|
var _message = _interopRequireDefault(require("../message"));
|
|
20
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
21
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
22
|
+
var ClosableTag = _consoleComponents.Tag.Closeable;
|
|
31
23
|
|
|
32
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
33
|
-
|
|
34
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
35
|
-
|
|
36
|
-
var TagGroup = _consoleComponents.Tag.Group,
|
|
37
|
-
ClosableTag = _consoleComponents.Tag.Closeable;
|
|
38
24
|
/**
|
|
39
25
|
* 判断是否是 标签 的数据结构
|
|
40
26
|
*/
|
|
41
|
-
|
|
42
27
|
var isTagLikeDataStructure = function isTagLikeDataStructure(value) {
|
|
43
28
|
var isTag = !!(value !== null && value !== void 0 && value.tagKey);
|
|
44
|
-
|
|
45
29
|
if ((0, _isArray.default)(value)) {
|
|
46
30
|
return value[0] && !!value[0].tagKey;
|
|
47
31
|
}
|
|
48
|
-
|
|
49
32
|
return isTag;
|
|
50
33
|
};
|
|
51
|
-
|
|
52
34
|
var SearchTagList = function SearchTagList(props) {
|
|
53
35
|
var dataSource = props.dataSource,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
className = props.className,
|
|
37
|
+
style = props.style,
|
|
38
|
+
onChange = props.onChange,
|
|
39
|
+
onClear = props.onClear,
|
|
40
|
+
_props$prefix = props.prefix,
|
|
41
|
+
prefix = _props$prefix === void 0 ? 'next-' : _props$prefix;
|
|
61
42
|
var onRemoveFilter = function onRemoveFilter(item) {
|
|
62
43
|
var newTagList = (0, _toConsumableArray2.default)(dataSource);
|
|
63
|
-
|
|
64
44
|
if (onChange) {
|
|
65
45
|
var resFindIndex = newTagList.findIndex(function (x) {
|
|
66
46
|
return x.dataIndex === item.dataIndex;
|
|
@@ -69,22 +49,18 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
69
49
|
onChange(deletedTags[0], newTagList);
|
|
70
50
|
}
|
|
71
51
|
};
|
|
72
|
-
|
|
73
52
|
var onRemoveAllFilter = function onRemoveAllFilter() {
|
|
74
53
|
if (onClear) {
|
|
75
54
|
onClear();
|
|
76
55
|
}
|
|
77
56
|
};
|
|
78
|
-
|
|
79
57
|
var onRemoveTag = function onRemoveTag(item, tag) {
|
|
80
58
|
var newDataSource = (0, _toConsumableArray2.default)(dataSource);
|
|
81
|
-
|
|
82
59
|
if (onChange) {
|
|
83
60
|
var resFindIndex = item.value.findIndex(function (x) {
|
|
84
61
|
return x.tagKey === tag.tagKey && x.tagValue === tag.tagValue;
|
|
85
62
|
});
|
|
86
63
|
var deletedTags = item.value.splice(resFindIndex, 1);
|
|
87
|
-
|
|
88
64
|
if (item.value.length === 0) {
|
|
89
65
|
onRemoveFilter(item);
|
|
90
66
|
} else {
|
|
@@ -94,10 +70,8 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
94
70
|
}
|
|
95
71
|
}
|
|
96
72
|
};
|
|
97
|
-
|
|
98
73
|
var renderTags = function renderTags(tagItem) {
|
|
99
74
|
var value = tagItem.value;
|
|
100
|
-
|
|
101
75
|
if ((0, _isArray.default)(value)) {
|
|
102
76
|
return value.map(function (t) {
|
|
103
77
|
return /*#__PURE__*/_react.default.createElement(_PureTag.default, {
|
|
@@ -113,7 +87,6 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
113
87
|
});
|
|
114
88
|
});
|
|
115
89
|
}
|
|
116
|
-
|
|
117
90
|
return /*#__PURE__*/_react.default.createElement(_PureTag.default, {
|
|
118
91
|
showLabel: true,
|
|
119
92
|
tagKey: value === null || value === void 0 ? void 0 : value.tagKey,
|
|
@@ -125,12 +98,17 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
125
98
|
}
|
|
126
99
|
});
|
|
127
100
|
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
101
|
+
var processDataSource = (dataSource === null || dataSource === void 0 ? void 0 : dataSource.filter(function (t) {
|
|
102
|
+
if ((0, _isArray.default)(t === null || t === void 0 ? void 0 : t.value)) {
|
|
103
|
+
// 过滤掉非法的 Tag 节点
|
|
104
|
+
var validValue = t.value.filter(isTagLikeDataStructure);
|
|
105
|
+
if (!validValue.length) return false;
|
|
106
|
+
}
|
|
107
|
+
if ((0, _isObject.default)(t === null || t === void 0 ? void 0 : t.value)) {
|
|
108
|
+
return isTagLikeDataStructure(t.value);
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
})) || [];
|
|
134
112
|
var isWindClass = (0, _useCssVar.useWindTheme)();
|
|
135
113
|
return /*#__PURE__*/_react.default.createElement(_style.TagListWrap, {
|
|
136
114
|
prefix: prefix,
|
|
@@ -140,15 +118,6 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
140
118
|
if (isTagLikeDataStructure(tagItem.value)) {
|
|
141
119
|
return renderTags(tagItem);
|
|
142
120
|
}
|
|
143
|
-
/**
|
|
144
|
-
* 非 tag 标签类型的 Object 数据不渲染
|
|
145
|
-
*/
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
if (typeof (tagItem.valueLabel || tagItem.value) !== 'string') {
|
|
149
|
-
return null;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
121
|
return /*#__PURE__*/_react.default.createElement(ClosableTag, {
|
|
153
122
|
className: "search-tags-tag",
|
|
154
123
|
key: tagItem.dataIndex + tagItem.value,
|
|
@@ -166,7 +135,4 @@ var SearchTagList = function SearchTagList(props) {
|
|
|
166
135
|
onClick: onRemoveAllFilter
|
|
167
136
|
}, _message.default.clearFilter));
|
|
168
137
|
};
|
|
169
|
-
|
|
170
|
-
var _default = _consoleComponents.ConfigProvider.config(SearchTagList);
|
|
171
|
-
|
|
172
|
-
exports.default = _default;
|
|
138
|
+
var _default = exports.default = _consoleComponents.ConfigProvider.config(SearchTagList);
|
package/lib/style.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ declare const MultiBtnWarp: import("styled-components").StyledComponent<"div", a
|
|
|
10
10
|
declare const TagListWrap: import("styled-components").StyledComponent<"div", any, {
|
|
11
11
|
prefix: string;
|
|
12
12
|
}, never>;
|
|
13
|
-
export { SearchWarp, MultiBtnWarp, TagListWrap, MenuContentWrap };
|
|
13
|
+
export { SearchWarp, MultiBtnWarp, TagListWrap, MenuContentWrap, };
|
package/lib/style.js
CHANGED
|
@@ -1,34 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.
|
|
9
|
-
|
|
10
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
-
|
|
7
|
+
exports.TagListWrap = exports.SearchWarp = exports.MultiBtnWarp = exports.MenuContentWrap = void 0;
|
|
12
8
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
13
|
-
|
|
14
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
15
|
-
|
|
16
9
|
var prefix = function prefix(props) {
|
|
17
10
|
return props.prefix ? ".".concat(props.prefix) : '.next-';
|
|
18
11
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
exports.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
var
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var TagListWrap = _styledComponents.default.div(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n ", "tag-medium", "tag-closable > ", "tag-close-btn {\n margin-left: 8px;\n padding-right: 6px;\n }\n ", "tag-medium", "tag-closable > ", "tag-body {\n max-width: calc(100% - 8px - 8px - var(--tag-size-m-padding-lr, 8px));\n }\n ", "tag-medium", "tag-closable > ", "tag-close-btn ", "icon:before, ", "tag-medium", "tag-closable > ", "tag-close-btn ", "icon ", "icon-remote{\n font-size: 16px;\n }\n && [class*='-icon-close']::before{\n color: #808080;\n font-size: 12px !important;\n }\n .remove-btn{\n line-height: 24px;\n margin-top: 4px;\n display: inline-block;\n vertical-align: middle;\n cursor: pointer;\n }\n"])), prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
33
|
-
|
|
34
|
-
exports.TagListWrap = TagListWrap;
|
|
12
|
+
var SearchWarp = exports.SearchWarp = _styledComponents.default.div.withConfig({
|
|
13
|
+
componentId: "sc-1afc1cn-0"
|
|
14
|
+
})(["height:100%;width:100%;display:flex;--input-clear-icon-transform:1;--input-hint-icon-color:#808080;.left-wrap{flex:1;border:1px solid var(--btn-pure-normal-border-color,#d1d5d9);display:flex;border-bottom-left-radius:var(--corner-1,2px);border-top-left-radius:var(--corner-1,2px);border-right:none;&.focus{border:1px solid #0064c8;border:1px solid var(--input-focus-border-color,#0064c8);;border-right:none;}.condition{height:26px;display:inline-block;margin-top:2px;}.condition-item{height:26px;display:inline-block;line-height:26px;background-color:var(--console-rc-search-label-color,#F7F9FA);:hover{background-color:var(--console-rc-search-label-hover-color,#EFF3F8);}border-radius:var(--corner-1,2px);padding:0 8px;margin:0 2px;font-size:12px;color:#333;position:relative;&-txt{padding-right:4px;}&:hover{background-color:#E0E4E8;}}.condition-select{width:100%;height:100%;opacity:0;position:absolute;top:0;left:0;min-width:auto;&.rc-search-prefix-no-select{", "input", "disabled{cursor:auto;}}", "select-inner{min-width:auto;}}.forms{flex:1;position:relative;.clear-level1{position:absolute;top:var(--console-rc-search-close-btn-top,1px);right:var(--console-rc-search-close-btn-left,1px);height:28px;width:30px;background-color:transparent;z-index:1;color:#333;text-align:center;line-height:28px;font-size:12px;cursor:pointer;padding:6px 0 0 6px;}}.main-input{", "select-arrow{display:none !important;}height:auto;border:none;box-shadow:none;&.single{flex:1;}&.select{width:100%;}&.multi{width:100%;}", "input,", "input{height:auto;box-shadow:none;}}", "input", "medium{height:auto;}}.right-wrap{width:32px;.search-btn{width:32px;padding:0 !important;border-bottom-left-radius:0;border-top-left-radius:0;&.focus{border-color:#0064c8;border-color:var(--input-focus-border-color,#0064c8);}}}.isWidget & .right-wrap,.isWind & .right-wrap{.search-btn{&:hover{border-color:#0064c8;border-color:var(--input-focus-border-color,#0064c8);}}}& ", "input-control ", "input-clear-icon::before{content:var(--icon-content-close,\"ea22\") !important;}.isWidget & ", "input-control ", "input-clear-icon::before{content:\"\\E697\" !important;}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
15
|
+
var MenuContentWrap = exports.MenuContentWrap = _styledComponents.default.ul.withConfig({
|
|
16
|
+
componentId: "sc-1afc1cn-1"
|
|
17
|
+
})(["", "tag-small", "tag-closable > ", "tag-close-btn{margin-left:8px;padding-right:4px;padding-top:1px;}", "tag-small", "tag-closable > ", "tag-body{max-width:calc(100% - 8px - 8px - var(--tag-size-m-padding-lr,8px));}", "tag-small", "tag-closable > ", "tag-close-btn ", "icon:before,", "tag-small", "tag-closable > ", "tag-close-btn ", "icon ", "icon-remote{font-size:13px;}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
18
|
+
var MultiBtnWarp = exports.MultiBtnWarp = _styledComponents.default.div.withConfig({
|
|
19
|
+
componentId: "sc-1afc1cn-2"
|
|
20
|
+
})(["padding:\"0 4px\";text-align:\"center\";.pri-btn{margin-right:8px;width:auto;min-width:auto;padding:3px 12px;}.cancel-btn{padding:3px 12px;width:auto;min-width:auto;}", "btn", "small:not(.isOnlyIcon):not(", "btn-text){min-width:auto;}"], prefix, prefix, prefix);
|
|
21
|
+
var TagListWrap = exports.TagListWrap = _styledComponents.default.div.withConfig({
|
|
22
|
+
componentId: "sc-1afc1cn-3"
|
|
23
|
+
})(["", "tag-medium", "tag-closable > ", "tag-close-btn{margin-left:8px;padding-right:6px;}", "tag-medium", "tag-closable > ", "tag-body{max-width:calc(100% - 8px - 8px - var(--tag-size-m-padding-lr,8px));}", "tag-medium", "tag-closable > ", "tag-close-btn ", "icon:before,", "tag-medium", "tag-closable > ", "tag-close-btn ", "icon ", "icon-remote{font-size:16px;}&& [class*='-icon-close']::before{color:#808080;font-size:12px !important;}.remove-btn{line-height:24px;margin-top:4px;display:inline-block;vertical-align:middle;cursor:pointer;}"], prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix, prefix);
|
|
@@ -3,25 +3,25 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export interface IRcSearchOptionsProps {
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
* 字段展示名称
|
|
7
|
+
*/
|
|
8
8
|
label: string;
|
|
9
9
|
/**
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
* 字段表单key
|
|
11
|
+
*/
|
|
12
12
|
dataIndex: string;
|
|
13
13
|
/**
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
* 字段,交互组件类型(input/select/multiple)<br />
|
|
15
|
+
* - input:搜索框<br />
|
|
16
|
+
* - select:单选<br />
|
|
17
|
+
* - multiple:多选<br />
|
|
18
|
+
*/
|
|
19
19
|
template?: string;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
* 定义传给表单项的属性
|
|
22
|
+
* templateProps.placeholder
|
|
23
|
+
* templateProps.dataSource
|
|
24
|
+
*/
|
|
25
25
|
templateProps?: any;
|
|
26
26
|
groupName?: string;
|
|
27
27
|
}
|
package/lib/useCssVar.js
CHANGED
|
@@ -1,57 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.useCssVar = useCssVar;
|
|
9
8
|
exports.useWindTheme = useWindTheme;
|
|
10
|
-
|
|
11
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
12
|
-
|
|
13
10
|
var _react = require("react");
|
|
14
|
-
|
|
15
11
|
var _consoleComponents = require("@alicloud/console-components");
|
|
16
|
-
|
|
17
12
|
var nextId = 0;
|
|
18
|
-
|
|
19
13
|
function useCssVar(cssVarName) {
|
|
20
14
|
var _useState = (0, _react.useState)(''),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
16
|
+
v = _useState2[0],
|
|
17
|
+
setV = _useState2[1];
|
|
25
18
|
var refElement = _consoleComponents.ConfigProvider.useRefElement();
|
|
26
|
-
|
|
27
19
|
(0, _react.useLayoutEffect)(function () {
|
|
28
20
|
var _window$__recheck_css;
|
|
21
|
+
check();
|
|
29
22
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
var checkArr = window['__recheck_css_var'] = (_window$__recheck_css = window['__recheck_css_var']) !== null && _window$__recheck_css !== void 0 ? _window$__recheck_css : [];
|
|
33
|
-
|
|
23
|
+
// @ts-ignore
|
|
24
|
+
var checkArr = window.__recheck_css_var = (_window$__recheck_css = window.__recheck_css_var) !== null && _window$__recheck_css !== void 0 ? _window$__recheck_css : [];
|
|
34
25
|
while (checkArr[nextId]) {
|
|
35
26
|
// 如果一个页面下有份此组件库(即有多个nextId指针),需要避免冲突
|
|
36
27
|
nextId++;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
29
|
var id = nextId++;
|
|
40
30
|
checkArr[id] = check;
|
|
41
31
|
return function () {
|
|
42
32
|
delete checkArr[id];
|
|
43
33
|
};
|
|
44
|
-
|
|
45
34
|
function check() {
|
|
46
35
|
var _window$getComputedSt, _window$getComputedSt2, _window;
|
|
47
|
-
|
|
48
36
|
var val = (_window$getComputedSt = (_window$getComputedSt2 = (_window = window).getComputedStyle) === null || _window$getComputedSt2 === void 0 ? void 0 : _window$getComputedSt2.call(_window, refElement).getPropertyValue(cssVarName)) !== null && _window$getComputedSt !== void 0 ? _window$getComputedSt : '';
|
|
49
37
|
setV(val);
|
|
50
38
|
}
|
|
51
39
|
}, [refElement, cssVarName]);
|
|
52
40
|
return v;
|
|
53
41
|
}
|
|
54
|
-
|
|
55
42
|
function useWindTheme() {
|
|
56
43
|
var themeVar = useCssVar('--alicloudfe-components-theme') || '';
|
|
57
44
|
return themeVar.indexOf('xconsole') === -1 ? themeVar.indexOf('wind') === -1 ? 'isWind isWidget' : 'isWind' : '';
|
package/lib/utils.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { LogFn } from '@alicloud/console-logger-sls';
|
|
2
1
|
declare const getHistoryTag: () => any;
|
|
3
2
|
declare const setHistoryTag: (newTagList: any) => any;
|
|
4
3
|
declare const removeHistoryTagItem: (tagItem: any) => any;
|
|
@@ -9,6 +8,5 @@ declare const getSelectOptionAdatp: (title: string, list: any) => {
|
|
|
9
8
|
children: any[];
|
|
10
9
|
}[];
|
|
11
10
|
declare const getEnv: () => any;
|
|
12
|
-
declare const getLogger: () => LogFn;
|
|
13
11
|
declare const isValidKey: (key: string | number | symbol, object: object) => key is never;
|
|
14
|
-
export { getHistoryTag, setHistoryTag, removeHistoryTagItem, getTagByFileds, checkNoIndexListFormat, getSelectOptionAdatp, getEnv,
|
|
12
|
+
export { getHistoryTag, setHistoryTag, removeHistoryTagItem, getTagByFileds, checkNoIndexListFormat, getSelectOptionAdatp, getEnv, isValidKey, };
|