antd3-esm 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/Checkbox.js +164 -0
- package/dist/CommonMixin.js +816 -0
- package/dist/Divider.js +646 -0
- package/dist/Notification.js +279 -0
- package/dist/Pagination.js +1106 -0
- package/dist/PortalWrapper.js +347 -0
- package/dist/RowContext.js +5 -0
- package/dist/Sider.js +533 -0
- package/dist/TextArea.js +432 -0
- package/dist/_arrayMap.js +68 -0
- package/dist/_assignValue.js +95 -0
- package/dist/_copyArray.js +31 -0
- package/dist/_hasPath.js +53 -0
- package/dist/_overArg.js +437 -0
- package/dist/_stringToArray.js +136 -0
- package/dist/antd/es/affix.js +12 -0
- package/dist/antd/es/alert.js +5 -0
- package/dist/antd/es/anchor.js +466 -0
- package/dist/antd/es/auto-complete.js +5 -0
- package/dist/antd/es/avatar.js +5 -0
- package/dist/antd/es/back-top.js +5 -0
- package/dist/antd/es/badge.js +5 -0
- package/dist/antd/es/breadcrumb.js +18 -0
- package/dist/antd/es/button.js +12 -0
- package/dist/antd/es/calendar.js +953 -0
- package/dist/antd/es/card.js +5 -0
- package/dist/antd/es/carousel.js +5 -0
- package/dist/antd/es/cascader.js +1275 -0
- package/dist/antd/es/checkbox.js +11 -0
- package/dist/antd/es/col.js +4 -0
- package/dist/antd/es/collapse.js +688 -0
- package/dist/antd/es/comment.js +5 -0
- package/dist/antd/es/config-provider.js +2 -0
- package/dist/antd/es/date-picker.js +4322 -0
- package/dist/antd/es/descriptions.js +342 -0
- package/dist/antd/es/divider.js +53 -0
- package/dist/antd/es/drawer.js +1115 -0
- package/dist/antd/es/dropdown.js +14 -0
- package/dist/antd/es/empty.js +6 -0
- package/dist/antd/es/form.js +5008 -0
- package/dist/antd/es/grid.js +13 -0
- package/dist/antd/es/icon.js +6 -0
- package/dist/antd/es/input-number.js +5 -0
- package/dist/antd/es/input.js +16 -0
- package/dist/antd/es/layout.js +14 -0
- package/dist/antd/es/list.js +5 -0
- package/dist/antd/es/locale/ar_EG.js +102 -0
- package/dist/antd/es/locale/bg_BG.js +98 -0
- package/dist/antd/es/locale/ca_ES.js +96 -0
- package/dist/antd/es/locale/cs_CZ.js +96 -0
- package/dist/antd/es/locale/da_DK.js +98 -0
- package/dist/antd/es/locale/de_DE.js +98 -0
- package/dist/antd/es/locale/default.js +2 -0
- package/dist/antd/es/locale/el_GR.js +98 -0
- package/dist/antd/es/locale/en_GB.js +98 -0
- package/dist/antd/es/locale/en_US.js +2 -0
- package/dist/antd/es/locale/es_ES.js +114 -0
- package/dist/antd/es/locale/et_EE.js +98 -0
- package/dist/antd/es/locale/fa_IR.js +98 -0
- package/dist/antd/es/locale/fi_FI.js +99 -0
- package/dist/antd/es/locale/fr_BE.js +102 -0
- package/dist/antd/es/locale/fr_FR.js +102 -0
- package/dist/antd/es/locale/ga_IE.js +99 -0
- package/dist/antd/es/locale/he_IL.js +99 -0
- package/dist/antd/es/locale/hi_IN.js +107 -0
- package/dist/antd/es/locale/hr_HR.js +113 -0
- package/dist/antd/es/locale/hu_HU.js +99 -0
- package/dist/antd/es/locale/hy_AM.js +109 -0
- package/dist/antd/es/locale/id_ID.js +101 -0
- package/dist/antd/es/locale/is_IS.js +98 -0
- package/dist/antd/es/locale/it_IT.js +111 -0
- package/dist/antd/es/locale/ja_JP.js +96 -0
- package/dist/antd/es/locale/kn_IN.js +107 -0
- package/dist/antd/es/locale/ko_KR.js +98 -0
- package/dist/antd/es/locale/ku_IQ.js +98 -0
- package/dist/antd/es/locale/lv_LV.js +98 -0
- package/dist/antd/es/locale/mk_MK.js +113 -0
- package/dist/antd/es/locale/mn_MN.js +99 -0
- package/dist/antd/es/locale/ms_MY.js +118 -0
- package/dist/antd/es/locale/nb_NO.js +97 -0
- package/dist/antd/es/locale/ne_NP.js +44 -0
- package/dist/antd/es/locale/nl_BE.js +98 -0
- package/dist/antd/es/locale/nl_NL.js +117 -0
- package/dist/antd/es/locale/pl_PL.js +98 -0
- package/dist/antd/es/locale/pt_BR.js +104 -0
- package/dist/antd/es/locale/pt_PT.js +127 -0
- package/dist/antd/es/locale/ro_RO.js +118 -0
- package/dist/antd/es/locale/ru_RU.js +110 -0
- package/dist/antd/es/locale/sk_SK.js +118 -0
- package/dist/antd/es/locale/sl_SI.js +96 -0
- package/dist/antd/es/locale/sr_RS.js +97 -0
- package/dist/antd/es/locale/sv_SE.js +101 -0
- package/dist/antd/es/locale/ta_IN.js +119 -0
- package/dist/antd/es/locale/th_TH.js +117 -0
- package/dist/antd/es/locale/tr_TR.js +112 -0
- package/dist/antd/es/locale/uk_UA.js +97 -0
- package/dist/antd/es/locale/vi_VN.js +99 -0
- package/dist/antd/es/locale/zh_CN.js +104 -0
- package/dist/antd/es/locale/zh_TW.js +100 -0
- package/dist/antd/es/locale-provider.js +6 -0
- package/dist/antd/es/mention.js +23215 -0
- package/dist/antd/es/mentions.js +961 -0
- package/dist/antd/es/menu.js +5 -0
- package/dist/antd/es/message.js +161 -0
- package/dist/antd/es/modal.js +885 -0
- package/dist/antd/es/notification.js +216 -0
- package/dist/antd/es/page-header.js +350 -0
- package/dist/antd/es/pagination.js +15 -0
- package/dist/antd/es/popconfirm.js +215 -0
- package/dist/antd/es/popover.js +5 -0
- package/dist/antd/es/progress.js +10 -0
- package/dist/antd/es/radio.js +10 -0
- package/dist/antd/es/rate.js +5 -0
- package/dist/antd/es/result.js +828 -0
- package/dist/antd/es/row.js +9 -0
- package/dist/antd/es/select.js +5 -0
- package/dist/antd/es/skeleton.js +370 -0
- package/dist/antd/es/slider.js +5 -0
- package/dist/antd/es/spin.js +11 -0
- package/dist/antd/es/statistic.js +650 -0
- package/dist/antd/es/steps.js +5 -0
- package/dist/antd/es/style.js +5 -0
- package/dist/antd/es/switch.js +5 -0
- package/dist/antd/es/table.js +7057 -0
- package/dist/antd/es/tabs.js +5 -0
- package/dist/antd/es/tag.js +12 -0
- package/dist/antd/es/time-picker.js +10 -0
- package/dist/antd/es/timeline.js +206 -0
- package/dist/antd/es/tooltip.js +9 -0
- package/dist/antd/es/transfer.js +2508 -0
- package/dist/antd/es/tree-select.js +5 -0
- package/dist/antd/es/tree.js +10 -0
- package/dist/antd/es/typography.js +1246 -0
- package/dist/antd/es/upload.js +3418 -0
- package/dist/antd/es/version.js +7 -0
- package/dist/col.js +142 -0
- package/dist/config-provider.js +6949 -0
- package/dist/dropdown.js +442 -0
- package/dist/get.js +1043 -0
- package/dist/icon.js +6138 -0
- package/dist/identity.js +230 -0
- package/dist/index.js +462 -0
- package/dist/index10.js +478 -0
- package/dist/index11.js +232 -0
- package/dist/index12.js +2766 -0
- package/dist/index13.js +422 -0
- package/dist/index14.js +283 -0
- package/dist/index15.js +1755 -0
- package/dist/index2.js +374 -0
- package/dist/index3.js +407 -0
- package/dist/index4.js +522 -0
- package/dist/index5.js +601 -0
- package/dist/index6.js +601 -0
- package/dist/index7.js +364 -0
- package/dist/index8.js +436 -0
- package/dist/index9.js +130 -0
- package/dist/input.js +475 -0
- package/dist/isLength.js +402 -0
- package/dist/keys.js +292 -0
- package/dist/menu.js +8138 -0
- package/dist/progress.js +852 -0
- package/dist/raf.js +34 -0
- package/dist/responsiveObserve.js +444 -0
- package/dist/row.js +173 -0
- package/dist/scrollTo.js +66 -0
- package/dist/toInteger.js +123 -0
- package/dist/toString.js +84 -0
- package/dist/transButton.js +121 -0
- package/dist/tree.js +3017 -0
- package/dist/warning.js +55 -0
- package/dist/wave.js +230 -0
- package/dist/zh_CN.js +17 -0
- package/package.json +160 -0
package/dist/index8.js
ADDED
|
@@ -0,0 +1,436 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { c as classNames, C as ConfigConsumer, p as propTypesExports } from './config-provider.js';
|
|
3
|
+
import { s as shallowEqual, p as polyfill } from './menu.js';
|
|
4
|
+
import { C as Checkbox$1 } from './Checkbox.js';
|
|
5
|
+
import { o as omit } from './input.js';
|
|
6
|
+
|
|
7
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
8
|
+
|
|
9
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
10
|
+
|
|
11
|
+
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
12
|
+
|
|
13
|
+
function _classCallCheck$1(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
|
|
15
|
+
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
16
|
+
|
|
17
|
+
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); return Constructor; }
|
|
18
|
+
|
|
19
|
+
function _inherits$1(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf$1(subClass, superClass); }
|
|
20
|
+
|
|
21
|
+
function _setPrototypeOf$1(o, p) { _setPrototypeOf$1 = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf$1(o, p); }
|
|
22
|
+
|
|
23
|
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf$1(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf$1(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn$1(this, result); }; }
|
|
24
|
+
|
|
25
|
+
function _possibleConstructorReturn$1(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized$1(self); }
|
|
26
|
+
|
|
27
|
+
function _assertThisInitialized$1(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
28
|
+
|
|
29
|
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
30
|
+
|
|
31
|
+
function _getPrototypeOf$1(o) { _getPrototypeOf$1 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf$1(o); }
|
|
32
|
+
|
|
33
|
+
var __rest$1 = undefined && undefined.__rest || function (s, e) {
|
|
34
|
+
var t = {};
|
|
35
|
+
|
|
36
|
+
for (var p in s) {
|
|
37
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
41
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
42
|
+
}
|
|
43
|
+
return t;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
var Checkbox = /*#__PURE__*/function (_React$Component) {
|
|
47
|
+
_inherits$1(Checkbox, _React$Component);
|
|
48
|
+
|
|
49
|
+
var _super = _createSuper$1(Checkbox);
|
|
50
|
+
|
|
51
|
+
function Checkbox() {
|
|
52
|
+
var _this;
|
|
53
|
+
|
|
54
|
+
_classCallCheck$1(this, Checkbox);
|
|
55
|
+
|
|
56
|
+
_this = _super.apply(this, arguments);
|
|
57
|
+
|
|
58
|
+
_this.saveCheckbox = function (node) {
|
|
59
|
+
_this.rcCheckbox = node;
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
_this.renderCheckbox = function (_ref) {
|
|
63
|
+
var _classNames;
|
|
64
|
+
|
|
65
|
+
var getPrefixCls = _ref.getPrefixCls;
|
|
66
|
+
|
|
67
|
+
var _assertThisInitialize = _assertThisInitialized$1(_this),
|
|
68
|
+
props = _assertThisInitialize.props,
|
|
69
|
+
context = _assertThisInitialize.context;
|
|
70
|
+
|
|
71
|
+
var customizePrefixCls = props.prefixCls,
|
|
72
|
+
className = props.className,
|
|
73
|
+
children = props.children,
|
|
74
|
+
indeterminate = props.indeterminate,
|
|
75
|
+
style = props.style,
|
|
76
|
+
onMouseEnter = props.onMouseEnter,
|
|
77
|
+
onMouseLeave = props.onMouseLeave,
|
|
78
|
+
restProps = __rest$1(props, ["prefixCls", "className", "children", "indeterminate", "style", "onMouseEnter", "onMouseLeave"]);
|
|
79
|
+
|
|
80
|
+
var checkboxGroup = context.checkboxGroup;
|
|
81
|
+
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
82
|
+
|
|
83
|
+
var checkboxProps = _extends$1({}, restProps);
|
|
84
|
+
|
|
85
|
+
if (checkboxGroup) {
|
|
86
|
+
checkboxProps.onChange = function () {
|
|
87
|
+
if (restProps.onChange) {
|
|
88
|
+
restProps.onChange.apply(restProps, arguments);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
checkboxGroup.toggleOption({
|
|
92
|
+
label: children,
|
|
93
|
+
value: props.value
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
checkboxProps.name = checkboxGroup.name;
|
|
98
|
+
checkboxProps.checked = checkboxGroup.value.indexOf(props.value) !== -1;
|
|
99
|
+
checkboxProps.disabled = props.disabled || checkboxGroup.disabled;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
var classString = classNames(className, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-wrapper"), true), _defineProperty(_classNames, "".concat(prefixCls, "-wrapper-checked"), checkboxProps.checked), _defineProperty(_classNames, "".concat(prefixCls, "-wrapper-disabled"), checkboxProps.disabled), _classNames));
|
|
103
|
+
var checkboxClass = classNames(_defineProperty({}, "".concat(prefixCls, "-indeterminate"), indeterminate));
|
|
104
|
+
return (
|
|
105
|
+
/*#__PURE__*/
|
|
106
|
+
// eslint-disable-next-line jsx-a11y/label-has-associated-control
|
|
107
|
+
React.createElement("label", {
|
|
108
|
+
className: classString,
|
|
109
|
+
style: style,
|
|
110
|
+
onMouseEnter: onMouseEnter,
|
|
111
|
+
onMouseLeave: onMouseLeave
|
|
112
|
+
}, /*#__PURE__*/React.createElement(Checkbox$1, _extends$1({}, checkboxProps, {
|
|
113
|
+
prefixCls: prefixCls,
|
|
114
|
+
className: checkboxClass,
|
|
115
|
+
ref: _this.saveCheckbox
|
|
116
|
+
})), children !== undefined && /*#__PURE__*/React.createElement("span", null, children))
|
|
117
|
+
);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return _this;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
_createClass$1(Checkbox, [{
|
|
124
|
+
key: "componentDidMount",
|
|
125
|
+
value: function componentDidMount() {
|
|
126
|
+
var value = this.props.value;
|
|
127
|
+
|
|
128
|
+
var _ref2 = this.context || {},
|
|
129
|
+
_ref2$checkboxGroup = _ref2.checkboxGroup,
|
|
130
|
+
checkboxGroup = _ref2$checkboxGroup === void 0 ? {} : _ref2$checkboxGroup;
|
|
131
|
+
|
|
132
|
+
if (checkboxGroup.registerValue) {
|
|
133
|
+
checkboxGroup.registerValue(value);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, {
|
|
137
|
+
key: "shouldComponentUpdate",
|
|
138
|
+
value: function shouldComponentUpdate(nextProps, nextState, nextContext) {
|
|
139
|
+
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState) || !shallowEqual(this.context.checkboxGroup, nextContext.checkboxGroup);
|
|
140
|
+
}
|
|
141
|
+
}, {
|
|
142
|
+
key: "componentDidUpdate",
|
|
143
|
+
value: function componentDidUpdate(_ref3) {
|
|
144
|
+
var prevValue = _ref3.value;
|
|
145
|
+
var value = this.props.value;
|
|
146
|
+
|
|
147
|
+
var _ref4 = this.context || {},
|
|
148
|
+
_ref4$checkboxGroup = _ref4.checkboxGroup,
|
|
149
|
+
checkboxGroup = _ref4$checkboxGroup === void 0 ? {} : _ref4$checkboxGroup;
|
|
150
|
+
|
|
151
|
+
if (value !== prevValue && checkboxGroup.registerValue && checkboxGroup.cancelValue) {
|
|
152
|
+
checkboxGroup.cancelValue(prevValue);
|
|
153
|
+
checkboxGroup.registerValue(value);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}, {
|
|
157
|
+
key: "componentWillUnmount",
|
|
158
|
+
value: function componentWillUnmount() {
|
|
159
|
+
var value = this.props.value;
|
|
160
|
+
|
|
161
|
+
var _ref5 = this.context || {},
|
|
162
|
+
_ref5$checkboxGroup = _ref5.checkboxGroup,
|
|
163
|
+
checkboxGroup = _ref5$checkboxGroup === void 0 ? {} : _ref5$checkboxGroup;
|
|
164
|
+
|
|
165
|
+
if (checkboxGroup.cancelValue) {
|
|
166
|
+
checkboxGroup.cancelValue(value);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "focus",
|
|
171
|
+
value: function focus() {
|
|
172
|
+
this.rcCheckbox.focus();
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
key: "blur",
|
|
176
|
+
value: function blur() {
|
|
177
|
+
this.rcCheckbox.blur();
|
|
178
|
+
}
|
|
179
|
+
}, {
|
|
180
|
+
key: "render",
|
|
181
|
+
value: function render() {
|
|
182
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderCheckbox);
|
|
183
|
+
}
|
|
184
|
+
}]);
|
|
185
|
+
|
|
186
|
+
return Checkbox;
|
|
187
|
+
}(React.Component);
|
|
188
|
+
|
|
189
|
+
Checkbox.__ANT_CHECKBOX = true;
|
|
190
|
+
Checkbox.defaultProps = {
|
|
191
|
+
indeterminate: false
|
|
192
|
+
};
|
|
193
|
+
Checkbox.contextTypes = {
|
|
194
|
+
checkboxGroup: propTypesExports.any
|
|
195
|
+
};
|
|
196
|
+
polyfill(Checkbox);
|
|
197
|
+
|
|
198
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
199
|
+
|
|
200
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
201
|
+
|
|
202
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
203
|
+
|
|
204
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
205
|
+
|
|
206
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
207
|
+
|
|
208
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
|
209
|
+
|
|
210
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
211
|
+
|
|
212
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
213
|
+
|
|
214
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
215
|
+
|
|
216
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
217
|
+
|
|
218
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
219
|
+
|
|
220
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
221
|
+
|
|
222
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
223
|
+
|
|
224
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
225
|
+
|
|
226
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
227
|
+
|
|
228
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
229
|
+
|
|
230
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
231
|
+
|
|
232
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
233
|
+
|
|
234
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
235
|
+
var t = {};
|
|
236
|
+
|
|
237
|
+
for (var p in s) {
|
|
238
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
242
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
243
|
+
}
|
|
244
|
+
return t;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
var CheckboxGroup = /*#__PURE__*/function (_React$Component) {
|
|
248
|
+
_inherits(CheckboxGroup, _React$Component);
|
|
249
|
+
|
|
250
|
+
var _super = _createSuper(CheckboxGroup);
|
|
251
|
+
|
|
252
|
+
function CheckboxGroup(props) {
|
|
253
|
+
var _this;
|
|
254
|
+
|
|
255
|
+
_classCallCheck(this, CheckboxGroup);
|
|
256
|
+
|
|
257
|
+
_this = _super.call(this, props);
|
|
258
|
+
|
|
259
|
+
_this.cancelValue = function (value) {
|
|
260
|
+
_this.setState(function (_ref) {
|
|
261
|
+
var registeredValues = _ref.registeredValues;
|
|
262
|
+
return {
|
|
263
|
+
registeredValues: registeredValues.filter(function (val) {
|
|
264
|
+
return val !== value;
|
|
265
|
+
})
|
|
266
|
+
};
|
|
267
|
+
});
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
_this.registerValue = function (value) {
|
|
271
|
+
_this.setState(function (_ref2) {
|
|
272
|
+
var registeredValues = _ref2.registeredValues;
|
|
273
|
+
return {
|
|
274
|
+
registeredValues: [].concat(_toConsumableArray(registeredValues), [value])
|
|
275
|
+
};
|
|
276
|
+
});
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
_this.toggleOption = function (option) {
|
|
280
|
+
var registeredValues = _this.state.registeredValues;
|
|
281
|
+
|
|
282
|
+
var optionIndex = _this.state.value.indexOf(option.value);
|
|
283
|
+
|
|
284
|
+
var value = _toConsumableArray(_this.state.value);
|
|
285
|
+
|
|
286
|
+
if (optionIndex === -1) {
|
|
287
|
+
value.push(option.value);
|
|
288
|
+
} else {
|
|
289
|
+
value.splice(optionIndex, 1);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (!('value' in _this.props)) {
|
|
293
|
+
_this.setState({
|
|
294
|
+
value: value
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
var onChange = _this.props.onChange;
|
|
299
|
+
|
|
300
|
+
if (onChange) {
|
|
301
|
+
var options = _this.getOptions();
|
|
302
|
+
|
|
303
|
+
onChange(value.filter(function (val) {
|
|
304
|
+
return registeredValues.indexOf(val) !== -1;
|
|
305
|
+
}).sort(function (a, b) {
|
|
306
|
+
var indexA = options.findIndex(function (opt) {
|
|
307
|
+
return opt.value === a;
|
|
308
|
+
});
|
|
309
|
+
var indexB = options.findIndex(function (opt) {
|
|
310
|
+
return opt.value === b;
|
|
311
|
+
});
|
|
312
|
+
return indexA - indexB;
|
|
313
|
+
}));
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
|
|
317
|
+
_this.renderGroup = function (_ref3) {
|
|
318
|
+
var getPrefixCls = _ref3.getPrefixCls;
|
|
319
|
+
|
|
320
|
+
var _assertThisInitialize = _assertThisInitialized(_this),
|
|
321
|
+
props = _assertThisInitialize.props,
|
|
322
|
+
state = _assertThisInitialize.state;
|
|
323
|
+
|
|
324
|
+
var customizePrefixCls = props.prefixCls,
|
|
325
|
+
className = props.className,
|
|
326
|
+
style = props.style,
|
|
327
|
+
options = props.options,
|
|
328
|
+
restProps = __rest(props, ["prefixCls", "className", "style", "options"]);
|
|
329
|
+
|
|
330
|
+
var prefixCls = getPrefixCls('checkbox', customizePrefixCls);
|
|
331
|
+
var groupPrefixCls = "".concat(prefixCls, "-group");
|
|
332
|
+
var domProps = omit(restProps, ['children', 'defaultValue', 'value', 'onChange', 'disabled']);
|
|
333
|
+
var children = props.children;
|
|
334
|
+
|
|
335
|
+
if (options && options.length > 0) {
|
|
336
|
+
children = _this.getOptions().map(function (option) {
|
|
337
|
+
return /*#__PURE__*/React.createElement(Checkbox, {
|
|
338
|
+
prefixCls: prefixCls,
|
|
339
|
+
key: option.value.toString(),
|
|
340
|
+
disabled: 'disabled' in option ? option.disabled : props.disabled,
|
|
341
|
+
value: option.value,
|
|
342
|
+
checked: state.value.indexOf(option.value) !== -1,
|
|
343
|
+
onChange: option.onChange,
|
|
344
|
+
className: "".concat(groupPrefixCls, "-item")
|
|
345
|
+
}, option.label);
|
|
346
|
+
});
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
var classString = classNames(groupPrefixCls, className);
|
|
350
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
351
|
+
className: classString,
|
|
352
|
+
style: style
|
|
353
|
+
}, domProps), children);
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
_this.state = {
|
|
357
|
+
value: props.value || props.defaultValue || [],
|
|
358
|
+
registeredValues: []
|
|
359
|
+
};
|
|
360
|
+
return _this;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
_createClass(CheckboxGroup, [{
|
|
364
|
+
key: "getChildContext",
|
|
365
|
+
value: function getChildContext() {
|
|
366
|
+
return {
|
|
367
|
+
checkboxGroup: {
|
|
368
|
+
toggleOption: this.toggleOption,
|
|
369
|
+
value: this.state.value,
|
|
370
|
+
disabled: this.props.disabled,
|
|
371
|
+
name: this.props.name,
|
|
372
|
+
// https://github.com/ant-design/ant-design/issues/16376
|
|
373
|
+
registerValue: this.registerValue,
|
|
374
|
+
cancelValue: this.cancelValue
|
|
375
|
+
}
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
}, {
|
|
379
|
+
key: "shouldComponentUpdate",
|
|
380
|
+
value: function shouldComponentUpdate(nextProps, nextState) {
|
|
381
|
+
return !shallowEqual(this.props, nextProps) || !shallowEqual(this.state, nextState);
|
|
382
|
+
}
|
|
383
|
+
}, {
|
|
384
|
+
key: "getOptions",
|
|
385
|
+
value: function getOptions() {
|
|
386
|
+
var options = this.props.options; // https://github.com/Microsoft/TypeScript/issues/7960
|
|
387
|
+
|
|
388
|
+
return options.map(function (option) {
|
|
389
|
+
if (typeof option === 'string') {
|
|
390
|
+
return {
|
|
391
|
+
label: option,
|
|
392
|
+
value: option
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
return option;
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}, {
|
|
400
|
+
key: "render",
|
|
401
|
+
value: function render() {
|
|
402
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderGroup);
|
|
403
|
+
}
|
|
404
|
+
}], [{
|
|
405
|
+
key: "getDerivedStateFromProps",
|
|
406
|
+
value: function getDerivedStateFromProps(nextProps) {
|
|
407
|
+
if ('value' in nextProps) {
|
|
408
|
+
return {
|
|
409
|
+
value: nextProps.value || []
|
|
410
|
+
};
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
}]);
|
|
416
|
+
|
|
417
|
+
return CheckboxGroup;
|
|
418
|
+
}(React.Component);
|
|
419
|
+
|
|
420
|
+
CheckboxGroup.defaultProps = {
|
|
421
|
+
options: []
|
|
422
|
+
};
|
|
423
|
+
CheckboxGroup.propTypes = {
|
|
424
|
+
defaultValue: propTypesExports.array,
|
|
425
|
+
value: propTypesExports.array,
|
|
426
|
+
options: propTypesExports.array.isRequired,
|
|
427
|
+
onChange: propTypesExports.func
|
|
428
|
+
};
|
|
429
|
+
CheckboxGroup.childContextTypes = {
|
|
430
|
+
checkboxGroup: propTypesExports.any
|
|
431
|
+
};
|
|
432
|
+
polyfill(CheckboxGroup);
|
|
433
|
+
|
|
434
|
+
Checkbox.Group = CheckboxGroup;
|
|
435
|
+
|
|
436
|
+
export { Checkbox as C };
|
package/dist/index9.js
ADDED
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { D as Dropdown } from './dropdown.js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { c as classNames, C as ConfigConsumer } from './config-provider.js';
|
|
4
|
+
import { B as Button } from './index7.js';
|
|
5
|
+
import { I as Icon } from './icon.js';
|
|
6
|
+
|
|
7
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
8
|
+
|
|
9
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
10
|
+
|
|
11
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
12
|
+
|
|
13
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
14
|
+
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); return Constructor; }
|
|
16
|
+
|
|
17
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
18
|
+
|
|
19
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
|
+
|
|
21
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
|
+
|
|
23
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
24
|
+
|
|
25
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
26
|
+
|
|
27
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
28
|
+
|
|
29
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
30
|
+
|
|
31
|
+
var __rest = undefined && undefined.__rest || function (s, e) {
|
|
32
|
+
var t = {};
|
|
33
|
+
|
|
34
|
+
for (var p in s) {
|
|
35
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
var ButtonGroup = Button.Group;
|
|
44
|
+
|
|
45
|
+
var DropdownButton = /*#__PURE__*/function (_React$Component) {
|
|
46
|
+
_inherits(DropdownButton, _React$Component);
|
|
47
|
+
|
|
48
|
+
var _super = _createSuper(DropdownButton);
|
|
49
|
+
|
|
50
|
+
function DropdownButton() {
|
|
51
|
+
var _this;
|
|
52
|
+
|
|
53
|
+
_classCallCheck(this, DropdownButton);
|
|
54
|
+
|
|
55
|
+
_this = _super.apply(this, arguments);
|
|
56
|
+
|
|
57
|
+
_this.renderButton = function (_ref) {
|
|
58
|
+
var getContextPopupContainer = _ref.getPopupContainer,
|
|
59
|
+
getPrefixCls = _ref.getPrefixCls;
|
|
60
|
+
|
|
61
|
+
var _a = _this.props,
|
|
62
|
+
customizePrefixCls = _a.prefixCls,
|
|
63
|
+
type = _a.type,
|
|
64
|
+
disabled = _a.disabled,
|
|
65
|
+
onClick = _a.onClick,
|
|
66
|
+
htmlType = _a.htmlType,
|
|
67
|
+
children = _a.children,
|
|
68
|
+
className = _a.className,
|
|
69
|
+
overlay = _a.overlay,
|
|
70
|
+
trigger = _a.trigger,
|
|
71
|
+
align = _a.align,
|
|
72
|
+
visible = _a.visible,
|
|
73
|
+
onVisibleChange = _a.onVisibleChange,
|
|
74
|
+
placement = _a.placement,
|
|
75
|
+
getPopupContainer = _a.getPopupContainer,
|
|
76
|
+
href = _a.href,
|
|
77
|
+
_a$icon = _a.icon,
|
|
78
|
+
icon = _a$icon === void 0 ? /*#__PURE__*/React.createElement(Icon, {
|
|
79
|
+
type: "ellipsis"
|
|
80
|
+
}) : _a$icon,
|
|
81
|
+
title = _a.title,
|
|
82
|
+
restProps = __rest(_a, ["prefixCls", "type", "disabled", "onClick", "htmlType", "children", "className", "overlay", "trigger", "align", "visible", "onVisibleChange", "placement", "getPopupContainer", "href", "icon", "title"]);
|
|
83
|
+
|
|
84
|
+
var prefixCls = getPrefixCls('dropdown-button', customizePrefixCls);
|
|
85
|
+
var dropdownProps = {
|
|
86
|
+
align: align,
|
|
87
|
+
overlay: overlay,
|
|
88
|
+
disabled: disabled,
|
|
89
|
+
trigger: disabled ? [] : trigger,
|
|
90
|
+
onVisibleChange: onVisibleChange,
|
|
91
|
+
placement: placement,
|
|
92
|
+
getPopupContainer: getPopupContainer || getContextPopupContainer
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
if ('visible' in _this.props) {
|
|
96
|
+
dropdownProps.visible = visible;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return /*#__PURE__*/React.createElement(ButtonGroup, _extends({}, restProps, {
|
|
100
|
+
className: classNames(prefixCls, className)
|
|
101
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
102
|
+
type: type,
|
|
103
|
+
disabled: disabled,
|
|
104
|
+
onClick: onClick,
|
|
105
|
+
htmlType: htmlType,
|
|
106
|
+
href: href,
|
|
107
|
+
title: title
|
|
108
|
+
}, children), /*#__PURE__*/React.createElement(Dropdown, dropdownProps, /*#__PURE__*/React.createElement(Button, {
|
|
109
|
+
type: type
|
|
110
|
+
}, icon)));
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
return _this;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_createClass(DropdownButton, [{
|
|
117
|
+
key: "render",
|
|
118
|
+
value: function render() {
|
|
119
|
+
return /*#__PURE__*/React.createElement(ConfigConsumer, null, this.renderButton);
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
|
|
123
|
+
return DropdownButton;
|
|
124
|
+
}(React.Component);
|
|
125
|
+
DropdownButton.defaultProps = {
|
|
126
|
+
placement: 'bottomRight',
|
|
127
|
+
type: 'default'
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
Dropdown.Button = DropdownButton;
|