iglooform 3.0.13 → 3.0.14
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/.dumi/tmp/core/defineApp.ts +1 -1
- package/.dumi/tmp/core/helmet.ts +1 -1
- package/.dumi/tmp/core/history.ts +1 -1
- package/.dumi/tmp/core/historyIntelli.ts +1 -1
- package/.dumi/tmp/core/plugin.ts +2 -2
- package/.dumi/tmp/core/polyfill.ts +197 -197
- package/.dumi/tmp/core/route.tsx +33 -33
- package/.dumi/tmp/dumi/exports.ts +1 -1
- package/.dumi/tmp/dumi/locales/runtime.tsx +2 -2
- package/.dumi/tmp/dumi/meta/index.ts +33 -33
- package/.dumi/tmp/dumi/meta/runtime.ts +1 -1
- package/.dumi/tmp/dumi/theme/ContextWrapper.tsx +2 -2
- package/.dumi/tmp/dumi/theme/builtins/API.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Badge.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Container.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Previewer.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/SourceCode.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Table.ts +1 -1
- package/.dumi/tmp/dumi/theme/builtins/Tree.ts +1 -1
- package/.dumi/tmp/dumi/theme/layouts/DocLayout.ts +1 -1
- package/.dumi/tmp/dumi/theme/loading.tsx +1 -1
- package/.dumi/tmp/dumi/theme/slots/ColorSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Content.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentFooter.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/ContentTabs.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Features.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Footer.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Header.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeaderExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Hero.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/HeroTitle.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/LangSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Logo.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Navbar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NavbarExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/NotFound.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActions.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/PreviewerActionsExtra.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/RtlSwitch.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SearchBar.ts +2 -2
- package/.dumi/tmp/dumi/theme/slots/SearchResult.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Sidebar.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/SocialIcon.ts +1 -1
- package/.dumi/tmp/dumi/theme/slots/Toc.ts +1 -1
- package/.dumi/tmp/exports.ts +5 -5
- package/.dumi/tmp/testBrowser.tsx +3 -3
- package/.dumi/tmp/umi.ts +4 -4
- package/.idea/iglooform.iml +4 -7
- package/.idea/misc.xml +5 -0
- package/es/app/context.d.ts +9 -0
- package/es/app/context.js +6 -0
- package/es/app/index.d.ts +8 -0
- package/es/app/index.js +33 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/layout/defaultFooter.js +2 -2
- package/es/message/index.d.ts +3 -1
- package/es/message/index.js +2 -0
- package/es/message/useMessage.d.ts +6 -0
- package/es/message/useMessage.js +52 -0
- package/es/modal/index.d.ts +3 -1
- package/es/modal/index.js +2 -0
- package/es/modal/useModal.d.ts +12 -0
- package/es/modal/useModal.js +135 -0
- package/es/radio/index.js +1 -17
- package/es/radio/radio-group-with-other.js +5 -2
- package/lib/app/context.d.ts +9 -0
- package/lib/app/context.js +13 -0
- package/lib/app/index.d.ts +8 -0
- package/lib/app/index.js +41 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +7 -0
- package/lib/layout/defaultFooter.js +2 -2
- package/lib/message/index.d.ts +3 -1
- package/lib/message/index.js +2 -0
- package/lib/message/useMessage.d.ts +6 -0
- package/lib/message/useMessage.js +60 -0
- package/lib/modal/index.d.ts +3 -1
- package/lib/modal/index.js +2 -0
- package/lib/modal/useModal.d.ts +12 -0
- package/lib/modal/useModal.js +142 -0
- package/lib/radio/index.js +0 -16
- package/lib/radio/radio-group-with-other.js +5 -2
- package/package.json +1 -1
- package/.idea/codeStyles/Project.xml +0 -59
- package/.idea/codeStyles/codeStyleConfig.xml +0 -5
- package/.idea/prettier.xml +0 -6
- package/yarn-error.log +0 -16168
package/es/app/index.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
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(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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import { useContext } from 'react';
|
|
8
|
+
import AppContext from "./context";
|
|
9
|
+
import useModal from "../modal/useModal";
|
|
10
|
+
import useMessage from "../message/useMessage";
|
|
11
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
var App = function App(_ref) {
|
|
13
|
+
var children = _ref.children;
|
|
14
|
+
var _useModal = useModal(),
|
|
15
|
+
_useModal2 = _slicedToArray(_useModal, 2),
|
|
16
|
+
modal = _useModal2[0],
|
|
17
|
+
modalContextHolder = _useModal2[1];
|
|
18
|
+
var _useMessage = useMessage(),
|
|
19
|
+
_useMessage2 = _slicedToArray(_useMessage, 2),
|
|
20
|
+
message = _useMessage2[0],
|
|
21
|
+
messageContextHolder = _useMessage2[1];
|
|
22
|
+
return /*#__PURE__*/_jsxs(AppContext.Provider, {
|
|
23
|
+
value: {
|
|
24
|
+
modal: modal,
|
|
25
|
+
message: message
|
|
26
|
+
},
|
|
27
|
+
children: [modalContextHolder, messageContextHolder, children]
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
App.useApp = function () {
|
|
31
|
+
return useContext(AppContext);
|
|
32
|
+
};
|
|
33
|
+
export default App;
|
package/es/index.d.ts
CHANGED
|
@@ -45,3 +45,4 @@ export { default as FormSteps } from './free-form/steps';
|
|
|
45
45
|
export { default as FormStep } from './free-form/step';
|
|
46
46
|
export { default as FormSection } from './free-form/section';
|
|
47
47
|
export { default as FormAddableSection } from './free-form/addable-section';
|
|
48
|
+
export { default as App } from './app';
|
package/es/index.js
CHANGED
|
@@ -44,4 +44,5 @@ export { default as FormPage } from "./free-form/page";
|
|
|
44
44
|
export { default as FormSteps } from "./free-form/steps";
|
|
45
45
|
export { default as FormStep } from "./free-form/step";
|
|
46
46
|
export { default as FormSection } from "./free-form/section";
|
|
47
|
-
export { default as FormAddableSection } from "./free-form/addable-section";
|
|
47
|
+
export { default as FormAddableSection } from "./free-form/addable-section";
|
|
48
|
+
export { default as App } from "./app";
|
|
@@ -32,7 +32,7 @@ var DefaultFooter = function DefaultFooter(props) {
|
|
|
32
32
|
className: "footer-bottom",
|
|
33
33
|
children: [/*#__PURE__*/_jsx(Typography, {
|
|
34
34
|
level: "body3",
|
|
35
|
-
children: "\xA9 ".concat(new Date().getFullYear(), " Powered by
|
|
35
|
+
children: "\xA9 ".concat(new Date().getFullYear(), " Powered by Axinan Pte Ltd. All Rights Reserved.")
|
|
36
36
|
}), /*#__PURE__*/_jsxs(Typography, {
|
|
37
37
|
level: "body3",
|
|
38
38
|
children: [/*#__PURE__*/_jsx(Button, {
|
|
@@ -73,7 +73,7 @@ var DefaultFooter = function DefaultFooter(props) {
|
|
|
73
73
|
children: [/*#__PURE__*/_jsx("div", {
|
|
74
74
|
children: /*#__PURE__*/_jsxs(Typography, {
|
|
75
75
|
level: "body3",
|
|
76
|
-
children: ["\xA9 ".concat(new Date().getFullYear(), " Powered by
|
|
76
|
+
children: ["\xA9 ".concat(new Date().getFullYear(), " Powered by Axinan Pte Ltd."), /*#__PURE__*/_jsx("div", {
|
|
77
77
|
children: "All Rights Reserved."
|
|
78
78
|
})]
|
|
79
79
|
})
|
package/es/message/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import useMessage from './useMessage';
|
|
2
3
|
import './style';
|
|
3
4
|
type ConfigContent = React.ReactNode | string;
|
|
4
5
|
type ConfigDuration = number;
|
|
5
|
-
interface IglooGlobalMessage {
|
|
6
|
+
export interface IglooGlobalMessage {
|
|
6
7
|
info(content: ConfigContent, duration?: ConfigDuration): any;
|
|
7
8
|
success(content: ConfigContent, duration?: ConfigDuration): any;
|
|
8
9
|
error(content: ConfigContent, duration?: ConfigDuration): any;
|
|
9
10
|
warning(content: ConfigContent, duration?: ConfigDuration): any;
|
|
11
|
+
useMessage: typeof useMessage;
|
|
10
12
|
}
|
|
11
13
|
declare const IglooMessage: IglooGlobalMessage;
|
|
12
14
|
export default IglooMessage;
|
package/es/message/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
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
2
|
import { message } from 'antd';
|
|
3
3
|
import AlertMessage from "../alert-message";
|
|
4
|
+
import useMessage from "./useMessage";
|
|
4
5
|
import "./style";
|
|
5
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
6
7
|
var IglooMessage = {};
|
|
@@ -88,4 +89,5 @@ IglooMessage.info = function (content, duration) {
|
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
};
|
|
92
|
+
IglooMessage.useMessage = useMessage;
|
|
91
93
|
export default IglooMessage;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { IglooGlobalMessage } from './';
|
|
3
|
+
import './style';
|
|
4
|
+
export type HookAPI = Omit<IglooGlobalMessage, 'useMessage'>;
|
|
5
|
+
declare const useMessage: () => readonly [HookAPI, ReactElement];
|
|
6
|
+
export default useMessage;
|
|
@@ -0,0 +1,52 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
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; }
|
|
6
|
+
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; } }
|
|
7
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
+
import { useCallback, useMemo } from 'react';
|
|
9
|
+
import { message } from 'antd';
|
|
10
|
+
import AlertMessage from "../alert-message";
|
|
11
|
+
import "./style";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
var useMessage = function useMessage() {
|
|
14
|
+
var _message$useMessage = message.useMessage(),
|
|
15
|
+
_message$useMessage2 = _slicedToArray(_message$useMessage, 2),
|
|
16
|
+
api = _message$useMessage2[0],
|
|
17
|
+
contextHolder = _message$useMessage2[1];
|
|
18
|
+
var getStaticFunc = useCallback(function (type) {
|
|
19
|
+
return function (content, duration) {
|
|
20
|
+
var func = api[type];
|
|
21
|
+
switch (_typeof(content)) {
|
|
22
|
+
case 'string':
|
|
23
|
+
return func({
|
|
24
|
+
className: 'iglooform-global-message',
|
|
25
|
+
content: /*#__PURE__*/_jsx(AlertMessage, {
|
|
26
|
+
type: type,
|
|
27
|
+
message: content
|
|
28
|
+
}),
|
|
29
|
+
icon: /*#__PURE__*/_jsx("div", {}),
|
|
30
|
+
duration: duration === undefined ? 3 : duration
|
|
31
|
+
});
|
|
32
|
+
default:
|
|
33
|
+
return func({
|
|
34
|
+
className: 'iglooform-global-message',
|
|
35
|
+
content: content,
|
|
36
|
+
icon: /*#__PURE__*/_jsx("div", {}),
|
|
37
|
+
duration: duration === undefined ? 3 : duration
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}, []);
|
|
42
|
+
var fns = useMemo(function () {
|
|
43
|
+
return {
|
|
44
|
+
info: getStaticFunc('info'),
|
|
45
|
+
success: getStaticFunc('success'),
|
|
46
|
+
error: getStaticFunc('error'),
|
|
47
|
+
warning: getStaticFunc('warning')
|
|
48
|
+
};
|
|
49
|
+
}, []);
|
|
50
|
+
return [fns, contextHolder];
|
|
51
|
+
};
|
|
52
|
+
export default useMessage;
|
package/es/modal/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ModalFuncProps, ModalProps } from 'antd/lib/modal';
|
|
3
3
|
import { FormBasicConfig, FormItemConfig } from '../types';
|
|
4
|
+
import useModal from './useModal';
|
|
4
5
|
import './style';
|
|
5
6
|
interface FormModalProps {
|
|
6
7
|
mode?: 'form' | 'normal';
|
|
@@ -17,7 +18,7 @@ interface ModalFuncReturn {
|
|
|
17
18
|
destroy: Function;
|
|
18
19
|
update: (props: ModalProps & ModalFuncProps & FormModalProps) => any;
|
|
19
20
|
}
|
|
20
|
-
type ModalFunction = (props: ModalProps & ModalFuncProps & FormModalProps) => ModalFuncReturn;
|
|
21
|
+
export type ModalFunction = (props: ModalProps & ModalFuncProps & FormModalProps) => ModalFuncReturn;
|
|
21
22
|
interface ModalType extends FC<ModalProps & ModalFuncProps & FormModalProps> {
|
|
22
23
|
confirm: ModalFunction;
|
|
23
24
|
info: ModalFunction;
|
|
@@ -26,6 +27,7 @@ interface ModalType extends FC<ModalProps & ModalFuncProps & FormModalProps> {
|
|
|
26
27
|
success: ModalFunction;
|
|
27
28
|
noFooter: ModalFunction;
|
|
28
29
|
destroyAll: Function;
|
|
30
|
+
useModal: typeof useModal;
|
|
29
31
|
}
|
|
30
32
|
declare const IglooModal: ModalType;
|
|
31
33
|
export default IglooModal;
|
package/es/modal/index.js
CHANGED
|
@@ -21,6 +21,7 @@ import Button from "../button";
|
|
|
21
21
|
import Form from "../form";
|
|
22
22
|
import { LocaleContext, LocaleProvider } from "../locale";
|
|
23
23
|
import { staticLang } from "../locale/format-message";
|
|
24
|
+
import useModal from "./useModal";
|
|
24
25
|
import "./style";
|
|
25
26
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
27
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -241,4 +242,5 @@ IglooModal.destroyAll = function () {
|
|
|
241
242
|
return destroy();
|
|
242
243
|
});
|
|
243
244
|
};
|
|
245
|
+
IglooModal.useModal = useModal;
|
|
244
246
|
export default IglooModal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { type ModalFunction } from './';
|
|
3
|
+
export interface HookAPI {
|
|
4
|
+
confirm: ModalFunction;
|
|
5
|
+
info: ModalFunction;
|
|
6
|
+
warning: ModalFunction;
|
|
7
|
+
error: ModalFunction;
|
|
8
|
+
success: ModalFunction;
|
|
9
|
+
noFooter: ModalFunction;
|
|
10
|
+
}
|
|
11
|
+
declare const useModal: () => readonly [HookAPI, ReactElement];
|
|
12
|
+
export default useModal;
|
|
@@ -0,0 +1,135 @@
|
|
|
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
|
+
var _excluded = ["content", "onOk", "onCancel"];
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { createRef, forwardRef, memo, useCallback, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
17
|
+
import usePatchElement from 'antd/es/_util/hooks/usePatchElement';
|
|
18
|
+
import classnames from 'classnames';
|
|
19
|
+
import IglooModal from "./";
|
|
20
|
+
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
var ElementsHolder = /*#__PURE__*/memo( /*#__PURE__*/forwardRef(function (_, ref) {
|
|
23
|
+
var _usePatchElement = usePatchElement(),
|
|
24
|
+
_usePatchElement2 = _slicedToArray(_usePatchElement, 2),
|
|
25
|
+
elements = _usePatchElement2[0],
|
|
26
|
+
patchElement = _usePatchElement2[1];
|
|
27
|
+
useImperativeHandle(ref, function () {
|
|
28
|
+
return {
|
|
29
|
+
patchElement: patchElement
|
|
30
|
+
};
|
|
31
|
+
}, []);
|
|
32
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
33
|
+
children: elements
|
|
34
|
+
});
|
|
35
|
+
}));
|
|
36
|
+
var HookModal = /*#__PURE__*/forwardRef(function (config, ref) {
|
|
37
|
+
var _useState = useState(true),
|
|
38
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
+
open = _useState2[0],
|
|
40
|
+
setOpen = _useState2[1];
|
|
41
|
+
var _useState3 = useState(config),
|
|
42
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
43
|
+
modalConfig = _useState4[0],
|
|
44
|
+
setModalConfig = _useState4[1];
|
|
45
|
+
var destroy = useCallback(function () {
|
|
46
|
+
return setOpen(false);
|
|
47
|
+
}, []);
|
|
48
|
+
useImperativeHandle(ref, function () {
|
|
49
|
+
return {
|
|
50
|
+
destroy: destroy,
|
|
51
|
+
update: function update(newConfig) {
|
|
52
|
+
return setModalConfig(function (oldConfig) {
|
|
53
|
+
return _objectSpread(_objectSpread({}, oldConfig), newConfig);
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}, []);
|
|
58
|
+
var content = modalConfig.content,
|
|
59
|
+
_onOk = modalConfig.onOk,
|
|
60
|
+
_onCancel = modalConfig.onCancel,
|
|
61
|
+
rest = _objectWithoutProperties(modalConfig, _excluded);
|
|
62
|
+
return /*#__PURE__*/_jsx(IglooModal, _objectSpread(_objectSpread({}, rest), {}, {
|
|
63
|
+
open: open,
|
|
64
|
+
onCancel: function onCancel() {
|
|
65
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
66
|
+
args[_key] = arguments[_key];
|
|
67
|
+
}
|
|
68
|
+
_onCancel === null || _onCancel === void 0 ? void 0 : _onCancel.apply(void 0, args);
|
|
69
|
+
destroy();
|
|
70
|
+
},
|
|
71
|
+
onOk: function onOk() {
|
|
72
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
73
|
+
args[_key2] = arguments[_key2];
|
|
74
|
+
}
|
|
75
|
+
var rst = _onOk === null || _onOk === void 0 ? void 0 : _onOk.apply(void 0, args);
|
|
76
|
+
if (rst instanceof Promise) {
|
|
77
|
+
rst.then(function () {
|
|
78
|
+
destroy();
|
|
79
|
+
});
|
|
80
|
+
} else {
|
|
81
|
+
destroy();
|
|
82
|
+
}
|
|
83
|
+
return rst;
|
|
84
|
+
},
|
|
85
|
+
children: content
|
|
86
|
+
}));
|
|
87
|
+
});
|
|
88
|
+
var uuid = 0;
|
|
89
|
+
var useModal = function useModal() {
|
|
90
|
+
var holderRef = useRef(null);
|
|
91
|
+
var staticFunc = useCallback(function (config) {
|
|
92
|
+
var _holderRef$current;
|
|
93
|
+
uuid++;
|
|
94
|
+
var modalRef = /*#__PURE__*/createRef();
|
|
95
|
+
var close;
|
|
96
|
+
var modal = /*#__PURE__*/_jsx(HookModal, _objectSpread(_objectSpread({}, config), {}, {
|
|
97
|
+
ref: modalRef,
|
|
98
|
+
afterClose: function afterClose() {
|
|
99
|
+
var _config$afterClose, _close;
|
|
100
|
+
(_config$afterClose = config.afterClose) === null || _config$afterClose === void 0 ? void 0 : _config$afterClose.call(config);
|
|
101
|
+
(_close = close) === null || _close === void 0 ? void 0 : _close();
|
|
102
|
+
}
|
|
103
|
+
}), 'modal-' + uuid);
|
|
104
|
+
close = (_holderRef$current = holderRef.current) === null || _holderRef$current === void 0 ? void 0 : _holderRef$current.patchElement(modal);
|
|
105
|
+
return {
|
|
106
|
+
destroy: function destroy() {
|
|
107
|
+
var _modalRef$current;
|
|
108
|
+
(_modalRef$current = modalRef.current) === null || _modalRef$current === void 0 ? void 0 : _modalRef$current.destroy();
|
|
109
|
+
},
|
|
110
|
+
update: function update(newConfig) {
|
|
111
|
+
var _modalRef$current2;
|
|
112
|
+
(_modalRef$current2 = modalRef.current) === null || _modalRef$current2 === void 0 ? void 0 : _modalRef$current2.update(newConfig);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
}, []);
|
|
116
|
+
var fns = useMemo(function () {
|
|
117
|
+
return {
|
|
118
|
+
confirm: staticFunc,
|
|
119
|
+
info: staticFunc,
|
|
120
|
+
warning: staticFunc,
|
|
121
|
+
error: staticFunc,
|
|
122
|
+
success: staticFunc,
|
|
123
|
+
noFooter: function noFooter(config) {
|
|
124
|
+
return staticFunc(_objectSpread(_objectSpread({}, config), {}, {
|
|
125
|
+
footer: null,
|
|
126
|
+
className: classnames('igloo-modal-no-footer', config.className)
|
|
127
|
+
}));
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
}, []);
|
|
131
|
+
return [fns, /*#__PURE__*/_jsx(ElementsHolder, {
|
|
132
|
+
ref: holderRef
|
|
133
|
+
})];
|
|
134
|
+
};
|
|
135
|
+
export default useModal;
|
package/es/radio/index.js
CHANGED
|
@@ -2,12 +2,6 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
var _excluded = ["className"],
|
|
3
3
|
_excluded2 = ["className", "options", "radioType", "value", "clearWhenOptionsUpdated", "preview"],
|
|
4
4
|
_excluded3 = ["label", "value", "extraInfo"];
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
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."); }
|
|
7
|
-
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); }
|
|
8
|
-
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; }
|
|
9
|
-
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; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
5
|
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; }
|
|
12
6
|
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; }
|
|
13
7
|
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; }
|
|
@@ -15,7 +9,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
15
9
|
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); }
|
|
16
10
|
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; }
|
|
17
11
|
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; }
|
|
18
|
-
import React, { useEffect,
|
|
12
|
+
import React, { useEffect, useRef, useContext } from 'react';
|
|
19
13
|
import { Radio, Row, Col } from 'antd';
|
|
20
14
|
import omit from 'omit.js';
|
|
21
15
|
import classnames from 'classnames';
|
|
@@ -48,19 +42,9 @@ export var InnerRadioGroup = function InnerRadioGroup(_ref) {
|
|
|
48
42
|
clearWhenOptionsUpdated = _ref$clearWhenOptions === void 0 ? false : _ref$clearWhenOptions,
|
|
49
43
|
preview = _ref.preview,
|
|
50
44
|
rest = _objectWithoutProperties(_ref, _excluded2);
|
|
51
|
-
var _useState = useState(value),
|
|
52
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
53
|
-
selected = _useState2[0],
|
|
54
|
-
setSelected = _useState2[1];
|
|
55
45
|
var originOptions = useRef(options);
|
|
56
46
|
var _useContext = useContext(LocaleContext),
|
|
57
47
|
formatMessage = _useContext.formatMessage;
|
|
58
|
-
useEffect(function () {
|
|
59
|
-
typeof rest.onChange === 'function' && value !== selected && rest.onChange(selected);
|
|
60
|
-
}, [selected]);
|
|
61
|
-
useEffect(function () {
|
|
62
|
-
setSelected(value);
|
|
63
|
-
}, [value]);
|
|
64
48
|
useEffect(function () {
|
|
65
49
|
var setFieldValue = rest.setFieldValue;
|
|
66
50
|
if (compareOptions(options, originOptions.current)) {
|
|
@@ -52,13 +52,16 @@ var InnerRadioGroupWithOther = function InnerRadioGroupWithOther(_ref) {
|
|
|
52
52
|
var setFieldValue = rest.setFieldValue;
|
|
53
53
|
if (compareOptions(options, originOptions.current)) {
|
|
54
54
|
if (clearWhenOptionsUpdated) {
|
|
55
|
-
typeof setFieldValue === 'function'
|
|
55
|
+
if (typeof setFieldValue === 'function') {
|
|
56
|
+
setFieldValue();
|
|
57
|
+
enableOther(false);
|
|
58
|
+
}
|
|
56
59
|
} else {
|
|
57
60
|
var foundValue = options.find(function (option) {
|
|
58
61
|
return Array.isArray(value) ? value.includes(option.value) : option.value === value;
|
|
59
62
|
});
|
|
60
63
|
if (!foundValue && value !== undefined) {
|
|
61
|
-
typeof setFieldValue === 'function' && setFieldValue();
|
|
64
|
+
typeof setFieldValue === 'function' && setFieldValue(otherEnabled ? value : undefined);
|
|
62
65
|
}
|
|
63
66
|
}
|
|
64
67
|
originOptions.current = options;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { HookAPI as ModalHookAPI } from '../modal/useModal';
|
|
3
|
+
import type { HookAPI as MessageHookAPI } from '../message/useMessage';
|
|
4
|
+
export type AppContextType = {
|
|
5
|
+
modal: ModalHookAPI;
|
|
6
|
+
message: MessageHookAPI;
|
|
7
|
+
};
|
|
8
|
+
declare const AppContext: import("react").Context<AppContextType>;
|
|
9
|
+
export default AppContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var AppContext = /*#__PURE__*/(0, _react.createContext)({
|
|
9
|
+
modal: {},
|
|
10
|
+
message: {}
|
|
11
|
+
});
|
|
12
|
+
var _default = AppContext;
|
|
13
|
+
exports.default = _default;
|
package/lib/app/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _context = _interopRequireDefault(require("./context"));
|
|
9
|
+
var _useModal3 = _interopRequireDefault(require("../modal/useModal"));
|
|
10
|
+
var _useMessage3 = _interopRequireDefault(require("../message/useMessage"));
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
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
|
+
var App = function App(_ref) {
|
|
20
|
+
var children = _ref.children;
|
|
21
|
+
var _useModal = (0, _useModal3.default)(),
|
|
22
|
+
_useModal2 = _slicedToArray(_useModal, 2),
|
|
23
|
+
modal = _useModal2[0],
|
|
24
|
+
modalContextHolder = _useModal2[1];
|
|
25
|
+
var _useMessage = (0, _useMessage3.default)(),
|
|
26
|
+
_useMessage2 = _slicedToArray(_useMessage, 2),
|
|
27
|
+
message = _useMessage2[0],
|
|
28
|
+
messageContextHolder = _useMessage2[1];
|
|
29
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_context.default.Provider, {
|
|
30
|
+
value: {
|
|
31
|
+
modal: modal,
|
|
32
|
+
message: message
|
|
33
|
+
},
|
|
34
|
+
children: [modalContextHolder, messageContextHolder, children]
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
App.useApp = function () {
|
|
38
|
+
return (0, _react.useContext)(_context.default);
|
|
39
|
+
};
|
|
40
|
+
var _default = App;
|
|
41
|
+
exports.default = _default;
|
package/lib/index.d.ts
CHANGED
|
@@ -45,3 +45,4 @@ export { default as FormSteps } from './free-form/steps';
|
|
|
45
45
|
export { default as FormStep } from './free-form/step';
|
|
46
46
|
export { default as FormSection } from './free-form/section';
|
|
47
47
|
export { default as FormAddableSection } from './free-form/addable-section';
|
|
48
|
+
export { default as App } from './app';
|
package/lib/index.js
CHANGED
|
@@ -34,6 +34,12 @@ Object.defineProperty(exports, "Amount", {
|
|
|
34
34
|
return _input.Amount;
|
|
35
35
|
}
|
|
36
36
|
});
|
|
37
|
+
Object.defineProperty(exports, "App", {
|
|
38
|
+
enumerable: true,
|
|
39
|
+
get: function get() {
|
|
40
|
+
return _app.default;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
37
43
|
Object.defineProperty(exports, "AttachedSelect", {
|
|
38
44
|
enumerable: true,
|
|
39
45
|
get: function get() {
|
|
@@ -483,6 +489,7 @@ var _steps = _interopRequireDefault(require("./free-form/steps"));
|
|
|
483
489
|
var _step = _interopRequireDefault(require("./free-form/step"));
|
|
484
490
|
var _section = _interopRequireDefault(require("./free-form/section"));
|
|
485
491
|
var _addableSection = _interopRequireDefault(require("./free-form/addable-section"));
|
|
492
|
+
var _app = _interopRequireDefault(require("./app"));
|
|
486
493
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
487
494
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
488
495
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -37,7 +37,7 @@ var DefaultFooter = function DefaultFooter(props) {
|
|
|
37
37
|
className: "footer-bottom",
|
|
38
38
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_typography.default, {
|
|
39
39
|
level: "body3",
|
|
40
|
-
children: "\xA9 ".concat(new Date().getFullYear(), " Powered by
|
|
40
|
+
children: "\xA9 ".concat(new Date().getFullYear(), " Powered by Axinan Pte Ltd. All Rights Reserved.")
|
|
41
41
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_typography.default, {
|
|
42
42
|
level: "body3",
|
|
43
43
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_button.default, {
|
|
@@ -78,7 +78,7 @@ var DefaultFooter = function DefaultFooter(props) {
|
|
|
78
78
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
79
79
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_typography.default, {
|
|
80
80
|
level: "body3",
|
|
81
|
-
children: ["\xA9 ".concat(new Date().getFullYear(), " Powered by
|
|
81
|
+
children: ["\xA9 ".concat(new Date().getFullYear(), " Powered by Axinan Pte Ltd."), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
82
82
|
children: "All Rights Reserved."
|
|
83
83
|
})]
|
|
84
84
|
})
|
package/lib/message/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import useMessage from './useMessage';
|
|
2
3
|
import './style';
|
|
3
4
|
type ConfigContent = React.ReactNode | string;
|
|
4
5
|
type ConfigDuration = number;
|
|
5
|
-
interface IglooGlobalMessage {
|
|
6
|
+
export interface IglooGlobalMessage {
|
|
6
7
|
info(content: ConfigContent, duration?: ConfigDuration): any;
|
|
7
8
|
success(content: ConfigContent, duration?: ConfigDuration): any;
|
|
8
9
|
error(content: ConfigContent, duration?: ConfigDuration): any;
|
|
9
10
|
warning(content: ConfigContent, duration?: ConfigDuration): any;
|
|
11
|
+
useMessage: typeof useMessage;
|
|
10
12
|
}
|
|
11
13
|
declare const IglooMessage: IglooGlobalMessage;
|
|
12
14
|
export default IglooMessage;
|
package/lib/message/index.js
CHANGED
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _antd = require("antd");
|
|
8
8
|
var _alertMessage = _interopRequireDefault(require("../alert-message"));
|
|
9
|
+
var _useMessage = _interopRequireDefault(require("./useMessage"));
|
|
9
10
|
require("./style");
|
|
10
11
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -95,5 +96,6 @@ IglooMessage.info = function (content, duration) {
|
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
98
|
};
|
|
99
|
+
IglooMessage.useMessage = _useMessage.default;
|
|
98
100
|
var _default = IglooMessage;
|
|
99
101
|
exports.default = _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { IglooGlobalMessage } from './';
|
|
3
|
+
import './style';
|
|
4
|
+
export type HookAPI = Omit<IglooGlobalMessage, 'useMessage'>;
|
|
5
|
+
declare const useMessage: () => readonly [HookAPI, ReactElement];
|
|
6
|
+
export default useMessage;
|