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,118 +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 = exports.ModalComponent = void 0;
9
- var _classnames = _interopRequireDefault(require("classnames"));
10
- var React = _interopRequireWildcard(require("react"));
11
- var _rmcDialog = _interopRequireDefault(require("rmc-dialog"));
12
- var _rmcFeedback = _interopRequireDefault(require("rmc-feedback"));
13
- class ModalComponent extends React.Component {}
14
- exports.ModalComponent = ModalComponent;
15
- class Modal extends ModalComponent {
16
- renderFooterButton(button, prefixCls, i) {
17
- let buttonStyle = {};
18
- if (button.style) {
19
- buttonStyle = button.style;
20
- if (typeof buttonStyle === 'string') {
21
- const styleMap = {
22
- cancel: {},
23
- default: {},
24
- destructive: {
25
- color: 'red'
26
- }
27
- };
28
- buttonStyle = styleMap[buttonStyle] || {};
29
- }
30
- }
31
- const onClickFn = e => {
32
- e.preventDefault();
33
- if (button.onPress) {
34
- button.onPress();
35
- }
36
- };
37
- return /*#__PURE__*/React.createElement(_rmcFeedback.default, {
38
- activeClassName: "".concat(prefixCls, "-button-active"),
39
- key: i
40
- }, /*#__PURE__*/React.createElement("a", {
41
- className: "".concat(prefixCls, "-button"),
42
- role: "button",
43
- style: buttonStyle,
44
- onClick: onClickFn
45
- }, button.text || 'Button'));
46
- }
47
- render() {
48
- const {
49
- prefixCls,
50
- className,
51
- wrapClassName,
52
- transitionName,
53
- maskTransitionName,
54
- style,
55
- platform,
56
- footer = [],
57
- operation,
58
- animated,
59
- transparent,
60
- popup,
61
- animationType,
62
- ...restProps
63
- } = this.props;
64
- const btnGroupClass = (0, _classnames.default)("".concat(prefixCls, "-button-group-").concat(footer.length === 2 && !operation ? 'h' : 'v'), "".concat(prefixCls, "-button-group-").concat(operation ? 'operation' : 'normal'));
65
- const footerDom = footer.length ? /*#__PURE__*/React.createElement("div", {
66
- className: btnGroupClass,
67
- role: "group"
68
- }, footer.map((button, i) =>
69
- // tslint:disable-next-line:jsx-no-multiline-js
70
- this.renderFooterButton(button, prefixCls, i))) : null;
71
- let transName;
72
- let maskTransName;
73
- if (animated) {
74
- // tslint:disable-next-line:prefer-conditional-expression
75
- if (transparent) {
76
- transName = maskTransName = 'am-fade';
77
- } else {
78
- transName = maskTransName = 'am-slide-up';
79
- }
80
- if (popup) {
81
- transName = animationType === 'slide-up' ? 'am-slide-up' : 'am-slide-down';
82
- maskTransName = 'am-fade';
83
- }
84
- }
85
- const wrapCls = (0, _classnames.default)(wrapClassName, {
86
- ["".concat(prefixCls, "-wrap-popup")]: popup
87
- });
88
- const cls = (0, _classnames.default)(className, {
89
- ["".concat(prefixCls, "-transparent")]: transparent,
90
- ["".concat(prefixCls, "-popup")]: popup,
91
- ["".concat(prefixCls, "-popup-").concat(animationType)]: popup && animationType,
92
- ["".concat(prefixCls, "-android")]: platform === 'android'
93
- });
94
- return /*#__PURE__*/React.createElement(_rmcDialog.default, Object.assign({}, restProps, {
95
- prefixCls: prefixCls,
96
- className: cls,
97
- wrapClassName: wrapCls,
98
- transitionName: transitionName || transName,
99
- maskTransitionName: maskTransitionName || maskTransName,
100
- style: style,
101
- footer: footerDom
102
- }));
103
- }
104
- }
105
- exports.default = Modal;
106
- Modal.defaultProps = {
107
- prefixCls: 'am-modal',
108
- transparent: false,
109
- popup: false,
110
- animationType: 'slide-down',
111
- animated: true,
112
- style: {},
113
- onShow() {},
114
- footer: [],
115
- closable: false,
116
- operation: false,
117
- platform: 'ios'
118
- };
@@ -1,77 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = operation;
9
- var React = _interopRequireWildcard(require("react"));
10
- var ReactDOM = _interopRequireWildcard(require("react-dom"));
11
- var _closest = _interopRequireDefault(require("../_util/closest"));
12
- var _modal = _interopRequireDefault(require("./modal"));
13
- function operation() {
14
- let actions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [{
15
- text: '确定'
16
- }];
17
- let platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'ios';
18
- let closed = false;
19
- const prefixCls = 'am-modal';
20
- const div = document.createElement('div');
21
- document.body.appendChild(div);
22
- function close() {
23
- ReactDOM.unmountComponentAtNode(div);
24
- if (div && div.parentNode) {
25
- div.parentNode.removeChild(div);
26
- }
27
- }
28
- const footer = actions.map(button => {
29
- // tslint:disable-next-line:only-arrow-functions
30
- const orginPress = button.onPress || function () {};
31
- button.onPress = () => {
32
- if (closed) {
33
- return;
34
- }
35
- const res = orginPress();
36
- if (res && res.then) {
37
- res.then(() => {
38
- closed = true;
39
- close();
40
- }).catch(() => {});
41
- } else {
42
- closed = true;
43
- close();
44
- }
45
- };
46
- return button;
47
- });
48
- function onWrapTouchStart(e) {
49
- if (!/iPhone|iPod|iPad/i.test(navigator.userAgent)) {
50
- return;
51
- }
52
- const pNode = (0, _closest.default)(e.target, '.am-modal-footer');
53
- if (!pNode) {
54
- e.preventDefault();
55
- }
56
- }
57
- ReactDOM.render( /*#__PURE__*/React.createElement(_modal.default, {
58
- visible: true,
59
- operation: true,
60
- transparent: true,
61
- prefixCls: prefixCls,
62
- transitionName: "am-zoom",
63
- closable: false,
64
- maskClosable: true,
65
- onClose: close,
66
- footer: footer,
67
- maskTransitionName: "am-fade",
68
- className: "am-modal-operation",
69
- platform: platform,
70
- wrapProps: {
71
- onTouchStart: onWrapTouchStart
72
- }
73
- }), div);
74
- return {
75
- close
76
- };
77
- }
@@ -1,207 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.default = prompt;
9
- var React = _interopRequireWildcard(require("react"));
10
- var ReactDOM = _interopRequireWildcard(require("react-dom"));
11
- var _closest = _interopRequireDefault(require("../_util/closest"));
12
- var _modal = _interopRequireDefault(require("./modal"));
13
- function prompt(title, message, callbackOrActions) {
14
- let type = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'default';
15
- let defaultValue = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
16
- let placeholders = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : ['', ''];
17
- let platform = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'ios';
18
- let closed = false;
19
- defaultValue = typeof defaultValue === 'string' ? defaultValue : typeof defaultValue === 'number' ? "".concat(defaultValue) : '';
20
- if (!callbackOrActions) {
21
- // console.log('Must specify callbackOrActions');
22
- return {
23
- close: () => {}
24
- };
25
- }
26
- const prefixCls = 'am-modal';
27
- const data = {
28
- text: defaultValue
29
- };
30
- function onChange(e) {
31
- const target = e.target;
32
- const inputType = target.getAttribute('type');
33
- if (inputType !== null) {
34
- data[inputType] = target.value;
35
- }
36
- }
37
-
38
- // hotfix issue: https://github.com/ant-design/ant-design-mobile/issues/2177
39
- function onClick(e) {
40
- const target = e.currentTarget || e.target;
41
- if (target) {
42
- target.focus();
43
- }
44
- }
45
- function onBlurFixWechat() {
46
- // https://github.com/ant-design/ant-design-mobile/issues/3137
47
- if (/MicroMessenger/.test(navigator.userAgent)) {
48
- // eslint-disable-next-line no-self-assign
49
- document.body.scrollTop = document.body.scrollTop;
50
- }
51
- }
52
- let inputDom;
53
- const focusFn = input => {
54
- setTimeout(() => {
55
- if (input) {
56
- input.focus();
57
- }
58
- }, 500);
59
- };
60
- switch (type) {
61
- case 'login-password':
62
- inputDom = /*#__PURE__*/React.createElement("div", {
63
- className: "".concat(prefixCls, "-input-container")
64
- }, /*#__PURE__*/React.createElement("div", {
65
- className: "".concat(prefixCls, "-input")
66
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
67
- type: "text",
68
- defaultValue: data.text,
69
- ref: input => focusFn(input),
70
- onClick: onClick,
71
- onChange: onChange,
72
- placeholder: placeholders[0],
73
- onBlur: onBlurFixWechat
74
- }))), /*#__PURE__*/React.createElement("div", {
75
- className: "".concat(prefixCls, "-input")
76
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
77
- type: "password",
78
- defaultValue: data.password,
79
- onClick: onClick,
80
- onChange: onChange,
81
- placeholder: placeholders[1],
82
- onBlur: onBlurFixWechat
83
- }))));
84
- break;
85
- case 'secure-text':
86
- inputDom = /*#__PURE__*/React.createElement("div", {
87
- className: "".concat(prefixCls, "-input-container")
88
- }, /*#__PURE__*/React.createElement("div", {
89
- className: "".concat(prefixCls, "-input")
90
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
91
- type: "password",
92
- defaultValue: data.password,
93
- ref: input => focusFn(input),
94
- onClick: onClick,
95
- onChange: onChange,
96
- placeholder: placeholders[0],
97
- onBlur: onBlurFixWechat
98
- }))));
99
- break;
100
- case 'default':
101
- default:
102
- inputDom = /*#__PURE__*/React.createElement("div", {
103
- className: "".concat(prefixCls, "-input-container")
104
- }, /*#__PURE__*/React.createElement("div", {
105
- className: "".concat(prefixCls, "-input")
106
- }, /*#__PURE__*/React.createElement("label", null, /*#__PURE__*/React.createElement("input", {
107
- type: "text",
108
- defaultValue: data.text,
109
- ref: input => focusFn(input),
110
- onClick: onClick,
111
- onChange: onChange,
112
- placeholder: placeholders[0],
113
- onBlur: onBlurFixWechat
114
- }))));
115
- }
116
- const content = /*#__PURE__*/React.createElement("div", null, message, inputDom);
117
- const div = document.createElement('div');
118
- document.body.appendChild(div);
119
- function close() {
120
- ReactDOM.unmountComponentAtNode(div);
121
- if (div && div.parentNode) {
122
- div.parentNode.removeChild(div);
123
- }
124
- }
125
- function handleConfirm(callback) {
126
- if (typeof callback !== 'function') {
127
- return;
128
- }
129
- const {
130
- text = '',
131
- password = ''
132
- } = data;
133
- const callbackArgs = type === 'login-password' ? [text, password] : type === 'secure-text' ? [password] : [text];
134
- return callback(...callbackArgs);
135
- }
136
- let actions;
137
- if (typeof callbackOrActions === 'function') {
138
- actions = [{
139
- text: '取消',
140
- onPress: () => {}
141
- }, {
142
- text: '确定',
143
- onPress: () => {
144
- handleConfirm(callbackOrActions);
145
- }
146
- }];
147
- } else {
148
- actions = callbackOrActions.map(item => {
149
- return {
150
- text: item.text,
151
- onPress: () => {
152
- return handleConfirm(item.onPress);
153
- }
154
- };
155
- });
156
- }
157
- const footer = actions.map(button => {
158
- // tslint:disable-next-line:only-arrow-functions
159
- const orginPress = button.onPress || function () {};
160
- button.onPress = () => {
161
- if (closed) {
162
- return;
163
- }
164
- const res = orginPress();
165
- if (res && res.then) {
166
- res.then(() => {
167
- closed = true;
168
- close();
169
- }).catch(() => {});
170
- } else {
171
- closed = true;
172
- close();
173
- }
174
- };
175
- return button;
176
- });
177
- function onWrapTouchStart(e) {
178
- // exclude input element for focus
179
- if (!/iPhone|iPod|iPad/i.test(navigator.userAgent)) {
180
- return;
181
- }
182
- const pNode = (0, _closest.default)(e.target, ".".concat(prefixCls, "-content"));
183
- if (!pNode) {
184
- e.preventDefault();
185
- }
186
- }
187
- ReactDOM.render( /*#__PURE__*/React.createElement(_modal.default, {
188
- visible: true,
189
- transparent: true,
190
- prefixCls: prefixCls,
191
- title: title,
192
- closable: false,
193
- maskClosable: false,
194
- transitionName: "am-zoom",
195
- footer: footer,
196
- maskTransitionName: "am-fade",
197
- platform: platform,
198
- wrapProps: {
199
- onTouchStart: onWrapTouchStart
200
- }
201
- }, /*#__PURE__*/React.createElement("div", {
202
- className: "".concat(prefixCls, "-propmt-content")
203
- }, content)), div);
204
- return {
205
- close
206
- };
207
- }