gxxc-ui 1.0.7 → 1.0.9
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/IconUI/index.d.ts +29 -0
- package/dist/IconUI/index.js +11 -5
- 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/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,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface IconUIProps {
|
|
3
|
+
/** 图标名称 */
|
|
4
|
+
name: string;
|
|
5
|
+
/** 图标大小 */
|
|
6
|
+
size?: string | number;
|
|
7
|
+
/** 图标填充颜色 */
|
|
8
|
+
fill?: string;
|
|
9
|
+
/** 图标描边宽度 */
|
|
10
|
+
strokeWidth?: number;
|
|
11
|
+
/** 图标主题 */
|
|
12
|
+
theme?: 'outline' | 'filled' | 'two-tone' | 'multi-color';
|
|
13
|
+
/** 图标宽度 */
|
|
14
|
+
width?: string | number;
|
|
15
|
+
/** 图标高度 */
|
|
16
|
+
height?: string | number;
|
|
17
|
+
/** 自定义类名 */
|
|
18
|
+
className?: string;
|
|
19
|
+
/** 自定义样式 */
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
/** 点击事件 */
|
|
22
|
+
onClick?: (e: React.MouseEvent<SVGSVGElement>) => void;
|
|
23
|
+
/** 是否禁用 */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** 其他属性 */
|
|
26
|
+
[key: string]: any;
|
|
27
|
+
}
|
|
28
|
+
declare const IconUI: React.FC<IconUIProps>;
|
|
29
|
+
export default IconUI;
|
package/dist/IconUI/index.js
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
var _excluded = ["name"];
|
|
3
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
4
|
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; }
|
|
6
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
6
|
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); }
|
|
8
|
-
function
|
|
9
|
-
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; }
|
|
7
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
10
8
|
import { iconMap } from "./material/rally";
|
|
11
9
|
var IconUI = function IconUI(props) {
|
|
12
|
-
var name = props.name
|
|
13
|
-
|
|
10
|
+
var name = props.name;
|
|
11
|
+
var otherProps = Object.assign({}, (_objectDestructuringEmpty(props), props));
|
|
12
|
+
|
|
13
|
+
/// 拦截点击事添加 disabled 使其禁止点击
|
|
14
|
+
var onClick = otherProps.onClick;
|
|
15
|
+
otherProps.onClick = function (e) {
|
|
16
|
+
if (!props.disabled) {
|
|
17
|
+
onClick(e);
|
|
18
|
+
}
|
|
19
|
+
};
|
|
14
20
|
|
|
15
21
|
// 直接从 iconMap 获取图标,避免每次都遍历数组
|
|
16
22
|
var current = iconMap[name];
|
|
@@ -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
|
+
}
|
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.9",
|
|
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",
|