@zykj2024/much-library 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/McCascader/city.js +909 -0
- package/dist/McCascader/index.css +60 -0
- package/dist/McCascader/index.d.ts +19 -0
- package/dist/McCascader/index.js +221 -0
- package/dist/McContainer/demo/actionBar.d.ts +8 -0
- package/dist/McContainer/demo/actionBar.js +70 -0
- package/dist/McContainer/demo/base.d.ts +8 -0
- package/dist/McContainer/demo/base.js +80 -0
- package/dist/McContainer/demo/batch.d.ts +8 -0
- package/dist/McContainer/demo/batch.js +89 -0
- package/dist/McContainer/demo/collapse.d.ts +8 -0
- package/dist/McContainer/demo/collapse.js +76 -0
- package/dist/McContainer/demo/expand.d.ts +8 -0
- package/dist/McContainer/demo/expand.js +90 -0
- package/dist/McContainer/demo/pagination.d.ts +7 -0
- package/dist/McContainer/demo/pagination.js +93 -0
- package/dist/McContainer/demo/search.d.ts +7 -0
- package/dist/McContainer/demo/search.js +101 -0
- package/dist/McContainer/demo/standard.d.ts +7 -0
- package/dist/McContainer/demo/standard.js +168 -0
- package/dist/McContainer/index.css +123 -0
- package/dist/McContainer/index.d.ts +49 -0
- package/dist/McContainer/index.js +407 -0
- package/dist/McDateRange/demo/base.d.ts +6 -0
- package/dist/McDateRange/demo/base.js +22 -0
- package/dist/McDateRange/demo/cancelPresets.d.ts +6 -0
- package/dist/McDateRange/demo/cancelPresets.js +23 -0
- package/dist/McDateRange/demo/overlap.d.ts +2 -0
- package/dist/McDateRange/demo/overlap.js +32 -0
- package/dist/McDateRange/index.css +31 -0
- package/dist/McDateRange/index.d.ts +28 -0
- package/dist/McDateRange/index.js +167 -0
- package/dist/McFonts/index.d.ts +7 -0
- package/dist/McFonts/index.js +10 -0
- package/dist/McFonts/public/FF DIN Pro Bold.otf +0 -0
- package/dist/McFonts/public/SourceHanSansCN-Bold.otf +0 -0
- package/dist/McFonts/public/SourceHanSansCN-Light.otf +0 -0
- package/dist/McFonts/public/SourceHanSansCN-Medium.otf +0 -0
- package/dist/McFonts/public/SourceHanSansCN-Regular.otf +0 -0
- package/dist/McGroupPanel/comps/SelectedItem/index.d.ts +4 -0
- package/dist/McGroupPanel/comps/SelectedItem/index.js +76 -0
- package/dist/McGroupPanel/index.css +162 -0
- package/dist/McGroupPanel/index.d.ts +29 -0
- package/dist/McGroupPanel/index.js +411 -0
- package/dist/McIconFont/iconfont.js +1 -0
- package/dist/McIconFont/index.d.ts +5 -0
- package/dist/McIconFont/index.js +8 -0
- package/dist/McIcons/business.json +137 -0
- package/dist/McInput/Input.d.ts +19 -0
- package/dist/McInput/Input.js +48 -0
- package/dist/McInput/Search.d.ts +39 -0
- package/dist/McInput/Search.js +81 -0
- package/dist/McInput/TextArea.d.ts +11 -0
- package/dist/McInput/TextArea.js +37 -0
- package/dist/McInput/demo/Input/addonBefore.d.ts +3 -0
- package/dist/McInput/demo/Input/addonBefore.js +67 -0
- package/dist/McInput/demo/Input/base.d.ts +2 -0
- package/dist/McInput/demo/Input/base.js +31 -0
- package/dist/McInput/demo/Input/isTrim.d.ts +2 -0
- package/dist/McInput/demo/Input/isTrim.js +22 -0
- package/dist/McInput/demo/Input/label.d.ts +2 -0
- package/dist/McInput/demo/Input/label.js +26 -0
- package/dist/McInput/demo/Input/ref.d.ts +3 -0
- package/dist/McInput/demo/Input/ref.js +53 -0
- package/dist/McInput/demo/Input/status.d.ts +2 -0
- package/dist/McInput/demo/Input/status.js +23 -0
- package/dist/McInput/demo/Search/search-base.d.ts +2 -0
- package/dist/McInput/demo/Search/search-base.js +38 -0
- package/dist/McInput/demo/TextArea/text-area-base.d.ts +2 -0
- package/dist/McInput/demo/TextArea/text-area-base.js +38 -0
- package/dist/McInput/index.css +44 -0
- package/dist/McInput/index.d.ts +13 -0
- package/dist/McInput/index.js +7 -0
- package/dist/McInputNumber/demo/index.d.ts +2 -0
- package/dist/McInputNumber/demo/index.js +28 -0
- package/dist/McInputNumber/demo/label.d.ts +2 -0
- package/dist/McInputNumber/demo/label.js +26 -0
- package/dist/McInputNumber/demo/precision.d.ts +2 -0
- package/dist/McInputNumber/demo/precision.js +20 -0
- package/dist/McInputNumber/index.css +9 -0
- package/dist/McInputNumber/index.d.ts +13 -0
- package/dist/McInputNumber/index.js +43 -0
- package/dist/McModalProvider/index.d.ts +174 -0
- package/dist/McModalProvider/index.js +498 -0
- package/dist/McPeriodSelect/demo/base.d.ts +6 -0
- package/dist/McPeriodSelect/demo/base.js +19 -0
- package/dist/McPeriodSelect/demo/half.d.ts +6 -0
- package/dist/McPeriodSelect/demo/half.js +20 -0
- package/dist/McPeriodSelect/index.css +189 -0
- package/dist/McPeriodSelect/index.d.ts +13 -0
- package/dist/McPeriodSelect/index.js +305 -0
- package/dist/McPopoverButton/index.d.ts +14 -0
- package/dist/McPopoverButton/index.js +52 -0
- package/dist/McPopoverForm/index.d.ts +14 -0
- package/dist/McPopoverForm/index.js +95 -0
- package/dist/McResult/default.d.ts +1 -0
- package/dist/McResult/default.js +84 -0
- package/dist/McResult/demo/403.d.ts +6 -0
- package/dist/McResult/demo/403.js +17 -0
- package/dist/McResult/demo/404.d.ts +6 -0
- package/dist/McResult/demo/404.js +17 -0
- package/dist/McResult/demo/500.d.ts +6 -0
- package/dist/McResult/demo/500.js +17 -0
- package/dist/McResult/demo/building.d.ts +6 -0
- package/dist/McResult/demo/building.js +12 -0
- package/dist/McResult/demo/empty.d.ts +2 -0
- package/dist/McResult/demo/empty.js +11 -0
- package/dist/McResult/demo/noFunction.d.ts +2 -0
- package/dist/McResult/demo/noFunction.js +11 -0
- package/dist/McResult/demo/noUser.d.ts +6 -0
- package/dist/McResult/demo/noUser.js +12 -0
- package/dist/McResult/demo/preview.d.ts +2 -0
- package/dist/McResult/demo/preview.js +14 -0
- package/dist/McResult/icon.d.ts +25 -0
- package/dist/McResult/icon.js +946 -0
- package/dist/McResult/index.css +20 -0
- package/dist/McResult/index.d.ts +27 -0
- package/dist/McResult/index.js +103 -0
- package/dist/McResult/public/403.svg +164 -0
- package/dist/McResult/public/404.svg +123 -0
- package/dist/McResult/public/500.svg +129 -0
- package/dist/McResult/public/building.svg +127 -0
- package/dist/McResult/public/code403.svg +7 -0
- package/dist/McResult/public/code404.svg +5 -0
- package/dist/McResult/public/code500.svg +5 -0
- package/dist/McResult/public/empty.svg +1 -0
- package/dist/McResult/public/noFunction.svg +1 -0
- package/dist/McResult/public/noUser.svg +90 -0
- package/dist/McSelect/demo/base.d.ts +2 -0
- package/dist/McSelect/demo/base.js +63 -0
- package/dist/McSelect/demo/changeOnHidden.d.ts +2 -0
- package/dist/McSelect/demo/changeOnHidden.js +43 -0
- package/dist/McSelect/demo/dropdownRender.d.ts +7 -0
- package/dist/McSelect/demo/dropdownRender.js +78 -0
- package/dist/McSelect/demo/fetchOptions.d.ts +7 -0
- package/dist/McSelect/demo/fetchOptions.js +210 -0
- package/dist/McSelect/demo/inexistent.d.ts +2 -0
- package/dist/McSelect/demo/inexistent.js +79 -0
- package/dist/McSelect/demo/labelInValue.d.ts +2 -0
- package/dist/McSelect/demo/labelInValue.js +72 -0
- package/dist/McSelect/demo/maxTagCount.d.ts +3 -0
- package/dist/McSelect/demo/maxTagCount.js +51 -0
- package/dist/McSelect/demo/multiple.d.ts +2 -0
- package/dist/McSelect/demo/multiple.js +46 -0
- package/dist/McSelect/demo/optionRender.d.ts +3 -0
- package/dist/McSelect/demo/optionRender.js +51 -0
- package/dist/McSelect/demo/tagRender.d.ts +3 -0
- package/dist/McSelect/demo/tagRender.js +51 -0
- package/dist/McSelect/index.css +60 -0
- package/dist/McSelect/index.d.ts +40 -0
- package/dist/McSelect/index.js +350 -0
- package/dist/McThemeConfig/customToken.json +38 -0
- package/dist/McThemeConfig/demo/button.d.ts +2 -0
- package/dist/McThemeConfig/demo/button.js +226 -0
- package/dist/McThemeConfig/demo/drawer.d.ts +2 -0
- package/dist/McThemeConfig/demo/drawer.js +59 -0
- package/dist/McThemeConfig/demo/modal.d.ts +2 -0
- package/dist/McThemeConfig/demo/modal.js +78 -0
- package/dist/McThemeConfig/demo/radio.d.ts +2 -0
- package/dist/McThemeConfig/demo/radio.js +97 -0
- package/dist/McThemeConfig/demo/switch.d.ts +2 -0
- package/dist/McThemeConfig/demo/switch.js +96 -0
- package/dist/McThemeConfig/demo/tabs.d.ts +2 -0
- package/dist/McThemeConfig/demo/tabs.js +35 -0
- package/dist/McThemeConfig/globalStyle.d.ts +2 -0
- package/dist/McThemeConfig/globalStyle.js +172 -0
- package/dist/McThemeConfig/index.d.ts +9 -0
- package/dist/McThemeConfig/index.js +16 -0
- package/dist/McThemeConfig/layoutStyle.d.ts +2 -0
- package/dist/McThemeConfig/layoutStyle.js +1 -0
- package/dist/McThemeConfig/provider.d.ts +7 -0
- package/dist/McThemeConfig/provider.js +19 -0
- package/dist/McThemeConfig/themeToken.json +149 -0
- package/dist/McTreePanel/SelectedItem.d.ts +4 -0
- package/dist/McTreePanel/SelectedItem.js +75 -0
- package/dist/McTreePanel/demo/base.d.ts +6 -0
- package/dist/McTreePanel/demo/base.js +45 -0
- package/dist/McTreePanel/demo/fieldNames.d.ts +6 -0
- package/dist/McTreePanel/demo/fieldNames.js +37 -0
- package/dist/McTreePanel/demo/inexistent.d.ts +6 -0
- package/dist/McTreePanel/demo/inexistent.js +56 -0
- package/dist/McTreePanel/demo/labelInValue.d.ts +6 -0
- package/dist/McTreePanel/demo/labelInValue.js +56 -0
- package/dist/McTreePanel/demo/sortable.d.ts +6 -0
- package/dist/McTreePanel/demo/sortable.js +34 -0
- package/dist/McTreePanel/index.css +110 -0
- package/dist/McTreePanel/index.d.ts +27 -0
- package/dist/McTreePanel/index.js +315 -0
- package/dist/McTreeSelect/demo/base.d.ts +5 -0
- package/dist/McTreeSelect/demo/base.js +58 -0
- package/dist/McTreeSelect/demo/inexistent.d.ts +5 -0
- package/dist/McTreeSelect/demo/inexistent.js +63 -0
- package/dist/McTreeSelect/demo/label.d.ts +5 -0
- package/dist/McTreeSelect/demo/label.js +60 -0
- package/dist/McTreeSelect/demo/multiple.d.ts +5 -0
- package/dist/McTreeSelect/demo/multiple.js +71 -0
- package/dist/McTreeSelect/index.css +60 -0
- package/dist/McTreeSelect/index.d.ts +13 -0
- package/dist/McTreeSelect/index.js +182 -0
- package/dist/Utils/index.d.ts +4 -0
- package/dist/Utils/index.js +26 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/typings.d.ts +20 -0
- package/package.json +82 -0
@@ -0,0 +1,149 @@
|
|
1
|
+
{
|
2
|
+
"token": {
|
3
|
+
"colorPrimary": "#325cf7",
|
4
|
+
"colorInfo": "#325cf7",
|
5
|
+
"colorSuccess": "#3aaf00",
|
6
|
+
"colorTextBase": "#262626",
|
7
|
+
"borderRadius": 4,
|
8
|
+
"colorText": "#262626",
|
9
|
+
"colorTextSecondary": "#595959",
|
10
|
+
"colorTextTertiary": "#8c8c8c",
|
11
|
+
"colorTextQuaternary": "#b3b3b3"
|
12
|
+
},
|
13
|
+
"components": {
|
14
|
+
"Button": {
|
15
|
+
"defaultActiveBg": "rgb(228, 230, 232)",
|
16
|
+
"defaultActiveBorderColor": "rgb(228, 230, 232)",
|
17
|
+
"defaultActiveColor": "rgb(50, 92, 247)",
|
18
|
+
"defaultHoverBg": "rgb(240, 242, 245)",
|
19
|
+
"defaultColor": "rgb(38, 38, 38)",
|
20
|
+
"defaultBg": "rgb(240, 242, 245)",
|
21
|
+
"defaultBorderColor": "rgb(240, 242, 245)",
|
22
|
+
"defaultHoverBorderColor": "rgb(240, 242, 245)",
|
23
|
+
"defaultHoverColor": "rgb(50, 92, 247)",
|
24
|
+
"groupBorderColor": "rgb(50, 92, 247)",
|
25
|
+
"textHoverBg": "rgb(245, 245, 245)",
|
26
|
+
"colorTextDisabled": "rgb(183, 179, 179)",
|
27
|
+
"contentFontSizeSM": 12,
|
28
|
+
"paddingInline": 16,
|
29
|
+
"paddingInlineLG": 16,
|
30
|
+
"paddingInlineSM": 12,
|
31
|
+
"colorText": "rgb(38, 38, 38)",
|
32
|
+
"borderColorDisabled": "rgb(245, 245, 245)",
|
33
|
+
"dangerShadow": "",
|
34
|
+
"defaultShadow": "",
|
35
|
+
"primaryShadow": ""
|
36
|
+
},
|
37
|
+
"Divider": {
|
38
|
+
"colorText": "rgb(38, 38, 38)",
|
39
|
+
"colorTextHeading": "rgb(38, 38, 38)",
|
40
|
+
"colorSplit": "rgb(235, 235, 235)"
|
41
|
+
},
|
42
|
+
"Anchor": {
|
43
|
+
"colorSplit": "rgb(235, 235, 235)",
|
44
|
+
"colorText": "rgb(38, 38, 38)"
|
45
|
+
},
|
46
|
+
"Breadcrumb": {
|
47
|
+
"lastItemColor": "rgb(0, 0, 0)",
|
48
|
+
"itemColor": "rgb(140, 140, 140)"
|
49
|
+
},
|
50
|
+
"Form": {
|
51
|
+
"labelColor": "rgb(38, 38, 38)"
|
52
|
+
},
|
53
|
+
"Input": {
|
54
|
+
"activeBg": "rgb(240, 242, 245)",
|
55
|
+
"hoverBg": "rgb(240, 242, 245)",
|
56
|
+
"colorBgContainer": "rgb(240, 242, 245)",
|
57
|
+
"hoverBorderColor": "rgb(50, 92, 247)",
|
58
|
+
"colorBgContainerDisabled": "rgba(240, 242, 245, 0.5)",
|
59
|
+
"colorBorder": "rgba(240, 242, 245, 0)",
|
60
|
+
"paddingBlockLG": 8,
|
61
|
+
"paddingInlineSM": 8,
|
62
|
+
"addonBg": "rgb(240, 242, 245)",
|
63
|
+
"colorTextPlaceholder": "rgb(140, 140, 140)",
|
64
|
+
"colorTextQuaternary": "rgb(179, 179, 179)"
|
65
|
+
},
|
66
|
+
"InputNumber": {
|
67
|
+
"activeBg": "rgb(240, 242, 245)",
|
68
|
+
"activeBorderColor": "rgb(50, 92, 247)",
|
69
|
+
"addonBg": "rgb(240, 242, 245)",
|
70
|
+
"filledHandleBg": "rgb(240, 242, 245)",
|
71
|
+
"handleBorderColor": "rgb(240, 242, 245)",
|
72
|
+
"hoverBg": "rgb(240, 242, 245)",
|
73
|
+
"hoverBorderColor": "rgb(50, 92, 247)",
|
74
|
+
"handleHoverColor": "rgb(50, 92, 247)",
|
75
|
+
"colorBgContainer": "rgb(240, 242, 245)",
|
76
|
+
"colorBorder": "rgba(240, 242, 245, 0)",
|
77
|
+
"colorBgContainerDisabled": "rgba(240, 242, 245, 0.5)",
|
78
|
+
"colorTextDisabled": "rgb(179, 179, 179)"
|
79
|
+
},
|
80
|
+
"Mentions": {
|
81
|
+
"activeBg": "rgb(240, 242, 245)",
|
82
|
+
"addonBg": "rgb(240, 242, 245)",
|
83
|
+
"hoverBg": "rgb(240, 242, 245)",
|
84
|
+
"colorBgContainer": "rgb(240, 242, 245)",
|
85
|
+
"colorBorder": "rgb(240, 242, 245)",
|
86
|
+
"hoverBorderColor": "rgb(50, 92, 247)",
|
87
|
+
"activeBorderColor": "rgb(50, 92, 247)"
|
88
|
+
},
|
89
|
+
"Radio": {
|
90
|
+
"buttonBg": "rgba(240, 242, 245)",
|
91
|
+
"buttonColor": "rgb(38, 38, 38)",
|
92
|
+
"buttonCheckedBg": "rgba(255, 255, 255, 0.1)",
|
93
|
+
"buttonCheckedBgDisabled": "rgba(255, 255, 255, 0.1)",
|
94
|
+
"buttonCheckedColorDisabled": "rgb(179, 179, 179)",
|
95
|
+
"colorBgContainerDisabled": "rgb(245, 245, 245)"
|
96
|
+
},
|
97
|
+
"Select": {
|
98
|
+
"selectorBg": "rgb(240, 242, 245)",
|
99
|
+
"colorBgContainer": "rgb(240, 242, 245)",
|
100
|
+
"colorBorder": "rgba(240, 242, 245, 0)",
|
101
|
+
"multipleItemBg": "rgb(255, 255, 255)",
|
102
|
+
"multipleSelectorBgDisabled": "rgb(255, 255, 255)",
|
103
|
+
"optionActiveBg": "rgb(240, 242, 245)",
|
104
|
+
"colorTextPlaceholder": "rgb(140, 140, 140)",
|
105
|
+
"colorTextDisabled": "rgb(179, 179, 179)",
|
106
|
+
"multipleItemColorDisabled": "rgb(179, 179, 179)",
|
107
|
+
"optionSelectedColor": "rgb(38, 38, 38)",
|
108
|
+
"colorBgContainerDisabled": "rgba(240, 242, 245, 0.5)"
|
109
|
+
},
|
110
|
+
"DatePicker": {
|
111
|
+
"cellHoverBg": "rgb(240, 242, 245)",
|
112
|
+
"hoverBg": "rgb(240, 242, 245)",
|
113
|
+
"activeBg": "rgb(240, 242, 245)",
|
114
|
+
"colorBgContainer": "rgb(240, 242, 245)",
|
115
|
+
"colorBorder": "rgba(240, 242, 245, 0)",
|
116
|
+
"hoverBorderColor": "rgb(50, 92, 247)",
|
117
|
+
"cellBgDisabled": "rgba(240, 242, 245, 0.5)",
|
118
|
+
"multipleItemColorDisabled": "rgb(179, 179, 179)",
|
119
|
+
"colorBgContainerDisabled": "rgba(240, 242, 245, 0.5)"
|
120
|
+
},
|
121
|
+
"Cascader": {
|
122
|
+
"colorBgContainerDisabled": "rgba(240, 242, 245, 0.5)",
|
123
|
+
"colorSplit": "rgba(5, 5, 5, 0)",
|
124
|
+
"colorBorder": "rgba(217, 217, 217, 0)"
|
125
|
+
},
|
126
|
+
"Switch": {
|
127
|
+
"handleShadow": "-1px 0px 2px 0px rgba(0, 0, 0, 0.1)",
|
128
|
+
"trackPadding": 3,
|
129
|
+
"trackHeight": 24,
|
130
|
+
"trackHeightSM": 20,
|
131
|
+
"handleSizeSM": 14,
|
132
|
+
"innerMaxMargin": 25,
|
133
|
+
"innerMinMargin": 9,
|
134
|
+
"trackMinWidthSM": 36
|
135
|
+
},
|
136
|
+
"Tabs": {
|
137
|
+
"horizontalItemGutter": 24,
|
138
|
+
"horizontalItemPadding": "5px 16px 9px",
|
139
|
+
"cardBg": "#F0F4F9",
|
140
|
+
"cardGutter": 0,
|
141
|
+
"cardHeight": 44,
|
142
|
+
"cardPadding": "11px 32px"
|
143
|
+
},
|
144
|
+
"Pagination": {
|
145
|
+
"itemActiveBg": "#325CF7",
|
146
|
+
"itemSizeSM": 22
|
147
|
+
}
|
148
|
+
}
|
149
|
+
}
|
@@ -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,75 @@
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
2
|
+
import { useSortable } from '@dnd-kit/sortable';
|
3
|
+
import { Button, Typography } from 'antd';
|
4
|
+
import { MenuOutlined } from 'much-icons';
|
5
|
+
import { McIconFont } from "./..";
|
6
|
+
import { memo, useMemo } from 'react';
|
7
|
+
import "./index.css";
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
+
var SelectedItem = function SelectedItem(_ref) {
|
11
|
+
var sortable = _ref.sortable,
|
12
|
+
itemMap = _ref.itemMap,
|
13
|
+
inexistent = _ref.inexistent,
|
14
|
+
text = _ref.text,
|
15
|
+
color = _ref.color,
|
16
|
+
reserved = _ref.reserved,
|
17
|
+
inexistentItemMap = _ref.inexistentItemMap,
|
18
|
+
value = _ref.value,
|
19
|
+
onRemove = _ref.onRemove;
|
20
|
+
var _label = useMemo(function () {
|
21
|
+
var _itemMap$value, _inexistentItemMap$va;
|
22
|
+
var label = ((_itemMap$value = itemMap[value]) === null || _itemMap$value === void 0 ? void 0 : _itemMap$value.title) || "".concat((_inexistentItemMap$va = inexistentItemMap[value]) === null || _inexistentItemMap$va === void 0 ? void 0 : _inexistentItemMap$va.title).concat(inexistent && !reserved ? "\u300C".concat(text, "\u300D") : '');
|
23
|
+
var fn = function fn() {
|
24
|
+
var isTooltip = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
25
|
+
return /*#__PURE__*/_jsx("span", {
|
26
|
+
style: {
|
27
|
+
color: !itemMap[value] && inexistent && !reserved ? color : isTooltip ? '#ffffff' : '#262626'
|
28
|
+
},
|
29
|
+
children: label
|
30
|
+
});
|
31
|
+
};
|
32
|
+
return fn;
|
33
|
+
}, [itemMap, inexistent, text, color, reserved, inexistentItemMap, value]);
|
34
|
+
var _useSortable = useSortable({
|
35
|
+
id: value
|
36
|
+
}),
|
37
|
+
setNodeRef = _useSortable.setNodeRef,
|
38
|
+
attributes = _useSortable.attributes,
|
39
|
+
listeners = _useSortable.listeners,
|
40
|
+
transform = _useSortable.transform,
|
41
|
+
transition = _useSortable.transition,
|
42
|
+
isDragging = _useSortable.isDragging;
|
43
|
+
var style = transform ? {
|
44
|
+
transform: "translate3d(".concat(transform.x, "px, ").concat(transform.y, "px, 0)"),
|
45
|
+
transition: isDragging ? 'unset' : transition
|
46
|
+
} : {
|
47
|
+
transition: 'unset'
|
48
|
+
};
|
49
|
+
return /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
|
50
|
+
ref: setNodeRef,
|
51
|
+
style: style
|
52
|
+
}, attributes), {}, {
|
53
|
+
className: "mc-tree-panel__selected-item",
|
54
|
+
children: [sortable && /*#__PURE__*/_jsx(Button, _objectSpread(_objectSpread({}, listeners), {}, {
|
55
|
+
className: "mc-tree-panel__selected-item__drag",
|
56
|
+
type: "text",
|
57
|
+
icon: /*#__PURE__*/_jsx(MenuOutlined, {})
|
58
|
+
})), /*#__PURE__*/_jsx(Typography.Paragraph, {
|
59
|
+
style: {
|
60
|
+
margin: '0 auto 0 4px'
|
61
|
+
},
|
62
|
+
ellipsis: {
|
63
|
+
tooltip: _label(true)
|
64
|
+
},
|
65
|
+
children: _label()
|
66
|
+
}), /*#__PURE__*/_jsx(McIconFont, {
|
67
|
+
className: "mc-tree-panel__selected-item__remove",
|
68
|
+
type: "icon-CloseOutlined",
|
69
|
+
onClick: onRemove
|
70
|
+
}), !itemMap[value] && reserved && /*#__PURE__*/_jsx("div", {
|
71
|
+
className: "mc-group-panel__selected-item--disabled"
|
72
|
+
})]
|
73
|
+
}));
|
74
|
+
};
|
75
|
+
export default /*#__PURE__*/memo(SelectedItem);
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/**
|
2
|
+
* title: 基本使用
|
3
|
+
* description: 设置 `disabled` 为 `true` 则禁止编辑
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { Space } from 'antd';
|
7
|
+
import { McTreePanel } from "../..";
|
8
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
9
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
10
|
+
export default (function () {
|
11
|
+
var options = [{
|
12
|
+
title: '部门1',
|
13
|
+
key: 1,
|
14
|
+
children: [{
|
15
|
+
title: '部门1-1',
|
16
|
+
key: 11
|
17
|
+
}, {
|
18
|
+
title: '部门1-2',
|
19
|
+
key: 12
|
20
|
+
}]
|
21
|
+
}, {
|
22
|
+
title: '部门2',
|
23
|
+
key: 2,
|
24
|
+
children: [{
|
25
|
+
title: '部门2-1',
|
26
|
+
key: 21
|
27
|
+
}, {
|
28
|
+
title: '部门2-2',
|
29
|
+
key: 22
|
30
|
+
}]
|
31
|
+
}];
|
32
|
+
return /*#__PURE__*/_jsxs(Space, {
|
33
|
+
direction: "vertical",
|
34
|
+
size: 16,
|
35
|
+
style: {
|
36
|
+
width: '100%'
|
37
|
+
},
|
38
|
+
children: [/*#__PURE__*/_jsx(McTreePanel, {
|
39
|
+
treeData: options
|
40
|
+
}), /*#__PURE__*/_jsx(McTreePanel, {
|
41
|
+
disabled: true,
|
42
|
+
treeData: options
|
43
|
+
})]
|
44
|
+
});
|
45
|
+
});
|
@@ -0,0 +1,37 @@
|
|
1
|
+
/**
|
2
|
+
* title: 使用 fieldNames
|
3
|
+
* description: 设置 `fieldNames` 来自定义节点 title、key、children 的字段
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { McTreePanel } from "../..";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
export default (function () {
|
9
|
+
var options = [{
|
10
|
+
label: '部门1',
|
11
|
+
value: 1,
|
12
|
+
children: [{
|
13
|
+
label: '部门1-1',
|
14
|
+
value: 11
|
15
|
+
}, {
|
16
|
+
label: '部门1-2',
|
17
|
+
value: 12
|
18
|
+
}]
|
19
|
+
}, {
|
20
|
+
label: '部门2',
|
21
|
+
value: 2,
|
22
|
+
children: [{
|
23
|
+
label: '部门2-1',
|
24
|
+
value: 21
|
25
|
+
}, {
|
26
|
+
label: '部门2-2',
|
27
|
+
value: 22
|
28
|
+
}]
|
29
|
+
}];
|
30
|
+
return /*#__PURE__*/_jsx(McTreePanel, {
|
31
|
+
treeData: options,
|
32
|
+
fieldNames: {
|
33
|
+
title: 'label',
|
34
|
+
key: 'value'
|
35
|
+
}
|
36
|
+
});
|
37
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
+
/**
|
3
|
+
* title: 不存在值的回显
|
4
|
+
* description: 设置 `inexistent` 为 `true` 处理不存在值的回显
|
5
|
+
*/
|
6
|
+
|
7
|
+
import { Col, Space } from 'antd';
|
8
|
+
import { McTreePanel } from "../..";
|
9
|
+
import { useState } from 'react';
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
12
|
+
export default (function () {
|
13
|
+
var _useState = useState([100]),
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
15
|
+
value = _useState2[0],
|
16
|
+
setValue = _useState2[1];
|
17
|
+
var options = [{
|
18
|
+
title: '部门1',
|
19
|
+
key: 1,
|
20
|
+
children: [{
|
21
|
+
title: '部门1-1',
|
22
|
+
key: 11
|
23
|
+
}, {
|
24
|
+
title: '部门1-2',
|
25
|
+
key: 12
|
26
|
+
}]
|
27
|
+
}, {
|
28
|
+
title: '部门2',
|
29
|
+
key: 2,
|
30
|
+
children: [{
|
31
|
+
title: '部门2-1',
|
32
|
+
key: 21
|
33
|
+
}, {
|
34
|
+
title: '部门2-2',
|
35
|
+
key: 22
|
36
|
+
}]
|
37
|
+
}];
|
38
|
+
var handelChange = function handelChange(v) {
|
39
|
+
setValue(v);
|
40
|
+
};
|
41
|
+
return /*#__PURE__*/_jsxs(Space, {
|
42
|
+
direction: "vertical",
|
43
|
+
size: 16,
|
44
|
+
style: {
|
45
|
+
width: '100%'
|
46
|
+
},
|
47
|
+
children: [/*#__PURE__*/_jsxs(Col, {
|
48
|
+
children: ["\u5F53\u524D\u503C\uFF1A", JSON.stringify(value !== null && value !== void 0 ? value : [])]
|
49
|
+
}), /*#__PURE__*/_jsx(McTreePanel, {
|
50
|
+
treeData: options,
|
51
|
+
value: value,
|
52
|
+
inexistent: true,
|
53
|
+
onChange: handelChange
|
54
|
+
})]
|
55
|
+
});
|
56
|
+
});
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
2
|
+
/**
|
3
|
+
* title: 使用 labelInValue
|
4
|
+
* description: 设置 `labelInValue` 为 `true` 把每个选项的title等信息包装到value中
|
5
|
+
*/
|
6
|
+
|
7
|
+
import { Col, Space } from 'antd';
|
8
|
+
import { McTreePanel } from "../..";
|
9
|
+
import { useState } from 'react';
|
10
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
12
|
+
export default (function () {
|
13
|
+
var _useState = useState([]),
|
14
|
+
_useState2 = _slicedToArray(_useState, 2),
|
15
|
+
value = _useState2[0],
|
16
|
+
setValue = _useState2[1];
|
17
|
+
var options = [{
|
18
|
+
title: '部门1',
|
19
|
+
key: 1,
|
20
|
+
children: [{
|
21
|
+
title: '部门1-1',
|
22
|
+
key: 11
|
23
|
+
}, {
|
24
|
+
title: '部门1-2',
|
25
|
+
key: 12
|
26
|
+
}]
|
27
|
+
}, {
|
28
|
+
title: '部门2',
|
29
|
+
key: 2,
|
30
|
+
children: [{
|
31
|
+
title: '部门2-1',
|
32
|
+
key: 21
|
33
|
+
}, {
|
34
|
+
title: '部门2-2',
|
35
|
+
key: 22
|
36
|
+
}]
|
37
|
+
}];
|
38
|
+
var handelChange = function handelChange(v) {
|
39
|
+
setValue(v);
|
40
|
+
};
|
41
|
+
return /*#__PURE__*/_jsxs(Space, {
|
42
|
+
direction: "vertical",
|
43
|
+
size: 16,
|
44
|
+
style: {
|
45
|
+
width: '100%'
|
46
|
+
},
|
47
|
+
children: [/*#__PURE__*/_jsxs(Col, {
|
48
|
+
children: ["\u5F53\u524D\u503C\uFF1A", JSON.stringify(value !== null && value !== void 0 ? value : [])]
|
49
|
+
}), /*#__PURE__*/_jsx(McTreePanel, {
|
50
|
+
treeData: options,
|
51
|
+
labelInValue: true,
|
52
|
+
value: value,
|
53
|
+
onChange: handelChange
|
54
|
+
})]
|
55
|
+
});
|
56
|
+
});
|
@@ -0,0 +1,34 @@
|
|
1
|
+
/**
|
2
|
+
* title: 已选项拖拽排序
|
3
|
+
* description: 设置 `sortable` 为 `true` 实现已选项可拖拽排序
|
4
|
+
*/
|
5
|
+
|
6
|
+
import { McTreePanel } from "../..";
|
7
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
8
|
+
export default (function () {
|
9
|
+
var options = [{
|
10
|
+
title: '部门1',
|
11
|
+
key: 1,
|
12
|
+
children: [{
|
13
|
+
title: '部门1-1',
|
14
|
+
key: 11
|
15
|
+
}, {
|
16
|
+
title: '部门1-2',
|
17
|
+
key: 12
|
18
|
+
}]
|
19
|
+
}, {
|
20
|
+
title: '部门2',
|
21
|
+
key: 2,
|
22
|
+
children: [{
|
23
|
+
title: '部门2-1',
|
24
|
+
key: 21
|
25
|
+
}, {
|
26
|
+
title: '部门2-2',
|
27
|
+
key: 22
|
28
|
+
}]
|
29
|
+
}];
|
30
|
+
return /*#__PURE__*/_jsx(McTreePanel, {
|
31
|
+
treeData: options,
|
32
|
+
sortable: true
|
33
|
+
});
|
34
|
+
});
|
@@ -0,0 +1,110 @@
|
|
1
|
+
.mc-tree-panel {
|
2
|
+
width: 100%;
|
3
|
+
height: 382px;
|
4
|
+
}
|
5
|
+
.mc-tree-panel__wrapper {
|
6
|
+
height: calc(100% - 40px);
|
7
|
+
display: -webkit-box;
|
8
|
+
display: -ms-flexbox;
|
9
|
+
display: flex;
|
10
|
+
-webkit-column-gap: 8px;
|
11
|
+
-moz-column-gap: 8px;
|
12
|
+
column-gap: 8px;
|
13
|
+
}
|
14
|
+
.mc-tree-panel__card-header {
|
15
|
+
height: 40px;
|
16
|
+
background: #fafafa;
|
17
|
+
padding: 0 16px;
|
18
|
+
display: -webkit-box;
|
19
|
+
display: -ms-flexbox;
|
20
|
+
display: flex;
|
21
|
+
-webkit-box-align: center;
|
22
|
+
-ms-flex-align: center;
|
23
|
+
align-items: center;
|
24
|
+
-webkit-box-pack: justify;
|
25
|
+
-ms-flex-pack: justify;
|
26
|
+
justify-content: space-between;
|
27
|
+
}
|
28
|
+
.mc-tree-panel__card-title {
|
29
|
+
color: rgba(0, 0, 0, 0.847);
|
30
|
+
font-weight: 600;
|
31
|
+
}
|
32
|
+
.mc-tree-panel__card-body {
|
33
|
+
height: calc(100% - 40px);
|
34
|
+
overflow: auto;
|
35
|
+
padding: 8px;
|
36
|
+
}
|
37
|
+
.mc-tree-panel__options {
|
38
|
+
border-radius: 4px;
|
39
|
+
border: 1px solid #ebebeb;
|
40
|
+
overflow: hidden;
|
41
|
+
-webkit-box-flex: 1;
|
42
|
+
-ms-flex: 1;
|
43
|
+
flex: 1;
|
44
|
+
}
|
45
|
+
.mc-tree-panel__selected {
|
46
|
+
border-radius: 4px;
|
47
|
+
border: 1px solid #ebebeb;
|
48
|
+
overflow: hidden;
|
49
|
+
width: 240px;
|
50
|
+
position: relative;
|
51
|
+
}
|
52
|
+
.mc-tree-panel__selected-item {
|
53
|
+
width: 208px;
|
54
|
+
height: 40px;
|
55
|
+
display: -webkit-box;
|
56
|
+
display: -ms-flexbox;
|
57
|
+
display: flex;
|
58
|
+
-webkit-box-align: center;
|
59
|
+
-ms-flex-align: center;
|
60
|
+
align-items: center;
|
61
|
+
padding: 0 8px;
|
62
|
+
background: #f5f5f5;
|
63
|
+
border-radius: 4px;
|
64
|
+
overflow: hidden;
|
65
|
+
}
|
66
|
+
.mc-tree-panel__selected-item:not(:first-child) {
|
67
|
+
margin-top: 8px;
|
68
|
+
}
|
69
|
+
.mc-tree-panel__selected-item__drag {
|
70
|
+
-ms-flex-negative: 0;
|
71
|
+
flex-shrink: 0;
|
72
|
+
color: #8c8c8c;
|
73
|
+
padding: 5px 0 3px;
|
74
|
+
}
|
75
|
+
.mc-tree-panel__selected-item__drag:hover {
|
76
|
+
background: rgba(38, 38, 38, 0.15) !important;
|
77
|
+
cursor: move;
|
78
|
+
}
|
79
|
+
.mc-tree-panel__selected-item__remove {
|
80
|
+
-ms-flex-negative: 0;
|
81
|
+
flex-shrink: 0;
|
82
|
+
color: #8c8c8c;
|
83
|
+
margin-left: 8px;
|
84
|
+
}
|
85
|
+
.mc-tree-panel__selected-item__remove:hover {
|
86
|
+
cursor: pointer;
|
87
|
+
color: #262626;
|
88
|
+
}
|
89
|
+
.mc-tree-panel__selected-item--disabled {
|
90
|
+
position: absolute;
|
91
|
+
top: 0;
|
92
|
+
right: 0;
|
93
|
+
bottom: 0;
|
94
|
+
left: 0;
|
95
|
+
z-index: 9;
|
96
|
+
border-radius: 4px;
|
97
|
+
background: rgba(246, 246, 246, 0.66);
|
98
|
+
cursor: no-drop;
|
99
|
+
}
|
100
|
+
.mc-tree-panel__selected--disabled {
|
101
|
+
position: absolute;
|
102
|
+
top: 0;
|
103
|
+
right: 0;
|
104
|
+
bottom: 0;
|
105
|
+
left: 0;
|
106
|
+
z-index: 9;
|
107
|
+
border-radius: 4px;
|
108
|
+
background: rgba(228, 228, 228, 0.3);
|
109
|
+
cursor: no-drop;
|
110
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { TreeDataNode } from 'antd';
|
2
|
+
import { CSSProperties, FC } from 'react';
|
3
|
+
import './index.less';
|
4
|
+
type Inexistent = {
|
5
|
+
text?: string;
|
6
|
+
color?: string;
|
7
|
+
reserved?: boolean;
|
8
|
+
};
|
9
|
+
type PropsType = {
|
10
|
+
style?: CSSProperties;
|
11
|
+
className?: string;
|
12
|
+
treeData?: TreeDataNode[];
|
13
|
+
fieldNames?: {
|
14
|
+
key?: string;
|
15
|
+
title?: string;
|
16
|
+
children?: string;
|
17
|
+
};
|
18
|
+
disabled?: boolean;
|
19
|
+
labelInValue?: boolean;
|
20
|
+
inexistent?: boolean | Inexistent;
|
21
|
+
sortable?: boolean;
|
22
|
+
value?: any[];
|
23
|
+
onChange?: (value?: any[]) => void;
|
24
|
+
[key: string]: any;
|
25
|
+
};
|
26
|
+
declare const McTreePanel: FC<PropsType>;
|
27
|
+
export default McTreePanel;
|