@power-xa/m-ui 0.0.1

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 (95) hide show
  1. package/README.md +21 -0
  2. package/dist/ActionSheet/index.d.ts +16 -0
  3. package/dist/ActionSheet/index.js +79 -0
  4. package/dist/ActionSheet/index.less +39 -0
  5. package/dist/Breadcrumb/index.d.ts +14 -0
  6. package/dist/Breadcrumb/index.js +31 -0
  7. package/dist/Breadcrumb/index.less +28 -0
  8. package/dist/Button/index.d.ts +16 -0
  9. package/dist/Button/index.js +53 -0
  10. package/dist/Button/index.less +42 -0
  11. package/dist/ConfigProvider/index.d.ts +23 -0
  12. package/dist/ConfigProvider/index.js +41 -0
  13. package/dist/CreatorEdit/index.d.ts +12 -0
  14. package/dist/CreatorEdit/index.js +70 -0
  15. package/dist/CreatorEdit/index.less +41 -0
  16. package/dist/Drawer/index.d.ts +12 -0
  17. package/dist/Drawer/index.js +71 -0
  18. package/dist/Drawer/index.less +24 -0
  19. package/dist/Empty/index.d.ts +12 -0
  20. package/dist/Empty/index.js +18 -0
  21. package/dist/Empty/index.less +15 -0
  22. package/dist/FloatButton/index.d.ts +10 -0
  23. package/dist/FloatButton/index.js +60 -0
  24. package/dist/FloatButton/index.less +26 -0
  25. package/dist/Grid/index.d.ts +15 -0
  26. package/dist/Grid/index.js +26 -0
  27. package/dist/Grid/index.less +4 -0
  28. package/dist/PageContainer/index.d.ts +17 -0
  29. package/dist/PageContainer/index.js +50 -0
  30. package/dist/PageContainer/index.less +41 -0
  31. package/dist/Popup/index.d.ts +13 -0
  32. package/dist/Popup/index.js +65 -0
  33. package/dist/Popup/index.less +22 -0
  34. package/dist/ProForm/Field/index.d.ts +8 -0
  35. package/dist/ProForm/Field/index.js +33 -0
  36. package/dist/ProForm/Field/index.less +96 -0
  37. package/dist/ProForm/Form/index.d.ts +7 -0
  38. package/dist/ProForm/Form/index.js +145 -0
  39. package/dist/ProForm/Form/index.less +61 -0
  40. package/dist/ProForm/Group/index.d.ts +7 -0
  41. package/dist/ProForm/Group/index.js +73 -0
  42. package/dist/ProForm/Group/index.less +32 -0
  43. package/dist/ProForm/controls/Date/index.d.ts +3 -0
  44. package/dist/ProForm/controls/Date/index.js +141 -0
  45. package/dist/ProForm/controls/List/index.d.ts +23 -0
  46. package/dist/ProForm/controls/List/index.js +77 -0
  47. package/dist/ProForm/controls/List/index.less +53 -0
  48. package/dist/ProForm/controls/Select/index.d.ts +4 -0
  49. package/dist/ProForm/controls/Select/index.js +263 -0
  50. package/dist/ProForm/controls/Select/index.less +120 -0
  51. package/dist/ProForm/controls/Text/index.d.ts +4 -0
  52. package/dist/ProForm/controls/Text/index.js +29 -0
  53. package/dist/ProForm/controls/Text/index.less +7 -0
  54. package/dist/ProForm/controls/TextArea/index.d.ts +4 -0
  55. package/dist/ProForm/controls/TextArea/index.js +63 -0
  56. package/dist/ProForm/controls/TextArea/index.less +46 -0
  57. package/dist/ProForm/controls/Upload/index.d.ts +4 -0
  58. package/dist/ProForm/controls/Upload/index.js +383 -0
  59. package/dist/ProForm/controls/Upload/index.less +174 -0
  60. package/dist/ProForm/index.d.ts +9 -0
  61. package/dist/ProForm/index.js +5 -0
  62. package/dist/ProForm/typings.d.ts +164 -0
  63. package/dist/ProList/index.d.ts +78 -0
  64. package/dist/ProList/index.js +323 -0
  65. package/dist/ProList/index.less +318 -0
  66. package/dist/RefreshList/index.d.ts +17 -0
  67. package/dist/RefreshList/index.js +43 -0
  68. package/dist/RefreshList/index.less +19 -0
  69. package/dist/Skeleton/index.d.ts +5 -0
  70. package/dist/Skeleton/index.js +37 -0
  71. package/dist/Skeleton/index.less +7 -0
  72. package/dist/Tabbar/index.d.ts +13 -0
  73. package/dist/Tabbar/index.js +77 -0
  74. package/dist/Tabbar/index.less +44 -0
  75. package/dist/Tabs/index.d.ts +26 -0
  76. package/dist/Tabs/index.js +186 -0
  77. package/dist/Tabs/index.less +249 -0
  78. package/dist/assets/fonts/PingFangSC-Light.ttf +0 -0
  79. package/dist/assets/fonts/PingFangSC-Medium.ttf +0 -0
  80. package/dist/assets/fonts/PingFangSC-Regular.ttf +0 -0
  81. package/dist/assets/less/mixins.less +37 -0
  82. package/dist/global.less +0 -0
  83. package/dist/index.d.ts +25 -0
  84. package/dist/index.js +27 -0
  85. package/dist/request/index.d.ts +8 -0
  86. package/dist/request/index.js +61 -0
  87. package/dist/services/FileController/index.d.ts +12 -0
  88. package/dist/services/FileController/index.js +39 -0
  89. package/dist/services/FileController/typings.d.ts +52 -0
  90. package/dist/services/index.d.ts +2 -0
  91. package/dist/services/index.js +2 -0
  92. package/dist/services/typings.d.ts +25 -0
  93. package/dist/utils/tools.d.ts +33 -0
  94. package/dist/utils/tools.js +231 -0
  95. package/package.json +88 -0
@@ -0,0 +1,186 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ 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; }
8
+ 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; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ 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); }
11
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
+ 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."); }
13
+ 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); }
14
+ 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; }
15
+ 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; } }
16
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
+ import React, { useCallback, useEffect, useState, cloneElement } from "react";
18
+ import { ScrollView, Swiper, SwiperItem, Text, View } from "@tarojs/components";
19
+ import { createSelectorQuery } from "@tarojs/taro";
20
+ import "./index.less";
21
+ var Tabs = function Tabs(_ref) {
22
+ var _items$, _tabsList$find2;
23
+ var items = _ref.items,
24
+ onChange = _ref.onChange,
25
+ activeKey = _ref.activeKey,
26
+ extra = _ref.extra,
27
+ _ref$swipeable = _ref.swipeable,
28
+ swipeable = _ref$swipeable === void 0 ? true : _ref$swipeable,
29
+ _ref$segmented = _ref.segmented,
30
+ segmented = _ref$segmented === void 0 ? false : _ref$segmented,
31
+ _ref$lazy = _ref.lazy,
32
+ lazy = _ref$lazy === void 0 ? false : _ref$lazy,
33
+ className = _ref.className,
34
+ isCardList = _ref.isCardList,
35
+ centered = _ref.centered;
36
+ var _useState = useState([]),
37
+ _useState2 = _slicedToArray(_useState, 2),
38
+ tabsList = _useState2[0],
39
+ setTabsList = _useState2[1];
40
+ var _useState3 = useState(activeKey || (items === null || items === void 0 || (_items$ = items[0]) === null || _items$ === void 0 ? void 0 : _items$.key) || ""),
41
+ _useState4 = _slicedToArray(_useState3, 2),
42
+ selectKey = _useState4[0],
43
+ setSelectKey = _useState4[1];
44
+ var _useState5 = useState(-1),
45
+ _useState6 = _slicedToArray(_useState5, 2),
46
+ parentLeft = _useState6[0],
47
+ setParentLeft = _useState6[1];
48
+ var _useState7 = useState(0),
49
+ _useState8 = _slicedToArray(_useState7, 2),
50
+ left = _useState8[0],
51
+ setLeft = _useState8[1];
52
+ var _useState9 = useState(150),
53
+ _useState10 = _slicedToArray(_useState9, 2),
54
+ height = _useState10[0],
55
+ setHeight = _useState10[1];
56
+ useEffect(function () {
57
+ if (items.length) {
58
+ setSelectKey(activeKey || items[0].key);
59
+ setTabsList(items.map(function (item, index) {
60
+ return _objectSpread(_objectSpread({}, item), {}, {
61
+ init: !lazy ? true : (activeKey ? item.key === activeKey : index === 0) ? true : false
62
+ });
63
+ }));
64
+ if (!segmented) getParentPosition();
65
+ if (swipeable) {
66
+ getSwiperHeight();
67
+ }
68
+ }
69
+ }, []);
70
+ useEffect(function () {
71
+ var _tabsList$find;
72
+ if (selectKey !== activeKey) onChange === null || onChange === void 0 || onChange(selectKey);
73
+ if (tabsList.length && !((_tabsList$find = tabsList.find(function (item) {
74
+ return item.key === selectKey;
75
+ })) !== null && _tabsList$find !== void 0 && _tabsList$find.init)) {
76
+ var index = tabsList.findIndex(function (item) {
77
+ return item.key === selectKey;
78
+ });
79
+ tabsList[index].init = true;
80
+ setTabsList(_toConsumableArray(tabsList));
81
+ }
82
+ if (parentLeft >= 0 && !segmented) {
83
+ getIndicatorPosition();
84
+ }
85
+ }, [selectKey, parentLeft]);
86
+ var getParentPosition = useCallback(function () {
87
+ var query = createSelectorQuery();
88
+ query.select("#p-tabs-nav-list-scroll").boundingClientRect(function (rect) {
89
+ if (!(rect instanceof Array)) setParentLeft(rect.left);
90
+ }).exec();
91
+ }, [tabsList]);
92
+ var getSwiperHeight = useCallback(function () {
93
+ var query = createSelectorQuery();
94
+ query.selectAll("#swiper-tab-content").boundingClientRect(function (rect) {
95
+ if (rect instanceof Array) {
96
+ var _height = Math.max.apply(Math, _toConsumableArray(rect.map(function (item) {
97
+ return item.height;
98
+ })));
99
+ setHeight(_height);
100
+ }
101
+ }).exec();
102
+ }, []);
103
+ var getIndicatorPosition = useCallback(function () {
104
+ if (tabsList.length && selectKey) {
105
+ var query = createSelectorQuery();
106
+ var id = "#tab-nav-".concat(selectKey);
107
+ query.select(id).boundingClientRect(function (rect) {
108
+ if (!(rect instanceof Array)) {
109
+ var _left = rect.left,
110
+ width = rect.width;
111
+ setLeft(_left + width / 2 - 8 - parentLeft);
112
+ }
113
+ }).exec();
114
+ }
115
+ }, [tabsList, selectKey, parentLeft]);
116
+ return /*#__PURE__*/React.createElement(View, {
117
+ className: "p-tabs-container ".concat(className, " ").concat(isCardList ? 'p-tabs-card-list-container' : '', " ").concat(centered ? 'p-tabs-centered-container' : '')
118
+ }, /*#__PURE__*/React.createElement(View, {
119
+ className: "p-tabs-nav-list"
120
+ }, /*#__PURE__*/React.createElement(View, {
121
+ className: "extra-content left"
122
+ }, extra === null || extra === void 0 ? void 0 : extra.left), /*#__PURE__*/React.createElement(ScrollView, {
123
+ scrollX: true,
124
+ enableFlex: true,
125
+ enhanced: true,
126
+ showScrollbar: false,
127
+ className: "p-tabs-nav-list-scroll",
128
+ scrollIntoView: 'tab-nav-' + selectKey,
129
+ id: "p-tabs-nav-list-scroll"
130
+ }, tabsList.map(function (item) {
131
+ return /*#__PURE__*/React.createElement(View, {
132
+ className: "p-tabs-nav-label ".concat(segmented ? "segmented" : "", " ").concat(selectKey === item.key ? 'selected' : ''),
133
+ key: 'tab-nav-' + item.key,
134
+ id: 'tab-nav-' + item.key,
135
+ onTap: function onTap() {
136
+ return setSelectKey(item.key);
137
+ }
138
+ }, item.icon && /*#__PURE__*/React.createElement(View, {
139
+ className: "iconfont ".concat(item.icon)
140
+ }), /*#__PURE__*/React.createElement(Text, {
141
+ className: "p-tabs-nav-label-text"
142
+ }, item.label));
143
+ })), !segmented && /*#__PURE__*/React.createElement(View, {
144
+ className: "p-tabs-indicator-line",
145
+ style: {
146
+ left: left + "px"
147
+ }
148
+ }), /*#__PURE__*/React.createElement(View, {
149
+ className: "extra-content right"
150
+ }, extra === null || extra === void 0 ? void 0 : extra.right)), /*#__PURE__*/React.createElement(View, {
151
+ className: "p-tabs-content"
152
+ }, swipeable ? /*#__PURE__*/React.createElement(Swiper, {
153
+ current: tabsList.findIndex(function (item) {
154
+ return item.key === selectKey;
155
+ }),
156
+ onChange: function onChange(e) {
157
+ return setSelectKey(tabsList[e.detail.current].key);
158
+ },
159
+ adjustHeight: "highest",
160
+ style: {
161
+ height: height
162
+ },
163
+ className: "p-tabs-content-swiper"
164
+ }, tabsList.map(function (item) {
165
+ return /*#__PURE__*/React.createElement(SwiperItem, {
166
+ key: 'tab-content-' + item.key,
167
+ className: "swiper-tab-content"
168
+ }, /*#__PURE__*/React.createElement(View, {
169
+ id: "swiper-tab-content",
170
+ className: "swiper-tab-content-view"
171
+ }, item.init && item.children && /*#__PURE__*/cloneElement(item.children, _objectSpread(_objectSpread({}, item.children.props), {}, {
172
+ onRefresh: function onRefresh(keys) {
173
+ keys.forEach(function (item) {
174
+ var tab = tabsList.find(function (tab) {
175
+ return tab.key === item;
176
+ });
177
+ if (tab !== null && tab !== void 0 && tab.init) tab.init = false;
178
+ });
179
+ setTabsList(_toConsumableArray(tabsList));
180
+ }
181
+ }))));
182
+ })) : (_tabsList$find2 = tabsList.find(function (item) {
183
+ return item.key === selectKey;
184
+ })) === null || _tabsList$find2 === void 0 ? void 0 : _tabsList$find2.children));
185
+ };
186
+ export default Tabs;
@@ -0,0 +1,249 @@
1
+ @import "@power-xa/m-ui/dist/assets/less/mixins.less";
2
+
3
+ .p-tabs-container {
4
+ .p-tabs-nav-list {
5
+ display: flex;
6
+ align-items: center;
7
+ position: relative;
8
+
9
+ .p-tabs-nav-list-scroll {
10
+ display: flex;
11
+ align-items: flex-start;
12
+
13
+ .p-tabs-nav-label {
14
+ display: flex;
15
+ align-items: center;
16
+ padding: 18px 0;
17
+ margin: 0 10px;
18
+
19
+ .iconfont {
20
+ font-size: 24px;
21
+ color: #7D7E80;
22
+ }
23
+
24
+ .p-tabs-nav-label-text {
25
+ .font(24, #7D7E80)
26
+ }
27
+
28
+ &.selected {
29
+ .p-tabs-nav-label-text {
30
+ .font(24, #333437, Regular, 500)
31
+ }
32
+ }
33
+
34
+ &.segmented {
35
+ padding: 12px 24px;
36
+ box-sizing: border-box;
37
+ justify-content: center;
38
+ background: #F5F6F7;
39
+ border-radius: 58px;
40
+
41
+ .iconfont {
42
+ font-size: 24px;
43
+ color: #333437;
44
+ }
45
+
46
+ .p-tabs-nav-label-text {
47
+ .font(24, #333437)
48
+ }
49
+
50
+ &.selected {
51
+ background: #333437;
52
+
53
+ .iconfont,
54
+ .p-tabs-nav-label-text {
55
+ color: #fff;
56
+ }
57
+ }
58
+ }
59
+
60
+ &:nth-of-type(1) {
61
+ margin-left: 0;
62
+ }
63
+
64
+ &:nth-last-of-type(1) {
65
+ margin-right: 0;
66
+ }
67
+ }
68
+ }
69
+
70
+ .p-tabs-indicator-line {
71
+ width: 32px;
72
+ height: 4px;
73
+ background: #333437;
74
+ border-radius: 4px;
75
+ position: absolute;
76
+ bottom: 0;
77
+ transition: left .3s;
78
+ }
79
+ }
80
+
81
+ .swiper-tab-content {
82
+ height: max-content;
83
+ }
84
+
85
+ &.p-tabs-card-list-container {
86
+ width: 100%;
87
+ height: 100%;
88
+ display: flex;
89
+ flex-direction: column;
90
+ padding: 32px;
91
+ box-sizing: border-box;
92
+ background: #F6F7F9;
93
+
94
+ .p-tabs-nav-list {
95
+
96
+ .p-tabs-nav-label.segmented {
97
+ background: #FFF !important;
98
+
99
+ &.selected {
100
+ background: #333437 !important;
101
+ }
102
+ }
103
+
104
+ .extra-content.right {
105
+ display: flex;
106
+ align-items: center;
107
+ gap: 20px;
108
+
109
+ .icon-button {
110
+ width: 56px;
111
+ height: 56px;
112
+ border-radius: 50%;
113
+ background: #FFF;
114
+ display: flex;
115
+ align-items: center;
116
+ justify-content: center;
117
+
118
+ .iconfont {
119
+ font-size: 24px;
120
+ color: #333437;
121
+ }
122
+ }
123
+ }
124
+ }
125
+
126
+ .p-tabs-content {
127
+ flex: 1;
128
+ height: 0;
129
+ margin: 0 -32px;
130
+
131
+ .p-tabs-content-swiper {
132
+ width: 100%;
133
+ height: 100% !important;
134
+
135
+ #swiper-tab-content {
136
+ width: 100%;
137
+ height: 100%;
138
+
139
+ .p-refresh-card-list-container {
140
+ width: 100%;
141
+ height: 100%;
142
+
143
+ .p-refresh-card-data-skeleton {
144
+ margin-bottom: 24px;
145
+ background: #fff;
146
+ border-radius: 28px;
147
+ padding: 42px 24px 30px;
148
+ box-sizing: border-box;
149
+ display: flex;
150
+ flex-direction: column;
151
+ gap: 28px;
152
+ position: relative;
153
+
154
+ .header {
155
+ display: flex;
156
+ align-items: flex-start;
157
+ gap: 24px;
158
+
159
+ .image {
160
+ width: 200px;
161
+ height: 150px;
162
+ }
163
+
164
+ .title {
165
+ flex: 1;
166
+ width: 0;
167
+ display: flex;
168
+ flex-direction: column;
169
+ gap: 6px;
170
+
171
+ .title-skeleton {
172
+ height: 40px;
173
+ width: 100%;
174
+ }
175
+ }
176
+ }
177
+
178
+ .content {
179
+ display: flex;
180
+ flex-direction: column;
181
+ gap: 20px;
182
+
183
+ .row {
184
+ display: flex;
185
+ align-items: center;
186
+ gap: 28px;
187
+
188
+ .label {
189
+ height: 34px;
190
+ flex: 1;
191
+ }
192
+
193
+ .value {
194
+ height: 34px;
195
+ flex: 3;
196
+ }
197
+ }
198
+ }
199
+
200
+ .footer {
201
+ display: flex;
202
+ align-items: center;
203
+ justify-content: space-between;
204
+ padding-top: 24px;
205
+ box-sizing: border-box;
206
+ border-top: 1px solid rgba(51, 52, 55, 0.10);
207
+
208
+ .creator {
209
+ display: flex;
210
+ align-items: center;
211
+ gap: 20px;
212
+
213
+ .avatar {
214
+ width: 46px;
215
+ height: 46px;
216
+ border-radius: 12px;
217
+ }
218
+
219
+ .text {
220
+ width: 100px;
221
+ height: 34px;
222
+ }
223
+ }
224
+
225
+ .time {
226
+ width: 120px;
227
+ height: 34px;
228
+ }
229
+ }
230
+ }
231
+ }
232
+
233
+
234
+ }
235
+ }
236
+ }
237
+ }
238
+
239
+ &.p-tabs-centered-container {
240
+ .p-tabs-nav-list {
241
+ justify-content: center;
242
+
243
+ .p-tabs-nav-label {
244
+ flex: 1;
245
+ justify-content: center;
246
+ }
247
+ }
248
+ }
249
+ }
@@ -0,0 +1,37 @@
1
+ .font(@size: 28, @color: #333437, @family: Light, @weight: 400) {
2
+
3
+ // 根据字号设置不同样式
4
+ & when (@size=20) {
5
+ font-size: 20px;
6
+ line-height: 28px;
7
+ }
8
+
9
+ & when (@size=24) {
10
+ font-size: 24px;
11
+ line-height: 34px;
12
+ }
13
+
14
+ & when (@size=28) {
15
+ font-size: 28px;
16
+ line-height: 40px;
17
+ }
18
+
19
+ & when (@size=32) {
20
+ font-size: 32px;
21
+ line-height: 44px;
22
+ }
23
+
24
+ & when (@size=36) {
25
+ font-size: 36px;
26
+ line-height: 50px;
27
+ }
28
+
29
+ & when (@size=60) {
30
+ font-size: 60px;
31
+ line-height: 84px;
32
+ }
33
+
34
+ color: @color;
35
+ font-weight: @weight;
36
+ font-family:~'"PingFang SC-@{family}, PingFang SC"';
37
+ }
File without changes
@@ -0,0 +1,25 @@
1
+ export { request } from "./request";
2
+ export { default as Button } from './Button';
3
+ export { default as PageContainer } from './PageContainer';
4
+ export { default as Tabs } from './Tabs';
5
+ export { default as RefreshList } from './RefreshList';
6
+ export { default as Skeleton } from './Skeleton';
7
+ export { default as Drawer } from './Drawer';
8
+ export { default as Popup } from './Popup';
9
+ export { default as Grid } from './Grid';
10
+ export { default as Tabbar } from './Tabbar';
11
+ export { default as ProList } from './ProList';
12
+ export { default as FloatButton } from './FloatButton';
13
+ export { default as Breadcrumb } from './Breadcrumb';
14
+ export { default as ConfigProvider } from './ConfigProvider';
15
+ export { default as CreatorEdit } from './CreatorEdit';
16
+ export { default as Empty } from './Empty';
17
+ export { default as ActionSheet } from './ActionSheet';
18
+ export { default as ProForm } from './ProForm';
19
+ export { default as ProFormText } from './ProForm/controls/Text';
20
+ export { default as ProFormTextArea } from './ProForm/controls/TextArea';
21
+ export { default as ProFormDate } from './ProForm/controls/Date';
22
+ export { default as ProFormUpload } from './ProForm/controls/Upload';
23
+ export { default as ProFormSelect } from './ProForm/controls/Select';
24
+ export { default as ProFormList } from './ProForm/controls/List';
25
+ export { getQueryParams, getListAssignField, dateFormat, getSimplifyDay, getUUID, getFileExt, getFileType, clipFileUrl } from "./utils/tools";
package/dist/index.js ADDED
@@ -0,0 +1,27 @@
1
+ export { request } from "./request";
2
+ export { default as Button } from "./Button";
3
+ export { default as PageContainer } from "./PageContainer";
4
+ export { default as Tabs } from "./Tabs";
5
+ export { default as RefreshList } from "./RefreshList";
6
+ export { default as Skeleton } from "./Skeleton";
7
+ export { default as Drawer } from "./Drawer";
8
+ export { default as Popup } from "./Popup";
9
+ export { default as Grid } from "./Grid";
10
+ export { default as Tabbar } from "./Tabbar";
11
+ export { default as ProList } from "./ProList";
12
+ export { default as FloatButton } from "./FloatButton";
13
+ export { default as Breadcrumb } from "./Breadcrumb";
14
+ export { default as ConfigProvider } from "./ConfigProvider";
15
+ export { default as CreatorEdit } from "./CreatorEdit";
16
+ export { default as Empty } from "./Empty";
17
+ export { default as ActionSheet } from "./ActionSheet";
18
+
19
+ /* Form相关 */
20
+ export { default as ProForm } from "./ProForm";
21
+ export { default as ProFormText } from "./ProForm/controls/Text";
22
+ export { default as ProFormTextArea } from "./ProForm/controls/TextArea";
23
+ export { default as ProFormDate } from "./ProForm/controls/Date";
24
+ export { default as ProFormUpload } from "./ProForm/controls/Upload";
25
+ export { default as ProFormSelect } from "./ProForm/controls/Select";
26
+ export { default as ProFormList } from "./ProForm/controls/List";
27
+ export { getQueryParams, getListAssignField, dateFormat, getSimplifyDay, getUUID, getFileExt, getFileType, clipFileUrl } from "./utils/tools";
@@ -0,0 +1,8 @@
1
+ declare const request: <RequestResponseData>(url: string, opts: {
2
+ method: "GET" | "POST" | "DELETE" | "PUT";
3
+ header?: {
4
+ "content-type": string;
5
+ };
6
+ data?: any;
7
+ }) => Promise<ServiceAPI.Response<RequestResponseData>>;
8
+ export { request };
@@ -0,0 +1,61 @@
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 Taro, { showToast, getStorageSync } from "@tarojs/taro";
8
+ import { getQueryParams } from "../utils/tools";
9
+ var request = function request(url, body) {
10
+ var _JSON$parse;
11
+ var request = Taro.request;
12
+ url = process.env.TARO_APP_DOMAIN_NAME + process.env.TARO_APP_SERVICE + url;
13
+ if (body.method === "PUT" && body.data) {
14
+ url = url + getQueryParams(body.data);
15
+ }
16
+ var user = getStorageSync("USER");
17
+ var token = user ? (_JSON$parse = JSON.parse(user)) === null || _JSON$parse === void 0 ? void 0 : _JSON$parse.token : "";
18
+ return new Promise(function (resolve, reject) {
19
+ request(_objectSpread(_objectSpread({
20
+ url: url,
21
+ timeout: 30000
22
+ }, body), {}, {
23
+ header: _objectSpread(_objectSpread({}, body.header), {}, {
24
+ "Authorization": token
25
+ })
26
+ })).then(function (result) {
27
+ var data = result.data,
28
+ statusCode = result.statusCode;
29
+ if (statusCode === 200 && data.code === 200) resolve(data);
30
+ switch (data.code) {
31
+ case 10000:
32
+ /* TOKEN失效,重新登录 */
33
+ break;
34
+ case 10001:
35
+ case 90001:
36
+ case 90002:
37
+ case 90003:
38
+ case 90004:
39
+ case 90005:
40
+ case 90006:
41
+ /* 接口报错,仅提示错误信息 */
42
+ showToast({
43
+ title: data.msg,
44
+ icon: "error"
45
+ });
46
+ return reject(data);
47
+ break;
48
+ case 200:
49
+ case 10002:
50
+ case 10003:
51
+ case 10004:
52
+ /* 200为成功返回,10002(用户不存在)、10003、10004(验证码错误) */
53
+ break;
54
+ }
55
+ resolve(data);
56
+ }).catch(function (error) {
57
+ reject(error);
58
+ });
59
+ });
60
+ };
61
+ export { request };
@@ -0,0 +1,12 @@
1
+ export declare const getUserAvatar: (params: {
2
+ ids: string[];
3
+ }, options?: {
4
+ [key: string]: any;
5
+ } | undefined) => Promise<ServiceAPI.Response<string[]>>;
6
+ export declare const getProjectMemberAvatar: (params: {
7
+ ids: string[];
8
+ }, options?: {
9
+ [key: string]: any;
10
+ } | undefined) => Promise<ServiceAPI.Response<string[]>>;
11
+ export declare const getUploadConfig: () => Promise<ServiceAPI.Response<FileAPI.UploadConfigType>>;
12
+ export declare const getOSSConfig: (callbackUrl: string, ext?: string) => Promise<ServiceAPI.Response<FileAPI.OSSConfigType>>;
@@ -0,0 +1,39 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ 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); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ 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; }
8
+ 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; }
9
+ 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; }
10
+ 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; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ 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); }
13
+ import { request } from "../..";
14
+ export var getUserAvatar = function getUserAvatar(params, options) {
15
+ return request("/service-user/user/batch/avatar", _objectSpread({
16
+ method: "POST",
17
+ data: _toConsumableArray(params.ids)
18
+ }, options || {}));
19
+ };
20
+ export var getProjectMemberAvatar = function getProjectMemberAvatar(params, options) {
21
+ return request("/service-project/org/member/batch/avatar", _objectSpread({
22
+ method: "POST",
23
+ data: _toConsumableArray(params.ids)
24
+ }, options || {}));
25
+ };
26
+ export var getUploadConfig = function getUploadConfig() {
27
+ return request("/service-ops/file/config/getConfig", {
28
+ method: "GET"
29
+ });
30
+ };
31
+ export var getOSSConfig = function getOSSConfig(callbackUrl, ext) {
32
+ return request("/service-ops/oss/policy", {
33
+ method: "GET",
34
+ data: {
35
+ callbackUrl: callbackUrl,
36
+ ext: ext
37
+ }
38
+ });
39
+ };