antd-mobile 5.2.1 → 5.2.2

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 (53) hide show
  1. package/2x/cjs/components/date-picker/date-picker.js +1 -1
  2. package/2x/cjs/components/dialog/dialog.css +27 -18
  3. package/2x/cjs/components/dialog/dialog.js +39 -42
  4. package/2x/cjs/components/dropdown/dropdown.css +2 -1
  5. package/2x/cjs/components/modal/modal.css +27 -21
  6. package/2x/cjs/components/modal/modal.js +39 -36
  7. package/2x/cjs/components/popover/arrow.js +1 -2
  8. package/2x/cjs/components/switch/spin-icon.d.ts +3 -0
  9. package/2x/cjs/components/switch/spin-icon.js +37 -0
  10. package/2x/cjs/components/switch/switch.css +1 -1
  11. package/2x/cjs/components/switch/switch.js +4 -6
  12. package/2x/es/components/date-picker/date-picker.js +1 -1
  13. package/2x/es/components/dialog/dialog.css +27 -18
  14. package/2x/es/components/dialog/dialog.js +37 -41
  15. package/2x/es/components/dropdown/dropdown.css +2 -1
  16. package/2x/es/components/modal/modal.css +27 -21
  17. package/2x/es/components/modal/modal.js +37 -36
  18. package/2x/es/components/popover/arrow.js +1 -2
  19. package/2x/es/components/switch/spin-icon.d.ts +3 -0
  20. package/2x/es/components/switch/spin-icon.js +23 -0
  21. package/2x/es/components/switch/switch.css +1 -1
  22. package/2x/es/components/switch/switch.js +3 -5
  23. package/2x/package.json +1 -1
  24. package/cjs/components/date-picker/date-picker.js +1 -1
  25. package/cjs/components/dialog/dialog.css +26 -18
  26. package/cjs/components/dialog/dialog.js +39 -42
  27. package/cjs/components/dropdown/dropdown.css +2 -1
  28. package/cjs/components/modal/modal.css +26 -20
  29. package/cjs/components/modal/modal.js +39 -36
  30. package/cjs/components/popover/arrow.js +1 -2
  31. package/cjs/components/switch/spin-icon.d.ts +3 -0
  32. package/cjs/components/switch/spin-icon.js +37 -0
  33. package/cjs/components/switch/switch.css +1 -1
  34. package/cjs/components/switch/switch.js +4 -6
  35. package/es/components/date-picker/date-picker.js +1 -1
  36. package/es/components/dialog/dialog.css +26 -18
  37. package/es/components/dialog/dialog.js +37 -41
  38. package/es/components/dropdown/dropdown.css +2 -1
  39. package/es/components/modal/modal.css +26 -20
  40. package/es/components/modal/modal.js +37 -36
  41. package/es/components/popover/arrow.js +1 -2
  42. package/es/components/switch/spin-icon.d.ts +3 -0
  43. package/es/components/switch/spin-icon.js +23 -0
  44. package/es/components/switch/switch.css +1 -1
  45. package/es/components/switch/switch.js +3 -5
  46. package/package.json +1 -1
  47. package/umd/antd-mobile.js +1 -1
  48. package/2x/assets/spin.svg +0 -12
  49. package/2x/cjs/assets/spin.svg +0 -12
  50. package/2x/es/assets/spin.svg +0 -12
  51. package/assets/spin.svg +0 -12
  52. package/cjs/assets/spin.svg +0 -12
  53. package/es/assets/spin.svg +0 -12
@@ -53,7 +53,7 @@ const DatePicker = p => {
53
53
  let date = value;
54
54
 
55
55
  if (date === null) {
56
- date = new Date((0, _bound.bound)(now.getDate(), props.min.getDate(), props.max.getDate()));
56
+ date = new Date((0, _bound.bound)(now.getTime(), props.min.getTime(), props.max.getTime()));
57
57
  }
58
58
 
59
59
  return (0, _datePickerUtils.convertDateToStringArray)(date, props.precision);
@@ -18,7 +18,7 @@
18
18
  transform: translate(-50%, -50%);
19
19
  }
20
20
 
21
- .adm-dialog-main {
21
+ .adm-dialog-body {
22
22
  width: 100%;
23
23
  max-height: 70vh;
24
24
  font-size: 28px;
@@ -29,35 +29,39 @@
29
29
  flex-direction: column;
30
30
  }
31
31
 
32
- .adm-dialog-main > * {
32
+ .adm-dialog-body > * {
33
33
  flex: none;
34
34
  }
35
35
 
36
- .adm-dialog-main > .adm-dialog-image-container {
36
+ .adm-dialog-body > .adm-dialog-content {
37
37
  flex: auto;
38
38
  }
39
39
 
40
- .adm-dialog-main > .adm-dialog-image-container + .adm-dialog-body {
41
- padding-top: 24px;
40
+ .adm-dialog-body:not(.adm-dialog-with-image) {
41
+ padding-top: 40px;
42
42
  }
43
43
 
44
- .adm-dialog-main .adm-dialog-body {
45
- padding: 40px 24px;
44
+ .adm-dialog-body .adm-dialog-image-container {
45
+ margin-bottom: 24px;
46
+ max-height: 40vh;
46
47
  }
47
48
 
48
- .adm-dialog-main .adm-dialog-body-header-wrapper {
49
- display: flex;
50
- justify-content: center;
49
+ .adm-dialog-body .adm-dialog-header {
50
+ margin-bottom: 16px;
51
+ padding: 0 24px;
51
52
  }
52
53
 
53
- .adm-dialog-main .adm-dialog-body-title {
54
+ .adm-dialog-body .adm-dialog-title {
55
+ margin-bottom: 16px;
56
+ padding: 0 24px;
54
57
  font-weight: bold;
55
58
  font-size: 36px;
56
59
  line-height: 50px;
57
60
  text-align: center;
58
61
  }
59
62
 
60
- .adm-dialog-main .adm-dialog-body-content {
63
+ .adm-dialog-body .adm-dialog-content {
64
+ padding: 0 24px 40px;
61
65
  max-height: 70vh;
62
66
  overflow-x: hidden;
63
67
  overflow-y: auto;
@@ -66,21 +70,26 @@
66
70
  color: #333;
67
71
  }
68
72
 
69
- .adm-dialog-main .adm-dialog-footer {
73
+ .adm-dialog-body .adm-dialog-content-empty {
74
+ padding: 0;
75
+ height: 24px;
76
+ }
77
+
78
+ .adm-dialog-body .adm-dialog-footer {
70
79
  user-select: none;
71
80
  }
72
81
 
73
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row {
82
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row {
74
83
  display: flex;
75
84
  align-items: stretch;
76
85
  border-top: 1px solid var(--adm-border-color);
77
86
  }
78
87
 
79
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > * {
88
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > * {
80
89
  flex: 1;
81
90
  }
82
91
 
83
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button {
92
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button {
84
93
  padding: 20px;
85
94
  font-size: 36px;
86
95
  line-height: 50px;
@@ -88,11 +97,11 @@
88
97
  border-right: solid 1px var(--adm-border-color);
89
98
  }
90
99
 
91
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button-bold {
100
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button-bold {
92
101
  font-weight: bold;
93
102
  }
94
103
 
95
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button:last-child {
104
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button:last-child {
96
105
  border-right: none;
97
106
  }
98
107
 
@@ -21,8 +21,6 @@ var _dialogActionButton = require("./dialog-action-button");
21
21
 
22
22
  var _image = _interopRequireDefault(require("../image"));
23
23
 
24
- var _space = _interopRequireDefault(require("../space"));
25
-
26
24
  var _renderToContainer = require("../../utils/render-to-container");
27
25
 
28
26
  var _withStopPropagation = require("../../utils/with-stop-propagation");
@@ -39,7 +37,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
39
37
 
40
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
39
 
42
- const classPrefix = `adm-dialog`;
43
40
  const defaultProps = {
44
41
  visible: false,
45
42
  actions: [],
@@ -78,51 +75,28 @@ const Dialog = p => {
78
75
  }
79
76
  });
80
77
  const [active, setActive] = (0, _react.useState)(props.visible);
81
- const node = (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
82
- className: classPrefix,
83
- style: {
84
- display: active ? 'unset' : 'none'
85
- }
86
- }, _react.default.createElement(_mask.default, {
87
- visible: props.visible,
88
- onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
89
- style: props.maskStyle,
90
- className: (0, _classnames.default)(`${classPrefix}-mask`, props.maskClassName)
91
- }), _react.default.createElement("div", {
92
- className: `${classPrefix}-wrap`,
93
- style: {
94
- pointerEvents: props.visible ? 'unset' : 'none'
95
- }
96
- }, _react.default.createElement(_web.animated.div, {
97
- style: Object.assign({}, style),
98
- onClick: e => e.stopPropagation(),
99
- className: `${classPrefix}-main`
78
+
79
+ const body = _react.default.createElement("div", {
80
+ className: (0, _classnames.default)(cls('body'), props.image && cls('with-image'), props.bodyClassName),
81
+ style: props.bodyStyle
100
82
  }, !!props.image && _react.default.createElement("div", {
101
- className: `${classPrefix}-image-container`
83
+ className: cls('image-container')
102
84
  }, _react.default.createElement(_image.default, {
103
85
  src: props.image,
104
86
  alt: 'dialog header image',
105
87
  width: '100%'
106
- })), _react.default.createElement("div", {
107
- style: props.bodyStyle,
108
- className: (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName)
109
- }, _react.default.createElement(_space.default, {
110
- direction: 'vertical',
111
- block: true
112
- }, !!props.header && _react.default.createElement("div", {
113
- className: `${classPrefix}-body-header-wrapper`
114
- }, _react.default.createElement("div", {
115
- className: `${classPrefix}-body-header`
116
- }, props.header)), !!props.title && _react.default.createElement("div", {
117
- className: `${classPrefix}-body-title`
118
- }, props.title), !!props.content && _react.default.createElement("div", {
119
- className: `${classPrefix}-body-content`
120
- }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content))), _react.default.createElement("div", {
121
- className: `${classPrefix}-footer`
88
+ })), !!props.header && _react.default.createElement("div", {
89
+ className: cls('header')
90
+ }, _react.default.createElement(_autoCenter.default, null, props.header)), !!props.title && _react.default.createElement("div", {
91
+ className: cls('title')
92
+ }, props.title), _react.default.createElement("div", {
93
+ className: (0, _classnames.default)(cls('content'), !props.content && cls('content-empty'))
94
+ }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content), _react.default.createElement("div", {
95
+ className: cls('footer')
122
96
  }, props.actions.map((row, index) => {
123
97
  const actions = Array.isArray(row) ? row : [row];
124
98
  return _react.default.createElement("div", {
125
- className: `${classPrefix}-action-row`,
99
+ className: cls('action-row'),
126
100
  key: index
127
101
  }, actions.map((action, index) => _react.default.createElement(_dialogActionButton.DialogActionButton, {
128
102
  key: action.key,
@@ -137,8 +111,31 @@ const Dialog = p => {
137
111
  }
138
112
  })
139
113
  })));
140
- }))))));
114
+ })));
115
+
116
+ const node = (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
117
+ className: cls(),
118
+ style: {
119
+ display: active ? 'unset' : 'none'
120
+ }
121
+ }, _react.default.createElement(_mask.default, {
122
+ visible: props.visible,
123
+ onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
124
+ style: props.maskStyle,
125
+ className: (0, _classnames.default)(cls('mask'), props.maskClassName)
126
+ }), _react.default.createElement("div", {
127
+ className: cls('wrap'),
128
+ style: {
129
+ pointerEvents: props.visible ? 'unset' : 'none'
130
+ }
131
+ }, _react.default.createElement(_web.animated.div, {
132
+ style: style
133
+ }, body))));
141
134
  return (0, _renderToContainer.renderToContainer)(props.getContainer, (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, node));
142
135
  };
143
136
 
144
- exports.Dialog = Dialog;
137
+ exports.Dialog = Dialog;
138
+
139
+ function cls(name = '') {
140
+ return 'adm-dialog' + (name && '-') + name;
141
+ }
@@ -4,10 +4,11 @@
4
4
 
5
5
  .adm-dropdown .adm-dropdown-nav {
6
6
  display: flex;
7
+ border-bottom: 2px solid transparent;
7
8
  }
8
9
 
9
10
  .adm-dropdown-open .adm-dropdown-nav {
10
- border-bottom: 2px solid var(--adm-border-color);
11
+ border-bottom-color: var(--adm-border-color);
11
12
  }
12
13
 
13
14
  .adm-dropdown-item {
@@ -19,56 +19,61 @@
19
19
  transform: translate(-50%, -50%);
20
20
  }
21
21
 
22
- .adm-modal-main {
22
+ .adm-modal-body {
23
23
  width: 100%;
24
24
  max-height: 70vh;
25
25
  box-sizing: border-box;
26
26
  font-size: 28px;
27
27
  background-color: white;
28
28
  border-radius: 16px;
29
- overflow-x: hidden;
30
- overflow-y: auto;
29
+ overflow: hidden;
31
30
  display: flex;
32
31
  flex-direction: column;
33
32
  }
34
33
 
35
- .adm-modal-main > * {
34
+ .adm-modal-body > * {
36
35
  flex: none;
37
36
  }
38
37
 
39
- .adm-modal-main > .adm-modal-image-container {
38
+ .adm-modal-body > .adm-modal-content {
40
39
  flex: auto;
41
40
  }
42
41
 
43
- .adm-modal-main .adm-modal-body {
44
- padding: 40px 24px 24px;
45
- display: flex;
46
- flex-direction: column;
42
+ .adm-modal-body:not(.adm-modal-with-image) {
43
+ padding-top: 40px;
47
44
  }
48
45
 
49
- .adm-modal-main .adm-modal-body > * + * {
50
- margin-top: 16px;
46
+ .adm-modal-body .adm-modal-image-container {
47
+ margin-bottom: 24px;
48
+ max-height: 40vh;
49
+ overflow-y: scroll;
51
50
  }
52
51
 
53
- .adm-modal-main .adm-modal-body-header-wrapper {
54
- display: flex;
55
- justify-content: center;
52
+ .adm-modal-body .adm-modal-header {
53
+ margin-bottom: 16px;
54
+ padding: 0 24px;
56
55
  }
57
56
 
58
- .adm-modal-main .adm-modal-body-title {
57
+ .adm-modal-body .adm-modal-title {
58
+ margin-bottom: 16px;
59
+ padding: 0 24px;
59
60
  font-weight: bold;
60
61
  font-size: 36px;
61
62
  line-height: 50px;
62
63
  text-align: center;
63
64
  }
64
65
 
65
- .adm-modal-main .adm-modal-body-content {
66
+ .adm-modal-body .adm-modal-content {
67
+ padding: 0 24px 24px;
68
+ max-height: 70vh;
69
+ overflow-x: hidden;
70
+ overflow-y: auto;
66
71
  font-size: 30px;
67
72
  line-height: 1.4;
68
73
  color: #333;
69
74
  }
70
75
 
71
- .adm-modal-main .adm-modal-close {
76
+ .adm-modal-body .adm-modal-close {
72
77
  position: absolute;
73
78
  right: 16px;
74
79
  top: 16px;
@@ -82,6 +87,11 @@
82
87
  padding: 16px 24px 24px;
83
88
  }
84
89
 
90
+ .adm-modal-footer-empty {
91
+ padding: 0;
92
+ height: 16px;
93
+ }
94
+
85
95
  .adm-modal-footer.adm-space {
86
96
  --gap-vertical: 40px;
87
97
  }
@@ -102,8 +112,4 @@
102
112
 
103
113
  .adm-modal-footer .adm-modal-button:not(.adm-modal-button-primary):active {
104
114
  opacity: 0.7;
105
- }
106
-
107
- .adm-modal-image-container {
108
- overflow-y: auto;
109
115
  }
@@ -81,49 +81,29 @@ const Modal = p => {
81
81
  }
82
82
  });
83
83
  const [active, setActive] = (0, _react.useState)(props.visible);
84
- const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
85
- className: classPrefix,
86
- style: {
87
- display: active ? 'unset' : 'none'
88
- }
89
- }, _react.default.createElement(_mask.default, {
90
- visible: props.visible,
91
- onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
92
- style: props.maskStyle,
93
- className: (0, _classnames.default)(`${classPrefix}-mask`, props.maskClassName)
94
- }), _react.default.createElement("div", {
95
- className: `${classPrefix}-wrap`,
96
- style: {
97
- pointerEvents: props.visible ? 'unset' : 'none'
98
- }
99
- }, _react.default.createElement(_web.animated.div, {
100
- style: Object.assign({}, style),
101
- onClick: e => e.stopPropagation(),
102
- className: `${classPrefix}-main`
84
+
85
+ const body = _react.default.createElement("div", {
86
+ className: (0, _classnames.default)(cls('body'), props.image && cls('with-image'), props.bodyClassName),
87
+ style: props.bodyStyle
103
88
  }, props.showCloseButton && _react.default.createElement("a", {
104
- className: (0, _classnames.default)(`${classPrefix}-close`, 'adm-plain-anchor'),
89
+ className: (0, _classnames.default)(cls('close'), 'adm-plain-anchor'),
105
90
  onClick: props.onClose
106
91
  }, _react.default.createElement(_antdMobileIcons.CloseOutline, null)), !!props.image && _react.default.createElement("div", {
107
- className: `${classPrefix}-image-container`
92
+ className: cls('image-container')
108
93
  }, _react.default.createElement(_image.default, {
109
94
  src: props.image,
110
95
  alt: 'modal header image',
111
96
  width: '100%'
112
- })), _react.default.createElement("div", {
113
- style: props.bodyStyle,
114
- className: (0, _classnames.default)(`${classPrefix}-body`, props.bodyClassName)
115
- }, !!props.header && _react.default.createElement("div", {
116
- className: `${classPrefix}-body-header-wrapper`
117
- }, _react.default.createElement("div", {
118
- className: `${classPrefix}-body-header`
119
- }, props.header)), !!props.title && _react.default.createElement("div", {
120
- className: `${classPrefix}-body-title`
121
- }, props.title), !!props.content && _react.default.createElement("div", {
122
- className: `${classPrefix}-body-content`
123
- }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content)), _react.default.createElement(_space.default, {
97
+ })), !!props.header && _react.default.createElement("div", {
98
+ className: cls('header')
99
+ }, _react.default.createElement(_autoCenter.default, null, props.header)), !!props.title && _react.default.createElement("div", {
100
+ className: cls('title')
101
+ }, props.title), _react.default.createElement("div", {
102
+ className: cls('content')
103
+ }, typeof props.content === 'string' ? _react.default.createElement(_autoCenter.default, null, props.content) : props.content), _react.default.createElement(_space.default, {
124
104
  direction: 'vertical',
125
105
  block: true,
126
- className: `${classPrefix}-footer`
106
+ className: (0, _classnames.default)(cls('footer'), props.actions.length === 0 && cls('footer-empty'))
127
107
  }, props.actions.map((action, index) => {
128
108
  return _react.default.createElement(_modalActionButton.ModalActionButton, {
129
109
  key: action.key,
@@ -138,8 +118,31 @@ const Modal = p => {
138
118
  }
139
119
  })
140
120
  });
141
- })))))));
121
+ })));
122
+
123
+ const node = (0, _withStopPropagation.withStopPropagation)(props.stopPropagation, (0, _nativeProps.withNativeProps)(props, _react.default.createElement("div", {
124
+ className: cls(),
125
+ style: {
126
+ display: active ? 'unset' : 'none'
127
+ }
128
+ }, _react.default.createElement(_mask.default, {
129
+ visible: props.visible,
130
+ onMaskClick: props.closeOnMaskClick ? props.onClose : undefined,
131
+ style: props.maskStyle,
132
+ className: (0, _classnames.default)(cls('mask'), props.maskClassName)
133
+ }), _react.default.createElement("div", {
134
+ className: cls('wrap'),
135
+ style: {
136
+ pointerEvents: props.visible ? 'unset' : 'none'
137
+ }
138
+ }, _react.default.createElement(_web.animated.div, {
139
+ style: style
140
+ }, body)))));
142
141
  return (0, _renderToContainer.renderToContainer)(props.getContainer, node);
143
142
  };
144
143
 
145
- exports.Modal = Modal;
144
+ exports.Modal = Modal;
145
+
146
+ function cls(name = '') {
147
+ return 'adm-modal' + (name && '-') + name;
148
+ }
@@ -17,10 +17,9 @@ const Arrow = (0, _react.memo)(props => {
17
17
  return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
18
18
  viewBox: '0 0 30 16'
19
19
  }, _react.default.createElement("g", {
20
- transform: 'translate(-1300.000000, -841.000000)',
21
20
  fill: 'currentColor'
22
21
  }, _react.default.createElement("path", {
23
- d: 'M1300,841 L1330,841 L1318.07289,855.312538 C1316.65863,857.009645 1314.13637,857.238942 1312.43926,855.824685 C1312.25341,855.669808 1312.08199,855.49839 1311.92711,855.312538 L1300,841 L1300,841 Z'
22
+ d: 'M0,0 L30,0 L18.07289,14.312538 C16.65863,16.009645 14.13637,16.238942 12.43926,14.824685 C12.25341,14.669808 12.08199,14.49839 11.92711,14.312538 L0,0 L0,0 Z'
24
23
  }))));
25
24
  });
26
25
  exports.Arrow = Arrow;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { NativeProps } from '../../utils/native-props';
3
+ export declare const SpinIcon: React.NamedExoticComponent<NativeProps<never>>;
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SpinIcon = void 0;
7
+
8
+ var _react = _interopRequireWildcard(require("react"));
9
+
10
+ var _nativeProps = require("../../utils/native-props");
11
+
12
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
13
+
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
15
+
16
+ const SpinIcon = (0, _react.memo)(props => {
17
+ return (0, _nativeProps.withNativeProps)(props, _react.default.createElement("svg", {
18
+ width: '28px',
19
+ height: '28px',
20
+ viewBox: '0 0 28 28'
21
+ }, _react.default.createElement("g", {
22
+ stroke: 'none',
23
+ strokeWidth: '1',
24
+ fill: 'none',
25
+ fillRule: 'evenodd'
26
+ }, _react.default.createElement("g", {
27
+ transform: 'translate(-137.000000, -840.000000)',
28
+ fill: '#1576FE'
29
+ }, _react.default.createElement("g", {
30
+ transform: 'translate(80.000000, 823.000000)'
31
+ }, _react.default.createElement("g", {
32
+ transform: 'translate(53.000000, 13.000000)'
33
+ }, _react.default.createElement("path", {
34
+ d: 'M17.9996753,31.5 C10.5556724,31.5 4.5,25.4443275 4.5,18.0003247 C4.5,10.5563219 10.5556724,4.5 17.9996753,4.5 C18.5355492,4.5 18.9702974,4.93474816 18.9702974,5.47062208 C18.9702974,6.006496 18.5355492,6.44124416 17.9996753,6.44124416 C11.6261524,6.44124416 6.44124416,11.6267709 6.44124416,18.0002938 C6.44124416,24.3738167 11.6261524,29.5587249 17.9996753,29.5587249 C24.3731982,29.5587249 29.5587249,24.3738167 29.5587249,18.0002938 C29.5587249,14.7964616 28.2778291,11.8169616 25.9523687,9.61220279 C25.5637302,9.24317094 25.5473089,8.62893223 25.9157222,8.23967523 C26.2841356,7.84976878 26.8989928,7.83461537 27.2882498,8.20302872 C30.0042351,10.7787368 31.5,14.2580826 31.5,18.0002938 C31.5,25.4443275 25.4436781,31.5 17.9996753,31.5 Z'
35
+ })))))));
36
+ });
37
+ exports.SpinIcon = SpinIcon;
@@ -101,7 +101,7 @@
101
101
  opacity: 0.4;
102
102
  }
103
103
 
104
- .adm-switch-icon {
104
+ .adm-switch-spin-icon {
105
105
  width: 28px;
106
106
  height: 28px;
107
107
  animation: loading-rotate 1s linear infinite;
@@ -11,14 +11,14 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
 
12
12
  var _react = _interopRequireWildcard(require("react"));
13
13
 
14
- var _spin = _interopRequireDefault(require("../../assets/spin.svg"));
15
-
16
14
  var _nativeProps = require("../../utils/native-props");
17
15
 
18
16
  var _usePropsValue = require("../../utils/use-props-value");
19
17
 
20
18
  var _withDefaultProps = require("../../utils/with-default-props");
21
19
 
20
+ var _spinIcon = require("./spin-icon");
21
+
22
22
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
23
23
 
24
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
@@ -75,10 +75,8 @@ const Switch = p => {
75
75
  className: `${classPrefix}-checkbox`
76
76
  }, _react.default.createElement("div", {
77
77
  className: `${classPrefix}-handle`
78
- }, (props.loading || changing) && _react.default.createElement("img", {
79
- src: _spin.default,
80
- className: `${classPrefix}-icon`,
81
- alt: 'switch-handle'
78
+ }, (props.loading || changing) && _react.default.createElement(_spinIcon.SpinIcon, {
79
+ className: `${classPrefix}-spin-icon`
82
80
  })), _react.default.createElement("div", {
83
81
  className: `${classPrefix}-inner`
84
82
  }, checked ? props.checkedText : props.uncheckedText))));
@@ -31,7 +31,7 @@ export const DatePicker = p => {
31
31
  let date = value;
32
32
 
33
33
  if (date === null) {
34
- date = new Date(bound(now.getDate(), props.min.getDate(), props.max.getDate()));
34
+ date = new Date(bound(now.getTime(), props.min.getTime(), props.max.getTime()));
35
35
  }
36
36
 
37
37
  return convertDateToStringArray(date, props.precision);
@@ -18,7 +18,7 @@
18
18
  transform: translate(-50%, -50%);
19
19
  }
20
20
 
21
- .adm-dialog-main {
21
+ .adm-dialog-body {
22
22
  width: 100%;
23
23
  max-height: 70vh;
24
24
  font-size: 28px;
@@ -29,35 +29,39 @@
29
29
  flex-direction: column;
30
30
  }
31
31
 
32
- .adm-dialog-main > * {
32
+ .adm-dialog-body > * {
33
33
  flex: none;
34
34
  }
35
35
 
36
- .adm-dialog-main > .adm-dialog-image-container {
36
+ .adm-dialog-body > .adm-dialog-content {
37
37
  flex: auto;
38
38
  }
39
39
 
40
- .adm-dialog-main > .adm-dialog-image-container + .adm-dialog-body {
41
- padding-top: 24px;
40
+ .adm-dialog-body:not(.adm-dialog-with-image) {
41
+ padding-top: 40px;
42
42
  }
43
43
 
44
- .adm-dialog-main .adm-dialog-body {
45
- padding: 40px 24px;
44
+ .adm-dialog-body .adm-dialog-image-container {
45
+ margin-bottom: 24px;
46
+ max-height: 40vh;
46
47
  }
47
48
 
48
- .adm-dialog-main .adm-dialog-body-header-wrapper {
49
- display: flex;
50
- justify-content: center;
49
+ .adm-dialog-body .adm-dialog-header {
50
+ margin-bottom: 16px;
51
+ padding: 0 24px;
51
52
  }
52
53
 
53
- .adm-dialog-main .adm-dialog-body-title {
54
+ .adm-dialog-body .adm-dialog-title {
55
+ margin-bottom: 16px;
56
+ padding: 0 24px;
54
57
  font-weight: bold;
55
58
  font-size: 36px;
56
59
  line-height: 50px;
57
60
  text-align: center;
58
61
  }
59
62
 
60
- .adm-dialog-main .adm-dialog-body-content {
63
+ .adm-dialog-body .adm-dialog-content {
64
+ padding: 0 24px 40px;
61
65
  max-height: 70vh;
62
66
  overflow-x: hidden;
63
67
  overflow-y: auto;
@@ -66,21 +70,26 @@
66
70
  color: #333;
67
71
  }
68
72
 
69
- .adm-dialog-main .adm-dialog-footer {
73
+ .adm-dialog-body .adm-dialog-content-empty {
74
+ padding: 0;
75
+ height: 24px;
76
+ }
77
+
78
+ .adm-dialog-body .adm-dialog-footer {
70
79
  user-select: none;
71
80
  }
72
81
 
73
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row {
82
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row {
74
83
  display: flex;
75
84
  align-items: stretch;
76
85
  border-top: 1px solid var(--adm-border-color);
77
86
  }
78
87
 
79
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > * {
88
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > * {
80
89
  flex: 1;
81
90
  }
82
91
 
83
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button {
92
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button {
84
93
  padding: 20px;
85
94
  font-size: 36px;
86
95
  line-height: 50px;
@@ -88,11 +97,11 @@
88
97
  border-right: solid 1px var(--adm-border-color);
89
98
  }
90
99
 
91
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button-bold {
100
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button-bold {
92
101
  font-weight: bold;
93
102
  }
94
103
 
95
- .adm-dialog-main .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button:last-child {
104
+ .adm-dialog-body .adm-dialog-footer .adm-dialog-action-row > .adm-dialog-button:last-child {
96
105
  border-right: none;
97
106
  }
98
107