@zykj2024/much-library 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +35 -0
  3. package/dist/McCascader/city.js +909 -0
  4. package/dist/McCascader/index.css +60 -0
  5. package/dist/McCascader/index.d.ts +19 -0
  6. package/dist/McCascader/index.js +221 -0
  7. package/dist/McContainer/demo/actionBar.d.ts +8 -0
  8. package/dist/McContainer/demo/actionBar.js +70 -0
  9. package/dist/McContainer/demo/base.d.ts +8 -0
  10. package/dist/McContainer/demo/base.js +80 -0
  11. package/dist/McContainer/demo/batch.d.ts +8 -0
  12. package/dist/McContainer/demo/batch.js +89 -0
  13. package/dist/McContainer/demo/collapse.d.ts +8 -0
  14. package/dist/McContainer/demo/collapse.js +76 -0
  15. package/dist/McContainer/demo/expand.d.ts +8 -0
  16. package/dist/McContainer/demo/expand.js +90 -0
  17. package/dist/McContainer/demo/pagination.d.ts +7 -0
  18. package/dist/McContainer/demo/pagination.js +93 -0
  19. package/dist/McContainer/demo/search.d.ts +7 -0
  20. package/dist/McContainer/demo/search.js +101 -0
  21. package/dist/McContainer/demo/standard.d.ts +7 -0
  22. package/dist/McContainer/demo/standard.js +168 -0
  23. package/dist/McContainer/index.css +123 -0
  24. package/dist/McContainer/index.d.ts +49 -0
  25. package/dist/McContainer/index.js +407 -0
  26. package/dist/McDateRange/demo/base.d.ts +6 -0
  27. package/dist/McDateRange/demo/base.js +22 -0
  28. package/dist/McDateRange/demo/cancelPresets.d.ts +6 -0
  29. package/dist/McDateRange/demo/cancelPresets.js +23 -0
  30. package/dist/McDateRange/demo/overlap.d.ts +2 -0
  31. package/dist/McDateRange/demo/overlap.js +32 -0
  32. package/dist/McDateRange/index.css +31 -0
  33. package/dist/McDateRange/index.d.ts +28 -0
  34. package/dist/McDateRange/index.js +167 -0
  35. package/dist/McFonts/index.d.ts +7 -0
  36. package/dist/McFonts/index.js +10 -0
  37. package/dist/McFonts/public/FF DIN Pro Bold.otf +0 -0
  38. package/dist/McFonts/public/SourceHanSansCN-Bold.otf +0 -0
  39. package/dist/McFonts/public/SourceHanSansCN-Light.otf +0 -0
  40. package/dist/McFonts/public/SourceHanSansCN-Medium.otf +0 -0
  41. package/dist/McFonts/public/SourceHanSansCN-Regular.otf +0 -0
  42. package/dist/McGroupPanel/comps/SelectedItem/index.d.ts +4 -0
  43. package/dist/McGroupPanel/comps/SelectedItem/index.js +76 -0
  44. package/dist/McGroupPanel/index.css +162 -0
  45. package/dist/McGroupPanel/index.d.ts +29 -0
  46. package/dist/McGroupPanel/index.js +411 -0
  47. package/dist/McIconFont/iconfont.js +1 -0
  48. package/dist/McIconFont/index.d.ts +5 -0
  49. package/dist/McIconFont/index.js +8 -0
  50. package/dist/McIcons/business.json +137 -0
  51. package/dist/McInput/Input.d.ts +19 -0
  52. package/dist/McInput/Input.js +48 -0
  53. package/dist/McInput/Search.d.ts +39 -0
  54. package/dist/McInput/Search.js +81 -0
  55. package/dist/McInput/TextArea.d.ts +11 -0
  56. package/dist/McInput/TextArea.js +37 -0
  57. package/dist/McInput/demo/Input/addonBefore.d.ts +3 -0
  58. package/dist/McInput/demo/Input/addonBefore.js +67 -0
  59. package/dist/McInput/demo/Input/base.d.ts +2 -0
  60. package/dist/McInput/demo/Input/base.js +31 -0
  61. package/dist/McInput/demo/Input/isTrim.d.ts +2 -0
  62. package/dist/McInput/demo/Input/isTrim.js +22 -0
  63. package/dist/McInput/demo/Input/label.d.ts +2 -0
  64. package/dist/McInput/demo/Input/label.js +26 -0
  65. package/dist/McInput/demo/Input/ref.d.ts +3 -0
  66. package/dist/McInput/demo/Input/ref.js +53 -0
  67. package/dist/McInput/demo/Input/status.d.ts +2 -0
  68. package/dist/McInput/demo/Input/status.js +23 -0
  69. package/dist/McInput/demo/Search/search-base.d.ts +2 -0
  70. package/dist/McInput/demo/Search/search-base.js +38 -0
  71. package/dist/McInput/demo/TextArea/text-area-base.d.ts +2 -0
  72. package/dist/McInput/demo/TextArea/text-area-base.js +38 -0
  73. package/dist/McInput/index.css +44 -0
  74. package/dist/McInput/index.d.ts +13 -0
  75. package/dist/McInput/index.js +7 -0
  76. package/dist/McInputNumber/demo/index.d.ts +2 -0
  77. package/dist/McInputNumber/demo/index.js +28 -0
  78. package/dist/McInputNumber/demo/label.d.ts +2 -0
  79. package/dist/McInputNumber/demo/label.js +26 -0
  80. package/dist/McInputNumber/demo/precision.d.ts +2 -0
  81. package/dist/McInputNumber/demo/precision.js +20 -0
  82. package/dist/McInputNumber/index.css +9 -0
  83. package/dist/McInputNumber/index.d.ts +13 -0
  84. package/dist/McInputNumber/index.js +43 -0
  85. package/dist/McModalProvider/index.d.ts +174 -0
  86. package/dist/McModalProvider/index.js +498 -0
  87. package/dist/McPeriodSelect/demo/base.d.ts +6 -0
  88. package/dist/McPeriodSelect/demo/base.js +19 -0
  89. package/dist/McPeriodSelect/demo/half.d.ts +6 -0
  90. package/dist/McPeriodSelect/demo/half.js +20 -0
  91. package/dist/McPeriodSelect/index.css +189 -0
  92. package/dist/McPeriodSelect/index.d.ts +13 -0
  93. package/dist/McPeriodSelect/index.js +305 -0
  94. package/dist/McPopoverButton/index.d.ts +14 -0
  95. package/dist/McPopoverButton/index.js +52 -0
  96. package/dist/McPopoverForm/index.d.ts +14 -0
  97. package/dist/McPopoverForm/index.js +95 -0
  98. package/dist/McResult/default.d.ts +1 -0
  99. package/dist/McResult/default.js +84 -0
  100. package/dist/McResult/demo/403.d.ts +6 -0
  101. package/dist/McResult/demo/403.js +17 -0
  102. package/dist/McResult/demo/404.d.ts +6 -0
  103. package/dist/McResult/demo/404.js +17 -0
  104. package/dist/McResult/demo/500.d.ts +6 -0
  105. package/dist/McResult/demo/500.js +17 -0
  106. package/dist/McResult/demo/building.d.ts +6 -0
  107. package/dist/McResult/demo/building.js +12 -0
  108. package/dist/McResult/demo/empty.d.ts +2 -0
  109. package/dist/McResult/demo/empty.js +11 -0
  110. package/dist/McResult/demo/noFunction.d.ts +2 -0
  111. package/dist/McResult/demo/noFunction.js +11 -0
  112. package/dist/McResult/demo/noUser.d.ts +6 -0
  113. package/dist/McResult/demo/noUser.js +12 -0
  114. package/dist/McResult/demo/preview.d.ts +2 -0
  115. package/dist/McResult/demo/preview.js +14 -0
  116. package/dist/McResult/icon.d.ts +25 -0
  117. package/dist/McResult/icon.js +946 -0
  118. package/dist/McResult/index.css +20 -0
  119. package/dist/McResult/index.d.ts +27 -0
  120. package/dist/McResult/index.js +103 -0
  121. package/dist/McResult/public/403.svg +164 -0
  122. package/dist/McResult/public/404.svg +123 -0
  123. package/dist/McResult/public/500.svg +129 -0
  124. package/dist/McResult/public/building.svg +127 -0
  125. package/dist/McResult/public/code403.svg +7 -0
  126. package/dist/McResult/public/code404.svg +5 -0
  127. package/dist/McResult/public/code500.svg +5 -0
  128. package/dist/McResult/public/empty.svg +1 -0
  129. package/dist/McResult/public/noFunction.svg +1 -0
  130. package/dist/McResult/public/noUser.svg +90 -0
  131. package/dist/McSelect/demo/base.d.ts +2 -0
  132. package/dist/McSelect/demo/base.js +63 -0
  133. package/dist/McSelect/demo/changeOnHidden.d.ts +2 -0
  134. package/dist/McSelect/demo/changeOnHidden.js +43 -0
  135. package/dist/McSelect/demo/dropdownRender.d.ts +7 -0
  136. package/dist/McSelect/demo/dropdownRender.js +78 -0
  137. package/dist/McSelect/demo/fetchOptions.d.ts +7 -0
  138. package/dist/McSelect/demo/fetchOptions.js +210 -0
  139. package/dist/McSelect/demo/inexistent.d.ts +2 -0
  140. package/dist/McSelect/demo/inexistent.js +79 -0
  141. package/dist/McSelect/demo/labelInValue.d.ts +2 -0
  142. package/dist/McSelect/demo/labelInValue.js +72 -0
  143. package/dist/McSelect/demo/maxTagCount.d.ts +3 -0
  144. package/dist/McSelect/demo/maxTagCount.js +51 -0
  145. package/dist/McSelect/demo/multiple.d.ts +2 -0
  146. package/dist/McSelect/demo/multiple.js +46 -0
  147. package/dist/McSelect/demo/optionRender.d.ts +3 -0
  148. package/dist/McSelect/demo/optionRender.js +51 -0
  149. package/dist/McSelect/demo/tagRender.d.ts +3 -0
  150. package/dist/McSelect/demo/tagRender.js +51 -0
  151. package/dist/McSelect/index.css +60 -0
  152. package/dist/McSelect/index.d.ts +40 -0
  153. package/dist/McSelect/index.js +350 -0
  154. package/dist/McThemeConfig/customToken.json +38 -0
  155. package/dist/McThemeConfig/demo/button.d.ts +2 -0
  156. package/dist/McThemeConfig/demo/button.js +226 -0
  157. package/dist/McThemeConfig/demo/drawer.d.ts +2 -0
  158. package/dist/McThemeConfig/demo/drawer.js +59 -0
  159. package/dist/McThemeConfig/demo/modal.d.ts +2 -0
  160. package/dist/McThemeConfig/demo/modal.js +78 -0
  161. package/dist/McThemeConfig/demo/radio.d.ts +2 -0
  162. package/dist/McThemeConfig/demo/radio.js +97 -0
  163. package/dist/McThemeConfig/demo/switch.d.ts +2 -0
  164. package/dist/McThemeConfig/demo/switch.js +96 -0
  165. package/dist/McThemeConfig/demo/tabs.d.ts +2 -0
  166. package/dist/McThemeConfig/demo/tabs.js +35 -0
  167. package/dist/McThemeConfig/globalStyle.d.ts +2 -0
  168. package/dist/McThemeConfig/globalStyle.js +172 -0
  169. package/dist/McThemeConfig/index.d.ts +9 -0
  170. package/dist/McThemeConfig/index.js +16 -0
  171. package/dist/McThemeConfig/layoutStyle.d.ts +2 -0
  172. package/dist/McThemeConfig/layoutStyle.js +1 -0
  173. package/dist/McThemeConfig/provider.d.ts +7 -0
  174. package/dist/McThemeConfig/provider.js +19 -0
  175. package/dist/McThemeConfig/themeToken.json +149 -0
  176. package/dist/McTreePanel/SelectedItem.d.ts +4 -0
  177. package/dist/McTreePanel/SelectedItem.js +75 -0
  178. package/dist/McTreePanel/demo/base.d.ts +6 -0
  179. package/dist/McTreePanel/demo/base.js +45 -0
  180. package/dist/McTreePanel/demo/fieldNames.d.ts +6 -0
  181. package/dist/McTreePanel/demo/fieldNames.js +37 -0
  182. package/dist/McTreePanel/demo/inexistent.d.ts +6 -0
  183. package/dist/McTreePanel/demo/inexistent.js +56 -0
  184. package/dist/McTreePanel/demo/labelInValue.d.ts +6 -0
  185. package/dist/McTreePanel/demo/labelInValue.js +56 -0
  186. package/dist/McTreePanel/demo/sortable.d.ts +6 -0
  187. package/dist/McTreePanel/demo/sortable.js +34 -0
  188. package/dist/McTreePanel/index.css +110 -0
  189. package/dist/McTreePanel/index.d.ts +27 -0
  190. package/dist/McTreePanel/index.js +315 -0
  191. package/dist/McTreeSelect/demo/base.d.ts +5 -0
  192. package/dist/McTreeSelect/demo/base.js +58 -0
  193. package/dist/McTreeSelect/demo/inexistent.d.ts +5 -0
  194. package/dist/McTreeSelect/demo/inexistent.js +63 -0
  195. package/dist/McTreeSelect/demo/label.d.ts +5 -0
  196. package/dist/McTreeSelect/demo/label.js +60 -0
  197. package/dist/McTreeSelect/demo/multiple.d.ts +5 -0
  198. package/dist/McTreeSelect/demo/multiple.js +71 -0
  199. package/dist/McTreeSelect/index.css +60 -0
  200. package/dist/McTreeSelect/index.d.ts +13 -0
  201. package/dist/McTreeSelect/index.js +182 -0
  202. package/dist/Utils/index.d.ts +4 -0
  203. package/dist/Utils/index.js +26 -0
  204. package/dist/index.d.ts +19 -0
  205. package/dist/index.js +19 -0
  206. package/dist/typings.d.ts +20 -0
  207. package/package.json +82 -0
@@ -0,0 +1,167 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
4
+ var _excluded = ["style", "className", "label", "valueFormat", "value", "onChange", "onShortcut", "disabled"];
5
+ import { DatePicker } from 'antd';
6
+ import dayjs from 'dayjs';
7
+ import { forwardRef, useEffect, useRef, useState } from 'react';
8
+ import "./index.css";
9
+
10
+ /* 快捷选择日期对应值的映射集合 */
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ import { jsxs as _jsxs } from "react/jsx-runtime";
13
+ var shortcutValueMap = {
14
+ today: [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
15
+ yesterday: [dayjs().add(-1, 'd').format('YYYY-MM-DD'), dayjs().add(-1, 'd').format('YYYY-MM-DD')],
16
+ last7days: [dayjs().add(-6, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
17
+ last30days: [dayjs().add(-29, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
18
+ last60days: [dayjs().add(-59, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')],
19
+ last90days: [dayjs().add(-89, 'd').format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
20
+ };
21
+ export var SHORTCUTprivateValue_MAP = shortcutValueMap;
22
+ var McDateRange = /*#__PURE__*/forwardRef(function (props, ref) {
23
+ var style = props.style,
24
+ className = props.className,
25
+ label = props.label,
26
+ _props$valueFormat = props.valueFormat,
27
+ valueFormat = _props$valueFormat === void 0 ? 'YYYY-MM-DD' : _props$valueFormat,
28
+ value = props.value,
29
+ onChange = props.onChange,
30
+ onShortcut = props.onShortcut,
31
+ disabled = props.disabled,
32
+ rest = _objectWithoutProperties(props, _excluded);
33
+
34
+ /* 获取label宽度 */
35
+ var labelRef = useRef();
36
+ var _useState = useState(11),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ paddingLeft = _useState2[0],
39
+ setPaddingLeft = _useState2[1];
40
+ var labelResizeObserver = new ResizeObserver(function (entries) {
41
+ setPaddingLeft(entries[0].contentRect.width + 11);
42
+ });
43
+ useEffect(function () {
44
+ if (labelRef.current) {
45
+ labelResizeObserver.observe(labelRef.current);
46
+ }
47
+ return function () {
48
+ return labelResizeObserver.disconnect();
49
+ };
50
+ }, []);
51
+ var _useState3 = useState(),
52
+ _useState4 = _slicedToArray(_useState3, 2),
53
+ privateValue = _useState4[0],
54
+ setPrivateValue = _useState4[1];
55
+ var currentRef = useRef();
56
+ var oldRef = useRef();
57
+ var isShortcutRef = useRef(false);
58
+ useEffect(function () {
59
+ var tempValue = value ? value === null || value === void 0 ? void 0 : value.map(function (i) {
60
+ return dayjs(i, valueFormat);
61
+ }) : null;
62
+ setPrivateValue(tempValue);
63
+ currentRef.current = tempValue;
64
+ }, [value]);
65
+ var change = function change(dates) {
66
+ if (!props.hasOwnProperty('value')) {
67
+ setPrivateValue(dates);
68
+ }
69
+ currentRef.current = dates;
70
+ // 当清空时
71
+ if (dates === null) {
72
+ if (props.hasOwnProperty('value')) {
73
+ setPrivateValue(value ? value === null || value === void 0 ? void 0 : value.map(function (i) {
74
+ return dayjs(i, valueFormat);
75
+ }) : null);
76
+ }
77
+ onChange === null || onChange === void 0 || onChange(null);
78
+ onShortcut === null || onShortcut === void 0 || onShortcut(undefined);
79
+ isShortcutRef.current = false;
80
+ }
81
+ };
82
+ var openChange = function openChange(open) {
83
+ if (open) {
84
+ oldRef.current = privateValue;
85
+ } else {
86
+ if (currentRef.current && currentRef.current !== oldRef.current) {
87
+ onChange === null || onChange === void 0 || onChange(currentRef.current.map(function (i) {
88
+ return i.format(valueFormat);
89
+ }), currentRef.current);
90
+ if (!isShortcutRef.current) {
91
+ onShortcut === null || onShortcut === void 0 || onShortcut(undefined);
92
+ }
93
+ isShortcutRef.current = false;
94
+ }
95
+ }
96
+ };
97
+ var shortcut = function shortcut(type) {
98
+ isShortcutRef.current = true;
99
+ onShortcut === null || onShortcut === void 0 || onShortcut(type);
100
+ };
101
+ return /*#__PURE__*/_jsxs("div", {
102
+ style: _objectSpread({
103
+ position: label ? 'relative' : 'static',
104
+ height: 32
105
+ }, style),
106
+ className: "mc-date-range ".concat(className || ''),
107
+ children: [label && /*#__PURE__*/_jsx("span", {
108
+ ref: labelRef,
109
+ className: "mc-date-range__label ".concat(disabled ? 'mc-date-range--disabled' : ''),
110
+ children: label
111
+ }), /*#__PURE__*/_jsx(DatePicker.RangePicker, _objectSpread({
112
+ ref: ref,
113
+ style: {
114
+ paddingLeft: paddingLeft
115
+ },
116
+ className: "mc-date-range__content",
117
+ value: privateValue,
118
+ onChange: change,
119
+ onOpenChange: openChange,
120
+ disabled: disabled,
121
+ presets: [{
122
+ label: /*#__PURE__*/_jsx("div", {
123
+ className: "mc-date-range__preset-label",
124
+ onClick: shortcut.bind(null, 'today'),
125
+ children: "\u4ECA\u5929"
126
+ }),
127
+ value: [dayjs(), dayjs()]
128
+ }, {
129
+ label: /*#__PURE__*/_jsx("div", {
130
+ className: "mc-date-range__preset-label",
131
+ onClick: shortcut === null || shortcut === void 0 ? void 0 : shortcut.bind(null, 'yesterday'),
132
+ children: "\u6628\u5929"
133
+ }),
134
+ value: [dayjs().add(-1, 'd'), dayjs().add(-1, 'd')]
135
+ }, {
136
+ label: /*#__PURE__*/_jsx("div", {
137
+ className: "mc-date-range__preset-label",
138
+ onClick: shortcut === null || shortcut === void 0 ? void 0 : shortcut.bind(null, 'last7days'),
139
+ children: "\u6700\u8FD17\u5929"
140
+ }),
141
+ value: [dayjs().add(-6, 'd'), dayjs()]
142
+ }, {
143
+ label: /*#__PURE__*/_jsx("div", {
144
+ className: "mc-date-range__preset-label",
145
+ onClick: shortcut === null || shortcut === void 0 ? void 0 : shortcut.bind(null, 'last30days'),
146
+ children: "\u6700\u8FD130\u5929"
147
+ }),
148
+ value: [dayjs().add(-29, 'd'), dayjs()]
149
+ }, {
150
+ label: /*#__PURE__*/_jsx("div", {
151
+ className: "mc-date-range__preset-label",
152
+ onClick: shortcut === null || shortcut === void 0 ? void 0 : shortcut.bind(null, 'last60days'),
153
+ children: "\u6700\u8FD160\u5929"
154
+ }),
155
+ value: [dayjs().add(-59, 'd'), dayjs()]
156
+ }, {
157
+ label: /*#__PURE__*/_jsx("div", {
158
+ className: "mc-date-range__preset-label",
159
+ onClick: shortcut === null || shortcut === void 0 ? void 0 : shortcut.bind(null, 'last90days'),
160
+ children: "\u6700\u8FD190\u5929"
161
+ }),
162
+ value: [dayjs().add(-89, 'd'), dayjs()]
163
+ }]
164
+ }, rest))]
165
+ });
166
+ });
167
+ export default McDateRange;
@@ -0,0 +1,7 @@
1
+ declare const _default: {
2
+ Regular: any;
3
+ Bold: any;
4
+ Light: any;
5
+ Medium: any;
6
+ };
7
+ export default _default;
@@ -0,0 +1,10 @@
1
+ import { default as Bold } from "./public/SourceHanSansCN-Bold.otf";
2
+ import { default as Light } from "./public/SourceHanSansCN-Light.otf";
3
+ import { default as Medium } from "./public/SourceHanSansCN-Medium.otf";
4
+ import { default as Regular } from "./public/SourceHanSansCN-Regular.otf";
5
+ export default {
6
+ Regular: Regular,
7
+ Bold: Bold,
8
+ Light: Light,
9
+ Medium: Medium
10
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import '../../index.less';
3
+ declare const _default: import("react").MemoExoticComponent<({ sortable, itemMap, inexistent, text, color, reserved, inexistentItemMap, value, onRemove, }: any) => import("react/jsx-runtime").JSX.Element>;
4
+ export default _default;
@@ -0,0 +1,76 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import { useSortable } from '@dnd-kit/sortable';
3
+ import { Button, Typography } from 'antd';
4
+ import { McIconFont } from "../../..";
5
+ import { memo, useMemo } from 'react';
6
+ import "../../index.css";
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ var SelectedItem = function SelectedItem(_ref) {
10
+ var sortable = _ref.sortable,
11
+ itemMap = _ref.itemMap,
12
+ inexistent = _ref.inexistent,
13
+ text = _ref.text,
14
+ color = _ref.color,
15
+ reserved = _ref.reserved,
16
+ inexistentItemMap = _ref.inexistentItemMap,
17
+ value = _ref.value,
18
+ onRemove = _ref.onRemove;
19
+ var _label = useMemo(function () {
20
+ var _itemMap$value, _inexistentItemMap$va;
21
+ var label = ((_itemMap$value = itemMap[value]) === null || _itemMap$value === void 0 ? void 0 : _itemMap$value.label) || "".concat((_inexistentItemMap$va = inexistentItemMap[value]) === null || _inexistentItemMap$va === void 0 ? void 0 : _inexistentItemMap$va.label).concat(inexistent && !reserved ? "\u300C".concat(text, "\u300D") : '');
22
+ var fn = function fn() {
23
+ var isTooltip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
24
+ return /*#__PURE__*/_jsx("span", {
25
+ style: {
26
+ color: !itemMap[value] && inexistent && !reserved ? color : isTooltip ? '#ffffff' : '#262626'
27
+ },
28
+ children: label
29
+ });
30
+ };
31
+ return fn;
32
+ }, [itemMap, inexistent, text, color, reserved, inexistentItemMap, value]);
33
+ var _useSortable = useSortable({
34
+ id: value
35
+ }),
36
+ setNodeRef = _useSortable.setNodeRef,
37
+ attributes = _useSortable.attributes,
38
+ listeners = _useSortable.listeners,
39
+ transform = _useSortable.transform,
40
+ transition = _useSortable.transition,
41
+ isDragging = _useSortable.isDragging;
42
+ var style = transform ? {
43
+ transform: "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0)"),
44
+ transition: isDragging ? 'unset' : transition
45
+ } : {
46
+ transition: 'unset'
47
+ };
48
+ return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
49
+ ref: setNodeRef,
50
+ style: style
51
+ }, attributes), {}, {
52
+ className: "mc-group-panel__selected-item",
53
+ children: [sortable && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, listeners), {}, {
54
+ className: "mc-group-panel__selected-item__drag",
55
+ type: "text",
56
+ icon: /*#__PURE__*/_jsx(McIconFont, {
57
+ type: "icon-MenuOutlined"
58
+ })
59
+ })), /*#__PURE__*/_jsx(Typography.Paragraph, {
60
+ style: {
61
+ margin: '0 auto 0 4px'
62
+ },
63
+ ellipsis: {
64
+ tooltip: _label(true)
65
+ },
66
+ children: _label()
67
+ }), /*#__PURE__*/_jsx(McIconFont, {
68
+ className: "mc-group-panel__selected-item__remove",
69
+ type: "icon-CloseOutlined",
70
+ onClick: onRemove
71
+ }), !itemMap[value] && reserved && /*#__PURE__*/_jsx("div", {
72
+ className: "mc-group-panel__selected-item--disabled"
73
+ })]
74
+ }));
75
+ };
76
+ export default /*#__PURE__*/memo(SelectedItem);
@@ -0,0 +1,162 @@
1
+ .mc-group-panel {
2
+ width: 100%;
3
+ height: 329px;
4
+ display: -webkit-box;
5
+ display: -ms-flexbox;
6
+ display: flex;
7
+ -webkit-column-gap: 8px;
8
+ -moz-column-gap: 8px;
9
+ column-gap: 8px;
10
+ position: relative;
11
+ }
12
+ .mc-group-panel__card-header {
13
+ height: 40px;
14
+ background: #fafafa;
15
+ padding: 0 16px;
16
+ display: -webkit-box;
17
+ display: -ms-flexbox;
18
+ display: flex;
19
+ -webkit-box-align: center;
20
+ -ms-flex-align: center;
21
+ align-items: center;
22
+ -webkit-box-pack: justify;
23
+ -ms-flex-pack: justify;
24
+ justify-content: space-between;
25
+ }
26
+ .mc-group-panel__card-title {
27
+ color: rgba(0, 0, 0, 0.847);
28
+ font-weight: 600;
29
+ }
30
+ .mc-group-panel__card-body {
31
+ height: calc(100% - 40px);
32
+ padding: 8px;
33
+ }
34
+ .mc-group-panel__options {
35
+ border-radius: 4px;
36
+ border: 1px solid #ebebeb;
37
+ overflow: hidden;
38
+ -webkit-box-flex: 1;
39
+ -ms-flex: 1;
40
+ flex: 1;
41
+ }
42
+ .mc-group-panel__options-wrapper {
43
+ display: -webkit-box;
44
+ display: -ms-flexbox;
45
+ display: flex;
46
+ height: calc(100% - 40px);
47
+ }
48
+ .mc-group-panel__options-groups {
49
+ -webkit-box-flex: 1;
50
+ -ms-flex: 1 1 44%;
51
+ flex: 1 1 44%;
52
+ }
53
+ .mc-group-panel__options-items {
54
+ -webkit-box-flex: 1;
55
+ -ms-flex: 1 1 56%;
56
+ flex: 1 1 56%;
57
+ border-left: 1px solid #ebebeb;
58
+ overflow: auto;
59
+ }
60
+ .mc-group-panel__options-list {
61
+ height: calc(100% - 40px);
62
+ overflow: auto;
63
+ }
64
+ .mc-group-panel__search-bar {
65
+ padding: 0 8px;
66
+ }
67
+ .mc-group-panel__checkbox-wrapper {
68
+ width: calc(100% - 24px);
69
+ height: 40px;
70
+ line-height: 40px;
71
+ padding: 0 12px;
72
+ }
73
+ .mc-group-panel__checkbox-wrapper .ant-checkbox-wrapper {
74
+ max-width: 100%;
75
+ }
76
+ .mc-group-panel__checkbox-wrapper .ant-checkbox-wrapper .ant-checkbox + span {
77
+ overflow: hidden;
78
+ }
79
+ .mc-group-panel__checkbox-wrapper:not(:first-child):hover {
80
+ background: #f6f6f6;
81
+ cursor: pointer;
82
+ }
83
+ .mc-group-panel__checkbox {
84
+ width: calc(100% - 24px);
85
+ height: 40px;
86
+ -webkit-box-align: center;
87
+ -ms-flex-align: center;
88
+ align-items: center;
89
+ padding: 0 12px;
90
+ }
91
+ .mc-group-panel__checkbox .ant-checkbox + span {
92
+ overflow: hidden;
93
+ }
94
+ .mc-group-panel__checkbox:hover {
95
+ background: #f6f6f6;
96
+ }
97
+ .mc-group-panel__selected {
98
+ border-radius: 4px;
99
+ border: 1px solid #ebebeb;
100
+ overflow: hidden;
101
+ width: 240px;
102
+ }
103
+ .mc-group-panel__selected-item {
104
+ width: calc(100% - 16px);
105
+ height: 40px;
106
+ display: -webkit-box;
107
+ display: -ms-flexbox;
108
+ display: flex;
109
+ -webkit-box-align: center;
110
+ -ms-flex-align: center;
111
+ align-items: center;
112
+ padding: 0 8px;
113
+ background: #f5f5f5;
114
+ border-radius: 4px;
115
+ overflow: hidden;
116
+ position: relative;
117
+ }
118
+ .mc-group-panel__selected-item:not(:first-child) {
119
+ margin-top: 8px;
120
+ }
121
+ .mc-group-panel__selected-item__drag {
122
+ -ms-flex-negative: 0;
123
+ flex-shrink: 0;
124
+ color: #8c8c8c;
125
+ padding: 5px 0 3px;
126
+ }
127
+ .mc-group-panel__selected-item__drag:hover {
128
+ background: rgba(38, 38, 38, 0.15) !important;
129
+ cursor: move;
130
+ }
131
+ .mc-group-panel__selected-item__remove {
132
+ -ms-flex-negative: 0;
133
+ flex-shrink: 0;
134
+ color: #8c8c8c;
135
+ margin-left: 8px;
136
+ }
137
+ .mc-group-panel__selected-item__remove:hover {
138
+ cursor: pointer;
139
+ color: #262626;
140
+ }
141
+ .mc-group-panel__selected-item--disabled {
142
+ position: absolute;
143
+ top: 0;
144
+ right: 0;
145
+ bottom: 0;
146
+ left: 0;
147
+ z-index: 9;
148
+ border-radius: 4px;
149
+ background: rgba(246, 246, 246, 0.66);
150
+ cursor: no-drop;
151
+ }
152
+ .mc-group-panel--disabled {
153
+ position: absolute;
154
+ top: 0;
155
+ right: 0;
156
+ bottom: 0;
157
+ left: 0;
158
+ z-index: 9;
159
+ border-radius: 4px;
160
+ background: rgba(228, 228, 228, 0.3);
161
+ cursor: no-drop;
162
+ }
@@ -0,0 +1,29 @@
1
+ import { CSSProperties, FC } from 'react';
2
+ import './index.less';
3
+ type Option = {
4
+ value: any;
5
+ label: string;
6
+ [key: string]: any;
7
+ };
8
+ type Options = Array<Option & {
9
+ children: Option[];
10
+ }>;
11
+ type Inexistent = {
12
+ text?: string;
13
+ color?: string;
14
+ reserved?: boolean;
15
+ };
16
+ type PropsType = {
17
+ style?: CSSProperties;
18
+ className?: string;
19
+ options?: Options;
20
+ disabled?: boolean;
21
+ labelInValue?: boolean;
22
+ inexistent?: boolean | Inexistent;
23
+ sortable?: boolean;
24
+ value?: any[];
25
+ onChange?: (value?: any[]) => void;
26
+ [key: string]: any;
27
+ };
28
+ declare const McGroupPanel: FC<PropsType>;
29
+ export default McGroupPanel;