@teamix/pro 1.2.9 → 1.2.13

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.
Files changed (122) hide show
  1. package/dist/212.js +1 -1
  2. package/dist/pro.css +1 -1
  3. package/dist/pro.js +2103 -993
  4. package/dist/pro.min.css +1 -1
  5. package/dist/pro.min.js +1 -1
  6. package/es/actions/base.d.ts +16 -6
  7. package/es/actions/base.js +66 -12
  8. package/es/actions/confirm.d.ts +1 -1
  9. package/es/actions/danger-confirm.d.ts +1 -1
  10. package/es/actions/dialog-component.d.ts +1 -1
  11. package/es/actions/dialog-form.d.ts +1 -1
  12. package/es/actions/dialog-form.js +2 -2
  13. package/es/actions/dialog-info.d.ts +1 -1
  14. package/es/actions/dialog-table.d.ts +1 -1
  15. package/es/actions/dialog.d.ts +6 -2
  16. package/es/actions/dialog.js +9 -5
  17. package/es/actions/drawer-form.d.ts +1 -1
  18. package/es/actions/drawer-info.d.ts +1 -1
  19. package/es/actions/drawer-table.d.ts +1 -1
  20. package/es/actions/drawer.d.ts +1 -1
  21. package/es/actions/error.d.ts +1 -1
  22. package/es/actions/index.js +9 -5
  23. package/es/actions/index.scss +28 -7
  24. package/es/actions/link.d.ts +2 -2
  25. package/es/actions/link.js +2 -2
  26. package/es/actions/notice.d.ts +1 -1
  27. package/es/actions/request.d.ts +1 -1
  28. package/es/actions/request.js +2 -2
  29. package/es/card/index.d.ts +10 -1
  30. package/es/card/index.js +20 -5
  31. package/es/card/index.scss +19 -0
  32. package/es/card/tab.d.ts +6 -0
  33. package/es/card/tab.js +27 -0
  34. package/es/form/Filter/index.d.ts +2 -5
  35. package/es/form/Filter/index.js +3 -44
  36. package/es/form/Filter/index.scss +71 -0
  37. package/es/form/Filter/index2.d.ts +8 -0
  38. package/es/form/Filter/index2.js +318 -0
  39. package/es/form/ProForm/index.js +3 -23
  40. package/es/form/ProForm/index.scss +10 -19
  41. package/es/form/ProForm/useFormDisplayValues.d.ts +3 -5
  42. package/es/form/ProForm/useFormDisplayValues.js +44 -38
  43. package/es/form/SchemaForm/index.js +7 -6
  44. package/es/form/index.d.ts +11 -10
  45. package/es/form/index.js +3 -2
  46. package/es/form/typing.d.ts +3 -0
  47. package/es/index.d.ts +1 -1
  48. package/es/index.js +1 -1
  49. package/es/info/components/ProInfoItem/index.js +3 -1
  50. package/es/nocode/pages/renderer.d.ts +2 -2
  51. package/es/page-header/index.d.ts +20 -11
  52. package/es/page-header/index.js +23 -47
  53. package/es/page-header/index.scss +0 -11
  54. package/es/table/components/Filter/index.js +11 -9
  55. package/es/table/components/Filter/index.scss +7 -3
  56. package/es/table/components/Layout/index.js +10 -1
  57. package/es/table/index.js +21 -11
  58. package/es/table/typing.d.ts +6 -0
  59. package/es/table/utils/columnRender.js +38 -1
  60. package/es/table/utils/index.js +15 -1
  61. package/es/utils/components/tags/index.d.ts +15 -0
  62. package/es/utils/components/tags/index.js +94 -0
  63. package/es/utils/components/tags/index.scss +12 -0
  64. package/lib/actions/base.d.ts +16 -6
  65. package/lib/actions/base.js +67 -12
  66. package/lib/actions/confirm.d.ts +1 -1
  67. package/lib/actions/danger-confirm.d.ts +1 -1
  68. package/lib/actions/dialog-component.d.ts +1 -1
  69. package/lib/actions/dialog-form.d.ts +1 -1
  70. package/lib/actions/dialog-form.js +2 -2
  71. package/lib/actions/dialog-info.d.ts +1 -1
  72. package/lib/actions/dialog-table.d.ts +1 -1
  73. package/lib/actions/dialog.d.ts +6 -2
  74. package/lib/actions/dialog.js +9 -5
  75. package/lib/actions/drawer-form.d.ts +1 -1
  76. package/lib/actions/drawer-info.d.ts +1 -1
  77. package/lib/actions/drawer-table.d.ts +1 -1
  78. package/lib/actions/drawer.d.ts +1 -1
  79. package/lib/actions/error.d.ts +1 -1
  80. package/lib/actions/index.js +9 -5
  81. package/lib/actions/index.scss +28 -7
  82. package/lib/actions/link.d.ts +2 -2
  83. package/lib/actions/link.js +2 -2
  84. package/lib/actions/notice.d.ts +1 -1
  85. package/lib/actions/request.d.ts +1 -1
  86. package/lib/actions/request.js +2 -2
  87. package/lib/card/index.d.ts +10 -1
  88. package/lib/card/index.js +22 -4
  89. package/lib/card/index.scss +19 -0
  90. package/lib/card/tab.d.ts +6 -0
  91. package/lib/card/tab.js +39 -0
  92. package/lib/form/Filter/index.d.ts +2 -5
  93. package/lib/form/Filter/index.js +4 -45
  94. package/lib/form/Filter/index.scss +71 -0
  95. package/lib/form/Filter/index2.d.ts +8 -0
  96. package/lib/form/Filter/index2.js +342 -0
  97. package/lib/form/ProForm/index.js +3 -23
  98. package/lib/form/ProForm/index.scss +10 -19
  99. package/lib/form/ProForm/useFormDisplayValues.d.ts +3 -5
  100. package/lib/form/ProForm/useFormDisplayValues.js +51 -44
  101. package/lib/form/SchemaForm/index.js +7 -6
  102. package/lib/form/index.d.ts +11 -10
  103. package/lib/form/index.js +5 -3
  104. package/lib/form/typing.d.ts +3 -0
  105. package/lib/index.d.ts +1 -1
  106. package/lib/index.js +1 -1
  107. package/lib/info/components/ProInfoItem/index.js +3 -1
  108. package/lib/nocode/pages/renderer.d.ts +2 -2
  109. package/lib/page-header/index.d.ts +20 -11
  110. package/lib/page-header/index.js +22 -45
  111. package/lib/page-header/index.scss +0 -11
  112. package/lib/table/components/Filter/index.js +10 -8
  113. package/lib/table/components/Filter/index.scss +7 -3
  114. package/lib/table/components/Layout/index.js +10 -1
  115. package/lib/table/index.js +20 -10
  116. package/lib/table/typing.d.ts +6 -0
  117. package/lib/table/utils/columnRender.js +38 -1
  118. package/lib/table/utils/index.js +15 -1
  119. package/lib/utils/components/tags/index.d.ts +15 -0
  120. package/lib/utils/components/tags/index.js +114 -0
  121. package/lib/utils/components/tags/index.scss +12 -0
  122. package/package.json +4 -4
@@ -31,7 +31,8 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
31
31
  // 组件内全局状态
32
32
  var state = {
33
33
  fullScreenState: false,
34
- filterRules: {}
34
+ filterRules: {},
35
+ filterColumns: []
35
36
  }; // 组件内全局监听事件
36
37
 
37
38
  var callback = {
@@ -42,6 +43,15 @@ var mutations = {
42
43
  getState: function getState() {
43
44
  return state;
44
45
  },
46
+ setState: function setState(key, value) {
47
+ state[key] = value;
48
+ useOn(key, value);
49
+
50
+ if (mutations.hasOwnProperty(key)) {
51
+ mutations[key] = value;
52
+ }
53
+ },
54
+ filterColumns: state.filterColumns,
45
55
  setFullScreenState: function setFullScreenState(fullScreenState) {
46
56
  state.fullScreenState = fullScreenState;
47
57
  useOn('fullScreenState', fullScreenState);
@@ -85,6 +95,10 @@ var mutations = {
85
95
  * @param name 监听名(作为销毁唯一id使用)
86
96
  */
87
97
  on: function on(fun, state, name) {
98
+ if (!callback[state]) {
99
+ callback[state] = {};
100
+ }
101
+
88
102
  callback[state][name] = fun;
89
103
  },
90
104
  off: function off(name) {
@@ -0,0 +1,15 @@
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;
@@ -0,0 +1,114 @@
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.renderTags = void 0;
9
+
10
+ var _react = _interopRequireWildcard(require("react"));
11
+
12
+ var _components = require("@alicloudfe/components");
13
+
14
+ var _src = require("../../../../../utils/src");
15
+
16
+ require("./index.scss");
17
+
18
+ var _excluded = ["text", "children", "closable", "color"];
19
+
20
+ 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); }
21
+
22
+ 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; }
23
+
24
+ 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; }
25
+
26
+ 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; }
27
+
28
+ 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; }
29
+
30
+ 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; }
31
+
32
+ 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; }
33
+
34
+ var cls = (0, _src.baseClass)('teamix-pro-tags');
35
+
36
+ var renderTags = function renderTags(tags, size) {
37
+ if (!tags || Array.isArray(tags) && !tags.length) {
38
+ return null;
39
+ } // 获取全局 tag
40
+
41
+
42
+ var getGlobalTag = function getGlobalTag() {
43
+ var globalTag = (0, _src.getGlobalConfig)('tag'); // GlobalTagNodePropsItem 类型
44
+
45
+ if (globalTag) {
46
+ var globalTagMap = new Map(globalTag.map(function (item) {
47
+ return [item.color, item];
48
+ }));
49
+ return globalTagMap;
50
+ }
51
+
52
+ return null;
53
+ }; // 渲染单个 tag
54
+
55
+
56
+ var renderTag = function renderTag(item, index) {
57
+ // @ts-ignore
58
+ var text = item.text,
59
+ children = item.children,
60
+ closable = item.closable,
61
+ colorProps = item.color,
62
+ others = _objectWithoutProperties(item, _excluded);
63
+
64
+ var color = (0, _src.getTagColor)(colorProps !== null && colorProps !== void 0 ? colorProps : '', 'tag');
65
+ var otherProps = {};
66
+ var globalTagMap = getGlobalTag();
67
+
68
+ if (globalTagMap && globalTagMap.get(color)) {
69
+ var _globalTagMap$get;
70
+
71
+ otherProps = (_globalTagMap$get = globalTagMap.get(color)) !== null && _globalTagMap$get !== void 0 ? _globalTagMap$get : {};
72
+ }
73
+
74
+ if (closable) {
75
+ return /*#__PURE__*/_react.default.createElement(_components.Tag.Closeable, _objectSpread(_objectSpread({
76
+ key: index,
77
+ size: size,
78
+ style: {
79
+ marginBottom: 0
80
+ },
81
+ color: color
82
+ }, otherProps), others), text || children);
83
+ }
84
+
85
+ return /*#__PURE__*/_react.default.createElement(_components.Tag, _objectSpread(_objectSpread({
86
+ key: index,
87
+ size: size,
88
+ style: {
89
+ marginBottom: 0
90
+ },
91
+ color: color
92
+ }, otherProps), others), text || children);
93
+ };
94
+
95
+ if (!Array.isArray(tags)) {
96
+ if ( /*#__PURE__*/(0, _react.isValidElement)(tags)) {
97
+ return tags;
98
+ }
99
+
100
+ return renderTag(tags, 0);
101
+ }
102
+
103
+ return /*#__PURE__*/_react.default.createElement(_components.Tag.Group, {
104
+ className: cls('')
105
+ }, tags.map(function (tag, i) {
106
+ if ( /*#__PURE__*/(0, _react.isValidElement)(tags)) {
107
+ return tags;
108
+ }
109
+
110
+ return renderTag(tag, i);
111
+ }));
112
+ };
113
+
114
+ exports.renderTags = renderTags;
@@ -0,0 +1,12 @@
1
+ .teamix-pro-tags {
2
+ display: inline-flex;
3
+ align-items: center;
4
+
5
+ & > div.next-tag {
6
+ margin-right: var(--s-2, 8px);
7
+
8
+ &:last-child {
9
+ margin-right: 0;
10
+ }
11
+ }
12
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamix/pro",
3
- "version": "1.2.9",
3
+ "version": "1.2.13",
4
4
  "description": "TeamixPro大包",
5
5
  "repository": "http://gitlab.alibaba-inc.com/teamix/pro",
6
6
  "author": "Velociraptor(迅猛龙)",
@@ -22,9 +22,9 @@
22
22
  ],
23
23
  "private": false,
24
24
  "dependencies": {
25
- "@formily/core": "2.0.4",
26
- "@formily/react": "2.0.4",
27
- "@teamix/formily": "2.0.4",
25
+ "@formily/core": "2.0.5",
26
+ "@formily/react": "2.0.5",
27
+ "@teamix/formily": "2.0.5",
28
28
  "@teamix/hooks": "^0.1.0",
29
29
  "@teamix/pop-confirm": "^1.2.2",
30
30
  "@teamix/pro-field": "^1.0.0",