@pisell/materials 1.0.611 → 1.0.612
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 +1 -1
- package/build/lowcode/preview.js +20 -12
- package/build/lowcode/render/default/view.js +37 -23
- package/build/lowcode/view.js +35 -21
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +1 -1
- package/es/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +36 -5
- package/es/components/dataSourceComponents/fields/index.d.ts +1 -1
- package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +1 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +1 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.js +9 -2
- package/es/components/pisellDraggable/index.d.ts +4 -2
- package/es/components/pisellDraggable/index.js +7 -4
- package/es/components/pisellDropSort/PisellDropSort.js +4 -2
- package/es/components/pisellDropSort/components/SortableItem/index.d.ts +2 -0
- package/es/components/pisellDropSort/components/SortableItem/index.js +9 -2
- package/es/components/pisellDropSort/types.d.ts +2 -0
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +4 -4
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.d.ts +1 -1
- package/lib/components/dataSourceComponents/fields/DatePicker/ReadPretty.js +30 -3
- package/lib/components/dataSourceComponents/fields/index.d.ts +1 -1
- package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +1 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +1 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.js +7 -1
- package/lib/components/pisellDraggable/index.d.ts +4 -2
- package/lib/components/pisellDraggable/index.js +7 -4
- package/lib/components/pisellDropSort/PisellDropSort.js +4 -2
- package/lib/components/pisellDropSort/components/SortableItem/index.d.ts +2 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.js +3 -2
- package/lib/components/pisellDropSort/types.d.ts +2 -0
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
title: number | boolean | React.
|
|
20
|
+
title: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
21
|
pagination: {
|
|
22
22
|
total: number;
|
|
23
23
|
current: number;
|
|
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
26
|
showSizeChanger: boolean;
|
|
27
27
|
};
|
|
28
28
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean | React.
|
|
29
|
+
subTitle: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
30
|
buttons: any[] | null;
|
|
31
31
|
filter: React.JSX.Element | null;
|
|
32
32
|
onRow: (record: any) => any;
|
|
@@ -47,7 +47,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
47
47
|
width: number;
|
|
48
48
|
align: "center" | "left" | "right";
|
|
49
49
|
fixed: false | "left" | "right";
|
|
50
|
-
type: "
|
|
50
|
+
type: "button" | "link";
|
|
51
51
|
items: OperationItem[];
|
|
52
52
|
} | undefined;
|
|
53
53
|
operationContent?: {
|
|
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
65
65
|
useCustomAction: boolean;
|
|
66
66
|
actionType: string;
|
|
67
67
|
openMode: "modal" | "drawer";
|
|
68
|
-
openContentSize: "small" | "
|
|
68
|
+
openContentSize: "small" | "middle" | "large";
|
|
69
69
|
openTitle: string;
|
|
70
70
|
key: string;
|
|
71
71
|
} | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DatePickerProps } from './type';
|
|
3
3
|
import './ReadPretty.less';
|
|
4
|
-
declare const DatePickerReadPretty:
|
|
4
|
+
declare const DatePickerReadPretty: React.FC<DatePickerProps>;
|
|
5
5
|
export default DatePickerReadPretty;
|
|
@@ -1,14 +1,45 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import dayjs from 'dayjs';
|
|
4
|
+
import usePisellConfig from "../../../pisell-config-provider/hooks/usePisellConfig";
|
|
4
5
|
import "./ReadPretty.less";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
var DEFAULT_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
7
|
+
var DATE_FORMATS = {
|
|
8
|
+
'zh-CN': 'YYYY-MM-DD HH:mm:ss',
|
|
9
|
+
'en-US': 'HH:mm:ss YYYY-MM-DD'
|
|
10
|
+
};
|
|
11
|
+
var DatePickerReadPretty = function DatePickerReadPretty(_ref) {
|
|
12
|
+
var value = _ref.value,
|
|
13
|
+
renderMode = _ref.renderMode;
|
|
14
|
+
var _usePisellConfig = usePisellConfig(),
|
|
15
|
+
_usePisellConfig$loca = _usePisellConfig.locale,
|
|
16
|
+
locale = _usePisellConfig$loca === void 0 ? 'zh-CN' : _usePisellConfig$loca;
|
|
17
|
+
var dateFormat = useMemo(function () {
|
|
18
|
+
// 检查 locale 是否在预定义的格式中
|
|
19
|
+
if (locale in DATE_FORMATS) {
|
|
20
|
+
return DATE_FORMATS[locale];
|
|
21
|
+
}
|
|
22
|
+
// 如果 locale 不在预定义格式中,使用默认格式并在控制台输出警告
|
|
23
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
24
|
+
console.warn("Unsupported locale: ".concat(locale, ", falling back to default format"));
|
|
25
|
+
}
|
|
26
|
+
return DEFAULT_FORMAT;
|
|
27
|
+
}, [locale]);
|
|
28
|
+
var formattedDate = useMemo(function () {
|
|
29
|
+
if (!value) return '';
|
|
30
|
+
try {
|
|
31
|
+
return dayjs(value).format(dateFormat);
|
|
32
|
+
} catch (error) {
|
|
33
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
34
|
+
console.error('Error formatting date:', error);
|
|
35
|
+
}
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
}, [value, dateFormat]);
|
|
8
39
|
return /*#__PURE__*/React.createElement("span", {
|
|
9
40
|
className: classNames('pisell-date-picker-read-pretty', {
|
|
10
41
|
'pisell-date-picker-read-pretty-table-view': renderMode === 'tableView'
|
|
11
42
|
})
|
|
12
|
-
},
|
|
43
|
+
}, formattedDate);
|
|
13
44
|
};
|
|
14
45
|
export default DatePickerReadPretty;
|
|
@@ -59,7 +59,7 @@ declare const formFieldMap: {
|
|
|
59
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> |
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
63
63
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
64
|
} & {
|
|
65
65
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Props as TreeItemProps } from './TreeItem';
|
|
4
4
|
interface Props extends TreeItemProps {
|
|
5
5
|
id: UniqueIdentifier;
|
|
6
|
+
__designMode?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function SortableTreeItem({ id, depth, ...props }: Props): React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -17,5 +17,6 @@ export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
|
|
|
17
17
|
wrapperRef?(node: HTMLLIElement): void;
|
|
18
18
|
item: TreeItemType;
|
|
19
19
|
renderItem?(item: Props, ref: React.ForwardedRef<HTMLDivElement>): React.ReactNode;
|
|
20
|
+
__designMode?: string;
|
|
20
21
|
}
|
|
21
22
|
export declare const TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
|
|
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
|
+
var _excluded = ["childCount", "clone", "depth", "disableSelection", "disableInteraction", "ghost", "handleProps", "indentationWidth", "indicator", "collapsed", "onCollapse", "onRemove", "style", "wrapperRef", "item", "renderItem", "__designMode"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function 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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
3
9
|
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
10
|
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
11
|
import classNames from 'classnames';
|
|
@@ -23,6 +29,7 @@ export var TreeItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
23
29
|
wrapperRef = props.wrapperRef,
|
|
24
30
|
item = props.item,
|
|
25
31
|
renderItem = props.renderItem,
|
|
32
|
+
__designMode = props.__designMode,
|
|
26
33
|
otherProps = _objectWithoutProperties(props, _excluded);
|
|
27
34
|
if (renderItem) {
|
|
28
35
|
return renderItem(props, ref);
|
|
@@ -37,7 +44,7 @@ export var TreeItem = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
37
44
|
className: 'TreeItem',
|
|
38
45
|
ref: ref,
|
|
39
46
|
style: style
|
|
40
|
-
}, /*#__PURE__*/React.createElement(Handle, handleProps), onCollapse && /*#__PURE__*/React.createElement(Action, {
|
|
47
|
+
}, /*#__PURE__*/React.createElement(Handle, __designMode === 'design' ? {} : _objectSpread({}, handleProps)), onCollapse && /*#__PURE__*/React.createElement(Action, {
|
|
41
48
|
onClick: onCollapse,
|
|
42
49
|
className: classNames('Collapse', collapsed && 'collapsed')
|
|
43
50
|
}, collapseIcon), /*#__PURE__*/React.createElement("span", {
|
|
@@ -22,7 +22,9 @@ interface Props {
|
|
|
22
22
|
onChange?: (items: TreeItems) => void;
|
|
23
23
|
/** 删除节点前 */
|
|
24
24
|
onRemoveBefore?: (item: TreeItem) => Promise<boolean>;
|
|
25
|
+
/** 设计模式 */
|
|
26
|
+
__designMode?: string;
|
|
25
27
|
}
|
|
26
|
-
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, }: Props): React.JSX.Element;
|
|
27
|
-
declare const Demo: () => React.JSX.Element;
|
|
28
|
+
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, __designMode, }: Props): React.JSX.Element;
|
|
29
|
+
declare const Demo: (props: Props) => React.JSX.Element;
|
|
28
30
|
export default Demo;
|
|
@@ -120,7 +120,8 @@ export function SortableTree(_ref3) {
|
|
|
120
120
|
removable = _ref3$removable === void 0 ? true : _ref3$removable,
|
|
121
121
|
renderItem = _ref3.renderItem,
|
|
122
122
|
onChange = _ref3.onChange,
|
|
123
|
-
onRemoveBefore = _ref3.onRemoveBefore
|
|
123
|
+
onRemoveBefore = _ref3.onRemoveBefore,
|
|
124
|
+
__designMode = _ref3.__designMode;
|
|
124
125
|
// 状态管理
|
|
125
126
|
/** 当前树形数据 */
|
|
126
127
|
var _useState = useState([]),
|
|
@@ -198,6 +199,7 @@ export function SortableTree(_ref3) {
|
|
|
198
199
|
useEffect(function () {
|
|
199
200
|
document.body.id = 'body';
|
|
200
201
|
}, []);
|
|
202
|
+
console.log(__designMode, '__designMode');
|
|
201
203
|
return /*#__PURE__*/React.createElement(DndContext, {
|
|
202
204
|
sensors: sensors,
|
|
203
205
|
collisionDetection: closestCenter,
|
|
@@ -229,7 +231,8 @@ export function SortableTree(_ref3) {
|
|
|
229
231
|
onRemove: removable ? function () {
|
|
230
232
|
return handleRemove(item);
|
|
231
233
|
} : undefined,
|
|
232
|
-
renderItem: renderItem
|
|
234
|
+
renderItem: renderItem,
|
|
235
|
+
__designMode: __designMode
|
|
233
236
|
});
|
|
234
237
|
}), /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement(DragOverlay, {
|
|
235
238
|
dropAnimation: dropAnimationConfig,
|
|
@@ -374,7 +377,7 @@ var adjustTranslate = function adjustTranslate(_ref13) {
|
|
|
374
377
|
y: transform.y - 25
|
|
375
378
|
});
|
|
376
379
|
};
|
|
377
|
-
var Demo = function Demo() {
|
|
378
|
-
return /*#__PURE__*/React.createElement(SortableTree,
|
|
380
|
+
var Demo = function Demo(props) {
|
|
381
|
+
return /*#__PURE__*/React.createElement(SortableTree, props);
|
|
379
382
|
};
|
|
380
383
|
export default Demo;
|
|
@@ -32,7 +32,8 @@ var PisellDropSort = function PisellDropSort(_ref) {
|
|
|
32
32
|
onAdd = _ref.onAdd,
|
|
33
33
|
propsRenderItem = _ref.renderItem,
|
|
34
34
|
leftContent = _ref.leftContent,
|
|
35
|
-
onAddRoot = _ref.onAddRoot
|
|
35
|
+
onAddRoot = _ref.onAddRoot,
|
|
36
|
+
__designMode = _ref.__designMode;
|
|
36
37
|
// 转换数据格式
|
|
37
38
|
var treeItems = useMemo(function () {
|
|
38
39
|
return value.map(function (item) {
|
|
@@ -63,7 +64,8 @@ var PisellDropSort = function PisellDropSort(_ref) {
|
|
|
63
64
|
onDelete: onDelete,
|
|
64
65
|
showBorder: showBorder,
|
|
65
66
|
spacing: spacing,
|
|
66
|
-
maxLevel: maxLevel
|
|
67
|
+
maxLevel: maxLevel,
|
|
68
|
+
__designMode: __designMode
|
|
67
69
|
});
|
|
68
70
|
}, [allowAddChild, allowDelete, allowDrag, value, disabled, maxLevel, onAdd, onDelete, showBorder, spacing, treeItems]);
|
|
69
71
|
|
|
@@ -1,5 +1,11 @@
|
|
|
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); }
|
|
1
2
|
var _excluded = ["item", "depth", "clone", "ghost", "indicator", "disableSelection", "disableInteraction", "wrapperRef", "style", "onCollapse", "onRemove", "childCount", "indentationWidth", "handleProps", "collapsed"];
|
|
2
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
+
function 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; }
|
|
5
|
+
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; }
|
|
6
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
3
9
|
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
10
|
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
11
|
import React from 'react';
|
|
@@ -20,7 +26,8 @@ var SortableItem = function SortableItem(props) {
|
|
|
20
26
|
onDelete = props.onDelete,
|
|
21
27
|
showBorder = props.showBorder,
|
|
22
28
|
spacing = props.spacing,
|
|
23
|
-
maxLevel = props.maxLevel
|
|
29
|
+
maxLevel = props.maxLevel,
|
|
30
|
+
__designMode = props.__designMode;
|
|
24
31
|
var item = itemProps.item,
|
|
25
32
|
depth = itemProps.depth,
|
|
26
33
|
clone = itemProps.clone,
|
|
@@ -56,7 +63,7 @@ var SortableItem = function SortableItem(props) {
|
|
|
56
63
|
}),
|
|
57
64
|
type: "text",
|
|
58
65
|
className: "pisell-lowcode-drop-sort-item-button"
|
|
59
|
-
}, handleProps)), onCollapse && /*#__PURE__*/React.createElement(Button, {
|
|
66
|
+
}, __designMode === 'design' ? {} : _objectSpread({}, handleProps))), onCollapse && /*#__PURE__*/React.createElement(Button, {
|
|
60
67
|
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
61
68
|
type: "pisell2-chevron-down",
|
|
62
69
|
className: "pisell-lowcode-drop-sort-item-icon"
|
|
@@ -5,7 +5,7 @@ export declare const paginationConfig: {
|
|
|
5
5
|
className: string;
|
|
6
6
|
defaultCurrent: number;
|
|
7
7
|
showTotal: (total: number, range: [number, number]) => string;
|
|
8
|
-
itemRender: (page: number, type: "
|
|
8
|
+
itemRender: (page: number, type: "page" | "next" | "prev" | "jump-prev" | "jump-next", element: React.ReactNode) => React.ReactNode;
|
|
9
9
|
responsive: boolean;
|
|
10
10
|
size: string;
|
|
11
11
|
};
|
|
@@ -17,7 +17,7 @@ interface UseTablePropsProps {
|
|
|
17
17
|
* @returns
|
|
18
18
|
*/
|
|
19
19
|
declare const useTableProps: (props: UseTablePropsProps) => {
|
|
20
|
-
title: number | boolean | React.
|
|
20
|
+
title: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
21
21
|
pagination: {
|
|
22
22
|
total: number;
|
|
23
23
|
current: number;
|
|
@@ -26,7 +26,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
26
26
|
showSizeChanger: boolean;
|
|
27
27
|
};
|
|
28
28
|
columns: import("./useColumns").Column[];
|
|
29
|
-
subTitle: number | boolean | React.
|
|
29
|
+
subTitle: number | boolean | Iterable<React.ReactNode> | React.JSX.Element | (() => React.ReactNode) | null | undefined;
|
|
30
30
|
buttons: any[] | null;
|
|
31
31
|
filter: React.JSX.Element | null;
|
|
32
32
|
onRow: (record: any) => any;
|
|
@@ -47,7 +47,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
47
47
|
width: number;
|
|
48
48
|
align: "center" | "left" | "right";
|
|
49
49
|
fixed: false | "left" | "right";
|
|
50
|
-
type: "
|
|
50
|
+
type: "button" | "link";
|
|
51
51
|
items: OperationItem[];
|
|
52
52
|
} | undefined;
|
|
53
53
|
operationContent?: {
|
|
@@ -65,7 +65,7 @@ declare const useTableProps: (props: UseTablePropsProps) => {
|
|
|
65
65
|
useCustomAction: boolean;
|
|
66
66
|
actionType: string;
|
|
67
67
|
openMode: "modal" | "drawer";
|
|
68
|
-
openContentSize: "small" | "
|
|
68
|
+
openContentSize: "small" | "middle" | "large";
|
|
69
69
|
openTitle: string;
|
|
70
70
|
key: string;
|
|
71
71
|
} | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DatePickerProps } from './type';
|
|
3
3
|
import './ReadPretty.less';
|
|
4
|
-
declare const DatePickerReadPretty:
|
|
4
|
+
declare const DatePickerReadPretty: React.FC<DatePickerProps>;
|
|
5
5
|
export default DatePickerReadPretty;
|
|
@@ -35,9 +35,36 @@ module.exports = __toCommonJS(ReadPretty_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_dayjs = __toESM(require("dayjs"));
|
|
38
|
+
var import_usePisellConfig = __toESM(require("../../../pisell-config-provider/hooks/usePisellConfig"));
|
|
38
39
|
var import_ReadPretty = require("./ReadPretty.less");
|
|
39
|
-
var
|
|
40
|
-
|
|
40
|
+
var DEFAULT_FORMAT = "YYYY-MM-DD HH:mm:ss";
|
|
41
|
+
var DATE_FORMATS = {
|
|
42
|
+
"zh-CN": "YYYY-MM-DD HH:mm:ss",
|
|
43
|
+
"en-US": "HH:mm:ss YYYY-MM-DD"
|
|
44
|
+
};
|
|
45
|
+
var DatePickerReadPretty = ({ value, renderMode }) => {
|
|
46
|
+
const { locale = "zh-CN" } = (0, import_usePisellConfig.default)();
|
|
47
|
+
const dateFormat = (0, import_react.useMemo)(() => {
|
|
48
|
+
if (locale in DATE_FORMATS) {
|
|
49
|
+
return DATE_FORMATS[locale];
|
|
50
|
+
}
|
|
51
|
+
if (process.env.NODE_ENV !== "production") {
|
|
52
|
+
console.warn(`Unsupported locale: ${locale}, falling back to default format`);
|
|
53
|
+
}
|
|
54
|
+
return DEFAULT_FORMAT;
|
|
55
|
+
}, [locale]);
|
|
56
|
+
const formattedDate = (0, import_react.useMemo)(() => {
|
|
57
|
+
if (!value)
|
|
58
|
+
return "";
|
|
59
|
+
try {
|
|
60
|
+
return (0, import_dayjs.default)(value).format(dateFormat);
|
|
61
|
+
} catch (error) {
|
|
62
|
+
if (process.env.NODE_ENV !== "production") {
|
|
63
|
+
console.error("Error formatting date:", error);
|
|
64
|
+
}
|
|
65
|
+
return "";
|
|
66
|
+
}
|
|
67
|
+
}, [value, dateFormat]);
|
|
41
68
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
42
69
|
"span",
|
|
43
70
|
{
|
|
@@ -45,7 +72,7 @@ var DatePickerReadPretty = (props) => {
|
|
|
45
72
|
"pisell-date-picker-read-pretty-table-view": renderMode === "tableView"
|
|
46
73
|
})
|
|
47
74
|
},
|
|
48
|
-
|
|
75
|
+
formattedDate
|
|
49
76
|
);
|
|
50
77
|
};
|
|
51
78
|
var ReadPretty_default = DatePickerReadPretty;
|
|
@@ -59,7 +59,7 @@ declare const formFieldMap: {
|
|
|
59
59
|
FormItemTranslation: import("react").FC<import("./Translation/type").TranslationProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
60
60
|
FormItemIconSelect: import("react").FC<import("./IconSelect/type").IconSelectProps & import("../dataSourceForm/utils").WithModeProps & import("../dataSourceForm/utils").WithFormItemProps>;
|
|
61
61
|
};
|
|
62
|
-
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> |
|
|
62
|
+
declare const getFieldComponent: (fieldComponent: string) => import("react").FC<any> | import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps> | (import("react").FC<{}> & {
|
|
63
63
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
64
64
|
} & {
|
|
65
65
|
Group: import("react").FC<import("./Checkbox/type").CheckboxGroupProps & import("../dataSourceForm/utils").WithModeProps>;
|
|
@@ -3,6 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import { Props as TreeItemProps } from './TreeItem';
|
|
4
4
|
interface Props extends TreeItemProps {
|
|
5
5
|
id: UniqueIdentifier;
|
|
6
|
+
__designMode?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare function SortableTreeItem({ id, depth, ...props }: Props): React.JSX.Element;
|
|
8
9
|
export {};
|
|
@@ -17,5 +17,6 @@ export interface Props extends Omit<HTMLAttributes<HTMLLIElement>, 'id'> {
|
|
|
17
17
|
wrapperRef?(node: HTMLLIElement): void;
|
|
18
18
|
item: TreeItemType;
|
|
19
19
|
renderItem?(item: Props, ref: React.ForwardedRef<HTMLDivElement>): React.ReactNode;
|
|
20
|
+
__designMode?: string;
|
|
20
21
|
}
|
|
21
22
|
export declare const TreeItem: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -54,6 +54,7 @@ var TreeItem = (0, import_react.forwardRef)((props, ref) => {
|
|
|
54
54
|
wrapperRef,
|
|
55
55
|
item,
|
|
56
56
|
renderItem,
|
|
57
|
+
__designMode,
|
|
57
58
|
...otherProps
|
|
58
59
|
} = props;
|
|
59
60
|
if (renderItem) {
|
|
@@ -76,7 +77,12 @@ var TreeItem = (0, import_react.forwardRef)((props, ref) => {
|
|
|
76
77
|
},
|
|
77
78
|
...otherProps
|
|
78
79
|
},
|
|
79
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "TreeItem", ref, style }, /* @__PURE__ */ import_react.default.createElement(
|
|
80
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "TreeItem", ref, style }, /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
import_components.Handle,
|
|
82
|
+
{
|
|
83
|
+
...__designMode === "design" ? {} : { ...handleProps }
|
|
84
|
+
}
|
|
85
|
+
), onCollapse && /* @__PURE__ */ import_react.default.createElement(
|
|
80
86
|
import_components.Action,
|
|
81
87
|
{
|
|
82
88
|
onClick: onCollapse,
|
|
@@ -22,7 +22,9 @@ interface Props {
|
|
|
22
22
|
onChange?: (items: TreeItems) => void;
|
|
23
23
|
/** 删除节点前 */
|
|
24
24
|
onRemoveBefore?: (item: TreeItem) => Promise<boolean>;
|
|
25
|
+
/** 设计模式 */
|
|
26
|
+
__designMode?: string;
|
|
25
27
|
}
|
|
26
|
-
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, }: Props): React.JSX.Element;
|
|
27
|
-
declare const Demo: () => React.JSX.Element;
|
|
28
|
+
export declare function SortableTree({ collapsible, value, indicator, indentationWidth, removable, renderItem, onChange, onRemoveBefore, __designMode, }: Props): React.JSX.Element;
|
|
29
|
+
declare const Demo: (props: Props) => React.JSX.Element;
|
|
28
30
|
export default Demo;
|
|
@@ -101,7 +101,8 @@ function SortableTree({
|
|
|
101
101
|
removable = true,
|
|
102
102
|
renderItem,
|
|
103
103
|
onChange,
|
|
104
|
-
onRemoveBefore
|
|
104
|
+
onRemoveBefore,
|
|
105
|
+
__designMode
|
|
105
106
|
}) {
|
|
106
107
|
const [items, setItems] = (0, import_react.useState)([]);
|
|
107
108
|
const [activeId, setActiveId] = (0, import_react.useState)(null);
|
|
@@ -148,6 +149,7 @@ function SortableTree({
|
|
|
148
149
|
(0, import_react.useEffect)(() => {
|
|
149
150
|
document.body.id = "body";
|
|
150
151
|
}, []);
|
|
152
|
+
console.log(__designMode, "__designMode");
|
|
151
153
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
152
154
|
import_core.DndContext,
|
|
153
155
|
{
|
|
@@ -174,7 +176,8 @@ function SortableTree({
|
|
|
174
176
|
collapsed: Boolean(collapsed && children.length),
|
|
175
177
|
onCollapse: collapsible && children.length ? () => handleCollapse(id) : void 0,
|
|
176
178
|
onRemove: removable ? () => handleRemove(item) : void 0,
|
|
177
|
-
renderItem
|
|
179
|
+
renderItem,
|
|
180
|
+
__designMode
|
|
178
181
|
}
|
|
179
182
|
);
|
|
180
183
|
}), (0, import_react_dom.createPortal)(
|
|
@@ -261,8 +264,8 @@ var adjustTranslate = ({ transform }) => {
|
|
|
261
264
|
y: transform.y - 25
|
|
262
265
|
};
|
|
263
266
|
};
|
|
264
|
-
var Demo = () => {
|
|
265
|
-
return /* @__PURE__ */ import_react.default.createElement(SortableTree,
|
|
267
|
+
var Demo = (props) => {
|
|
268
|
+
return /* @__PURE__ */ import_react.default.createElement(SortableTree, { ...props });
|
|
266
269
|
};
|
|
267
270
|
var pisellDraggable_default = Demo;
|
|
268
271
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -57,7 +57,8 @@ var PisellDropSort = ({
|
|
|
57
57
|
onAdd,
|
|
58
58
|
renderItem: propsRenderItem,
|
|
59
59
|
leftContent,
|
|
60
|
-
onAddRoot
|
|
60
|
+
onAddRoot,
|
|
61
|
+
__designMode
|
|
61
62
|
}) => {
|
|
62
63
|
const treeItems = (0, import_react.useMemo)(() => {
|
|
63
64
|
return value.map((item) => {
|
|
@@ -87,7 +88,8 @@ var PisellDropSort = ({
|
|
|
87
88
|
onDelete,
|
|
88
89
|
showBorder,
|
|
89
90
|
spacing,
|
|
90
|
-
maxLevel
|
|
91
|
+
maxLevel,
|
|
92
|
+
__designMode
|
|
91
93
|
}
|
|
92
94
|
);
|
|
93
95
|
},
|
|
@@ -51,7 +51,8 @@ var SortableItem = (props) => {
|
|
|
51
51
|
onDelete,
|
|
52
52
|
showBorder,
|
|
53
53
|
spacing,
|
|
54
|
-
maxLevel
|
|
54
|
+
maxLevel,
|
|
55
|
+
__designMode
|
|
55
56
|
} = props;
|
|
56
57
|
const {
|
|
57
58
|
item,
|
|
@@ -104,7 +105,7 @@ var SortableItem = (props) => {
|
|
|
104
105
|
icon: /* @__PURE__ */ import_react.default.createElement(import_DotsSix.default, { className: "pisell-lowcode-drop-sort-item-drag-handle-icon" }),
|
|
105
106
|
type: "text",
|
|
106
107
|
className: "pisell-lowcode-drop-sort-item-button",
|
|
107
|
-
...handleProps
|
|
108
|
+
...__designMode === "design" ? {} : { ...handleProps }
|
|
108
109
|
}
|
|
109
110
|
),
|
|
110
111
|
onCollapse && /* @__PURE__ */ import_react.default.createElement(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.612",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"libphonenumber-js": "^1.11.17",
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
71
|
"react-barcode": "^1.5.3",
|
|
72
|
-
"@pisell/date-picker": "1.0.115",
|
|
73
72
|
"@pisell/icon": "0.0.10",
|
|
74
|
-
"@pisell/utils": "1.0.43"
|
|
73
|
+
"@pisell/utils": "1.0.43",
|
|
74
|
+
"@pisell/date-picker": "1.0.115"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^18.0.0",
|