@pisell/materials 2.2.16 → 2.2.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.
@@ -4,6 +4,7 @@ import PisellContext, { globalConfig } from "./context";
4
4
  import { useResponsive } from "../../hooks";
5
5
  import useEngineContext from "../../hooks/useEngineContext";
6
6
  import { setMessage } from "../pisellMessage";
7
+ import { setModal } from "../pisellModal/components/functions";
7
8
  var platformMap = {
8
9
  phone: 'h5',
9
10
  pc: 'pc',
@@ -28,6 +29,7 @@ var PisellConfigProvider = function PisellConfigProvider(props) {
28
29
  };
29
30
  var staticFunction = App.useApp();
30
31
  setMessage(staticFunction.message);
32
+ setModal(staticFunction.modal);
31
33
  globalConfig.setConfig(config);
32
34
  return /*#__PURE__*/React.createElement(PisellContext.Provider, {
33
35
  value: config
@@ -1,12 +1,30 @@
1
1
  import { ModalFuncProps } from 'antd';
2
+ import { useAppProps } from 'antd/es/app/context';
2
3
  import { PisellContextType } from '../../../pisell-config-provider/context';
3
4
  import './index.less';
5
+ declare const setModal: (m: useAppProps['modal']) => void;
4
6
  export interface PisellModalFuncProps extends ModalFuncProps {
5
7
  platform?: PisellContextType['platform'];
6
8
  }
7
- export declare const info: (props: PisellModalFuncProps) => any;
8
- export declare const success: (props: PisellModalFuncProps) => any;
9
- export declare const error: (props: PisellModalFuncProps) => any;
10
- export declare const warning: (props: PisellModalFuncProps) => any;
9
+ export declare const info: (props: PisellModalFuncProps) => {
10
+ destroy: () => void;
11
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
12
+ };
13
+ export declare const success: (props: PisellModalFuncProps) => {
14
+ destroy: () => void;
15
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
16
+ };
17
+ export declare const error: (props: PisellModalFuncProps) => {
18
+ destroy: () => void;
19
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
20
+ };
21
+ export declare const warning: (props: PisellModalFuncProps) => {
22
+ destroy: () => void;
23
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
24
+ };
11
25
  export declare const warn: (props: PisellModalFuncProps) => any;
12
- export declare const confirm: (props: PisellModalFuncProps) => any;
26
+ export declare const confirm: (props: PisellModalFuncProps) => {
27
+ destroy: () => void;
28
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
29
+ };
30
+ export { setModal };
@@ -4,15 +4,19 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  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); }
7
- import Modal from "../../../modal";
8
7
  import classNames from 'classnames';
9
8
  import { globalConfig } from "../../../pisell-config-provider/context";
10
9
  import "./index.less";
10
+ var Modal;
11
+ var setModal = function setModal(m) {
12
+ Modal = m;
13
+ };
11
14
  var genConfig = function genConfig(props) {
12
15
  var _globalConfig$getConf = globalConfig.getConfig(),
13
16
  platform = _globalConfig$getConf.platform;
14
17
  return _objectSpread(_objectSpread({}, props), {}, {
15
18
  wrapClassName: classNames('pisell-modal-function-wrap', _defineProperty({}, 'pisell-modal-mobile-function-wrap', platform === 'h5')),
19
+ transitionName: "pisell-move-down",
16
20
  cancelButtonProps: _objectSpread({
17
21
  block: true,
18
22
  size: 'large'
@@ -41,4 +45,5 @@ export var warn = function warn(props) {
41
45
  };
42
46
  export var confirm = function confirm(props) {
43
47
  return Modal.confirm(genConfig(props));
44
- };
48
+ };
49
+ export { setModal };
@@ -32,12 +32,27 @@ export interface PisellModalProps extends ModalProps {
32
32
  }
33
33
  declare const PisellModal: {
34
34
  (props: PisellModalProps): React.JSX.Element;
35
- confirm: (props: import("./components/functions").PisellModalFuncProps) => any;
36
- info: (props: import("./components/functions").PisellModalFuncProps) => any;
37
- error: (props: import("./components/functions").PisellModalFuncProps) => any;
35
+ confirm: (props: import("./components/functions").PisellModalFuncProps) => {
36
+ destroy: () => void;
37
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
38
+ };
39
+ info: (props: import("./components/functions").PisellModalFuncProps) => {
40
+ destroy: () => void;
41
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
42
+ };
43
+ error: (props: import("./components/functions").PisellModalFuncProps) => {
44
+ destroy: () => void;
45
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
46
+ };
38
47
  warn: (props: import("./components/functions").PisellModalFuncProps) => any;
39
- warning: (props: import("./components/functions").PisellModalFuncProps) => any;
40
- success: (props: import("./components/functions").PisellModalFuncProps) => any;
48
+ warning: (props: import("./components/functions").PisellModalFuncProps) => {
49
+ destroy: () => void;
50
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
51
+ };
52
+ success: (props: import("./components/functions").PisellModalFuncProps) => {
53
+ destroy: () => void;
54
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
55
+ };
41
56
  Information: (props: import("./components/Information").InformationProps) => React.JSX.Element;
42
57
  };
43
58
  export default PisellModal;
@@ -38,6 +38,7 @@ var import_context = __toESM(require("./context"));
38
38
  var import_hooks = require("../../hooks");
39
39
  var import_useEngineContext = __toESM(require("../../hooks/useEngineContext"));
40
40
  var import_pisellMessage = require("../pisellMessage");
41
+ var import_functions = require("../pisellModal/components/functions");
41
42
  var platformMap = {
42
43
  phone: "h5",
43
44
  pc: "pc",
@@ -63,6 +64,7 @@ var PisellConfigProvider = (props) => {
63
64
  };
64
65
  const staticFunction = import_antd.App.useApp();
65
66
  (0, import_pisellMessage.setMessage)(staticFunction.message);
67
+ (0, import_functions.setModal)(staticFunction.modal);
66
68
  import_context.globalConfig.setConfig(config);
67
69
  return /* @__PURE__ */ import_react.default.createElement(import_context.default.Provider, { value: config }, children);
68
70
  };
@@ -1,12 +1,30 @@
1
1
  import { ModalFuncProps } from 'antd';
2
+ import { useAppProps } from 'antd/es/app/context';
2
3
  import { PisellContextType } from '../../../pisell-config-provider/context';
3
4
  import './index.less';
5
+ declare const setModal: (m: useAppProps['modal']) => void;
4
6
  export interface PisellModalFuncProps extends ModalFuncProps {
5
7
  platform?: PisellContextType['platform'];
6
8
  }
7
- export declare const info: (props: PisellModalFuncProps) => any;
8
- export declare const success: (props: PisellModalFuncProps) => any;
9
- export declare const error: (props: PisellModalFuncProps) => any;
10
- export declare const warning: (props: PisellModalFuncProps) => any;
9
+ export declare const info: (props: PisellModalFuncProps) => {
10
+ destroy: () => void;
11
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
12
+ };
13
+ export declare const success: (props: PisellModalFuncProps) => {
14
+ destroy: () => void;
15
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
16
+ };
17
+ export declare const error: (props: PisellModalFuncProps) => {
18
+ destroy: () => void;
19
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
20
+ };
21
+ export declare const warning: (props: PisellModalFuncProps) => {
22
+ destroy: () => void;
23
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
24
+ };
11
25
  export declare const warn: (props: PisellModalFuncProps) => any;
12
- export declare const confirm: (props: PisellModalFuncProps) => any;
26
+ export declare const confirm: (props: PisellModalFuncProps) => {
27
+ destroy: () => void;
28
+ update: (configUpdate: ModalFuncProps | ((prevConfig: ModalFuncProps) => ModalFuncProps)) => void;
29
+ };
30
+ export { setModal };
@@ -32,15 +32,19 @@ __export(functions_exports, {
32
32
  confirm: () => confirm,
33
33
  error: () => error,
34
34
  info: () => info,
35
+ setModal: () => setModal,
35
36
  success: () => success,
36
37
  warn: () => warn,
37
38
  warning: () => warning
38
39
  });
39
40
  module.exports = __toCommonJS(functions_exports);
40
- var import_modal = __toESM(require("../../../modal"));
41
41
  var import_classnames = __toESM(require("classnames"));
42
42
  var import_context = require("../../../pisell-config-provider/context");
43
43
  var import_index = require("./index.less");
44
+ var Modal;
45
+ var setModal = (m) => {
46
+ Modal = m;
47
+ };
44
48
  var genConfig = (props) => {
45
49
  const { platform } = import_context.globalConfig.getConfig();
46
50
  return {
@@ -48,6 +52,7 @@ var genConfig = (props) => {
48
52
  wrapClassName: (0, import_classnames.default)("pisell-modal-function-wrap", {
49
53
  ["pisell-modal-mobile-function-wrap"]: platform === "h5"
50
54
  }),
55
+ transitionName: "pisell-move-down",
51
56
  cancelButtonProps: {
52
57
  block: true,
53
58
  size: "large",
@@ -62,28 +67,29 @@ var genConfig = (props) => {
62
67
  };
63
68
  };
64
69
  var info = (props) => {
65
- return import_modal.default.info(genConfig(props));
70
+ return Modal.info(genConfig(props));
66
71
  };
67
72
  var success = (props) => {
68
- return import_modal.default.success(genConfig(props));
73
+ return Modal.success(genConfig(props));
69
74
  };
70
75
  var error = (props) => {
71
- return import_modal.default.error(genConfig(props));
76
+ return Modal.error(genConfig(props));
72
77
  };
73
78
  var warning = (props) => {
74
- return import_modal.default.warning(genConfig(props));
79
+ return Modal.warning(genConfig(props));
75
80
  };
76
81
  var warn = (props) => {
77
- return import_modal.default.warn(genConfig(props));
82
+ return Modal.warn(genConfig(props));
78
83
  };
79
84
  var confirm = (props) => {
80
- return import_modal.default.confirm(genConfig(props));
85
+ return Modal.confirm(genConfig(props));
81
86
  };
82
87
  // Annotate the CommonJS export names for ESM import in node:
83
88
  0 && (module.exports = {
84
89
  confirm,
85
90
  error,
86
91
  info,
92
+ setModal,
87
93
  success,
88
94
  warn,
89
95
  warning
@@ -32,12 +32,27 @@ export interface PisellModalProps extends ModalProps {
32
32
  }
33
33
  declare const PisellModal: {
34
34
  (props: PisellModalProps): React.JSX.Element;
35
- confirm: (props: import("./components/functions").PisellModalFuncProps) => any;
36
- info: (props: import("./components/functions").PisellModalFuncProps) => any;
37
- error: (props: import("./components/functions").PisellModalFuncProps) => any;
35
+ confirm: (props: import("./components/functions").PisellModalFuncProps) => {
36
+ destroy: () => void;
37
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
38
+ };
39
+ info: (props: import("./components/functions").PisellModalFuncProps) => {
40
+ destroy: () => void;
41
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
42
+ };
43
+ error: (props: import("./components/functions").PisellModalFuncProps) => {
44
+ destroy: () => void;
45
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
46
+ };
38
47
  warn: (props: import("./components/functions").PisellModalFuncProps) => any;
39
- warning: (props: import("./components/functions").PisellModalFuncProps) => any;
40
- success: (props: import("./components/functions").PisellModalFuncProps) => any;
48
+ warning: (props: import("./components/functions").PisellModalFuncProps) => {
49
+ destroy: () => void;
50
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
51
+ };
52
+ success: (props: import("./components/functions").PisellModalFuncProps) => {
53
+ destroy: () => void;
54
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
55
+ };
41
56
  Information: (props: import("./components/Information").InformationProps) => React.JSX.Element;
42
57
  };
43
58
  export default PisellModal;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "2.2.16",
3
+ "version": "2.2.18",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -63,8 +63,8 @@
63
63
  "react-virtualized-auto-sizer": "^1.0.20",
64
64
  "crypto-js": "^4.2.0",
65
65
  "@zxing/library": "0.21.2",
66
- "@pisell/utils": "1.0.28",
67
- "@pisell/date-picker": "1.0.97",
66
+ "@pisell/utils": "1.0.30",
67
+ "@pisell/date-picker": "1.0.99",
68
68
  "@pisell/icon": "0.0.11"
69
69
  },
70
70
  "peerDependencies": {