amssui 1.0.1 → 1.0.2

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.
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import type { ModalProps } from 'antd/lib/modal';
2
+ import type { DialogProps } from 'react-vant/lib/dialog/PropsType';
3
3
  export interface ModalAction {
4
4
  open: () => void;
5
5
  close: () => void;
6
6
  }
7
- export interface ButtonModalProps extends Omit<ModalProps, 'children'> {
7
+ export interface ButtonModalProps extends Omit<DialogProps, 'children'> {
8
8
  onClose?: () => void;
9
9
  onOpen?: () => void;
10
10
  trigger?: React.ReactElement;
@@ -52,12 +52,11 @@ var __read = this && this.__read || function (o, n) {
52
52
  }
53
53
 
54
54
  return ar;
55
- }; // @ts-nocheck
56
-
55
+ };
57
56
 
58
57
  import * as React from 'react';
59
58
  import isFunction from 'lodash/isFunction';
60
- import Modal from 'react-vant/lib/dialog';
59
+ import Dialog from 'react-vant/lib/dialog';
61
60
 
62
61
  var ButtonModal = function ButtonModal(props, ref) {
63
62
  var _a = __read(React.useState(false), 2),
@@ -68,9 +67,9 @@ var ButtonModal = function ButtonModal(props, ref) {
68
67
  trigger = props.trigger,
69
68
  onOpen = props.onOpen,
70
69
  onClose = props.onClose,
71
- onOk = props.onOk,
70
+ onConfirm = props.onConfirm,
72
71
  onCancel = props.onCancel,
73
- restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
72
+ restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onConfirm", "onCancel"]);
74
73
 
75
74
  var openModal = function openModal() {
76
75
  if (onOpen) {
@@ -97,8 +96,8 @@ var ButtonModal = function ButtonModal(props, ref) {
97
96
  });
98
97
 
99
98
  var handleModalOk = function handleModalOk(e) {
100
- if (onOk) {
101
- return onOk(e);
99
+ if (onConfirm) {
100
+ return onConfirm(e);
102
101
  }
103
102
 
104
103
  closeModal();
@@ -116,12 +115,10 @@ var ButtonModal = function ButtonModal(props, ref) {
116
115
  var buttonNode = trigger && /*#__PURE__*/React.cloneElement(trigger, {
117
116
  onClick: openModal
118
117
  });
119
- return /*#__PURE__*/React.createElement(React.Fragment, null, buttonNode, /*#__PURE__*/React.createElement(Modal, __assign({
118
+ return /*#__PURE__*/React.createElement(React.Fragment, null, buttonNode, /*#__PURE__*/React.createElement(Dialog, __assign({
120
119
  visible: visible,
121
120
  onConfirm: handleModalOk,
122
- onCancel: handleModalCancel,
123
- centered: true,
124
- maskClosable: false
121
+ onCancel: handleModalCancel
125
122
  }, restModalProps), isFunction(children) ? children(modalActionRef.current) : /*#__PURE__*/React.cloneElement(children, {
126
123
  modalAction: modalActionRef.current
127
124
  })));
@@ -1 +1 @@
1
- import 'antd/lib/modal/style';
1
+ import 'react-vant/lib/dialog/style/index.css';
@@ -1 +1 @@
1
- import 'antd/lib/modal/style';
1
+ import 'react-vant/lib/dialog/style/index.css';
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react';
2
- import type { ModalProps } from 'antd/lib/modal';
2
+ import type { DialogProps } from 'react-vant/lib/dialog/PropsType';
3
3
  export interface ModalAction {
4
4
  open: () => void;
5
5
  close: () => void;
6
6
  }
7
- export interface ButtonModalProps extends Omit<ModalProps, 'children'> {
7
+ export interface ButtonModalProps extends Omit<DialogProps, 'children'> {
8
8
  onClose?: () => void;
9
9
  onOpen?: () => void;
10
10
  trigger?: React.ReactElement;
@@ -104,7 +104,7 @@ var __importDefault = this && this.__importDefault || function (mod) {
104
104
 
105
105
  Object.defineProperty(exports, "__esModule", {
106
106
  value: true
107
- }); // @ts-nocheck
107
+ });
108
108
 
109
109
  var React = __importStar(require("react"));
110
110
 
@@ -121,9 +121,9 @@ var ButtonModal = function ButtonModal(props, ref) {
121
121
  trigger = props.trigger,
122
122
  onOpen = props.onOpen,
123
123
  onClose = props.onClose,
124
- onOk = props.onOk,
124
+ onConfirm = props.onConfirm,
125
125
  onCancel = props.onCancel,
126
- restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onOk", "onCancel"]);
126
+ restModalProps = __rest(props, ["children", "trigger", "onOpen", "onClose", "onConfirm", "onCancel"]);
127
127
 
128
128
  var openModal = function openModal() {
129
129
  if (onOpen) {
@@ -150,8 +150,8 @@ var ButtonModal = function ButtonModal(props, ref) {
150
150
  });
151
151
 
152
152
  var handleModalOk = function handleModalOk(e) {
153
- if (onOk) {
154
- return onOk(e);
153
+ if (onConfirm) {
154
+ return onConfirm(e);
155
155
  }
156
156
 
157
157
  closeModal();
@@ -172,9 +172,7 @@ var ButtonModal = function ButtonModal(props, ref) {
172
172
  return React.createElement(React.Fragment, null, buttonNode, React.createElement(dialog_1["default"], __assign({
173
173
  visible: visible,
174
174
  onConfirm: handleModalOk,
175
- onCancel: handleModalCancel,
176
- centered: true,
177
- maskClosable: false
175
+ onCancel: handleModalCancel
178
176
  }, restModalProps), (0, isFunction_1["default"])(children) ? children(modalActionRef.current) : React.cloneElement(children, {
179
177
  modalAction: modalActionRef.current
180
178
  })));
@@ -1 +1 @@
1
- import 'antd/lib/modal/style';
1
+ import 'react-vant/lib/dialog/style/index.css';
@@ -4,4 +4,4 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
 
7
- require("antd/lib/modal/style");
7
+ require("react-vant/lib/dialog/style/index.css");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amssui",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "react ui library",
5
5
  "author": "jason <usochen@gmail.com>",
6
6
  "main": "./lib/index.js",
@@ -33,11 +33,11 @@
33
33
  "@ahooksjs/use-url-state": "^2.5.8",
34
34
  "a-icons": "^1.0.71",
35
35
  "aa-utils": "^2.0.25",
36
- "ahooks": "^3.0.8",
37
- "react-vant": "^2.0.0-alpha.41"
36
+ "ahooks": "^3.0.8"
38
37
  },
39
38
  "peerDependencies": {
40
- "react": "^16.8.6 || ^17.0 || ^18.0"
39
+ "react": "^16.8.6 || ^17.0 || ^18.0",
40
+ "react-vant": "^2.0.0-alpha.41"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/enzyme": "^3.10.5",
@@ -48,5 +48,5 @@
48
48
  "node": ">=10.0.0"
49
49
  },
50
50
  "license": "MIT",
51
- "gitHead": "50e2603d97efe6f8c3eaf2852011051e1ba60b5b"
51
+ "gitHead": "b2189ac1e58ae8629ba7ca6a88c43281c18312ef"
52
52
  }