@trionesdev/antd-taro-react 0.0.2-beta.0 → 0.0.2-beta.10

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 (148) 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/style.scss +235 -231
  8. package/dist/Calendar/calendar-grid.js +1 -2
  9. package/dist/Calendar/calendar-range.js +1 -1
  10. package/dist/Calendar/calendar.js +5 -5
  11. package/dist/Calendar/style.scss +85 -85
  12. package/dist/Calendar/touchable-calendar-grid.js +9 -9
  13. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.d.ts +4 -4
  14. package/dist/CalendarDatetimePicker/CalendarDatetimePicker.js +42 -156
  15. package/dist/CalendarDatetimePicker/style.scss +24 -54
  16. package/dist/CalendarDatetimePicker/types.d.ts +0 -4
  17. package/dist/CalendarDatetimePicker/types.js +1 -6
  18. package/dist/CalendarDatetimePopup/CalendarDatetimePopup.d.ts +10 -0
  19. package/dist/CalendarDatetimePopup/CalendarDatetimePopup.js +163 -0
  20. package/dist/CalendarDatetimePopup/index.d.ts +3 -0
  21. package/dist/CalendarDatetimePopup/index.js +2 -0
  22. package/dist/CalendarDatetimePopup/style.scss +62 -0
  23. package/dist/CalendarDatetimePopup/types.d.ts +5 -0
  24. package/dist/CalendarDatetimePopup/types.js +6 -0
  25. package/dist/CalendarPopup/CalendarPopup.d.ts +4 -0
  26. package/dist/{CalendarPicker/calendar-picker.js → CalendarPopup/CalendarPopup.js} +6 -4
  27. package/dist/CalendarPopup/CalendarRangePopup.d.ts +4 -0
  28. package/dist/{CalendarPicker/calendar-range-picker.js → CalendarPopup/CalendarRangePopup.js} +5 -4
  29. package/dist/CalendarPopup/index.d.ts +8 -0
  30. package/dist/CalendarPopup/index.js +5 -0
  31. package/dist/CalendarPopup/style.scss +32 -0
  32. package/dist/{CalendarPicker → CalendarPopup}/types.d.ts +3 -2
  33. package/dist/CalendarPopup/types.js +1 -0
  34. package/dist/CascaderPicker/CascaderPicker.d.ts +25 -0
  35. package/dist/CascaderPicker/CascaderPicker.js +78 -0
  36. package/dist/CascaderPicker/index.d.ts +1 -1
  37. package/dist/CascaderPicker/index.js +1 -1
  38. package/dist/CascaderPicker/style.scss +24 -0
  39. package/dist/CascaderPopup/cascader-popup.d.ts +27 -0
  40. package/dist/CascaderPopup/cascader-popup.js +90 -0
  41. package/dist/CascaderPopup/index.d.ts +3 -0
  42. package/dist/CascaderPopup/index.js +2 -0
  43. package/dist/CascaderPopup/style.scss +45 -0
  44. package/dist/DatePicker/DatePicker.d.ts +15 -0
  45. package/dist/DatePicker/DatePicker.js +85 -0
  46. package/dist/DatePicker/DatePickerPopup.d.ts +18 -0
  47. package/dist/DatePicker/DatePickerPopup.js +329 -0
  48. package/dist/DatePicker/index.d.ts +3 -0
  49. package/dist/DatePicker/index.js +3 -0
  50. package/dist/DatePicker/style.scss +64 -0
  51. package/dist/DatePicker/types.d.ts +1 -0
  52. package/dist/Form/FormItem/form-item-input.d.ts +15 -0
  53. package/dist/Form/FormItem/form-item-input.js +39 -0
  54. package/dist/Form/FormItem/form-item-label.d.ts +13 -0
  55. package/dist/Form/FormItem/form-item-label.js +35 -0
  56. package/dist/Form/FormItem/form-item.d.ts +22 -0
  57. package/dist/Form/FormItem/form-item.js +73 -0
  58. package/dist/Form/FormItem/index.d.ts +5 -0
  59. package/dist/Form/FormItem/index.js +3 -0
  60. package/dist/Form/index.d.ts +8 -1
  61. package/dist/Form/index.js +5 -1
  62. package/dist/Form/style.scss +78 -0
  63. package/dist/ImagesPreview/ImagesPreview.js +4 -3
  64. package/dist/ImagesPreview/style.scss +34 -34
  65. package/dist/ImagesWall/ImagesWall.js +4 -4
  66. package/dist/ImagesWall/style.scss +70 -70
  67. package/dist/Input/index.d.ts +17 -2
  68. package/dist/Input/index.js +13 -1
  69. package/dist/Input/index.scss +267 -0
  70. package/dist/Input/input-affix-wrapper.d.ts +13 -0
  71. package/dist/Input/input-affix-wrapper.js +37 -0
  72. package/dist/Input/input-digit.d.ts +7 -0
  73. package/dist/Input/input-digit.js +53 -0
  74. package/dist/Input/input-number.d.ts +7 -0
  75. package/dist/Input/input-number.js +50 -0
  76. package/dist/Input/input-opt.d.ts +16 -0
  77. package/dist/Input/input-opt.js +87 -0
  78. package/dist/Input/input-password.d.ts +8 -0
  79. package/dist/Input/input-password.js +49 -0
  80. package/dist/Input/input.d.ts +3 -0
  81. package/dist/Input/input.js +7 -0
  82. package/dist/Input/taro-input.d.ts +8 -0
  83. package/dist/Input/taro-input.js +54 -0
  84. package/dist/Input/textarea.d.ts +15 -0
  85. package/dist/Input/textarea.js +52 -0
  86. package/dist/Input/types.d.ts +19 -0
  87. package/dist/Input/types.js +2 -0
  88. package/dist/Overlay/Overlay.d.ts +17 -0
  89. package/dist/Overlay/Overlay.js +100 -0
  90. package/dist/Overlay/index.d.ts +4 -0
  91. package/dist/Overlay/index.js +3 -0
  92. package/dist/Overlay/style.scss +20 -0
  93. package/dist/Picker/Picker.d.ts +19 -0
  94. package/dist/Picker/Picker.js +75 -0
  95. package/dist/Picker/index.d.ts +1 -1
  96. package/dist/Picker/index.js +1 -1
  97. package/dist/Picker/style.scss +41 -0
  98. package/dist/PickerView/PickerView.d.ts +4 -0
  99. package/dist/PickerView/PickerView.js +71 -0
  100. package/dist/PickerView/index.d.ts +2 -2
  101. package/dist/PickerView/index.js +1 -1
  102. package/dist/PickerView/style.scss +13 -0
  103. package/dist/PickerView/types.d.ts +15 -0
  104. package/dist/PickerView/types.js +1 -0
  105. package/dist/Popup/Popup.d.ts +48 -0
  106. package/dist/Popup/Popup.js +135 -0
  107. package/dist/Popup/index.d.ts +2 -1
  108. package/dist/Popup/index.js +2 -1
  109. package/dist/Popup/style.scss +124 -0
  110. package/dist/Progress/index.d.ts +1 -1
  111. package/dist/Progress/index.js +1 -1
  112. package/dist/SideBar/side-bar.js +9 -8
  113. package/dist/SideBar/style.scss +85 -85
  114. package/dist/Toast/Toast.d.ts +18 -0
  115. package/dist/Toast/Toast.js +112 -0
  116. package/dist/Toast/index.d.ts +1 -1
  117. package/dist/Toast/index.js +1 -1
  118. package/dist/Toast/style.scss +63 -0
  119. package/dist/VerificationCodeInput/index.d.ts +2 -2
  120. package/dist/VerificationCodeInput/index.js +1 -1
  121. package/dist/VerificationCodeInput/style.scss +20 -0
  122. package/dist/VerificationCodeInput/verification-code-input.d.ts +24 -0
  123. package/dist/VerificationCodeInput/verification-code-input.js +99 -0
  124. package/dist/index.d.ts +10 -5
  125. package/dist/index.js +5 -2
  126. package/dist/style/variable.scss +20 -0
  127. package/dist/types.d.ts +0 -1
  128. package/package.json +26 -26
  129. package/readme.md +23 -23
  130. package/dist/CalendarPicker/calendar-picker.d.ts +0 -4
  131. package/dist/CalendarPicker/calendar-range-picker.d.ts +0 -4
  132. package/dist/CalendarPicker/index.d.ts +0 -9
  133. package/dist/CalendarPicker/index.js +0 -5
  134. package/dist/CalendarPicker/style.scss +0 -31
  135. package/dist/Mask/index.d.ts +0 -3
  136. package/dist/Mask/index.js +0 -2
  137. package/dist/Progress/Progress.d.ts +0 -38
  138. package/dist/Progress/Progress.js +0 -53
  139. package/dist/Progress/ProgressCircle.d.ts +0 -16
  140. package/dist/Progress/ProgressCircle.js +0 -147
  141. package/dist/Progress/ProgressLine.d.ts +0 -15
  142. package/dist/Progress/ProgressLine.js +0 -87
  143. package/dist/Progress/style.scss +0 -33
  144. package/dist/Progress/types.d.ts +0 -4
  145. package/dist/Progress/types.js +0 -2
  146. /package/dist/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.d.ts +0 -0
  147. /package/dist/{CalendarDatetimePicker → CalendarDatetimePopup}/DateTimeSwitch.js +0 -0
  148. /package/dist/{CalendarPicker → DatePicker}/types.js +0 -0
@@ -0,0 +1,15 @@
1
+ import { Rule } from 'rc-field-form/lib/interface';
2
+ import React, { FC } from 'react';
3
+ type FormItemInputProps = {
4
+ children?: React.ReactElement;
5
+ className?: string;
6
+ name?: string;
7
+ rules?: Rule[];
8
+ initialValue?: any;
9
+ valuePropName?: string;
10
+ errors?: React.ReactNode[];
11
+ errorRender?: (errors?: any[]) => React.ReactNode;
12
+ hiddenError?: boolean;
13
+ };
14
+ export declare const FormItemInput: FC<FormItemInputProps>;
15
+ export {};
@@ -0,0 +1,39 @@
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 } from 'lodash-es';
9
+ import { Field } from 'rc-field-form';
10
+ import React, { useState } from 'react';
11
+ export var FormItemInput = function FormItemInput(_ref) {
12
+ var children = _ref.children,
13
+ className = _ref.className,
14
+ name = _ref.name,
15
+ rules = _ref.rules,
16
+ initialValue = _ref.initialValue,
17
+ valuePropName = _ref.valuePropName,
18
+ errorRender = _ref.errorRender,
19
+ hiddenError = _ref.hiddenError;
20
+ var _useState = useState(),
21
+ _useState2 = _slicedToArray(_useState, 2),
22
+ meta = _useState2[0],
23
+ setMeta = _useState2[1];
24
+ var clsPrefix = 'triones-antm-form-item';
25
+ return /*#__PURE__*/React.createElement("div", {
26
+ className: classNames(className)
27
+ }, /*#__PURE__*/React.createElement(Field, {
28
+ name: name,
29
+ rules: rules,
30
+ valuePropName: valuePropName,
31
+ trigger: 'onChange',
32
+ onMetaChange: function onMetaChange(meta) {
33
+ setMeta(meta);
34
+ },
35
+ initialValue: initialValue
36
+ }, children), !hiddenError && !isEmpty(meta === null || meta === void 0 ? void 0 : meta.errors) && /*#__PURE__*/React.createElement("div", {
37
+ className: classNames("".concat(clsPrefix, "-error"))
38
+ }, (errorRender === null || errorRender === void 0 ? void 0 : errorRender(meta === null || meta === void 0 ? void 0 : meta.errors)) || (meta === null || meta === void 0 ? void 0 : meta.errors.join(','))));
39
+ };
@@ -0,0 +1,13 @@
1
+ import React, { CSSProperties, FC } from "react";
2
+ import { NamePath } from "rc-field-form/lib/interface";
3
+ import { FormItemLayout } from "@trionesdev/antd-mobile-base-react";
4
+ type FormItemLabelProps = {
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ label?: React.ReactNode;
8
+ layout?: FormItemLayout;
9
+ name?: NamePath;
10
+ required?: boolean;
11
+ };
12
+ export declare const FormItemLabel: FC<FormItemLabelProps>;
13
+ export {};
@@ -0,0 +1,35 @@
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 React from "react";
6
+ import classNames from "classnames";
7
+ import { isFunction } from "lodash-es";
8
+ import { useFormContext } from "@trionesdev/antd-mobile-base-react";
9
+ import { useTaro } from "../../hooks";
10
+ export var FormItemLabel = function FormItemLabel(_ref) {
11
+ var className = _ref.className,
12
+ style = _ref.style,
13
+ label = _ref.label,
14
+ layout = _ref.layout,
15
+ required = _ref.required;
16
+ var _useTaro = useTaro(),
17
+ isTaroWeApp = _useTaro.isTaroWeApp,
18
+ isTaroWeb = _useTaro.isTaroWeb;
19
+ var _useFormContext = useFormContext(),
20
+ requiredMark = _useFormContext.requiredMark,
21
+ colon = _useFormContext.colon;
22
+ var clsPrefix = "triones-antm-form-item-label";
23
+ return /*#__PURE__*/React.createElement("div", {
24
+ className: classNames(className, {
25
+ required: "".concat(clsPrefix, "-required")
26
+ }),
27
+ style: style
28
+ }, /*#__PURE__*/React.createElement("div", {
29
+ className: classNames("".concat(clsPrefix, "-wrapper"), _defineProperty(_defineProperty({}, "h5", isTaroWeb), "wx", isTaroWeApp))
30
+ }, required && /*#__PURE__*/React.createElement("div", {
31
+ className: "".concat(clsPrefix, "-required-mark")
32
+ }, isFunction(requiredMark) ? requiredMark(label, {
33
+ required: required
34
+ }) : '*'), label, layout == 'horizontal' && colon && ':'));
35
+ };
@@ -0,0 +1,22 @@
1
+ import React, { CSSProperties, FC, ReactElement, ReactNode } from "react";
2
+ import { NamePath, Rule } from "rc-field-form/lib/interface";
3
+ import { FormItemLayout, FormLayoutAlign } from "@trionesdev/antd-mobile-base-react";
4
+ export type FormItemProps = {
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ children?: ReactElement;
8
+ layout?: FormItemLayout;
9
+ label?: ReactNode;
10
+ labelAlign?: FormLayoutAlign;
11
+ labelWidth?: number;
12
+ name?: NamePath;
13
+ required?: boolean;
14
+ hidden?: boolean;
15
+ noStyle?: boolean;
16
+ rules?: Rule[];
17
+ initialValue?: any;
18
+ valuePropName?: string;
19
+ errorRender?: (errors?: any[]) => React.ReactNode;
20
+ extra?: ReactNode;
21
+ };
22
+ export declare const FormItem: FC<FormItemProps>;
@@ -0,0 +1,73 @@
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
+ var _excluded = ["className", "style", "children", "layout", "label", "labelAlign", "labelWidth", "name", "required", "hidden", "noStyle", "rules", "initialValue", "valuePropName", "errorRender", "extra"];
3
+ 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); }
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 _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; }
8
+ 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; }
9
+ import React from "react";
10
+ import { FormItemLabel } from "./form-item-label";
11
+ import { FormItemInput } from "./form-item-input";
12
+ import classNames from "classnames";
13
+ import { Field } from "rc-field-form";
14
+ import { useFormContext } from "@trionesdev/antd-mobile-base-react";
15
+ export var FormItem = function FormItem(_ref) {
16
+ var className = _ref.className,
17
+ style = _ref.style,
18
+ children = _ref.children,
19
+ layout = _ref.layout,
20
+ label = _ref.label,
21
+ labelAlign = _ref.labelAlign,
22
+ labelWidth = _ref.labelWidth,
23
+ name = _ref.name,
24
+ required = _ref.required,
25
+ _ref$hidden = _ref.hidden,
26
+ hidden = _ref$hidden === void 0 ? false : _ref$hidden,
27
+ _ref$noStyle = _ref.noStyle,
28
+ noStyle = _ref$noStyle === void 0 ? false : _ref$noStyle,
29
+ rules = _ref.rules,
30
+ initialValue = _ref.initialValue,
31
+ valuePropName = _ref.valuePropName,
32
+ errorRender = _ref.errorRender,
33
+ extra = _ref.extra,
34
+ props = _objectWithoutProperties(_ref, _excluded);
35
+ var _useFormContext = useFormContext(),
36
+ formLayout = _useFormContext.layout,
37
+ formLayoutAlign = _useFormContext.labelAlign,
38
+ formLabelWidth = _useFormContext.labelWidth,
39
+ hiddenError = _useFormContext.hiddenError,
40
+ formExtra = _useFormContext.extra;
41
+ var formItemLayout = layout ? layout : formLayout === 'inline' ? 'horizontal' : formLayout;
42
+ var formItemAlign = labelAlign ? labelAlign : formLayoutAlign || 'left';
43
+ var formItemLabelWidth = labelWidth ? labelWidth : formLabelWidth;
44
+ var itemExtra = extra !== undefined ? extra : formExtra;
45
+ var clsPrefix = "triones-antm-form-item";
46
+ if (noStyle) {
47
+ return /*#__PURE__*/React.createElement(Field, {
48
+ name: name,
49
+ rules: rules,
50
+ trigger: 'onChange',
51
+ initialValue: initialValue
52
+ }, children);
53
+ }
54
+ return /*#__PURE__*/React.createElement("div", {
55
+ className: classNames(clsPrefix, "".concat(clsPrefix, "-").concat(formItemLayout), className, _defineProperty({}, "".concat(clsPrefix, "-hidden"), hidden)),
56
+ style: style
57
+ }, label && /*#__PURE__*/React.createElement(FormItemLabel, {
58
+ className: classNames("".concat(clsPrefix, "-label"), "".concat(clsPrefix, "-label-").concat(formItemAlign)),
59
+ style: {
60
+ width: formItemLabelWidth
61
+ },
62
+ label: label,
63
+ required: required
64
+ }), /*#__PURE__*/React.createElement(FormItemInput, _extends({
65
+ className: "".concat(clsPrefix, "-input")
66
+ }, props, {
67
+ name: name,
68
+ rules: rules,
69
+ errorRender: errorRender,
70
+ initialValue: initialValue,
71
+ hiddenError: hiddenError
72
+ }), children), formExtra);
73
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import { FormItemProps } from "./form-item";
3
+ declare const FormItem: import("react").FC<FormItemProps>;
4
+ export type { FormItemProps };
5
+ export default FormItem;
@@ -0,0 +1,3 @@
1
+ import { FormItem as InternalFromItem } from "./form-item";
2
+ var FormItem = InternalFromItem;
3
+ export default FormItem;
@@ -1,3 +1,10 @@
1
- import { Form, FormProps, FormItemProps } from "@trionesdev/antd-mobile-base-react";
1
+ import { Form as InternalForm, FormProps } from "@trionesdev/antd-mobile-base-react";
2
+ import FormItem, { FormItemProps } from "./FormItem";
3
+ import "./style.scss";
4
+ type InternalFormType = typeof InternalForm;
5
+ type CompoundedComponent = InternalFormType & {
6
+ Item: typeof FormItem;
7
+ };
8
+ declare const Form: CompoundedComponent;
2
9
  export type { FormProps, FormItemProps };
3
10
  export default Form;
@@ -1,2 +1,6 @@
1
- import { Form } from "@trionesdev/antd-mobile-base-react";
1
+ import { Form as InternalForm } from "@trionesdev/antd-mobile-base-react";
2
+ import FormItem from "./FormItem";
3
+ import "./style.scss";
4
+ var Form = InternalForm;
5
+ Form.Item = FormItem;
2
6
  export default Form;
@@ -0,0 +1,78 @@
1
+ @use "../style/variable" as variable;
2
+
3
+ $cls-prefix-form: 'triones-antm-form';
4
+ $cls-prefix-form-item: 'triones-antm-form-item';
5
+
6
+ .#{$cls-prefix-form} {
7
+ }
8
+
9
+ .#{$cls-prefix-form-item} {
10
+
11
+ &-label {
12
+ font-size: variable.$trionesFontSize;
13
+ padding-block: 4Px;
14
+ color: #6F6F6F;
15
+
16
+
17
+ &-wrapper {
18
+ display: flex;
19
+ align-items: center;
20
+
21
+ &.h5 {
22
+ @include variable.h5-input-size;
23
+ }
24
+
25
+ &.wx {
26
+ @include variable.h5-input-size;
27
+ }
28
+ }
29
+
30
+ &-left {
31
+ }
32
+
33
+ &-right {
34
+ text-align: right;
35
+ }
36
+
37
+ &-required-mark {
38
+ display: inline-block;
39
+ color: red;
40
+ margin-right: 4Px;
41
+ }
42
+
43
+ }
44
+
45
+ &-input {
46
+
47
+ .#{$cls-prefix-form-item} {
48
+ &-error {
49
+ font-size: variable.$trionesFontSizeSm;
50
+ color: red;
51
+ }
52
+ }
53
+ }
54
+
55
+ &-horizontal {
56
+ display: flex;
57
+
58
+ .#{$cls-prefix-form-item} {
59
+ &-label {
60
+ flex-shrink: 1;
61
+ min-width: 0;
62
+ }
63
+
64
+ &-input {
65
+ flex: 1;
66
+ flex-shrink: 1;
67
+ min-width: 0;
68
+ display: flex;
69
+ flex-direction: column;
70
+ justify-content: center;
71
+ }
72
+ }
73
+ }
74
+
75
+ &-hidden {
76
+ display: none;
77
+ }
78
+ }
@@ -5,11 +5,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5
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
6
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
7
  import React, { useEffect } from "react";
8
- import Mask from "../Mask";
9
8
  import classNames from "classnames";
10
9
  import "./style.scss";
11
10
  import Swiper from "../Swiper";
12
11
  import Image from "../Image";
12
+ import Overlay from "../Overlay";
13
13
  var cls = 'triones-antm-image-preview';
14
14
  export var ImagesPreview = function ImagesPreview(_ref) {
15
15
  var className = _ref.className,
@@ -46,7 +46,7 @@ export var ImagesPreview = function ImagesPreview(_ref) {
46
46
  }
47
47
  setInnerActiveIndex(activeIndex);
48
48
  }, [activeIndex]);
49
- return /*#__PURE__*/React.createElement(Mask, {
49
+ return /*#__PURE__*/React.createElement(Overlay, {
50
50
  open: innerOpen
51
51
  }, /*#__PURE__*/React.createElement("div", {
52
52
  className: classNames(cls, className),
@@ -62,8 +62,9 @@ export var ImagesPreview = function ImagesPreview(_ref) {
62
62
  width: '100%',
63
63
  height: '100%'
64
64
  }
65
- }, items === null || items === void 0 ? void 0 : items.map(function (item) {
65
+ }, items === null || items === void 0 ? void 0 : items.map(function (item, index) {
66
66
  return /*#__PURE__*/React.createElement(Swiper.Item, {
67
+ key: index,
67
68
  style: {
68
69
  width: '100%',
69
70
  height: '100%',
@@ -1,34 +1,34 @@
1
- $imagePreviewCls: 'triones-antm-image-preview';
2
-
3
- .#{$imagePreviewCls} {
4
- height: 100%;
5
- width: 100%;
6
- position: relative;
7
- background-color: rgba(0, 0, 0, 0.8);
8
-
9
- &-head {
10
- position: fixed;
11
- top: 50Px;
12
- left: 0;
13
- right: 0;
14
- display: flex;
15
- justify-content: center;
16
- align-items: center;
17
- color: white;
18
- font-size: 14Px;
19
- z-index: 1000;
20
- }
21
-
22
- &-content {
23
- height: 100%;
24
- width: 100%;
25
- :global{
26
- .triones-antm-image-img{
27
- height: auto!important;
28
- }
29
- }
30
- }
31
-
32
- &-foot {
33
- }
34
- }
1
+ $imagePreviewCls: 'triones-antm-image-preview';
2
+
3
+ .#{$imagePreviewCls} {
4
+ height: 100%;
5
+ width: 100%;
6
+ position: relative;
7
+ background-color: rgba(0, 0, 0, 0.8);
8
+
9
+ &-head {
10
+ position: fixed;
11
+ top: 50Px;
12
+ left: 0;
13
+ right: 0;
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ color: white;
18
+ font-size: 14Px;
19
+ z-index: 1000;
20
+ }
21
+
22
+ &-content {
23
+ height: 100%;
24
+ width: 100%;
25
+ :global{
26
+ .triones-antm-image-img{
27
+ height: auto!important;
28
+ }
29
+ }
30
+ }
31
+
32
+ &-foot {
33
+ }
34
+ }
@@ -10,10 +10,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import React, { useEffect, useState } from "react";
12
12
  import classNames from "classnames";
13
- import { AddOutline, CloseOutline } from "../../../antd-mobile-icons-react";
13
+ import { AddOutline, CloseOutline } from "@trionesdev/antd-mobile-icons-react";
14
14
  import "./style.scss";
15
15
  import { ImagesPreview } from "../index";
16
- import _ from "lodash";
16
+ import { isEqual } from "lodash-es";
17
17
  import { RandomUtils } from "../utils/random-utils";
18
18
  import Taro from "@tarojs/taro";
19
19
  var cls = 'triones-antm-images-wall';
@@ -77,12 +77,12 @@ export var ImagesWall = function ImagesWall(_ref2) {
77
77
  (_item$status = item.status) !== null && _item$status !== void 0 ? _item$status : item.status = 'done';
78
78
  return item;
79
79
  });
80
- if (_.isEqual(newImages, images)) {
80
+ if (isEqual(newImages, images)) {
81
81
  return;
82
82
  }
83
83
  setImages(newImages || []);
84
84
  }, [value]);
85
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ImagesPreview, {
85
+ return /*#__PURE__*/React.createElement(React.Fragment, null, preview && /*#__PURE__*/React.createElement(ImagesPreview, {
86
86
  open: imagePreviewOpen,
87
87
  afterOpenChange: setImagePreviewOpen,
88
88
  items: images.map(function (item) {
@@ -1,70 +1,70 @@
1
- @import "@trionesdev/antd-mobile-base-react/dist/style/variable";
2
-
3
- $imagesWallCls: 'triones-antm-images-wall';
4
-
5
- .#{$imagesWallCls} {
6
- display: grid;
7
- grid-gap: 4PX;
8
- width: 100%;
9
-
10
- &-item {
11
- aspect-ratio: 1;
12
- border-radius: $trionesBorderRadius;
13
- overflow: hidden;
14
- position: relative;
15
-
16
- &-inner {
17
- width: 100%;
18
- height: 100%;
19
- }
20
-
21
- &-close {
22
- position: absolute;
23
- top: 0;
24
- right: 0;
25
- background-color: rgb(0 0 0 / 63%);
26
- width: 20Px;
27
- height: 20Px;
28
- border-bottom-left-radius: $trionesBorderRadius;
29
- display: flex;
30
- justify-content: center;
31
- align-items: center;
32
-
33
- .triones-antm-icon {
34
- color: white;
35
- font-size: 12Px;
36
- }
37
- }
38
-
39
- &-input {
40
- position: absolute;
41
- width: 100%;
42
- height: 100%;
43
- top: 0;
44
- left: 0;
45
- margin: 0;
46
- padding: 0;
47
- z-index: 1;
48
- opacity: 0;
49
- }
50
-
51
- &-image {
52
- width: 100%;
53
- height: 100%;
54
- object-fit: cover;
55
- }
56
- }
57
-
58
- &-upload {
59
- display: flex;
60
- justify-content: center;
61
- align-items: center;
62
- background-color: $trionesColorBgTextActive;
63
- }
64
-
65
- &-action-sheet {
66
-
67
- }
68
- }
69
-
70
-
1
+ @use "../style/variable" as variable;
2
+
3
+ $imagesWallCls: 'triones-antm-images-wall';
4
+
5
+ .#{$imagesWallCls} {
6
+ display: grid;
7
+ grid-gap: 4PX;
8
+ width: 100%;
9
+
10
+ &-item {
11
+ aspect-ratio: 1;
12
+ border-radius: variable.$trionesBorderRadius;
13
+ overflow: hidden;
14
+ position: relative;
15
+
16
+ &-inner {
17
+ width: 100%;
18
+ height: 100%;
19
+ }
20
+
21
+ &-close {
22
+ position: absolute;
23
+ top: 0;
24
+ right: 0;
25
+ background-color: rgb(0 0 0 / 63%);
26
+ width: 20Px;
27
+ height: 20Px;
28
+ border-bottom-left-radius: variable.$trionesBorderRadius;
29
+ display: flex;
30
+ justify-content: center;
31
+ align-items: center;
32
+
33
+ .triones-antm-icon {
34
+ color: white;
35
+ font-size: 12Px;
36
+ }
37
+ }
38
+
39
+ &-input {
40
+ position: absolute;
41
+ width: 100%;
42
+ height: 100%;
43
+ top: 0;
44
+ left: 0;
45
+ margin: 0;
46
+ padding: 0;
47
+ z-index: 1;
48
+ opacity: 0;
49
+ }
50
+
51
+ &-image {
52
+ width: 100%;
53
+ height: 100%;
54
+ object-fit: cover;
55
+ }
56
+ }
57
+
58
+ &-upload {
59
+ display: flex;
60
+ justify-content: center;
61
+ align-items: center;
62
+ background-color: variable.$trionesColorBgTextActive;
63
+ }
64
+
65
+ &-action-sheet {
66
+
67
+ }
68
+ }
69
+
70
+
@@ -1,3 +1,18 @@
1
- import { Input, InputProps, InputOPTProps, InputPasswordProps, InputTextareaProps } from "@trionesdev/antd-mobile-base-react";
2
- export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, };
1
+ import { Input as InternalInput } from "./input";
2
+ import { InputDigit, InputDigitProps } from "./input-digit";
3
+ import { InputNumber, InputNumberProps } from "./input-number";
4
+ import { InputPassword, InputPasswordProps } from "./input-password";
5
+ import { Textarea, InputTextareaProps } from "./textarea";
6
+ import "./index.scss";
7
+ import { InputOPT, InputOPTProps } from "./input-opt";
8
+ import { InputProps } from "./types";
9
+ type CompoundedComponent = typeof InternalInput & {
10
+ Password: typeof InputPassword;
11
+ OPT: typeof InputOPT;
12
+ Digit: typeof InputDigit;
13
+ Number: typeof InputNumber;
14
+ Textarea: typeof Textarea;
15
+ };
16
+ declare const Input: CompoundedComponent;
17
+ export type { InputOPTProps, InputPasswordProps, InputProps, InputTextareaProps, InputDigitProps, InputNumberProps };
3
18
  export default Input;
@@ -1,2 +1,14 @@
1
- import { Input } from "@trionesdev/antd-mobile-base-react";
1
+ import { Input as InternalInput } from "./input";
2
+ import { InputDigit } from "./input-digit";
3
+ import { InputNumber } from "./input-number";
4
+ import { InputPassword } from "./input-password";
5
+ import { Textarea } from "./textarea";
6
+ import "./index.scss";
7
+ import { InputOPT } from "./input-opt";
8
+ var Input = InternalInput;
9
+ Input.Password = InputPassword;
10
+ Input.OPT = InputOPT;
11
+ Input.Digit = InputDigit;
12
+ Input.Number = InputNumber;
13
+ Input.Textarea = Textarea;
2
14
  export default Input;