@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,71 @@
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
+ import { pickerViewCls } from "./types";
8
+ import React, { useMemo } from "react";
9
+ import classNames from "classnames";
10
+ import { PickerView as TaroPickerView, PickerViewColumn as TaroPickerViewColumn, View } from "@tarojs/components";
11
+ import "./style.scss";
12
+ export var PickerView = function PickerView(_ref) {
13
+ var className = _ref.className,
14
+ style = _ref.style,
15
+ columns = _ref.columns,
16
+ _ref$height = _ref.height,
17
+ height = _ref$height === void 0 ? 300 : _ref$height,
18
+ labelInValue = _ref.labelInValue,
19
+ value = _ref.value,
20
+ onChange = _ref.onChange;
21
+ var handleChange = function handleChange(e) {
22
+ var changedValue = e.detail.value;
23
+ var newValue = Array(changedValue.length).fill(null);
24
+ changedValue.forEach(function (v, index) {
25
+ var columnOptions = columns === null || columns === void 0 ? void 0 : columns[index];
26
+ if (columnOptions) {
27
+ var option = columnOptions[v];
28
+ if (option) {
29
+ newValue[index] = labelInValue ? option : option.value;
30
+ }
31
+ }
32
+ });
33
+ onChange === null || onChange === void 0 || onChange(newValue);
34
+ };
35
+ var innerValue = useMemo(function () {
36
+ var valueInit = Array(columns === null || columns === void 0 ? void 0 : columns.length).fill(0);
37
+ value === null || value === void 0 || value.forEach(function (v, index) {
38
+ var columnOptions = columns === null || columns === void 0 ? void 0 : columns[index];
39
+ if (columnOptions) {
40
+ var optionIndex = columnOptions.findIndex(function (option) {
41
+ return labelInValue ? option.value === v.value : option.value === v;
42
+ });
43
+ if (optionIndex > 0) {
44
+ valueInit[index] = optionIndex;
45
+ }
46
+ }
47
+ });
48
+ return valueInit;
49
+ }, [value]);
50
+ return /*#__PURE__*/React.createElement(TaroPickerView, {
51
+ className: classNames(pickerViewCls, className),
52
+ style: _objectSpread(_objectSpread({
53
+ width: '100%'
54
+ }, style), {}, {
55
+ height: height
56
+ }),
57
+ indicatorStyle: 'height: 32px;',
58
+ value: innerValue,
59
+ onChange: handleChange
60
+ }, columns === null || columns === void 0 ? void 0 : columns.map(function (columnOptions, index) {
61
+ return /*#__PURE__*/React.createElement(TaroPickerViewColumn, {
62
+ className: classNames("".concat(pickerViewCls, "-column")),
63
+ key: index
64
+ }, columnOptions.map(function (option, index) {
65
+ return /*#__PURE__*/React.createElement(View, {
66
+ key: "pvoi-".concat(index),
67
+ className: classNames("".concat(pickerViewCls, "-column-item"))
68
+ }, option.label);
69
+ }));
70
+ }));
71
+ };
@@ -1,3 +1,3 @@
1
- import { PickerView, PickerViewProps, PickerColumnOption } from "@trionesdev/antd-mobile-base-react";
2
- export type { PickerViewProps, PickerColumnOption };
1
+ import { PickerView } from "./PickerView";
2
+ export type { PickerViewProps, PickerColumnOption } from "./types";
3
3
  export default PickerView;
@@ -1,2 +1,2 @@
1
- import { PickerView } from "@trionesdev/antd-mobile-base-react";
1
+ import { PickerView } from "./PickerView";
2
2
  export default PickerView;
@@ -0,0 +1,13 @@
1
+ $pickerViewCls: 'triones-antm-picker-view';
2
+ .#{$pickerViewCls}{
3
+ &-column{
4
+ &-item{
5
+ flex-shrink: 0;
6
+ display: flex;
7
+ align-items: center;
8
+ justify-content: center;
9
+ height: 32Px;
10
+ box-sizing: border-box;
11
+ }
12
+ }
13
+ }
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ export declare const pickerViewCls = "triones-antm-picker-view";
3
+ export type PickerColumnOption = {
4
+ label?: React.ReactNode;
5
+ value?: any;
6
+ };
7
+ export type PickerViewProps = {
8
+ className?: string;
9
+ style?: React.CSSProperties;
10
+ columns?: PickerColumnOption[][];
11
+ height?: number;
12
+ labelInValue?: boolean;
13
+ value?: any[];
14
+ onChange?: (value: any[]) => void;
15
+ };
@@ -0,0 +1 @@
1
+ export var pickerViewCls = "triones-antm-picker-view";
@@ -0,0 +1,48 @@
1
+ import React, { PropsWithChildren } from "react";
2
+ export type PopupProps = {
3
+ open?: boolean;
4
+ title?: React.ReactNode;
5
+ position?: 'top' | 'bottom' | 'left' | 'right' | 'center';
6
+ /**
7
+ * @description 弹窗高度,当position 为 `top`或`bottom` 时生效
8
+ * @default null
9
+ */
10
+ height?: number | string;
11
+ /**
12
+ * @description 弹窗宽度,当position 为 `left`或`right` 时生效
13
+ * @default null
14
+ */
15
+ width?: number | string;
16
+ backable?: boolean;
17
+ backIcon?: React.ReactNode;
18
+ closable?: boolean;
19
+ closeIcon?: React.ReactNode;
20
+ /**
21
+ * @description 点击遮罩层是否关闭
22
+ * @default true
23
+ */
24
+ showOverlay?: boolean;
25
+ overlayClosable?: boolean;
26
+ /**
27
+ * @description 关闭的时候销毁组件
28
+ * @default false
29
+ */
30
+ destroyOnHidden?: boolean;
31
+ onClose?: () => void;
32
+ onBack?: () => void;
33
+ afterClose?: () => void;
34
+ afterOpenChange?: (open: boolean) => void;
35
+ className?: string;
36
+ style?: React.CSSProperties;
37
+ round?: boolean;
38
+ zIndex?: number;
39
+ duration?: number;
40
+ styles?: {
41
+ overlay?: React.CSSProperties;
42
+ container?: React.CSSProperties;
43
+ header?: React.CSSProperties;
44
+ title?: React.CSSProperties;
45
+ body?: React.CSSProperties;
46
+ };
47
+ };
48
+ export declare const Popup: React.FC<PropsWithChildren<PopupProps>>;
@@ -0,0 +1,135 @@
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 React, { useEffect, useState } from "react";
14
+ import { RootPortal, View } from "@tarojs/components";
15
+ import classNames from "classnames";
16
+ import { CloseOutline, LeftOutline } from "@trionesdev/antd-mobile-icons-react";
17
+ var cls = 'triones-antm-popup';
18
+ export var Popup = function Popup(_ref) {
19
+ var children = _ref.children,
20
+ _ref$open = _ref.open,
21
+ open = _ref$open === void 0 ? false : _ref$open,
22
+ title = _ref.title,
23
+ _ref$position = _ref.position,
24
+ position = _ref$position === void 0 ? 'bottom' : _ref$position,
25
+ height = _ref.height,
26
+ width = _ref.width,
27
+ _ref$backable = _ref.backable,
28
+ backable = _ref$backable === void 0 ? false : _ref$backable,
29
+ backIcon = _ref.backIcon,
30
+ _ref$closable = _ref.closable,
31
+ closable = _ref$closable === void 0 ? false : _ref$closable,
32
+ closeIcon = _ref.closeIcon,
33
+ _ref$showOverlay = _ref.showOverlay,
34
+ showOverlay = _ref$showOverlay === void 0 ? true : _ref$showOverlay,
35
+ _ref$overlayClosable = _ref.overlayClosable,
36
+ overlayClosable = _ref$overlayClosable === void 0 ? true : _ref$overlayClosable,
37
+ _ref$destroyOnHidden = _ref.destroyOnHidden,
38
+ destroyOnHidden = _ref$destroyOnHidden === void 0 ? false : _ref$destroyOnHidden,
39
+ onClose = _ref.onClose,
40
+ onBack = _ref.onBack,
41
+ afterClose = _ref.afterClose,
42
+ afterOpenChange = _ref.afterOpenChange,
43
+ _ref$round = _ref.round,
44
+ round = _ref$round === void 0 ? false : _ref$round,
45
+ _ref$zIndex = _ref.zIndex,
46
+ zIndex = _ref$zIndex === void 0 ? 998 : _ref$zIndex,
47
+ _ref$duration = _ref.duration,
48
+ duration = _ref$duration === void 0 ? 300 : _ref$duration,
49
+ styles = _ref.styles;
50
+ var _useState = useState(open),
51
+ _useState2 = _slicedToArray(_useState, 2),
52
+ render = _useState2[0],
53
+ setRender = _useState2[1];
54
+ var _useState3 = useState(open || false),
55
+ _useState4 = _slicedToArray(_useState3, 2),
56
+ internalOpen = _useState4[0],
57
+ setInternalOpen = _useState4[1];
58
+ var handleBack = function handleBack() {
59
+ setInternalOpen(false);
60
+ onBack === null || onBack === void 0 || onBack();
61
+ };
62
+ var handleClose = function handleClose() {
63
+ setInternalOpen(false);
64
+ onClose === null || onClose === void 0 || onClose();
65
+ };
66
+ useEffect(function () {
67
+ if (internalOpen) {
68
+ setRender(true);
69
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(true);
70
+ var timer = setTimeout(function () {}, 50);
71
+ return function () {
72
+ return clearTimeout(timer);
73
+ };
74
+ } else {
75
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(false);
76
+ var _timer = setTimeout(function () {
77
+ setRender(false);
78
+ afterClose === null || afterClose === void 0 || afterClose();
79
+ }, duration);
80
+ if (destroyOnHidden) {
81
+ setRender(false);
82
+ }
83
+ return function () {
84
+ return clearTimeout(_timer);
85
+ };
86
+ }
87
+ }, [internalOpen]);
88
+ useEffect(function () {
89
+ if (open === undefined) {
90
+ return;
91
+ }
92
+ if (open !== internalOpen) {
93
+ setInternalOpen(open);
94
+ }
95
+ }, [open]);
96
+ if (!render) return null;
97
+ return /*#__PURE__*/React.createElement(RootPortal, null, /*#__PURE__*/React.createElement(View, {
98
+ catchMove: true,
99
+ className: classNames("".concat(cls), _defineProperty({}, "".concat(cls, "-open"), internalOpen)),
100
+ style: {
101
+ zIndex: zIndex,
102
+ transitionDuration: "".concat(duration, "ms")
103
+ }
104
+ }, showOverlay && /*#__PURE__*/React.createElement(View, {
105
+ className: classNames("".concat(cls, "-overlay")),
106
+ onClick: function onClick(e) {
107
+ if (e.target === e.currentTarget) {
108
+ if (overlayClosable) {
109
+ handleClose();
110
+ }
111
+ }
112
+ }
113
+ }), /*#__PURE__*/React.createElement(View, {
114
+ className: classNames("".concat(cls, "-container"), "".concat(cls, "-").concat(position), _defineProperty({}, "".concat(cls, "-round"), round)),
115
+ style: _objectSpread(_objectSpread({}, styles === null || styles === void 0 ? void 0 : styles.container), {}, {
116
+ width: width,
117
+ height: height
118
+ })
119
+ }, (title || backable || closable) && /*#__PURE__*/React.createElement("div", {
120
+ className: "".concat(cls, "-header"),
121
+ style: styles === null || styles === void 0 ? void 0 : styles.header
122
+ }, backable && /*#__PURE__*/React.createElement("div", {
123
+ className: "".concat(cls, "-header-back"),
124
+ onClick: handleBack
125
+ }, backIcon || /*#__PURE__*/React.createElement(LeftOutline, null)), title && /*#__PURE__*/React.createElement("div", {
126
+ className: "".concat(cls, "-header-title"),
127
+ style: styles === null || styles === void 0 ? void 0 : styles.title
128
+ }, title), closable && /*#__PURE__*/React.createElement("div", {
129
+ className: "".concat(cls, "-header-close"),
130
+ onClick: handleClose
131
+ }, closeIcon || /*#__PURE__*/React.createElement(CloseOutline, null))), /*#__PURE__*/React.createElement("div", {
132
+ className: "".concat(cls, "-body"),
133
+ style: styles === null || styles === void 0 ? void 0 : styles.body
134
+ }, children))));
135
+ };
@@ -1,3 +1,4 @@
1
- import { Popup, PopupProps } from "@trionesdev/antd-mobile-base-react";
1
+ import { Popup, PopupProps } from "./Popup";
2
+ import "./style.scss";
2
3
  export type { PopupProps };
3
4
  export default Popup;
@@ -1,2 +1,3 @@
1
- import { Popup } from "@trionesdev/antd-mobile-base-react";
1
+ import { Popup } from "./Popup";
2
+ import "./style.scss";
2
3
  export default Popup;
@@ -0,0 +1,126 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $trionesPopupCls: 'triones-antm-popup';
4
+
5
+ .#{$trionesPopupCls} {
6
+ position: fixed;
7
+ top: 0;
8
+ bottom: 0;
9
+ left: 0;
10
+ right: 0;
11
+ touch-action: none;
12
+ pointer-events: none;
13
+ opacity: 0;
14
+ transition: opacity 0.3s ease;
15
+
16
+ &-open {
17
+ pointer-events: auto;
18
+ opacity: 1;
19
+ }
20
+
21
+ &-overlay {
22
+ width: 100%;
23
+ height: 100%;
24
+ background-color: rgba(0, 0, 0, .55);
25
+ }
26
+
27
+ &-container {
28
+ position: fixed;
29
+ overflow: hidden;
30
+ background-color: white;
31
+ display: flex;
32
+ flex-direction: column;
33
+ }
34
+
35
+
36
+ &-header {
37
+ display: flex;
38
+ align-items: center;
39
+ padding-block: variable.$trionesPaddingContentVertical;
40
+ padding-inline: variable.$trionesPaddingContentHorizontal;
41
+ border-bottom: 1px solid variable.$trionesBorderColor;
42
+ &-title{
43
+ flex: 1;
44
+ text-align: center;
45
+ font-size: variable.$trionesFontSizeLg;
46
+ }
47
+ }
48
+
49
+ &-body{
50
+ min-height: 0;
51
+ flex: 1;
52
+ }
53
+
54
+ &-top {
55
+ top: 0;
56
+ left: 0;
57
+ right: 0;
58
+ max-height: 100%;
59
+
60
+
61
+ &.#{$trionesPopupCls} {
62
+ &-round {
63
+ border-bottom-left-radius: variable.$trionesBorderRadiusLg;
64
+ border-bottom-right-radius: variable.$trionesBorderRadiusLg;
65
+ }
66
+ }
67
+ }
68
+
69
+ &-bottom {
70
+ bottom: 0;
71
+ left: 0;
72
+ right: 0;
73
+ max-height: 100%;
74
+
75
+
76
+ &.#{$trionesPopupCls} {
77
+ &-round {
78
+ border-top-left-radius: variable.$trionesBorderRadiusLg;
79
+ border-top-right-radius: variable.$trionesBorderRadiusLg;
80
+ }
81
+ }
82
+ }
83
+
84
+ &-left {
85
+ top: 0;
86
+ bottom: 0;
87
+ left: 0;
88
+ max-width: 100%;
89
+
90
+ &.#{$trionesPopupCls} {
91
+ &-round {
92
+ border-top-right-radius: variable.$trionesBorderRadiusLg;
93
+ border-bottom-right-radius: variable.$trionesBorderRadiusLg;
94
+ }
95
+ }
96
+ }
97
+
98
+ &-right {
99
+ top: 0;
100
+ bottom: 0;
101
+ right: 0;
102
+ max-width: 100%;
103
+
104
+ &.#{$trionesPopupCls} {
105
+ &-round {
106
+ border-top-left-radius: variable.$trionesBorderRadiusLg;
107
+ border-bottom-left-radius: variable.$trionesBorderRadiusLg;
108
+ }
109
+ }
110
+ }
111
+
112
+ &-center {
113
+ top: 50%;
114
+ left: 50%;
115
+ transform: translate(-50%, -50%);
116
+ max-width: 100%;
117
+ max-height: 100%;
118
+
119
+ &.#{$trionesPopupCls} {
120
+ &-round {
121
+ border-radius: variable.$trionesBorderRadiusLg;
122
+ }
123
+ }
124
+ }
125
+
126
+ }
@@ -1,3 +1,3 @@
1
- import { Progress, ProgressProps } from "./Progress";
1
+ import { Progress, ProgressProps } from "@trionesdev/antd-mobile-base-react";
2
2
  export type { ProgressProps };
3
3
  export default Progress;
@@ -1,2 +1,2 @@
1
- import { Progress } from "./Progress";
1
+ import { Progress } from "@trionesdev/antd-mobile-base-react";
2
2
  export default Progress;
@@ -0,0 +1,3 @@
1
+ import { Segmented, SegmentedProps } from '@trionesdev/antd-mobile-base-react';
2
+ export type { SegmentedProps };
3
+ export default Segmented;
@@ -0,0 +1,2 @@
1
+ import { Segmented } from '@trionesdev/antd-mobile-base-react';
2
+ export default Segmented;
@@ -264,13 +264,14 @@ var SideBarContent = /*#__PURE__*/memo(function (_ref2) {
264
264
  return computeReactiveOffsetBottom();
265
265
  case 6:
266
266
  reactiveOffsetBottom = _context5.sent;
267
- if (!isTaroEnv) {
267
+ if (!isTaroWeApp) {
268
268
  _context5.next = 13;
269
269
  break;
270
270
  }
271
271
  _context5.next = 10;
272
272
  return new Promise(function (resolve) {
273
- Taro.getSystemInfo().then(function (res) {
273
+ var _Taro$getSystemInfo;
274
+ (_Taro$getSystemInfo = Taro.getSystemInfo) === null || _Taro$getSystemInfo === void 0 || _Taro$getSystemInfo.call(Taro).then(function (res) {
274
275
  return resolve(res.windowHeight);
275
276
  });
276
277
  });
@@ -1,4 +1,4 @@
1
- @use "../style/variable" as *;
1
+ @use "../style/variable" as variable;
2
2
 
3
3
  $trionesSideBarCls: 'triones-antm-sidebar';
4
4
 
@@ -9,7 +9,7 @@ $trionesSideBarCls: 'triones-antm-sidebar';
9
9
 
10
10
  &-tabs {
11
11
  min-width: 0;
12
- background-color: $trionesColorFill;
12
+ background-color: variable.$trionesColorFill;
13
13
  overflow: auto;
14
14
  scrollbar-width: thin;
15
15
  flex-shrink: 0;
@@ -17,12 +17,12 @@ $trionesSideBarCls: 'triones-antm-sidebar';
17
17
 
18
18
  &-tab {
19
19
  cursor: pointer;
20
- padding: $trionesPadding $trionesPadding;
21
- color: $trionesColorTextSecondary;
20
+ padding: variable.$trionesPadding variable.$trionesPadding;
21
+ color: variable.$trionesColorTextSecondary;
22
22
 
23
23
  &-active {
24
- color: $trionesColorPrimaryText;
25
- background-color: $trionesColorBgBase;
24
+ color: variable.$trionesColorPrimaryText;
25
+ background-color: variable.$trionesColorBgBase;
26
26
  }
27
27
 
28
28
  }
@@ -0,0 +1,3 @@
1
+ import { Stepper, StepperProps } from "@trionesdev/antd-mobile-base-react";
2
+ export type { StepperProps };
3
+ export default Stepper;
@@ -0,0 +1,2 @@
1
+ import { Stepper } from "@trionesdev/antd-mobile-base-react";
2
+ export default Stepper;
@@ -0,0 +1,18 @@
1
+ import { FC } from "react";
2
+ import React from "react";
3
+ import "./style.scss";
4
+ export type ToastProps = {
5
+ open?: boolean;
6
+ maskClosable?: boolean;
7
+ content?: React.ReactNode;
8
+ duration?: number;
9
+ durationAble?: boolean;
10
+ icon?: 'success' | 'fail' | 'loading' | React.ReactNode;
11
+ maskClassName?: string;
12
+ position?: 'top' | 'bottom' | 'center';
13
+ destroyOnClose?: boolean;
14
+ afterClose?: () => void;
15
+ afterOpenChange?: (open: boolean) => void;
16
+ onDestroy?: () => void;
17
+ };
18
+ export declare const Toast: FC<ToastProps>;
@@ -0,0 +1,112 @@
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 { memo, useEffect, useMemo, useRef, useState } from "react";
12
+ import classNames from "classnames";
13
+ import React from "react";
14
+ import "./style.scss";
15
+ import { SpinLoading } from "../index";
16
+ import Overlay from "../Overlay";
17
+ import { CheckOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
18
+ var toastCls = "triones-antm-toast";
19
+ export var Toast = /*#__PURE__*/memo(function (_ref) {
20
+ var open = _ref.open,
21
+ _ref$maskClosable = _ref.maskClosable,
22
+ maskClosable = _ref$maskClosable === void 0 ? true : _ref$maskClosable,
23
+ content = _ref.content,
24
+ _ref$duration = _ref.duration,
25
+ duration = _ref$duration === void 0 ? 2000 : _ref$duration,
26
+ _ref$durationAble = _ref.durationAble,
27
+ durationAble = _ref$durationAble === void 0 ? true : _ref$durationAble,
28
+ icon = _ref.icon,
29
+ maskClassName = _ref.maskClassName,
30
+ _ref$position = _ref.position,
31
+ position = _ref$position === void 0 ? 'center' : _ref$position,
32
+ destroyOnClose = _ref.destroyOnClose,
33
+ afterClose = _ref.afterClose,
34
+ afterOpenChange = _ref.afterOpenChange,
35
+ onDestroy = _ref.onDestroy;
36
+ var _useState = useState(open || false),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ internalOpen = _useState2[0],
39
+ setInternalOpen = _useState2[1];
40
+ var time = useRef();
41
+ var handleIcon = function handleIcon() {
42
+ if (icon === 'success') {
43
+ return /*#__PURE__*/React.createElement(CheckOutline, null);
44
+ } else if (icon === 'fail') {
45
+ return /*#__PURE__*/React.createElement(CloseOutline, null);
46
+ } else if (icon === 'loading') {
47
+ return /*#__PURE__*/React.createElement(SpinLoading, {
48
+ color: "white"
49
+ });
50
+ } else {
51
+ return icon;
52
+ }
53
+ };
54
+ useEffect(function () {
55
+ if (open === undefined) {
56
+ return;
57
+ }
58
+ if (open !== internalOpen) {
59
+ setInternalOpen(open);
60
+ }
61
+ }, [open]);
62
+ useEffect(function () {
63
+ afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(internalOpen);
64
+ if (!internalOpen) {
65
+ afterClose === null || afterClose === void 0 || afterClose();
66
+ if (destroyOnClose) {
67
+ onDestroy === null || onDestroy === void 0 || onDestroy();
68
+ }
69
+ clearTimeout(time.current);
70
+ }
71
+ if (durationAble && internalOpen && duration) {
72
+ time.current = setTimeout(function () {
73
+ setInternalOpen(false);
74
+ }, duration);
75
+ }
76
+ }, [internalOpen]);
77
+ var top = useMemo(function () {
78
+ switch (position) {
79
+ case 'top':
80
+ return '20%';
81
+ case 'bottom':
82
+ return '80%';
83
+ default:
84
+ return '50%';
85
+ }
86
+ }, [position]);
87
+ return /*#__PURE__*/React.createElement(Overlay, {
88
+ className: maskClassName,
89
+ open: internalOpen,
90
+ onClick: function onClick() {
91
+ if (maskClosable) {
92
+ setInternalOpen(false);
93
+ }
94
+ }
95
+ }, /*#__PURE__*/React.createElement("div", {
96
+ className: classNames(toastCls)
97
+ }, /*#__PURE__*/React.createElement("div", {
98
+ className: classNames("".concat(toastCls, "-main"), _defineProperty({}, "".concat(toastCls, "-main-icon"), icon)),
99
+ style: {
100
+ top: top
101
+ },
102
+ onClick: function onClick(e) {
103
+ e.stopPropagation();
104
+ }
105
+ }, /*#__PURE__*/React.createElement("div", {
106
+ className: classNames("".concat(toastCls, "-center"))
107
+ }, icon && /*#__PURE__*/React.createElement("div", {
108
+ className: classNames("".concat(toastCls, "-center-icon"))
109
+ }, handleIcon()), content && /*#__PURE__*/React.createElement("div", {
110
+ className: classNames("".concat(toastCls, "-center-content"))
111
+ }, content)))));
112
+ });
@@ -1,3 +1,3 @@
1
- import { Toast, ToastProps } from "@trionesdev/antd-mobile-base-react";
1
+ import { Toast, ToastProps } from "./Toast";
2
2
  export type { ToastProps };
3
3
  export default Toast;
@@ -1,2 +1,2 @@
1
- import { Toast } from "@trionesdev/antd-mobile-base-react";
1
+ import { Toast } from "./Toast";
2
2
  export default Toast;