@teamix/pro 1.2.13 → 1.2.17
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/212.js +798 -766
- package/dist/pro.css +1 -1
- package/dist/pro.js +1668 -1751
- package/dist/pro.min.css +1 -1
- package/dist/pro.min.js +1 -1
- package/es/actions/dialog-component.js +2 -2
- package/es/actions/dialog-form.js +2 -2
- package/es/actions/dialog.js +5 -3
- package/es/actions/index.d.ts +2 -0
- package/es/actions/index.js +30 -16
- package/es/actions/link.js +2 -2
- package/es/actions/request.js +2 -2
- package/es/actions/utils.js +2 -2
- package/es/card/card-container.js +2 -2
- package/es/card/divider.js +2 -2
- package/es/card/index.d.ts +6 -3
- package/es/card/index.js +11 -6
- package/es/card/index.scss +4 -0
- package/es/card/selectable.js +2 -2
- package/es/card/tab.js +2 -2
- package/es/form/Components/Editable/index.js +2 -2
- package/es/form/Components/FormGroup/index.js +2 -2
- package/es/form/Components/LightFilter/componentMap.d.ts +2 -0
- package/es/form/Components/LightFilter/componentMap.js +5 -0
- package/es/form/Components/LightFilter/index.d.ts +15 -0
- package/es/form/Components/{QueryFilter → LightFilter}/index.js +45 -44
- package/es/form/Components/LightFilter/index.scss +74 -0
- package/es/form/Components/ProField/index.js +2 -2
- package/es/form/Components/Text/index.js +2 -2
- package/es/form/Filter/index.js +4 -4
- package/es/form/Filter/index.scss +0 -46
- package/es/form/Filter/index2.d.ts +1 -1
- package/es/form/Filter/index2.js +163 -115
- package/es/form/Filter/index2.scss +73 -0
- package/es/form/ProForm/index.js +3 -2
- package/es/form/ProForm/index.scss +9 -9
- package/es/form/ProForm/useAutoSubmit.js +2 -2
- package/es/form/ProForm/useFieldRequest.js +2 -2
- package/es/form/ProForm/useFormDisplayValues.js +46 -15
- package/es/form/ProForm/useInitialRequest.js +2 -2
- package/es/form/SchemaForm/adapterType.js +1 -0
- package/es/form/SchemaForm/index.js +5 -5
- package/es/form/SchemaForm/initializeArrayCards.js +2 -2
- package/es/form/SchemaForm/initializeArrayCollapse.js +2 -2
- package/es/form/SchemaForm/initializeArrayItems.js +2 -2
- package/es/form/SchemaForm/initializeArrayTable.js +2 -2
- package/es/form/SchemaForm/initializeFormButton.js +2 -2
- package/es/form/SchemaForm/initializeFormCollapse.js +2 -2
- package/es/form/SchemaForm/initializeFormGroup.js +2 -2
- package/es/form/SchemaForm/initializeFormStep.js +2 -2
- package/es/form/SchemaForm/initializeFormTab.js +2 -2
- package/es/form/SchemaForm/initializeReactions.js +2 -2
- package/es/form/SchemaForm/initializeRules.js +2 -2
- package/es/form/SchemaForm/reactions.js +4 -8
- package/es/form/fieldTypeMap.js +1 -0
- package/es/form/global.scss +1 -0
- package/es/form/index.d.ts +9 -9
- package/es/form/index.js +2 -2
- package/es/form/typing.d.ts +6 -0
- package/es/form/utils.js +2 -2
- package/es/form/warning.js +2 -2
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/info/components/InfoGroup/index.js +2 -2
- package/es/info/components/InfoValueItem/index.js +2 -2
- package/es/info/components/tableInfo/index.js +2 -2
- package/es/info/index.js +2 -2
- package/es/info/utils/index.js +2 -2
- package/es/nocode/configurators/ProTable.js +1 -0
- package/es/nocode/pages/playground.js +2 -2
- package/es/nocode/pages/renderer.js +5 -5
- package/es/nocode/playground.js +2 -2
- package/es/page-header/index.d.ts +1 -2
- package/es/page-header/index.js +4 -14
- package/es/sidebar/components/sidebar-container/index.js +2 -2
- package/es/sidebar/components/tree/index.js +2 -2
- package/es/sidebar/index.js +2 -2
- package/es/table/components/Filter/index.js +44 -18
- package/es/table/components/Layout/index.js +3 -3
- package/es/table/components/QuickAction/index.js +3 -3
- package/es/table/components/ToolBar/FilterColumnIcon.js +54 -19
- package/es/table/components/ToolBar/index.js +2 -2
- package/es/table/components/ToolBar/index.scss +1 -0
- package/es/table/index.js +11 -4
- package/es/table/typing.d.ts +6 -2
- package/es/table/utils/columnRender.js +29 -8
- package/es/table/utils/genProColumnToColumn.js +2 -2
- package/es/table/utils/index.js +9 -3
- package/es/table/utils/useTableSelection.js +2 -2
- package/es/templates/List/index.js +2 -2
- package/es/utils/message.d.ts +1 -1
- package/es/utils/message.js +9 -9
- package/lib/actions/dialog-component.js +2 -2
- package/lib/actions/dialog-form.js +3 -3
- package/lib/actions/dialog.js +6 -4
- package/lib/actions/index.d.ts +2 -0
- package/lib/actions/index.js +30 -16
- package/lib/actions/link.js +2 -2
- package/lib/actions/request.js +2 -2
- package/lib/actions/utils.js +2 -2
- package/lib/card/card-container.js +2 -2
- package/lib/card/divider.js +2 -2
- package/lib/card/index.d.ts +6 -3
- package/lib/card/index.js +11 -6
- package/lib/card/index.scss +4 -0
- package/lib/card/selectable.js +2 -2
- package/lib/card/tab.js +2 -2
- package/lib/field/index.js +1 -1
- package/lib/form/Components/Editable/index.js +3 -3
- package/lib/form/Components/FormGroup/index.js +2 -2
- package/lib/form/Components/LightFilter/componentMap.d.ts +2 -0
- package/lib/form/Components/LightFilter/componentMap.js +12 -0
- package/lib/form/Components/LightFilter/index.d.ts +15 -0
- package/lib/form/Components/{QueryFilter → LightFilter}/index.js +50 -44
- package/lib/form/Components/LightFilter/index.scss +74 -0
- package/lib/form/Components/ProField/index.js +2 -2
- package/lib/form/Components/Text/index.js +2 -2
- package/lib/form/Filter/index.js +5 -5
- package/lib/form/Filter/index.scss +0 -46
- package/lib/form/Filter/index2.d.ts +1 -1
- package/lib/form/Filter/index2.js +165 -115
- package/lib/form/Filter/index2.scss +73 -0
- package/lib/form/ProForm/index.js +4 -3
- package/lib/form/ProForm/index.scss +9 -9
- package/lib/form/ProForm/useAutoSubmit.js +2 -2
- package/lib/form/ProForm/useFieldRequest.js +2 -2
- package/lib/form/ProForm/useFormDisplayValues.js +47 -15
- package/lib/form/ProForm/useInitialRequest.js +2 -2
- package/lib/form/SchemaForm/adapterType.js +1 -0
- package/lib/form/SchemaForm/index.js +6 -6
- package/lib/form/SchemaForm/initializeArrayCards.js +2 -2
- package/lib/form/SchemaForm/initializeArrayCollapse.js +2 -2
- package/lib/form/SchemaForm/initializeArrayItems.js +2 -2
- package/lib/form/SchemaForm/initializeArrayTable.js +2 -2
- package/lib/form/SchemaForm/initializeFormButton.js +2 -2
- package/lib/form/SchemaForm/initializeFormCollapse.js +2 -2
- package/lib/form/SchemaForm/initializeFormGroup.js +2 -2
- package/lib/form/SchemaForm/initializeFormStep.js +2 -2
- package/lib/form/SchemaForm/initializeFormTab.js +2 -2
- package/lib/form/SchemaForm/initializeReactions.js +2 -2
- package/lib/form/SchemaForm/initializeRules.js +2 -2
- package/lib/form/SchemaForm/reactions.js +3 -7
- package/lib/form/fieldTypeMap.js +1 -0
- package/lib/form/global.scss +1 -0
- package/lib/form/index.d.ts +9 -9
- package/lib/form/index.js +3 -3
- package/lib/form/typing.d.ts +6 -0
- package/lib/form/utils.js +2 -2
- package/lib/form/warning.js +2 -2
- package/lib/hooks/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/info/components/InfoGroup/index.js +3 -3
- package/lib/info/components/InfoValueItem/index.js +3 -3
- package/lib/info/components/tableInfo/index.js +3 -3
- package/lib/info/index.js +3 -3
- package/lib/info/utils/index.js +2 -2
- package/lib/nocode/configurators/ProTable.js +1 -0
- package/lib/nocode/configurators/index.js +1 -1
- package/lib/nocode/pages/playground.js +3 -3
- package/lib/nocode/pages/renderer.js +5 -5
- package/lib/nocode/playground.js +3 -3
- package/lib/page-container/index.js +1 -1
- package/lib/page-header/index.d.ts +1 -2
- package/lib/page-header/index.js +6 -17
- package/lib/sidebar/components/sidebar-container/index.js +2 -2
- package/lib/sidebar/components/tree/index.js +3 -3
- package/lib/sidebar/index.js +3 -3
- package/lib/skeleton/index.js +1 -1
- package/lib/table/components/Filter/index.js +45 -19
- package/lib/table/components/Layout/index.js +3 -3
- package/lib/table/components/QuickAction/index.js +3 -3
- package/lib/table/components/ToolBar/DensityIcon.js +1 -1
- package/lib/table/components/ToolBar/FilterColumnIcon.js +55 -20
- package/lib/table/components/ToolBar/FullScreenIcon.js +1 -1
- package/lib/table/components/ToolBar/Fullscreen.js +1 -1
- package/lib/table/components/ToolBar/index.js +2 -2
- package/lib/table/components/ToolBar/index.scss +1 -0
- package/lib/table/index.js +11 -4
- package/lib/table/typing.d.ts +6 -2
- package/lib/table/utils/columnRender.js +29 -8
- package/lib/table/utils/genProColumnToColumn.js +2 -2
- package/lib/table/utils/index.js +9 -3
- package/lib/table/utils/useTableSelection.js +2 -2
- package/lib/templates/List/index.js +3 -3
- package/lib/utils/index.js +1 -1
- package/lib/utils/message.d.ts +1 -1
- package/lib/utils/message.js +9 -9
- package/package.json +2 -2
- package/es/form/Components/Query/index.d.ts +0 -4
- package/es/form/Components/Query/index.js +0 -70
- package/es/form/Components/Query/index.scss +0 -85
- package/es/form/Components/QueryFilter/index.d.ts +0 -3
- package/es/utils/components/tags/index.d.ts +0 -15
- package/es/utils/components/tags/index.js +0 -94
- package/es/utils/components/tags/index.scss +0 -12
- package/lib/form/Components/Query/index.d.ts +0 -4
- package/lib/form/Components/Query/index.js +0 -91
- package/lib/form/Components/Query/index.scss +0 -85
- package/lib/form/Components/QueryFilter/index.d.ts +0 -3
- package/lib/utils/components/tags/index.d.ts +0 -15
- package/lib/utils/components/tags/index.js +0 -114
- package/lib/utils/components/tags/index.scss +0 -12
package/lib/utils/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
4
4
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
6
6
|
value: true
|
package/lib/utils/message.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
import { MessageProps } from '@alicloudfe/components/types/message';
|
2
2
|
export declare type ProMessageProps = MessageProps | string;
|
3
|
-
export declare const renderProMessage: (message
|
3
|
+
export declare const renderProMessage: (message?: ProMessageProps | undefined, defaultProps?: MessageProps | undefined) => JSX.Element | null;
|
package/lib/utils/message.js
CHANGED
@@ -11,22 +11,22 @@ var _components = require("@alicloudfe/components");
|
|
11
11
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
13
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
14
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
15
15
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
16
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
17
17
|
|
18
18
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
19
19
|
|
20
|
-
var renderProMessage = function renderProMessage(message) {
|
20
|
+
var renderProMessage = function renderProMessage(message, defaultProps) {
|
21
|
+
if (!message) {
|
22
|
+
return null;
|
23
|
+
}
|
24
|
+
|
21
25
|
if (typeof message === 'string') {
|
22
|
-
return /*#__PURE__*/_react.default.createElement(_components.Message, {
|
23
|
-
type: "notice"
|
24
|
-
}, message);
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_components.Message, _objectSpread({}, defaultProps), message);
|
25
27
|
}
|
26
28
|
|
27
|
-
return /*#__PURE__*/_react.default.createElement(_components.Message, _objectSpread({
|
28
|
-
type: "notice"
|
29
|
-
}, message));
|
29
|
+
return /*#__PURE__*/_react.default.createElement(_components.Message, _objectSpread(_objectSpread({}, defaultProps), message));
|
30
30
|
};
|
31
31
|
|
32
32
|
exports.renderProMessage = renderProMessage;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@teamix/pro",
|
3
|
-
"version": "1.2.
|
3
|
+
"version": "1.2.17",
|
4
4
|
"description": "TeamixPro大包",
|
5
5
|
"repository": "http://gitlab.alibaba-inc.com/teamix/pro",
|
6
6
|
"author": "Velociraptor(迅猛龙)",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
"dependencies": {
|
25
25
|
"@formily/core": "2.0.5",
|
26
26
|
"@formily/react": "2.0.5",
|
27
|
-
"@teamix/formily": "2.0.5",
|
27
|
+
"@teamix/formily": "2.0.5-1",
|
28
28
|
"@teamix/hooks": "^0.1.0",
|
29
29
|
"@teamix/pop-confirm": "^1.2.2",
|
30
30
|
"@teamix/pro-field": "^1.0.0",
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import React, { memo } from 'react';
|
2
|
-
import { Tag, Select } from '@alicloudfe/components';
|
3
|
-
import cls from 'classnames';
|
4
|
-
import { usePrefixCls, isArr, isObj } from '@teamix/utils';
|
5
|
-
import './index.scss';
|
6
|
-
var TagGroup = Tag.Group,
|
7
|
-
CloseableTag = Tag.Closeable;
|
8
|
-
var TagText = /*#__PURE__*/memo(function (_ref) {
|
9
|
-
var tagPrefixCls = _ref.tagPrefixCls,
|
10
|
-
title = _ref.title,
|
11
|
-
content = _ref.content;
|
12
|
-
var prefixCls = "".concat(tagPrefixCls, "-tag");
|
13
|
-
return /*#__PURE__*/React.createElement("span", {
|
14
|
-
className: prefixCls
|
15
|
-
}, /*#__PURE__*/React.createElement("span", {
|
16
|
-
className: "".concat(prefixCls, "-title")
|
17
|
-
}, title), /*#__PURE__*/React.createElement("span", {
|
18
|
-
className: "".concat(prefixCls, "-content")
|
19
|
-
}, function () {
|
20
|
-
if (isArr(content)) {
|
21
|
-
return content.join(', ');
|
22
|
-
}
|
23
|
-
|
24
|
-
if (isObj(content)) {
|
25
|
-
return /*#__PURE__*/React.createElement(TagText, {
|
26
|
-
tagPrefixCls: tagPrefixCls,
|
27
|
-
title: content.title,
|
28
|
-
content: content.content
|
29
|
-
});
|
30
|
-
}
|
31
|
-
|
32
|
-
return content;
|
33
|
-
}()));
|
34
|
-
});
|
35
|
-
var Query = /*#__PURE__*/memo(function (_ref2) {
|
36
|
-
var size = _ref2.size,
|
37
|
-
tags = _ref2.tags,
|
38
|
-
filterItems = _ref2.filterItems,
|
39
|
-
onFilterItemsChange = _ref2.onFilterItemsChange,
|
40
|
-
children = _ref2.children;
|
41
|
-
var defaultCls = usePrefixCls();
|
42
|
-
var prefixCls = usePrefixCls('filter');
|
43
|
-
return /*#__PURE__*/React.createElement("span", {
|
44
|
-
className: cls(prefixCls, "".concat(defaultCls).concat(size))
|
45
|
-
}, /*#__PURE__*/React.createElement(TagGroup, null, tags === null || tags === void 0 ? void 0 : tags.map(function (_ref3) {
|
46
|
-
var key = _ref3.key,
|
47
|
-
title = _ref3.title,
|
48
|
-
content = _ref3.content;
|
49
|
-
return /*#__PURE__*/React.createElement(CloseableTag, {
|
50
|
-
key: key,
|
51
|
-
onClose: function onClose() {
|
52
|
-
console.log('onClose', key);
|
53
|
-
return false;
|
54
|
-
}
|
55
|
-
}, /*#__PURE__*/React.createElement(TagText, {
|
56
|
-
tagPrefixCls: prefixCls,
|
57
|
-
title: title,
|
58
|
-
content: content
|
59
|
-
}));
|
60
|
-
})), /*#__PURE__*/React.createElement(Select, {
|
61
|
-
className: "".concat(prefixCls, "-select"),
|
62
|
-
placeholder: "\u8BF7\u6DFB\u52A0\u7B5B\u9009\u6761\u4EF6",
|
63
|
-
dataSource: filterItems,
|
64
|
-
onChange: onFilterItemsChange
|
65
|
-
}), children);
|
66
|
-
});
|
67
|
-
Query.defaultProps = {
|
68
|
-
size: 'medium'
|
69
|
-
};
|
70
|
-
export default Query;
|
@@ -1,85 +0,0 @@
|
|
1
|
-
@import '../../global.scss';
|
2
|
-
|
3
|
-
// Query样式
|
4
|
-
.#{$css-prefix}filter {
|
5
|
-
display: flex;
|
6
|
-
width: 100%;
|
7
|
-
box-sizing: border-box;
|
8
|
-
|
9
|
-
border-color: var(--input-focus-border-color, #ababab);
|
10
|
-
border-style: solid;
|
11
|
-
transition: box-shadow var(--active-transition);
|
12
|
-
&:hover {
|
13
|
-
box-shadow: var(--active-shadow);
|
14
|
-
}
|
15
|
-
.#{$css-prefix}filter-tag {
|
16
|
-
.#{$css-prefix}filter-tag-title {
|
17
|
-
margin-right: 8px;
|
18
|
-
color: var(--color-text1-8, #848484);
|
19
|
-
}
|
20
|
-
.#{$css-prefix}filter-tag-content {
|
21
|
-
color: var(--color-text1-3, #333333);
|
22
|
-
.#{$css-prefix}filter-tag-title {
|
23
|
-
margin-right: 0;
|
24
|
-
color: var(--color-text1-3, #333333);
|
25
|
-
font-weight: bold;
|
26
|
-
&::after {
|
27
|
-
position: relative;
|
28
|
-
top: -0.5px;
|
29
|
-
content: ':';
|
30
|
-
margin: 0 4px 0 4px;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
// 表单项选择模块
|
37
|
-
.#{$css-prefix}filter-select {
|
38
|
-
min-width: auto;
|
39
|
-
.#{$css-prefix}input {
|
40
|
-
min-width: auto;
|
41
|
-
border: 0;
|
42
|
-
.#{$css-prefix}input-text-field {
|
43
|
-
padding-right: 0;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
.#{$css-prefix}input.#{$css-prefix}medium {
|
47
|
-
height: $noborder-font-weight-medium;
|
48
|
-
}
|
49
|
-
.#{$css-prefix}input-control {
|
50
|
-
display: none;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
// Query尺寸
|
56
|
-
.#{$css-prefix}filter.#{$css-prefix}medium {
|
57
|
-
padding: 0 8px;
|
58
|
-
height: var(--search-normal-normal-m-height, 32px);
|
59
|
-
border-width: var(--search-normal-normal-border-width, 1px);
|
60
|
-
border-radius: var(--search-normal-corner, 2px);
|
61
|
-
.#{$css-prefix}tag-group {
|
62
|
-
.#{$css-prefix}tag-medium {
|
63
|
-
margin: 3px 4px 3px 0;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
// Query无边框模式
|
69
|
-
.#{$form-item-cls}-bordered-none {
|
70
|
-
.#{$form-item-cls}-control {
|
71
|
-
.#{$form-item-cls}-control-content {
|
72
|
-
.#{$form-item-cls}-control-content-component {
|
73
|
-
min-height: $noborder-font-weight-medium;
|
74
|
-
.#{$css-prefix}date-picker2-input {
|
75
|
-
border: 0;
|
76
|
-
box-shadow: none !important;
|
77
|
-
}
|
78
|
-
.#{$css-prefix}date-picker2-input.#{$css-prefix}date-picker2-input-medium,
|
79
|
-
.#{$css-prefix}input.#{$css-prefix}medium {
|
80
|
-
height: $noborder-font-weight-medium;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
|
3
|
-
import './index.scss';
|
4
|
-
export declare type ProTagItem = (TagProps | (CloseableProps & {
|
5
|
-
closable: true;
|
6
|
-
})) & {
|
7
|
-
/**
|
8
|
-
* @deprecated 建议使用 children 代替
|
9
|
-
*/
|
10
|
-
text?: string;
|
11
|
-
};
|
12
|
-
export declare type ProTagProps = ProTagItem[] | ProTagItem | React.ReactNode | React.ReactNode[];
|
13
|
-
/** 全局注册 tag 配置 */
|
14
|
-
export declare type GlobalTagProps = ProTagItem[];
|
15
|
-
export declare const renderTags: (tags?: ProTagProps, size?: "small" | "medium" | "large" | undefined) => JSX.Element | null;
|
@@ -1,94 +0,0 @@
|
|
1
|
-
var _excluded = ["text", "children", "closable", "color"];
|
2
|
-
|
3
|
-
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; }
|
4
|
-
|
5
|
-
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) { _defineProperty(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; }
|
6
|
-
|
7
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8
|
-
|
9
|
-
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; }
|
10
|
-
|
11
|
-
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; }
|
12
|
-
|
13
|
-
import React, { isValidElement } from 'react';
|
14
|
-
import { Tag } from '@alicloudfe/components';
|
15
|
-
import { baseClass, getTagColor, getGlobalConfig } from '../../../../../utils/src';
|
16
|
-
import './index.scss';
|
17
|
-
var cls = baseClass('teamix-pro-tags');
|
18
|
-
export var renderTags = function renderTags(tags, size) {
|
19
|
-
if (!tags || Array.isArray(tags) && !tags.length) {
|
20
|
-
return null;
|
21
|
-
} // 获取全局 tag
|
22
|
-
|
23
|
-
|
24
|
-
var getGlobalTag = function getGlobalTag() {
|
25
|
-
var globalTag = getGlobalConfig('tag'); // GlobalTagNodePropsItem 类型
|
26
|
-
|
27
|
-
if (globalTag) {
|
28
|
-
var globalTagMap = new Map(globalTag.map(function (item) {
|
29
|
-
return [item.color, item];
|
30
|
-
}));
|
31
|
-
return globalTagMap;
|
32
|
-
}
|
33
|
-
|
34
|
-
return null;
|
35
|
-
}; // 渲染单个 tag
|
36
|
-
|
37
|
-
|
38
|
-
var renderTag = function renderTag(item, index) {
|
39
|
-
// @ts-ignore
|
40
|
-
var text = item.text,
|
41
|
-
children = item.children,
|
42
|
-
closable = item.closable,
|
43
|
-
colorProps = item.color,
|
44
|
-
others = _objectWithoutProperties(item, _excluded);
|
45
|
-
|
46
|
-
var color = getTagColor(colorProps !== null && colorProps !== void 0 ? colorProps : '', 'tag');
|
47
|
-
var otherProps = {};
|
48
|
-
var globalTagMap = getGlobalTag();
|
49
|
-
|
50
|
-
if (globalTagMap && globalTagMap.get(color)) {
|
51
|
-
var _globalTagMap$get;
|
52
|
-
|
53
|
-
otherProps = (_globalTagMap$get = globalTagMap.get(color)) !== null && _globalTagMap$get !== void 0 ? _globalTagMap$get : {};
|
54
|
-
}
|
55
|
-
|
56
|
-
if (closable) {
|
57
|
-
return /*#__PURE__*/React.createElement(Tag.Closeable, _objectSpread(_objectSpread({
|
58
|
-
key: index,
|
59
|
-
size: size,
|
60
|
-
style: {
|
61
|
-
marginBottom: 0
|
62
|
-
},
|
63
|
-
color: color
|
64
|
-
}, otherProps), others), text || children);
|
65
|
-
}
|
66
|
-
|
67
|
-
return /*#__PURE__*/React.createElement(Tag, _objectSpread(_objectSpread({
|
68
|
-
key: index,
|
69
|
-
size: size,
|
70
|
-
style: {
|
71
|
-
marginBottom: 0
|
72
|
-
},
|
73
|
-
color: color
|
74
|
-
}, otherProps), others), text || children);
|
75
|
-
};
|
76
|
-
|
77
|
-
if (!Array.isArray(tags)) {
|
78
|
-
if ( /*#__PURE__*/isValidElement(tags)) {
|
79
|
-
return tags;
|
80
|
-
}
|
81
|
-
|
82
|
-
return renderTag(tags, 0);
|
83
|
-
}
|
84
|
-
|
85
|
-
return /*#__PURE__*/React.createElement(Tag.Group, {
|
86
|
-
className: cls('')
|
87
|
-
}, tags.map(function (tag, i) {
|
88
|
-
if ( /*#__PURE__*/isValidElement(tags)) {
|
89
|
-
return tags;
|
90
|
-
}
|
91
|
-
|
92
|
-
return renderTag(tag, i);
|
93
|
-
}));
|
94
|
-
};
|
@@ -1,91 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
4
|
-
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
6
|
-
value: true
|
7
|
-
});
|
8
|
-
exports.default = void 0;
|
9
|
-
|
10
|
-
var _react = _interopRequireWildcard(require("react"));
|
11
|
-
|
12
|
-
var _components = require("@alicloudfe/components");
|
13
|
-
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
-
|
16
|
-
var _utils = require("@teamix/utils");
|
17
|
-
|
18
|
-
require("./index.scss");
|
19
|
-
|
20
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
21
|
-
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
|
-
|
24
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
25
|
-
|
26
|
-
var TagGroup = _components.Tag.Group,
|
27
|
-
CloseableTag = _components.Tag.Closeable;
|
28
|
-
var TagText = /*#__PURE__*/(0, _react.memo)(function (_ref) {
|
29
|
-
var tagPrefixCls = _ref.tagPrefixCls,
|
30
|
-
title = _ref.title,
|
31
|
-
content = _ref.content;
|
32
|
-
var prefixCls = "".concat(tagPrefixCls, "-tag");
|
33
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
34
|
-
className: prefixCls
|
35
|
-
}, /*#__PURE__*/_react.default.createElement("span", {
|
36
|
-
className: "".concat(prefixCls, "-title")
|
37
|
-
}, title), /*#__PURE__*/_react.default.createElement("span", {
|
38
|
-
className: "".concat(prefixCls, "-content")
|
39
|
-
}, function () {
|
40
|
-
if ((0, _utils.isArr)(content)) {
|
41
|
-
return content.join(', ');
|
42
|
-
}
|
43
|
-
|
44
|
-
if ((0, _utils.isObj)(content)) {
|
45
|
-
return /*#__PURE__*/_react.default.createElement(TagText, {
|
46
|
-
tagPrefixCls: tagPrefixCls,
|
47
|
-
title: content.title,
|
48
|
-
content: content.content
|
49
|
-
});
|
50
|
-
}
|
51
|
-
|
52
|
-
return content;
|
53
|
-
}()));
|
54
|
-
});
|
55
|
-
var Query = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
56
|
-
var size = _ref2.size,
|
57
|
-
tags = _ref2.tags,
|
58
|
-
filterItems = _ref2.filterItems,
|
59
|
-
onFilterItemsChange = _ref2.onFilterItemsChange,
|
60
|
-
children = _ref2.children;
|
61
|
-
var defaultCls = (0, _utils.usePrefixCls)();
|
62
|
-
var prefixCls = (0, _utils.usePrefixCls)('filter');
|
63
|
-
return /*#__PURE__*/_react.default.createElement("span", {
|
64
|
-
className: (0, _classnames.default)(prefixCls, "".concat(defaultCls).concat(size))
|
65
|
-
}, /*#__PURE__*/_react.default.createElement(TagGroup, null, tags === null || tags === void 0 ? void 0 : tags.map(function (_ref3) {
|
66
|
-
var key = _ref3.key,
|
67
|
-
title = _ref3.title,
|
68
|
-
content = _ref3.content;
|
69
|
-
return /*#__PURE__*/_react.default.createElement(CloseableTag, {
|
70
|
-
key: key,
|
71
|
-
onClose: function onClose() {
|
72
|
-
console.log('onClose', key);
|
73
|
-
return false;
|
74
|
-
}
|
75
|
-
}, /*#__PURE__*/_react.default.createElement(TagText, {
|
76
|
-
tagPrefixCls: prefixCls,
|
77
|
-
title: title,
|
78
|
-
content: content
|
79
|
-
}));
|
80
|
-
})), /*#__PURE__*/_react.default.createElement(_components.Select, {
|
81
|
-
className: "".concat(prefixCls, "-select"),
|
82
|
-
placeholder: "\u8BF7\u6DFB\u52A0\u7B5B\u9009\u6761\u4EF6",
|
83
|
-
dataSource: filterItems,
|
84
|
-
onChange: onFilterItemsChange
|
85
|
-
}), children);
|
86
|
-
});
|
87
|
-
Query.defaultProps = {
|
88
|
-
size: 'medium'
|
89
|
-
};
|
90
|
-
var _default = Query;
|
91
|
-
exports.default = _default;
|
@@ -1,85 +0,0 @@
|
|
1
|
-
@import '../../global.scss';
|
2
|
-
|
3
|
-
// Query样式
|
4
|
-
.#{$css-prefix}filter {
|
5
|
-
display: flex;
|
6
|
-
width: 100%;
|
7
|
-
box-sizing: border-box;
|
8
|
-
|
9
|
-
border-color: var(--input-focus-border-color, #ababab);
|
10
|
-
border-style: solid;
|
11
|
-
transition: box-shadow var(--active-transition);
|
12
|
-
&:hover {
|
13
|
-
box-shadow: var(--active-shadow);
|
14
|
-
}
|
15
|
-
.#{$css-prefix}filter-tag {
|
16
|
-
.#{$css-prefix}filter-tag-title {
|
17
|
-
margin-right: 8px;
|
18
|
-
color: var(--color-text1-8, #848484);
|
19
|
-
}
|
20
|
-
.#{$css-prefix}filter-tag-content {
|
21
|
-
color: var(--color-text1-3, #333333);
|
22
|
-
.#{$css-prefix}filter-tag-title {
|
23
|
-
margin-right: 0;
|
24
|
-
color: var(--color-text1-3, #333333);
|
25
|
-
font-weight: bold;
|
26
|
-
&::after {
|
27
|
-
position: relative;
|
28
|
-
top: -0.5px;
|
29
|
-
content: ':';
|
30
|
-
margin: 0 4px 0 4px;
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
|
36
|
-
// 表单项选择模块
|
37
|
-
.#{$css-prefix}filter-select {
|
38
|
-
min-width: auto;
|
39
|
-
.#{$css-prefix}input {
|
40
|
-
min-width: auto;
|
41
|
-
border: 0;
|
42
|
-
.#{$css-prefix}input-text-field {
|
43
|
-
padding-right: 0;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
.#{$css-prefix}input.#{$css-prefix}medium {
|
47
|
-
height: $noborder-font-weight-medium;
|
48
|
-
}
|
49
|
-
.#{$css-prefix}input-control {
|
50
|
-
display: none;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
}
|
54
|
-
|
55
|
-
// Query尺寸
|
56
|
-
.#{$css-prefix}filter.#{$css-prefix}medium {
|
57
|
-
padding: 0 8px;
|
58
|
-
height: var(--search-normal-normal-m-height, 32px);
|
59
|
-
border-width: var(--search-normal-normal-border-width, 1px);
|
60
|
-
border-radius: var(--search-normal-corner, 2px);
|
61
|
-
.#{$css-prefix}tag-group {
|
62
|
-
.#{$css-prefix}tag-medium {
|
63
|
-
margin: 3px 4px 3px 0;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
}
|
67
|
-
|
68
|
-
// Query无边框模式
|
69
|
-
.#{$form-item-cls}-bordered-none {
|
70
|
-
.#{$form-item-cls}-control {
|
71
|
-
.#{$form-item-cls}-control-content {
|
72
|
-
.#{$form-item-cls}-control-content-component {
|
73
|
-
min-height: $noborder-font-weight-medium;
|
74
|
-
.#{$css-prefix}date-picker2-input {
|
75
|
-
border: 0;
|
76
|
-
box-shadow: none !important;
|
77
|
-
}
|
78
|
-
.#{$css-prefix}date-picker2-input.#{$css-prefix}date-picker2-input-medium,
|
79
|
-
.#{$css-prefix}input.#{$css-prefix}medium {
|
80
|
-
height: $noborder-font-weight-medium;
|
81
|
-
}
|
82
|
-
}
|
83
|
-
}
|
84
|
-
}
|
85
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { TagProps, CloseableProps } from '@alicloudfe/components/types/tag';
|
3
|
-
import './index.scss';
|
4
|
-
export declare type ProTagItem = (TagProps | (CloseableProps & {
|
5
|
-
closable: true;
|
6
|
-
})) & {
|
7
|
-
/**
|
8
|
-
* @deprecated 建议使用 children 代替
|
9
|
-
*/
|
10
|
-
text?: string;
|
11
|
-
};
|
12
|
-
export declare type ProTagProps = ProTagItem[] | ProTagItem | React.ReactNode | React.ReactNode[];
|
13
|
-
/** 全局注册 tag 配置 */
|
14
|
-
export declare type GlobalTagProps = ProTagItem[];
|
15
|
-
export declare const renderTags: (tags?: ProTagProps, size?: "small" | "medium" | "large" | undefined) => JSX.Element | null;
|