@pisell/materials 6.0.7 → 6.0.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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +3 -3
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +1 -1
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +3 -1
- package/es/components/dataSourceComponents/fields/Input.Email/WithMode.js +15 -2
- package/es/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -1
- package/es/components/dataSourceComponents/fields/Input.Email/index.js +5 -1
- package/es/components/dataSourceComponents/hooks/useActions.js +44 -34
- package/es/components/login-and-register/index.less +4 -1
- package/es/components/pisellViewGrid/index.d.ts +16 -0
- package/es/components/pisellViewGrid/index.js +66 -0
- package/es/components/pisellViewGrid/index.less +31 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +1 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.d.ts +3 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/WithMode.js +9 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/index.d.ts +3 -1
- package/lib/components/dataSourceComponents/fields/Input.Email/index.js +5 -1
- package/lib/components/dataSourceComponents/hooks/useActions.js +9 -1
- package/lib/components/login-and-register/index.less +4 -1
- package/lib/components/pisellViewGrid/index.d.ts +16 -0
- package/lib/components/pisellViewGrid/index.js +98 -0
- package/lib/components/pisellViewGrid/index.less +31 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/pisell-view-grid/__screenshots__/card-1.png +0 -0
- package/lowcode/pisell-view-grid/meta.ts +167 -0
- package/lowcode/pisell-view-grid/snippets.ts +54 -0
- package/package.json +2 -2
|
@@ -76,7 +76,7 @@ export var formItemNameReverse = function formItemNameReverse(name) {
|
|
|
76
76
|
|
|
77
77
|
// 验证域名
|
|
78
78
|
export var isValidDomain = function isValidDomain(value) {
|
|
79
|
-
return /^(
|
|
79
|
+
return /^(?!.*--)[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9](\.[A-Za-z]{2,})+$/.test(value);
|
|
80
80
|
};
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from 'antd';
|
|
3
|
-
declare const EmailWithMode: React.FC<InputProps &
|
|
3
|
+
declare const EmailWithMode: React.FC<InputProps & {
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
} & import("../../dataSourceForm/utils").WithModeProps>;
|
|
4
6
|
export default EmailWithMode;
|
|
@@ -1,11 +1,24 @@
|
|
|
1
|
+
var _excluded = ["onBlur", "onChange"];
|
|
1
2
|
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
|
-
|
|
3
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
4
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
5
|
+
import React, { useCallback } from 'react';
|
|
3
6
|
import { Input as AntInput } from 'antd';
|
|
4
7
|
import Icon from "../../../icon";
|
|
5
8
|
import ReadPretty from "./ReadPretty";
|
|
6
9
|
import { withMode } from "../../dataSourceForm/utils";
|
|
7
10
|
var Email = function Email(props) {
|
|
8
|
-
|
|
11
|
+
var propsOnBlur = props.onBlur,
|
|
12
|
+
propsOnChange = props.onChange,
|
|
13
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
14
|
+
var onBlur = useCallback(function (e) {
|
|
15
|
+
var _e$target;
|
|
16
|
+
propsOnChange === null || propsOnChange === void 0 ? void 0 : propsOnChange(((e === null || e === void 0 ? void 0 : (_e$target = e.target) === null || _e$target === void 0 ? void 0 : _e$target.value) || "").trim());
|
|
17
|
+
propsOnBlur === null || propsOnBlur === void 0 ? void 0 : propsOnBlur(e);
|
|
18
|
+
}, [propsOnBlur, propsOnChange]);
|
|
19
|
+
return /*#__PURE__*/React.createElement(AntInput, _extends({}, rest, {
|
|
20
|
+
onChange: propsOnChange,
|
|
21
|
+
onBlur: onBlur,
|
|
9
22
|
prefix: /*#__PURE__*/React.createElement(Icon, {
|
|
10
23
|
type: "pisell2-mail-01",
|
|
11
24
|
size: 18,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const Email: React.FC<import("antd").InputProps &
|
|
2
|
+
declare const Email: React.FC<import("antd").InputProps & {
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
} & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps>;
|
|
3
5
|
export default Email;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { withFormItem } from "../../dataSourceForm/utils";
|
|
2
2
|
import EmailWithMode from "./WithMode";
|
|
3
|
-
var Email = withFormItem(EmailWithMode
|
|
3
|
+
var Email = withFormItem(EmailWithMode, {
|
|
4
|
+
otherFormItemProps: {
|
|
5
|
+
validateTrigger: 'onBlur'
|
|
6
|
+
}
|
|
7
|
+
});
|
|
4
8
|
export default Email;
|
|
@@ -22,7 +22,9 @@ import useParseActionsVariable from "./useParseActionsVariable";
|
|
|
22
22
|
import useVariables from "./useVariables";
|
|
23
23
|
import useDataSource from "./useDataSource";
|
|
24
24
|
import { getText } from "../../../locales";
|
|
25
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
25
26
|
var useActions = function useActions() {
|
|
27
|
+
var _context$appHelper;
|
|
26
28
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
27
29
|
propsDataSource = _ref.dataSource,
|
|
28
30
|
propsCurrentValue = _ref.currentValue,
|
|
@@ -32,6 +34,14 @@ var useActions = function useActions() {
|
|
|
32
34
|
var _useDataSource = useDataSource(),
|
|
33
35
|
ctxDataSource = _useDataSource.dataSource,
|
|
34
36
|
ctxDesignMode = _useDataSource.__designMode;
|
|
37
|
+
var context = useEngineContext();
|
|
38
|
+
var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.constants) || {},
|
|
39
|
+
pisell2ApiBaseUrl = _ref2.pisell2ApiBaseUrl,
|
|
40
|
+
mypisellApiBaseUrl = _ref2.mypisellApiBaseUrl;
|
|
41
|
+
var baseUrlMap = {
|
|
42
|
+
'pisell2-api': pisell2ApiBaseUrl,
|
|
43
|
+
'mypisell-api': mypisellApiBaseUrl
|
|
44
|
+
};
|
|
35
45
|
var _useVariables = useVariables(),
|
|
36
46
|
parseVariable = _useVariables.parseVariable;
|
|
37
47
|
var _useParseActionsVaria = useParseActionsVariable(),
|
|
@@ -39,14 +49,14 @@ var useActions = function useActions() {
|
|
|
39
49
|
var currentDataSource = propsDataSource || ctxDataSource;
|
|
40
50
|
var currentValue = propsCurrentValue || 'server';
|
|
41
51
|
var designMode = __designMode || ctxDesignMode;
|
|
42
|
-
var
|
|
43
|
-
isCustomApi =
|
|
44
|
-
originalActions =
|
|
45
|
-
options =
|
|
46
|
-
headerDataSource =
|
|
47
|
-
name =
|
|
48
|
-
dataSourceKey =
|
|
49
|
-
fields =
|
|
52
|
+
var _ref3 = currentDataSource || {},
|
|
53
|
+
isCustomApi = _ref3.isCustomApi,
|
|
54
|
+
originalActions = _ref3.actions,
|
|
55
|
+
options = _ref3.options,
|
|
56
|
+
headerDataSource = _ref3.headerDataSource,
|
|
57
|
+
name = _ref3.name,
|
|
58
|
+
dataSourceKey = _ref3.dataSourceKey,
|
|
59
|
+
fields = _ref3.fields;
|
|
50
60
|
var _useFormat = useFormat({
|
|
51
61
|
dataSourceKey: dataSourceKey || '',
|
|
52
62
|
fields: fields || []
|
|
@@ -60,14 +70,14 @@ var useActions = function useActions() {
|
|
|
60
70
|
return parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(currentValue, {});
|
|
61
71
|
}, [currentValue, parseVariable]);
|
|
62
72
|
var extraParams = useMemo(function () {
|
|
63
|
-
return Object.entries(propsExtraParams || {}).reduce(function (acc,
|
|
64
|
-
var
|
|
65
|
-
key =
|
|
66
|
-
value =
|
|
67
|
-
acc[key] = Object.entries(value || {}).reduce(function (acc,
|
|
68
|
-
var
|
|
69
|
-
k =
|
|
70
|
-
v =
|
|
73
|
+
return Object.entries(propsExtraParams || {}).reduce(function (acc, _ref4) {
|
|
74
|
+
var _ref5 = _slicedToArray(_ref4, 2),
|
|
75
|
+
key = _ref5[0],
|
|
76
|
+
value = _ref5[1];
|
|
77
|
+
acc[key] = Object.entries(value || {}).reduce(function (acc, _ref6) {
|
|
78
|
+
var _ref7 = _slicedToArray(_ref6, 2),
|
|
79
|
+
k = _ref7[0],
|
|
80
|
+
v = _ref7[1];
|
|
71
81
|
acc[k] = parseVariable === null || parseVariable === void 0 ? void 0 : parseVariable(v, {});
|
|
72
82
|
return acc;
|
|
73
83
|
}, {});
|
|
@@ -82,15 +92,15 @@ var useActions = function useActions() {
|
|
|
82
92
|
});
|
|
83
93
|
|
|
84
94
|
// 生成自定义 API 请求函数
|
|
85
|
-
var genCustomApi = useMemoizedFn(function (
|
|
86
|
-
var method =
|
|
87
|
-
path =
|
|
88
|
-
parsedPath =
|
|
89
|
-
params =
|
|
90
|
-
headers =
|
|
91
|
-
body =
|
|
95
|
+
var genCustomApi = useMemoizedFn(function (_ref8) {
|
|
96
|
+
var method = _ref8.method,
|
|
97
|
+
path = _ref8.path,
|
|
98
|
+
parsedPath = _ref8.parsedPath,
|
|
99
|
+
params = _ref8.params,
|
|
100
|
+
headers = _ref8.headers,
|
|
101
|
+
body = _ref8.body;
|
|
92
102
|
return /*#__PURE__*/function () {
|
|
93
|
-
var
|
|
103
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
94
104
|
var result;
|
|
95
105
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
96
106
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -98,7 +108,7 @@ var useActions = function useActions() {
|
|
|
98
108
|
_context.next = 2;
|
|
99
109
|
return customApi(parsedPath || path, data, {
|
|
100
110
|
method: method,
|
|
101
|
-
baseUrl: options === null || options === void 0 ? void 0 : options.baseUrl,
|
|
111
|
+
baseUrl: baseUrlMap[dataSourceKey] || (options === null || options === void 0 ? void 0 : options.baseUrl),
|
|
102
112
|
params: params,
|
|
103
113
|
headers: headers,
|
|
104
114
|
body: body
|
|
@@ -119,7 +129,7 @@ var useActions = function useActions() {
|
|
|
119
129
|
}, _callee);
|
|
120
130
|
}));
|
|
121
131
|
return function (_x2) {
|
|
122
|
-
return
|
|
132
|
+
return _ref9.apply(this, arguments);
|
|
123
133
|
};
|
|
124
134
|
}();
|
|
125
135
|
});
|
|
@@ -138,7 +148,7 @@ var useActions = function useActions() {
|
|
|
138
148
|
|
|
139
149
|
// 创建数据
|
|
140
150
|
var create = useMemoizedFn( /*#__PURE__*/function () {
|
|
141
|
-
var
|
|
151
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(values) {
|
|
142
152
|
var actions, createApi;
|
|
143
153
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
144
154
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -176,7 +186,7 @@ var useActions = function useActions() {
|
|
|
176
186
|
}, _callee2);
|
|
177
187
|
}));
|
|
178
188
|
return function (_x3) {
|
|
179
|
-
return
|
|
189
|
+
return _ref10.apply(this, arguments);
|
|
180
190
|
};
|
|
181
191
|
}());
|
|
182
192
|
|
|
@@ -230,7 +240,7 @@ var useActions = function useActions() {
|
|
|
230
240
|
|
|
231
241
|
// 更新数据
|
|
232
242
|
var update = useMemoizedFn( /*#__PURE__*/function () {
|
|
233
|
-
var
|
|
243
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(values) {
|
|
234
244
|
var actions, updateApi, id;
|
|
235
245
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
236
246
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -281,13 +291,13 @@ var useActions = function useActions() {
|
|
|
281
291
|
}, _callee4);
|
|
282
292
|
}));
|
|
283
293
|
return function (_x4) {
|
|
284
|
-
return
|
|
294
|
+
return _ref12.apply(this, arguments);
|
|
285
295
|
};
|
|
286
296
|
}());
|
|
287
297
|
|
|
288
298
|
// 获取数据列表
|
|
289
299
|
var list = useMemoizedFn( /*#__PURE__*/function () {
|
|
290
|
-
var
|
|
300
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
291
301
|
var formatParams, actions, listApi;
|
|
292
302
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
293
303
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -335,11 +345,11 @@ var useActions = function useActions() {
|
|
|
335
345
|
}, _callee5);
|
|
336
346
|
}));
|
|
337
347
|
return function (_x5) {
|
|
338
|
-
return
|
|
348
|
+
return _ref13.apply(this, arguments);
|
|
339
349
|
};
|
|
340
350
|
}());
|
|
341
351
|
var destroy = useMemoizedFn( /*#__PURE__*/function () {
|
|
342
|
-
var
|
|
352
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
|
|
343
353
|
var actions, deleteApi;
|
|
344
354
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
345
355
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -379,7 +389,7 @@ var useActions = function useActions() {
|
|
|
379
389
|
}, _callee6);
|
|
380
390
|
}));
|
|
381
391
|
return function (_x6) {
|
|
382
|
-
return
|
|
392
|
+
return _ref14.apply(this, arguments);
|
|
383
393
|
};
|
|
384
394
|
}());
|
|
385
395
|
return {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
.saas-login-container {
|
|
2
2
|
// width: 100%;
|
|
3
|
+
width: 360px;
|
|
3
4
|
max-width: 360px;
|
|
5
|
+
min-width: 266px;
|
|
6
|
+
margin: 0 20px;
|
|
4
7
|
overflow-x: hidden;
|
|
5
8
|
// margin: 0 auto;
|
|
6
9
|
// padding: 24px;
|
|
7
|
-
text-align: center;
|
|
10
|
+
// text-align: center;
|
|
8
11
|
// height: 100%;
|
|
9
12
|
// overflow-y: auto;
|
|
10
13
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellViewGridProps {
|
|
4
|
+
columns?: number;
|
|
5
|
+
horizontalGap?: number;
|
|
6
|
+
verticalGap?: number;
|
|
7
|
+
singleRow?: boolean;
|
|
8
|
+
dataSource?: any[];
|
|
9
|
+
renderItem?: (item: any, index: number) => React.ReactNode;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare const PisellViewGrid: React.FC<PisellViewGridProps>;
|
|
16
|
+
export default PisellViewGrid;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import Loading from "../pisellLoading";
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import "./index.less";
|
|
11
|
+
var PisellViewGrid = function PisellViewGrid(_ref) {
|
|
12
|
+
var _ref$columns = _ref.columns,
|
|
13
|
+
columns = _ref$columns === void 0 ? 3 : _ref$columns,
|
|
14
|
+
_ref$horizontalGap = _ref.horizontalGap,
|
|
15
|
+
horizontalGap = _ref$horizontalGap === void 0 ? 10 : _ref$horizontalGap,
|
|
16
|
+
_ref$verticalGap = _ref.verticalGap,
|
|
17
|
+
verticalGap = _ref$verticalGap === void 0 ? 10 : _ref$verticalGap,
|
|
18
|
+
_ref$singleRow = _ref.singleRow,
|
|
19
|
+
singleRow = _ref$singleRow === void 0 ? false : _ref$singleRow,
|
|
20
|
+
_ref$dataSource = _ref.dataSource,
|
|
21
|
+
dataSource = _ref$dataSource === void 0 ? [] : _ref$dataSource,
|
|
22
|
+
renderItem = _ref.renderItem,
|
|
23
|
+
_ref$loading = _ref.loading,
|
|
24
|
+
loading = _ref$loading === void 0 ? false : _ref$loading,
|
|
25
|
+
children = _ref.children,
|
|
26
|
+
className = _ref.className,
|
|
27
|
+
style = _ref.style;
|
|
28
|
+
var classes = classNames('pisell-view-grid', {
|
|
29
|
+
'pisell-view-grid-single-row': singleRow
|
|
30
|
+
}, className);
|
|
31
|
+
return /*#__PURE__*/React.createElement(Loading, {
|
|
32
|
+
loading: loading,
|
|
33
|
+
fullscreen: false,
|
|
34
|
+
style: {
|
|
35
|
+
width: '100%'
|
|
36
|
+
}
|
|
37
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
className: classes,
|
|
39
|
+
style: _objectSpread(_objectSpread({}, style), {}, {
|
|
40
|
+
width: '100%',
|
|
41
|
+
overflow: 'hidden'
|
|
42
|
+
})
|
|
43
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
44
|
+
className: "pisell-view-grid-content",
|
|
45
|
+
style: !singleRow ? {
|
|
46
|
+
gap: "".concat(verticalGap, "px ").concat(horizontalGap, "px"),
|
|
47
|
+
gridTemplateColumns: "repeat(".concat(columns, ", 1fr)"),
|
|
48
|
+
width: '100%'
|
|
49
|
+
} : {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexWrap: 'nowrap',
|
|
52
|
+
overflowX: 'auto',
|
|
53
|
+
width: '100%'
|
|
54
|
+
}
|
|
55
|
+
}, dataSource.map(function (item, index) {
|
|
56
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
57
|
+
key: index,
|
|
58
|
+
className: "pisell-view-grid-item",
|
|
59
|
+
style: {
|
|
60
|
+
minWidth: 0,
|
|
61
|
+
flex: "0 0 calc(100% / ".concat(columns, ")")
|
|
62
|
+
}
|
|
63
|
+
}, renderItem === null || renderItem === void 0 ? void 0 : renderItem(item, index));
|
|
64
|
+
}))));
|
|
65
|
+
};
|
|
66
|
+
export default PisellViewGrid;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.pisell-view-grid {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
|
|
7
|
+
&-content {
|
|
8
|
+
display: grid;
|
|
9
|
+
width: 100%;
|
|
10
|
+
// grid-template-columns: repeat(4, 1fr);
|
|
11
|
+
// gap: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-item {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-single-row {
|
|
19
|
+
&::-webkit-scrollbar {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
-ms-overflow-style: none;
|
|
23
|
+
scrollbar-width: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// &-item {
|
|
27
|
+
// box-sizing: border-box;
|
|
28
|
+
// display: inline-block;
|
|
29
|
+
// vertical-align: top;
|
|
30
|
+
// }
|
|
31
|
+
}
|
package/es/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export { default as DataSourceWrapper } from './components/dataSourceComponents/
|
|
|
131
131
|
export { default as DataSourceTypography } from './components/dataSourceComponents/dataSourceShow/dataSourceTypography';
|
|
132
132
|
export { default as DataSourceImage } from './components/dataSourceComponents/dataSourceShow/dataSourceImage';
|
|
133
133
|
export { default as DataSourceQRCode } from './components/dataSourceComponents/dataSourceShow/dataSourceQRCode';
|
|
134
|
+
export { default as PisellViewGrid } from './components/pisellViewGrid';
|
|
134
135
|
export { default as PageHeader } from './components/page-header';
|
|
135
136
|
export { default as OrganizationTenantSwitcher } from './components/organizationTenantSwitcher';
|
|
136
137
|
export { default as PisellTags } from './components/pisellTags';
|
package/es/index.js
CHANGED
|
@@ -155,6 +155,7 @@ export { default as DataSourceWrapper } from "./components/dataSourceComponents/
|
|
|
155
155
|
export { default as DataSourceTypography } from "./components/dataSourceComponents/dataSourceShow/dataSourceTypography";
|
|
156
156
|
export { default as DataSourceImage } from "./components/dataSourceComponents/dataSourceShow/dataSourceImage";
|
|
157
157
|
export { default as DataSourceQRCode } from "./components/dataSourceComponents/dataSourceShow/dataSourceQRCode";
|
|
158
|
+
export { default as PisellViewGrid } from "./components/pisellViewGrid";
|
|
158
159
|
export { default as PageHeader } from "./components/page-header";
|
|
159
160
|
export { default as OrganizationTenantSwitcher } from "./components/organizationTenantSwitcher";
|
|
160
161
|
export { default as PisellTags } from "./components/pisellTags";
|
|
@@ -88,7 +88,7 @@ var formItemNameReverse = (name) => {
|
|
|
88
88
|
return name.replace(new RegExp(FORM_ITEM_SPLIT_CHAR, "g"), ".");
|
|
89
89
|
};
|
|
90
90
|
var isValidDomain = (value) => {
|
|
91
|
-
return /^(
|
|
91
|
+
return /^(?!.*--)[A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9](\.[A-Za-z]{2,})+$/.test(value);
|
|
92
92
|
};
|
|
93
93
|
var withFormItem = (WrappedComponent, overlayProps) => {
|
|
94
94
|
return ({
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { InputProps } from 'antd';
|
|
3
|
-
declare const EmailWithMode: React.FC<InputProps &
|
|
3
|
+
declare const EmailWithMode: React.FC<InputProps & {
|
|
4
|
+
onChange: (value: string) => void;
|
|
5
|
+
} & import("../../dataSourceForm/utils").WithModeProps>;
|
|
4
6
|
export default EmailWithMode;
|
|
@@ -38,10 +38,18 @@ var import_icon = __toESM(require("../../../icon"));
|
|
|
38
38
|
var import_ReadPretty = __toESM(require("./ReadPretty"));
|
|
39
39
|
var import_utils = require("../../dataSourceForm/utils");
|
|
40
40
|
var Email = (props) => {
|
|
41
|
+
const { onBlur: propsOnBlur, onChange: propsOnChange, ...rest } = props;
|
|
42
|
+
const onBlur = (0, import_react.useCallback)((e) => {
|
|
43
|
+
var _a;
|
|
44
|
+
propsOnChange == null ? void 0 : propsOnChange((((_a = e == null ? void 0 : e.target) == null ? void 0 : _a.value) || "").trim());
|
|
45
|
+
propsOnBlur == null ? void 0 : propsOnBlur(e);
|
|
46
|
+
}, [propsOnBlur, propsOnChange]);
|
|
41
47
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
42
48
|
import_antd.Input,
|
|
43
49
|
{
|
|
44
|
-
...
|
|
50
|
+
...rest,
|
|
51
|
+
onChange: propsOnChange,
|
|
52
|
+
onBlur,
|
|
45
53
|
prefix: /* @__PURE__ */ import_react.default.createElement(
|
|
46
54
|
import_icon.default,
|
|
47
55
|
{
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const Email: React.FC<import("antd").InputProps &
|
|
2
|
+
declare const Email: React.FC<import("antd").InputProps & {
|
|
3
|
+
onChange: (value: string) => void;
|
|
4
|
+
} & import("../../dataSourceForm/utils").WithModeProps & import("../../dataSourceForm/utils").WithFormItemProps>;
|
|
3
5
|
export default Email;
|
|
@@ -34,5 +34,9 @@ __export(Input_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Input_exports);
|
|
35
35
|
var import_utils = require("../../dataSourceForm/utils");
|
|
36
36
|
var import_WithMode = __toESM(require("./WithMode"));
|
|
37
|
-
var Email = (0, import_utils.withFormItem)(import_WithMode.default
|
|
37
|
+
var Email = (0, import_utils.withFormItem)(import_WithMode.default, {
|
|
38
|
+
otherFormItemProps: {
|
|
39
|
+
validateTrigger: "onBlur"
|
|
40
|
+
}
|
|
41
|
+
});
|
|
38
42
|
var Input_default = Email;
|
|
@@ -41,13 +41,21 @@ var import_useParseActionsVariable = __toESM(require("./useParseActionsVariable"
|
|
|
41
41
|
var import_useVariables = __toESM(require("./useVariables"));
|
|
42
42
|
var import_useDataSource = __toESM(require("./useDataSource"));
|
|
43
43
|
var import_locales = require("../../../locales");
|
|
44
|
+
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
44
45
|
var useActions = ({
|
|
45
46
|
dataSource: propsDataSource,
|
|
46
47
|
currentValue: propsCurrentValue,
|
|
47
48
|
__designMode,
|
|
48
49
|
extraParams: propsExtraParams
|
|
49
50
|
} = {}) => {
|
|
51
|
+
var _a;
|
|
50
52
|
const { dataSource: ctxDataSource, __designMode: ctxDesignMode } = (0, import_useDataSource.default)();
|
|
53
|
+
const context = (0, import_useEngineContext.default)();
|
|
54
|
+
const { pisell2ApiBaseUrl, mypisellApiBaseUrl } = ((_a = context.appHelper) == null ? void 0 : _a.constants) || {};
|
|
55
|
+
const baseUrlMap = {
|
|
56
|
+
"pisell2-api": pisell2ApiBaseUrl,
|
|
57
|
+
"mypisell-api": mypisellApiBaseUrl
|
|
58
|
+
};
|
|
51
59
|
const { parseVariable } = (0, import_useVariables.default)();
|
|
52
60
|
const { parseActions } = (0, import_useParseActionsVariable.default)();
|
|
53
61
|
const currentDataSource = propsDataSource || ctxDataSource;
|
|
@@ -93,7 +101,7 @@ var useActions = ({
|
|
|
93
101
|
return async (data) => {
|
|
94
102
|
const result = await (0, import_serve.customApi)(parsedPath || path, data, {
|
|
95
103
|
method,
|
|
96
|
-
baseUrl: options == null ? void 0 : options.baseUrl,
|
|
104
|
+
baseUrl: baseUrlMap[dataSourceKey] || (options == null ? void 0 : options.baseUrl),
|
|
97
105
|
params,
|
|
98
106
|
headers,
|
|
99
107
|
body
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
.saas-login-container {
|
|
2
2
|
// width: 100%;
|
|
3
|
+
width: 360px;
|
|
3
4
|
max-width: 360px;
|
|
5
|
+
min-width: 266px;
|
|
6
|
+
margin: 0 20px;
|
|
4
7
|
overflow-x: hidden;
|
|
5
8
|
// margin: 0 auto;
|
|
6
9
|
// padding: 24px;
|
|
7
|
-
text-align: center;
|
|
10
|
+
// text-align: center;
|
|
8
11
|
// height: 100%;
|
|
9
12
|
// overflow-y: auto;
|
|
10
13
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PisellViewGridProps {
|
|
4
|
+
columns?: number;
|
|
5
|
+
horizontalGap?: number;
|
|
6
|
+
verticalGap?: number;
|
|
7
|
+
singleRow?: boolean;
|
|
8
|
+
dataSource?: any[];
|
|
9
|
+
renderItem?: (item: any, index: number) => React.ReactNode;
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
className?: string;
|
|
13
|
+
style?: React.CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
declare const PisellViewGrid: React.FC<PisellViewGridProps>;
|
|
16
|
+
export default PisellViewGrid;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/pisellViewGrid/index.tsx
|
|
30
|
+
var pisellViewGrid_exports = {};
|
|
31
|
+
__export(pisellViewGrid_exports, {
|
|
32
|
+
default: () => pisellViewGrid_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellViewGrid_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_pisellLoading = __toESM(require("../pisellLoading"));
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var PisellViewGrid = ({
|
|
40
|
+
columns = 3,
|
|
41
|
+
horizontalGap = 10,
|
|
42
|
+
verticalGap = 10,
|
|
43
|
+
singleRow = false,
|
|
44
|
+
dataSource = [],
|
|
45
|
+
renderItem,
|
|
46
|
+
loading = false,
|
|
47
|
+
children,
|
|
48
|
+
className,
|
|
49
|
+
style
|
|
50
|
+
}) => {
|
|
51
|
+
const classes = (0, import_classnames.default)(
|
|
52
|
+
"pisell-view-grid",
|
|
53
|
+
{
|
|
54
|
+
"pisell-view-grid-single-row": singleRow
|
|
55
|
+
},
|
|
56
|
+
className
|
|
57
|
+
);
|
|
58
|
+
return /* @__PURE__ */ import_react.default.createElement(import_pisellLoading.default, { loading, fullscreen: false, style: { width: "100%" } }, /* @__PURE__ */ import_react.default.createElement(
|
|
59
|
+
"div",
|
|
60
|
+
{
|
|
61
|
+
className: classes,
|
|
62
|
+
style: {
|
|
63
|
+
...style,
|
|
64
|
+
width: "100%",
|
|
65
|
+
overflow: "hidden"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
69
|
+
"div",
|
|
70
|
+
{
|
|
71
|
+
className: "pisell-view-grid-content",
|
|
72
|
+
style: !singleRow ? {
|
|
73
|
+
gap: `${verticalGap}px ${horizontalGap}px`,
|
|
74
|
+
gridTemplateColumns: `repeat(${columns}, 1fr)`,
|
|
75
|
+
width: "100%"
|
|
76
|
+
} : {
|
|
77
|
+
display: "flex",
|
|
78
|
+
flexWrap: "nowrap",
|
|
79
|
+
overflowX: "auto",
|
|
80
|
+
width: "100%"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
dataSource.map((item, index) => /* @__PURE__ */ import_react.default.createElement(
|
|
84
|
+
"div",
|
|
85
|
+
{
|
|
86
|
+
key: index,
|
|
87
|
+
className: "pisell-view-grid-item",
|
|
88
|
+
style: {
|
|
89
|
+
minWidth: 0,
|
|
90
|
+
flex: `0 0 calc(100% / ${columns})`
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
renderItem == null ? void 0 : renderItem(item, index)
|
|
94
|
+
))
|
|
95
|
+
)
|
|
96
|
+
));
|
|
97
|
+
};
|
|
98
|
+
var pisellViewGrid_default = PisellViewGrid;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
.pisell-view-grid {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
box-sizing: border-box;
|
|
6
|
+
|
|
7
|
+
&-content {
|
|
8
|
+
display: grid;
|
|
9
|
+
width: 100%;
|
|
10
|
+
// grid-template-columns: repeat(4, 1fr);
|
|
11
|
+
// gap: 10px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&-item {
|
|
15
|
+
width: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-single-row {
|
|
19
|
+
&::-webkit-scrollbar {
|
|
20
|
+
display: none;
|
|
21
|
+
}
|
|
22
|
+
-ms-overflow-style: none;
|
|
23
|
+
scrollbar-width: none;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// &-item {
|
|
27
|
+
// box-sizing: border-box;
|
|
28
|
+
// display: inline-block;
|
|
29
|
+
// vertical-align: top;
|
|
30
|
+
// }
|
|
31
|
+
}
|