@arim-aisdc/public-components 0.0.16 → 0.0.18

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 (32) hide show
  1. package/dist/components/CenterModal/CenterModal.d.ts +5 -0
  2. package/dist/components/CenterModal/CenterModal.js +138 -0
  3. package/dist/components/CenterModal/index.d.ts +3 -0
  4. package/dist/components/CenterModal/index.js +2 -0
  5. package/dist/components/CenterModal/index.less +13 -0
  6. package/dist/components/CenterModal/type.d.ts +23 -0
  7. package/dist/components/CenterModal/type.js +1 -0
  8. package/dist/components/CustomForm/CustomForm.d.ts +5 -0
  9. package/dist/components/CustomForm/CustomForm.js +677 -0
  10. package/dist/components/CustomForm/index.d.ts +4 -0
  11. package/dist/components/CustomForm/index.js +3 -0
  12. package/dist/components/CustomForm/index.less +62 -0
  13. package/dist/components/CustomForm/type.d.ts +118 -0
  14. package/dist/components/CustomForm/type.js +26 -0
  15. package/dist/components/QueryFilter/QueryFilter.d.ts +2 -2
  16. package/dist/components/QueryFilter/index.d.ts +1 -1
  17. package/dist/components/QueryFilter/type.d.ts +1 -1
  18. package/dist/components/TableMax/TableBody/Row.d.ts +2 -2
  19. package/dist/components/TableMax/TableBody/Row.js +5 -5
  20. package/dist/components/TableMax/TableBody/index.d.ts +4 -2
  21. package/dist/components/TableMax/TableBody/index.js +10 -13
  22. package/dist/components/TableMax/TableHeader/index.js +5 -4
  23. package/dist/components/TableMax/TableHeader/index.less +1 -1
  24. package/dist/components/TableMax/TableMax.js +86 -41
  25. package/dist/components/TableMax/components/ColumnFilter/index.js +0 -2
  26. package/dist/components/TableMax/components/ColumnSort/customSortFns.d.ts +10 -6
  27. package/dist/components/TableMax/components/ColumnSort/customSortFns.js +51 -4
  28. package/dist/components/TableMax/tableMax.less +1 -1
  29. package/dist/components/TableMax/type.d.ts +12 -8
  30. package/dist/index.d.ts +4 -0
  31. package/dist/index.js +4 -0
  32. package/package.json +3 -2
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import { CenterModalPropsType } from './type';
4
+ declare const CenterModal: React.FC<CenterModalPropsType>;
5
+ export default CenterModal;
@@ -0,0 +1,138 @@
1
+ import "antd/es/modal/style";
2
+ import _Modal from "antd/es/modal";
3
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4
+ 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."); }
5
+ 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); }
6
+ 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; }
7
+ 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; } }
8
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
9
+ import React, { useRef, useState } from 'react';
10
+ import Draggable from 'react-draggable';
11
+ import "./index.less";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
13
+ // import 'ant-design-draggable-modal/dist/index.css';
14
+
15
+ var CenterModal = function CenterModal(_ref) {
16
+ var _ref$open = _ref.open,
17
+ open = _ref$open === void 0 ? false : _ref$open,
18
+ title = _ref.title,
19
+ _ref$okText = _ref.okText,
20
+ okText = _ref$okText === void 0 ? '确定' : _ref$okText,
21
+ _ref$hasfooter = _ref.hasfooter,
22
+ hasfooter = _ref$hasfooter === void 0 ? false : _ref$hasfooter,
23
+ footer = _ref.footer,
24
+ _ref$width = _ref.width,
25
+ width = _ref$width === void 0 ? 500 : _ref$width,
26
+ _ref$size = _ref.size,
27
+ size = _ref$size === void 0 ? '' : _ref$size,
28
+ renderContent = _ref.renderContent,
29
+ handleConfirm = _ref.handleConfirm,
30
+ handleCancel = _ref.handleCancel,
31
+ _ref$confirmLoading = _ref.confirmLoading,
32
+ confirmLoading = _ref$confirmLoading === void 0 ? false : _ref$confirmLoading,
33
+ _ref$maskClosable = _ref.maskClosable,
34
+ maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
35
+ _ref$bodyStyle = _ref.bodyStyle,
36
+ bodyStyle = _ref$bodyStyle === void 0 ? {
37
+ position: 'relative'
38
+ // padding: '24px 32px',
39
+ } : _ref$bodyStyle,
40
+ afterClose = _ref.afterClose;
41
+ var _useState = useState(false),
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ disabled = _useState2[0],
44
+ setDisabled = _useState2[1];
45
+ var _useState3 = useState({
46
+ left: 0,
47
+ top: 0,
48
+ bottom: 0,
49
+ right: 0
50
+ }),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ bounds = _useState4[0],
53
+ setBounds = _useState4[1];
54
+ var draggleRef = useRef(null);
55
+ var _onStart = function onStart(event, uiData) {
56
+ var _window, _draggleRef$current;
57
+ // eslint-disable-next-line no-unsafe-optional-chaining
58
+ var _window$document$docu = (_window = window) === null || _window === void 0 || (_window = _window.document) === null || _window === void 0 ? void 0 : _window.documentElement,
59
+ clientWidth = _window$document$docu.clientWidth,
60
+ clientHeight = _window$document$docu.clientHeight;
61
+ var modalHeader = document.getElementById('modal-header');
62
+ var targetRect = draggleRef === null || draggleRef === void 0 || (_draggleRef$current = draggleRef.current) === null || _draggleRef$current === void 0 ? void 0 : _draggleRef$current.getBoundingClientRect();
63
+ console.log(modalHeader, event.target);
64
+ if (modalHeader && !modalHeader.contains(event.target)) {
65
+ setBounds({
66
+ left: 0,
67
+ right: 0,
68
+ top: 0,
69
+ bottom: 0
70
+ });
71
+ return;
72
+ }
73
+ setBounds({
74
+ left: -(targetRect === null || targetRect === void 0 ? void 0 : targetRect.left) + (uiData === null || uiData === void 0 ? void 0 : uiData.x),
75
+ right: clientWidth - ((targetRect === null || targetRect === void 0 ? void 0 : targetRect.right) - (uiData === null || uiData === void 0 ? void 0 : uiData.x)),
76
+ top: -(targetRect === null || targetRect === void 0 ? void 0 : targetRect.top) + (uiData === null || uiData === void 0 ? void 0 : uiData.y),
77
+ bottom: clientHeight - ((targetRect === null || targetRect === void 0 ? void 0 : targetRect.bottom) - (uiData === null || uiData === void 0 ? void 0 : uiData.y))
78
+ });
79
+ };
80
+ return /*#__PURE__*/_jsx(_Modal, {
81
+ className: "centerModal".concat(size),
82
+ title: /*#__PURE__*/_jsx("div", {
83
+ id: "modal-header",
84
+ style: {
85
+ width: '100%',
86
+ cursor: 'move'
87
+ },
88
+ onMouseOver: function onMouseOver() {
89
+ if (disabled) {
90
+ setDisabled(false);
91
+ }
92
+ },
93
+ onMouseOut: function onMouseOut() {
94
+ setDisabled(false);
95
+ }
96
+ // fix eslintjsx-a11y/mouse-events-have-key-events
97
+ // https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/master/docs/rules/mouse-events-have-key-events.md
98
+ ,
99
+ onFocus: function onFocus() {},
100
+ onBlur: function onBlur() {}
101
+ // end
102
+ ,
103
+ children: title
104
+ }),
105
+ open: open,
106
+ width: width,
107
+ maskClosable: maskClosable,
108
+ onOk: handleConfirm,
109
+ onCancel: handleCancel,
110
+ okText: okText,
111
+ footer: hasfooter ? footer : null,
112
+ centered: true,
113
+ closeIcon: /*#__PURE__*/_jsx("i", {
114
+ className: "iconfont-other icon-other-close"
115
+ }),
116
+ destroyOnClose: true,
117
+ confirmLoading: confirmLoading,
118
+ bodyStyle: bodyStyle,
119
+ afterClose: afterClose,
120
+ modalRender: function modalRender(modal) {
121
+ return /*#__PURE__*/_jsx(Draggable, {
122
+ disabled: disabled,
123
+ bounds: bounds,
124
+ handle: "#modal-header",
125
+ onStart: function onStart(event, uiData) {
126
+ return _onStart(event, uiData);
127
+ },
128
+ children: /*#__PURE__*/_jsx("div", {
129
+ children: modal
130
+ })
131
+ });
132
+ },
133
+ children: renderContent ? renderContent : /*#__PURE__*/_jsx("div", {
134
+ className: "gantt-leftbar-defalutItem"
135
+ })
136
+ });
137
+ };
138
+ export default CenterModal;
@@ -0,0 +1,3 @@
1
+ import CenterModal from './CenterModal';
2
+ export type { CenterModalPropsType } from './type';
3
+ export default CenterModal;
@@ -0,0 +1,2 @@
1
+ import CenterModal from "./CenterModal";
2
+ export default CenterModal;
@@ -0,0 +1,13 @@
1
+ .custom-light-modal {
2
+ top: 0 !important;
3
+ left: 0 !important;
4
+ height: 'none' !important;
5
+ }
6
+
7
+ .ant-design-draggable-modal-resize-handle {
8
+ display: none;
9
+
10
+ .ant-design-draggable-modal .ant-design-draggable-modal-title {
11
+ padding: 0;
12
+ }
13
+ }
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ export type BoundsType = {
3
+ left: number;
4
+ right: number;
5
+ top: number;
6
+ bottom: number;
7
+ };
8
+ export interface CenterModalPropsType {
9
+ open: boolean;
10
+ title?: JSX.Element;
11
+ okText?: string;
12
+ hasfooter?: boolean;
13
+ footer?: ReactNode;
14
+ width?: number;
15
+ size?: string;
16
+ renderContent?: JSX.Element | null;
17
+ maskClosable?: boolean;
18
+ handleConfirm?: () => void;
19
+ handleCancel?: () => void;
20
+ confirmLoading?: boolean;
21
+ bodyStyle?: object;
22
+ afterClose?: () => void;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import './index.less';
3
+ import { CustomFormProps } from './type';
4
+ declare const _default: React.NamedExoticComponent<CustomFormProps>;
5
+ export default _default;