@trionesdev/antd-mobile-base-react 0.0.2-beta.2 → 0.0.2-beta.21
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/dist/Alert/alert.js +1 -1
- package/dist/Alert/style.scss +17 -17
- package/dist/Avatar/avatar.d.ts +4 -1
- package/dist/Avatar/avatar.js +19 -6
- package/dist/Avatar/style.scss +3 -2
- package/dist/Card/style.scss +12 -12
- package/dist/CascaderView/cascader-column-item.js +1 -1
- package/dist/CascaderView/style.scss +2 -2
- package/dist/Cell/CellGroup.js +53 -14
- package/dist/Cell/cell.js +52 -15
- package/dist/Cell/context.d.ts +19 -0
- package/dist/Cell/context.js +2 -0
- package/dist/Cell/styles.scss +42 -13
- package/dist/Cell/types.d.ts +30 -7
- package/dist/Checkbox/checkbox-button.d.ts +6 -2
- package/dist/Checkbox/checkbox-button.js +6 -18
- package/dist/Checkbox/checkbox-group.js +19 -4
- package/dist/Checkbox/checkbox-round.d.ts +8 -0
- package/dist/Checkbox/checkbox-round.js +35 -0
- package/dist/Checkbox/checkbox.js +49 -34
- package/dist/Checkbox/index.d.ts +0 -2
- package/dist/Checkbox/index.js +0 -2
- package/dist/Checkbox/index.scss +48 -34
- package/dist/Checkbox/types.d.ts +11 -1
- package/dist/ConfigProvider/config-provider.d.ts +1 -0
- package/dist/Descriptions/style.scss +4 -4
- package/dist/Divider/divider.d.ts +1 -1
- package/dist/Divider/divider.js +5 -3
- package/dist/Divider/style.scss +7 -7
- package/dist/Form/ErrorList.d.ts +4 -0
- package/dist/Form/ErrorList.js +9 -0
- package/dist/Form/context.d.ts +5 -2
- package/dist/Form/context.js +2 -1
- package/dist/Form/form.d.ts +25 -12
- package/dist/Form/form.js +25 -13
- package/dist/Form/hooks/useForm.js +1 -8
- package/dist/Form/hooks/useFormContext.js +1 -2
- package/dist/Form/index.d.ts +8 -3
- package/dist/Form/index.js +7 -2
- package/dist/Form/styles.scss +11 -0
- package/dist/Form/types.d.ts +8 -0
- package/dist/FormCell/FormCell.d.ts +22 -0
- package/dist/FormCell/FormCell.js +57 -0
- package/dist/FormCell/index.d.ts +4 -0
- package/dist/FormCell/index.js +3 -0
- package/dist/FormCell/styles.scss +103 -0
- package/dist/IndexedStack/IndexedStack.d.ts +9 -0
- package/dist/IndexedStack/IndexedStack.js +27 -0
- package/dist/IndexedStack/index.d.ts +3 -0
- package/dist/IndexedStack/index.js +2 -0
- package/dist/InputNumber/input-number.d.ts +3 -2
- package/dist/InputNumber/input-number.js +48 -26
- package/dist/InputNumber/style.scss +79 -22
- package/dist/Loading/DotLoading.d.ts +7 -0
- package/dist/{Mask/mask-modal.js → Loading/DotLoading.js} +25 -25
- package/dist/{SpinLoading/spin-loading.d.ts → Loading/SpinLoading.d.ts} +0 -1
- package/dist/Loading/SpinLoading.js +69 -0
- package/dist/Loading/index.d.ts +6 -0
- package/dist/Loading/index.js +4 -0
- package/dist/Loading/style.scss +113 -0
- package/dist/NavBar/nav-bar.d.ts +1 -0
- package/dist/NavBar/nav-bar.js +3 -2
- package/dist/NavBar/style.scss +7 -3
- package/dist/Progress/Progress.d.ts +39 -0
- package/dist/Progress/Progress.js +56 -0
- package/dist/Progress/ProgressCircle.d.ts +15 -0
- package/dist/Progress/ProgressCircle.js +117 -0
- package/dist/Progress/ProgressLine.d.ts +15 -0
- package/dist/Progress/ProgressLine.js +87 -0
- package/dist/Progress/index.d.ts +3 -0
- package/dist/Progress/index.js +2 -0
- package/dist/Progress/style.scss +33 -0
- package/dist/Progress/types.d.ts +6 -0
- package/dist/Progress/types.js +2 -0
- package/dist/Radio/RadioGroup.js +3 -3
- package/dist/Radio/radio.js +1 -1
- package/dist/Radio/style.scss +40 -24
- package/dist/Radio/types.d.ts +6 -4
- package/dist/Rate/rate.js +1 -1
- package/dist/Result/use-result-icon.js +1 -1
- package/dist/SafeArea/style.scss +5 -3
- package/dist/Scaffold/style.scss +2 -1
- package/dist/Segmented/Segmented.d.ts +57 -0
- package/dist/Segmented/Segmented.js +82 -0
- package/dist/Segmented/index.d.ts +2 -0
- package/dist/Segmented/index.js +1 -0
- package/dist/Segmented/style.scss +75 -0
- package/dist/Skeleton/Skeleton.d.ts +86 -0
- package/dist/Skeleton/Skeleton.js +263 -0
- package/dist/Skeleton/index.d.ts +3 -0
- package/dist/Skeleton/index.js +2 -0
- package/dist/Skeleton/style.scss +215 -0
- package/dist/Space/space.d.ts +1 -0
- package/dist/Space/space.js +20 -6
- package/dist/Space/style.scss +27 -3
- package/dist/Stepper/index.d.ts +3 -0
- package/dist/Stepper/index.js +2 -0
- package/dist/Stepper/stepper.d.ts +14 -0
- package/dist/Stepper/stepper.js +92 -0
- package/dist/Stepper/style.scss +100 -0
- package/dist/Steps/HorizontalSteps.js +10 -3
- package/dist/Steps/VerticalSteps.js +5 -2
- package/dist/Steps/style.scss +7 -0
- package/dist/Steps/types.d.ts +2 -0
- package/dist/Switch/style.scss +6 -7
- package/dist/Switch/switch.d.ts +2 -0
- package/dist/Switch/switch.js +6 -5
- package/dist/TabBar/index.js +2 -1
- package/dist/TabBar/index.scss +3 -2
- package/dist/Tabs/style.scss +5 -5
- package/dist/Tag/style.scss +45 -21
- package/dist/Tag/tag.d.ts +4 -1
- package/dist/Tag/tag.js +8 -2
- package/dist/index.d.ts +17 -26
- package/dist/index.js +8 -13
- package/dist/style/css-variable.scss +6 -0
- package/dist/style/style.scss +2 -2
- package/dist/style/variable.scss +176 -164
- package/dist/types.d.ts +10 -1
- package/package.json +5 -8
- package/dist/ActionSheet/ActionSheet.d.ts +0 -25
- package/dist/ActionSheet/ActionSheet.js +0 -77
- package/dist/ActionSheet/index.d.ts +0 -3
- package/dist/ActionSheet/index.js +0 -2
- package/dist/ActionSheet/style.scss +0 -51
- package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
- package/dist/CascaderPicker/cascader-picker.js +0 -88
- package/dist/CascaderPicker/index.d.ts +0 -3
- package/dist/CascaderPicker/index.js +0 -2
- package/dist/CascaderPicker/style.scss +0 -42
- package/dist/Form/FormItem/form-item-input.d.ts +0 -15
- package/dist/Form/FormItem/form-item-input.js +0 -39
- package/dist/Form/FormItem/form-item-label.d.ts +0 -13
- package/dist/Form/FormItem/form-item-label.js +0 -25
- package/dist/Form/FormItem/form-item.d.ts +0 -21
- package/dist/Form/FormItem/form-item.js +0 -70
- package/dist/Form/FormItem/index.d.ts +0 -5
- package/dist/Form/FormItem/index.js +0 -3
- package/dist/Form/style.scss +0 -45
- package/dist/Input/base-input.d.ts +0 -14
- package/dist/Input/base-input.js +0 -63
- package/dist/Input/index.d.ts +0 -12
- package/dist/Input/index.js +0 -9
- package/dist/Input/index.scss +0 -173
- package/dist/Input/input-affix-wrapper.d.ts +0 -8
- package/dist/Input/input-affix-wrapper.js +0 -50
- package/dist/Input/input-opt.d.ts +0 -16
- package/dist/Input/input-opt.js +0 -93
- package/dist/Input/input-password.d.ts +0 -7
- package/dist/Input/input-password.js +0 -47
- package/dist/Input/input.d.ts +0 -15
- package/dist/Input/input.js +0 -47
- package/dist/Input/textarea.d.ts +0 -13
- package/dist/Input/textarea.js +0 -45
- package/dist/Input/types.d.ts +0 -1
- package/dist/Input/types.js +0 -1
- package/dist/Mask/index.d.ts +0 -3
- package/dist/Mask/index.js +0 -2
- package/dist/Mask/mask-modal.d.ts +0 -45
- package/dist/Mask/mask.d.ts +0 -5
- package/dist/Mask/mask.js +0 -19
- package/dist/Mask/style.scss +0 -20
- package/dist/Picker/index.d.ts +0 -3
- package/dist/Picker/index.js +0 -2
- package/dist/Picker/picker.d.ts +0 -19
- package/dist/Picker/picker.js +0 -97
- package/dist/Picker/style.scss +0 -41
- package/dist/PickerView/index.d.ts +0 -4
- package/dist/PickerView/index.js +0 -2
- package/dist/PickerView/picker-view-column-item.d.ts +0 -7
- package/dist/PickerView/picker-view-column-item.js +0 -11
- package/dist/PickerView/picker-view-column.d.ts +0 -10
- package/dist/PickerView/picker-view-column.js +0 -117
- package/dist/PickerView/picker-view.d.ts +0 -12
- package/dist/PickerView/picker-view.js +0 -60
- package/dist/PickerView/style.scss +0 -72
- package/dist/PickerView/types.d.ts +0 -4
- package/dist/Popup/index.d.ts +0 -3
- package/dist/Popup/index.js +0 -2
- package/dist/Popup/popup-modal.d.ts +0 -52
- package/dist/Popup/popup-modal.js +0 -74
- package/dist/Popup/popup.d.ts +0 -4
- package/dist/Popup/popup.js +0 -56
- package/dist/Popup/style.scss +0 -53
- package/dist/ScrollView/index.d.ts +0 -4
- package/dist/ScrollView/index.js +0 -2
- package/dist/ScrollView/scroll-view.d.ts +0 -4
- package/dist/ScrollView/scroll-view.js +0 -55
- package/dist/ScrollView/style.scss +0 -19
- package/dist/ScrollView/types.d.ts +0 -26
- package/dist/ScrollView/types.js +0 -1
- package/dist/SideBar/SideBarContext.d.ts +0 -18
- package/dist/SideBar/SideBarContext.js +0 -2
- package/dist/SideBar/index.d.ts +0 -3
- package/dist/SideBar/index.js +0 -2
- package/dist/SideBar/side-bar.d.ts +0 -25
- package/dist/SideBar/side-bar.js +0 -351
- package/dist/SideBar/style.scss +0 -85
- package/dist/SideBar/types.d.ts +0 -7
- package/dist/SideBar/types.js +0 -1
- package/dist/SpinLoading/demo/base.d.ts +0 -3
- package/dist/SpinLoading/demo/base.js +0 -21
- package/dist/SpinLoading/index.d.ts +0 -3
- package/dist/SpinLoading/index.js +0 -2
- package/dist/SpinLoading/spin-loading.js +0 -59
- package/dist/SpinLoading/spin-loading.scss +0 -40
- package/dist/Tabs/demo/base.d.ts +0 -3
- package/dist/Tabs/demo/base.js +0 -59
- package/dist/Tag/demo/base.d.ts +0 -7
- package/dist/Tag/demo/base.js +0 -67
- package/dist/Tag/demo/style.scss +0 -8
- package/dist/Toast/index.d.ts +0 -5
- package/dist/Toast/index.js +0 -3
- package/dist/Toast/style.scss +0 -63
- package/dist/Toast/toast-modal.d.ts +0 -18
- package/dist/Toast/toast-modal.js +0 -112
- package/dist/Toast/toast.d.ts +0 -7
- package/dist/Toast/toast.js +0 -78
- package/dist/VerificationCodeInput/demo/base.d.ts +0 -3
- package/dist/VerificationCodeInput/demo/base.js +0 -11
- package/dist/VerificationCodeInput/index.d.ts +0 -3
- package/dist/VerificationCodeInput/index.js +0 -2
- package/dist/VerificationCodeInput/style.scss +0 -20
- package/dist/VerificationCodeInput/verification-code-input.d.ts +0 -24
- package/dist/VerificationCodeInput/verification-code-input.js +0 -99
- /package/dist/{PickerView → Form}/types.js +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
var _excluded = ["prefix", "suffix", "allowClear", "value", "onChange"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import { CloseCircleFill } from "../../../antd-mobile-icons-react";
|
|
12
|
-
import classNames from 'classnames';
|
|
13
|
-
import React, { useRef } from 'react';
|
|
14
|
-
import { BaseInput } from "./base-input";
|
|
15
|
-
export var InputAffixWrapper = function InputAffixWrapper(_ref) {
|
|
16
|
-
var prefix = _ref.prefix,
|
|
17
|
-
suffix = _ref.suffix,
|
|
18
|
-
allowClear = _ref.allowClear,
|
|
19
|
-
value = _ref.value,
|
|
20
|
-
_onChange = _ref.onChange,
|
|
21
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
var _React$useState = React.useState(value),
|
|
23
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
24
|
-
innerValue = _React$useState2[0],
|
|
25
|
-
setInnerValue = _React$useState2[1];
|
|
26
|
-
var baseInputRef = useRef({});
|
|
27
|
-
var cls = 'triones-antm-input-affix-wrapper';
|
|
28
|
-
var inputCls = 'triones-antm-input';
|
|
29
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: classNames([cls])
|
|
31
|
-
}, prefix && /*#__PURE__*/React.createElement("div", {
|
|
32
|
-
className: classNames(["".concat(inputCls, "-prefix")])
|
|
33
|
-
}, prefix), /*#__PURE__*/React.createElement(BaseInput, _extends({
|
|
34
|
-
ref: baseInputRef
|
|
35
|
-
}, rest, {
|
|
36
|
-
value: value,
|
|
37
|
-
onChange: function onChange(value) {
|
|
38
|
-
setInnerValue(value);
|
|
39
|
-
_onChange === null || _onChange === void 0 || _onChange(value);
|
|
40
|
-
}
|
|
41
|
-
})), (suffix || allowClear) && /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: classNames(["".concat(inputCls, "-suffix")])
|
|
43
|
-
}, allowClear && innerValue && /*#__PURE__*/React.createElement(CloseCircleFill, {
|
|
44
|
-
className: "clear-icon",
|
|
45
|
-
onClick: function onClick() {
|
|
46
|
-
var _baseInputRef$current, _baseInputRef$current2;
|
|
47
|
-
(_baseInputRef$current = (_baseInputRef$current2 = baseInputRef.current).clear) === null || _baseInputRef$current === void 0 || _baseInputRef$current.call(_baseInputRef$current2);
|
|
48
|
-
}
|
|
49
|
-
}), suffix));
|
|
50
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export type InputOPTProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
length?: number;
|
|
7
|
-
value?: string;
|
|
8
|
-
onChange?: (value: string) => void;
|
|
9
|
-
};
|
|
10
|
-
export type InputOPTItemProps = {
|
|
11
|
-
index: number;
|
|
12
|
-
focusIndex?: number;
|
|
13
|
-
value?: string;
|
|
14
|
-
onFocus?: (index: number) => void;
|
|
15
|
-
};
|
|
16
|
-
export declare const InputOPT: FC<InputOPTProps>;
|
package/dist/Input/input-opt.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
9
|
-
import "./index.scss";
|
|
10
|
-
var cls = 'triones-antm-pot';
|
|
11
|
-
var inputCls = 'triones-antm-input';
|
|
12
|
-
var InputOPTItem = function InputOPTItem(_ref) {
|
|
13
|
-
var index = _ref.index,
|
|
14
|
-
focusIndex = _ref.focusIndex,
|
|
15
|
-
value = _ref.value,
|
|
16
|
-
onFocus = _ref.onFocus;
|
|
17
|
-
var ref = React.useRef(null);
|
|
18
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
19
|
-
ref: ref,
|
|
20
|
-
className: classNames("".concat(inputCls), "".concat(cls, "-item"), "".concat(inputCls, "-outlined") // {
|
|
21
|
-
// [`${cls}-item-focus`]: focusIndex === index,
|
|
22
|
-
// }
|
|
23
|
-
),
|
|
24
|
-
onClick: function onClick() {
|
|
25
|
-
onFocus === null || onFocus === void 0 || onFocus(index);
|
|
26
|
-
}
|
|
27
|
-
}, value);
|
|
28
|
-
};
|
|
29
|
-
export var InputOPT = function InputOPT(_ref2) {
|
|
30
|
-
var className = _ref2.className,
|
|
31
|
-
style = _ref2.style,
|
|
32
|
-
_ref2$length = _ref2.length,
|
|
33
|
-
length = _ref2$length === void 0 ? 6 : _ref2$length,
|
|
34
|
-
value = _ref2.value,
|
|
35
|
-
_onChange = _ref2.onChange;
|
|
36
|
-
var inputRef = useRef();
|
|
37
|
-
var _useState = useState(value || ''),
|
|
38
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
39
|
-
inputValue = _useState2[0],
|
|
40
|
-
setInputValue = _useState2[1];
|
|
41
|
-
var _React$useState = React.useState(Array.from({
|
|
42
|
-
length: length
|
|
43
|
-
}).map(function () {
|
|
44
|
-
return '';
|
|
45
|
-
})),
|
|
46
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
47
|
-
internalValue = _React$useState2[0],
|
|
48
|
-
setInternalValue = _React$useState2[1];
|
|
49
|
-
var _useState3 = useState(0),
|
|
50
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
51
|
-
focusIndex = _useState4[0],
|
|
52
|
-
setFocusIndex = _useState4[1];
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
if (value === undefined) {
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
setInternalValue(Array.from(inputValue));
|
|
58
|
-
}, [inputValue]);
|
|
59
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: classNames(cls, className),
|
|
61
|
-
style: style
|
|
62
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
63
|
-
className: classNames("".concat(cls, "-wrapper")),
|
|
64
|
-
onClick: function onClick() {
|
|
65
|
-
var _inputRef$current;
|
|
66
|
-
(_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
|
|
67
|
-
}
|
|
68
|
-
}, Array.from({
|
|
69
|
-
length: length
|
|
70
|
-
}).map(function (_, index) {
|
|
71
|
-
return /*#__PURE__*/React.createElement(InputOPTItem, {
|
|
72
|
-
key: index,
|
|
73
|
-
index: index,
|
|
74
|
-
focusIndex: focusIndex,
|
|
75
|
-
value: (internalValue === null || internalValue === void 0 ? void 0 : internalValue[index]) || '',
|
|
76
|
-
onFocus: function onFocus(index) {
|
|
77
|
-
setFocusIndex(index);
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
})), /*#__PURE__*/React.createElement("input", {
|
|
81
|
-
ref: inputRef,
|
|
82
|
-
className: "".concat(cls, "-input"),
|
|
83
|
-
type: "number",
|
|
84
|
-
value: inputValue,
|
|
85
|
-
onChange: function onChange(e) {
|
|
86
|
-
if (e.target.value.length > length) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
setInputValue(e.target.value);
|
|
90
|
-
_onChange === null || _onChange === void 0 || _onChange(e.target.value);
|
|
91
|
-
}
|
|
92
|
-
}));
|
|
93
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { InputProps } from './input';
|
|
3
|
-
export type InputPasswordProps = Omit<InputProps, 'type'> & {
|
|
4
|
-
iconRender?: (visible: boolean) => React.ReactNode;
|
|
5
|
-
visibilityToggle?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const InputPassword: FC<InputPasswordProps>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var _excluded = ["iconRender", "visibilityToggle", "suffix"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
8
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
9
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
|
-
import { EyeInvisibleOutline, EyeOutline } from "../../../antd-mobile-icons-react";
|
|
12
|
-
import React, { useState } from 'react';
|
|
13
|
-
import { Input } from "./input";
|
|
14
|
-
export var InputPassword = function InputPassword(_ref) {
|
|
15
|
-
var iconRender = _ref.iconRender,
|
|
16
|
-
_ref$visibilityToggle = _ref.visibilityToggle,
|
|
17
|
-
visibilityToggle = _ref$visibilityToggle === void 0 ? true : _ref$visibilityToggle,
|
|
18
|
-
suffix = _ref.suffix,
|
|
19
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
20
|
-
var _useState = useState(false),
|
|
21
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
-
visible = _useState2[0],
|
|
23
|
-
setVisible = _useState2[1];
|
|
24
|
-
var toggleRender = function toggleRender() {
|
|
25
|
-
if (iconRender) {
|
|
26
|
-
return iconRender(visible);
|
|
27
|
-
} else {
|
|
28
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, visible ? /*#__PURE__*/React.createElement(EyeOutline, {
|
|
29
|
-
onClick: function onClick() {
|
|
30
|
-
return setVisible(false);
|
|
31
|
-
}
|
|
32
|
-
}) : /*#__PURE__*/React.createElement(EyeInvisibleOutline, {
|
|
33
|
-
onClick: function onClick() {
|
|
34
|
-
return setVisible(true);
|
|
35
|
-
}
|
|
36
|
-
}));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
return /*#__PURE__*/React.createElement(Input, _extends({}, rest, {
|
|
40
|
-
type: visible ? 'text' : 'password',
|
|
41
|
-
suffix: /*#__PURE__*/React.createElement(React.Fragment, null, ' ', visibilityToggle && /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
style: {
|
|
43
|
-
paddingLeft: 4
|
|
44
|
-
}
|
|
45
|
-
}, toggleRender()), " ", suffix, ' ')
|
|
46
|
-
}));
|
|
47
|
-
};
|
package/dist/Input/input.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export type InputProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
type?: 'text' | 'password' | 'textarea';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
allowClear?: boolean;
|
|
10
|
-
prefix?: React.ReactNode;
|
|
11
|
-
suffix?: React.ReactNode;
|
|
12
|
-
value?: any;
|
|
13
|
-
onChange?: (e: any) => void;
|
|
14
|
-
};
|
|
15
|
-
export declare const Input: FC<InputProps>;
|
package/dist/Input/input.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
var _excluded = ["className", "style", "placeholder", "type", "disabled", "allowClear", "prefix", "suffix", "value", "onChange"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import { BaseInput } from "./base-input";
|
|
6
|
-
import { InputAffixWrapper } from "./input-affix-wrapper";
|
|
7
|
-
import React from 'react';
|
|
8
|
-
import "./index.scss";
|
|
9
|
-
export var Input = function Input(_ref) {
|
|
10
|
-
var className = _ref.className,
|
|
11
|
-
style = _ref.style,
|
|
12
|
-
placeholder = _ref.placeholder,
|
|
13
|
-
type = _ref.type,
|
|
14
|
-
disabled = _ref.disabled,
|
|
15
|
-
allowClear = _ref.allowClear,
|
|
16
|
-
prefix = _ref.prefix,
|
|
17
|
-
suffix = _ref.suffix,
|
|
18
|
-
value = _ref.value,
|
|
19
|
-
onChange = _ref.onChange,
|
|
20
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
var handleRender = function handleRender() {
|
|
22
|
-
if (prefix || suffix || allowClear) {
|
|
23
|
-
return /*#__PURE__*/React.createElement(InputAffixWrapper, _extends({}, rest, {
|
|
24
|
-
className: className,
|
|
25
|
-
style: style,
|
|
26
|
-
placeholder: placeholder,
|
|
27
|
-
prefix: prefix,
|
|
28
|
-
suffix: suffix,
|
|
29
|
-
allowClear: allowClear,
|
|
30
|
-
type: type,
|
|
31
|
-
value: value,
|
|
32
|
-
onChange: onChange
|
|
33
|
-
}));
|
|
34
|
-
} else {
|
|
35
|
-
return /*#__PURE__*/React.createElement(BaseInput, _extends({}, rest, {
|
|
36
|
-
className: className,
|
|
37
|
-
style: style,
|
|
38
|
-
placeholder: placeholder,
|
|
39
|
-
type: type,
|
|
40
|
-
disabled: disabled,
|
|
41
|
-
value: value,
|
|
42
|
-
onChange: onChange
|
|
43
|
-
}));
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, handleRender());
|
|
47
|
-
};
|
package/dist/Input/textarea.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import './index.scss';
|
|
3
|
-
export type InputTextareaProps = {
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
allowClear?: boolean;
|
|
9
|
-
rows?: number;
|
|
10
|
-
value?: any;
|
|
11
|
-
onChange?: (e: any) => void;
|
|
12
|
-
};
|
|
13
|
-
export declare const Textarea: FC<InputTextareaProps>;
|
package/dist/Input/textarea.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useEffect } from 'react';
|
|
8
|
-
import "./index.scss";
|
|
9
|
-
import { inputCls } from "./types";
|
|
10
|
-
import classNames from 'classnames';
|
|
11
|
-
export var Textarea = function Textarea(_ref) {
|
|
12
|
-
var className = _ref.className,
|
|
13
|
-
style = _ref.style,
|
|
14
|
-
placeholder = _ref.placeholder,
|
|
15
|
-
disabled = _ref.disabled,
|
|
16
|
-
allowClear = _ref.allowClear,
|
|
17
|
-
rows = _ref.rows,
|
|
18
|
-
value = _ref.value,
|
|
19
|
-
onChange = _ref.onChange;
|
|
20
|
-
var _React$useState = React.useState(value),
|
|
21
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22
|
-
internalValue = _React$useState2[0],
|
|
23
|
-
setInternalValue = _React$useState2[1];
|
|
24
|
-
useEffect(function () {
|
|
25
|
-
if (value === undefined) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
if (value === internalValue) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
setInternalValue(value);
|
|
32
|
-
}, [value]);
|
|
33
|
-
return /*#__PURE__*/React.createElement("textarea", {
|
|
34
|
-
className: classNames("".concat(inputCls, "-textarea"), className),
|
|
35
|
-
style: style,
|
|
36
|
-
placeholder: placeholder,
|
|
37
|
-
disabled: disabled,
|
|
38
|
-
rows: rows,
|
|
39
|
-
value: internalValue,
|
|
40
|
-
onInput: function onInput(e) {
|
|
41
|
-
setInternalValue(e.target.value);
|
|
42
|
-
onChange === null || onChange === void 0 || onChange(e.target.value);
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
};
|
package/dist/Input/types.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const inputCls = "triones-antm-input";
|
package/dist/Input/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export var inputCls = 'triones-antm-input';
|
package/dist/Mask/index.d.ts
DELETED
package/dist/Mask/index.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import React, { CSSProperties, FC, PropsWithChildren } from "react";
|
|
2
|
-
export type MaskModalProps = {
|
|
3
|
-
className?: string;
|
|
4
|
-
style?: CSSProperties;
|
|
5
|
-
/**
|
|
6
|
-
* @description 样式
|
|
7
|
-
* @default horizontal
|
|
8
|
-
*/
|
|
9
|
-
styles?: {
|
|
10
|
-
body?: CSSProperties;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* @description Modal 完全关闭后的回调
|
|
14
|
-
* @default
|
|
15
|
-
*/
|
|
16
|
-
afterClose?: () => void;
|
|
17
|
-
/**
|
|
18
|
-
* @description 是否打开
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
open?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* @description 是否蒙层关闭
|
|
24
|
-
* @default true
|
|
25
|
-
*/
|
|
26
|
-
maskClosable?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* @description 关闭时销毁 Modal 里的子元素
|
|
29
|
-
* @default false
|
|
30
|
-
*/
|
|
31
|
-
destroyOnClose?: boolean;
|
|
32
|
-
/**
|
|
33
|
-
* @description 设置 Modal 的 z-index
|
|
34
|
-
* @default 1000
|
|
35
|
-
*/
|
|
36
|
-
zIndex?: number;
|
|
37
|
-
/**
|
|
38
|
-
* @description 打开和关闭 Modal 时动画结束后的回调
|
|
39
|
-
* @default
|
|
40
|
-
*/
|
|
41
|
-
afterOpenChange?: (open: boolean) => void;
|
|
42
|
-
onMaskClick?: (event: React.MouseEvent<HTMLDivElement, MouseEvent>) => void;
|
|
43
|
-
onDestroy?: () => void;
|
|
44
|
-
};
|
|
45
|
-
export declare const MaskModal: FC<PropsWithChildren<MaskModalProps>>;
|
package/dist/Mask/mask.d.ts
DELETED
package/dist/Mask/mask.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
var _excluded = ["children", "open"];
|
|
2
|
-
function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
|
|
3
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
-
import React from "react";
|
|
6
|
-
import "./style.scss";
|
|
7
|
-
import { MaskModal } from "./mask-modal";
|
|
8
|
-
export var Mask = function Mask(_ref) {
|
|
9
|
-
var children = _ref.children,
|
|
10
|
-
_ref$open = _ref.open,
|
|
11
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
12
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
13
|
-
if (!open) {
|
|
14
|
-
return null;
|
|
15
|
-
}
|
|
16
|
-
return /*#__PURE__*/React.createElement(MaskModal, _extends({}, rest, {
|
|
17
|
-
open: open
|
|
18
|
-
}), children);
|
|
19
|
-
};
|
package/dist/Mask/style.scss
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
$maskCls:'triones-antm-mask2';
|
|
2
|
-
|
|
3
|
-
.#{$maskCls}{
|
|
4
|
-
position: fixed;
|
|
5
|
-
top: 0;
|
|
6
|
-
left: 0;
|
|
7
|
-
right: 0;
|
|
8
|
-
bottom: 0;
|
|
9
|
-
display: none;
|
|
10
|
-
background-color: rgba(0, 0, 0, .15);
|
|
11
|
-
z-index: 1000;
|
|
12
|
-
&-open{
|
|
13
|
-
display: block;
|
|
14
|
-
}
|
|
15
|
-
&-inner{
|
|
16
|
-
height: 100%;
|
|
17
|
-
width: 100%;
|
|
18
|
-
position: relative;
|
|
19
|
-
}
|
|
20
|
-
}
|
package/dist/Picker/index.d.ts
DELETED
package/dist/Picker/index.js
DELETED
package/dist/Picker/picker.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { PickerColumnOption } from '../PickerView';
|
|
3
|
-
import './style.scss';
|
|
4
|
-
export type PickerProps = {
|
|
5
|
-
open?: boolean;
|
|
6
|
-
afterOpenChange?: (open: boolean) => void;
|
|
7
|
-
title?: React.ReactNode;
|
|
8
|
-
columns?: PickerColumnOption[][];
|
|
9
|
-
/**
|
|
10
|
-
* @description 是否把每个选项的 label 包装到 value 中,会把 Select 的 value 类型从 string 变为 { value: string, label: ReactNode } 的格式
|
|
11
|
-
* @default false
|
|
12
|
-
*/
|
|
13
|
-
labelInValue?: boolean;
|
|
14
|
-
value?: any[];
|
|
15
|
-
onOk: (value: any[]) => void;
|
|
16
|
-
onCancel?: () => void;
|
|
17
|
-
onClose?: () => void;
|
|
18
|
-
};
|
|
19
|
-
export declare const Picker: FC<PickerProps>;
|
package/dist/Picker/picker.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
-
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); }
|
|
4
|
-
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; }
|
|
5
|
-
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import classNames from 'classnames';
|
|
8
|
-
import { size } from 'lodash-es';
|
|
9
|
-
import React, { useEffect, useState } from 'react';
|
|
10
|
-
import ConfigProvider from "../ConfigProvider";
|
|
11
|
-
import PickerView from "../PickerView";
|
|
12
|
-
import Popup from "../Popup";
|
|
13
|
-
import "./style.scss";
|
|
14
|
-
var pickerCls = 'triones-antm-picker';
|
|
15
|
-
export var Picker = /*#__PURE__*/React.memo(function (_ref) {
|
|
16
|
-
var open = _ref.open,
|
|
17
|
-
afterOpenChange = _ref.afterOpenChange,
|
|
18
|
-
title = _ref.title,
|
|
19
|
-
columns = _ref.columns,
|
|
20
|
-
_ref$labelInValue = _ref.labelInValue,
|
|
21
|
-
labelInValue = _ref$labelInValue === void 0 ? false : _ref$labelInValue,
|
|
22
|
-
value = _ref.value,
|
|
23
|
-
onOk = _ref.onOk,
|
|
24
|
-
onCancel = _ref.onCancel,
|
|
25
|
-
onClose = _ref.onClose;
|
|
26
|
-
var _ConfigProvider$useCo = ConfigProvider.useConfig(),
|
|
27
|
-
locale = _ConfigProvider$useCo.locale;
|
|
28
|
-
var _useState = useState(value || Array.from({
|
|
29
|
-
length: size(columns)
|
|
30
|
-
}).map(function () {
|
|
31
|
-
return null;
|
|
32
|
-
})),
|
|
33
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
34
|
-
internalValue = _useState2[0],
|
|
35
|
-
setInternalValue = _useState2[1];
|
|
36
|
-
var _React$useState = React.useState(open || false),
|
|
37
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
38
|
-
innerOpen = _React$useState2[0],
|
|
39
|
-
setInnerOpen = _React$useState2[1];
|
|
40
|
-
var handleClose = function handleClose() {
|
|
41
|
-
setInnerOpen(false);
|
|
42
|
-
onClose === null || onClose === void 0 || onClose();
|
|
43
|
-
};
|
|
44
|
-
var handleOk = function handleOk() {
|
|
45
|
-
onOk === null || onOk === void 0 || onOk(internalValue);
|
|
46
|
-
handleClose();
|
|
47
|
-
};
|
|
48
|
-
var handelCancel = function handelCancel() {
|
|
49
|
-
onCancel === null || onCancel === void 0 || onCancel();
|
|
50
|
-
handleClose();
|
|
51
|
-
};
|
|
52
|
-
useEffect(function () {
|
|
53
|
-
afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(innerOpen);
|
|
54
|
-
}, [innerOpen]);
|
|
55
|
-
useEffect(function () {
|
|
56
|
-
if (open === undefined) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
if (open === innerOpen) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
setInnerOpen(open);
|
|
63
|
-
}, [open]);
|
|
64
|
-
return /*#__PURE__*/React.createElement(Popup, {
|
|
65
|
-
open: innerOpen,
|
|
66
|
-
onClose: function onClose() {
|
|
67
|
-
setInnerOpen(false);
|
|
68
|
-
},
|
|
69
|
-
styles: {
|
|
70
|
-
body: {
|
|
71
|
-
borderTopLeftRadius: 6,
|
|
72
|
-
borderTopRightRadius: 6
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
76
|
-
className: classNames(pickerCls)
|
|
77
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
className: classNames("".concat(pickerCls, "-header"))
|
|
79
|
-
}, /*#__PURE__*/React.createElement("a", {
|
|
80
|
-
className: classNames("".concat(pickerCls, "-header-button")),
|
|
81
|
-
onClick: handelCancel
|
|
82
|
-
}, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
|
|
83
|
-
className: classNames("".concat(pickerCls, "-header-title"))
|
|
84
|
-
}, title), /*#__PURE__*/React.createElement("a", {
|
|
85
|
-
className: classNames("".concat(pickerCls, "-header-button"), "".concat(pickerCls, "-header-button-ok")),
|
|
86
|
-
onClick: handleOk
|
|
87
|
-
}, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
className: classNames("".concat(pickerCls, "-body"))
|
|
89
|
-
}, /*#__PURE__*/React.createElement(PickerView, {
|
|
90
|
-
columns: columns,
|
|
91
|
-
labelInValue: labelInValue,
|
|
92
|
-
value: internalValue,
|
|
93
|
-
onChange: function onChange(v) {
|
|
94
|
-
setInternalValue(v);
|
|
95
|
-
}
|
|
96
|
-
}))));
|
|
97
|
-
});
|
package/dist/Picker/style.scss
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
@use "../style/variable" as *;
|
|
2
|
-
$pickerCls: 'triones-antm-picker';
|
|
3
|
-
|
|
4
|
-
.#{$pickerCls} {
|
|
5
|
-
width: 100%;
|
|
6
|
-
height: 300Px;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
position: relative;
|
|
9
|
-
display: flex;
|
|
10
|
-
flex-direction: column;
|
|
11
|
-
|
|
12
|
-
&-header {
|
|
13
|
-
display: flex;
|
|
14
|
-
justify-content: space-between;
|
|
15
|
-
align-items: center;
|
|
16
|
-
border-bottom: 1Px solid #eee;
|
|
17
|
-
padding: 4Px;
|
|
18
|
-
|
|
19
|
-
&-button {
|
|
20
|
-
padding: 8Px;
|
|
21
|
-
font-size: 12Px;
|
|
22
|
-
&-ok{
|
|
23
|
-
color: $trionesColorPrimary;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
&-title {
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
&-body {
|
|
32
|
-
flex: 1 1;
|
|
33
|
-
width: 100%;
|
|
34
|
-
height: 100%;
|
|
35
|
-
pointer-events: unset;
|
|
36
|
-
}
|
|
37
|
-
&-view{
|
|
38
|
-
--height: 100%;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
}
|
package/dist/PickerView/index.js
DELETED