@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,11 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
import React from "react";
|
|
3
|
-
var pickerViewCls = "triones-antm-picker-view";
|
|
4
|
-
export var PickerViewColumnItem = function PickerViewColumnItem(_ref) {
|
|
5
|
-
var option = _ref.option;
|
|
6
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
className: classNames("".concat(pickerViewCls, "-column-item"))
|
|
8
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
9
|
-
className: "".concat(pickerViewCls, "-column-item-label")
|
|
10
|
-
}, option.label));
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FC } from "react";
|
|
2
|
-
import { PickerColumnOption } from "./types";
|
|
3
|
-
type PickerViewColumnProps = {
|
|
4
|
-
options?: PickerColumnOption[];
|
|
5
|
-
labelInValue?: boolean;
|
|
6
|
-
value?: any;
|
|
7
|
-
onChange?: (value: any, index?: number) => void;
|
|
8
|
-
};
|
|
9
|
-
export declare const PickerViewColumn: FC<PickerViewColumnProps>;
|
|
10
|
-
export {};
|
|
@@ -1,117 +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, useState } from "react";
|
|
8
|
-
import classNames from "classnames";
|
|
9
|
-
import { PickerViewColumnItem } from "./picker-view-column-item";
|
|
10
|
-
import { findIndex, isEmpty, size } from "lodash-es";
|
|
11
|
-
var pickerViewCls = "triones-antm-picker-view";
|
|
12
|
-
export var PickerViewColumn = /*#__PURE__*/React.memo(function (_ref) {
|
|
13
|
-
var options = _ref.options,
|
|
14
|
-
labelInValue = _ref.labelInValue,
|
|
15
|
-
value = _ref.value,
|
|
16
|
-
onChange = _ref.onChange;
|
|
17
|
-
var _useState = useState(value || null),
|
|
18
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
-
internalValue = _useState2[0],
|
|
20
|
-
setInternalValue = _useState2[1];
|
|
21
|
-
var itemHeight = 34;
|
|
22
|
-
var max = 0;
|
|
23
|
-
var min = 0 - itemHeight * (size(options) - 1);
|
|
24
|
-
var _useState3 = useState(false),
|
|
25
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
26
|
-
touching = _useState4[0],
|
|
27
|
-
setTouching = _useState4[1];
|
|
28
|
-
var _React$useState = React.useState(),
|
|
29
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
30
|
-
touchPoint = _React$useState2[0],
|
|
31
|
-
setTouchPoint = _React$useState2[1];
|
|
32
|
-
var _useState5 = useState(0),
|
|
33
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
34
|
-
translateY = _useState6[0],
|
|
35
|
-
setTranslateY = _useState6[1];
|
|
36
|
-
var handleSelectOption = function handleSelectOption(selectValue) {
|
|
37
|
-
var valueIndex = findIndex(options, function (option) {
|
|
38
|
-
if (labelInValue) {
|
|
39
|
-
return option.value === selectValue.value;
|
|
40
|
-
}
|
|
41
|
-
return option.value === selectValue;
|
|
42
|
-
});
|
|
43
|
-
setTranslateY(0 - valueIndex * itemHeight);
|
|
44
|
-
};
|
|
45
|
-
useEffect(function () {
|
|
46
|
-
if (value === undefined) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
if (value === internalValue) {
|
|
50
|
-
return;
|
|
51
|
-
}
|
|
52
|
-
setInternalValue(value);
|
|
53
|
-
handleSelectOption(value);
|
|
54
|
-
}, [value]);
|
|
55
|
-
useEffect(function () {
|
|
56
|
-
if (!value) {
|
|
57
|
-
var selectValue = labelInValue ? options === null || options === void 0 ? void 0 : options[0] : options === null || options === void 0 ? void 0 : options[0].value;
|
|
58
|
-
setInternalValue(selectValue || null);
|
|
59
|
-
onChange === null || onChange === void 0 || onChange(selectValue || null);
|
|
60
|
-
handleSelectOption(selectValue);
|
|
61
|
-
} else {
|
|
62
|
-
handleSelectOption(value);
|
|
63
|
-
}
|
|
64
|
-
}, [options]);
|
|
65
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
66
|
-
className: classNames("".concat(pickerViewCls, "-column"))
|
|
67
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: classNames("".concat(pickerViewCls, "-column-wheel")),
|
|
69
|
-
style: {
|
|
70
|
-
transform: "translate3d(0, ".concat(translateY, "px, 0)")
|
|
71
|
-
},
|
|
72
|
-
onTouchStart: function onTouchStart(event) {
|
|
73
|
-
setTouching(true);
|
|
74
|
-
var startPoint = {
|
|
75
|
-
clientX: event.touches[0].clientX,
|
|
76
|
-
clientY: event.touches[0].clientY
|
|
77
|
-
};
|
|
78
|
-
setTouchPoint(startPoint);
|
|
79
|
-
},
|
|
80
|
-
onTouchMove: function onTouchMove(event) {
|
|
81
|
-
if (touching) {
|
|
82
|
-
var movePoint = {
|
|
83
|
-
clientX: event.touches[0].clientX,
|
|
84
|
-
clientY: event.touches[0].clientY
|
|
85
|
-
};
|
|
86
|
-
if (translateY > max || translateY < min) {
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
setTranslateY(translateY + (movePoint.clientY - touchPoint.clientY));
|
|
90
|
-
setTouchPoint(movePoint);
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
onTouchEnd: function onTouchEnd(event) {
|
|
94
|
-
setTouching(false);
|
|
95
|
-
var selectIndex = 0;
|
|
96
|
-
if (translateY > 0) {
|
|
97
|
-
setTranslateY(0);
|
|
98
|
-
selectIndex = 0;
|
|
99
|
-
} else if (translateY < 0 - itemHeight * (size(options) - 1)) {
|
|
100
|
-
setTranslateY(0 - itemHeight * (size(options) - 1));
|
|
101
|
-
selectIndex = size(options) - 1;
|
|
102
|
-
} else {
|
|
103
|
-
var num = Math.abs(Math.round(translateY / itemHeight));
|
|
104
|
-
setTranslateY(0 - num * itemHeight);
|
|
105
|
-
selectIndex = num;
|
|
106
|
-
}
|
|
107
|
-
var selectValue = labelInValue ? options === null || options === void 0 ? void 0 : options[selectIndex] : options === null || options === void 0 ? void 0 : options[selectIndex].value;
|
|
108
|
-
setInternalValue(selectValue);
|
|
109
|
-
onChange === null || onChange === void 0 || onChange(selectValue);
|
|
110
|
-
}
|
|
111
|
-
}, !isEmpty(options) && (options === null || options === void 0 ? void 0 : options.map(function (option, index) {
|
|
112
|
-
return /*#__PURE__*/React.createElement(PickerViewColumnItem, {
|
|
113
|
-
option: option,
|
|
114
|
-
key: "view-column-".concat(index)
|
|
115
|
-
});
|
|
116
|
-
}))));
|
|
117
|
-
});
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React, { FC } from "react";
|
|
2
|
-
import { PickerColumnOption } from "./types";
|
|
3
|
-
import "./style.scss";
|
|
4
|
-
export type PickerViewProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
columns?: PickerColumnOption[][];
|
|
8
|
-
labelInValue?: boolean;
|
|
9
|
-
value?: any[];
|
|
10
|
-
onChange?: (value: any[]) => void;
|
|
11
|
-
};
|
|
12
|
-
export declare const PickerView: FC<PickerViewProps>;
|
|
@@ -1,60 +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 { isEmpty, size } from "lodash-es";
|
|
9
|
-
import { PickerViewColumn } from "./picker-view-column";
|
|
10
|
-
import React, { useEffect, useState } from "react";
|
|
11
|
-
import "./style.scss";
|
|
12
|
-
var pickerViewCls = "triones-antm-picker-view";
|
|
13
|
-
export var PickerView = /*#__PURE__*/React.memo(function (_ref) {
|
|
14
|
-
var className = _ref.className,
|
|
15
|
-
style = _ref.style,
|
|
16
|
-
columns = _ref.columns,
|
|
17
|
-
labelInValue = _ref.labelInValue,
|
|
18
|
-
value = _ref.value,
|
|
19
|
-
_onChange = _ref.onChange;
|
|
20
|
-
var _useState = useState(value || Array.from({
|
|
21
|
-
length: size(columns)
|
|
22
|
-
}).map(function () {
|
|
23
|
-
return null;
|
|
24
|
-
})),
|
|
25
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
26
|
-
internalValue = _useState2[0],
|
|
27
|
-
setInternalValue = _useState2[1];
|
|
28
|
-
useEffect(function () {
|
|
29
|
-
if (value === undefined) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (value === internalValue) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
setInternalValue(value);
|
|
36
|
-
}, [value]);
|
|
37
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
38
|
-
className: classNames("".concat(pickerViewCls), className),
|
|
39
|
-
style: style
|
|
40
|
-
}, !isEmpty(columns) && (columns === null || columns === void 0 ? void 0 : columns.map(function (column, index) {
|
|
41
|
-
return /*#__PURE__*/React.createElement(PickerViewColumn, {
|
|
42
|
-
key: "column-".concat(index),
|
|
43
|
-
labelInValue: labelInValue,
|
|
44
|
-
options: column,
|
|
45
|
-
value: value === null || value === void 0 ? void 0 : value[index],
|
|
46
|
-
onChange: function onChange(v) {
|
|
47
|
-
internalValue[index] = v;
|
|
48
|
-
_onChange === null || _onChange === void 0 || _onChange(internalValue);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: classNames("".concat(pickerViewCls, "-mask"))
|
|
53
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
54
|
-
className: classNames("".concat(pickerViewCls, "-mask-top"))
|
|
55
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
56
|
-
className: classNames("".concat(pickerViewCls, "-mask-middle"))
|
|
57
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
58
|
-
className: classNames("".concat(pickerViewCls, "-mask-bottom"))
|
|
59
|
-
})));
|
|
60
|
-
});
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
$pickerViewCls: 'triones-antm-picker-view';
|
|
2
|
-
.#{$pickerViewCls} {
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: var(--height,240Px);
|
|
5
|
-
display: flex;
|
|
6
|
-
position: relative;
|
|
7
|
-
overflow: hidden;
|
|
8
|
-
--item-height: 34Px;
|
|
9
|
-
--item-font-size: 16Px;
|
|
10
|
-
|
|
11
|
-
&-column {
|
|
12
|
-
height: 100%;
|
|
13
|
-
flex: 1 1;
|
|
14
|
-
user-select: none;
|
|
15
|
-
touch-action: none;
|
|
16
|
-
position: relative;
|
|
17
|
-
z-index: 0;
|
|
18
|
-
&-wheel{
|
|
19
|
-
width: 100%;
|
|
20
|
-
cursor: grab;
|
|
21
|
-
position: absolute;
|
|
22
|
-
top: calc(50% - var(--item-height)/2);
|
|
23
|
-
left: 0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
&-item {
|
|
27
|
-
font-size: var(--item-font-size);
|
|
28
|
-
padding: 0 6px;
|
|
29
|
-
height: var(--item-height);
|
|
30
|
-
display: flex;
|
|
31
|
-
justify-content: center;
|
|
32
|
-
align-items: center;
|
|
33
|
-
&-label{
|
|
34
|
-
overflow: hidden;
|
|
35
|
-
text-overflow: ellipsis;
|
|
36
|
-
white-space: nowrap;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&-mask {
|
|
42
|
-
position: absolute;
|
|
43
|
-
z-index: 10000;
|
|
44
|
-
left: 0;
|
|
45
|
-
top: 0;
|
|
46
|
-
width: 100%;
|
|
47
|
-
height: 100%;
|
|
48
|
-
display: flex;
|
|
49
|
-
flex-direction: column;
|
|
50
|
-
pointer-events: none;
|
|
51
|
-
|
|
52
|
-
&-top {
|
|
53
|
-
background-color: white;
|
|
54
|
-
flex: auto;
|
|
55
|
-
mask: linear-gradient(0deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .8) 50%, #000);
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
&-middle {
|
|
59
|
-
height: var(--item-height);
|
|
60
|
-
box-sizing: border-box;
|
|
61
|
-
flex: none;
|
|
62
|
-
border-top: 1px solid #eee;
|
|
63
|
-
border-bottom: 1px solid #eee;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
&-bottom {
|
|
67
|
-
background-color: white;
|
|
68
|
-
flex: auto;
|
|
69
|
-
mask: linear-gradient(180deg, rgba(0, 0, 0, .6), rgba(0, 0, 0, .8) 50%, #000);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
package/dist/Popup/index.d.ts
DELETED
package/dist/Popup/index.js
DELETED
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, FC, PropsWithChildren } from 'react';
|
|
2
|
-
import './style.scss';
|
|
3
|
-
export type Position = 'top' | 'bottom' | 'left' | 'right';
|
|
4
|
-
export type PopupModalProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
/**
|
|
7
|
-
* @description 样式
|
|
8
|
-
* @default horizontal
|
|
9
|
-
*/
|
|
10
|
-
styles?: {
|
|
11
|
-
body?: CSSProperties;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* @description Modal 完全关闭后的回调
|
|
15
|
-
* @default
|
|
16
|
-
*/
|
|
17
|
-
afterClose?: () => void;
|
|
18
|
-
/**
|
|
19
|
-
* @description 是否打开
|
|
20
|
-
* @default false
|
|
21
|
-
*/
|
|
22
|
-
open?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* @description 打开位置
|
|
25
|
-
* @default bottom
|
|
26
|
-
*/
|
|
27
|
-
position?: Position;
|
|
28
|
-
/**
|
|
29
|
-
* @description 是否可以关闭(显示关闭按钮)
|
|
30
|
-
* @default false
|
|
31
|
-
*/
|
|
32
|
-
closable?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @description 是否蒙层关闭
|
|
35
|
-
* @default true
|
|
36
|
-
*/
|
|
37
|
-
maskClosable?: boolean;
|
|
38
|
-
onMaskClick?: () => void;
|
|
39
|
-
/**
|
|
40
|
-
* @description 关闭时销毁 Modal 里的子元素
|
|
41
|
-
* @default false
|
|
42
|
-
*/
|
|
43
|
-
destroyOnClose?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* @description 设置 Modal 的 z-index
|
|
46
|
-
* @default 1000
|
|
47
|
-
*/
|
|
48
|
-
zIndex?: number;
|
|
49
|
-
onClose?: () => void;
|
|
50
|
-
onDestroy?: () => void;
|
|
51
|
-
};
|
|
52
|
-
export declare const PopupModal: FC<PropsWithChildren<PopupModalProps>>;
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import React, { memo, useMemo } from 'react';
|
|
3
|
-
import SafeArea from "../SafeArea";
|
|
4
|
-
import "./style.scss";
|
|
5
|
-
import { CloseOutline } from "@trionesdev/antd-mobile-icons-react";
|
|
6
|
-
var popupCls = 'triones-antm-popup';
|
|
7
|
-
export var PopupModal = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
-
var children = _ref.children,
|
|
9
|
-
styles = _ref.styles,
|
|
10
|
-
afterClose = _ref.afterClose,
|
|
11
|
-
_ref$open = _ref.open,
|
|
12
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
13
|
-
_ref$position = _ref.position,
|
|
14
|
-
position = _ref$position === void 0 ? 'bottom' : _ref$position,
|
|
15
|
-
_ref$closable = _ref.closable,
|
|
16
|
-
closable = _ref$closable === void 0 ? false : _ref$closable,
|
|
17
|
-
_ref$maskClosable = _ref.maskClosable,
|
|
18
|
-
maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
|
|
19
|
-
onMaskClick = _ref.onMaskClick,
|
|
20
|
-
_ref$destroyOnClose = _ref.destroyOnClose,
|
|
21
|
-
destroyOnClose = _ref$destroyOnClose === void 0 ? false : _ref$destroyOnClose,
|
|
22
|
-
_ref$zIndex = _ref.zIndex,
|
|
23
|
-
zIndex = _ref$zIndex === void 0 ? 1000 : _ref$zIndex,
|
|
24
|
-
onClose = _ref.onClose,
|
|
25
|
-
onDestroy = _ref.onDestroy;
|
|
26
|
-
var safeAreaPosition = useMemo(function () {
|
|
27
|
-
if (position === 'bottom') {
|
|
28
|
-
return 'bottom';
|
|
29
|
-
} else if (position === 'top') {
|
|
30
|
-
return 'top';
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
33
|
-
}, [position]);
|
|
34
|
-
var handleClose = function handleClose() {
|
|
35
|
-
onClose === null || onClose === void 0 || onClose();
|
|
36
|
-
afterClose === null || afterClose === void 0 || afterClose();
|
|
37
|
-
if (destroyOnClose) {
|
|
38
|
-
onDestroy === null || onDestroy === void 0 || onDestroy();
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
42
|
-
className: classNames(popupCls),
|
|
43
|
-
style: {
|
|
44
|
-
zIndex: zIndex,
|
|
45
|
-
display: open ? 'block' : 'none'
|
|
46
|
-
},
|
|
47
|
-
onClick: function onClick(e) {
|
|
48
|
-
e.stopPropagation();
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
}
|
|
51
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
52
|
-
className: classNames("".concat(popupCls, "-mask")),
|
|
53
|
-
onClick: function onClick() {
|
|
54
|
-
if (maskClosable) {
|
|
55
|
-
onMaskClick === null || onMaskClick === void 0 || onMaskClick();
|
|
56
|
-
handleClose();
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
60
|
-
className: classNames("".concat(popupCls, "-body"), "".concat(popupCls, "-").concat(position)),
|
|
61
|
-
style: styles === null || styles === void 0 ? void 0 : styles.body,
|
|
62
|
-
onClick: function onClick(e) {
|
|
63
|
-
e.stopPropagation();
|
|
64
|
-
e.preventDefault();
|
|
65
|
-
}
|
|
66
|
-
}, closable && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CloseOutline, {
|
|
67
|
-
className: classNames("".concat(popupCls, "-close")),
|
|
68
|
-
onClick: function onClick() {
|
|
69
|
-
handleClose();
|
|
70
|
-
}
|
|
71
|
-
})), /*#__PURE__*/React.createElement(SafeArea, {
|
|
72
|
-
position: safeAreaPosition
|
|
73
|
-
}, children)));
|
|
74
|
-
});
|
package/dist/Popup/popup.d.ts
DELETED
package/dist/Popup/popup.js
DELETED
|
@@ -1,56 +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, { memo } from 'react';
|
|
6
|
-
import { PopupModal } from "./popup-modal";
|
|
7
|
-
export var Popup = /*#__PURE__*/memo(function (_ref) {
|
|
8
|
-
var children = _ref.children,
|
|
9
|
-
_ref$open = _ref.open,
|
|
10
|
-
open = _ref$open === void 0 ? false : _ref$open,
|
|
11
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
12
|
-
// const [renderEnable, setRenderEnable] = React.useState(false);
|
|
13
|
-
// const containerRef = React.useRef<HTMLDivElement>(null);
|
|
14
|
-
// const mountRef = React.useRef<HTMLDivElement | null>(null);
|
|
15
|
-
// const rootContainer = getContainer?.() || containerRef.current!;
|
|
16
|
-
//
|
|
17
|
-
// const Portal = () => {
|
|
18
|
-
// if (!mountRef.current) {
|
|
19
|
-
// mountRef.current = document.createElement('div');
|
|
20
|
-
// rootContainer.appendChild(mountRef.current);
|
|
21
|
-
// }
|
|
22
|
-
//
|
|
23
|
-
// const destroy = () => {
|
|
24
|
-
// if (rootContainer && mountRef.current) {
|
|
25
|
-
// rootContainer.removeChild(mountRef.current);
|
|
26
|
-
// }
|
|
27
|
-
// mountRef.current = null;
|
|
28
|
-
// setRenderEnable(false);
|
|
29
|
-
// };
|
|
30
|
-
//
|
|
31
|
-
// return (
|
|
32
|
-
// <>
|
|
33
|
-
// {createPortal(
|
|
34
|
-
// <PopupModal {...rest} onDestroy={destroy} open={open}>
|
|
35
|
-
// {children}
|
|
36
|
-
// </PopupModal>,
|
|
37
|
-
// mountRef.current!,
|
|
38
|
-
// )}
|
|
39
|
-
// </>
|
|
40
|
-
// );
|
|
41
|
-
// };
|
|
42
|
-
|
|
43
|
-
// useEffect(() => {
|
|
44
|
-
// if (open && !renderEnable) {
|
|
45
|
-
// setRenderEnable(true);
|
|
46
|
-
// }
|
|
47
|
-
// // rest.afterOpenChange?.(open);
|
|
48
|
-
// }, [open]);
|
|
49
|
-
|
|
50
|
-
if (!open) {
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
return /*#__PURE__*/React.createElement(PopupModal, _extends({}, rest, {
|
|
54
|
-
open: open
|
|
55
|
-
}), children);
|
|
56
|
-
});
|
package/dist/Popup/style.scss
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
@use "../style/variable" as *;
|
|
2
|
-
$popupCls: 'triones-antm-popup';
|
|
3
|
-
|
|
4
|
-
.#{$popupCls} {
|
|
5
|
-
position: fixed;
|
|
6
|
-
top: 0;
|
|
7
|
-
left: 0;
|
|
8
|
-
right: 0;
|
|
9
|
-
bottom: 0;
|
|
10
|
-
|
|
11
|
-
&-mask {
|
|
12
|
-
height: 100%;
|
|
13
|
-
width: 100%;
|
|
14
|
-
background-color: rgba(0, 0, 0, .55);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
&-close {
|
|
18
|
-
position: absolute;
|
|
19
|
-
right: 10Px;
|
|
20
|
-
top: 10Px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&-body {
|
|
24
|
-
background-color: white;
|
|
25
|
-
position: fixed;
|
|
26
|
-
border-top-left-radius: $trionesBorderRadius;
|
|
27
|
-
border-top-right-radius: $trionesBorderRadius;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&-top {
|
|
31
|
-
top: 0;
|
|
32
|
-
left: 0;
|
|
33
|
-
right: 0;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&-bottom {
|
|
37
|
-
bottom: 0;
|
|
38
|
-
left: 0;
|
|
39
|
-
right: 0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&-left {
|
|
43
|
-
left: 0;
|
|
44
|
-
top: 0;
|
|
45
|
-
bottom: 0;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
&-right {
|
|
49
|
-
right: 0;
|
|
50
|
-
top: 0;
|
|
51
|
-
bottom: 0;
|
|
52
|
-
}
|
|
53
|
-
}
|
package/dist/ScrollView/index.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
4
|
-
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
5
|
-
import classNames from 'classnames';
|
|
6
|
-
import React, { forwardRef, useEffect, useRef } from 'react';
|
|
7
|
-
import "./style.scss";
|
|
8
|
-
export var ScrollView = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9
|
-
var className = _ref.className,
|
|
10
|
-
style = _ref.style,
|
|
11
|
-
children = _ref.children,
|
|
12
|
-
_onScroll = _ref.onScroll,
|
|
13
|
-
_ref$showScrollbar = _ref.showScrollbar,
|
|
14
|
-
showScrollbar = _ref$showScrollbar === void 0 ? true : _ref$showScrollbar,
|
|
15
|
-
scrollX = _ref.scrollX,
|
|
16
|
-
scrollY = _ref.scrollY,
|
|
17
|
-
scrollTop = _ref.scrollTop,
|
|
18
|
-
_ref$upperThreshold = _ref.upperThreshold,
|
|
19
|
-
upperThreshold = _ref$upperThreshold === void 0 ? 50 : _ref$upperThreshold,
|
|
20
|
-
_ref$lowerThreshold = _ref.lowerThreshold,
|
|
21
|
-
lowerThreshold = _ref$lowerThreshold === void 0 ? 50 : _ref$lowerThreshold,
|
|
22
|
-
onScrollToUpper = _ref.onScrollToUpper,
|
|
23
|
-
onScrollToLower = _ref.onScrollToLower;
|
|
24
|
-
var scrollRef = useRef();
|
|
25
|
-
var handleRef = function handleRef(node) {
|
|
26
|
-
scrollRef.current = node;
|
|
27
|
-
if (ref) {
|
|
28
|
-
if (typeof ref === 'function') {
|
|
29
|
-
ref(node);
|
|
30
|
-
} else {
|
|
31
|
-
ref.current = node;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
useEffect(function () {
|
|
36
|
-
if (scrollTop !== undefined) {}
|
|
37
|
-
}, [scrollTop]);
|
|
38
|
-
var trionesScrollViewCls = 'triones-antm-scroll-view';
|
|
39
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
40
|
-
ref: handleRef,
|
|
41
|
-
className: classNames("".concat(trionesScrollViewCls), className, _defineProperty(_defineProperty(_defineProperty({}, "".concat(trionesScrollViewCls, "-scroll-x"), scrollX), "".concat(trionesScrollViewCls, "-scroll-y"), scrollY), "".concat(trionesScrollViewCls, "-scroll-bar-hidden"), !showScrollbar)),
|
|
42
|
-
style: style,
|
|
43
|
-
onScroll: function onScroll(e) {
|
|
44
|
-
// console.log(e);
|
|
45
|
-
_onScroll === null || _onScroll === void 0 || _onScroll({
|
|
46
|
-
detail: {
|
|
47
|
-
scrollLeft: e.target.scrollLeft,
|
|
48
|
-
scrollTop: e.target.scrollTop,
|
|
49
|
-
scrollHeight: e.target.scrollHeight,
|
|
50
|
-
scrollWidth: e.target.scrollWidth
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
}, children);
|
|
55
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
$trionesScrollViewCls: 'triones-antm-scroll-view';
|
|
2
|
-
|
|
3
|
-
.#{$trionesScrollViewCls} {
|
|
4
|
-
scrollbar-width: thin;
|
|
5
|
-
|
|
6
|
-
&-scroll-x {
|
|
7
|
-
overflow-x: auto;
|
|
8
|
-
overflow-y: hidden;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
&-scroll-y {
|
|
12
|
-
overflow-x: hidden;
|
|
13
|
-
overflow-y: auto;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
&-scroll-bar-hidden {
|
|
17
|
-
scrollbar-width: none;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
export type ScrollEvent = {
|
|
3
|
-
target?: any;
|
|
4
|
-
detail: {
|
|
5
|
-
deltaX?: number;
|
|
6
|
-
deltaY?: number;
|
|
7
|
-
scrollLeft?: number;
|
|
8
|
-
scrollTop?: number;
|
|
9
|
-
scrollHeight?: number;
|
|
10
|
-
scrollWidth?: number;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
export type ScrollViewProps = {
|
|
14
|
-
className?: string;
|
|
15
|
-
style?: React.CSSProperties;
|
|
16
|
-
children?: ReactNode;
|
|
17
|
-
onScroll?: (e: ScrollEvent) => void;
|
|
18
|
-
showScrollbar?: boolean;
|
|
19
|
-
scrollX?: boolean;
|
|
20
|
-
scrollY?: boolean;
|
|
21
|
-
scrollTop?: number;
|
|
22
|
-
upperThreshold?: number;
|
|
23
|
-
lowerThreshold?: number;
|
|
24
|
-
onScrollToUpper?: () => void;
|
|
25
|
-
onScrollToLower?: () => void;
|
|
26
|
-
};
|
package/dist/ScrollView/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|