@trionesdev/antd-taro-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.
Files changed (175) hide show
  1. package/dist/ActionSheet/ActionSheet.d.ts +25 -0
  2. package/dist/ActionSheet/ActionSheet.js +77 -0
  3. package/dist/ActionSheet/index.d.ts +1 -1
  4. package/dist/ActionSheet/index.js +1 -1
  5. package/dist/ActionSheet/style.scss +52 -0
  6. package/dist/Button/button.d.ts +2 -1
  7. package/dist/Button/button.js +2 -3
  8. package/dist/Button/style.scss +65 -50
  9. package/dist/Calendar/calendar-grid.d.ts +10 -9
  10. package/dist/Calendar/calendar-grid.js +37 -62
  11. package/dist/Calendar/calendar-header.d.ts +3 -2
  12. package/dist/Calendar/calendar-header.js +9 -6
  13. package/dist/Calendar/calendar-range.d.ts +4 -3
  14. package/dist/Calendar/calendar-range.js +22 -18
  15. package/dist/Calendar/calendar.d.ts +5 -4
  16. package/dist/Calendar/calendar.js +30 -17
  17. package/dist/Calendar/style.scss +8 -5
  18. package/dist/Calendar/touchable-calendar-grid.d.ts +6 -5
  19. package/dist/Calendar/touchable-calendar-grid.js +87 -86
  20. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +3 -2
  21. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +40 -57
  22. package/dist/CalendarDatetimePicker/DateTimeSwitch.d.ts +3 -2
  23. package/dist/CalendarDatetimePicker/DateTimeSwitch.js +2 -2
  24. package/dist/CalendarDatetimePicker/style.scss +11 -3
  25. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.d.ts +9 -0
  26. package/dist/CalendarDatetimePickerCell/CalendarDatetimePickerCell.js +60 -0
  27. package/dist/CalendarDatetimePickerCell/index.d.ts +3 -0
  28. package/dist/CalendarDatetimePickerCell/index.js +2 -0
  29. package/dist/CalendarPicker/{calendar-picker.js → CalendarPicker.js} +10 -6
  30. package/dist/CalendarPicker/{calendar-range-picker.js → CalendarRangePicker.js} +8 -6
  31. package/dist/CalendarPicker/index.d.ts +3 -4
  32. package/dist/CalendarPicker/index.js +2 -2
  33. package/dist/CalendarPicker/style.scss +7 -6
  34. package/dist/CalendarPicker/types.d.ts +8 -6
  35. package/dist/CalendarPicker/types.js +1 -1
  36. package/dist/CalendarPickerCell/CalendarPickerCell.d.ts +11 -0
  37. package/dist/CalendarPickerCell/CalendarPickerCell.js +54 -0
  38. package/dist/CalendarPickerCell/CalendarRangePickerCell.d.ts +11 -0
  39. package/dist/CalendarPickerCell/CalendarRangePickerCell.js +56 -0
  40. package/dist/CalendarPickerCell/index.d.ts +8 -0
  41. package/dist/CalendarPickerCell/index.js +5 -0
  42. package/dist/CascaderPicker/cascader-picker.d.ts +27 -0
  43. package/dist/CascaderPicker/cascader-picker.js +90 -0
  44. package/dist/CascaderPicker/index.d.ts +1 -1
  45. package/dist/CascaderPicker/index.js +1 -1
  46. package/dist/CascaderPicker/style.scss +45 -0
  47. package/dist/CascaderPickerCell/CascaderPickerCell.d.ts +20 -0
  48. package/dist/CascaderPickerCell/CascaderPickerCell.js +70 -0
  49. package/dist/CascaderPickerCell/index.d.ts +3 -0
  50. package/dist/CascaderPickerCell/index.js +2 -0
  51. package/dist/DatePicker/DatePicker.d.ts +18 -0
  52. package/dist/DatePicker/DatePicker.js +310 -0
  53. package/dist/DatePicker/index.d.ts +4 -0
  54. package/dist/DatePicker/index.js +3 -0
  55. package/dist/DatePicker/style.scss +41 -0
  56. package/dist/DatePicker/types.d.ts +1 -0
  57. package/dist/DatePicker/types.js +1 -0
  58. package/dist/DatePickerCell/DatePickerCell.d.ts +16 -0
  59. package/dist/DatePickerCell/DatePickerCell.js +78 -0
  60. package/dist/DatePickerCell/index.d.ts +3 -0
  61. package/dist/DatePickerCell/index.js +2 -0
  62. package/dist/FetchPicker/FetchPicker.d.ts +78 -0
  63. package/dist/FetchPicker/FetchPicker.js +310 -0
  64. package/dist/FetchPicker/index.d.ts +4 -0
  65. package/dist/FetchPicker/index.js +3 -0
  66. package/dist/FetchPicker/styles.scss +130 -0
  67. package/dist/FloatButton/FloatButton.d.ts +19 -0
  68. package/dist/FloatButton/FloatButton.js +60 -0
  69. package/dist/FloatButton/FloatButtonGroup.d.ts +21 -0
  70. package/dist/FloatButton/FloatButtonGroup.js +141 -0
  71. package/dist/FloatButton/context.d.ts +10 -0
  72. package/dist/FloatButton/context.js +2 -0
  73. package/dist/FloatButton/index.d.ts +10 -0
  74. package/dist/FloatButton/index.js +5 -0
  75. package/dist/FloatButton/style.scss +126 -0
  76. package/dist/Form/FormItem/form-item-content.d.ts +17 -0
  77. package/dist/Form/FormItem/form-item-content.js +39 -0
  78. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  79. package/dist/Form/FormItem/form-item-label.js +29 -0
  80. package/dist/Form/FormItem/form-item.d.ts +23 -0
  81. package/dist/Form/FormItem/form-item.js +77 -0
  82. package/dist/Form/FormItem/index.d.ts +5 -0
  83. package/dist/Form/FormItem/index.js +3 -0
  84. package/dist/Form/index.d.ts +9 -2
  85. package/dist/Form/index.js +5 -1
  86. package/dist/Form/style.scss +100 -0
  87. package/dist/FormCell/index.d.ts +3 -0
  88. package/dist/FormCell/index.js +2 -0
  89. package/dist/ImagesPreview/ImagesPreview.js +4 -3
  90. package/dist/ImagesWall/ImagesWall.js +1 -1
  91. package/dist/Input/index.d.ts +17 -2
  92. package/dist/Input/index.js +13 -1
  93. package/dist/Input/index.scss +282 -0
  94. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  95. package/dist/Input/input-affix-wrapper.js +37 -0
  96. package/dist/Input/input-digit.d.ts +7 -0
  97. package/dist/Input/input-digit.js +53 -0
  98. package/dist/Input/input-number.d.ts +7 -0
  99. package/dist/Input/input-number.js +50 -0
  100. package/dist/Input/input-opt.d.ts +16 -0
  101. package/dist/Input/input-opt.js +87 -0
  102. package/dist/Input/input-password.d.ts +8 -0
  103. package/dist/Input/input-password.js +49 -0
  104. package/dist/Input/input.d.ts +3 -0
  105. package/dist/Input/input.js +7 -0
  106. package/dist/Input/taro-input.d.ts +8 -0
  107. package/dist/Input/taro-input.js +70 -0
  108. package/dist/Input/textarea.d.ts +15 -0
  109. package/dist/Input/textarea.js +52 -0
  110. package/dist/Input/types.d.ts +20 -0
  111. package/dist/Input/types.js +2 -0
  112. package/dist/Loading/index.d.ts +4 -0
  113. package/dist/Loading/index.js +3 -0
  114. package/dist/Overlay/Overlay.d.ts +17 -0
  115. package/dist/Overlay/Overlay.js +100 -0
  116. package/dist/Overlay/index.d.ts +4 -0
  117. package/dist/Overlay/index.js +3 -0
  118. package/dist/Overlay/style.scss +20 -0
  119. package/dist/Picker/Picker.d.ts +27 -0
  120. package/dist/Picker/Picker.js +100 -0
  121. package/dist/Picker/index.d.ts +1 -1
  122. package/dist/Picker/index.js +1 -1
  123. package/dist/Picker/style.scss +41 -0
  124. package/dist/PickerView/PickerView.d.ts +4 -0
  125. package/dist/PickerView/PickerView.js +71 -0
  126. package/dist/PickerView/index.d.ts +2 -2
  127. package/dist/PickerView/index.js +1 -1
  128. package/dist/PickerView/style.scss +13 -0
  129. package/dist/PickerView/types.d.ts +15 -0
  130. package/dist/PickerView/types.js +1 -0
  131. package/dist/Popup/Popup.d.ts +48 -0
  132. package/dist/Popup/Popup.js +135 -0
  133. package/dist/Popup/index.d.ts +2 -1
  134. package/dist/Popup/index.js +2 -1
  135. package/dist/Popup/style.scss +126 -0
  136. package/dist/Progress/index.d.ts +1 -1
  137. package/dist/Progress/index.js +1 -1
  138. package/dist/Segmented/index.d.ts +3 -0
  139. package/dist/Segmented/index.js +2 -0
  140. package/dist/SideBar/side-bar.js +3 -2
  141. package/dist/SideBar/style.scss +6 -6
  142. package/dist/Stepper/index.d.ts +3 -0
  143. package/dist/Stepper/index.js +2 -0
  144. package/dist/Toast/Toast.d.ts +18 -0
  145. package/dist/Toast/Toast.js +112 -0
  146. package/dist/Toast/index.d.ts +1 -1
  147. package/dist/Toast/index.js +1 -1
  148. package/dist/Toast/style.scss +63 -0
  149. package/dist/VerificationCodeInput/index.d.ts +2 -2
  150. package/dist/VerificationCodeInput/index.js +1 -1
  151. package/dist/VerificationCodeInput/style.scss +20 -0
  152. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  153. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  154. package/dist/index.d.ts +28 -7
  155. package/dist/index.js +12 -2
  156. package/dist/style/variable.scss +33 -0
  157. package/dist/types.d.ts +0 -1
  158. package/dist/utils/dayjs.d.ts +4 -0
  159. package/dist/utils/dayjs.js +42 -0
  160. package/package.json +25 -30
  161. package/dist/Mask/index.d.ts +0 -3
  162. package/dist/Mask/index.js +0 -2
  163. package/dist/Progress/Progress.d.ts +0 -38
  164. package/dist/Progress/Progress.js +0 -53
  165. package/dist/Progress/ProgressCircle.d.ts +0 -16
  166. package/dist/Progress/ProgressCircle.js +0 -147
  167. package/dist/Progress/ProgressLine.d.ts +0 -15
  168. package/dist/Progress/ProgressLine.js +0 -87
  169. package/dist/Progress/style.scss +0 -33
  170. package/dist/Progress/types.d.ts +0 -4
  171. package/dist/Progress/types.js +0 -2
  172. package/dist/SpinLoading/index.d.ts +0 -3
  173. package/dist/SpinLoading/index.js +0 -2
  174. /package/dist/CalendarPicker/{calendar-picker.d.ts → CalendarPicker.d.ts} +0 -0
  175. /package/dist/CalendarPicker/{calendar-range-picker.d.ts → CalendarRangePicker.d.ts} +0 -0
@@ -0,0 +1,49 @@
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 { useState } from "react";
12
+ import { TaroInput } from "./taro-input";
13
+ import { EyeInvisibleOutline, EyeOutline } from "@trionesdev/antd-mobile-icons-react";
14
+ import React from "react";
15
+ export var InputPassword = function InputPassword(_ref) {
16
+ var iconRender = _ref.iconRender,
17
+ _ref$visibilityToggle = _ref.visibilityToggle,
18
+ visibilityToggle = _ref$visibilityToggle === void 0 ? true : _ref$visibilityToggle,
19
+ suffix = _ref.suffix,
20
+ rest = _objectWithoutProperties(_ref, _excluded);
21
+ var _useState = useState(false),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ visible = _useState2[0],
24
+ setVisible = _useState2[1];
25
+ var toggleRender = function toggleRender() {
26
+ if (iconRender) {
27
+ return iconRender(visible);
28
+ } else {
29
+ return /*#__PURE__*/React.createElement(React.Fragment, null, visible ? /*#__PURE__*/React.createElement(EyeOutline, {
30
+ onClick: function onClick() {
31
+ return setVisible(false);
32
+ }
33
+ }) : /*#__PURE__*/React.createElement(EyeInvisibleOutline, {
34
+ onClick: function onClick() {
35
+ return setVisible(true);
36
+ }
37
+ }));
38
+ }
39
+ };
40
+ return /*#__PURE__*/React.createElement(TaroInput, _extends({}, rest, {
41
+ password: visible ? false : true,
42
+ suffix: /*#__PURE__*/React.createElement(React.Fragment, null, ' ', visibilityToggle && /*#__PURE__*/React.createElement("div", {
43
+ style: {
44
+ paddingLeft: 4,
45
+ paddingRight: 4
46
+ }
47
+ }, toggleRender()), " ", suffix, ' ')
48
+ }));
49
+ };
@@ -0,0 +1,3 @@
1
+ import { FC } from "react";
2
+ import { InputProps } from "./types";
3
+ export declare const Input: FC<InputProps>;
@@ -0,0 +1,7 @@
1
+ function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
2
+ import { TaroInput } from "./taro-input";
3
+ import React from "react";
4
+ export var Input = function Input(_ref) {
5
+ var rest = Object.assign({}, (_objectDestructuringEmpty(_ref), _ref));
6
+ return /*#__PURE__*/React.createElement(TaroInput, rest);
7
+ };
@@ -0,0 +1,8 @@
1
+ import { InputProps as InternalTaroInputProps } from '@tarojs/components';
2
+ import { FC } from "react";
3
+ import { InputProps } from "./types";
4
+ export type TaroInputProps = Omit<InputProps, 'type'> & {
5
+ type?: keyof InternalTaroInputProps.Type;
6
+ password?: boolean;
7
+ };
8
+ export declare const TaroInput: FC<TaroInputProps>;
@@ -0,0 +1,70 @@
1
+ var _excluded = ["value", "onChange", "type", "size", "align"];
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 { Input as InternalTaroInput } from '@tarojs/components';
12
+ import React, { useEffect, useMemo } from "react";
13
+ import { InputAffixWrapper } from "./input-affix-wrapper";
14
+ export var TaroInput = function TaroInput(_ref) {
15
+ var value = _ref.value,
16
+ onChange = _ref.onChange,
17
+ type = _ref.type,
18
+ _ref$size = _ref.size,
19
+ size = _ref$size === void 0 ? 'middle' : _ref$size,
20
+ _ref$align = _ref.align,
21
+ align = _ref$align === void 0 ? 'start' : _ref$align,
22
+ rest = _objectWithoutProperties(_ref, _excluded);
23
+ var _React$useState = React.useState(value),
24
+ _React$useState2 = _slicedToArray(_React$useState, 2),
25
+ innerValue = _React$useState2[0],
26
+ setInnerValue = _React$useState2[1];
27
+ var textAlign = useMemo(function () {
28
+ switch (align) {
29
+ case 'start':
30
+ return 'left';
31
+ case 'center':
32
+ return 'center';
33
+ case 'end':
34
+ return 'right';
35
+ default:
36
+ return 'left';
37
+ }
38
+ }, [align]);
39
+ useEffect(function () {
40
+ if (value !== innerValue) {
41
+ setInnerValue(value);
42
+ }
43
+ }, [value]);
44
+ return /*#__PURE__*/React.createElement(InputAffixWrapper, _extends({}, rest, {
45
+ className: rest.className,
46
+ style: rest.style,
47
+ prefix: rest.prefix,
48
+ suffix: rest.suffix,
49
+ allowClear: rest.allowClear,
50
+ value: innerValue,
51
+ onClear: function onClear() {
52
+ setInnerValue(null);
53
+ }
54
+ }), /*#__PURE__*/React.createElement(InternalTaroInput, {
55
+ style: {
56
+ flex: 1,
57
+ textAlign: textAlign
58
+ },
59
+ type: type,
60
+ defaultValue: rest.defaultValue,
61
+ value: innerValue,
62
+ placeholder: rest.placeholder,
63
+ password: rest.password,
64
+ disabled: rest.disabled,
65
+ onInput: function onInput(e) {
66
+ setInnerValue(e.target.value);
67
+ onChange === null || onChange === void 0 || onChange(e.target.value);
68
+ }
69
+ }));
70
+ };
@@ -0,0 +1,15 @@
1
+ import React, { FC } from 'react';
2
+ import { variantType } from './types';
3
+ export type InputTextareaProps = {
4
+ className?: string;
5
+ style?: React.CSSProperties;
6
+ variant?: variantType;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ allowClear?: boolean;
10
+ rows?: number;
11
+ value?: any;
12
+ defaultValue?: any;
13
+ onChange?: (e: any) => void;
14
+ };
15
+ export declare const Textarea: FC<InputTextareaProps>;
@@ -0,0 +1,52 @@
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
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
6
+ 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."); }
7
+ 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); }
8
+ 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; }
9
+ 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; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import React, { useEffect } from 'react';
12
+ import { Textarea as TaroTextarea } from "@tarojs/components";
13
+ import { inputCls } from "./types";
14
+ import classNames from 'classnames';
15
+ export var Textarea = function Textarea(_ref) {
16
+ var className = _ref.className,
17
+ style = _ref.style,
18
+ variant = _ref.variant,
19
+ placeholder = _ref.placeholder,
20
+ disabled = _ref.disabled,
21
+ allowClear = _ref.allowClear,
22
+ rows = _ref.rows,
23
+ value = _ref.value,
24
+ defaultValue = _ref.defaultValue,
25
+ onChange = _ref.onChange;
26
+ var _React$useState = React.useState(value),
27
+ _React$useState2 = _slicedToArray(_React$useState, 2),
28
+ internalValue = _React$useState2[0],
29
+ setInternalValue = _React$useState2[1];
30
+ useEffect(function () {
31
+ if (value === undefined) {
32
+ return;
33
+ }
34
+ if (value === internalValue) {
35
+ return;
36
+ }
37
+ setInternalValue(value);
38
+ }, [value]);
39
+ return /*#__PURE__*/React.createElement("div", {
40
+ className: classNames("".concat(inputCls, "-textarea"), _defineProperty({}, "".concat(inputCls, "-").concat(variant), variant), className),
41
+ style: style
42
+ }, /*#__PURE__*/React.createElement(TaroTextarea, {
43
+ placeholder: placeholder,
44
+ disabled: disabled,
45
+ defaultValue: defaultValue,
46
+ value: internalValue,
47
+ onInput: function onInput(e) {
48
+ setInternalValue(e.target.value);
49
+ onChange === null || onChange === void 0 || onChange(e.target.value);
50
+ }
51
+ }));
52
+ };
@@ -0,0 +1,20 @@
1
+ import { AntSize } from "@trionesdev/antd-mobile-base-react";
2
+ import React from "react";
3
+ export declare const inputCls = "triones-antm-input";
4
+ export declare const inputAffixWrapperCls = "triones-antm-input-affix-wrapper";
5
+ export type InputProps = {
6
+ className?: string;
7
+ style?: React.CSSProperties;
8
+ placeholder?: string;
9
+ size?: AntSize;
10
+ disabled?: boolean;
11
+ align?: 'start' | 'center' | 'end';
12
+ allowClear?: boolean;
13
+ prefix?: React.ReactNode;
14
+ suffix?: React.ReactNode;
15
+ variant?: variantType;
16
+ defaultValue?: any;
17
+ value?: any;
18
+ onChange?: (e: any) => void;
19
+ };
20
+ export type variantType = 'outlined' | 'borderless' | 'filled' | 'underlined' | undefined;
@@ -0,0 +1,2 @@
1
+ export var inputCls = 'triones-antm-input';
2
+ export var inputAffixWrapperCls = 'triones-antm-input-affix-wrapper';
@@ -0,0 +1,4 @@
1
+ import { SpinLoading, SpinLoadingProps, DotLoading, DotLoadingProps } from "@trionesdev/antd-mobile-base-react";
2
+ export type { SpinLoadingProps, DotLoadingProps };
3
+ export { SpinLoading };
4
+ export { DotLoading };
@@ -0,0 +1,3 @@
1
+ import { SpinLoading, DotLoading } from "@trionesdev/antd-mobile-base-react";
2
+ export { SpinLoading };
3
+ export { DotLoading };
@@ -0,0 +1,17 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ import { FC } from "react";
3
+ import { ITouchEvent } from "@tarojs/components";
4
+ export type OverlayProps = {
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ open: boolean;
8
+ zIndex?: number;
9
+ closeOnOverlayClick?: boolean;
10
+ destroyOnHidden?: boolean;
11
+ onClick?: (e: ITouchEvent) => void;
12
+ onClose?: () => void;
13
+ afterClose?: () => void;
14
+ afterOpenChange?: (open: boolean) => void;
15
+ duration?: number;
16
+ };
17
+ export declare const Overlay: FC<PropsWithChildren<OverlayProps>>;
@@ -0,0 +1,100 @@
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ 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."); }
9
+ 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); }
10
+ 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; }
11
+ 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; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ import { RootPortal, View } from "@tarojs/components";
14
+ import React, { useEffect, useState } from "react";
15
+ import classNames from "classnames";
16
+ var cls = 'triones-antm-overlay';
17
+ export var Overlay = function Overlay(_ref) {
18
+ var children = _ref.children,
19
+ className = _ref.className,
20
+ style = _ref.style,
21
+ open = _ref.open,
22
+ _ref$zIndex = _ref.zIndex,
23
+ zIndex = _ref$zIndex === void 0 ? 1000 : _ref$zIndex,
24
+ _ref$closeOnOverlayCl = _ref.closeOnOverlayClick,
25
+ closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
26
+ _ref$destroyOnHidden = _ref.destroyOnHidden,
27
+ destroyOnHidden = _ref$destroyOnHidden === void 0 ? false : _ref$destroyOnHidden,
28
+ onClick = _ref.onClick,
29
+ onClose = _ref.onClose,
30
+ afterClose = _ref.afterClose,
31
+ afterOpenChange = _ref.afterOpenChange,
32
+ _ref$duration = _ref.duration,
33
+ duration = _ref$duration === void 0 ? 300 : _ref$duration;
34
+ var _useState = useState(false),
35
+ _useState2 = _slicedToArray(_useState, 2),
36
+ active = _useState2[0],
37
+ setActive = _useState2[1];
38
+ var _useState3 = useState(open),
39
+ _useState4 = _slicedToArray(_useState3, 2),
40
+ render = _useState4[0],
41
+ setRender = _useState4[1];
42
+ var _useState5 = useState(open),
43
+ _useState6 = _slicedToArray(_useState5, 2),
44
+ internalOpen = _useState6[0],
45
+ setInternalOpen = _useState6[1];
46
+ useEffect(function () {
47
+ if (internalOpen) {
48
+ setRender(true);
49
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(true);
50
+ // Next tick to allow render before transition
51
+ var timer = setTimeout(function () {
52
+ setActive(true);
53
+ }, 50);
54
+ return function () {
55
+ return clearTimeout(timer);
56
+ };
57
+ } else {
58
+ setActive(false);
59
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(false);
60
+ var _timer = setTimeout(function () {
61
+ setRender(false);
62
+ afterClose === null || afterClose === void 0 || afterClose();
63
+ }, duration);
64
+ if (destroyOnHidden) {
65
+ setRender(false);
66
+ }
67
+ return function () {
68
+ return clearTimeout(_timer);
69
+ };
70
+ }
71
+ }, [internalOpen, duration, destroyOnHidden]);
72
+ var handleClick = function handleClick(e) {
73
+ // 只在点击遮罩层本身时触发,忽略子元素冒泡上来的点击
74
+ if (e.target === e.currentTarget) {
75
+ onClick === null || onClick === void 0 || onClick(e);
76
+ if (closeOnOverlayClick) {
77
+ setInternalOpen(false);
78
+ onClose === null || onClose === void 0 || onClose();
79
+ }
80
+ }
81
+ };
82
+ useEffect(function () {
83
+ if (open == undefined) {
84
+ return;
85
+ }
86
+ if (open !== internalOpen) {
87
+ setInternalOpen(open);
88
+ }
89
+ }, [open]);
90
+ if (!render) return null;
91
+ return /*#__PURE__*/React.createElement(RootPortal, null, /*#__PURE__*/React.createElement(View, {
92
+ className: classNames(cls, _defineProperty({}, "".concat(cls, "-active"), active), className),
93
+ onClick: handleClick,
94
+ style: _objectSpread(_objectSpread({}, style), {}, {
95
+ zIndex: zIndex,
96
+ transitionDuration: "".concat(duration, "ms")
97
+ }),
98
+ catchMove: true
99
+ }, children));
100
+ };
@@ -0,0 +1,4 @@
1
+ import { Overlay, OverlayProps } from "./Overlay";
2
+ import "./style.scss";
3
+ export type { OverlayProps };
4
+ export default Overlay;
@@ -0,0 +1,3 @@
1
+ import { Overlay } from "./Overlay";
2
+ import "./style.scss";
3
+ export default Overlay;
@@ -0,0 +1,20 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesOverlayCls: 'triones-antm-overlay';
4
+
5
+ .#{$trionesOverlayCls} {
6
+ position: fixed;
7
+ top: 0;
8
+ left: 0;
9
+ right: 0;
10
+ bottom: 0;
11
+ background-color: rgba(0, 0, 0, .55);
12
+ opacity: 0;
13
+ transition: opacity 0.3s ease;
14
+ pointer-events: none; // 初始状态不可点击
15
+
16
+ &-active {
17
+ opacity: 1;
18
+ pointer-events: auto;
19
+ }
20
+ }
@@ -0,0 +1,27 @@
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
+ round?: boolean;
16
+ onOk?: (value: any[]) => void;
17
+ onCancel?: () => void;
18
+ onClose?: () => void;
19
+ styles?: {
20
+ overlay?: React.CSSProperties;
21
+ container?: React.CSSProperties;
22
+ header?: React.CSSProperties;
23
+ title?: React.CSSProperties;
24
+ body?: React.CSSProperties;
25
+ };
26
+ };
27
+ export declare const Picker: FC<PickerProps>;
@@ -0,0 +1,100 @@
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
+ _ref$columns = _ref.columns,
20
+ columns = _ref$columns === void 0 ? [] : _ref$columns,
21
+ _ref$labelInValue = _ref.labelInValue,
22
+ labelInValue = _ref$labelInValue === void 0 ? false : _ref$labelInValue,
23
+ value = _ref.value,
24
+ _ref$round = _ref.round,
25
+ round = _ref$round === void 0 ? true : _ref$round,
26
+ onOk = _ref.onOk,
27
+ onCancel = _ref.onCancel,
28
+ onClose = _ref.onClose,
29
+ styles = _ref.styles;
30
+ var _ConfigProvider$useCo = ConfigProvider.useConfig(),
31
+ locale = _ConfigProvider$useCo.locale;
32
+ var _useState = useState(value || []),
33
+ _useState2 = _slicedToArray(_useState, 2),
34
+ internalValue = _useState2[0],
35
+ setInternalValue = _useState2[1];
36
+ var handleClose = function handleClose() {
37
+ onClose === null || onClose === void 0 || onClose();
38
+ };
39
+ var handleOk = function handleOk() {
40
+ onOk === null || onOk === void 0 || onOk(internalValue);
41
+ handleClose();
42
+ };
43
+ var handelCancel = function handelCancel() {
44
+ onCancel === null || onCancel === void 0 || onCancel();
45
+ handleClose();
46
+ };
47
+ useEffect(function () {
48
+ if (!value || size(value) === 0 || size(value) !== size(columns)) {
49
+ if (labelInValue) {
50
+ setInternalValue(columns.map(function (column, index) {
51
+ if (index < size(value)) {
52
+ return column.find(function (option) {
53
+ return option.value === value[index].value;
54
+ });
55
+ }
56
+ return column[0];
57
+ }));
58
+ } else {
59
+ setInternalValue(columns.map(function (column, index) {
60
+ if (index < size(value)) {
61
+ var _column$find;
62
+ return (_column$find = column.find(function (option) {
63
+ return option.value === value[index];
64
+ })) === null || _column$find === void 0 ? void 0 : _column$find.value;
65
+ }
66
+ return column[0].value;
67
+ }));
68
+ }
69
+ }
70
+ }, [columns]);
71
+ return /*#__PURE__*/React.createElement(Popup, {
72
+ open: open,
73
+ onClose: function onClose() {
74
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(false);
75
+ },
76
+ round: round,
77
+ styles: styles
78
+ }, /*#__PURE__*/React.createElement("div", {
79
+ className: classNames(pickerCls)
80
+ }, /*#__PURE__*/React.createElement("div", {
81
+ className: classNames("".concat(pickerCls, "-header"))
82
+ }, /*#__PURE__*/React.createElement("a", {
83
+ className: classNames("".concat(pickerCls, "-header-button"), "".concat(pickerCls, "-header-button-cancel")),
84
+ onClick: handelCancel
85
+ }, locale.common.cancel), title && /*#__PURE__*/React.createElement("div", {
86
+ className: classNames("".concat(pickerCls, "-header-title"))
87
+ }, title), /*#__PURE__*/React.createElement("a", {
88
+ className: classNames("".concat(pickerCls, "-header-button"), "".concat(pickerCls, "-header-button-ok")),
89
+ onClick: handleOk
90
+ }, locale.common.confirm)), /*#__PURE__*/React.createElement("div", {
91
+ className: classNames("".concat(pickerCls, "-body"))
92
+ }, /*#__PURE__*/React.createElement(PickerView, {
93
+ columns: columns,
94
+ labelInValue: labelInValue,
95
+ value: value,
96
+ onChange: function onChange(v) {
97
+ setInternalValue(v);
98
+ }
99
+ }))));
100
+ });
@@ -1,3 +1,3 @@
1
- import { Picker, PickerProps } from "@trionesdev/antd-mobile-base-react";
1
+ import { Picker, PickerProps } from "./Picker";
2
2
  export type { PickerProps, };
3
3
  export default Picker;
@@ -1,2 +1,2 @@
1
- import { Picker } from "@trionesdev/antd-mobile-base-react";
1
+ import { Picker } from "./Picker";
2
2
  export default Picker;
@@ -0,0 +1,41 @@
1
+ @use "../style/variable" as variable;
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
+ &-cancel{
23
+ color: variable.$trionesColorTextSecondary;
24
+ }
25
+ &-ok{
26
+ color: variable.$trionesColorPrimary;
27
+ }
28
+ }
29
+
30
+ &-title {
31
+ }
32
+ }
33
+
34
+ &-body {
35
+ flex: 1 1;
36
+ width: 100%;
37
+ height: 100%;
38
+ pointer-events: unset;
39
+ }
40
+
41
+ }
@@ -0,0 +1,4 @@
1
+ import { PickerViewProps } from "./types";
2
+ import { FC } from "react";
3
+ import "./style.scss";
4
+ export declare const PickerView: FC<PickerViewProps>;