amssui 2.0.31 → 2.0.33
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/es/button-modal/index.d.ts +9 -7
- package/es/button-modal/index.js +89 -56
- package/es/button-modal/style/index.js +1 -1
- package/es/index.d.ts +2 -2
- package/es/index.js +1 -1
- package/es/menu-nav-icon-button/index.d.ts +4 -4
- package/es/menu-nav-icon-button/index.js +63 -44
- package/es/menu-nav-icon-button/style/index.js +1 -1
- package/lib/button-modal/index.d.ts +9 -7
- package/lib/button-modal/index.js +147 -95
- package/lib/button-modal/style/index.js +4 -4
- package/lib/index.d.ts +2 -2
- package/lib/index.js +20 -16
- package/lib/menu-nav-icon-button/index.d.ts +4 -4
- package/lib/menu-nav-icon-button/index.js +76 -53
- package/lib/menu-nav-icon-button/style/index.js +4 -4
- package/package.json +3 -3
- package/LICENSE +0 -21
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DialogProps } from 'react-vant/lib/dialog/PropsType';
|
|
3
3
|
export interface ModalAction {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
open: () => void;
|
|
5
|
+
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends Omit<DialogProps, 'children'> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
trigger?: React.ReactElement;
|
|
11
|
+
children: ((v: ModalAction) => React.ReactElement) | React.ReactElement;
|
|
12
12
|
}
|
|
13
|
-
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<
|
|
13
|
+
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<
|
|
14
|
+
ButtonModalProps & React.RefAttributes<unknown>
|
|
15
|
+
>;
|
|
14
16
|
export default ForwardRefButtonModal;
|
package/es/button-modal/index.js
CHANGED
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
var __assign =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
var __assign =
|
|
2
|
+
(this && this.__assign) ||
|
|
3
|
+
function () {
|
|
4
|
+
__assign =
|
|
5
|
+
Object.assign ||
|
|
6
|
+
function (t) {
|
|
7
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
8
|
+
s = arguments[i];
|
|
9
|
+
for (var p in s) {
|
|
10
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return t;
|
|
14
|
+
};
|
|
15
|
+
return __assign.apply(this, arguments);
|
|
16
|
+
};
|
|
17
|
+
var __rest =
|
|
18
|
+
(this && this.__rest) ||
|
|
19
|
+
function (s, e) {
|
|
20
|
+
var t = {};
|
|
21
|
+
for (var p in s) {
|
|
22
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
8
23
|
}
|
|
24
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
25
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
26
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
27
|
+
t[p[i]] = s[p[i]];
|
|
28
|
+
}
|
|
9
29
|
return t;
|
|
10
30
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
|
-
var __read = this && this.__read || function (o, n) {
|
|
24
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
25
|
-
if (!m) return o;
|
|
26
|
-
var i = m.call(o),
|
|
27
|
-
r,
|
|
28
|
-
ar = [],
|
|
29
|
-
e;
|
|
30
|
-
try {
|
|
31
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
32
|
-
ar.push(r.value);
|
|
33
|
-
}
|
|
34
|
-
} catch (error) {
|
|
35
|
-
e = {
|
|
36
|
-
error: error
|
|
37
|
-
};
|
|
38
|
-
} finally {
|
|
31
|
+
var __read =
|
|
32
|
+
(this && this.__read) ||
|
|
33
|
+
function (o, n) {
|
|
34
|
+
var m = typeof Symbol === 'function' && o[Symbol.iterator];
|
|
35
|
+
if (!m) return o;
|
|
36
|
+
var i = m.call(o),
|
|
37
|
+
r,
|
|
38
|
+
ar = [],
|
|
39
|
+
e;
|
|
39
40
|
try {
|
|
40
|
-
|
|
41
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
42
|
+
ar.push(r.value);
|
|
43
|
+
}
|
|
44
|
+
} catch (error) {
|
|
45
|
+
e = {
|
|
46
|
+
error: error,
|
|
47
|
+
};
|
|
41
48
|
} finally {
|
|
42
|
-
|
|
49
|
+
try {
|
|
50
|
+
if (r && !r.done && (m = i['return'])) m.call(i);
|
|
51
|
+
} finally {
|
|
52
|
+
if (e) throw e.error;
|
|
53
|
+
}
|
|
43
54
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
import * as React from 'react';
|
|
55
|
+
return ar;
|
|
56
|
+
};
|
|
48
57
|
import isFunction from 'lodash/isFunction';
|
|
49
|
-
import
|
|
58
|
+
import * as React from 'react';
|
|
59
|
+
import Dialog from 'react-vant/es/dialog';
|
|
50
60
|
var ButtonModal = function ButtonModal(props, ref) {
|
|
51
61
|
var _a = __read(React.useState(false), 2),
|
|
52
62
|
visible = _a[0],
|
|
@@ -57,7 +67,14 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
57
67
|
onClose = props.onClose,
|
|
58
68
|
onConfirm = props.onConfirm,
|
|
59
69
|
onCancel = props.onCancel,
|
|
60
|
-
restModalProps = __rest(props, [
|
|
70
|
+
restModalProps = __rest(props, [
|
|
71
|
+
'children',
|
|
72
|
+
'trigger',
|
|
73
|
+
'onOpen',
|
|
74
|
+
'onClose',
|
|
75
|
+
'onConfirm',
|
|
76
|
+
'onCancel',
|
|
77
|
+
]);
|
|
61
78
|
var openModal = function openModal() {
|
|
62
79
|
if (onOpen) {
|
|
63
80
|
onOpen();
|
|
@@ -72,7 +89,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
72
89
|
};
|
|
73
90
|
var modalActionRef = React.useRef({
|
|
74
91
|
open: openModal,
|
|
75
|
-
close: closeModal
|
|
92
|
+
close: closeModal,
|
|
76
93
|
});
|
|
77
94
|
React.useImperativeHandle(ref, function () {
|
|
78
95
|
return modalActionRef.current;
|
|
@@ -90,16 +107,32 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
90
107
|
}
|
|
91
108
|
closeModal();
|
|
92
109
|
};
|
|
93
|
-
var buttonNode =
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
110
|
+
var buttonNode =
|
|
111
|
+
trigger &&
|
|
112
|
+
/*#__PURE__*/ React.cloneElement(trigger, {
|
|
113
|
+
onClick: openModal,
|
|
114
|
+
});
|
|
115
|
+
return /*#__PURE__*/ React.createElement(
|
|
116
|
+
React.Fragment,
|
|
117
|
+
null,
|
|
118
|
+
buttonNode,
|
|
119
|
+
/*#__PURE__*/ React.createElement(
|
|
120
|
+
Dialog,
|
|
121
|
+
__assign(
|
|
122
|
+
{
|
|
123
|
+
visible: visible,
|
|
124
|
+
onConfirm: handleModalOk,
|
|
125
|
+
onCancel: handleModalCancel,
|
|
126
|
+
},
|
|
127
|
+
restModalProps,
|
|
128
|
+
),
|
|
129
|
+
isFunction(children)
|
|
130
|
+
? children(modalActionRef.current)
|
|
131
|
+
: /*#__PURE__*/ React.cloneElement(children, {
|
|
132
|
+
modalAction: modalActionRef.current,
|
|
133
|
+
}),
|
|
134
|
+
),
|
|
135
|
+
);
|
|
103
136
|
};
|
|
104
|
-
var ForwardRefButtonModal = /*#__PURE__*/React.forwardRef(ButtonModal);
|
|
105
|
-
export default ForwardRefButtonModal;
|
|
137
|
+
var ForwardRefButtonModal = /*#__PURE__*/ React.forwardRef(ButtonModal);
|
|
138
|
+
export default ForwardRefButtonModal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import 'react-vant/es/dialog/style/index.css';
|
package/es/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ButtonModalProps } from './button-modal';
|
|
2
1
|
export { default as ButtonModal } from './button-modal';
|
|
3
|
-
export type {
|
|
2
|
+
export type { ButtonModalProps } from './button-modal';
|
|
4
3
|
export { default as MenuNavIconButton } from './menu-nav-icon-button';
|
|
4
|
+
export type { MenuNavIconProps } from './menu-nav-icon-button';
|
package/es/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { default as ButtonModal } from './button-modal';
|
|
2
|
-
export { default as MenuNavIconButton } from './menu-nav-icon-button';
|
|
2
|
+
export { default as MenuNavIconButton } from './menu-nav-icon-button';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type MenuNavIconProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
onChange?: (status: boolean) => void;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
status?: boolean;
|
|
6
|
+
className?: string;
|
|
7
7
|
};
|
|
8
8
|
declare const MenuNavIconButton: React.FC<MenuNavIconProps>;
|
|
9
9
|
export default MenuNavIconButton;
|
|
@@ -1,55 +1,74 @@
|
|
|
1
|
-
var __read =
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
ar.push(r.value);
|
|
11
|
-
}
|
|
12
|
-
} catch (error) {
|
|
13
|
-
e = {
|
|
14
|
-
error: error
|
|
15
|
-
};
|
|
16
|
-
} finally {
|
|
1
|
+
var __read =
|
|
2
|
+
(this && this.__read) ||
|
|
3
|
+
function (o, n) {
|
|
4
|
+
var m = typeof Symbol === 'function' && o[Symbol.iterator];
|
|
5
|
+
if (!m) return o;
|
|
6
|
+
var i = m.call(o),
|
|
7
|
+
r,
|
|
8
|
+
ar = [],
|
|
9
|
+
e;
|
|
17
10
|
try {
|
|
18
|
-
|
|
11
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
12
|
+
ar.push(r.value);
|
|
13
|
+
}
|
|
14
|
+
} catch (error) {
|
|
15
|
+
e = {
|
|
16
|
+
error: error,
|
|
17
|
+
};
|
|
19
18
|
} finally {
|
|
20
|
-
|
|
19
|
+
try {
|
|
20
|
+
if (r && !r.done && (m = i['return'])) m.call(i);
|
|
21
|
+
} finally {
|
|
22
|
+
if (e) throw e.error;
|
|
23
|
+
}
|
|
21
24
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
import useControllableValue from "ahooks/es/useControllableValue";
|
|
25
|
+
return ar;
|
|
26
|
+
};
|
|
27
|
+
import useControllableValue from 'ahooks/es/useControllableValue';
|
|
26
28
|
import classNames from 'classnames';
|
|
27
29
|
import React from 'react';
|
|
28
30
|
var MenuNavIconButton = function MenuNavIconButton(props) {
|
|
29
31
|
var _onClick = props.onClick,
|
|
30
32
|
className = props.className;
|
|
31
|
-
var _a = __read(
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
var _a = __read(
|
|
34
|
+
useControllableValue(props, {
|
|
35
|
+
valuePropName: 'status',
|
|
36
|
+
}),
|
|
37
|
+
2,
|
|
38
|
+
),
|
|
34
39
|
status = _a[0],
|
|
35
40
|
setStatus = _a[1];
|
|
36
|
-
return /*#__PURE__*/React.createElement(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
41
|
+
return /*#__PURE__*/ React.createElement(
|
|
42
|
+
'div',
|
|
43
|
+
{
|
|
44
|
+
className: classNames(
|
|
45
|
+
'menu-nav-icon',
|
|
46
|
+
{
|
|
47
|
+
open: status,
|
|
48
|
+
},
|
|
49
|
+
className,
|
|
50
|
+
),
|
|
51
|
+
onClick: function onClick() {
|
|
52
|
+
var nextStatus = !status;
|
|
53
|
+
setStatus(nextStatus);
|
|
54
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick();
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
/*#__PURE__*/ React.createElement(
|
|
58
|
+
'div',
|
|
59
|
+
{
|
|
60
|
+
className: 'menu-nav-icon-wrap',
|
|
61
|
+
},
|
|
62
|
+
/*#__PURE__*/ React.createElement('span', {
|
|
63
|
+
className: 'menu-nav-icon-bar',
|
|
64
|
+
}),
|
|
65
|
+
/*#__PURE__*/ React.createElement('span', {
|
|
66
|
+
className: 'menu-nav-icon-bar',
|
|
67
|
+
}),
|
|
68
|
+
/*#__PURE__*/ React.createElement('span', {
|
|
69
|
+
className: 'menu-nav-icon-bar',
|
|
70
|
+
}),
|
|
71
|
+
),
|
|
72
|
+
);
|
|
54
73
|
};
|
|
55
|
-
export default MenuNavIconButton;
|
|
74
|
+
export default MenuNavIconButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import './index.less';
|
|
1
|
+
import './index.less';
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { DialogProps } from 'react-vant/lib/dialog/PropsType';
|
|
3
3
|
export interface ModalAction {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
open: () => void;
|
|
5
|
+
close: () => void;
|
|
6
6
|
}
|
|
7
7
|
export interface ButtonModalProps extends Omit<DialogProps, 'children'> {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
onClose?: () => void;
|
|
9
|
+
onOpen?: () => void;
|
|
10
|
+
trigger?: React.ReactElement;
|
|
11
|
+
children: ((v: ModalAction) => React.ReactElement) | React.ReactElement;
|
|
12
12
|
}
|
|
13
|
-
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<
|
|
13
|
+
declare const ForwardRefButtonModal: React.ForwardRefExoticComponent<
|
|
14
|
+
ButtonModalProps & React.RefAttributes<unknown>
|
|
15
|
+
>;
|
|
14
16
|
export default ForwardRefButtonModal;
|
|
@@ -1,95 +1,124 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
var __assign =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var __assign =
|
|
4
|
+
(this && this.__assign) ||
|
|
5
|
+
function () {
|
|
6
|
+
__assign =
|
|
7
|
+
Object.assign ||
|
|
8
|
+
function (t) {
|
|
9
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
10
|
+
s = arguments[i];
|
|
11
|
+
for (var p in s) {
|
|
12
|
+
if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return t;
|
|
16
|
+
};
|
|
17
|
+
return __assign.apply(this, arguments);
|
|
18
|
+
};
|
|
19
|
+
var __createBinding =
|
|
20
|
+
(this && this.__createBinding) ||
|
|
21
|
+
(Object.create
|
|
22
|
+
? function (o, m, k, k2) {
|
|
23
|
+
if (k2 === undefined) k2 = k;
|
|
24
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
25
|
+
if (
|
|
26
|
+
!desc ||
|
|
27
|
+
('get' in desc ? !m.__esModule : desc.writable || desc.configurable)
|
|
28
|
+
) {
|
|
29
|
+
desc = {
|
|
30
|
+
enumerable: true,
|
|
31
|
+
get: function get() {
|
|
32
|
+
return m[k];
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
Object.defineProperty(o, k2, desc);
|
|
37
|
+
}
|
|
38
|
+
: function (o, m, k, k2) {
|
|
39
|
+
if (k2 === undefined) k2 = k;
|
|
40
|
+
o[k2] = m[k];
|
|
41
|
+
});
|
|
42
|
+
var __setModuleDefault =
|
|
43
|
+
(this && this.__setModuleDefault) ||
|
|
44
|
+
(Object.create
|
|
45
|
+
? function (o, v) {
|
|
46
|
+
Object.defineProperty(o, 'default', {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
value: v,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
: function (o, v) {
|
|
52
|
+
o['default'] = v;
|
|
53
|
+
});
|
|
54
|
+
var __importStar =
|
|
55
|
+
(this && this.__importStar) ||
|
|
56
|
+
function (mod) {
|
|
57
|
+
if (mod && mod.__esModule) return mod;
|
|
58
|
+
var result = {};
|
|
59
|
+
if (mod != null)
|
|
60
|
+
for (var k in mod) {
|
|
61
|
+
if (k !== 'default' && Object.prototype.hasOwnProperty.call(mod, k))
|
|
62
|
+
__createBinding(result, mod, k);
|
|
9
63
|
}
|
|
64
|
+
__setModuleDefault(result, mod);
|
|
65
|
+
return result;
|
|
66
|
+
};
|
|
67
|
+
var __rest =
|
|
68
|
+
(this && this.__rest) ||
|
|
69
|
+
function (s, e) {
|
|
70
|
+
var t = {};
|
|
71
|
+
for (var p in s) {
|
|
72
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
10
73
|
}
|
|
74
|
+
if (s != null && typeof Object.getOwnPropertySymbols === 'function')
|
|
75
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
76
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
77
|
+
t[p[i]] = s[p[i]];
|
|
78
|
+
}
|
|
11
79
|
return t;
|
|
12
80
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return m[k];
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
Object.defineProperty(o, k2, desc);
|
|
27
|
-
} : function (o, m, k, k2) {
|
|
28
|
-
if (k2 === undefined) k2 = k;
|
|
29
|
-
o[k2] = m[k];
|
|
30
|
-
});
|
|
31
|
-
var __setModuleDefault = this && this.__setModuleDefault || (Object.create ? function (o, v) {
|
|
32
|
-
Object.defineProperty(o, "default", {
|
|
33
|
-
enumerable: true,
|
|
34
|
-
value: v
|
|
35
|
-
});
|
|
36
|
-
} : function (o, v) {
|
|
37
|
-
o["default"] = v;
|
|
38
|
-
});
|
|
39
|
-
var __importStar = this && this.__importStar || function (mod) {
|
|
40
|
-
if (mod && mod.__esModule) return mod;
|
|
41
|
-
var result = {};
|
|
42
|
-
if (mod != null) for (var k in mod) {
|
|
43
|
-
if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
44
|
-
}
|
|
45
|
-
__setModuleDefault(result, mod);
|
|
46
|
-
return result;
|
|
47
|
-
};
|
|
48
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
49
|
-
var t = {};
|
|
50
|
-
for (var p in s) {
|
|
51
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
52
|
-
}
|
|
53
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
55
|
-
}
|
|
56
|
-
return t;
|
|
57
|
-
};
|
|
58
|
-
var __read = this && this.__read || function (o, n) {
|
|
59
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
60
|
-
if (!m) return o;
|
|
61
|
-
var i = m.call(o),
|
|
62
|
-
r,
|
|
63
|
-
ar = [],
|
|
64
|
-
e;
|
|
65
|
-
try {
|
|
66
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
67
|
-
ar.push(r.value);
|
|
68
|
-
}
|
|
69
|
-
} catch (error) {
|
|
70
|
-
e = {
|
|
71
|
-
error: error
|
|
72
|
-
};
|
|
73
|
-
} finally {
|
|
81
|
+
var __read =
|
|
82
|
+
(this && this.__read) ||
|
|
83
|
+
function (o, n) {
|
|
84
|
+
var m = typeof Symbol === 'function' && o[Symbol.iterator];
|
|
85
|
+
if (!m) return o;
|
|
86
|
+
var i = m.call(o),
|
|
87
|
+
r,
|
|
88
|
+
ar = [],
|
|
89
|
+
e;
|
|
74
90
|
try {
|
|
75
|
-
|
|
91
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
92
|
+
ar.push(r.value);
|
|
93
|
+
}
|
|
94
|
+
} catch (error) {
|
|
95
|
+
e = {
|
|
96
|
+
error: error,
|
|
97
|
+
};
|
|
76
98
|
} finally {
|
|
77
|
-
|
|
99
|
+
try {
|
|
100
|
+
if (r && !r.done && (m = i['return'])) m.call(i);
|
|
101
|
+
} finally {
|
|
102
|
+
if (e) throw e.error;
|
|
103
|
+
}
|
|
78
104
|
}
|
|
79
|
-
|
|
80
|
-
return ar;
|
|
81
|
-
};
|
|
82
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
83
|
-
return mod && mod.__esModule ? mod : {
|
|
84
|
-
"default": mod
|
|
105
|
+
return ar;
|
|
85
106
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
107
|
+
var __importDefault =
|
|
108
|
+
(this && this.__importDefault) ||
|
|
109
|
+
function (mod) {
|
|
110
|
+
return mod && mod.__esModule
|
|
111
|
+
? mod
|
|
112
|
+
: {
|
|
113
|
+
default: mod,
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
Object.defineProperty(exports, '__esModule', {
|
|
117
|
+
value: true,
|
|
89
118
|
});
|
|
90
|
-
var React = __importStar(require(
|
|
91
|
-
var isFunction_1 = __importDefault(require(
|
|
92
|
-
var dialog_1 = __importDefault(require(
|
|
119
|
+
var React = __importStar(require('react'));
|
|
120
|
+
var isFunction_1 = __importDefault(require('lodash/isFunction'));
|
|
121
|
+
var dialog_1 = __importDefault(require('react-vant/lib/dialog'));
|
|
93
122
|
var ButtonModal = function ButtonModal(props, ref) {
|
|
94
123
|
var _a = __read(React.useState(false), 2),
|
|
95
124
|
visible = _a[0],
|
|
@@ -100,7 +129,14 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
100
129
|
onClose = props.onClose,
|
|
101
130
|
onConfirm = props.onConfirm,
|
|
102
131
|
onCancel = props.onCancel,
|
|
103
|
-
restModalProps = __rest(props, [
|
|
132
|
+
restModalProps = __rest(props, [
|
|
133
|
+
'children',
|
|
134
|
+
'trigger',
|
|
135
|
+
'onOpen',
|
|
136
|
+
'onClose',
|
|
137
|
+
'onConfirm',
|
|
138
|
+
'onCancel',
|
|
139
|
+
]);
|
|
104
140
|
var openModal = function openModal() {
|
|
105
141
|
if (onOpen) {
|
|
106
142
|
onOpen();
|
|
@@ -115,7 +151,7 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
115
151
|
};
|
|
116
152
|
var modalActionRef = React.useRef({
|
|
117
153
|
open: openModal,
|
|
118
|
-
close: closeModal
|
|
154
|
+
close: closeModal,
|
|
119
155
|
});
|
|
120
156
|
React.useImperativeHandle(ref, function () {
|
|
121
157
|
return modalActionRef.current;
|
|
@@ -133,16 +169,32 @@ var ButtonModal = function ButtonModal(props, ref) {
|
|
|
133
169
|
}
|
|
134
170
|
closeModal();
|
|
135
171
|
};
|
|
136
|
-
var buttonNode =
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
172
|
+
var buttonNode =
|
|
173
|
+
trigger &&
|
|
174
|
+
React.cloneElement(trigger, {
|
|
175
|
+
onClick: openModal,
|
|
176
|
+
});
|
|
177
|
+
return React.createElement(
|
|
178
|
+
React.Fragment,
|
|
179
|
+
null,
|
|
180
|
+
buttonNode,
|
|
181
|
+
React.createElement(
|
|
182
|
+
dialog_1['default'],
|
|
183
|
+
__assign(
|
|
184
|
+
{
|
|
185
|
+
visible: visible,
|
|
186
|
+
onConfirm: handleModalOk,
|
|
187
|
+
onCancel: handleModalCancel,
|
|
188
|
+
},
|
|
189
|
+
restModalProps,
|
|
190
|
+
),
|
|
191
|
+
(0, isFunction_1['default'])(children)
|
|
192
|
+
? children(modalActionRef.current)
|
|
193
|
+
: React.cloneElement(children, {
|
|
194
|
+
modalAction: modalActionRef.current,
|
|
195
|
+
}),
|
|
196
|
+
),
|
|
197
|
+
);
|
|
146
198
|
};
|
|
147
199
|
var ForwardRefButtonModal = React.forwardRef(ButtonModal);
|
|
148
|
-
exports[
|
|
200
|
+
exports['default'] = ForwardRefButtonModal;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports,
|
|
4
|
-
value: true
|
|
3
|
+
Object.defineProperty(exports, '__esModule', {
|
|
4
|
+
value: true,
|
|
5
5
|
});
|
|
6
|
-
require(
|
|
6
|
+
require('react-vant/lib/dialog/style/index.css');
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { ButtonModalProps } from './button-modal';
|
|
2
1
|
export { default as ButtonModal } from './button-modal';
|
|
3
|
-
export type {
|
|
2
|
+
export type { ButtonModalProps } from './button-modal';
|
|
4
3
|
export { default as MenuNavIconButton } from './menu-nav-icon-button';
|
|
4
|
+
export type { MenuNavIconProps } from './menu-nav-icon-button';
|
package/lib/index.js
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
var __importDefault =
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
var __importDefault =
|
|
4
|
+
(this && this.__importDefault) ||
|
|
5
|
+
function (mod) {
|
|
6
|
+
return mod && mod.__esModule
|
|
7
|
+
? mod
|
|
8
|
+
: {
|
|
9
|
+
default: mod,
|
|
10
|
+
};
|
|
6
11
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
value: true
|
|
12
|
+
Object.defineProperty(exports, '__esModule', {
|
|
13
|
+
value: true,
|
|
10
14
|
});
|
|
11
15
|
exports.MenuNavIconButton = exports.ButtonModal = void 0;
|
|
12
|
-
var button_modal_1 = require(
|
|
13
|
-
Object.defineProperty(exports,
|
|
16
|
+
var button_modal_1 = require('./button-modal');
|
|
17
|
+
Object.defineProperty(exports, 'ButtonModal', {
|
|
14
18
|
enumerable: true,
|
|
15
19
|
get: function get() {
|
|
16
|
-
return __importDefault(button_modal_1)[
|
|
17
|
-
}
|
|
20
|
+
return __importDefault(button_modal_1)['default'];
|
|
21
|
+
},
|
|
18
22
|
});
|
|
19
|
-
var menu_nav_icon_button_1 = require(
|
|
20
|
-
Object.defineProperty(exports,
|
|
23
|
+
var menu_nav_icon_button_1 = require('./menu-nav-icon-button');
|
|
24
|
+
Object.defineProperty(exports, 'MenuNavIconButton', {
|
|
21
25
|
enumerable: true,
|
|
22
26
|
get: function get() {
|
|
23
|
-
return __importDefault(menu_nav_icon_button_1)[
|
|
24
|
-
}
|
|
25
|
-
});
|
|
27
|
+
return __importDefault(menu_nav_icon_button_1)['default'];
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
export type MenuNavIconProps = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
onChange?: (status: boolean) => void;
|
|
4
|
+
onClick?: () => void;
|
|
5
|
+
status?: boolean;
|
|
6
|
+
className?: string;
|
|
7
7
|
};
|
|
8
8
|
declare const MenuNavIconButton: React.FC<MenuNavIconProps>;
|
|
9
9
|
export default MenuNavIconButton;
|
|
@@ -1,65 +1,88 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
2
|
|
|
3
|
-
var __read =
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
ar.push(r.value);
|
|
13
|
-
}
|
|
14
|
-
} catch (error) {
|
|
15
|
-
e = {
|
|
16
|
-
error: error
|
|
17
|
-
};
|
|
18
|
-
} finally {
|
|
3
|
+
var __read =
|
|
4
|
+
(this && this.__read) ||
|
|
5
|
+
function (o, n) {
|
|
6
|
+
var m = typeof Symbol === 'function' && o[Symbol.iterator];
|
|
7
|
+
if (!m) return o;
|
|
8
|
+
var i = m.call(o),
|
|
9
|
+
r,
|
|
10
|
+
ar = [],
|
|
11
|
+
e;
|
|
19
12
|
try {
|
|
20
|
-
|
|
13
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) {
|
|
14
|
+
ar.push(r.value);
|
|
15
|
+
}
|
|
16
|
+
} catch (error) {
|
|
17
|
+
e = {
|
|
18
|
+
error: error,
|
|
19
|
+
};
|
|
21
20
|
} finally {
|
|
22
|
-
|
|
21
|
+
try {
|
|
22
|
+
if (r && !r.done && (m = i['return'])) m.call(i);
|
|
23
|
+
} finally {
|
|
24
|
+
if (e) throw e.error;
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
|
-
|
|
25
|
-
return ar;
|
|
26
|
-
};
|
|
27
|
-
var __importDefault = this && this.__importDefault || function (mod) {
|
|
28
|
-
return mod && mod.__esModule ? mod : {
|
|
29
|
-
"default": mod
|
|
27
|
+
return ar;
|
|
30
28
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
var __importDefault =
|
|
30
|
+
(this && this.__importDefault) ||
|
|
31
|
+
function (mod) {
|
|
32
|
+
return mod && mod.__esModule
|
|
33
|
+
? mod
|
|
34
|
+
: {
|
|
35
|
+
default: mod,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, '__esModule', {
|
|
39
|
+
value: true,
|
|
34
40
|
});
|
|
35
|
-
var useControllableValue_1 = __importDefault(require(
|
|
36
|
-
var classnames_1 = __importDefault(require(
|
|
37
|
-
var react_1 = __importDefault(require(
|
|
41
|
+
var useControllableValue_1 = __importDefault(require('ahooks/lib/useControllableValue'));
|
|
42
|
+
var classnames_1 = __importDefault(require('classnames'));
|
|
43
|
+
var react_1 = __importDefault(require('react'));
|
|
38
44
|
var MenuNavIconButton = function MenuNavIconButton(props) {
|
|
39
45
|
var _onClick = props.onClick,
|
|
40
46
|
className = props.className;
|
|
41
|
-
var _a = __read(
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
var _a = __read(
|
|
48
|
+
(0, useControllableValue_1['default'])(props, {
|
|
49
|
+
valuePropName: 'status',
|
|
50
|
+
}),
|
|
51
|
+
2,
|
|
52
|
+
),
|
|
44
53
|
status = _a[0],
|
|
45
54
|
setStatus = _a[1];
|
|
46
|
-
return react_1[
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
55
|
+
return react_1['default'].createElement(
|
|
56
|
+
'div',
|
|
57
|
+
{
|
|
58
|
+
className: (0, classnames_1['default'])(
|
|
59
|
+
'menu-nav-icon',
|
|
60
|
+
{
|
|
61
|
+
open: status,
|
|
62
|
+
},
|
|
63
|
+
className,
|
|
64
|
+
),
|
|
65
|
+
onClick: function onClick() {
|
|
66
|
+
var nextStatus = !status;
|
|
67
|
+
setStatus(nextStatus);
|
|
68
|
+
_onClick === null || _onClick === void 0 ? void 0 : _onClick();
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
react_1['default'].createElement(
|
|
72
|
+
'div',
|
|
73
|
+
{
|
|
74
|
+
className: 'menu-nav-icon-wrap',
|
|
75
|
+
},
|
|
76
|
+
react_1['default'].createElement('span', {
|
|
77
|
+
className: 'menu-nav-icon-bar',
|
|
78
|
+
}),
|
|
79
|
+
react_1['default'].createElement('span', {
|
|
80
|
+
className: 'menu-nav-icon-bar',
|
|
81
|
+
}),
|
|
82
|
+
react_1['default'].createElement('span', {
|
|
83
|
+
className: 'menu-nav-icon-bar',
|
|
84
|
+
}),
|
|
85
|
+
),
|
|
86
|
+
);
|
|
64
87
|
};
|
|
65
|
-
exports[
|
|
88
|
+
exports['default'] = MenuNavIconButton;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amssui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.33",
|
|
4
4
|
"description": "react ui library",
|
|
5
5
|
"author": "jason <usochen@gmail.com>",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"README.md"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"a-icons": "^1.2.
|
|
33
|
+
"a-icons": "^1.2.33",
|
|
34
34
|
"ahooks": "^3.0.8",
|
|
35
35
|
"react-vant": "3.0.0"
|
|
36
36
|
},
|
|
@@ -47,5 +47,5 @@
|
|
|
47
47
|
"node": ">=10.0.0"
|
|
48
48
|
},
|
|
49
49
|
"license": "MIT",
|
|
50
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "6615cb416b767e1dd43fe6136805702b70722f88"
|
|
51
51
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020 assui
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|