@pointcloud/pcloud-components 0.1.4 → 0.1.5

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 (68) hide show
  1. package/README.md +297 -25
  2. package/dist/esm/AdvancedFilter/FormFilter.d.ts +2 -2
  3. package/dist/esm/AdvancedFilter/FormFilter.js +43 -45
  4. package/dist/esm/AdvancedFilter/index.js +66 -75
  5. package/dist/esm/AdvancedFilter/interface.d.ts +1 -1
  6. package/dist/esm/AdvancedFilter/styles/index.less +146 -116
  7. package/dist/esm/ConfigProvider/index.d.ts +1 -1
  8. package/dist/esm/ConfigProvider/index.js +5 -3
  9. package/dist/esm/DCascader/index.js +7 -21
  10. package/dist/esm/DCascader/index.less +5 -1
  11. package/dist/esm/DForm/DItem/index.d.ts +5 -0
  12. package/dist/esm/DForm/DItem/index.js +33 -0
  13. package/dist/esm/DForm/DItem/itemType.d.ts +106 -0
  14. package/dist/esm/DForm/DItem/itemType.js +1 -0
  15. package/dist/esm/DForm/DItem/itemsRender.d.ts +39 -0
  16. package/dist/esm/DForm/DItem/itemsRender.js +193 -0
  17. package/dist/esm/DForm/helper.js +7 -7
  18. package/dist/esm/DForm/index.d.ts +1 -1
  19. package/dist/esm/DForm/index.js +17 -17
  20. package/dist/esm/DForm/index.less +32 -31
  21. package/dist/esm/DInput/index.js +6 -11
  22. package/dist/esm/DSelect/index.d.ts +1 -1
  23. package/dist/esm/DSelect/index.js +7 -18
  24. package/dist/esm/DTable/index.js +58 -64
  25. package/dist/esm/DTable/index.less +8 -0
  26. package/dist/esm/DTreeSelect/index.d.ts +1 -1
  27. package/dist/esm/DTreeSelect/index.js +6 -20
  28. package/dist/esm/DTreeSelect/index.less +2 -0
  29. package/dist/esm/DUpload/helper.js +2 -6
  30. package/dist/esm/DUpload/index.js +28 -36
  31. package/dist/esm/DUpload/index.less +1 -0
  32. package/dist/esm/ErrorBoundary/index.d.ts +2 -2
  33. package/dist/esm/ErrorBoundary/index.js +16 -12
  34. package/dist/esm/ErrorBoundary/index.less +1 -0
  35. package/dist/esm/LModal/index.d.ts +2 -2
  36. package/dist/esm/LModal/index.js +11 -13
  37. package/dist/esm/LModal/interface.d.ts +1 -1
  38. package/dist/esm/LModal/styles/index.less +27 -25
  39. package/dist/esm/LabelValue/index.d.ts +1 -1
  40. package/dist/esm/LabelValue/index.js +14 -12
  41. package/dist/esm/LabelValue/styles/index.less +4 -0
  42. package/dist/esm/Loading/interface.d.ts +4 -4
  43. package/dist/esm/Loading/loading.d.ts +2 -2
  44. package/dist/esm/Loading/loading.js +18 -16
  45. package/dist/esm/Loading/styles/index.less +3 -1
  46. package/dist/esm/NoData/index.d.ts +2 -2
  47. package/dist/esm/NoData/index.js +14 -13
  48. package/dist/esm/NoData/styles/index.less +4 -1
  49. package/dist/umd/images/favicon.png +0 -0
  50. package/dist/umd/mock/dcascader/china_region_city.json +2962 -0
  51. package/dist/umd/mock/dcascader/china_region_county.json +9991 -0
  52. package/dist/umd/mock/dcascader/china_region_province.json +36 -0
  53. package/dist/umd/mock/dupload/other/ZJ-TZ-001_/346/212/244/345/233/275/345/272/231/346/210/217/345/217/260/345/216/206/345/217/262/345/273/272/347/255/221/346/241/243/346/241/210/350/241/250.pdf +0 -0
  54. package/dist/umd/mock/dupload/other//346/234/210/347/211/231/346/271/276 - /351/243/236/345/204/277/344/271/220/345/233/242.mp3 +0 -0
  55. package/dist/umd/mock/dupload/picture/110500-thumb.jpg +0 -0
  56. package/dist/umd/mock/dupload/picture/110500.jpg +0 -0
  57. package/dist/umd/mock/dupload/picture/110502-thumb.jpg +0 -0
  58. package/dist/umd/mock/dupload/picture/110502.jpg +0 -0
  59. package/dist/umd/mock/dupload/picture/110504.png +0 -0
  60. package/dist/umd/mock/dupload/picture/default.png +0 -0
  61. package/dist/umd/mock/dupload/picture//346/255/243/351/227/250/345/205/250/346/231/257.jpg +0 -0
  62. package/dist/umd/pcloud-components.min.css +1 -1
  63. package/dist/umd/pcloud-components.min.js +1 -1
  64. package/package.json +91 -73
  65. package/dist/esm/DForm/DItem.d.ts +0 -28
  66. package/dist/esm/DForm/DItem.js +0 -31
  67. package/dist/esm/DForm/DItemsMap.d.ts +0 -33
  68. package/dist/esm/DForm/DItemsMap.js +0 -148
@@ -1,30 +1,14 @@
1
- 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); }
2
- 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; }
3
- 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; }
4
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
5
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
8
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
9
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
3
+ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
13
4
  import React, { useState, useRef, useImperativeHandle, useContext } from 'react';
14
5
  import { Input, Button, Collapse } from 'antd';
15
6
  import classNames from 'classnames';
16
- import { motion } from 'framer-motion';
17
7
  import FormFilter from "./FormFilter";
18
8
  import { ConfigContext } from "../ConfigProvider";
19
9
  import "./styles/index.less";
20
- var variants = {
21
- down: {
22
- transform: 'rotateZ(180deg)'
23
- },
24
- up: {
25
- transform: 'rotateZ(0deg)'
26
- }
27
- };
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ import { jsxs as _jsxs } from "react/jsx-runtime";
28
12
  var AdvancedFilter = function AdvancedFilter(props) {
29
13
  var left = props.left,
30
14
  right = props.right,
@@ -70,63 +54,70 @@ var AdvancedFilter = function AdvancedFilter(props) {
70
54
  var inputSearch = function inputSearch(v) {
71
55
  (inputProps === null || inputProps === void 0 ? void 0 : inputProps.inputSearch) && inputProps.inputSearch(_defineProperty({}, inputProps.name, v));
72
56
  };
73
- return /*#__PURE__*/React.createElement(Collapse, {
57
+ return /*#__PURE__*/_jsx(Collapse, {
74
58
  className: wrapperClass,
75
59
  activeKey: panelVisible ? '1' : 'none',
76
60
  collapsible: "header",
77
61
  ghost: true,
78
- bordered: false
79
- }, /*#__PURE__*/React.createElement(Collapse.Panel, {
80
- key: "1",
81
- showArrow: false,
82
- header: /*#__PURE__*/React.createElement("div", {
83
- className: "search-header",
84
- style: {
85
- justifyContent: left ? 'space-between' : 'flex-end',
86
- alignItems: 'center'
87
- },
88
- onClick: function onClick(e) {
89
- return e.stopPropagation();
90
- }
91
- }, left && /*#__PURE__*/React.createElement("div", {
92
- className: "left"
93
- }, left), /*#__PURE__*/React.createElement("div", {
94
- className: "right right-content"
95
- }, /*#__PURE__*/React.createElement(Input.Search, {
96
- className: "input",
97
- ref: inputRef,
98
- allowClear: true,
99
- placeholder: inputProps === null || inputProps === void 0 ? void 0 : inputProps.placeholder,
100
- onChange: function onChange(e) {
101
- setInputValue(e.target.value);
102
- onValuesChange && onValuesChange(e.target.value);
103
- },
104
- onSearch: inputSearch,
105
- name: inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
106
- value: inputValue
107
- }), /*#__PURE__*/React.createElement(Button, {
108
- className: "button",
109
- onClick: function onClick() {
110
- return setPanelVisible(!panelVisible);
111
- }
112
- }, "\u9AD8\u7EA7\u7B5B\u9009", icon && /*#__PURE__*/React.createElement(motion.span, {
113
- className: "icon",
114
- animate: panelVisible ? 'down' : 'up',
115
- variants: variants
116
- }, icon)), right && /*#__PURE__*/React.createElement("div", {
117
- className: "right"
118
- }, right)))
119
- }, /*#__PURE__*/React.createElement("div", {
120
- className: "title"
121
- }, /*#__PURE__*/React.createElement("span", {
122
- className: "icon"
123
- }), " \u67E5\u8BE2\u6761\u4EF6"), /*#__PURE__*/React.createElement("div", {
124
- className: "search-content"
125
- }, /*#__PURE__*/React.createElement(FormFilter, {
126
- formRef: formRef,
127
- formItemConfig: formItemConfig,
128
- onSearch: handleSearch,
129
- onReset: onReset
130
- }))));
62
+ bordered: false,
63
+ children: /*#__PURE__*/_jsxs(Collapse.Panel, {
64
+ showArrow: false,
65
+ header: /*#__PURE__*/_jsxs("div", {
66
+ className: "search-header",
67
+ style: {
68
+ justifyContent: left ? 'space-between' : 'flex-end',
69
+ alignItems: 'center'
70
+ },
71
+ onClick: function onClick(e) {
72
+ return e.stopPropagation();
73
+ },
74
+ children: [left && /*#__PURE__*/_jsx("div", {
75
+ className: "left",
76
+ children: left
77
+ }), /*#__PURE__*/_jsxs("div", {
78
+ className: "right right-content",
79
+ children: [/*#__PURE__*/_jsx(Input.Search, {
80
+ className: "input",
81
+ ref: inputRef,
82
+ allowClear: true,
83
+ placeholder: inputProps === null || inputProps === void 0 ? void 0 : inputProps.placeholder,
84
+ onChange: function onChange(e) {
85
+ setInputValue(e.target.value);
86
+ onValuesChange && onValuesChange(e.target.value);
87
+ },
88
+ onSearch: inputSearch,
89
+ name: inputProps === null || inputProps === void 0 ? void 0 : inputProps.name,
90
+ value: inputValue
91
+ }), /*#__PURE__*/_jsxs(Button, {
92
+ className: "button",
93
+ onClick: function onClick() {
94
+ return setPanelVisible(!panelVisible);
95
+ },
96
+ children: ["\u9AD8\u7EA7\u7B5B\u9009", /*#__PURE__*/_jsx("span", {
97
+ className: "".concat(panelVisible ? 'down' : 'up', " icon"),
98
+ children: icon
99
+ })]
100
+ }), right && /*#__PURE__*/_jsx("div", {
101
+ className: "right",
102
+ children: right
103
+ })]
104
+ })]
105
+ }),
106
+ children: [/*#__PURE__*/_jsxs("div", {
107
+ className: "title",
108
+ children: [/*#__PURE__*/_jsx("span", {
109
+ className: "icon"
110
+ }), " \u67E5\u8BE2\u6761\u4EF6"]
111
+ }), /*#__PURE__*/_jsx("div", {
112
+ className: "search-content",
113
+ children: /*#__PURE__*/_jsx(FormFilter, {
114
+ formRef: formRef,
115
+ formItemConfig: formItemConfig,
116
+ onSearch: handleSearch,
117
+ onReset: onReset
118
+ })
119
+ })]
120
+ }, "1")
121
+ });
131
122
  };
132
123
  export default AdvancedFilter;
@@ -15,7 +15,7 @@ export interface FormProps {
15
15
  /**
16
16
  * @description 点击重置按钮时触发
17
17
  */
18
- onReset?: Function;
18
+ onReset?: () => void;
19
19
  }
20
20
  export interface FProps extends FormProps {
21
21
  /**
@@ -1,116 +1,146 @@
1
- @import '../../commonStyle/index.less';
2
- .@{prefix}-search-filter {
3
- align-items: center;
4
- width: 100%;
5
- margin-top: 10px;
6
- background-color: #fff;
7
- span.ant-collapse-header-text {
8
- display: inline-block;
9
- width: 100%;
10
- cursor: auto !important;
11
- }
12
- .ant-collapse-content-box {
13
- padding: 0px;
14
- }
15
-
16
- .search-header {
17
- display: flex;
18
- width: 100%;
19
- .left {
20
- max-width: 100%;
21
- overflow: hidden;
22
- white-space: no-wrap;
23
- text-overflow: ellipsis;
24
- :global {
25
- .ant-radio-wrapper:first-child {
26
- border-left: 1px solid #d9d9d9;
27
- border-radius: 5px 0 0 5px;
28
- }
29
- .ant-radio-wrapper:last-child {
30
- border-radius: 0 5px 5px 0;
31
- }
32
- .ant-radio-wrapper {
33
- margin-right: 0;
34
- padding: 4px 6px;
35
- border: 1px solid #d9d9d9;
36
- border-top-width: 1px;
37
- border-left: 1px solid #fff;
38
- border-left-width: 1px;
39
- .ant-radio {
40
- display: none;
41
- }
42
- }
43
- .ant-radio-wrapper:hover {
44
- color: #1890ff;
45
- }
46
- .ant-radio-wrapper-checked {
47
- z-index: 1;
48
- color: #1890ff;
49
- background: #fff;
50
- border: 1px solid #1890ff;
51
- border-left: 1px solid #1890ff !important;
52
- }
53
- }
54
- }
55
- .right {
56
- display: flex;
57
- justify-content: center;
58
- .input {
59
- width: 200px;
60
- border-radius: 4px;
61
- }
62
- .button {
63
- margin-left: 10px;
64
- color: #fff;
65
- background-color: #ff7e00;
66
- border-radius: 4px;
67
- &:active,
68
- &:focus,
69
- &:hover {
70
- border-color: transparent;
71
- }
72
- .icon {
73
- margin-left: 8px;
74
- }
75
- }
76
- }
77
- }
78
- .title {
79
- display: flex;
80
- align-items: center;
81
- margin: 0px 10px;
82
- padding-bottom: 10px;
83
- font-weight: bold;
84
- border-bottom: 1px solid #f0f0f0;
85
- span.icon {
86
- width: 4px;
87
- height: 16px;
88
- margin-right: 6px;
89
- background-color: #ff7e00;
90
- border-radius: 2px;
91
- }
92
- }
93
- .search-content {
94
- .filter-row {
95
- display: flex;
96
- flex-wrap: wrap;
97
- width: 100%;
98
- padding: 10px;
99
- }
100
- .filter-col {
101
- height: 30px;
102
- margin-bottom: 10px;
103
- line-height: 30px;
104
- }
105
- .filter-col .ant-picker {
106
- width: 100%;
107
- }
108
-
109
- .search-btn {
110
- justify-content: center;
111
- > button {
112
- margin: 0 5px;
113
- }
114
- }
115
- }
116
- }
1
+ @import '../../commonStyle/index.less';
2
+
3
+ .@{prefix}-search-filter {
4
+ align-items: center;
5
+ width: 100%;
6
+ margin-top: 10px;
7
+ background-color: #fff;
8
+
9
+ span.ant-collapse-header-text {
10
+ display: inline-block;
11
+ width: 100%;
12
+ cursor: auto !important;
13
+ }
14
+
15
+ .ant-collapse-content-box {
16
+ padding: 0;
17
+ }
18
+
19
+ .search-header {
20
+ display: flex;
21
+ width: 100%;
22
+
23
+ .left {
24
+ max-width: 100%;
25
+ overflow: hidden;
26
+ white-space: no-wrap;
27
+ text-overflow: ellipsis;
28
+
29
+ :global {
30
+ .ant-radio-wrapper:first-child {
31
+ border-left: 1px solid #d9d9d9;
32
+ border-radius: 5px 0 0 5px;
33
+ }
34
+
35
+ .ant-radio-wrapper:last-child {
36
+ border-radius: 0 5px 5px 0;
37
+ }
38
+
39
+ .ant-radio-wrapper {
40
+ margin-right: 0;
41
+ padding: 4px 6px;
42
+ border: 1px solid #d9d9d9;
43
+ border-top-width: 1px;
44
+ border-left: 1px solid #fff;
45
+ border-left-width: 1px;
46
+
47
+ .ant-radio {
48
+ display: none;
49
+ }
50
+ }
51
+
52
+ .ant-radio-wrapper:hover {
53
+ color: #1890ff;
54
+ }
55
+
56
+ .ant-radio-wrapper-checked {
57
+ z-index: 1;
58
+ color: #1890ff;
59
+ background: #fff;
60
+ border: 1px solid #1890ff;
61
+ border-left: 1px solid #1890ff !important;
62
+ }
63
+ }
64
+ }
65
+
66
+ .right {
67
+ display: flex;
68
+ justify-content: center;
69
+
70
+ .input {
71
+ width: 200px;
72
+ border-radius: 4px;
73
+ }
74
+
75
+ .button {
76
+ margin-left: 10px;
77
+ color: #fff;
78
+ background-color: #ff7e00;
79
+ border-radius: 4px;
80
+
81
+ &:active,
82
+ &:focus,
83
+ &:hover {
84
+ border-color: transparent;
85
+ }
86
+
87
+ .icon {
88
+ margin-left: 8px;
89
+ transition: transform 0.4s;
90
+
91
+ &.down {
92
+ transform: rotateZ(180deg);
93
+ }
94
+
95
+ &.up {
96
+ transform: rotateZ(0deg);
97
+ }
98
+ }
99
+ }
100
+ }
101
+ }
102
+
103
+ .title {
104
+ display: flex;
105
+ align-items: center;
106
+ margin: 0 10px;
107
+ padding-bottom: 10px;
108
+ font-weight: bold;
109
+ border-bottom: 1px solid #f0f0f0;
110
+
111
+ span.icon {
112
+ width: 4px;
113
+ height: 16px;
114
+ margin-right: 6px;
115
+ background-color: #ff7e00;
116
+ border-radius: 2px;
117
+ }
118
+ }
119
+
120
+ .search-content {
121
+ .filter-row {
122
+ display: flex;
123
+ flex-wrap: wrap;
124
+ width: 100%;
125
+ padding: 10px;
126
+ }
127
+
128
+ .filter-col {
129
+ height: 30px;
130
+ margin-bottom: 10px;
131
+ line-height: 30px;
132
+ }
133
+
134
+ .filter-col .ant-picker {
135
+ width: 100%;
136
+ }
137
+
138
+ .search-btn {
139
+ justify-content: center;
140
+
141
+ > button {
142
+ margin: 0 5px;
143
+ }
144
+ }
145
+ }
146
+ }
@@ -2,5 +2,5 @@ import React from 'react';
2
2
  import { ConfigProviderProps } from './interface';
3
3
  export declare const defaultPrefixCls = "pui";
4
4
  export declare const ConfigContext: React.Context<ConfigProviderProps>;
5
- declare const ConfigProvider: (props: ConfigProviderProps) => React.JSX.Element;
5
+ declare const ConfigProvider: (props: ConfigProviderProps) => JSX.Element;
6
6
  export default ConfigProvider;
@@ -1,4 +1,5 @@
1
1
  import React, { createContext } from 'react';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  export var defaultPrefixCls = 'pui';
3
4
 
4
5
  // export const ConfigContext = createContext<ConfigProviderProps>({} as ConfigProviderProps);
@@ -9,8 +10,9 @@ export var ConfigContext = /*#__PURE__*/createContext({
9
10
  });
10
11
  var ConfigProvider = function ConfigProvider(props) {
11
12
  var children = props.children;
12
- return /*#__PURE__*/React.createElement(ConfigContext.Provider, {
13
- value: props
14
- }, children);
13
+ return /*#__PURE__*/_jsx(ConfigContext.Provider, {
14
+ value: props,
15
+ children: children
16
+ });
15
17
  };
16
18
  export default ConfigProvider;
@@ -1,34 +1,20 @@
1
- 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); }
1
+ import _toConsumableArray from "@babel/runtime/helpers/esm/toConsumableArray";
2
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
3
+ import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
4
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
5
  var _excluded = ["className", "popupClassName", "fieldNames", "options", "onChange", "loadData", "onLoadData", "loading"];
3
- function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
5
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
7
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
8
- 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; }
9
- 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; }
10
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
13
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
14
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
15
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
16
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
17
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
18
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
19
- 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; }
20
- 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; }
21
6
  /*
22
7
  * @Author : wangfeihu
23
8
  * @Date : 2023-05-18 13:35:38
24
9
  * @LastEditors : wangfeihu
25
- * @LastEditTime : 2023-06-30 16:19:18
10
+ * @LastEditTime : 2023-07-12 09:44:01
26
11
  * @Description : 基于antd的Cascader组件
27
12
  */
28
13
  import React, { useRef, forwardRef, useState, useEffect, useMemo, useContext } from 'react';
29
14
  import { Cascader } from 'antd';
30
15
  import { ConfigContext } from "../ConfigProvider";
31
16
  import "./index.less";
17
+ import { jsx as _jsx } from "react/jsx-runtime";
32
18
  // 获取延时时间,默认800ms,true代表默认时间,false代表0
33
19
  function getDelayTime(value) {
34
20
  var defaultValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 800;
@@ -198,7 +184,7 @@ function InternalCascader(props, ref) {
198
184
  };
199
185
  }
200
186
  }, [timestamp]);
201
- return /*#__PURE__*/React.createElement(Cascader, _extends({}, otherProps, {
187
+ return /*#__PURE__*/_jsx(Cascader, _objectSpread(_objectSpread({}, otherProps), {}, {
202
188
  ref: ref,
203
189
  fieldNames: _fieldNames,
204
190
  loadData: _loadData,
@@ -1,18 +1,22 @@
1
1
  @import '../commonStyle/index.less';
2
+
2
3
  .@{prefix}-cascader-dropdown .ant-cascader-menu {
3
4
  &::-webkit-scrollbar {
4
5
  width: 8px;
5
6
  height: 8px;
6
7
  }
8
+
7
9
  // 轨道拖动部分的背景颜色
8
10
  &::-webkit-scrollbar-thumb {
9
- background-color: rgba(0, 0, 0, 0.5);
11
+ background-color: rgba(0, 0, 0, 50%);
10
12
  border-radius: 8px;
11
13
  }
14
+
12
15
  // 轨道背景颜色
13
16
  &::-webkit-scrollbar-track {
14
17
  border-radius: 2px;
15
18
  }
19
+
16
20
  // x、y两条轨道的交叉处
17
21
  &::-webkit-scrollbar-corner {
18
22
  background-color: #f1f1f1;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { DItemProps } from './itemType';
3
+ export type { DItemProps };
4
+ declare function DItem(props: DItemProps): JSX.Element;
5
+ export default DItem;
@@ -0,0 +1,33 @@
1
+ import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
3
+ var _excluded = ["formItemProps", "label", "name", "renderType", "render", "children"];
4
+ import itemsRender from "./itemsRender";
5
+ import { Fragment as _Fragment } from "react/jsx-runtime";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ function DItem(props) {
8
+ // @ts-ignore
9
+ var formItemProps = props.formItemProps,
10
+ _props$label = props.label,
11
+ label = _props$label === void 0 ? '' : _props$label,
12
+ name = props.name,
13
+ renderType = props.renderType,
14
+ render = props.render,
15
+ children = props.children,
16
+ otherProps = _objectWithoutProperties(props, _excluded);
17
+ var _formItemProps = _objectSpread({
18
+ label: label,
19
+ name: name
20
+ }, formItemProps);
21
+ if (renderType === 'custom' || renderType === 'other') {
22
+ return render ? /*#__PURE__*/_jsx(_Fragment, {
23
+ children: render(otherProps, _formItemProps, props)
24
+ }) : /*#__PURE__*/_jsx(_Fragment, {
25
+ children: children
26
+ });
27
+ } else if (renderType) {
28
+ return itemsRender[renderType](otherProps, _formItemProps, label, render, children);
29
+ } else {
30
+ return /*#__PURE__*/_jsx(_Fragment, {});
31
+ }
32
+ }
33
+ export default DItem;