dtable-ui-component 6.0.26 → 6.0.28

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 (79) hide show
  1. package/lib/DateEditor/mb-date-editor-popover/index.js +3 -3
  2. package/lib/Department-editor/department-multiple-select/index.css +4 -1
  3. package/lib/Department-editor/department-multiple-select/index.js +7 -4
  4. package/lib/Department-editor/department-single-select.js +7 -4
  5. package/lib/Department-editor/index.css +4 -0
  6. package/lib/FileFormatter/index.js +98 -38
  7. package/lib/FileItemFormatter/index.js +3 -1
  8. package/lib/constants/file.js +1 -0
  9. package/lib/index.js +1 -106
  10. package/lib/locales/zh-CN.json +1 -1
  11. package/package.json +3 -12
  12. package/lib/ActionSheet/index.js +0 -194
  13. package/lib/ActionSheet/style/index.css +0 -365
  14. package/lib/ActivityIndicator/index.css +0 -108
  15. package/lib/ActivityIndicator/index.js +0 -76
  16. package/lib/Badge/index.css +0 -96
  17. package/lib/Badge/index.js +0 -65
  18. package/lib/DatePicker/index.js +0 -120
  19. package/lib/DatePicker/locale/en_US.js +0 -14
  20. package/lib/DatePicker/locale/ru_RU.js +0 -14
  21. package/lib/DatePicker/locale/sv_SE.js +0 -14
  22. package/lib/DatePicker/locale/zh_CN.js +0 -14
  23. package/lib/DatePicker/style/index.css +0 -290
  24. package/lib/DatePicker/utils.js +0 -36
  25. package/lib/Drawer/index.css +0 -142
  26. package/lib/Drawer/index.js +0 -21
  27. package/lib/Icon/index.css +0 -50
  28. package/lib/Icon/index.js +0 -35
  29. package/lib/Icon/load-sprite.js +0 -56
  30. package/lib/InputItem/custom-input.js +0 -321
  31. package/lib/InputItem/custom-keyboard.js +0 -162
  32. package/lib/InputItem/index.js +0 -389
  33. package/lib/InputItem/input.js +0 -45
  34. package/lib/InputItem/locale/en_US.js +0 -12
  35. package/lib/InputItem/locale/ru_RU.js +0 -12
  36. package/lib/InputItem/locale/sv_SE.js +0 -12
  37. package/lib/InputItem/locale/zh_CN.js +0 -12
  38. package/lib/InputItem/portal.js +0 -23
  39. package/lib/InputItem/style/index.css +0 -512
  40. package/lib/List/index.css +0 -381
  41. package/lib/List/index.js +0 -41
  42. package/lib/List/list-item.js +0 -169
  43. package/lib/Modal/alert.js +0 -82
  44. package/lib/Modal/index.js +0 -16
  45. package/lib/Modal/modal.js +0 -118
  46. package/lib/Modal/operation.js +0 -77
  47. package/lib/Modal/prompt.js +0 -207
  48. package/lib/Modal/style/index.css +0 -580
  49. package/lib/Picker/AbstractPicker.js +0 -190
  50. package/lib/Picker/index.js +0 -28
  51. package/lib/Picker/locale/en_US.js +0 -12
  52. package/lib/Picker/locale/ru_RU.js +0 -12
  53. package/lib/Picker/locale/sv_SE.js +0 -12
  54. package/lib/Picker/locale/zh_CN.js +0 -12
  55. package/lib/Picker/popupProps.js +0 -12
  56. package/lib/Picker/style/index.css +0 -141
  57. package/lib/Popover/index.js +0 -63
  58. package/lib/Popover/item.js +0 -55
  59. package/lib/Popover/style/index.css +0 -229
  60. package/lib/Progress/index.css +0 -22
  61. package/lib/Progress/index.js +0 -66
  62. package/lib/Radio/Radio.js +0 -47
  63. package/lib/Radio/RadioItem.js +0 -57
  64. package/lib/Radio/index.css +0 -90
  65. package/lib/Radio/index.js +0 -12
  66. package/lib/TabBar/Tab.js +0 -76
  67. package/lib/TabBar/index.css +0 -138
  68. package/lib/TabBar/index.js +0 -129
  69. package/lib/Tabs/index.css +0 -443
  70. package/lib/Tabs/index.js +0 -39
  71. package/lib/TextareaItem/index.css +0 -231
  72. package/lib/TextareaItem/index.js +0 -231
  73. package/lib/Toast/index.css +0 -65
  74. package/lib/Toast/index.js +0 -131
  75. package/lib/_util/class.js +0 -34
  76. package/lib/_util/closest.js +0 -17
  77. package/lib/_util/exenv.js +0 -8
  78. package/lib/_util/getDataAttr.js +0 -15
  79. package/lib/_util/getLocale.js +0 -42
@@ -1,36 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.formatFn = formatFn;
7
- function formatIt(date, form) {
8
- const pad = n => n < 10 ? "0".concat(n) : n;
9
- const dateStr = "".concat(date.getFullYear(), "-").concat(pad(date.getMonth() + 1), "-").concat(pad(date.getDate()));
10
- const timeStr = "".concat(pad(date.getHours()), ":").concat(pad(date.getMinutes()));
11
- if (form === 'YYYY-MM-DD') {
12
- return dateStr;
13
- }
14
- if (form === 'HH:mm') {
15
- return timeStr;
16
- }
17
- return "".concat(dateStr, " ").concat(timeStr);
18
- }
19
- function formatFn(instance, value) {
20
- const formatsEnum = {
21
- date: 'YYYY-MM-DD',
22
- time: 'HH:mm',
23
- datetime: 'YYYY-MM-DD HH:mm'
24
- };
25
- const {
26
- format
27
- } = instance.props;
28
- const type = typeof format;
29
- if (type === 'string') {
30
- return formatIt(value, format);
31
- }
32
- if (type === 'function') {
33
- return format(value);
34
- }
35
- return formatIt(value, formatsEnum[instance.props.mode]);
36
- }
@@ -1,142 +0,0 @@
1
- .am-drawer {
2
- position: absolute;
3
- top: 0;
4
- left: 0;
5
- right: 0;
6
- bottom: 0;
7
- overflow: hidden;
8
- }
9
-
10
- .am-drawer-sidebar {
11
- z-index: 4;
12
- position: absolute;
13
- -webkit-transition: -webkit-transform 0.3s ease-out;
14
- transition: -webkit-transform 0.3s ease-out;
15
- transition: transform 0.3s ease-out;
16
- transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out;
17
- will-change: transform;
18
- overflow-y: auto;
19
- }
20
-
21
- .am-drawer-draghandle {
22
- z-index: 1;
23
- position: absolute;
24
- background-color: rgba(50, 50, 50, 0.1);
25
- }
26
-
27
- .am-drawer-overlay {
28
- z-index: 3;
29
- position: absolute;
30
- top: 0;
31
- left: 0;
32
- right: 0;
33
- bottom: 0;
34
- opacity: 0;
35
- visibility: hidden;
36
- -webkit-transition: opacity 0.5s ease-out;
37
- transition: opacity 0.5s ease-out;
38
- background-color: rgba(0, 0, 0, 0.4);
39
- }
40
-
41
- .am-drawer-content {
42
- position: absolute;
43
- top: 0;
44
- left: 0;
45
- right: 0;
46
- bottom: 0;
47
- overflow: auto;
48
- -webkit-transition: left 0.3s ease-out, right 0.3s ease-out;
49
- transition: left 0.3s ease-out, right 0.3s ease-out;
50
- }
51
-
52
- .am-drawer.am-drawer-left .am-drawer-sidebar,
53
- .am-drawer.am-drawer-right .am-drawer-sidebar,
54
- .am-drawer.am-drawer-left .am-drawer-draghandle,
55
- .am-drawer.am-drawer-right .am-drawer-draghandle {
56
- top: 0;
57
- bottom: 0;
58
- }
59
-
60
- .am-drawer.am-drawer-left .am-drawer-draghandle,
61
- .am-drawer.am-drawer-right .am-drawer-draghandle {
62
- width: 10px;
63
- height: 100%;
64
- }
65
-
66
- .am-drawer.am-drawer-top .am-drawer-sidebar,
67
- .am-drawer.am-drawer-bottom .am-drawer-sidebar,
68
- .am-drawer.am-drawer-top .am-drawer-draghandle,
69
- .am-drawer.am-drawer-bottom .am-drawer-draghandle {
70
- left: 0;
71
- right: 0;
72
- }
73
-
74
- .am-drawer.am-drawer-top .am-drawer-draghandle,
75
- .am-drawer.am-drawer-bottom .am-drawer-draghandle {
76
- width: 100%;
77
- height: 10px;
78
- }
79
-
80
- .am-drawer.am-drawer-left .am-drawer-sidebar {
81
- left: 0;
82
- -webkit-transform: translateX(-100%);
83
- -ms-transform: translateX(-100%);
84
- transform: translateX(-100%);
85
- }
86
-
87
- .am-drawer-open.am-drawer.am-drawer-left .am-drawer-sidebar {
88
- -webkit-box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
89
- box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
90
- }
91
-
92
- .am-drawer.am-drawer-left .am-drawer-draghandle {
93
- left: 0;
94
- }
95
-
96
- .am-drawer.am-drawer-right .am-drawer-sidebar {
97
- right: 0;
98
- -webkit-transform: translateX(100%);
99
- -ms-transform: translateX(100%);
100
- transform: translateX(100%);
101
- }
102
-
103
- .am-drawer-open.am-drawer.am-drawer-right .am-drawer-sidebar {
104
- -webkit-box-shadow: -1PX 1PX 2px rgba(0, 0, 0, 0.15);
105
- box-shadow: -1PX 1PX 2px rgba(0, 0, 0, 0.15);
106
- }
107
-
108
- .am-drawer.am-drawer-right .am-drawer-draghandle {
109
- right: 0;
110
- }
111
-
112
- .am-drawer.am-drawer-top .am-drawer-sidebar {
113
- top: 0;
114
- -webkit-transform: translateY(-100%);
115
- -ms-transform: translateY(-100%);
116
- transform: translateY(-100%);
117
- }
118
-
119
- .am-drawer-open.am-drawer.am-drawer-top .am-drawer-sidebar {
120
- -webkit-box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
121
- box-shadow: 1PX 1PX 2px rgba(0, 0, 0, 0.15);
122
- }
123
-
124
- .am-drawer.am-drawer-top .am-drawer-draghandle {
125
- top: 0;
126
- }
127
-
128
- .am-drawer.am-drawer-bottom .am-drawer-sidebar {
129
- bottom: 0;
130
- -webkit-transform: translateY(100%);
131
- -ms-transform: translateY(100%);
132
- transform: translateY(100%);
133
- }
134
-
135
- .am-drawer-open.am-drawer.am-drawer-bottom .am-drawer-sidebar {
136
- -webkit-box-shadow: 1PX -1PX 2px rgba(0, 0, 0, 0.15);
137
- box-shadow: 1PX -1PX 2px rgba(0, 0, 0, 0.15);
138
- }
139
-
140
- .am-drawer.am-drawer-bottom .am-drawer-draghandle {
141
- bottom: 0;
142
- }
@@ -1,21 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _rmcDrawer = _interopRequireDefault(require("rmc-drawer"));
10
- var React = _interopRequireWildcard(require("react"));
11
- require("./index.css");
12
- class Drawer extends React.Component {
13
- render() {
14
- return /*#__PURE__*/React.createElement(_rmcDrawer.default, this.props);
15
- }
16
- }
17
- exports.default = Drawer;
18
- Drawer.defaultProps = {
19
- prefixCls: 'am-drawer',
20
- enableDragHandle: false
21
- };
@@ -1,50 +0,0 @@
1
- .am-icon {
2
- fill: currentColor;
3
- background-size: cover;
4
- width: 22px;
5
- height: 22px;
6
- }
7
-
8
- .am-icon-xxs {
9
- width: 15px;
10
- height: 15px;
11
- }
12
-
13
- .am-icon-xs {
14
- width: 18px;
15
- height: 18px;
16
- }
17
-
18
- .am-icon-sm {
19
- width: 21px;
20
- height: 21px;
21
- }
22
-
23
- .am-icon-md {
24
- width: 22px;
25
- height: 22px;
26
- }
27
-
28
- .am-icon-lg {
29
- width: 36px;
30
- height: 36px;
31
- }
32
-
33
- .am-icon-loading {
34
- -webkit-animation: cirle-anim 1s linear infinite;
35
- animation: cirle-anim 1s linear infinite;
36
- }
37
-
38
- @-webkit-keyframes cirle-anim {
39
- 100% {
40
- -webkit-transform: rotate(360deg);
41
- transform: rotate(360deg);
42
- }
43
- }
44
-
45
- @keyframes cirle-anim {
46
- 100% {
47
- -webkit-transform: rotate(360deg);
48
- transform: rotate(360deg);
49
- }
50
- }
package/lib/Icon/index.js DELETED
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var React = _interopRequireWildcard(require("react"));
11
- var _loadSprite = _interopRequireDefault(require("./load-sprite"));
12
- require("./index.css");
13
- class Icon extends React.Component {
14
- componentDidMount() {
15
- (0, _loadSprite.default)();
16
- }
17
- render() {
18
- const {
19
- type,
20
- className,
21
- size,
22
- ...restProps
23
- } = this.props;
24
- const cls = (0, _classnames.default)(className, 'am-icon', "am-icon-".concat(type), "am-icon-".concat(size));
25
- return /*#__PURE__*/React.createElement("svg", Object.assign({
26
- className: cls
27
- }, restProps), /*#__PURE__*/React.createElement("use", {
28
- xlinkHref: "#".concat(type)
29
- }));
30
- }
31
- }
32
- exports.default = Icon;
33
- Icon.defaultProps = {
34
- size: 'md'
35
- };
@@ -1,56 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- /* tslint:disable:max-line-length */
8
- // inspried by https://github.com/kisenka/svg-sprite-loader/blob/master/runtime/browser-sprite.js
9
- // Much simplified, do make sure run this after document ready
10
- const svgSprite = contents => "\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n id=\"__ANTD_MOBILE_SVG_SPRITE_NODE__\"\n style=\"display:none;overflow:hidden;width:0;height:0\"\n >\n <defs>\n ".concat(contents, "\n </defs>\n </svg>\n");
11
-
12
- // both minified by https://github.com/svg/svgo
13
- const icons = {
14
- check: '<svg viewBox="0 0 44 44"><path fill-rule="evenodd" d="M34.538 8L38 11.518 17.808 32 8 22.033l3.462-3.518 6.346 6.45z"/></svg>',
15
- 'check-circle': '<svg viewBox="0 0 48 48"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zM13.1 23.2l-2.2 2.1 10 9.9L38.1 15l-2.2-2-15.2 17.8-7.6-7.6z" fill-rule="evenodd"/></svg>',
16
- 'check-circle-o': '<svg viewBox="0 0 48 48"><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M12.2 23.2L10 25.3l10 9.9L37.2 15 35 13 19.8 30.8z"/></g></svg>',
17
- cross: '<svg viewBox="0 0 44 44"><path fill-rule="evenodd" d="M24.008 21.852l8.97-8.968L31.092 11l-8.97 8.968L13.157 11l-1.884 1.884 8.968 8.968-9.24 9.24 1.884 1.885 9.24-9.24 9.24 9.24 1.885-1.884-9.24-9.24z"/></svg>',
18
- 'cross-circle': '<svg viewBox="0 0 48 48"><g fill-rule="evenodd"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm0-3c11.598 0 21-9.402 21-21S35.598 3 24 3 3 12.402 3 24s9.402 21 21 21z"/><path d="M24.34 22.22l-7.775-7.775a1.5 1.5 0 1 0-2.12 2.12l7.773 7.775-7.774 7.775a1.5 1.5 0 1 0 2.12 2.12l7.775-7.773 7.774 7.774a1.5 1.5 0 1 0 2.12-2.12L26.46 24.34l7.774-7.774a1.5 1.5 0 1 0-2.12-2.12l-7.776 7.773z"/></g></svg>',
19
- 'cross-circle-o': '<svg viewBox="0 0 48 48"><path d="M24 48c13.255 0 24-10.745 24-24S37.255 0 24 0 0 10.745 0 24s10.745 24 24 24zm.353-25.77l-7.593-7.593c-.797-.8-1.538-.822-2.263-.207-.724.614-.56 1.617-.124 2.067l7.852 7.847-7.72 7.723c-.727.728-.56 1.646-.066 2.177.493.532 1.553.683 2.31-.174l7.588-7.584 7.644 7.623c.796.798 1.608.724 2.21.145.605-.58.72-1.442-.074-2.24l-7.657-7.67 7.545-7.52c.81-.697.9-1.76.297-2.34-.92-.885-1.85-.338-2.264.078l-7.685 7.667z" fill-rule="evenodd"/></svg>',
20
- // Todo: simplify direction to 2, use css transform
21
- left: '<svg viewBox="0 0 44 44"><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M16.247 21.4L28.48 9.165l2.12 2.12-10.117 10.12L30.6 31.524l-2.12 2.12-12.233-12.232.007-.006z"/></svg>',
22
- right: '<svg viewBox="0 0 44 44"><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M30.6 21.4L18.37 9.165l-2.12 2.12 10.117 10.12-10.118 10.118 2.12 2.12 12.234-12.232-.005-.006z"/></svg>',
23
- down: '<svg viewBox="0 0 44 44"><path d="M22.355 28.237l-11.483-10.9c-.607-.576-1.714-.396-2.48.41l.674-.71c-.763.802-.73 2.07-.282 2.496l11.37 10.793-.04.04 2.088 2.195L23.3 31.52l12.308-11.682c.447-.425.48-1.694-.282-2.496l.674.71c-.766-.806-1.873-.986-2.48-.41L22.355 28.237z" fill-rule="evenodd"/></svg>',
24
- up: '<svg viewBox="0 0 44 44"><path fill="none" d="M-1-1h46v46H-1z"/><defs><path id="a" d="M-129-845h24v24h-24z"/></defs><clipPath id="b"><use xlink:href="#a"/></clipPath><g clip-path="url(#b)"><defs><path id="c" d="M-903-949H947V996H-903z"/></defs></g><path d="M23.417 14.23L11.184 26.46l2.12 2.12 10.12-10.117 10.118 10.118 2.12-2.12L23.43 14.228l-.006.005z"/></svg>',
25
- loading: '<svg viewBox="0 -2 59.75 60.25"><path fill="#ccc" d="M29.69-.527C14.044-.527 1.36 12.158 1.36 27.806S14.043 56.14 29.69 56.14c15.65 0 28.334-12.686 28.334-28.334S45.34-.527 29.69-.527zm.185 53.75c-14.037 0-25.417-11.38-25.417-25.417S15.838 2.39 29.875 2.39s25.417 11.38 25.417 25.417-11.38 25.416-25.417 25.416z"/><path fill="none" stroke="#108ee9" stroke-width="3" stroke-linecap="round" stroke-miterlimit="10" d="M56.587 29.766c.37-7.438-1.658-14.7-6.393-19.552"/></svg>',
26
- search: '<svg viewBox="0 0 44 44"><path d="M32.98 29.255l8.915 8.293L39.603 40l-8.86-8.242a15.952 15.952 0 0 1-10.753 4.147C11.16 35.905 4 28.763 4 19.952 4 11.142 11.16 4 19.99 4s15.99 7.142 15.99 15.952c0 3.472-1.112 6.685-3 9.303zm.05-9.21c0 7.123-5.7 12.918-12.88 12.918-7.176 0-13.015-5.795-13.015-12.918 0-7.12 5.84-12.917 13.017-12.917 7.178 0 12.88 5.797 12.88 12.917z" fill-rule="evenodd"/></svg>',
27
- ellipsis: '<svg viewBox="0 0 44 44"><circle cx="21.888" cy="22" r="4.045"/><circle cx="5.913" cy="22" r="4.045"/><circle cx="37.863" cy="22" r="4.045"/></svg>',
28
- 'ellipsis-circle': '<svg viewBox="0 0 44 44"><g fill-rule="evenodd"><path d="M22.13.11C10.05.11.255 9.902.255 21.983S10.05 43.86 22.13 43.86s21.875-9.795 21.875-21.876S34.21.11 22.13.11zm0 40.7c-10.396 0-18.825-8.43-18.825-18.826S11.735 3.16 22.13 3.16c10.396 0 18.825 8.428 18.825 18.824S32.525 40.81 22.13 40.81z"/><circle cx="21.888" cy="22.701" r="2.445"/><circle cx="12.23" cy="22.701" r="2.445"/><circle cx="31.546" cy="22.701" r="2.445"/></g></svg>',
29
- 'exclamation-circle': '<svg viewBox="0 0 64 64"><path d="M59.58 40.89L41.193 9.11C39.135 5.382 35.723 3 31.387 3c-3.11 0-6.52 2.382-8.58 6.11L4.42 40.89c-2.788 4.635-3.126 8.81-1.225 12.22C5.015 56.208 7.572 58 13 58h36.773c5.428 0 9.21-1.792 11.03-4.89 1.9-3.41 1.565-7.583-1.224-12.22zm-2.452 11c-.635 1.694-3.802 2.443-7.354 2.443H13c-3.59 0-5.493-.75-6.13-2.444-1.71-2.41-1.374-5.263 0-8.557l18.387-31.777c2.116-3.168 4.394-4.89 6.13-4.89 2.96 0 5.238 1.722 7.354 4.89l18.387 31.777c1.374 3.294 1.713 6.146 0 8.556zm-25.74-33c-.405 0-1.227.835-1.227 2.443v15.89c0 1.608.823 2.444 1.227 2.444 1.628 0 2.452-.836 2.452-2.445v-15.89c0-1.607-.825-2.443-2.453-2.443zm0 23.22c-.405 0-1.227.79-1.227 1.223v2.445c0 .434.823 1.222 1.227 1.222 1.628 0 2.452-.788 2.452-1.222v-2.445c0-.434-.825-1.222-2.453-1.222z" fill-rule="evenodd"/></svg>',
30
- 'info-circle': '<svg viewBox="0 0 44 44"><circle cx="13.828" cy="19.63" r="1.938"/><circle cx="21.767" cy="19.63" r="1.938"/><circle cx="29.767" cy="19.63" r="1.938"/><path d="M22.102 4.16c-9.918 0-17.958 7.147-17.958 15.962 0 4.935 2.522 9.345 6.48 12.273v5.667l.04.012a2.627 2.627 0 1 0 4.5 1.455h.002l5.026-3.54c.628.06 1.265.094 1.91.094 9.92 0 17.96-7.146 17.96-15.96C40.06 11.306 32.02 4.16 22.1 4.16zm-.04 29.902c-.902 0-1.78-.08-2.642-.207l-5.882 4.234c-.024.024-.055.04-.083.06l-.008.005a.51.51 0 0 1-.284.095.525.525 0 0 1-.525-.525l.005-6.375c-3.91-2.516-6.456-6.544-6.456-11.1 0-7.628 7.107-13.812 15.875-13.812s15.875 6.184 15.875 13.812-7.107 13.812-15.875 13.812z"/></svg>',
31
- 'question-circle': '<svg viewBox="0 0 44 44"><g fill-rule="evenodd"><path d="M21.186 3c-10.853 0-19.36 8.506-19.36 19.358C1.827 32.494 10.334 41 21.187 41c10.133 0 18.64-8.506 18.64-18.642C39.827 11.506 31.32 3 21.187 3m15.64 19c0 8.823-7.178 16-16 16s-16-7.177-16-16 7.178-16 16-16 16 7.177 16 16z"/><path d="M22.827 31.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0m4-15.48c0 .957-.203 1.822-.61 2.593-.427.792-1.117 1.612-2.073 2.457-.867.734-1.453 1.435-1.754 2.096-.302.7-.453 1.693-.453 2.98a.828.828 0 0 1-.823.854.828.828 0 0 1-.584-.22.877.877 0 0 1-.24-.635c0-1.305.168-2.38.506-3.227.336-.883.93-1.682 1.78-2.4 1.01-.883 1.71-1.692 2.1-2.428.336-.645.503-1.38.503-2.21-.02-.935-.3-1.7-.85-2.288-.655-.717-1.62-1.075-2.897-1.075-1.506 0-2.596.535-3.27 1.6-.46.754-.688 1.645-.688 2.677a.92.92 0 0 1-.266.66.747.747 0 0 1-.56.25.73.73 0 0 1-.584-.194c-.16-.164-.24-.393-.24-.69 0-1.82.585-3.272 1.755-4.357C18.645 11.486 19.928 11 21.434 11h.293c1.452 0 2.638.414 3.56 1.24 1.028.903 1.54 2.163 1.54 3.78z"/></g></svg>',
32
- voice: '<svg viewBox="0 0 38 33"><g fill-rule="evenodd"><path d="M17.838 28.8c-.564-.468-1.192-.983-1.836-1.496-4.244-3.385-5.294-3.67-6.006-3.67-.014 0-.027.005-.04.005-.015 0-.028-.006-.042-.006H3.562c-.734 0-.903-.203-.903-.928v-12.62c0-.49.057-.8.66-.8H9.1c.694 0 1.76-.28 6.4-3.63.83-.596 1.638-1.196 2.337-1.722V28.8zM19.682.19c-.463-.22-1.014-.158-1.417.157-.02.016-1.983 1.552-4.152 3.125C10.34 6.21 9.243 6.664 9.02 6.737H3.676c-.027 0-.053.003-.08.004H1.183c-.608 0-1.1.487-1.1 1.086V25.14c0 .598.492 1.084 1.1 1.084h8.71c.22.08 1.257.55 4.605 3.24 1.947 1.562 3.694 3.088 3.712 3.103.25.22.568.333.89.333.186 0 .373-.038.55-.116.48-.213.79-.684.79-1.204V1.38c0-.506-.294-.968-.758-1.19z" mask="url(#mask-2)"/><path d="M31.42 16.475c0-3.363-1.854-6.297-4.606-7.876-.125-.067-.42-.193-.625-.193-.613 0-1.11.488-1.11 1.09 0 .404.22.764.55.952 2.13 1.19 3.566 3.44 3.566 6.024 0 2.627-1.486 4.913-3.677 6.087-.32.19-.53.54-.53.935 0 .602.495 1.09 1.106 1.09.26.002.568-.15.568-.15 2.835-1.556 4.754-4.538 4.754-7.96" mask="url(#mask-4)"/><path d="M30.14 3.057c-.205-.122-.41-.22-.658-.22-.608 0-1.1.485-1.1 1.084 0 .434.26.78.627.978 4.042 2.323 6.76 6.636 6.76 11.578 0 4.938-2.715 9.248-6.754 11.572-.354.19-.66.55-.66.993 0 .6.494 1.085 1.102 1.085.243 0 .438-.092.65-.213 4.692-2.695 7.848-7.7 7.848-13.435 0-5.723-3.142-10.718-7.817-13.418" mask="url(#mask-6)"/></g></svg>',
33
- plus: '<svg viewBox="0 0 30 30"><path d="M14 14H0v2h14v14h2V16h14v-2H16V0h-2v14z" fill-rule="evenodd"/></svg>',
34
- minus: '<svg viewBox="0 0 30 2"><path d="M0 0h30v2H0z" fill-rule="evenodd"/></svg>',
35
- dislike: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path fill="#FFF" d="M47 22h2v6h-2zm-24 0h2v6h-2z"/><path d="M21 51s4.6-7 15-7 15 7 15 7" stroke="#FFF" stroke-width="2"/></g></svg>',
36
- fail: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path d="M22 22l28.304 28.304m-28.304 0L50.304 22" stroke="#FFF" stroke-width="2"/></g></svg>',
37
- success: '<svg viewBox="0 0 72 72"><g fill="none" fill-rule="evenodd"><path d="M36 72c19.882 0 36-16.118 36-36S55.882 0 36 0 0 16.118 0 36s16.118 36 36 36zm0-2c18.778 0 34-15.222 34-34S54.778 2 36 2 2 17.222 2 36s15.222 34 34 34z" fill="#FFF"/><path stroke="#FFF" stroke-width="2" d="M19 34.54l11.545 11.923L52.815 24"/></g></svg>'
38
- };
39
- const renderSvgSprite = () => {
40
- const symbols = Object.keys(icons).map(iconName => {
41
- const svgContent = icons[iconName].split('svg')[1];
42
- return "<symbol id=".concat(iconName).concat(svgContent, "symbol>");
43
- }).join('');
44
- return svgSprite(symbols);
45
- };
46
- const loadSprite = () => {
47
- if (!document) {
48
- return;
49
- }
50
- const existing = document.getElementById('__ANTD_MOBILE_SVG_SPRITE_NODE__');
51
- const mountNode = document.body;
52
- if (!existing) {
53
- mountNode.insertAdjacentHTML('afterbegin', renderSvgSprite());
54
- }
55
- };
56
- var _default = exports.default = loadSprite;
@@ -1,321 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = void 0;
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var React = _interopRequireWildcard(require("react"));
11
- var ReactDOM = _interopRequireWildcard(require("react-dom"));
12
- var _class = require("../_util/class");
13
- var _exenv = require("../_util/exenv");
14
- var _customKeyboard = _interopRequireDefault(require("./custom-keyboard"));
15
- var _portal = _interopRequireDefault(require("./portal"));
16
- let customNumberKeyboard = null;
17
- const IS_REACT_16 = !!ReactDOM.createPortal;
18
- function getBodyScrollTop() {
19
- const el = document.scrollingElement || document.documentElement;
20
- return el && el.scrollTop || 0;
21
- }
22
- function setBodyScrollTop(scrollTop) {
23
- const el = document.scrollingElement || document.documentElement;
24
- el.scrollTop = scrollTop;
25
- }
26
- class NumberInput extends React.Component {
27
- constructor(props) {
28
- super(props);
29
- this.onChange = value => {
30
- if (!('value' in this.props)) {
31
- this.setState({
32
- value: value.target.value
33
- });
34
- }
35
- this.props.onChange(value);
36
- };
37
- this.onConfirm = value => {
38
- this.props.onVirtualKeyboardConfirm(value);
39
- };
40
- this.addBlurListener = () => {
41
- document.addEventListener('touchend', this.doBlur, false);
42
- };
43
- this.removeBlurListener = () => {
44
- document.removeEventListener('touchend', this.doBlur, false);
45
- };
46
- this.saveRef = el => {
47
- if (IS_REACT_16 && el) {
48
- customNumberKeyboard = el;
49
- }
50
- };
51
- this.doBlur = ev => {
52
- const {
53
- value
54
- } = this.state;
55
- if (ev.target !== this.inputRef) {
56
- this.onInputBlur(value);
57
- }
58
- };
59
- this.unLinkInput = () => {
60
- if (customNumberKeyboard && customNumberKeyboard.antmKeyboard && customNumberKeyboard.linkedInput && customNumberKeyboard.linkedInput === this) {
61
- customNumberKeyboard.linkedInput = null;
62
- if (this.props.autoAdjustHeight) {
63
- this.getContainer().style.height = '0';
64
- }
65
- (0, _class.addClass)(customNumberKeyboard.antmKeyboard, "".concat(this.props.keyboardPrefixCls, "-wrapper-hide"));
66
- }
67
- // for unmount
68
- this.removeBlurListener();
69
- };
70
- this.onInputBlur = value => {
71
- if (IS_REACT_16) {
72
- this.keyBoard = null;
73
- }
74
- const {
75
- focus
76
- } = this.state;
77
- if (focus) {
78
- this.setState({
79
- focus: false
80
- });
81
- this.props.onBlur(value);
82
- setTimeout(() => {
83
- this.unLinkInput();
84
- }, 50);
85
- }
86
- };
87
- this.onInputFocus = () => {
88
- const {
89
- value
90
- } = this.state;
91
- this.props.onFocus(value);
92
- this.setState({
93
- focus: true
94
- }, () => {
95
- if (customNumberKeyboard) {
96
- customNumberKeyboard.linkedInput = this;
97
- if (customNumberKeyboard.antmKeyboard) {
98
- if (this.props.autoAdjustHeight) {
99
- const keyBoardHeight = customNumberKeyboard.antmKeyboard.offsetHeight;
100
- this.getContainer().style.height = "".concat(keyBoardHeight, "px");
101
- if (this.inputRef) {
102
- const {
103
- bottom
104
- } = this.inputRef.getBoundingClientRect();
105
- const clientHeight = window.innerHeight;
106
- // 计算输入框距离视窗的底部距离
107
- const distance = clientHeight - bottom;
108
- if (distance < keyBoardHeight) {
109
- setBodyScrollTop(getBodyScrollTop() + keyBoardHeight - distance);
110
- }
111
- }
112
- }
113
- (0, _class.removeClass)(customNumberKeyboard.antmKeyboard, "".concat(this.props.keyboardPrefixCls, "-wrapper-hide"));
114
- }
115
- customNumberKeyboard.confirmDisabled = value === '';
116
- if (customNumberKeyboard.confirmKeyboardItem) {
117
- if (value === '') {
118
- (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
119
- } else {
120
- (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
121
- }
122
- }
123
- }
124
- });
125
- };
126
- this.onKeyboardClick = KeyboardItemValue => {
127
- const {
128
- maxLength
129
- } = this.props;
130
- const {
131
- value
132
- } = this.state;
133
- // tslint:disable-next-line:no-this-assignment
134
- const {
135
- onChange
136
- } = this;
137
- let valueAfterChange;
138
- // 删除键
139
- if (KeyboardItemValue === 'delete') {
140
- valueAfterChange = value.substring(0, value.length - 1);
141
- onChange({
142
- target: {
143
- value: valueAfterChange
144
- }
145
- });
146
- // 确认键
147
- } else if (KeyboardItemValue === 'confirm') {
148
- valueAfterChange = value;
149
- onChange({
150
- target: {
151
- value: valueAfterChange
152
- }
153
- });
154
- this.onInputBlur(value);
155
- this.onConfirm(value);
156
- // 收起键
157
- } else if (KeyboardItemValue === 'hide') {
158
- valueAfterChange = value;
159
- this.onInputBlur(valueAfterChange);
160
- } else {
161
- if (maxLength !== undefined && +maxLength >= 0 && (value + KeyboardItemValue).length > maxLength) {
162
- valueAfterChange = (value + KeyboardItemValue).substr(0, maxLength);
163
- onChange({
164
- target: {
165
- value: valueAfterChange
166
- }
167
- });
168
- } else {
169
- valueAfterChange = value + KeyboardItemValue;
170
- onChange({
171
- target: {
172
- value: valueAfterChange
173
- }
174
- });
175
- }
176
- }
177
- if (customNumberKeyboard) {
178
- customNumberKeyboard.confirmDisabled = valueAfterChange === '';
179
- if (customNumberKeyboard.confirmKeyboardItem) {
180
- if (valueAfterChange === '') {
181
- (0, _class.addClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
182
- } else {
183
- (0, _class.removeClass)(customNumberKeyboard.confirmKeyboardItem, "".concat(this.props.keyboardPrefixCls, "-item-disabled"));
184
- }
185
- }
186
- }
187
- };
188
- this.onFakeInputClick = () => {
189
- this.focus();
190
- };
191
- this.focus = () => {
192
- // this focus may invocked by users page button click, so this click may trigger blurEventListener at the same time
193
- this.renderCustomKeyboard();
194
- this.removeBlurListener();
195
- const {
196
- focus
197
- } = this.state;
198
- if (!focus) {
199
- this.onInputFocus();
200
- }
201
- setTimeout(() => {
202
- this.addBlurListener();
203
- }, 50);
204
- };
205
- this.state = {
206
- focus: false,
207
- value: props.value || ''
208
- };
209
- }
210
- componentWillReceiveProps(nextProps) {
211
- if ('value' in nextProps) {
212
- this.setState({
213
- value: nextProps.value
214
- });
215
- }
216
- }
217
- componentWillUnmount() {
218
- // focus:true unmount 不能触发 blur
219
- if (this.state.focus) {
220
- this.props.onBlur(this.state.value);
221
- }
222
- this.unLinkInput();
223
- }
224
- getComponent() {
225
- const {
226
- confirmLabel,
227
- backspaceLabel,
228
- cancelKeyboardLabel,
229
- keyboardPrefixCls,
230
- moneyKeyboardWrapProps,
231
- moneyKeyboardHeader,
232
- disabledKeys
233
- } = this.props;
234
- return /*#__PURE__*/React.createElement(_customKeyboard.default, {
235
- ref: this.saveRef,
236
- onClick: this.onKeyboardClick,
237
- prefixCls: keyboardPrefixCls,
238
- confirmLabel: confirmLabel,
239
- backspaceLabel: backspaceLabel,
240
- cancelKeyboardLabel: cancelKeyboardLabel,
241
- wrapProps: moneyKeyboardWrapProps,
242
- header: moneyKeyboardHeader,
243
- disabledKeys: disabledKeys
244
- });
245
- }
246
- getContainer() {
247
- const {
248
- keyboardPrefixCls
249
- } = this.props;
250
- let container = document.querySelector("#".concat(keyboardPrefixCls, "-container"));
251
- if (!container) {
252
- container = document.createElement('div');
253
- container.setAttribute('id', "".concat(keyboardPrefixCls, "-container"));
254
- document.body.appendChild(container);
255
- }
256
- this.container = container;
257
- return this.container;
258
- }
259
- renderCustomKeyboard() {
260
- if (IS_REACT_16) {
261
- this.keyBoard = /*#__PURE__*/React.createElement(_portal.default, {
262
- getContainer: () => this.getContainer()
263
- }, this.getComponent());
264
- } else {
265
- customNumberKeyboard = ReactDOM.unstable_renderSubtreeIntoContainer(this, this.getComponent(), this.getContainer());
266
- }
267
- }
268
- renderPortal() {
269
- if (!IS_REACT_16 || !_exenv.canUseDOM) {
270
- return null;
271
- }
272
- return this.keyBoard;
273
- }
274
- render() {
275
- const {
276
- placeholder,
277
- disabled,
278
- editable,
279
- moneyKeyboardAlign
280
- } = this.props;
281
- const {
282
- focus,
283
- value
284
- } = this.state;
285
- const preventKeyboard = disabled || !editable;
286
- const fakeInputCls = (0, _classnames.default)('fake-input', {
287
- focus,
288
- 'fake-input-disabled': disabled
289
- });
290
- const fakeInputContainerCls = (0, _classnames.default)('fake-input-container', {
291
- 'fake-input-container-left': moneyKeyboardAlign === 'left'
292
- });
293
- return /*#__PURE__*/React.createElement("div", {
294
- className: fakeInputContainerCls
295
- }, value === '' &&
296
- /*#__PURE__*/
297
- // tslint:disable-next-line:jsx-no-multiline-js
298
- React.createElement("div", {
299
- className: "fake-input-placeholder"
300
- }, placeholder), /*#__PURE__*/React.createElement("div", {
301
- role: "textbox",
302
- "aria-label": value || placeholder,
303
- className: fakeInputCls,
304
- ref: el => this.inputRef = el,
305
- onClick: preventKeyboard ? () => {} : this.onFakeInputClick
306
- }, value), this.renderPortal());
307
- }
308
- }
309
- NumberInput.defaultProps = {
310
- onChange: () => {},
311
- onFocus: () => {},
312
- onBlur: () => {},
313
- onVirtualKeyboardConfirm: () => {},
314
- placeholder: '',
315
- disabled: false,
316
- editable: true,
317
- prefixCls: 'am-input',
318
- keyboardPrefixCls: 'am-number-keyboard',
319
- autoAdjustHeight: false
320
- };
321
- var _default = exports.default = NumberInput;