@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 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;
@@ -50,7 +50,9 @@ var MenuItem = forwardRef(function(props, ref) {
50
50
  }, [showPopup]);
51
51
  useImperativeHandle(ref, function() {
52
52
  return {
53
- toggle: parent.toggleMenuItem
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' | 'waring';
4
+ export type NotifyType = 'primary' | 'success' | 'danger' | 'warning';
5
5
  export interface NotifyProps extends BasicComponent {
6
6
  id?: string;
7
7
  duration: number;
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:57 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:44 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -6,7 +6,7 @@ var __publicField = (obj, key, value) => {
6
6
  };
7
7
  var _a;
8
8
  /*!
9
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:08 GMT+0800 (中国标准时间)
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: parent.toggleMenuItem
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;
@@ -9,7 +9,7 @@ var __publicField = (obj, key, value) => {
9
9
  return value;
10
10
  };
11
11
  /*!
12
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:08 GMT+0800 (中国标准时间)
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: parent.toggleMenuItem
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
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @nutui/nutui-react v2.0.17 Wed Sep 13 2023 17:08:35 GMT+0800 (中国标准时间)
2
+ * @nutui/nutui-react v2.0.18-beta.0 Fri Sep 15 2023 14:06:18 GMT+0800 (China Standard Time)
3
3
  * (c) 2023 @jdf2e.
4
4
  * Released under the MIT License.
5
5
  */
@@ -41,7 +41,7 @@ export interface FormItemProps extends BasicComponent, BaseFormField {
41
41
  errorMessageAlign: TextAlign
42
42
  /**
43
43
  * 统一设置字段触发验证的时机
44
- * @default string[]
44
+ * @default onChange
45
45
  */
46
46
  validateTrigger: string | string[]
47
47
  }
@@ -28,8 +28,16 @@ export interface MenuProps extends BasicComponent {
28
28
  */
29
29
  icon: React.ReactNode
30
30
  children: React.ReactNode;
31
- onOpen: () => void;
32
- onClose: () => void;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nutui/nutui-react",
3
- "version": "2.0.17-beta.1",
3
+ "version": "2.0.18-beta.0",
4
4
  "style": "dist/style.css",
5
5
  "main": "dist/nutui.react.umd.js",
6
6
  "module": "dist/esm/nutui-react.es.js",