gxxc-ui 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/AnchorUI/index.d.ts +4 -0
- package/dist/ButtonUI/index.d.ts +9 -0
- package/dist/DateUI/index.d.ts +5 -0
- package/dist/DescriptionsUI/index.d.ts +19 -0
- package/dist/FilterUI/index.js +8 -1
- package/dist/FormUI/index.d.ts +4 -0
- package/dist/InputUI/index.d.ts +7 -0
- package/dist/MessageUI/index.d.ts +3 -0
- package/dist/ModalUI/index.d.ts +4 -0
- package/dist/NotificationUI/index.d.ts +3 -0
- package/dist/SearchNumberUI/index.d.ts +4 -0
- package/dist/SearchNumberUI/index.js +57 -0
- package/dist/SearchNumberUI/index.scss +20 -0
- package/dist/SwitchUI/index.d.ts +4 -0
- package/dist/TableUI/material/Setting/index.js +26 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ButtonProps } from 'antd';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './index.scss';
|
|
4
|
+
interface ButtonUIProps extends ButtonProps {
|
|
5
|
+
iconPosition?: 'start' | 'end';
|
|
6
|
+
children?: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
declare const ButtonUI: React.FC<ButtonUIProps>;
|
|
9
|
+
export default ButtonUI;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
interface IProps {
|
|
4
|
+
items: ItemType[];
|
|
5
|
+
isSingleLine?: boolean;
|
|
6
|
+
labelWidth?: number | string;
|
|
7
|
+
type?: 'table' | 'text';
|
|
8
|
+
layout?: 'horizontal' | 'vertical';
|
|
9
|
+
labelAlign?: 'left' | 'right';
|
|
10
|
+
colon?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface ItemType {
|
|
13
|
+
label: string;
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
span?: number;
|
|
16
|
+
noDataHide?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const DescriptionsUI: (props: IProps) => React.JSX.Element;
|
|
19
|
+
export default DescriptionsUI;
|
package/dist/FilterUI/index.js
CHANGED
|
@@ -13,7 +13,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
13
13
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
14
|
import { Affix, Cascader, Form, Space } from 'antd';
|
|
15
15
|
import React, { useEffect, useState } from 'react';
|
|
16
|
-
import { ButtonUI, DateUI, IconUI, SearchUI, SelectUI } from "./..";
|
|
16
|
+
import { ButtonUI, DateUI, IconUI, SearchUI, SearchNumberUI, SelectUI } from "./..";
|
|
17
17
|
import "./index.scss";
|
|
18
18
|
var FilterUI = function FilterUI(props) {
|
|
19
19
|
var form = props.form,
|
|
@@ -138,6 +138,13 @@ var FilterUI = function FilterUI(props) {
|
|
|
138
138
|
}, /*#__PURE__*/React.createElement(SearchUI, _extends({
|
|
139
139
|
placeholder: option.label
|
|
140
140
|
}, option === null || option === void 0 ? void 0 : option.renderProps)));
|
|
141
|
+
case 'searchNumber':
|
|
142
|
+
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
143
|
+
key: option.key,
|
|
144
|
+
name: option.key
|
|
145
|
+
}, /*#__PURE__*/React.createElement(SearchNumberUI, _extends({
|
|
146
|
+
placeholder: option.label
|
|
147
|
+
}, option === null || option === void 0 ? void 0 : option.renderProps)));
|
|
141
148
|
case 'select':
|
|
142
149
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
143
150
|
key: option.key,
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { Flex, Input } from 'antd';
|
|
8
|
+
import React, { useEffect, useState } from 'react';
|
|
9
|
+
import { IconUI } from "./..";
|
|
10
|
+
import "./index.scss";
|
|
11
|
+
// 搜索框
|
|
12
|
+
var timer;
|
|
13
|
+
var SearchNumberUI = function SearchNumberUI(props) {
|
|
14
|
+
var value = props.value,
|
|
15
|
+
placeholder = props.placeholder,
|
|
16
|
+
onChange = props.onChange;
|
|
17
|
+
var _useState = useState(),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
searchValue = _useState2[0],
|
|
20
|
+
setSearchValue = _useState2[1];
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
var ee = value === null || value === void 0 ? void 0 : value.replace(/[^0-9]/g, '');
|
|
23
|
+
setSearchValue(ee);
|
|
24
|
+
return function () {
|
|
25
|
+
clearTimeout(timer);
|
|
26
|
+
};
|
|
27
|
+
}, [value]);
|
|
28
|
+
var valueChange = function valueChange(e) {
|
|
29
|
+
if ((e === null || e === void 0 ? void 0 : e.type) === 'change' || (e === null || e === void 0 ? void 0 : e.type) === 'compositionend') {
|
|
30
|
+
var ee = e.target.value.replace(/[^0-9]/g, '');
|
|
31
|
+
setSearchValue(ee);
|
|
32
|
+
clearTimeout(timer);
|
|
33
|
+
timer = setTimeout(function () {
|
|
34
|
+
onChange(ee);
|
|
35
|
+
}, 500);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return /*#__PURE__*/React.createElement(Input.Search, {
|
|
39
|
+
value: searchValue,
|
|
40
|
+
className: "sic-searchui",
|
|
41
|
+
onChange: function onChange(e) {
|
|
42
|
+
return valueChange(e);
|
|
43
|
+
},
|
|
44
|
+
allowClear: true,
|
|
45
|
+
onSearch: function onSearch(e) {
|
|
46
|
+
onChange(e.trim());
|
|
47
|
+
},
|
|
48
|
+
placeholder: placeholder,
|
|
49
|
+
enterButton: /*#__PURE__*/React.createElement(Flex, {
|
|
50
|
+
align: "center",
|
|
51
|
+
gap: 4
|
|
52
|
+
}, /*#__PURE__*/React.createElement(IconUI, {
|
|
53
|
+
name: "Search"
|
|
54
|
+
}), /*#__PURE__*/React.createElement("div", null, "\u641C\u7D22"))
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
export default SearchNumberUI;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.sic-searchui {
|
|
2
|
+
font-size: 13px;
|
|
3
|
+
width: 320px;
|
|
4
|
+
.ant-input-search-button {
|
|
5
|
+
padding: 0 8px;
|
|
6
|
+
}
|
|
7
|
+
.ant-input-group-addon {
|
|
8
|
+
.ant-btn-variant-solid {
|
|
9
|
+
color: var(--themeColor);
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
border: 1px solid #d9d9d9;
|
|
12
|
+
box-shadow: none;
|
|
13
|
+
}
|
|
14
|
+
.ant-btn-variant-solid:hover {
|
|
15
|
+
color: var(--themeColor);
|
|
16
|
+
background-color: #fff;
|
|
17
|
+
border: 1px solid var(--themeColor);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -12,6 +12,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
12
12
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
+
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
15
16
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
16
17
|
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."); }
|
|
17
18
|
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); }
|
|
@@ -45,10 +46,34 @@ export var Setting = function Setting(props) {
|
|
|
45
46
|
|
|
46
47
|
// 确认
|
|
47
48
|
var handleGetSortedData = function handleGetSortedData() {
|
|
49
|
+
var dataSourceMap = {};
|
|
48
50
|
dataSource === null || dataSource === void 0 || dataSource.map(function (item, i) {
|
|
49
51
|
item.sort = i + 1;
|
|
52
|
+
dataSourceMap[item.key] = item;
|
|
50
53
|
});
|
|
51
|
-
|
|
54
|
+
var tableHeaderMap = {};
|
|
55
|
+
var _iterator = _createForOfIteratorHelper(tableHeader),
|
|
56
|
+
_step;
|
|
57
|
+
try {
|
|
58
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
59
|
+
var item = _step.value;
|
|
60
|
+
tableHeaderMap[item.key] = item;
|
|
61
|
+
}
|
|
62
|
+
} catch (err) {
|
|
63
|
+
_iterator.e(err);
|
|
64
|
+
} finally {
|
|
65
|
+
_iterator.f();
|
|
66
|
+
}
|
|
67
|
+
for (var _key in dataSourceMap) {
|
|
68
|
+
var item1 = dataSourceMap[_key];
|
|
69
|
+
var item2 = tableHeaderMap[_key];
|
|
70
|
+
item2.disable = item1.disable;
|
|
71
|
+
item2.key = item1.key;
|
|
72
|
+
item2.name = item1.name;
|
|
73
|
+
item2.selected = item1.selected;
|
|
74
|
+
item2.sort = item1.sort;
|
|
75
|
+
}
|
|
76
|
+
getTableheader(tableHeader);
|
|
52
77
|
_setOpenModifyHeader(false);
|
|
53
78
|
};
|
|
54
79
|
// 关闭
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { default as NotificationUI } from './NotificationUI';
|
|
|
21
21
|
export { default as PasswordStrongUI } from './PasswordStrongUI';
|
|
22
22
|
export { default as RichEditorUI } from './RichEditorUI';
|
|
23
23
|
export { default as SearchUI } from './SearchUI';
|
|
24
|
+
export { default as SearchNumberUI } from './SearchNumberUI';
|
|
24
25
|
export { default as SelectUI } from './SelectUI';
|
|
25
26
|
export { default as StatisticUI } from './StatisticUI';
|
|
26
27
|
export { default as SwitchUI } from './SwitchUI';
|
package/dist/index.js
CHANGED
|
@@ -21,6 +21,7 @@ export { default as NotificationUI } from "./NotificationUI";
|
|
|
21
21
|
export { default as PasswordStrongUI } from "./PasswordStrongUI";
|
|
22
22
|
export { default as RichEditorUI } from "./RichEditorUI";
|
|
23
23
|
export { default as SearchUI } from "./SearchUI";
|
|
24
|
+
export { default as SearchNumberUI } from "./SearchNumberUI";
|
|
24
25
|
export { default as SelectUI } from "./SelectUI";
|
|
25
26
|
export { default as StatisticUI } from "./StatisticUI";
|
|
26
27
|
export { default as SwitchUI } from "./SwitchUI";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gxxc-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "A react library developed with dumi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@icon-park/react": "^1.4.2",
|
|
49
49
|
"@wangeditor/editor": "^5.1.23",
|
|
50
50
|
"@wangeditor/editor-for-react": "^1.0.6",
|
|
51
|
-
"antd": "^5.26.
|
|
51
|
+
"antd": "^5.26.7",
|
|
52
52
|
"dayjs": "^1.11.11",
|
|
53
53
|
"lodash": "^4.17.21",
|
|
54
54
|
"react-countup": "^6.5.3",
|