@trionesdev/antd-mobile-base-react 0.0.2-beta.7 → 0.0.2-beta.9

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 (82) hide show
  1. package/dist/Avatar/avatar.d.ts +2 -0
  2. package/dist/Avatar/avatar.js +5 -2
  3. package/dist/Cell/CellGroup.js +19 -5
  4. package/dist/Cell/cell.js +24 -8
  5. package/dist/Cell/context.d.ts +6 -0
  6. package/dist/Cell/styles.scss +3 -0
  7. package/dist/Cell/types.d.ts +13 -0
  8. package/dist/IndexedStack/IndexedStack.d.ts +9 -0
  9. package/dist/IndexedStack/IndexedStack.js +27 -0
  10. package/dist/IndexedStack/index.d.ts +3 -0
  11. package/dist/IndexedStack/index.js +2 -0
  12. package/dist/Skeleton/Skeleton.d.ts +27 -0
  13. package/dist/Skeleton/Skeleton.js +72 -0
  14. package/dist/Skeleton/index.d.ts +1 -0
  15. package/dist/Skeleton/index.js +1 -0
  16. package/dist/Skeleton/style.scss +48 -0
  17. package/dist/index.d.ts +2 -18
  18. package/dist/index.js +1 -9
  19. package/package.json +3 -3
  20. package/dist/ActionSheet/ActionSheet.d.ts +0 -25
  21. package/dist/ActionSheet/ActionSheet.js +0 -77
  22. package/dist/ActionSheet/index.d.ts +0 -3
  23. package/dist/ActionSheet/index.js +0 -2
  24. package/dist/ActionSheet/style.scss +0 -52
  25. package/dist/CascaderPicker/cascader-picker.d.ts +0 -27
  26. package/dist/CascaderPicker/cascader-picker.js +0 -88
  27. package/dist/CascaderPicker/index.d.ts +0 -3
  28. package/dist/CascaderPicker/index.js +0 -2
  29. package/dist/CascaderPicker/style.scss +0 -42
  30. package/dist/Mask/index.d.ts +0 -3
  31. package/dist/Mask/index.js +0 -2
  32. package/dist/Mask/mask-modal.d.ts +0 -45
  33. package/dist/Mask/mask-modal.js +0 -32
  34. package/dist/Mask/mask.d.ts +0 -5
  35. package/dist/Mask/mask.js +0 -19
  36. package/dist/Mask/style.scss +0 -20
  37. package/dist/Picker/index.d.ts +0 -3
  38. package/dist/Picker/index.js +0 -2
  39. package/dist/Picker/picker.d.ts +0 -19
  40. package/dist/Picker/picker.js +0 -97
  41. package/dist/Picker/style.scss +0 -41
  42. package/dist/PickerView/index.d.ts +0 -4
  43. package/dist/PickerView/index.js +0 -2
  44. package/dist/PickerView/picker-view-column-item.d.ts +0 -7
  45. package/dist/PickerView/picker-view-column-item.js +0 -11
  46. package/dist/PickerView/picker-view-column.d.ts +0 -10
  47. package/dist/PickerView/picker-view-column.js +0 -117
  48. package/dist/PickerView/picker-view.d.ts +0 -12
  49. package/dist/PickerView/picker-view.js +0 -60
  50. package/dist/PickerView/style.scss +0 -72
  51. package/dist/PickerView/types.d.ts +0 -4
  52. package/dist/PickerView/types.js +0 -1
  53. package/dist/Popup/index.d.ts +0 -5
  54. package/dist/Popup/index.js +0 -4
  55. package/dist/Popup/popup-modal.d.ts +0 -52
  56. package/dist/Popup/popup-modal.js +0 -74
  57. package/dist/Popup/popup.d.ts +0 -4
  58. package/dist/Popup/popup.js +0 -56
  59. package/dist/Popup/style.scss +0 -53
  60. package/dist/ScrollView/index.d.ts +0 -4
  61. package/dist/ScrollView/index.js +0 -2
  62. package/dist/ScrollView/scroll-view.d.ts +0 -4
  63. package/dist/ScrollView/scroll-view.js +0 -55
  64. package/dist/ScrollView/style.scss +0 -19
  65. package/dist/ScrollView/types.d.ts +0 -26
  66. package/dist/ScrollView/types.js +0 -1
  67. package/dist/SideBar/SideBarContext.d.ts +0 -18
  68. package/dist/SideBar/SideBarContext.js +0 -2
  69. package/dist/SideBar/index.d.ts +0 -3
  70. package/dist/SideBar/index.js +0 -2
  71. package/dist/SideBar/side-bar.d.ts +0 -25
  72. package/dist/SideBar/side-bar.js +0 -351
  73. package/dist/SideBar/style.scss +0 -85
  74. package/dist/SideBar/types.d.ts +0 -7
  75. package/dist/SideBar/types.js +0 -1
  76. package/dist/Toast/index.d.ts +0 -5
  77. package/dist/Toast/index.js +0 -3
  78. package/dist/Toast/style.scss +0 -63
  79. package/dist/Toast/toast-modal.d.ts +0 -18
  80. package/dist/Toast/toast-modal.js +0 -112
  81. package/dist/Toast/toast.d.ts +0 -7
  82. package/dist/Toast/toast.js +0 -78
@@ -8,6 +8,8 @@ export type AvatarProps = {
8
8
  size?: SizeType | number;
9
9
  src?: string | React.ReactNode;
10
10
  srcSet?: string;
11
+ onClick?: React.MouseEventHandler<HTMLDivElement>;
12
+ className?: string;
11
13
  style?: React.CSSProperties;
12
14
  children?: React.ReactNode;
13
15
  };
@@ -16,6 +16,8 @@ export var Avatar = function Avatar(_ref) {
16
16
  size = _ref$size === void 0 ? 32 : _ref$size,
17
17
  src = _ref.src,
18
18
  srcSet = _ref.srcSet,
19
+ onClick = _ref.onClick,
20
+ className = _ref.className,
19
21
  style = _ref.style,
20
22
  children = _ref.children;
21
23
  var clsPrefix = 'triones-antm-avatar';
@@ -30,12 +32,13 @@ export var Avatar = function Avatar(_ref) {
30
32
  }[size];
31
33
  }, [size]);
32
34
  return /*#__PURE__*/React.createElement("div", {
33
- className: classNames(clsPrefix, _defineProperty({}, "".concat(clsPrefix, "-").concat(shape !== 'square' ? 'circle' : 'square'), true)),
35
+ className: classNames(clsPrefix, _defineProperty({}, "".concat(clsPrefix, "-").concat(shape !== 'square' ? 'circle' : 'square'), true), className),
34
36
  style: _objectSpread({
35
37
  width: avatarSize,
36
38
  height: avatarSize,
37
39
  backgroundColor: src ? undefined : '#ccc'
38
- }, style)
40
+ }, style),
41
+ onClick: onClick
39
42
  }, src ? typeof src === 'string' ? /*#__PURE__*/React.createElement("img", {
40
43
  src: src,
41
44
  srcSet: srcSet,
@@ -1,3 +1,9 @@
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); }
1
7
  import classNames from 'classnames';
2
8
  import React from 'react';
3
9
  import { cls } from "./types";
@@ -13,7 +19,8 @@ export var CellGroup = function CellGroup(_ref) {
13
19
  labelCol = _ref.labelCol,
14
20
  labelAlign = _ref.labelAlign,
15
21
  wrapperAlign = _ref.wrapperAlign,
16
- divider = _ref.divider;
22
+ divider = _ref.divider,
23
+ styles = _ref.styles;
17
24
  var handleRender = function handleRender() {
18
25
  if (children) {
19
26
  if (Array.isArray(children)) {
@@ -38,12 +45,19 @@ export var CellGroup = function CellGroup(_ref) {
38
45
  labelCol: labelCol,
39
46
  labelAlign: labelAlign,
40
47
  wrapperAlign: wrapperAlign,
41
- extra: extra
48
+ extra: extra,
49
+ styles: {
50
+ cell: styles === null || styles === void 0 ? void 0 : styles.cell,
51
+ label: styles === null || styles === void 0 ? void 0 : styles.label,
52
+ content: styles === null || styles === void 0 ? void 0 : styles.content,
53
+ extra: styles === null || styles === void 0 ? void 0 : styles.extra
54
+ }
42
55
  }
43
56
  }, /*#__PURE__*/React.createElement("div", {
44
57
  className: classNames("".concat(cls, "-group"), className),
45
- style: style
58
+ style: _objectSpread(_objectSpread({}, style), styles === null || styles === void 0 ? void 0 : styles.container)
46
59
  }, title && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
47
- className: classNames("".concat(cls, "-group-title"))
48
- }, /*#__PURE__*/React.createElement("div", null, title))), handleRender()));
60
+ className: classNames("".concat(cls, "-group-title")),
61
+ style: styles === null || styles === void 0 ? void 0 : styles.title
62
+ }, title)), handleRender()));
49
63
  };
package/dist/Cell/cell.js CHANGED
@@ -1,7 +1,14 @@
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); }
1
7
  import classNames from 'classnames';
2
8
  import React, { useContext, useMemo } from 'react';
3
9
  import "./styles.scss";
4
10
  import { CellGroupContext } from "./context";
11
+ import { assign } from "lodash-es";
5
12
  var cls = 'triones-antm-cell';
6
13
  export var Cell = function Cell(_ref) {
7
14
  var className = _ref.className,
@@ -13,12 +20,14 @@ export var Cell = function Cell(_ref) {
13
20
  labelCol = _ref.labelCol,
14
21
  labelAlign = _ref.labelAlign,
15
22
  wrapperAlign = _ref.wrapperAlign,
16
- onClick = _ref.onClick;
23
+ onClick = _ref.onClick,
24
+ styles = _ref.styles;
17
25
  var _useContext = useContext(CellGroupContext),
18
26
  ctxLabelCol = _useContext.labelCol,
19
27
  ctxLabelAlign = _useContext.labelAlign,
20
28
  ctxWrapperAlign = _useContext.wrapperAlign,
21
- ctxExtra = _useContext.extra;
29
+ ctxExtra = _useContext.extra,
30
+ ctxStyles = _useContext.styles;
22
31
  var labelWidth = useMemo(function () {
23
32
  return (labelCol === null || labelCol === void 0 ? void 0 : labelCol.flex) || (ctxLabelCol === null || ctxLabelCol === void 0 ? void 0 : ctxLabelCol.flex) || 'auto';
24
33
  }, [labelCol, ctxLabelCol]);
@@ -48,22 +57,29 @@ export var Cell = function Cell(_ref) {
48
57
  return 'start';
49
58
  }
50
59
  }, [wrapperAlign, ctxWrapperAlign]);
60
+ var mergedStyles = assign({}, ctxStyles, styles);
61
+ if (style) {
62
+ mergedStyles.cell = assign(mergedStyles.cell, style);
63
+ }
51
64
  return /*#__PURE__*/React.createElement("div", {
52
65
  className: classNames(cls, className),
53
- style: style,
66
+ style: _objectSpread({}, mergedStyles.cell),
54
67
  onClick: onClick
55
68
  }, label && /*#__PURE__*/React.createElement("div", {
56
69
  className: classNames("".concat(cls, "-label")),
57
- style: {
70
+ style: _objectSpread({
58
71
  width: labelWidth,
59
72
  justifyContent: labelAlignStyle
60
- }
73
+ }, mergedStyles === null || mergedStyles === void 0 ? void 0 : mergedStyles.label)
61
74
  }, label), /*#__PURE__*/React.createElement("div", {
62
75
  className: classNames("".concat(cls, "-content")),
63
- style: {
76
+ style: _objectSpread({
64
77
  justifyContent: wrapperAlignStyle
65
- }
78
+ }, mergedStyles === null || mergedStyles === void 0 ? void 0 : mergedStyles.content)
66
79
  }, children || placeholder && /*#__PURE__*/React.createElement("div", {
67
80
  className: classNames("".concat(cls, "-placeholder"))
68
- }, placeholder)), extra || ctxExtra);
81
+ }, placeholder)), (extra || ctxExtra) && /*#__PURE__*/React.createElement("div", {
82
+ className: classNames("".concat(cls, "-extra")),
83
+ style: mergedStyles === null || mergedStyles === void 0 ? void 0 : mergedStyles.extra
84
+ }, extra || ctxExtra));
69
85
  };
@@ -6,6 +6,12 @@ type CellGroupContextType = {
6
6
  labelAlign?: align;
7
7
  wrapperAlign?: align;
8
8
  extra?: React.ReactNode;
9
+ styles?: {
10
+ cell?: React.CSSProperties;
11
+ label?: React.CSSProperties;
12
+ content?: React.CSSProperties;
13
+ extra?: React.CSSProperties;
14
+ };
9
15
  };
10
16
  export declare const CellGroupContext: React.Context<CellGroupContextType>;
11
17
  export {};
@@ -6,6 +6,7 @@ $cellCls: 'triones-antm-cell';
6
6
  padding-block: 4Px;
7
7
  display: flex;
8
8
  gap: 4Px;
9
+ align-items: center;
9
10
 
10
11
 
11
12
  &-label {
@@ -20,6 +21,8 @@ $cellCls: 'triones-antm-cell';
20
21
  }
21
22
 
22
23
  &-extra {
24
+ display: flex;
25
+ align-items: center;
23
26
  }
24
27
 
25
28
 
@@ -28,6 +28,11 @@ export type CellProps = {
28
28
  labelCol?: Col;
29
29
  labelAlign?: align;
30
30
  wrapperAlign?: align;
31
+ styles?: {
32
+ label?: React.CSSProperties;
33
+ content?: React.CSSProperties;
34
+ extra?: React.CSSProperties;
35
+ };
31
36
  };
32
37
  export type CellGroupProps = {
33
38
  className?: string;
@@ -46,4 +51,12 @@ export type CellGroupProps = {
46
51
  labelAlign?: align;
47
52
  wrapperAlign?: align;
48
53
  divider?: ReactNode;
54
+ styles?: {
55
+ container?: React.CSSProperties;
56
+ title?: React.CSSProperties;
57
+ cell?: React.CSSProperties;
58
+ label?: React.CSSProperties;
59
+ content?: React.CSSProperties;
60
+ extra?: React.CSSProperties;
61
+ };
49
62
  };
@@ -0,0 +1,9 @@
1
+ import React, { ReactNode } from 'react';
2
+ export interface IndexedStackProps {
3
+ children: ReactNode[];
4
+ activeIndex: number;
5
+ className?: string;
6
+ style?: React.CSSProperties;
7
+ }
8
+ declare const IndexedStack: React.FC<IndexedStackProps>;
9
+ export { IndexedStack };
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ var IndexedStack = function IndexedStack(_ref) {
3
+ var children = _ref.children,
4
+ _ref$activeIndex = _ref.activeIndex,
5
+ activeIndex = _ref$activeIndex === void 0 ? 0 : _ref$activeIndex,
6
+ className = _ref.className,
7
+ style = _ref.style;
8
+ // 确保 activeIndex 在有效范围内
9
+ var validActiveIndex = Math.max(0, Math.min(activeIndex, children.length - 1));
10
+ return /*#__PURE__*/React.createElement("div", {
11
+ className: className,
12
+ style: style
13
+ }, React.Children.map(children, function (child, index) {
14
+ if (! /*#__PURE__*/React.isValidElement(child)) {
15
+ return null;
16
+ }
17
+ return /*#__PURE__*/React.createElement("div", {
18
+ key: index,
19
+ style: {
20
+ display: index === validActiveIndex ? 'block' : 'none',
21
+ width: '100%',
22
+ height: '100%'
23
+ }
24
+ }, child);
25
+ }));
26
+ };
27
+ export { IndexedStack };
@@ -0,0 +1,3 @@
1
+ import { IndexedStack, IndexedStackProps } from './IndexedStack';
2
+ export type { IndexedStackProps };
3
+ export default IndexedStack;
@@ -0,0 +1,2 @@
1
+ import { IndexedStack } from "./IndexedStack";
2
+ export default IndexedStack;
@@ -0,0 +1,27 @@
1
+ import React from 'react';
2
+ import './style.scss';
3
+ export interface SkeletonProps {
4
+ /** 是否显示骨架屏 */
5
+ loading?: boolean;
6
+ /** 骨架屏类型:text, circle, rect */
7
+ type?: 'text' | 'circle' | 'rect';
8
+ /** 宽度 */
9
+ width?: string | number;
10
+ /** 高度 */
11
+ height?: string | number;
12
+ /** 圆角大小,仅在type为circle时生效 */
13
+ radius?: string | number;
14
+ /** 显示多行文本骨架,仅在type为text时生效 */
15
+ rows?: number;
16
+ /** 是否显示动画效果 */
17
+ animated?: boolean;
18
+ /** 自定义样式类名 */
19
+ className?: string;
20
+ /** 自定义内联样式 */
21
+ style?: React.CSSProperties;
22
+ /** 子元素 */
23
+ children?: React.ReactNode;
24
+ /** 是否是圆角矩形 */
25
+ round?: boolean;
26
+ }
27
+ export declare const Skeleton: React.FC<SkeletonProps>;
@@ -0,0 +1,72 @@
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 React from 'react';
8
+ import "./style.scss";
9
+ export var Skeleton = function Skeleton(_ref) {
10
+ var _ref$loading = _ref.loading,
11
+ loading = _ref$loading === void 0 ? true : _ref$loading,
12
+ _ref$type = _ref.type,
13
+ type = _ref$type === void 0 ? 'text' : _ref$type,
14
+ width = _ref.width,
15
+ height = _ref.height,
16
+ radius = _ref.radius,
17
+ _ref$rows = _ref.rows,
18
+ rows = _ref$rows === void 0 ? 1 : _ref$rows,
19
+ _ref$animated = _ref.animated,
20
+ animated = _ref$animated === void 0 ? true : _ref$animated,
21
+ _ref$className = _ref.className,
22
+ className = _ref$className === void 0 ? '' : _ref$className,
23
+ style = _ref.style,
24
+ children = _ref.children,
25
+ _ref$round = _ref.round,
26
+ round = _ref$round === void 0 ? false : _ref$round;
27
+ if (!loading || children) {
28
+ return /*#__PURE__*/React.createElement(React.Fragment, null, children);
29
+ }
30
+ var getSkeletonStyle = function getSkeletonStyle() {
31
+ var style = {};
32
+ if (width !== undefined) {
33
+ style.width = typeof width === 'number' ? "".concat(width, "px") : width;
34
+ }
35
+ if (height !== undefined) {
36
+ style.height = typeof height === 'number' ? "".concat(height, "px") : height;
37
+ }
38
+ if (type === 'circle') {
39
+ style.borderRadius = '50%';
40
+ if (radius !== undefined) {
41
+ style.width = typeof radius === 'number' ? "".concat(radius, "px") : radius;
42
+ style.height = typeof radius === 'number' ? "".concat(radius, "px") : radius;
43
+ }
44
+ } else if (round) {
45
+ style.borderRadius = '8px';
46
+ } else if (radius !== undefined) {
47
+ style.borderRadius = typeof radius === 'number' ? "".concat(radius, "px") : radius;
48
+ }
49
+ return style;
50
+ };
51
+ var renderSkeletonItems = function renderSkeletonItems() {
52
+ if (type === 'text') {
53
+ return Array.from({
54
+ length: rows
55
+ }).map(function (_, index) {
56
+ return /*#__PURE__*/React.createElement("div", {
57
+ key: index,
58
+ className: "skeleton-item skeleton-text ".concat(animated ? 'skeleton-animated' : '', " ").concat(className),
59
+ style: _objectSpread(_objectSpread({}, getSkeletonStyle()), style)
60
+ });
61
+ });
62
+ } else {
63
+ return /*#__PURE__*/React.createElement("div", {
64
+ className: "skeleton-item skeleton-".concat(type, " ").concat(animated ? 'skeleton-animated' : '', " ").concat(className),
65
+ style: _objectSpread(_objectSpread({}, getSkeletonStyle()), style)
66
+ });
67
+ }
68
+ };
69
+ return /*#__PURE__*/React.createElement("div", {
70
+ className: "skeleton-container"
71
+ }, renderSkeletonItems());
72
+ };
@@ -0,0 +1 @@
1
+ export { Skeleton } from './Skeleton';
@@ -0,0 +1 @@
1
+ export { Skeleton } from "./Skeleton";
@@ -0,0 +1,48 @@
1
+ .skeleton-container {
2
+ display: flex;
3
+ flex-direction: column;
4
+ gap: 12rpx;
5
+
6
+ .skeleton-item {
7
+ background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
8
+ background-size: 200% 100%;
9
+ background-position: 100% 0;
10
+ animation: skeleton-loading 1.5s infinite linear;
11
+
12
+ &.skeleton-animated {
13
+ animation: skeleton-loading 1.5s infinite linear;
14
+ }
15
+ }
16
+
17
+ .skeleton-text {
18
+ width: 100%;
19
+ height: 32rpx;
20
+ border-radius: 8rpx;
21
+ margin-bottom: 12rpx;
22
+ &:last-child {
23
+ margin-bottom: 0;
24
+ width: 70%;
25
+ }
26
+ }
27
+
28
+ .skeleton-circle {
29
+ width: 64rpx;
30
+ height: 64rpx;
31
+ border-radius: 50%;
32
+ }
33
+
34
+ .skeleton-rect {
35
+ width: 100%;
36
+ height: 128rpx;
37
+ border-radius: 16rpx;
38
+ }
39
+ }
40
+
41
+ @keyframes skeleton-loading {
42
+ 0% {
43
+ background-position: 100% 0;
44
+ }
45
+ 100% {
46
+ background-position: -100% 0;
47
+ }
48
+ }
package/dist/index.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import './style';
2
- export { default as ActionSheet } from "./ActionSheet";
3
- export type { ActionSheetProps } from './ActionSheet';
4
2
  export { default as Alert } from './Alert';
5
3
  export type { AlertProps } from './Alert';
6
4
  export { default as Avatar } from './Avatar';
@@ -9,8 +7,6 @@ export { default as Badge } from './Badge';
9
7
  export type { BadgeFill, BadgeProps } from './Badge';
10
8
  export { default as Card } from './Card';
11
9
  export type { CardProps } from './Card';
12
- export { default as CascaderPicker } from './CascaderPicker';
13
- export type { CascaderPickerProps } from './CascaderPicker';
14
10
  export { default as CascaderView } from './CascaderView';
15
11
  export type { CascaderViewProps } from './CascaderView';
16
12
  export { default as Cell } from './Cell';
@@ -35,22 +31,16 @@ export { default as Form, useFormContext } from './Form';
35
31
  export type { FormProps, FormLayout, FormLayoutAlign, FormItemLayout } from './Form';
36
32
  export { default as Grid } from './Grid';
37
33
  export type { GridProps, GridItemProps } from './Grid';
34
+ export { default as IndexedStack } from './IndexedStack';
35
+ export type { IndexedStackProps } from './IndexedStack';
38
36
  export { default as InputNumber } from './InputNumber';
39
37
  export type { InputNumberProps } from './InputNumber';
40
- export { default as Mask } from "./Mask";
41
- export type { MaskProps } from "./Mask";
42
38
  export { default as NavBar } from './NavBar';
43
39
  export type { NavBarProps } from './NavBar';
44
40
  export { default as NoticeBar } from './NoticeBar';
45
41
  export type { NoticeBarProps } from './NoticeBar';
46
42
  export { default as PageIndicator } from './PageIndicator';
47
43
  export type { PageIndicatorProps } from './PageIndicator';
48
- export { default as Picker } from './Picker';
49
- export type { PickerProps } from './Picker';
50
- export { default as PickerView } from './PickerView';
51
- export type { PickerViewProps, PickerColumnOption } from './PickerView';
52
- export { default as Popup, PopupModal } from './Popup';
53
- export type { PopupProps } from './Popup';
54
44
  export { default as Progress } from './Progress';
55
45
  export type { ProgressProps } from './Progress';
56
46
  export { default as Radio } from './Radio';
@@ -63,10 +53,6 @@ export { default as SafeArea } from './SafeArea';
63
53
  export type { SafeAreaProps } from './SafeArea';
64
54
  export { default as Scaffold } from './Scaffold';
65
55
  export type { ScaffoldProps } from './Scaffold';
66
- export { default as ScrollView } from './ScrollView';
67
- export type { ScrollViewProps } from './ScrollView';
68
- export { default as SideBar } from './SideBar';
69
- export type { SideBarProps } from './SideBar';
70
56
  export { default as Space } from './Space';
71
57
  export type { SpaceProps } from './Space';
72
58
  export { default as SpinLoading } from './SpinLoading';
@@ -79,8 +65,6 @@ export { default as TabBar } from './TabBar';
79
65
  export type { TabBarProps } from './TabBar';
80
66
  export { default as Tag } from './Tag';
81
67
  export type { TagProps } from './Tag';
82
- export { default as Toast } from './Toast';
83
- export type { ToastProps } from './Toast';
84
68
  export { default as Tabs } from './Tabs';
85
69
  export type { TabsProps } from './Tabs';
86
70
  export { default as WaterMark } from './WaterMark';
package/dist/index.js CHANGED
@@ -1,10 +1,8 @@
1
1
  import "./style";
2
- export { default as ActionSheet } from "./ActionSheet";
3
2
  export { default as Alert } from "./Alert";
4
3
  export { default as Avatar } from "./Avatar";
5
4
  export { default as Badge } from "./Badge";
6
5
  export { default as Card } from "./Card";
7
- export { default as CascaderPicker } from "./CascaderPicker";
8
6
  export { default as CascaderView } from "./CascaderView";
9
7
  export { default as Cell } from "./Cell";
10
8
  export { default as Checkbox } from "./Checkbox";
@@ -17,29 +15,23 @@ export { default as ErrorBlock, createErrorBlock } from "./ErrorBlock";
17
15
  export { default as Footer } from "./Footer";
18
16
  export { default as Form, useFormContext } from "./Form";
19
17
  export { default as Grid } from "./Grid";
18
+ export { default as IndexedStack } from "./IndexedStack";
20
19
  export { default as InputNumber } from "./InputNumber";
21
- export { default as Mask } from "./Mask";
22
20
  export { default as NavBar } from "./NavBar";
23
21
  export { default as NoticeBar } from "./NoticeBar";
24
22
  export { default as PageIndicator } from "./PageIndicator";
25
- export { default as Picker } from "./Picker";
26
- export { default as PickerView } from "./PickerView";
27
- export { default as Popup, PopupModal } from "./Popup";
28
23
  export { default as Progress } from "./Progress";
29
24
  export { default as Radio } from "./Radio";
30
25
  export { default as Rate } from "./Rate";
31
26
  export { default as Result } from "./Result";
32
27
  export { default as SafeArea } from "./SafeArea";
33
28
  export { default as Scaffold } from "./Scaffold";
34
- export { default as ScrollView } from "./ScrollView";
35
- export { default as SideBar } from "./SideBar";
36
29
  export { default as Space } from "./Space";
37
30
  export { default as SpinLoading } from "./SpinLoading";
38
31
  export { default as Steps } from "./Steps";
39
32
  export { default as Switch } from "./Switch";
40
33
  export { default as TabBar } from "./TabBar";
41
34
  export { default as Tag } from "./Tag";
42
- export { default as Toast } from "./Toast";
43
35
  export { default as Tabs } from "./Tabs";
44
36
  export { default as WaterMark } from "./WaterMark";
45
37
  export * from "./types";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trionesdev/antd-mobile-base-react",
3
- "version": "0.0.2-beta.7",
3
+ "version": "0.0.2-beta.9",
4
4
  "description": "antd mobile base react",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -48,7 +48,7 @@
48
48
  "runes2": "^1.1.4"
49
49
  },
50
50
  "optionalDependencies": {
51
- "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.7"
51
+ "@trionesdev/antd-mobile-icons-react": "0.0.2-beta.9"
52
52
  },
53
- "gitHead": "dda211e5c6e5ddc80ba9045b0cdec0b4b5297e4e"
53
+ "gitHead": "c062f3bd8651ea933f9385279c05a1ab0245b2b8"
54
54
  }
@@ -1,25 +0,0 @@
1
- import React, { FC } from "react";
2
- import "./style.scss";
3
- type ActionSheetActionItemType = {
4
- key?: any;
5
- children?: React.ReactNode;
6
- onClick?: () => void;
7
- };
8
- export type ActionSheetProps = {
9
- className?: string;
10
- style?: React.CSSProperties;
11
- open?: boolean;
12
- afterOpenChange?: (open: boolean) => void;
13
- title?: React.ReactNode;
14
- actions?: ActionSheetActionItemType[];
15
- cancel?: React.ReactNode | false;
16
- onCancel?: () => void;
17
- onClose?: () => void;
18
- /**
19
- * @description 点击操作项后是否关闭
20
- * @default true
21
- */
22
- closeAfterClickAction?: boolean;
23
- };
24
- export declare const ActionSheet: FC<ActionSheetProps>;
25
- export {};
@@ -1,77 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React from "react";
8
- import Popup from "../Popup";
9
- import classNames from "classnames";
10
- import "./style.scss";
11
- var cls = 'triones-antm-action-sheet';
12
- export var ActionSheet = function ActionSheet(_ref) {
13
- var className = _ref.className,
14
- style = _ref.style,
15
- open = _ref.open,
16
- afterOpenChange = _ref.afterOpenChange,
17
- title = _ref.title,
18
- actions = _ref.actions,
19
- cancel = _ref.cancel,
20
- onCancel = _ref.onCancel,
21
- onClose = _ref.onClose,
22
- _ref$closeAfterClickA = _ref.closeAfterClickAction,
23
- closeAfterClickAction = _ref$closeAfterClickA === void 0 ? true : _ref$closeAfterClickA;
24
- var _React$useState = React.useState(open || false),
25
- _React$useState2 = _slicedToArray(_React$useState, 2),
26
- innerOpen = _React$useState2[0],
27
- setInnerOpen = _React$useState2[1];
28
- var handleClose = function handleClose() {
29
- setInnerOpen(false);
30
- onClose === null || onClose === void 0 || onClose();
31
- };
32
- React.useEffect(function () {
33
- if (open === undefined) {
34
- return;
35
- }
36
- if (open === innerOpen) {
37
- return;
38
- }
39
- setInnerOpen(open);
40
- }, [open]);
41
- React.useEffect(function () {
42
- afterOpenChange === null || afterOpenChange === void 0 || afterOpenChange(innerOpen);
43
- }, [innerOpen]);
44
- return /*#__PURE__*/React.createElement(Popup, {
45
- open: open,
46
- afterClose: function afterClose() {
47
- setInnerOpen(false);
48
- }
49
- }, /*#__PURE__*/React.createElement("div", {
50
- className: classNames(cls, className),
51
- style: style
52
- }, /*#__PURE__*/React.createElement("div", {
53
- className: classNames("".concat(cls, "-body"))
54
- }, title && /*#__PURE__*/React.createElement("div", {
55
- className: classNames("".concat(cls, "-title"))
56
- }, title), actions && /*#__PURE__*/React.createElement("div", {
57
- className: classNames("".concat(cls, "-actions"))
58
- }, actions.map(function (action) {
59
- return /*#__PURE__*/React.createElement("div", {
60
- className: "".concat(cls, "-actions-item"),
61
- key: action.key,
62
- onClick: function onClick() {
63
- var _action$onClick;
64
- (_action$onClick = action.onClick) === null || _action$onClick === void 0 || _action$onClick.call(action);
65
- if (closeAfterClickAction) {
66
- handleClose();
67
- }
68
- }
69
- }, action.children);
70
- }))), cancel !== false && /*#__PURE__*/React.createElement("div", {
71
- className: classNames("".concat(cls, "-cancel")),
72
- onClick: function onClick() {
73
- onCancel === null || onCancel === void 0 || onCancel();
74
- handleClose();
75
- }
76
- }, cancel || /*#__PURE__*/React.createElement("div", null, "\u53D6\u6D88"))));
77
- };
@@ -1,3 +0,0 @@
1
- import { ActionSheet, ActionSheetProps } from "./ActionSheet";
2
- export type { ActionSheetProps };
3
- export default ActionSheet;
@@ -1,2 +0,0 @@
1
- import { ActionSheet } from "./ActionSheet";
2
- export default ActionSheet;