zmdms-webui 0.0.1
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 +104 -0
- package/dist/es/_virtual/_commonjsHelpers.js +5 -0
- package/dist/es/_virtual/_tslib.js +51 -0
- package/dist/es/_virtual/index.js +3 -0
- package/dist/es/_virtual/index2.js +3 -0
- package/dist/es/button/button.d.ts +10 -0
- package/dist/es/button/button.js +39 -0
- package/dist/es/button/index.d.ts +5 -0
- package/dist/es/button/index.js +5 -0
- package/dist/es/calendar/index.d.ts +6 -0
- package/dist/es/calendar/index.js +6 -0
- package/dist/es/config/ZtxkContext.d.ts +11 -0
- package/dist/es/config/ZtxkContext.js +8 -0
- package/dist/es/config/commonHooks.js +28 -0
- package/dist/es/config/i18n/en.js +5 -0
- package/dist/es/config/i18n/zh_cn.js +5 -0
- package/dist/es/config/index.js +3 -0
- package/dist/es/config/isEqual.js +44 -0
- package/dist/es/config/useLocale.js +21 -0
- package/dist/es/container/container.d.ts +13 -0
- package/dist/es/container/container.js +24 -0
- package/dist/es/container/index.d.ts +5 -0
- package/dist/es/container/index.js +5 -0
- package/dist/es/datepicker/index.d.ts +55 -0
- package/dist/es/datepicker/index.js +6 -0
- package/dist/es/dynamicsetting/dynamicDrawer.js +76 -0
- package/dist/es/dynamicsetting/dynamicSetting.d.ts +6 -0
- package/dist/es/dynamicsetting/dynamicSetting.js +38 -0
- package/dist/es/dynamicsetting/hooks.js +50 -0
- package/dist/es/dynamicsetting/index.d.ts +5 -0
- package/dist/es/dynamicsetting/index.js +5 -0
- package/dist/es/dynamicsetting/interface.d.ts +18 -0
- package/dist/es/dynamicsetting/sortable.js +68 -0
- package/dist/es/dynamicsetting/useDynamic.js +125 -0
- package/dist/es/footer/footer.d.ts +6 -0
- package/dist/es/footer/footer.js +37 -0
- package/dist/es/footer/index.d.ts +5 -0
- package/dist/es/footer/index.js +5 -0
- package/dist/es/footer/interface.d.ts +33 -0
- package/dist/es/forgetpassword/forgetPassword.js +9 -0
- package/dist/es/forgetpassword/index.js +5 -0
- package/dist/es/form/form.d.ts +16 -0
- package/dist/es/form/form.js +89 -0
- package/dist/es/form/formItems.js +14 -0
- package/dist/es/form/hooks.js +105 -0
- package/dist/es/form/index.d.ts +5 -0
- package/dist/es/form/index.js +5 -0
- package/dist/es/form/interface.d.ts +39 -0
- package/dist/es/formitem/formItem.d.ts +43 -0
- package/dist/es/formitem/formItem.js +128 -0
- package/dist/es/formitem/index.d.ts +5 -0
- package/dist/es/formitem/index.js +5 -0
- package/dist/es/icon/index.d.ts +6 -0
- package/dist/es/icon/index.js +7 -0
- package/dist/es/input/index.d.ts +5 -0
- package/dist/es/input/index.js +5 -0
- package/dist/es/input/input.d.ts +20 -0
- package/dist/es/input/input.js +16 -0
- package/dist/es/inputnumber/index.d.ts +5 -0
- package/dist/es/inputnumber/index.js +5 -0
- package/dist/es/inputnumber/inputNumber.d.ts +20 -0
- package/dist/es/inputnumber/inputNumber.js +26 -0
- package/dist/es/inputnumber/interface.d.ts +4 -0
- package/dist/es/inputnumber/utils.js +132 -0
- package/dist/es/login/index.d.ts +13 -0
- package/dist/es/login/index.js +26 -0
- package/dist/es/node_modules/@ant-design/colors/dist/index.esm.js +223 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/AntdIcon.js +63 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/Context.js +6 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/Icon.js +69 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/IconBase.js +63 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/IconFont.js +71 -0
- package/dist/es/node_modules/@ant-design/icons/es/components/twoTonePrimaryColor.js +23 -0
- package/dist/es/node_modules/@ant-design/icons/es/icons/SettingOutlined.js +15 -0
- package/dist/es/node_modules/@ant-design/icons/es/utils.js +76 -0
- package/dist/es/node_modules/@ant-design/icons-svg/es/asn/SettingOutlined.js +5 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +7 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +5 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/defineProperty.js +18 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +29 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +5 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/objectSpread2.js +25 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js +19 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js +14 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +10 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/dist/es/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +12 -0
- package/dist/es/node_modules/@ctrl/tinycolor/dist/module/conversion.js +150 -0
- package/dist/es/node_modules/@ctrl/tinycolor/dist/module/css-color-names.js +156 -0
- package/dist/es/node_modules/@ctrl/tinycolor/dist/module/format-input.js +186 -0
- package/dist/es/node_modules/@ctrl/tinycolor/dist/module/util.js +77 -0
- package/dist/es/node_modules/@react-dnd/asap/dist/AsapQueue.js +140 -0
- package/dist/es/node_modules/@react-dnd/asap/dist/RawTask.js +20 -0
- package/dist/es/node_modules/@react-dnd/asap/dist/TaskFactory.js +17 -0
- package/dist/es/node_modules/@react-dnd/asap/dist/asap.js +17 -0
- package/dist/es/node_modules/@react-dnd/asap/dist/makeRequestCall.js +77 -0
- package/dist/es/node_modules/@react-dnd/invariant/dist/index.js +36 -0
- package/dist/es/node_modules/@react-dnd/shallowequal/dist/index.js +34 -0
- package/dist/es/node_modules/classnames/index.js +64 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/beginDrag.js +85 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/drop.js +74 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/endDrag.js +24 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/hover.js +57 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/index.js +17 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/local/setClientOffset.js +13 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/publishDragSource.js +15 -0
- package/dist/es/node_modules/dnd-core/dist/actions/dragDrop/types.js +8 -0
- package/dist/es/node_modules/dnd-core/dist/actions/registry.js +38 -0
- package/dist/es/node_modules/dnd-core/dist/classes/DragDropManagerImpl.js +57 -0
- package/dist/es/node_modules/dnd-core/dist/classes/DragDropMonitorImpl.js +153 -0
- package/dist/es/node_modules/dnd-core/dist/classes/HandlerRegistryImpl.js +130 -0
- package/dist/es/node_modules/dnd-core/dist/contracts.js +22 -0
- package/dist/es/node_modules/dnd-core/dist/createDragDropManager.js +25 -0
- package/dist/es/node_modules/dnd-core/dist/interfaces.js +7 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/dirtyHandlerIds.js +45 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/dragOffset.js +62 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/dragOperation.js +90 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/index.js +51 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/refCount.js +16 -0
- package/dist/es/node_modules/dnd-core/dist/reducers/stateId.js +5 -0
- package/dist/es/node_modules/dnd-core/dist/utils/coords.js +47 -0
- package/dist/es/node_modules/dnd-core/dist/utils/dirtiness.js +23 -0
- package/dist/es/node_modules/dnd-core/dist/utils/equality.js +32 -0
- package/dist/es/node_modules/dnd-core/dist/utils/getNextUniqueId.js +6 -0
- package/dist/es/node_modules/dnd-core/dist/utils/js_utils.js +51 -0
- package/dist/es/node_modules/dnd-core/dist/utils/matchesType.js +9 -0
- package/dist/es/node_modules/fast-deep-equal/index.js +50 -0
- package/dist/es/node_modules/immutability-helper/index.js +259 -0
- package/dist/es/node_modules/rc-picker/es/generate/dayjs.js +219 -0
- package/dist/es/node_modules/rc-util/es/Dom/canUseDom.js +5 -0
- package/dist/es/node_modules/rc-util/es/Dom/contains.js +22 -0
- package/dist/es/node_modules/rc-util/es/Dom/dynamicCSS.js +116 -0
- package/dist/es/node_modules/rc-util/es/warning.js +54 -0
- package/dist/es/node_modules/react-dnd/dist/core/DndContext.js +9 -0
- package/dist/es/node_modules/react-dnd/dist/core/DndProvider.js +92 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useCollectedProps.js +9 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useCollector.js +38 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/DragSourceImpl.js +49 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/connectors.js +16 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useDrag.js +26 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useDragSource.js +18 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceConnector.js +33 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useDragSourceMonitor.js +13 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useDragType.js +14 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrag/useRegisteredDragSource.js +28 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDragDropManager.js +13 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/DropTargetImpl.js +28 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/connectors.js +10 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useAccept.js +20 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useDrop.js +23 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useDropTarget.js +17 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useDropTargetConnector.js +23 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useDropTargetMonitor.js +13 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useDrop/useRegisteredDropTarget.js +26 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useIsomorphicLayoutEffect.js +6 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useMonitorOutput.js +23 -0
- package/dist/es/node_modules/react-dnd/dist/hooks/useOptionalFactory.js +15 -0
- package/dist/es/node_modules/react-dnd/dist/internals/DragSourceMonitorImpl.js +93 -0
- package/dist/es/node_modules/react-dnd/dist/internals/DropTargetMonitorImpl.js +68 -0
- package/dist/es/node_modules/react-dnd/dist/internals/SourceConnector.js +157 -0
- package/dist/es/node_modules/react-dnd/dist/internals/TargetConnector.js +89 -0
- package/dist/es/node_modules/react-dnd/dist/internals/isRef.js +6 -0
- package/dist/es/node_modules/react-dnd/dist/internals/registration.js +18 -0
- package/dist/es/node_modules/react-dnd/dist/internals/wrapConnectorHooks.js +74 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/BrowserDetector.js +8 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/EnterLeaveCounter.js +27 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/HTML5BackendImpl.js +572 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/MonotonicInterpolant.js +86 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/NativeDragSources/NativeDragSource.js +50 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/NativeDragSources/getDataFromDataTransfer.js +7 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/NativeDragSources/index.js +28 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/NativeDragSources/nativeTypesConfig.js +52 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/NativeTypes.js +6 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/OffsetUtils.js +100 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/OptionsReader.js +31 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/index.js +7 -0
- package/dist/es/node_modules/react-dnd-html5-backend/dist/utils/js_utils.js +30 -0
- package/dist/es/node_modules/redux/es/redux.js +383 -0
- package/dist/es/pagination/index.d.ts +5 -0
- package/dist/es/pagination/index.js +5 -0
- package/dist/es/pagination/pagination.d.ts +8 -0
- package/dist/es/pagination/pagination.js +12 -0
- package/dist/es/protectedroute/index.d.ts +14 -0
- package/dist/es/protectedroute/index.js +17 -0
- package/dist/es/suspensecomponent/index.d.ts +9 -0
- package/dist/es/suspensecomponent/index.js +10 -0
- package/dist/es/table/components/CopyIcon.js +10 -0
- package/dist/es/table/components/EnhanceCell.js +48 -0
- package/dist/es/table/components/EnhanceRow.js +11 -0
- package/dist/es/table/components/hooks.js +24 -0
- package/dist/es/table/constant.js +3 -0
- package/dist/es/table/hooks.js +24 -0
- package/dist/es/table/index.d.ts +5 -0
- package/dist/es/table/index.js +5 -0
- package/dist/es/table/interface.d.ts +43 -0
- package/dist/es/table/table.d.ts +5 -0
- package/dist/es/table/table.js +60 -0
- package/dist/es/table/useColumns.js +48 -0
- package/dist/es/table/useDynamicListByColumns.js +47 -0
- package/dist/es/table/utils.js +82 -0
- package/dist/es/timepicker/index.d.ts +9 -0
- package/dist/es/timepicker/index.js +11 -0
- package/dist/index.build.d.ts +19 -0
- package/dist/index.dark.css +2 -0
- package/dist/index.default.css +2 -0
- package/dist/index.es.js +19 -0
- package/dist/index.umd.js +6 -0
- package/package.json +103 -0
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
|
3
|
+
*
|
|
4
|
+
* Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
|
|
5
|
+
* during build.
|
|
6
|
+
* @param {number} code
|
|
7
|
+
*/
|
|
8
|
+
function formatProdErrorMessage(code) {
|
|
9
|
+
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Inlined version of the `symbol-observable` polyfill
|
|
13
|
+
var $$observable = (function () {
|
|
14
|
+
return typeof Symbol === 'function' && Symbol.observable || '@@observable';
|
|
15
|
+
})();
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* These are private action types reserved by Redux.
|
|
19
|
+
* For any unknown actions, you must return the current state.
|
|
20
|
+
* If the current state is undefined, you must return the initial state.
|
|
21
|
+
* Do not reference these action types directly in your code.
|
|
22
|
+
*/
|
|
23
|
+
var randomString = function randomString() {
|
|
24
|
+
return Math.random().toString(36).substring(7).split('').join('.');
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
var ActionTypes = {
|
|
28
|
+
INIT: "@@redux/INIT" + randomString(),
|
|
29
|
+
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
30
|
+
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
31
|
+
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @param {any} obj The object to inspect.
|
|
37
|
+
* @returns {boolean} True if the argument appears to be a plain object.
|
|
38
|
+
*/
|
|
39
|
+
function isPlainObject(obj) {
|
|
40
|
+
if (typeof obj !== 'object' || obj === null) return false;
|
|
41
|
+
var proto = obj;
|
|
42
|
+
|
|
43
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
44
|
+
proto = Object.getPrototypeOf(proto);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return Object.getPrototypeOf(obj) === proto;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
|
|
51
|
+
function miniKindOf(val) {
|
|
52
|
+
if (val === void 0) return 'undefined';
|
|
53
|
+
if (val === null) return 'null';
|
|
54
|
+
var type = typeof val;
|
|
55
|
+
|
|
56
|
+
switch (type) {
|
|
57
|
+
case 'boolean':
|
|
58
|
+
case 'string':
|
|
59
|
+
case 'number':
|
|
60
|
+
case 'symbol':
|
|
61
|
+
case 'function':
|
|
62
|
+
{
|
|
63
|
+
return type;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (Array.isArray(val)) return 'array';
|
|
68
|
+
if (isDate(val)) return 'date';
|
|
69
|
+
if (isError(val)) return 'error';
|
|
70
|
+
var constructorName = ctorName(val);
|
|
71
|
+
|
|
72
|
+
switch (constructorName) {
|
|
73
|
+
case 'Symbol':
|
|
74
|
+
case 'Promise':
|
|
75
|
+
case 'WeakMap':
|
|
76
|
+
case 'WeakSet':
|
|
77
|
+
case 'Map':
|
|
78
|
+
case 'Set':
|
|
79
|
+
return constructorName;
|
|
80
|
+
} // other
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function ctorName(val) {
|
|
87
|
+
return typeof val.constructor === 'function' ? val.constructor.name : null;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function isError(val) {
|
|
91
|
+
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function isDate(val) {
|
|
95
|
+
if (val instanceof Date) return true;
|
|
96
|
+
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function kindOf(val) {
|
|
100
|
+
var typeOfVal = typeof val;
|
|
101
|
+
|
|
102
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
103
|
+
typeOfVal = miniKindOf(val);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return typeOfVal;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* @deprecated
|
|
111
|
+
*
|
|
112
|
+
* **We recommend using the `configureStore` method
|
|
113
|
+
* of the `@reduxjs/toolkit` package**, which replaces `createStore`.
|
|
114
|
+
*
|
|
115
|
+
* Redux Toolkit is our recommended approach for writing Redux logic today,
|
|
116
|
+
* including store setup, reducers, data fetching, and more.
|
|
117
|
+
*
|
|
118
|
+
* **For more details, please read this Redux docs page:**
|
|
119
|
+
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
|
|
120
|
+
*
|
|
121
|
+
* `configureStore` from Redux Toolkit is an improved version of `createStore` that
|
|
122
|
+
* simplifies setup and helps avoid common bugs.
|
|
123
|
+
*
|
|
124
|
+
* You should not be using the `redux` core package by itself today, except for learning purposes.
|
|
125
|
+
* The `createStore` method from the core `redux` package will not be removed, but we encourage
|
|
126
|
+
* all users to migrate to using Redux Toolkit for all Redux code.
|
|
127
|
+
*
|
|
128
|
+
* If you want to use `createStore` without this visual deprecation warning, use
|
|
129
|
+
* the `legacy_createStore` import instead:
|
|
130
|
+
*
|
|
131
|
+
* `import { legacy_createStore as createStore} from 'redux'`
|
|
132
|
+
*
|
|
133
|
+
*/
|
|
134
|
+
|
|
135
|
+
function createStore(reducer, preloadedState, enhancer) {
|
|
136
|
+
var _ref2;
|
|
137
|
+
|
|
138
|
+
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
|
139
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
|
143
|
+
enhancer = preloadedState;
|
|
144
|
+
preloadedState = undefined;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (typeof enhancer !== 'undefined') {
|
|
148
|
+
if (typeof enhancer !== 'function') {
|
|
149
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return enhancer(createStore)(reducer, preloadedState);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (typeof reducer !== 'function') {
|
|
156
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
var currentReducer = reducer;
|
|
160
|
+
var currentState = preloadedState;
|
|
161
|
+
var currentListeners = [];
|
|
162
|
+
var nextListeners = currentListeners;
|
|
163
|
+
var isDispatching = false;
|
|
164
|
+
/**
|
|
165
|
+
* This makes a shallow copy of currentListeners so we can use
|
|
166
|
+
* nextListeners as a temporary list while dispatching.
|
|
167
|
+
*
|
|
168
|
+
* This prevents any bugs around consumers calling
|
|
169
|
+
* subscribe/unsubscribe in the middle of a dispatch.
|
|
170
|
+
*/
|
|
171
|
+
|
|
172
|
+
function ensureCanMutateNextListeners() {
|
|
173
|
+
if (nextListeners === currentListeners) {
|
|
174
|
+
nextListeners = currentListeners.slice();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Reads the state tree managed by the store.
|
|
179
|
+
*
|
|
180
|
+
* @returns {any} The current state tree of your application.
|
|
181
|
+
*/
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
function getState() {
|
|
185
|
+
if (isDispatching) {
|
|
186
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
return currentState;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Adds a change listener. It will be called any time an action is dispatched,
|
|
193
|
+
* and some part of the state tree may potentially have changed. You may then
|
|
194
|
+
* call `getState()` to read the current state tree inside the callback.
|
|
195
|
+
*
|
|
196
|
+
* You may call `dispatch()` from a change listener, with the following
|
|
197
|
+
* caveats:
|
|
198
|
+
*
|
|
199
|
+
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
|
200
|
+
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
|
201
|
+
* will not have any effect on the `dispatch()` that is currently in progress.
|
|
202
|
+
* However, the next `dispatch()` call, whether nested or not, will use a more
|
|
203
|
+
* recent snapshot of the subscription list.
|
|
204
|
+
*
|
|
205
|
+
* 2. The listener should not expect to see all state changes, as the state
|
|
206
|
+
* might have been updated multiple times during a nested `dispatch()` before
|
|
207
|
+
* the listener is called. It is, however, guaranteed that all subscribers
|
|
208
|
+
* registered before the `dispatch()` started will be called with the latest
|
|
209
|
+
* state by the time it exits.
|
|
210
|
+
*
|
|
211
|
+
* @param {Function} listener A callback to be invoked on every dispatch.
|
|
212
|
+
* @returns {Function} A function to remove this change listener.
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
function subscribe(listener) {
|
|
217
|
+
if (typeof listener !== 'function') {
|
|
218
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
if (isDispatching) {
|
|
222
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
var isSubscribed = true;
|
|
226
|
+
ensureCanMutateNextListeners();
|
|
227
|
+
nextListeners.push(listener);
|
|
228
|
+
return function unsubscribe() {
|
|
229
|
+
if (!isSubscribed) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (isDispatching) {
|
|
234
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
isSubscribed = false;
|
|
238
|
+
ensureCanMutateNextListeners();
|
|
239
|
+
var index = nextListeners.indexOf(listener);
|
|
240
|
+
nextListeners.splice(index, 1);
|
|
241
|
+
currentListeners = null;
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* Dispatches an action. It is the only way to trigger a state change.
|
|
246
|
+
*
|
|
247
|
+
* The `reducer` function, used to create the store, will be called with the
|
|
248
|
+
* current state tree and the given `action`. Its return value will
|
|
249
|
+
* be considered the **next** state of the tree, and the change listeners
|
|
250
|
+
* will be notified.
|
|
251
|
+
*
|
|
252
|
+
* The base implementation only supports plain object actions. If you want to
|
|
253
|
+
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
|
254
|
+
* wrap your store creating function into the corresponding middleware. For
|
|
255
|
+
* example, see the documentation for the `redux-thunk` package. Even the
|
|
256
|
+
* middleware will eventually dispatch plain object actions using this method.
|
|
257
|
+
*
|
|
258
|
+
* @param {Object} action A plain object representing “what changed”. It is
|
|
259
|
+
* a good idea to keep actions serializable so you can record and replay user
|
|
260
|
+
* sessions, or use the time travelling `redux-devtools`. An action must have
|
|
261
|
+
* a `type` property which may not be `undefined`. It is a good idea to use
|
|
262
|
+
* string constants for action types.
|
|
263
|
+
*
|
|
264
|
+
* @returns {Object} For convenience, the same action object you dispatched.
|
|
265
|
+
*
|
|
266
|
+
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
|
267
|
+
* return something else (for example, a Promise you can await).
|
|
268
|
+
*/
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
function dispatch(action) {
|
|
272
|
+
if (!isPlainObject(action)) {
|
|
273
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if (typeof action.type === 'undefined') {
|
|
277
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
if (isDispatching) {
|
|
281
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
try {
|
|
285
|
+
isDispatching = true;
|
|
286
|
+
currentState = currentReducer(currentState, action);
|
|
287
|
+
} finally {
|
|
288
|
+
isDispatching = false;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
var listeners = currentListeners = nextListeners;
|
|
292
|
+
|
|
293
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
294
|
+
var listener = listeners[i];
|
|
295
|
+
listener();
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
return action;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Replaces the reducer currently used by the store to calculate the state.
|
|
302
|
+
*
|
|
303
|
+
* You might need this if your app implements code splitting and you want to
|
|
304
|
+
* load some of the reducers dynamically. You might also need this if you
|
|
305
|
+
* implement a hot reloading mechanism for Redux.
|
|
306
|
+
*
|
|
307
|
+
* @param {Function} nextReducer The reducer for the store to use instead.
|
|
308
|
+
* @returns {void}
|
|
309
|
+
*/
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
function replaceReducer(nextReducer) {
|
|
313
|
+
if (typeof nextReducer !== 'function') {
|
|
314
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
|
|
318
|
+
// Any reducers that existed in both the new and old rootReducer
|
|
319
|
+
// will receive the previous state. This effectively populates
|
|
320
|
+
// the new state tree with any relevant data from the old one.
|
|
321
|
+
|
|
322
|
+
dispatch({
|
|
323
|
+
type: ActionTypes.REPLACE
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Interoperability point for observable/reactive libraries.
|
|
328
|
+
* @returns {observable} A minimal observable of state changes.
|
|
329
|
+
* For more information, see the observable proposal:
|
|
330
|
+
* https://github.com/tc39/proposal-observable
|
|
331
|
+
*/
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
function observable() {
|
|
335
|
+
var _ref;
|
|
336
|
+
|
|
337
|
+
var outerSubscribe = subscribe;
|
|
338
|
+
return _ref = {
|
|
339
|
+
/**
|
|
340
|
+
* The minimal observable subscription method.
|
|
341
|
+
* @param {Object} observer Any object that can be used as an observer.
|
|
342
|
+
* The observer object should have a `next` method.
|
|
343
|
+
* @returns {subscription} An object with an `unsubscribe` method that can
|
|
344
|
+
* be used to unsubscribe the observable from the store, and prevent further
|
|
345
|
+
* emission of values from the observable.
|
|
346
|
+
*/
|
|
347
|
+
subscribe: function subscribe(observer) {
|
|
348
|
+
if (typeof observer !== 'object' || observer === null) {
|
|
349
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
function observeState() {
|
|
353
|
+
if (observer.next) {
|
|
354
|
+
observer.next(getState());
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
observeState();
|
|
359
|
+
var unsubscribe = outerSubscribe(observeState);
|
|
360
|
+
return {
|
|
361
|
+
unsubscribe: unsubscribe
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
}, _ref[$$observable] = function () {
|
|
365
|
+
return this;
|
|
366
|
+
}, _ref;
|
|
367
|
+
} // When a store is created, an "INIT" action is dispatched so that every
|
|
368
|
+
// reducer returns their initial state. This effectively populates
|
|
369
|
+
// the initial state tree.
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
dispatch({
|
|
373
|
+
type: ActionTypes.INIT
|
|
374
|
+
});
|
|
375
|
+
return _ref2 = {
|
|
376
|
+
dispatch: dispatch,
|
|
377
|
+
subscribe: subscribe,
|
|
378
|
+
getState: getState,
|
|
379
|
+
replaceReducer: replaceReducer
|
|
380
|
+
}, _ref2[$$observable] = observable, _ref2;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
export { ActionTypes as __DO_NOT_USE__ActionTypes, createStore };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { __rest, __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Pagination as Pagination$1 } from 'antd';
|
|
4
|
+
import classNames from '../node_modules/classnames/index.js';
|
|
5
|
+
|
|
6
|
+
var Pagination = function (props) {
|
|
7
|
+
var className = props.className, restProps = __rest(props, ["className"]);
|
|
8
|
+
var classes = classNames("ztxk-pagination", className, {});
|
|
9
|
+
return jsx(Pagination$1, __assign({ className: classes }, restProps));
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { Pagination as default };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React__default from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 受保护的组件,是否需要登录信息
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
interface IProps {
|
|
8
|
+
hasAuth?: boolean;
|
|
9
|
+
element: any;
|
|
10
|
+
backLogin: () => React__default.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
declare function ProtectedRoute(props: IProps): any;
|
|
13
|
+
|
|
14
|
+
export { ProtectedRoute as default };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { getToken } from 'zmdms-utils';
|
|
3
|
+
|
|
4
|
+
function ProtectedRoute(props) {
|
|
5
|
+
var _a = props.hasAuth, hasAuth = _a === void 0 ? true : _a, element = props.element, backLogin = props.backLogin;
|
|
6
|
+
var token = getToken();
|
|
7
|
+
if (!token) {
|
|
8
|
+
console.log("当前页面需要登录! 请登录成功后再进行访问!");
|
|
9
|
+
return backLogin();
|
|
10
|
+
}
|
|
11
|
+
if (hasAuth) {
|
|
12
|
+
return element;
|
|
13
|
+
}
|
|
14
|
+
return jsx("div", { children: "\u60A8\u6CA1\u6709\u6743\u9650\u8BBF\u95EE\u5F53\u524D\u9875\u9762\uFF01" });
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { ProtectedRoute as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface IProps {
|
|
5
|
+
children: React__default.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare const SuspenseComponent: ({ children }: IProps) => react_jsx_runtime.JSX.Element;
|
|
8
|
+
|
|
9
|
+
export { SuspenseComponent as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { __assign } from '../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { Suspense } from 'react';
|
|
4
|
+
|
|
5
|
+
var SuspenseComponent = function (_a) {
|
|
6
|
+
var children = _a.children;
|
|
7
|
+
return jsx(Suspense, __assign({ fallback: jsx("div", { children: "loading..." }) }, { children: children }));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { SuspenseComponent as default };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { copyColData } from '../utils.js';
|
|
3
|
+
import IconFont from '../../icon/index.js';
|
|
4
|
+
|
|
5
|
+
var CopyIcon = function (_a) {
|
|
6
|
+
var copyKey = _a.copyKey, dataSourceRef = _a.dataSourceRef;
|
|
7
|
+
return (jsx(IconFont, { type: "icon-copy", style: { fontSize: "22px" }, className: "thead-icon", title: "\u590D\u5236\u6574\u5217", onClick: function () { return copyColData(copyKey, dataSourceRef.current); } }));
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export { CopyIcon as default };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import { useEditing, useIptRef } from './hooks.js';
|
|
5
|
+
import MemoInput from '../../input/input.js';
|
|
6
|
+
import InputNumber from '../../inputnumber/inputNumber.js';
|
|
7
|
+
|
|
8
|
+
var EnhanceCell = function (props) {
|
|
9
|
+
var record = props.record, index = props.index, editable = props.editable, editableConfig = props.editableConfig, dataIndex = props.dataIndex; props.title; var onEditableSave = props.onEditableSave; props.onMouseEnter; props.onMouseLeave; var children = props.children, resetProps = __rest(props, ["record", "index", "editable", "editableConfig", "dataIndex", "title", "onEditableSave", "onMouseEnter", "onMouseLeave", "children"]);
|
|
10
|
+
// 当前数据
|
|
11
|
+
var _a = useState(record ? record[dataIndex] : undefined), val = _a[0], setVal = _a[1];
|
|
12
|
+
// 当前是否是编辑状态 性能优化,显示纯字段比显示一个完整的组件 性能要高出许多
|
|
13
|
+
var _b = useEditing(), editing = _b.editing, toggleEdit = _b.toggleEdit;
|
|
14
|
+
// 输入框ref对象
|
|
15
|
+
var iptRef = useIptRef(editing);
|
|
16
|
+
// 触发表格保存事件
|
|
17
|
+
var onSave = function (info) {
|
|
18
|
+
var _a;
|
|
19
|
+
if (!onEditableSave) {
|
|
20
|
+
throw Error("如果开启了editable, 那么必须传递 onEditableSave属性 来更改表格数据!");
|
|
21
|
+
}
|
|
22
|
+
toggleEdit();
|
|
23
|
+
onEditableSave(__assign(__assign({}, record), (_a = {}, _a[dataIndex] = val, _a)), index, dataIndex);
|
|
24
|
+
};
|
|
25
|
+
// 如果开启编辑 那么内部直接代理
|
|
26
|
+
if (editable) {
|
|
27
|
+
var _c = editableConfig || {
|
|
28
|
+
type: "input",
|
|
29
|
+
}, type = _c.type, resetEditableConfigProps = __rest(_c, ["type"]);
|
|
30
|
+
var CurrentReactNode = null;
|
|
31
|
+
// 输入框处理
|
|
32
|
+
if (type === "input") {
|
|
33
|
+
CurrentReactNode = (jsx(MemoInput, __assign({ value: val, onChange: function (e) {
|
|
34
|
+
setVal(e.target.value);
|
|
35
|
+
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef }, resetEditableConfigProps)));
|
|
36
|
+
}
|
|
37
|
+
// 数字输入框处理
|
|
38
|
+
if (type === "inputNumber") {
|
|
39
|
+
CurrentReactNode = (jsx(InputNumber, __assign({ value: val, onChange: function (value) {
|
|
40
|
+
setVal(value);
|
|
41
|
+
}, onPressEnter: onSave, onBlur: onSave, ref: iptRef }, resetEditableConfigProps)));
|
|
42
|
+
}
|
|
43
|
+
return (jsx("td", __assign({}, resetProps, { children: editing ? (jsx("div", __assign({ className: "ztxk-table__enhance-cell" }, { children: CurrentReactNode }))) : (jsx("div", __assign({ className: "ztxk-table__enhance-cell-wrap", onClick: toggleEdit }, { children: children }))) })));
|
|
44
|
+
}
|
|
45
|
+
return jsx("td", __assign({}, resetProps, { children: children }));
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export { EnhanceCell as default };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __rest, __assign } from '../../_virtual/_tslib.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
3
|
+
import classNames from '../../node_modules/classnames/index.js';
|
|
4
|
+
|
|
5
|
+
var EnhanceRow = function (props) {
|
|
6
|
+
var className = props.className, resetProps = __rest(props, ["className"]);
|
|
7
|
+
var classes = classNames("ztxk-table__enhance-row", className);
|
|
8
|
+
return jsx("tr", __assign({ className: classes }, resetProps));
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { EnhanceRow as default };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useState, useRef, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
function useEditing() {
|
|
4
|
+
var _a = useState(false), editing = _a[0], setEditing = _a[1];
|
|
5
|
+
var toggleEdit = function () {
|
|
6
|
+
setEditing(!editing);
|
|
7
|
+
};
|
|
8
|
+
return {
|
|
9
|
+
editing: editing,
|
|
10
|
+
toggleEdit: toggleEdit,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
function useIptRef(editing) {
|
|
14
|
+
// 输入框ref对象
|
|
15
|
+
var iptRef = useRef();
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
if (editing) {
|
|
18
|
+
iptRef.current.focus();
|
|
19
|
+
}
|
|
20
|
+
}, [editing]);
|
|
21
|
+
return iptRef;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useEditing, useIptRef };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { useCallback } from 'react';
|
|
2
|
+
|
|
3
|
+
function useEditChange(dataSourceRef, onTableChange) {
|
|
4
|
+
// 内部表格编辑事件
|
|
5
|
+
var onEditableSave = useCallback(function (record, index, dataIndex, otherInfo) {
|
|
6
|
+
var _a;
|
|
7
|
+
var newDataSource = (_a = dataSourceRef.current) === null || _a === void 0 ? void 0 : _a.slice();
|
|
8
|
+
if (newDataSource[index][dataIndex] === record[dataIndex]) {
|
|
9
|
+
// 说明数据没发生改变 这里什么也不做
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
newDataSource[index] = record;
|
|
13
|
+
onTableChange &&
|
|
14
|
+
onTableChange(newDataSource, dataSourceRef.current, {
|
|
15
|
+
type: "edit",
|
|
16
|
+
currentIndex: index,
|
|
17
|
+
});
|
|
18
|
+
},
|
|
19
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
|
+
[onTableChange]);
|
|
21
|
+
return onEditableSave;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { useEditChange };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Table } from 'antd';
|
|
2
|
+
import { TableProps, ColumnType } from 'antd/lib/table';
|
|
3
|
+
import { IInputProps } from '../input/input.js';
|
|
4
|
+
import { IInputNumberProps } from '../inputnumber/inputNumber.js';
|
|
5
|
+
|
|
6
|
+
type IEditableConfigOtherProps = IInputProps & IInputNumberProps;
|
|
7
|
+
interface IEditableConfig extends Partial<IEditableConfigOtherProps> {
|
|
8
|
+
type: "input" | "inputNumber";
|
|
9
|
+
[props: string]: any;
|
|
10
|
+
}
|
|
11
|
+
interface IColumnType<RecordType> extends ColumnType<RecordType> {
|
|
12
|
+
dynamicDisabled?: boolean;
|
|
13
|
+
isCopy?: boolean | string | string[];
|
|
14
|
+
editable?: boolean;
|
|
15
|
+
editableConfig?: IEditableConfig;
|
|
16
|
+
}
|
|
17
|
+
interface IColumnGroupType<RecordType> extends Omit<IColumnType<RecordType>, "dataIndex"> {
|
|
18
|
+
children: IColumnsType<RecordType>;
|
|
19
|
+
}
|
|
20
|
+
type IColumnsTypeProp<RecordType> = IColumnGroupType<RecordType> | IColumnType<RecordType>;
|
|
21
|
+
declare type IColumnsType<RecordType = unknown> = IColumnsTypeProp<RecordType>[];
|
|
22
|
+
interface ITableProps<RecordType> extends Omit<TableProps<RecordType>, "columns"> {
|
|
23
|
+
dynamicKey?: string;
|
|
24
|
+
columns?: IColumnsType<RecordType>;
|
|
25
|
+
onTableChange?: (dataSource: any, preDataSource: any, other?: {
|
|
26
|
+
currentIndex: number;
|
|
27
|
+
type?: "edit" | "move" | "add" | "del";
|
|
28
|
+
}) => void;
|
|
29
|
+
isEdit?: boolean;
|
|
30
|
+
isMove?: boolean;
|
|
31
|
+
}
|
|
32
|
+
interface TableComponent<T> extends React.FC<ITableProps<T>> {
|
|
33
|
+
SELECTION_COLUMN: typeof Table.SELECTION_COLUMN;
|
|
34
|
+
EXPAND_COLUMN: typeof Table.EXPAND_COLUMN;
|
|
35
|
+
SELECTION_ALL: typeof Table.SELECTION_ALL;
|
|
36
|
+
SELECTION_INVERT: typeof Table.SELECTION_INVERT;
|
|
37
|
+
SELECTION_NONE: typeof Table.SELECTION_NONE;
|
|
38
|
+
Column: typeof Table.Column;
|
|
39
|
+
ColumnGroup: typeof Table.ColumnGroup;
|
|
40
|
+
Summary: typeof Table.Summary;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { IColumnGroupType, IColumnType, IColumnsType, IColumnsTypeProp, IEditableConfig, ITableProps, TableComponent };
|