@nutui/nutui-react 2.0.17-beta.1 → 2.0.18-beta.0
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/dist/esm/Menu.js +5 -5
- package/dist/esm/menuitem2.js +3 -1
- package/dist/esm/types/src/packages/menu/menu.d.ts +2 -2
- package/dist/esm/types/src/packages/menu/menu.taro.d.ts +2 -2
- package/dist/esm/types/src/packages/notify/notify.taro.d.ts +1 -1
- package/dist/locales/base.js +1 -1
- package/dist/locales/en-US.js +1 -1
- package/dist/locales/id-ID.js +1 -1
- package/dist/locales/tr-TR.js +1 -1
- package/dist/locales/zh-CN.js +1 -1
- package/dist/locales/zh-TW.js +1 -1
- package/dist/locales/zh-UG.js +1 -1
- package/dist/nutui.react.es.js +9 -7
- package/dist/nutui.react.umd.js +9 -7
- package/dist/style.mjs +1 -1
- package/dist/types/packages/formitem/formitem.d.ts +1 -1
- package/dist/types/packages/menu/menu.d.ts +10 -2
- package/package.json +1 -1
package/dist/esm/Menu.js
CHANGED
|
@@ -39,9 +39,9 @@ var defaultProps = _objectSpread(_objectSpread({}, ComponentDefaults), {}, {
|
|
|
39
39
|
scrollFixed: false,
|
|
40
40
|
lockScroll: true,
|
|
41
41
|
icon: null,
|
|
42
|
-
onOpen: function onOpen() {
|
|
42
|
+
onOpen: function onOpen(index) {
|
|
43
43
|
},
|
|
44
|
-
onClose: function onClose() {
|
|
44
|
+
onClose: function onClose(index) {
|
|
45
45
|
}
|
|
46
46
|
});
|
|
47
47
|
var Menu = function Menu2(props) {
|
|
@@ -70,9 +70,9 @@ var Menu = function Menu2(props) {
|
|
|
70
70
|
var toggleMenuItem = function toggleMenuItem2(index) {
|
|
71
71
|
showMenuItem[index] = !showMenuItem[index];
|
|
72
72
|
if (showMenuItem[index]) {
|
|
73
|
-
onOpen2 && onOpen2();
|
|
73
|
+
onOpen2 && onOpen2(index);
|
|
74
74
|
} else {
|
|
75
|
-
onClose2 && onClose2();
|
|
75
|
+
onClose2 && onClose2(index);
|
|
76
76
|
}
|
|
77
77
|
var temp = showMenuItem.map(function(i, idx) {
|
|
78
78
|
return idx === index ? i : false;
|
|
@@ -82,7 +82,7 @@ var Menu = function Menu2(props) {
|
|
|
82
82
|
var hideMenuItem = function hideMenuItem2(index) {
|
|
83
83
|
showMenuItem[index] = false;
|
|
84
84
|
setShowMenuItem(_toConsumableArray(showMenuItem));
|
|
85
|
-
onClose2 && onClose2();
|
|
85
|
+
onClose2 && onClose2(index);
|
|
86
86
|
};
|
|
87
87
|
var updateTitle = function updateTitle2(text, index) {
|
|
88
88
|
menuItemTitle[index] = text;
|
package/dist/esm/menuitem2.js
CHANGED
|
@@ -50,7 +50,9 @@ var MenuItem = forwardRef(function(props, ref) {
|
|
|
50
50
|
}, [showPopup]);
|
|
51
51
|
useImperativeHandle(ref, function() {
|
|
52
52
|
return {
|
|
53
|
-
toggle:
|
|
53
|
+
toggle: function toggle(s) {
|
|
54
|
+
s ? parent.toggleMenuItem(index) : parent.hideMenuItem(index);
|
|
55
|
+
}
|
|
54
56
|
};
|
|
55
57
|
});
|
|
56
58
|
var getIconCName = function getIconCName2(optionVal, value2) {
|
|
@@ -8,8 +8,8 @@ export interface MenuProps extends BasicComponent {
|
|
|
8
8
|
lockScroll: boolean;
|
|
9
9
|
icon: React.ReactNode;
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
onOpen: () => void;
|
|
12
|
-
onClose: () => void;
|
|
11
|
+
onOpen: (index: number) => void;
|
|
12
|
+
onClose: (index: number) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const Menu: FunctionComponent<Partial<MenuProps>> & {
|
|
15
15
|
Item: typeof MenuItem;
|
|
@@ -8,8 +8,8 @@ export interface MenuProps extends BasicComponent {
|
|
|
8
8
|
lockScroll: boolean;
|
|
9
9
|
icon: React.ReactNode;
|
|
10
10
|
children: React.ReactNode;
|
|
11
|
-
onOpen: () => void;
|
|
12
|
-
onClose: () => void;
|
|
11
|
+
onOpen: (index: number) => void;
|
|
12
|
+
onClose: (index: number) => void;
|
|
13
13
|
}
|
|
14
14
|
export declare const Menu: FunctionComponent<Partial<MenuProps>> & {
|
|
15
15
|
Item: typeof MenuItem;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
2
|
import { BasicComponent } from '@/utils/typings';
|
|
3
3
|
export type NotifyPosition = 'top' | 'bottom';
|
|
4
|
-
export type NotifyType = 'primary' | 'success' | 'danger' | '
|
|
4
|
+
export type NotifyType = 'primary' | 'success' | 'danger' | 'warning';
|
|
5
5
|
export interface NotifyProps extends BasicComponent {
|
|
6
6
|
id?: string;
|
|
7
7
|
duration: number;
|
package/dist/locales/base.js
CHANGED
package/dist/locales/en-US.js
CHANGED
package/dist/locales/id-ID.js
CHANGED
package/dist/locales/tr-TR.js
CHANGED
package/dist/locales/zh-CN.js
CHANGED
package/dist/locales/zh-TW.js
CHANGED
package/dist/locales/zh-UG.js
CHANGED
package/dist/nutui.react.es.js
CHANGED
|
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
|
|
|
6
6
|
};
|
|
7
7
|
var _a;
|
|
8
8
|
/*!
|
|
9
|
-
* @nutui/nutui-react v2.0.
|
|
9
|
+
* @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:05:49 GMT+0800 (China Standard Time)
|
|
10
10
|
* (c) 2023 @jdf2e.
|
|
11
11
|
* Released under the MIT License.
|
|
12
12
|
*/
|
|
@@ -17349,7 +17349,9 @@ const MenuItem = forwardRef((props, ref) => {
|
|
|
17349
17349
|
getParentOffset();
|
|
17350
17350
|
}, [showPopup]);
|
|
17351
17351
|
useImperativeHandle(ref, () => ({
|
|
17352
|
-
toggle:
|
|
17352
|
+
toggle: (s) => {
|
|
17353
|
+
s ? parent.toggleMenuItem(index) : parent.hideMenuItem(index);
|
|
17354
|
+
}
|
|
17353
17355
|
}));
|
|
17354
17356
|
const getIconCName = (optionVal, value2) => {
|
|
17355
17357
|
return classNames({
|
|
@@ -17497,9 +17499,9 @@ const defaultProps$R = {
|
|
|
17497
17499
|
scrollFixed: false,
|
|
17498
17500
|
lockScroll: true,
|
|
17499
17501
|
icon: null,
|
|
17500
|
-
onOpen: () => {
|
|
17502
|
+
onOpen: (index) => {
|
|
17501
17503
|
},
|
|
17502
|
-
onClose: () => {
|
|
17504
|
+
onClose: (index) => {
|
|
17503
17505
|
}
|
|
17504
17506
|
};
|
|
17505
17507
|
const Menu = (props) => {
|
|
@@ -17540,9 +17542,9 @@ const Menu = (props) => {
|
|
|
17540
17542
|
const toggleMenuItem = (index) => {
|
|
17541
17543
|
showMenuItem[index] = !showMenuItem[index];
|
|
17542
17544
|
if (showMenuItem[index]) {
|
|
17543
|
-
onOpen && onOpen();
|
|
17545
|
+
onOpen && onOpen(index);
|
|
17544
17546
|
} else {
|
|
17545
|
-
onClose && onClose();
|
|
17547
|
+
onClose && onClose(index);
|
|
17546
17548
|
}
|
|
17547
17549
|
const temp = showMenuItem.map(
|
|
17548
17550
|
(i, idx) => idx === index ? i : false
|
|
@@ -17552,7 +17554,7 @@ const Menu = (props) => {
|
|
|
17552
17554
|
const hideMenuItem = (index) => {
|
|
17553
17555
|
showMenuItem[index] = false;
|
|
17554
17556
|
setShowMenuItem([...showMenuItem]);
|
|
17555
|
-
onClose && onClose();
|
|
17557
|
+
onClose && onClose(index);
|
|
17556
17558
|
};
|
|
17557
17559
|
const updateTitle = (text, index) => {
|
|
17558
17560
|
menuItemTitle[index] = text;
|
package/dist/nutui.react.umd.js
CHANGED
|
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
|
|
|
9
9
|
return value;
|
|
10
10
|
};
|
|
11
11
|
/*!
|
|
12
|
-
* @nutui/nutui-react v2.0.
|
|
12
|
+
* @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:05:49 GMT+0800 (China Standard Time)
|
|
13
13
|
* (c) 2023 @jdf2e.
|
|
14
14
|
* Released under the MIT License.
|
|
15
15
|
*/
|
|
@@ -17367,7 +17367,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17367
17367
|
getParentOffset();
|
|
17368
17368
|
}, [showPopup]);
|
|
17369
17369
|
React.useImperativeHandle(ref, () => ({
|
|
17370
|
-
toggle:
|
|
17370
|
+
toggle: (s) => {
|
|
17371
|
+
s ? parent.toggleMenuItem(index) : parent.hideMenuItem(index);
|
|
17372
|
+
}
|
|
17371
17373
|
}));
|
|
17372
17374
|
const getIconCName = (optionVal, value2) => {
|
|
17373
17375
|
return classNames({
|
|
@@ -17515,9 +17517,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17515
17517
|
scrollFixed: false,
|
|
17516
17518
|
lockScroll: true,
|
|
17517
17519
|
icon: null,
|
|
17518
|
-
onOpen: () => {
|
|
17520
|
+
onOpen: (index) => {
|
|
17519
17521
|
},
|
|
17520
|
-
onClose: () => {
|
|
17522
|
+
onClose: (index) => {
|
|
17521
17523
|
}
|
|
17522
17524
|
};
|
|
17523
17525
|
const Menu = (props) => {
|
|
@@ -17558,9 +17560,9 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17558
17560
|
const toggleMenuItem = (index) => {
|
|
17559
17561
|
showMenuItem[index] = !showMenuItem[index];
|
|
17560
17562
|
if (showMenuItem[index]) {
|
|
17561
|
-
onOpen && onOpen();
|
|
17563
|
+
onOpen && onOpen(index);
|
|
17562
17564
|
} else {
|
|
17563
|
-
onClose && onClose();
|
|
17565
|
+
onClose && onClose(index);
|
|
17564
17566
|
}
|
|
17565
17567
|
const temp = showMenuItem.map(
|
|
17566
17568
|
(i, idx) => idx === index ? i : false
|
|
@@ -17570,7 +17572,7 @@ Please add \`${key}Action\` when creating your handler.`);
|
|
|
17570
17572
|
const hideMenuItem = (index) => {
|
|
17571
17573
|
showMenuItem[index] = false;
|
|
17572
17574
|
setShowMenuItem([...showMenuItem]);
|
|
17573
|
-
onClose && onClose();
|
|
17575
|
+
onClose && onClose(index);
|
|
17574
17576
|
};
|
|
17575
17577
|
const updateTitle = (text, index) => {
|
|
17576
17578
|
menuItemTitle[index] = text;
|
package/dist/style.mjs
CHANGED
|
@@ -28,8 +28,16 @@ export interface MenuProps extends BasicComponent {
|
|
|
28
28
|
*/
|
|
29
29
|
icon: React.ReactNode
|
|
30
30
|
children: React.ReactNode;
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
/**
|
|
32
|
+
* menu 展开触发
|
|
33
|
+
* @default -
|
|
34
|
+
*/
|
|
35
|
+
onOpen: (index: number) => void
|
|
36
|
+
/**
|
|
37
|
+
* menu 关闭触发
|
|
38
|
+
* @default -
|
|
39
|
+
*/
|
|
40
|
+
onClose: (index: number) => void
|
|
33
41
|
}
|
|
34
42
|
export declare const Menu: FunctionComponent<Partial<MenuProps>> & {
|
|
35
43
|
Item: typeof MenuItem;
|