antd-mobile 5.0.0-rc.23 → 5.0.0-rc.24

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.
Files changed (135) hide show
  1. package/2x/README.md +6 -6
  2. package/2x/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
  3. package/2x/cjs/components/date-picker/date-picker.d.ts +1 -1
  4. package/2x/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
  5. package/2x/cjs/components/form/form-item.css +3 -2
  6. package/2x/cjs/components/form/form-item.d.ts +2 -2
  7. package/2x/cjs/components/form/form-item.js +9 -5
  8. package/2x/cjs/components/form/form.css +3 -3
  9. package/2x/cjs/components/form/form.d.ts +5 -4
  10. package/2x/cjs/components/form/index.css +6 -5
  11. package/2x/cjs/components/form/index.d.ts +5 -4
  12. package/2x/cjs/components/input/input.d.ts +2 -2
  13. package/2x/cjs/components/input/input.js +3 -1
  14. package/2x/cjs/components/list/list.css +2 -6
  15. package/2x/cjs/components/picker/picker.css +10 -2
  16. package/2x/cjs/components/picker/picker.d.ts +1 -1
  17. package/2x/cjs/components/picker-view/picker-view.css +2 -1
  18. package/2x/cjs/components/picker-view/picker-view.d.ts +1 -1
  19. package/2x/cjs/components/popover/arrow.d.ts +3 -0
  20. package/2x/cjs/components/popover/arrow.js +26 -0
  21. package/2x/cjs/components/popover/index.d.ts +7 -15
  22. package/2x/cjs/components/popover/index.js +4 -2
  23. package/2x/cjs/components/popover/popover-menu.css +63 -0
  24. package/2x/cjs/components/popover/popover-menu.d.ts +20 -0
  25. package/{cjs/components/popover/pop-menu.js → 2x/cjs/components/popover/popover-menu.js} +23 -26
  26. package/2x/cjs/components/popover/popover.css +90 -318
  27. package/2x/cjs/components/popover/popover.d.ts +9 -8
  28. package/2x/cjs/components/popover/popover.js +11 -17
  29. package/2x/cjs/components/text-area/text-area.css +9 -9
  30. package/2x/cjs/components/text-area/text-area.d.ts +2 -2
  31. package/2x/cjs/components/text-area/text-area.js +40 -32
  32. package/2x/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
  33. package/2x/es/components/date-picker/date-picker.d.ts +1 -1
  34. package/2x/es/components/date-picker-view/date-picker-view.d.ts +3 -2
  35. package/2x/es/components/form/form-item.css +3 -2
  36. package/2x/es/components/form/form-item.d.ts +2 -2
  37. package/2x/es/components/form/form-item.js +9 -5
  38. package/2x/es/components/form/form.css +3 -3
  39. package/2x/es/components/form/form.d.ts +5 -4
  40. package/2x/es/components/form/index.css +6 -5
  41. package/2x/es/components/form/index.d.ts +5 -4
  42. package/2x/es/components/input/input.d.ts +2 -2
  43. package/2x/es/components/input/input.js +3 -1
  44. package/2x/es/components/list/list.css +2 -6
  45. package/2x/es/components/picker/picker.css +10 -2
  46. package/2x/es/components/picker/picker.d.ts +1 -1
  47. package/2x/es/components/picker-view/picker-view.css +2 -1
  48. package/2x/es/components/picker-view/picker-view.d.ts +1 -1
  49. package/2x/es/components/popover/arrow.d.ts +3 -0
  50. package/2x/es/components/popover/arrow.js +12 -0
  51. package/2x/es/components/popover/index.d.ts +7 -15
  52. package/2x/es/components/popover/index.js +3 -2
  53. package/2x/es/components/popover/popover-menu.css +63 -0
  54. package/2x/es/components/popover/popover-menu.d.ts +20 -0
  55. package/2x/es/components/popover/popover-menu.js +52 -0
  56. package/2x/es/components/popover/popover.css +90 -318
  57. package/2x/es/components/popover/popover.d.ts +9 -8
  58. package/2x/es/components/popover/popover.js +10 -17
  59. package/2x/es/components/text-area/text-area.css +9 -9
  60. package/2x/es/components/text-area/text-area.d.ts +2 -2
  61. package/2x/es/components/text-area/text-area.js +40 -31
  62. package/2x/package.json +1 -1
  63. package/README.md +6 -6
  64. package/cjs/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
  65. package/cjs/components/date-picker/date-picker.d.ts +1 -1
  66. package/cjs/components/date-picker-view/date-picker-view.d.ts +3 -2
  67. package/cjs/components/form/form-item.css +3 -2
  68. package/cjs/components/form/form-item.d.ts +2 -2
  69. package/cjs/components/form/form-item.js +9 -5
  70. package/cjs/components/form/form.css +3 -3
  71. package/cjs/components/form/form.d.ts +5 -4
  72. package/cjs/components/form/index.css +6 -5
  73. package/cjs/components/form/index.d.ts +5 -4
  74. package/cjs/components/input/input.d.ts +2 -2
  75. package/cjs/components/input/input.js +3 -1
  76. package/cjs/components/list/list.css +2 -5
  77. package/cjs/components/picker/picker.css +9 -2
  78. package/cjs/components/picker/picker.d.ts +1 -1
  79. package/cjs/components/picker-view/picker-view.css +2 -1
  80. package/cjs/components/picker-view/picker-view.d.ts +1 -1
  81. package/cjs/components/popover/arrow.d.ts +3 -0
  82. package/cjs/components/popover/arrow.js +26 -0
  83. package/cjs/components/popover/index.d.ts +7 -15
  84. package/cjs/components/popover/index.js +4 -2
  85. package/cjs/components/popover/popover-menu.css +52 -0
  86. package/cjs/components/popover/popover-menu.d.ts +20 -0
  87. package/{2x/cjs/components/popover/pop-menu.js → cjs/components/popover/popover-menu.js} +23 -26
  88. package/cjs/components/popover/popover.css +83 -276
  89. package/cjs/components/popover/popover.d.ts +9 -8
  90. package/cjs/components/popover/popover.js +11 -17
  91. package/cjs/components/text-area/text-area.css +9 -9
  92. package/cjs/components/text-area/text-area.d.ts +2 -2
  93. package/cjs/components/text-area/text-area.js +40 -32
  94. package/es/components/cascade-picker-view/cascade-picker-view.d.ts +1 -2
  95. package/es/components/date-picker/date-picker.d.ts +1 -1
  96. package/es/components/date-picker-view/date-picker-view.d.ts +3 -2
  97. package/es/components/form/form-item.css +3 -2
  98. package/es/components/form/form-item.d.ts +2 -2
  99. package/es/components/form/form-item.js +9 -5
  100. package/es/components/form/form.css +3 -3
  101. package/es/components/form/form.d.ts +5 -4
  102. package/es/components/form/index.css +6 -5
  103. package/es/components/form/index.d.ts +5 -4
  104. package/es/components/input/input.d.ts +2 -2
  105. package/es/components/input/input.js +3 -1
  106. package/es/components/list/list.css +2 -5
  107. package/es/components/picker/picker.css +9 -2
  108. package/es/components/picker/picker.d.ts +1 -1
  109. package/es/components/picker-view/picker-view.css +2 -1
  110. package/es/components/picker-view/picker-view.d.ts +1 -1
  111. package/es/components/popover/arrow.d.ts +3 -0
  112. package/es/components/popover/arrow.js +12 -0
  113. package/es/components/popover/index.d.ts +7 -15
  114. package/es/components/popover/index.js +3 -2
  115. package/es/components/popover/popover-menu.css +52 -0
  116. package/es/components/popover/popover-menu.d.ts +20 -0
  117. package/es/components/popover/popover-menu.js +52 -0
  118. package/es/components/popover/popover.css +83 -276
  119. package/es/components/popover/popover.d.ts +9 -8
  120. package/es/components/popover/popover.js +10 -17
  121. package/es/components/text-area/text-area.css +9 -9
  122. package/es/components/text-area/text-area.d.ts +2 -2
  123. package/es/components/text-area/text-area.js +40 -31
  124. package/package.json +1 -1
  125. package/umd/antd-mobile.js +1 -1
  126. package/2x/cjs/components/popover/animation.css +0 -111
  127. package/2x/cjs/components/popover/pop-menu.d.ts +0 -28
  128. package/2x/es/components/popover/animation.css +0 -111
  129. package/2x/es/components/popover/pop-menu.d.ts +0 -28
  130. package/2x/es/components/popover/pop-menu.js +0 -54
  131. package/cjs/components/popover/animation.css +0 -96
  132. package/cjs/components/popover/pop-menu.d.ts +0 -28
  133. package/es/components/popover/animation.css +0 -96
  134. package/es/components/popover/pop-menu.d.ts +0 -28
  135. package/es/components/popover/pop-menu.js +0 -54
@@ -1,111 +0,0 @@
1
- @keyframes amSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 0% 0%;
5
- opacity: 0;
6
- }
7
-
8
- 100% {
9
- transform: scaleY(1);
10
- transform-origin: 0% 0%;
11
- opacity: 1;
12
- }
13
- }
14
-
15
- @keyframes amSlideDownOut {
16
- 0% {
17
- transform: scaleY(1);
18
- transform-origin: 0% 0%;
19
- opacity: 1;
20
- }
21
-
22
- 100% {
23
- transform: scaleY(0.8);
24
- transform-origin: 0% 0%;
25
- opacity: 0;
26
- }
27
- }
28
-
29
- @keyframes amSlideUpIn {
30
- 0% {
31
- transform: scaleY(0.8);
32
- transform-origin: 100% 100%;
33
- opacity: 0;
34
- }
35
-
36
- 100% {
37
- transform: scaleY(1);
38
- transform-origin: 100% 100%;
39
- opacity: 1;
40
- }
41
- }
42
-
43
- @keyframes amSlideUpOut {
44
- 0% {
45
- transform: scaleY(1);
46
- transform-origin: 100% 100%;
47
- opacity: 1;
48
- }
49
-
50
- 100% {
51
- transform: scaleY(0.8);
52
- transform-origin: 100% 100%;
53
- opacity: 0;
54
- }
55
- }
56
-
57
- @keyframes amSlideRightIn {
58
- 0% {
59
- transform: scaleX(0.8);
60
- transform-origin: 0% 0%;
61
- opacity: 0;
62
- }
63
-
64
- 100% {
65
- transform: scaleX(1);
66
- transform-origin: 0% 0%;
67
- opacity: 1;
68
- }
69
- }
70
-
71
- @keyframes amSlideRightOut {
72
- 0% {
73
- transform: scaleX(1);
74
- transform-origin: 0% 0%;
75
- opacity: 1;
76
- }
77
-
78
- 100% {
79
- transform: scaleX(0.8);
80
- transform-origin: 0% 0%;
81
- opacity: 0;
82
- }
83
- }
84
-
85
- @keyframes amSlideLeftIn {
86
- 0% {
87
- transform: scaleX(0.8);
88
- transform-origin: 100% 0%;
89
- opacity: 0;
90
- }
91
-
92
- 100% {
93
- transform: scaleX(1);
94
- transform-origin: 100% 0%;
95
- opacity: 1;
96
- }
97
- }
98
-
99
- @keyframes amSlideLeftOut {
100
- 0% {
101
- transform: scaleX(1);
102
- transform-origin: 100% 0%;
103
- opacity: 1;
104
- }
105
-
106
- 100% {
107
- transform: scaleX(0.8);
108
- transform-origin: 100% 0%;
109
- opacity: 0;
110
- }
111
- }
@@ -1,28 +0,0 @@
1
- import React, { ReactElement, Ref } from 'react';
2
- import { BasePopoverProps, PopoverRef } from './popover';
3
- export declare type Action = {
4
- text: React.ReactNode;
5
- icon?: React.ReactNode;
6
- disabled?: boolean;
7
- key?: string;
8
- onClick?: () => void;
9
- [key: string]: any;
10
- };
11
- export declare type PopMenuProps<T> = BasePopoverProps & {
12
- actions: T[];
13
- onAction?: (text: T) => void;
14
- };
15
- export declare const PopMenu: <T extends Action = Action>(props: {
16
- getContainer?: (() => HTMLElement) | undefined;
17
- destroyOnHide?: boolean | undefined;
18
- children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
19
- mode?: "dark" | "light" | undefined;
20
- trigger?: "click" | undefined;
21
- placement: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
22
- stopPropagation?: "click"[] | undefined;
23
- } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
24
- actions: T[];
25
- onAction?: ((text: T) => void) | undefined;
26
- } & {
27
- ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
28
- }) => ReactElement;
@@ -1,111 +0,0 @@
1
- @keyframes amSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 0% 0%;
5
- opacity: 0;
6
- }
7
-
8
- 100% {
9
- transform: scaleY(1);
10
- transform-origin: 0% 0%;
11
- opacity: 1;
12
- }
13
- }
14
-
15
- @keyframes amSlideDownOut {
16
- 0% {
17
- transform: scaleY(1);
18
- transform-origin: 0% 0%;
19
- opacity: 1;
20
- }
21
-
22
- 100% {
23
- transform: scaleY(0.8);
24
- transform-origin: 0% 0%;
25
- opacity: 0;
26
- }
27
- }
28
-
29
- @keyframes amSlideUpIn {
30
- 0% {
31
- transform: scaleY(0.8);
32
- transform-origin: 100% 100%;
33
- opacity: 0;
34
- }
35
-
36
- 100% {
37
- transform: scaleY(1);
38
- transform-origin: 100% 100%;
39
- opacity: 1;
40
- }
41
- }
42
-
43
- @keyframes amSlideUpOut {
44
- 0% {
45
- transform: scaleY(1);
46
- transform-origin: 100% 100%;
47
- opacity: 1;
48
- }
49
-
50
- 100% {
51
- transform: scaleY(0.8);
52
- transform-origin: 100% 100%;
53
- opacity: 0;
54
- }
55
- }
56
-
57
- @keyframes amSlideRightIn {
58
- 0% {
59
- transform: scaleX(0.8);
60
- transform-origin: 0% 0%;
61
- opacity: 0;
62
- }
63
-
64
- 100% {
65
- transform: scaleX(1);
66
- transform-origin: 0% 0%;
67
- opacity: 1;
68
- }
69
- }
70
-
71
- @keyframes amSlideRightOut {
72
- 0% {
73
- transform: scaleX(1);
74
- transform-origin: 0% 0%;
75
- opacity: 1;
76
- }
77
-
78
- 100% {
79
- transform: scaleX(0.8);
80
- transform-origin: 0% 0%;
81
- opacity: 0;
82
- }
83
- }
84
-
85
- @keyframes amSlideLeftIn {
86
- 0% {
87
- transform: scaleX(0.8);
88
- transform-origin: 100% 0%;
89
- opacity: 0;
90
- }
91
-
92
- 100% {
93
- transform: scaleX(1);
94
- transform-origin: 100% 0%;
95
- opacity: 1;
96
- }
97
- }
98
-
99
- @keyframes amSlideLeftOut {
100
- 0% {
101
- transform: scaleX(1);
102
- transform-origin: 100% 0%;
103
- opacity: 1;
104
- }
105
-
106
- 100% {
107
- transform: scaleX(0.8);
108
- transform-origin: 100% 0%;
109
- opacity: 0;
110
- }
111
- }
@@ -1,28 +0,0 @@
1
- import React, { ReactElement, Ref } from 'react';
2
- import { BasePopoverProps, PopoverRef } from './popover';
3
- export declare type Action = {
4
- text: React.ReactNode;
5
- icon?: React.ReactNode;
6
- disabled?: boolean;
7
- key?: string;
8
- onClick?: () => void;
9
- [key: string]: any;
10
- };
11
- export declare type PopMenuProps<T> = BasePopoverProps & {
12
- actions: T[];
13
- onAction?: (text: T) => void;
14
- };
15
- export declare const PopMenu: <T extends Action = Action>(props: {
16
- getContainer?: (() => HTMLElement) | undefined;
17
- destroyOnHide?: boolean | undefined;
18
- children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
19
- mode?: "dark" | "light" | undefined;
20
- trigger?: "click" | undefined;
21
- placement: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
22
- stopPropagation?: "click"[] | undefined;
23
- } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
24
- actions: T[];
25
- onAction?: ((text: T) => void) | undefined;
26
- } & {
27
- ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
28
- }) => ReactElement;
@@ -1,54 +0,0 @@
1
- import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';
2
- import classNames from 'classnames';
3
- import Button from '../button';
4
- import { Popover } from './popover';
5
- const classPrefix = `adm-popover`;
6
- export const PopMenu = forwardRef((props, ref) => {
7
- const innerRef = useRef(null);
8
- useImperativeHandle(ref, () => innerRef.current, []);
9
- const onClick = useCallback(e => {
10
- var _a;
11
-
12
- const {
13
- onAction
14
- } = props;
15
-
16
- if (onAction) {
17
- onAction(e);
18
- }
19
-
20
- (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.hide();
21
- }, [props.onAction]);
22
- const overlay = useMemo(() => {
23
- return React.createElement(React.Fragment, null, (props.actions || []).map((ele, index) => {
24
- var _a;
25
-
26
- return React.createElement("div", {
27
- className: classNames(`${classPrefix}-inner-menu`, {
28
- [`${classPrefix}-inner-menu-with-icon`]: !!ele.icon
29
- }),
30
- key: (_a = ele.key) !== null && _a !== void 0 ? _a : index
31
- }, React.createElement(Button, {
32
- disabled: ele.disabled,
33
- onClick: () => {
34
- var _a;
35
-
36
- if (!ele.disabled) {
37
- onClick(ele);
38
- (_a = ele.onClick) === null || _a === void 0 ? void 0 : _a.call(ele);
39
- }
40
- },
41
- fill: 'none',
42
- block: true
43
- }, ele.icon && React.createElement("span", {
44
- className: `${classPrefix}-inner-menu-icon`
45
- }, ele.icon), ele.text));
46
- }));
47
- }, [props.actions, onClick]);
48
- return React.createElement(Popover, Object.assign({
49
- ref: innerRef
50
- }, props, {
51
- overlayClassName: classNames(`${classPrefix}-menu`, props.overlayClassName),
52
- content: overlay
53
- }), props.children);
54
- });
@@ -1,96 +0,0 @@
1
- @keyframes amSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 0% 0%;
5
- opacity: 0;
6
- }
7
- 100% {
8
- transform: scaleY(1);
9
- transform-origin: 0% 0%;
10
- opacity: 1;
11
- }
12
- }
13
- @keyframes amSlideDownOut {
14
- 0% {
15
- transform: scaleY(1);
16
- transform-origin: 0% 0%;
17
- opacity: 1;
18
- }
19
- 100% {
20
- transform: scaleY(0.8);
21
- transform-origin: 0% 0%;
22
- opacity: 0;
23
- }
24
- }
25
- @keyframes amSlideUpIn {
26
- 0% {
27
- transform: scaleY(0.8);
28
- transform-origin: 100% 100%;
29
- opacity: 0;
30
- }
31
- 100% {
32
- transform: scaleY(1);
33
- transform-origin: 100% 100%;
34
- opacity: 1;
35
- }
36
- }
37
- @keyframes amSlideUpOut {
38
- 0% {
39
- transform: scaleY(1);
40
- transform-origin: 100% 100%;
41
- opacity: 1;
42
- }
43
- 100% {
44
- transform: scaleY(0.8);
45
- transform-origin: 100% 100%;
46
- opacity: 0;
47
- }
48
- }
49
- @keyframes amSlideRightIn {
50
- 0% {
51
- transform: scaleX(0.8);
52
- transform-origin: 0% 0%;
53
- opacity: 0;
54
- }
55
- 100% {
56
- transform: scaleX(1);
57
- transform-origin: 0% 0%;
58
- opacity: 1;
59
- }
60
- }
61
- @keyframes amSlideRightOut {
62
- 0% {
63
- transform: scaleX(1);
64
- transform-origin: 0% 0%;
65
- opacity: 1;
66
- }
67
- 100% {
68
- transform: scaleX(0.8);
69
- transform-origin: 0% 0%;
70
- opacity: 0;
71
- }
72
- }
73
- @keyframes amSlideLeftIn {
74
- 0% {
75
- transform: scaleX(0.8);
76
- transform-origin: 100% 0%;
77
- opacity: 0;
78
- }
79
- 100% {
80
- transform: scaleX(1);
81
- transform-origin: 100% 0%;
82
- opacity: 1;
83
- }
84
- }
85
- @keyframes amSlideLeftOut {
86
- 0% {
87
- transform: scaleX(1);
88
- transform-origin: 100% 0%;
89
- opacity: 1;
90
- }
91
- 100% {
92
- transform: scaleX(0.8);
93
- transform-origin: 100% 0%;
94
- opacity: 0;
95
- }
96
- }
@@ -1,28 +0,0 @@
1
- import React, { ReactElement, Ref } from 'react';
2
- import { BasePopoverProps, PopoverRef } from './popover';
3
- export declare type Action = {
4
- text: React.ReactNode;
5
- icon?: React.ReactNode;
6
- disabled?: boolean;
7
- key?: string;
8
- onClick?: () => void;
9
- [key: string]: any;
10
- };
11
- export declare type PopMenuProps<T> = BasePopoverProps & {
12
- actions: T[];
13
- onAction?: (text: T) => void;
14
- };
15
- export declare const PopMenu: <T extends Action = Action>(props: {
16
- getContainer?: (() => HTMLElement) | undefined;
17
- destroyOnHide?: boolean | undefined;
18
- children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
19
- mode?: "dark" | "light" | undefined;
20
- trigger?: "click" | undefined;
21
- placement: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
22
- stopPropagation?: "click"[] | undefined;
23
- } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
24
- actions: T[];
25
- onAction?: ((text: T) => void) | undefined;
26
- } & {
27
- ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
28
- }) => ReactElement;
@@ -1,96 +0,0 @@
1
- @keyframes amSlideDownIn {
2
- 0% {
3
- transform: scaleY(0.8);
4
- transform-origin: 0% 0%;
5
- opacity: 0;
6
- }
7
- 100% {
8
- transform: scaleY(1);
9
- transform-origin: 0% 0%;
10
- opacity: 1;
11
- }
12
- }
13
- @keyframes amSlideDownOut {
14
- 0% {
15
- transform: scaleY(1);
16
- transform-origin: 0% 0%;
17
- opacity: 1;
18
- }
19
- 100% {
20
- transform: scaleY(0.8);
21
- transform-origin: 0% 0%;
22
- opacity: 0;
23
- }
24
- }
25
- @keyframes amSlideUpIn {
26
- 0% {
27
- transform: scaleY(0.8);
28
- transform-origin: 100% 100%;
29
- opacity: 0;
30
- }
31
- 100% {
32
- transform: scaleY(1);
33
- transform-origin: 100% 100%;
34
- opacity: 1;
35
- }
36
- }
37
- @keyframes amSlideUpOut {
38
- 0% {
39
- transform: scaleY(1);
40
- transform-origin: 100% 100%;
41
- opacity: 1;
42
- }
43
- 100% {
44
- transform: scaleY(0.8);
45
- transform-origin: 100% 100%;
46
- opacity: 0;
47
- }
48
- }
49
- @keyframes amSlideRightIn {
50
- 0% {
51
- transform: scaleX(0.8);
52
- transform-origin: 0% 0%;
53
- opacity: 0;
54
- }
55
- 100% {
56
- transform: scaleX(1);
57
- transform-origin: 0% 0%;
58
- opacity: 1;
59
- }
60
- }
61
- @keyframes amSlideRightOut {
62
- 0% {
63
- transform: scaleX(1);
64
- transform-origin: 0% 0%;
65
- opacity: 1;
66
- }
67
- 100% {
68
- transform: scaleX(0.8);
69
- transform-origin: 0% 0%;
70
- opacity: 0;
71
- }
72
- }
73
- @keyframes amSlideLeftIn {
74
- 0% {
75
- transform: scaleX(0.8);
76
- transform-origin: 100% 0%;
77
- opacity: 0;
78
- }
79
- 100% {
80
- transform: scaleX(1);
81
- transform-origin: 100% 0%;
82
- opacity: 1;
83
- }
84
- }
85
- @keyframes amSlideLeftOut {
86
- 0% {
87
- transform: scaleX(1);
88
- transform-origin: 100% 0%;
89
- opacity: 1;
90
- }
91
- 100% {
92
- transform: scaleX(0.8);
93
- transform-origin: 100% 0%;
94
- opacity: 0;
95
- }
96
- }
@@ -1,28 +0,0 @@
1
- import React, { ReactElement, Ref } from 'react';
2
- import { BasePopoverProps, PopoverRef } from './popover';
3
- export declare type Action = {
4
- text: React.ReactNode;
5
- icon?: React.ReactNode;
6
- disabled?: boolean;
7
- key?: string;
8
- onClick?: () => void;
9
- [key: string]: any;
10
- };
11
- export declare type PopMenuProps<T> = BasePopoverProps & {
12
- actions: T[];
13
- onAction?: (text: T) => void;
14
- };
15
- export declare const PopMenu: <T extends Action = Action>(props: {
16
- getContainer?: (() => HTMLElement) | undefined;
17
- destroyOnHide?: boolean | undefined;
18
- children: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
19
- mode?: "dark" | "light" | undefined;
20
- trigger?: "click" | undefined;
21
- placement: "left" | "right" | "bottom" | "top" | "topLeft" | "topRight" | "bottomLeft" | "bottomRight" | "leftTop" | "leftBottom" | "rightTop" | "rightBottom";
22
- stopPropagation?: "click"[] | undefined;
23
- } & Pick<import("rc-tooltip/lib/Tooltip").TooltipProps, "visible" | "zIndex" | "align" | "defaultVisible" | "onVisibleChange" | "overlayStyle" | "overlayClassName"> & import("../../utils/native-props").NativeProps<"--z-index"> & {
24
- actions: T[];
25
- onAction?: ((text: T) => void) | undefined;
26
- } & {
27
- ref?: ((instance: PopoverRef | null) => void) | React.RefObject<PopoverRef> | null | undefined;
28
- }) => ReactElement;
@@ -1,54 +0,0 @@
1
- import React, { forwardRef, useCallback, useImperativeHandle, useMemo, useRef } from 'react';
2
- import classNames from 'classnames';
3
- import Button from '../button';
4
- import { Popover } from './popover';
5
- const classPrefix = `adm-popover`;
6
- export const PopMenu = forwardRef((props, ref) => {
7
- const innerRef = useRef(null);
8
- useImperativeHandle(ref, () => innerRef.current, []);
9
- const onClick = useCallback(e => {
10
- var _a;
11
-
12
- const {
13
- onAction
14
- } = props;
15
-
16
- if (onAction) {
17
- onAction(e);
18
- }
19
-
20
- (_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.hide();
21
- }, [props.onAction]);
22
- const overlay = useMemo(() => {
23
- return React.createElement(React.Fragment, null, (props.actions || []).map((ele, index) => {
24
- var _a;
25
-
26
- return React.createElement("div", {
27
- className: classNames(`${classPrefix}-inner-menu`, {
28
- [`${classPrefix}-inner-menu-with-icon`]: !!ele.icon
29
- }),
30
- key: (_a = ele.key) !== null && _a !== void 0 ? _a : index
31
- }, React.createElement(Button, {
32
- disabled: ele.disabled,
33
- onClick: () => {
34
- var _a;
35
-
36
- if (!ele.disabled) {
37
- onClick(ele);
38
- (_a = ele.onClick) === null || _a === void 0 ? void 0 : _a.call(ele);
39
- }
40
- },
41
- fill: 'none',
42
- block: true
43
- }, ele.icon && React.createElement("span", {
44
- className: `${classPrefix}-inner-menu-icon`
45
- }, ele.icon), ele.text));
46
- }));
47
- }, [props.actions, onClick]);
48
- return React.createElement(Popover, Object.assign({
49
- ref: innerRef
50
- }, props, {
51
- overlayClassName: classNames(`${classPrefix}-menu`, props.overlayClassName),
52
- content: overlay
53
- }), props.children);
54
- });