@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,263 @@
1
+ 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); }
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 _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); }
7
+ 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; }
8
+ 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; }
9
+ 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; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ 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); }
12
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
13
+ 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."); }
14
+ 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); }
15
+ 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; }
16
+ 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; } }
17
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
18
+ import React, { Fragment, useCallback, useEffect, useState } from "react";
19
+ import { navigateTo } from "@tarojs/taro";
20
+ import { ScrollView, Text, View } from "@tarojs/components";
21
+ import { getListAssignField, Popup } from "../../..";
22
+ import ProFormField from "../../Field";
23
+ import "./index.less";
24
+ var ProFormSelect = function ProFormSelect(props) {
25
+ var _props$fieldNames = props.fieldNames,
26
+ fieldNames = _props$fieldNames === void 0 ? {
27
+ value: "value",
28
+ label: "label"
29
+ } : _props$fieldNames,
30
+ _props$placeholder = props.placeholder,
31
+ placeholder = _props$placeholder === void 0 ? "请选择" : _props$placeholder,
32
+ request = props.request,
33
+ _props$params = props.params,
34
+ params = _props$params === void 0 ? {} : _props$params,
35
+ optionType = props.optionType,
36
+ getFormValue = props.getFormValue,
37
+ _props$dependencies = props.dependencies,
38
+ dependencies = _props$dependencies === void 0 ? "" : _props$dependencies,
39
+ label = props.label,
40
+ multiple = props.multiple,
41
+ _onChange = props.onChange,
42
+ projectId = props.projectId,
43
+ companyId = props.companyId,
44
+ source = props.source,
45
+ disabled = props.disabled;
46
+ var _useState = useState([]),
47
+ _useState2 = _slicedToArray(_useState, 2),
48
+ options = _useState2[0],
49
+ setOptions = _useState2[1];
50
+ var _useState3 = useState([]),
51
+ _useState4 = _slicedToArray(_useState3, 2),
52
+ value = _useState4[0],
53
+ setValue = _useState4[1];
54
+ var _useState5 = useState(false),
55
+ _useState6 = _slicedToArray(_useState5, 2),
56
+ open = _useState6[0],
57
+ setOpen = _useState6[1];
58
+ useEffect(function () {
59
+ if (props.value !== value) setValue(props.value);
60
+ }, [props.value]);
61
+ useEffect(function () {
62
+ var _props$options;
63
+ if ((_props$options = props.options) !== null && _props$options !== void 0 && _props$options.length) {
64
+ setOptions(props.options);
65
+ }
66
+ }, [props.options]);
67
+ useEffect(function () {
68
+ if (dependencies) {
69
+ /* 监听Form其他字段值 */
70
+ if (request && getFormValue !== null && getFormValue !== void 0 && getFormValue(dependencies)) {
71
+ var requestParams = _objectSpread({}, params);
72
+ requestParams[dependencies] = getFormValue === null || getFormValue === void 0 ? void 0 : getFormValue(dependencies);
73
+ request(requestParams).then(function (result) {
74
+ setOptions(result);
75
+ if (!result.some(function (item) {
76
+ return item.value === props.value;
77
+ })) {
78
+ _onChange === null || _onChange === void 0 || _onChange(null);
79
+ } else {
80
+ setValue(props.value);
81
+ }
82
+ });
83
+ }
84
+ }
85
+ }, [dependencies ? getFormValue === null || getFormValue === void 0 ? void 0 : getFormValue(dependencies) : null]);
86
+ var onSelect = useCallback(function () {
87
+ var user = false;
88
+ for (var _key in source) {
89
+ if (["ALL", "USER"].includes(source[_key])) user = true;
90
+ }
91
+ if (user) {
92
+ navigateTo({
93
+ url: "/screens/common/select/recent/index",
94
+ success: function success(result) {
95
+ result.eventChannel.emit("getRecentParams", _objectSpread(_objectSpread({}, props), {}, {
96
+ value: value,
97
+ onChange: function onChange(result) {
98
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange(result);
99
+ }
100
+ }));
101
+ }
102
+ });
103
+ } else {
104
+ navigateTo({
105
+ url: "/screens/common/select/".concat(companyId ? 'company' : "project", "/index"),
106
+ success: function success(result) {
107
+ result.eventChannel.emit("getSelectParams", _objectSpread(_objectSpread({}, props), {}, {
108
+ value: value,
109
+ onChange: function onChange(result) {
110
+ return _onChange === null || _onChange === void 0 ? void 0 : _onChange(result);
111
+ }
112
+ }));
113
+ }
114
+ });
115
+ }
116
+ }, [value]);
117
+ var renderValueText = useCallback(function () {
118
+ if (typeof value === "string") return getListAssignField(value, options, fieldNames);
119
+ if (value instanceof Array) {
120
+ if (value.length) {
121
+ if (typeof value[0] === "string") return value.map(function (v) {
122
+ return getListAssignField(v, options, fieldNames);
123
+ }).join("、");
124
+ return value.map(function (v) {
125
+ return v[fieldNames.label];
126
+ }).join("、");
127
+ }
128
+ }
129
+ }, [value, options]);
130
+ var renderPopupSelectIcon = useCallback(function (option) {
131
+ if (["string", "boolean"].includes(_typeof(value)) && value === option) return /*#__PURE__*/React.createElement(View, {
132
+ className: "iconfont icon-icon-radio"
133
+ });
134
+ if (value instanceof Array) {
135
+ if (typeof value[0] === "string" && value.some(function (v) {
136
+ return v === option;
137
+ })) return /*#__PURE__*/React.createElement(View, {
138
+ className: "iconfont icon-icon-checkbox"
139
+ });
140
+ if (value.some(function (v) {
141
+ return v[fieldNames.value] === option;
142
+ })) return /*#__PURE__*/React.createElement(View, {
143
+ className: "iconfont icon-icon-checkbox"
144
+ });
145
+ }
146
+ return /*#__PURE__*/React.createElement(View, {
147
+ className: "iconfont icon-icon-circle"
148
+ });
149
+ }, [value]);
150
+ if (optionType && !companyId && !projectId) return /*#__PURE__*/React.createElement(ProFormField, _extends({
151
+ layout: "vertical"
152
+ }, props), /*#__PURE__*/React.createElement(View, {
153
+ className: "p-pro-form-item-select"
154
+ }, options.length ? /*#__PURE__*/React.createElement(Fragment, null, options.map(function (item) {
155
+ return /*#__PURE__*/React.createElement(View, {
156
+ className: "p-pro-form-item-select-option ".concat(disabled ? 'disabled' : ''),
157
+ key: 'option-' + item[fieldNames.value],
158
+ onTap: function onTap() {
159
+ if (disabled) return false;
160
+ if (multiple) {
161
+ if (value.some(function (v) {
162
+ return v === item[fieldNames.value];
163
+ })) {
164
+ value.splice(value.findIndex(function (v) {
165
+ return v === item[fieldNames.value];
166
+ }), 1);
167
+ } else {
168
+ value.push(item[fieldNames.value]);
169
+ }
170
+ setValue(_toConsumableArray(value));
171
+ } else {
172
+ _onChange === null || _onChange === void 0 || _onChange(item[fieldNames.value]);
173
+ }
174
+ }
175
+ }, renderPopupSelectIcon(item[fieldNames.value]), /*#__PURE__*/React.createElement(Text, {
176
+ className: "p-pro-form-item-select-option-text"
177
+ }, item[fieldNames.label]));
178
+ })) : /*#__PURE__*/React.createElement(View, {
179
+ className: "error-view"
180
+ }, /*#__PURE__*/React.createElement(Text, {
181
+ className: "text"
182
+ }, "\u6682\u65E0\u6570\u636E"))));
183
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(ProFormField, _extends({}, props, {
184
+ layout: "horizontal"
185
+ }), /*#__PURE__*/React.createElement(View, {
186
+ className: "p-pro-form-item-select",
187
+ onTap: function onTap() {
188
+ if (disabled) return false;
189
+ if (companyId || projectId) {
190
+ onSelect();
191
+ } else {
192
+ setOpen(true);
193
+ }
194
+ }
195
+ }, disabled ? /*#__PURE__*/React.createElement(Text, {
196
+ className: "p-pro-form-item-control-disabled"
197
+ }, renderValueText() || "-") : value ? /*#__PURE__*/React.createElement(Text, {
198
+ className: "p-pro-form-item-value"
199
+ }, renderValueText()) : /*#__PURE__*/React.createElement(Text, {
200
+ className: "p-pro-form-item-placeholder"
201
+ }, placeholder))), !companyId && !projectId && /*#__PURE__*/React.createElement(Popup, {
202
+ open: open,
203
+ onOpenChange: function onOpenChange(open) {
204
+ return setOpen(open);
205
+ },
206
+ rootClassName: "p-pro-form-item-select-popup-container"
207
+ }, function (_ref) {
208
+ var onOpenChange = _ref.onOpenChange;
209
+ return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(View, {
210
+ className: "p-pro-form-item-select-popup-header"
211
+ }, /*#__PURE__*/React.createElement(View, {
212
+ className: "extra-content left"
213
+ }, /*#__PURE__*/React.createElement(View, {
214
+ className: "iconfont icon-icon-psp-guanbi",
215
+ onTap: onOpenChange
216
+ })), /*#__PURE__*/React.createElement(Text, {
217
+ className: "title"
218
+ }, label), /*#__PURE__*/React.createElement(View, {
219
+ className: "extra-content right"
220
+ }, multiple && /*#__PURE__*/React.createElement(Text, {
221
+ className: "text",
222
+ onClick: function onClick() {
223
+ onOpenChange();
224
+ _onChange === null || _onChange === void 0 || _onChange(value);
225
+ }
226
+ }, "\u786E\u5B9A"))), /*#__PURE__*/React.createElement(ScrollView, {
227
+ className: "p-pro-form-item-select-popup-content",
228
+ showScrollbar: false,
229
+ scrollY: true,
230
+ enableFlex: true,
231
+ enhanced: true
232
+ }, options.length ? /*#__PURE__*/React.createElement(Fragment, null, options.map(function (item) {
233
+ return /*#__PURE__*/React.createElement(View, {
234
+ className: "p-pro-form-item-select-option",
235
+ key: 'option-' + item[fieldNames.value],
236
+ onTap: function onTap() {
237
+ if (multiple) {
238
+ if (value.some(function (v) {
239
+ return v === item[fieldNames.value];
240
+ })) {
241
+ value.splice(value.findIndex(function (v) {
242
+ return v === item[fieldNames.value];
243
+ }), 1);
244
+ } else {
245
+ value.push(item[fieldNames.value]);
246
+ }
247
+ setValue(_toConsumableArray(value));
248
+ } else {
249
+ onOpenChange();
250
+ _onChange === null || _onChange === void 0 || _onChange(item[fieldNames.value]);
251
+ }
252
+ }
253
+ }, renderPopupSelectIcon(item[fieldNames.value]), /*#__PURE__*/React.createElement(Text, {
254
+ className: "p-pro-form-item-select-option-text"
255
+ }, item[fieldNames.label]));
256
+ })) : /*#__PURE__*/React.createElement(View, {
257
+ className: "error-view"
258
+ }, /*#__PURE__*/React.createElement(Text, {
259
+ className: "text"
260
+ }, "\u6682\u65E0\u6570\u636E"))));
261
+ }));
262
+ };
263
+ export default ProFormSelect;
@@ -0,0 +1,120 @@
1
+ @import "@power-xa/m-ui/dist/assets/less/mixins.less";
2
+
3
+ .p-pro-form-item {
4
+ .p-pro-form-item-select {
5
+ display: flex;
6
+ align-items: center;
7
+ flex-wrap: wrap;
8
+ gap: 28px;
9
+
10
+ .p-pro-form-item-select-option {
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 12px;
14
+
15
+ .iconfont {
16
+ font-size: 28px;
17
+ color: #999;
18
+ }
19
+
20
+ .icon-icon-checkbox,
21
+ .icon-icon-radio {
22
+ color: #333437;
23
+ }
24
+
25
+ .p-pro-form-item-select-option-text {
26
+ .font(28, #333437)
27
+ }
28
+ }
29
+ }
30
+
31
+ &.horizontal {
32
+ .p-pro-form-item-select {
33
+ width: 100%;
34
+ justify-content: flex-end;
35
+ }
36
+ }
37
+ }
38
+
39
+ .p-pro-form-item-select-popup-container {
40
+ z-index: 99999;
41
+
42
+ .p-popup-container {
43
+ display: flex;
44
+ flex-direction: column;
45
+ }
46
+
47
+ .p-pro-form-item-select-popup-header {
48
+ display: flex;
49
+ align-items: center;
50
+ justify-content: space-between;
51
+ padding: 34px 32px;
52
+ box-sizing: border-box;
53
+
54
+ .extra-content {
55
+ flex: 1;
56
+ display: flex;
57
+ align-items: center;
58
+
59
+ .iconfont {
60
+ font-size: 24px;
61
+ color: #333437;
62
+ padding: 8px 12px;
63
+ width: max-content;
64
+ }
65
+
66
+ .text {
67
+ .font(28, #333437)
68
+ }
69
+
70
+ &.right {
71
+ justify-content: flex-end;
72
+ }
73
+ }
74
+
75
+ .title {
76
+ flex: 5;
77
+ text-align: center;
78
+ .font(32, #333437, Regular, 500)
79
+ }
80
+ }
81
+
82
+ .p-pro-form-item-select-popup-content {
83
+ flex: 1;
84
+ height: 0;
85
+
86
+ .p-pro-form-item-select-option {
87
+ display: flex;
88
+ align-items: center;
89
+ gap: 20px;
90
+ padding: 24px 32px;
91
+ box-sizing: border-box;
92
+
93
+ .iconfont {
94
+ font-size: 28px;
95
+ color: #999;
96
+ }
97
+
98
+ .icon-icon-checkbox,
99
+ .icon-icon-radio {
100
+ color: #333437;
101
+ }
102
+
103
+ .p-pro-form-item-select-option-text {
104
+ .font(28, #333437)
105
+ }
106
+ }
107
+
108
+ .error-view {
109
+ width: 100%;
110
+ height: 100%;
111
+ display: flex;
112
+ align-items: center;
113
+ justify-content: center;
114
+
115
+ .text {
116
+ .font(24, #999)
117
+ }
118
+ }
119
+ }
120
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import "./index.less";
3
+ declare const ProFormText: FC<ProFormAPI.ProFormItemProps>;
4
+ export default ProFormText;
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import { Input, Text } from "@tarojs/components";
3
+ import ProFormField from "../../Field";
4
+ import "./index.less";
5
+ var ProFormText = function ProFormText(props) {
6
+ var _props$placeholder = props.placeholder,
7
+ placeholder = _props$placeholder === void 0 ? "请输入" : _props$placeholder,
8
+ onChange = props.onChange,
9
+ _props$maxLength = props.maxLength,
10
+ maxLength = _props$maxLength === void 0 ? -1 : _props$maxLength,
11
+ _props$inputType = props.inputType,
12
+ inputType = _props$inputType === void 0 ? "text" : _props$inputType,
13
+ disabled = props.disabled,
14
+ value = props.value;
15
+ return /*#__PURE__*/React.createElement(ProFormField, props, disabled ? /*#__PURE__*/React.createElement(Text, {
16
+ className: "p-pro-form-item-control-disabled"
17
+ }, value || "-") : /*#__PURE__*/React.createElement(Input, {
18
+ placeholder: placeholder,
19
+ className: "p-pro-form-item-input",
20
+ placeholderClass: "p-pro-form-item-placeholder",
21
+ onInput: function onInput(e) {
22
+ return onChange === null || onChange === void 0 ? void 0 : onChange(e.detail.value);
23
+ },
24
+ maxlength: maxLength,
25
+ type: inputType,
26
+ value: value
27
+ }));
28
+ };
29
+ export default ProFormText;
@@ -0,0 +1,7 @@
1
+ @import "@power-xa/m-ui/dist/assets/less/mixins.less";
2
+
3
+ .p-pro-form-item-input {
4
+ width: 100%;
5
+ text-align: right;
6
+ .font(28, #333437)
7
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import "./index.less";
3
+ declare const ProFormTextArea: FC<ProFormAPI.ProFormItemProps>;
4
+ export default ProFormTextArea;
@@ -0,0 +1,63 @@
1
+ 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); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ 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."); }
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 _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; }
6
+ 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; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ import React, { Fragment, useState } from "react";
9
+ import { Text, Textarea, View } from "@tarojs/components";
10
+ import ProFormField from "../../Field";
11
+ import "./index.less";
12
+ var ProFormTextArea = function ProFormTextArea(props) {
13
+ var _props$placeholder = props.placeholder,
14
+ placeholder = _props$placeholder === void 0 ? "请输入" : _props$placeholder,
15
+ onChange = props.onChange,
16
+ _props$maxLength = props.maxLength,
17
+ maxLength = _props$maxLength === void 0 ? -1 : _props$maxLength,
18
+ recommend = props.recommend,
19
+ value = props.value,
20
+ disabled = props.disabled;
21
+ var _useState = useState(true),
22
+ _useState2 = _slicedToArray(_useState, 2),
23
+ show = _useState2[0],
24
+ setShow = _useState2[1];
25
+ return /*#__PURE__*/React.createElement(ProFormField, _extends({}, props, {
26
+ layout: "vertical"
27
+ }), disabled ? /*#__PURE__*/React.createElement(Text, {
28
+ className: "p-pro-form-item-control-disabled"
29
+ }, value || "-") : /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Textarea, {
30
+ value: value,
31
+ placeholder: placeholder,
32
+ className: "p-pro-form-item-textarea",
33
+ placeholderClass: "p-pro-form-item-placeholder",
34
+ onInput: function onInput(e) {
35
+ return onChange === null || onChange === void 0 ? void 0 : onChange(e.detail.value);
36
+ },
37
+ maxlength: maxLength
38
+ }), recommend && /*#__PURE__*/React.createElement(View, {
39
+ className: "p-pro-form-item-textarea-recommend-container"
40
+ }, /*#__PURE__*/React.createElement(View, {
41
+ className: "recommend-header",
42
+ onTap: function onTap() {
43
+ return setShow(!show);
44
+ }
45
+ }, /*#__PURE__*/React.createElement(Text, {
46
+ className: "text"
47
+ }, "\u63A8\u8350\u5185\u5BB9"), /*#__PURE__*/React.createElement(View, {
48
+ className: "iconfont ".concat(show ? 'icon-icon-xianshi' : 'icon-icon-yincang')
49
+ })), show && /*#__PURE__*/React.createElement(View, {
50
+ className: "recommend-content"
51
+ }, recommend.map(function (item, index) {
52
+ return /*#__PURE__*/React.createElement(View, {
53
+ className: "recommend-tag",
54
+ key: 'recommend-tag-' + index,
55
+ onTap: function onTap() {
56
+ return onChange === null || onChange === void 0 ? void 0 : onChange((value || "") + item);
57
+ }
58
+ }, /*#__PURE__*/React.createElement(Text, {
59
+ className: "text"
60
+ }, item));
61
+ })))));
62
+ };
63
+ export default ProFormTextArea;
@@ -0,0 +1,46 @@
1
+ @import "@power-xa/m-ui/dist/assets/less/mixins.less";
2
+
3
+ .p-pro-form-item-textarea {
4
+ width: 100%;
5
+ height: 120px;
6
+ .font(28, #333437);
7
+ }
8
+
9
+ .p-pro-form-item-textarea-recommend-container {
10
+ .recommend-header {
11
+ display: flex;
12
+ align-items: center;
13
+ gap: 8px;
14
+
15
+ .text {
16
+ .font(24, #999)
17
+ }
18
+
19
+ .iconfont {
20
+ font-size: 24px;
21
+ color: #999;
22
+ padding: 0 12px;
23
+ }
24
+ }
25
+
26
+ .recommend-content {
27
+ display: flex;
28
+ align-items: center;
29
+ flex-wrap: wrap;
30
+ gap: 24px;
31
+ margin-top: 12px;
32
+
33
+ .recommend-tag {
34
+ padding: 8px 24px;
35
+ border-radius: 12px;
36
+ box-sizing: border-box;
37
+ background: #F5F6F7;
38
+ display: flex;
39
+ align-items: center;
40
+
41
+ .text {
42
+ .font(20, #333437)
43
+ }
44
+ }
45
+ }
46
+ }
@@ -0,0 +1,4 @@
1
+ import { FC } from "react";
2
+ import "./index.less";
3
+ declare const ProFormUpload: FC<ProFormAPI.ProFormItemProps>;
4
+ export default ProFormUpload;