@hi-ui/pop-confirm 4.2.4 → 5.0.0-canary.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/CHANGELOG.md CHANGED
@@ -1,5 +1,38 @@
1
1
  # @hi-ui/pop-confirm
2
2
 
3
+ ## 5.0.0-canary.0
4
+
5
+ ### Major Changes
6
+
7
+ - 225ebaa51: feat: 组件的 package.json 中的 exports 统一加上 types 配置 (5.0)
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [f70601635]
12
+ - Updated dependencies [225ebaa51]
13
+ - Updated dependencies [428716024]
14
+ - @hi-ui/button@5.0.0-canary.0
15
+ - @hi-ui/core@5.0.0-canary.0
16
+ - @hi-ui/use-latest@5.0.0-canary.0
17
+ - @hi-ui/use-toggle@5.0.0-canary.0
18
+ - @hi-ui/use-uncontrolled-state@5.0.0-canary.0
19
+ - @hi-ui/icons@5.0.0-canary.0
20
+ - @hi-ui/popper@5.0.0-canary.0
21
+ - @hi-ui/classname@5.0.0-canary.0
22
+ - @hi-ui/dom-utils@5.0.0-canary.0
23
+ - @hi-ui/env@5.0.0-canary.0
24
+ - @hi-ui/react-utils@5.0.0-canary.0
25
+ - @hi-ui/type-assertion@5.0.0-canary.0
26
+
27
+ ## 4.2.5
28
+
29
+ ### Patch Changes
30
+
31
+ - [#2813](https://github.com/XiaoMi/hiui/pull/2813) [`084600ea6`](https://github.com/XiaoMi/hiui/commit/084600ea6e4fdec7efde79a3cc90d8ef45ca602f) Thanks [@xiamiao1121](https://github.com/xiamiao1121)! - fix: 修复点击按钮会触发 onCancel 问题
32
+
33
+ - Updated dependencies [[`3afbf239e`](https://github.com/XiaoMi/hiui/commit/3afbf239e816ede48d6a85cbd99b6b099b8c8eb3)]:
34
+ - @hi-ui/env@4.0.7
35
+
3
36
  ## 4.2.4
4
37
 
5
38
  ### Patch Changes
@@ -12,7 +12,7 @@
12
12
  Object.defineProperty(exports, '__esModule', {
13
13
  value: true
14
14
  });
15
- var css_248z = ".hi-v4-pop-confirm {overflow-wrap: break-word;font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);position: relative;background: var(--hi-v4-color-static-white, #fff);white-space: nowrap;border-radius: var(--hi-v4-border-radius-lg, 6px);padding: var(--hi-v4-spacing-10, 20px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v4-pop-confirm__content {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-pop-confirm__content-icon {margin-right: var(--hi-v4-spacing-5, 10px);color: var(--hi-v4-color-warning-500, var(--hi-v4-color-yellow-500, #fab007));font-size: var(--hi-v4-text-size-xl, 1.125rem);}.hi-v4-pop-confirm__content-title {color: var(--hi-v4-color-gray-700, #1f2733);font-weight: var(--hi-v4-text-weight-semibold, 600);}.hi-v4-pop-confirm__body {margin: var(--hi-v4-spacing-5, 10px) 0 0 var(--hi-v4-spacing-14, 28px);white-space: normal;color: var(--hi-v4-color-gray-600, #5f6a7a);}.hi-v4-pop-confirm__footer {margin-top: var(--hi-v4-spacing-10, 20px);text-align: right;}";
15
+ var css_248z = ".hi-v5-pop-confirm {overflow-wrap: break-word;font-size: var(--hi-v5-text-size-md, 0.875rem);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);position: relative;background: var(--hi-v5-color-static-white, #fff);white-space: nowrap;border-radius: var(--hi-v5-border-radius-lg, 6px);padding: var(--hi-v5-spacing-10, 20px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v5-pop-confirm__content {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v5-pop-confirm__content-icon {margin-right: var(--hi-v5-spacing-5, 10px);color: var(--hi-v5-color-warning-500, var(--hi-v5-color-yellow-500, #ffbe0a));font-size: var(--hi-v5-text-size-xl, 1.125rem);}.hi-v5-pop-confirm__content-title {color: var(--hi-v5-color-gray-700, #1a1d26);font-weight: var(--hi-v5-text-weight-semibold, 600);}.hi-v5-pop-confirm__body {margin: var(--hi-v5-spacing-5, 10px) 0 0 var(--hi-v5-spacing-14, 28px);white-space: normal;color: var(--hi-v5-color-gray-600, #565a66);}.hi-v5-pop-confirm__footer {margin-top: var(--hi-v5-spacing-10, 20px);text-align: right;}";
16
16
  var __styleInject__ = require('@hi-ui/style-inject')["default"];
17
17
  __styleInject__(css_248z);
18
18
  exports["default"] = css_248z;
@@ -28,7 +28,7 @@ var usePopConfirm = function usePopConfirm(_a) {
28
28
  onCancelProp = _a.onCancel,
29
29
  onConfirmProp = _a.onConfirm,
30
30
  onOpen = _a.onOpen,
31
- _onClose = _a.onClose,
31
+ onClose = _a.onClose,
32
32
  restProps = tslib.__rest(_a, ["visible", "disabled", "closeOnCancel", "closeOnConfirm", "onCancel", "onConfirm", "onOpen", "onClose"]);
33
33
  // TODO: 移除 popper,使用 hook 重写
34
34
  var _omitPopperOverlayPro = Popper.omitPopperOverlayProps(restProps),
@@ -38,18 +38,17 @@ var usePopConfirm = function usePopConfirm(_a) {
38
38
  defaultVisible: false,
39
39
  visible: visibleProp,
40
40
  onOpen: onOpen,
41
- onClose: function onClose() {
42
- _onClose === null || _onClose === void 0 ? void 0 : _onClose();
43
- onCancelProp === null || onCancelProp === void 0 ? void 0 : onCancelProp();
44
- }
41
+ onClose: onClose
45
42
  }),
46
43
  visible = _useUncontrolledToggl[0],
47
44
  visibleAction = _useUncontrolledToggl[1];
45
+ var onCancelLatest = useLatest.useLatestCallback(onCancelProp);
48
46
  var onCancel = React.useCallback(function () {
47
+ onCancelLatest();
49
48
  if (closeOnCancel) {
50
49
  visibleAction.off();
51
50
  }
52
- }, [closeOnCancel, visibleAction]);
51
+ }, [closeOnCancel, visibleAction, onCancelLatest]);
53
52
  var onConfirmLatest = useLatest.useLatestCallback(onConfirmProp);
54
53
  var onConfirm = React.useCallback(function () {
55
54
  onConfirmLatest();
@@ -8,6 +8,6 @@
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  */
10
10
  import __styleInject__ from '@hi-ui/style-inject';
11
- var css_248z = ".hi-v4-pop-confirm {overflow-wrap: break-word;font-size: var(--hi-v4-text-size-md, 0.875rem);line-height: var(--hi-v4-text-lineheight-md, 1.375rem);position: relative;background: var(--hi-v4-color-static-white, #fff);white-space: nowrap;border-radius: var(--hi-v4-border-radius-lg, 6px);padding: var(--hi-v4-spacing-10, 20px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v4-pop-confirm__content {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v4-pop-confirm__content-icon {margin-right: var(--hi-v4-spacing-5, 10px);color: var(--hi-v4-color-warning-500, var(--hi-v4-color-yellow-500, #fab007));font-size: var(--hi-v4-text-size-xl, 1.125rem);}.hi-v4-pop-confirm__content-title {color: var(--hi-v4-color-gray-700, #1f2733);font-weight: var(--hi-v4-text-weight-semibold, 600);}.hi-v4-pop-confirm__body {margin: var(--hi-v4-spacing-5, 10px) 0 0 var(--hi-v4-spacing-14, 28px);white-space: normal;color: var(--hi-v4-color-gray-600, #5f6a7a);}.hi-v4-pop-confirm__footer {margin-top: var(--hi-v4-spacing-10, 20px);text-align: right;}";
11
+ var css_248z = ".hi-v5-pop-confirm {overflow-wrap: break-word;font-size: var(--hi-v5-text-size-md, 0.875rem);line-height: var(--hi-v5-text-lineheight-md, 1.375rem);position: relative;background: var(--hi-v5-color-static-white, #fff);white-space: nowrap;border-radius: var(--hi-v5-border-radius-lg, 6px);padding: var(--hi-v5-spacing-10, 20px);display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-orient: vertical;-webkit-box-direction: normal;-ms-flex-direction: column;flex-direction: column;}.hi-v5-pop-confirm__content {display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-align: center;-ms-flex-align: center;align-items: center;}.hi-v5-pop-confirm__content-icon {margin-right: var(--hi-v5-spacing-5, 10px);color: var(--hi-v5-color-warning-500, var(--hi-v5-color-yellow-500, #ffbe0a));font-size: var(--hi-v5-text-size-xl, 1.125rem);}.hi-v5-pop-confirm__content-title {color: var(--hi-v5-color-gray-700, #1a1d26);font-weight: var(--hi-v5-text-weight-semibold, 600);}.hi-v5-pop-confirm__body {margin: var(--hi-v5-spacing-5, 10px) 0 0 var(--hi-v5-spacing-14, 28px);white-space: normal;color: var(--hi-v5-color-gray-600, #565a66);}.hi-v5-pop-confirm__footer {margin-top: var(--hi-v5-spacing-10, 20px);text-align: right;}";
12
12
  __styleInject__(css_248z);
13
13
  export { css_248z as default };
@@ -23,7 +23,7 @@ var usePopConfirm = function usePopConfirm(_a) {
23
23
  onCancelProp = _a.onCancel,
24
24
  onConfirmProp = _a.onConfirm,
25
25
  onOpen = _a.onOpen,
26
- _onClose = _a.onClose,
26
+ onClose = _a.onClose,
27
27
  restProps = __rest(_a, ["visible", "disabled", "closeOnCancel", "closeOnConfirm", "onCancel", "onConfirm", "onOpen", "onClose"]);
28
28
  // TODO: 移除 popper,使用 hook 重写
29
29
  var _omitPopperOverlayPro = omitPopperOverlayProps(restProps),
@@ -33,18 +33,17 @@ var usePopConfirm = function usePopConfirm(_a) {
33
33
  defaultVisible: false,
34
34
  visible: visibleProp,
35
35
  onOpen: onOpen,
36
- onClose: function onClose() {
37
- _onClose === null || _onClose === void 0 ? void 0 : _onClose();
38
- onCancelProp === null || onCancelProp === void 0 ? void 0 : onCancelProp();
39
- }
36
+ onClose: onClose
40
37
  }),
41
38
  visible = _useUncontrolledToggl[0],
42
39
  visibleAction = _useUncontrolledToggl[1];
40
+ var onCancelLatest = useLatestCallback(onCancelProp);
43
41
  var onCancel = useCallback(function () {
42
+ onCancelLatest();
44
43
  if (closeOnCancel) {
45
44
  visibleAction.off();
46
45
  }
47
- }, [closeOnCancel, visibleAction]);
46
+ }, [closeOnCancel, visibleAction, onCancelLatest]);
48
47
  var onConfirmLatest = useLatestCallback(onConfirmProp);
49
48
  var onConfirm = useCallback(function () {
50
49
  onConfirmLatest();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hi-ui/pop-confirm",
3
- "version": "4.2.4",
3
+ "version": "5.0.0-canary.0",
4
4
  "description": "A sub-package for @hi-ui/hiui.",
5
5
  "keywords": [],
6
6
  "author": "HiUI <mi-hiui@xiaomi.com>",
@@ -20,7 +20,8 @@
20
20
  "exports": {
21
21
  ".": {
22
22
  "require": "./lib/cjs/index.js",
23
- "default": "./lib/esm/index.js"
23
+ "default": "./lib/esm/index.js",
24
+ "types": "./lib/types/index.d.ts"
24
25
  }
25
26
  },
26
27
  "publishConfig": {
@@ -43,26 +44,26 @@
43
44
  "url": "https://github.com/XiaoMi/hiui/issues"
44
45
  },
45
46
  "dependencies": {
46
- "@hi-ui/button": "^4.0.10",
47
- "@hi-ui/classname": "^4.0.5",
48
- "@hi-ui/dom-utils": "^4.0.7",
49
- "@hi-ui/env": "^4.0.5",
50
- "@hi-ui/icons": "^4.0.19",
51
- "@hi-ui/popper": "^4.1.5",
52
- "@hi-ui/react-utils": "^4.0.4",
53
- "@hi-ui/type-assertion": "^4.0.4",
54
- "@hi-ui/use-latest": "^4.0.4",
55
- "@hi-ui/use-toggle": "^4.0.4",
56
- "@hi-ui/use-uncontrolled-state": "^4.0.4"
47
+ "@hi-ui/button": "^5.0.0-canary.0",
48
+ "@hi-ui/classname": "^5.0.0-canary.0",
49
+ "@hi-ui/dom-utils": "^5.0.0-canary.0",
50
+ "@hi-ui/env": "^5.0.0-canary.0",
51
+ "@hi-ui/icons": "^5.0.0-canary.0",
52
+ "@hi-ui/popper": "^5.0.0-canary.0",
53
+ "@hi-ui/react-utils": "^5.0.0-canary.0",
54
+ "@hi-ui/type-assertion": "^5.0.0-canary.0",
55
+ "@hi-ui/use-latest": "^5.0.0-canary.0",
56
+ "@hi-ui/use-toggle": "^5.0.0-canary.0",
57
+ "@hi-ui/use-uncontrolled-state": "^5.0.0-canary.0"
57
58
  },
58
59
  "peerDependencies": {
59
- "@hi-ui/core": ">=4.0.8",
60
+ "@hi-ui/core": ">=5.0.0-canary.0",
60
61
  "react": ">=16.8.6",
61
62
  "react-dom": ">=16.8.6"
62
63
  },
63
64
  "devDependencies": {
64
- "@hi-ui/core": "^4.0.8",
65
- "@hi-ui/core-css": "^4.1.5",
65
+ "@hi-ui/core": "^5.0.0-canary.0",
66
+ "@hi-ui/core-css": "^5.0.0-canary.0",
66
67
  "react": "^17.0.1",
67
68
  "react-dom": "^17.0.1"
68
69
  }