@pisell/materials 6.0.14 → 6.0.15
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 +5 -5
- package/build/lowcode/preview.js +21 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +34 -20
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +34 -20
- package/es/components/Pagination/index.d.ts +1 -1
- package/es/components/appVersionControl/index.d.ts +5 -0
- package/es/components/appVersionControl/index.js +218 -0
- package/es/components/appVersionControl/index.less +35 -0
- package/es/components/appVersionControl/types.d.ts +24 -0
- package/es/components/appVersionControl/types.js +1 -0
- package/es/components/appVersionControl/utils.d.ts +13 -0
- package/es/components/appVersionControl/utils.js +30 -0
- package/es/components/customSelect/index.d.ts +17 -0
- package/es/components/customSelect/index.js +32 -0
- package/es/components/customSelect/index.less +7 -0
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/group/index.js +23 -6
- package/es/components/dataSourceComponents/dataSourceForm/group/index.less +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +1 -1
- package/es/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +4 -8
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/submitButton/index.js +4 -3
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +6 -3
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +94 -18
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +6 -2
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +30 -6
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +1 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +17 -1
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -2
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +33 -13
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +7 -1
- package/es/components/dataSourceComponents/dataSourceTable/index.d.ts +3 -2
- package/es/components/dataSourceComponents/dataSourceTable/index.js +7 -4
- package/es/components/dataSourceComponents/fields/DatePicker/index.js +13 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +5 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.js +18 -0
- package/es/components/dataSourceComponents/fields/IconSelect/ReadPretty.less +6 -0
- package/es/components/dataSourceComponents/fields/IconSelect/WithMode.d.ts +4 -0
- package/es/components/dataSourceComponents/fields/IconSelect/WithMode.js +5 -0
- package/es/components/dataSourceComponents/fields/IconSelect/index.d.ts +3 -0
- package/es/components/dataSourceComponents/fields/IconSelect/index.js +4 -0
- package/es/components/dataSourceComponents/fields/IconSelect/type.d.ts +8 -0
- package/es/components/dataSourceComponents/fields/IconSelect/type.js +1 -0
- package/es/components/dataSourceComponents/fields/Input/WithMode.d.ts +3 -3
- package/es/components/dataSourceComponents/fields/Input/WithMode.js +8 -1
- package/es/components/dataSourceComponents/fields/Input/type.d.ts +2 -0
- package/es/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/Select/index.js +2 -1
- package/es/components/dataSourceComponents/fields/Upload/BaseUpload.js +12 -54
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.js +2 -2
- package/es/components/dataSourceComponents/fields/Upload/ReadPretty.less +1 -0
- package/es/components/dataSourceComponents/fields/Upload/index.js +35 -1
- package/es/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/es/components/dataSourceComponents/fields/index.d.ts +5 -2
- package/es/components/dataSourceComponents/fields/index.js +3 -1
- package/es/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/es/components/dataSourceComponents/hooks/useValueMap.js +2 -2
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +8 -0
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceContext.js +2 -1
- package/es/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +11 -3
- package/es/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
- package/es/components/iconSelect/index.d.ts +10 -0
- package/es/components/iconSelect/index.js +217 -0
- package/es/components/iconSelect/index.less +54 -0
- package/es/components/iconSelect/utils.d.ts +14 -0
- package/es/components/iconSelect/utils.js +102 -0
- package/es/components/image/avatar.png +0 -0
- package/es/components/image/image.png +0 -0
- package/es/components/image/index.d.ts +10 -0
- package/es/components/image/index.js +25 -0
- package/es/components/image/product.png +0 -0
- package/es/components/page-header/index.less +4 -4
- package/es/components/pisellAppCard/PisellAppCard.d.ts +5 -0
- package/es/components/pisellAppCard/PisellAppCard.js +80 -0
- package/es/components/pisellAppCard/PisellAppCard.less +55 -0
- package/es/components/pisellAppCard/index.d.ts +3 -0
- package/es/components/pisellAppCard/index.js +2 -0
- package/es/components/pisellAppCard/types.d.ts +34 -0
- package/es/components/pisellAppCard/types.js +1 -0
- package/es/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +1 -0
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +2 -1
- package/es/components/pisellDraggable/components/TreeItem/TreeItem.js +10 -3
- package/es/components/pisellDraggable/index.d.ts +6 -3
- package/es/components/pisellDraggable/index.js +9 -6
- package/es/components/pisellDraggable/types.d.ts +1 -0
- package/es/components/pisellDraggable/utilities.js +10 -6
- package/es/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/es/components/pisellDropSort/PisellDropSort.js +94 -0
- package/es/components/pisellDropSort/PisellDropSort.less +92 -0
- package/es/components/pisellDropSort/components/SortableItem/index.d.ts +25 -0
- package/es/components/pisellDropSort/components/SortableItem/index.js +104 -0
- package/es/components/pisellDropSort/components/SortableItem/index.less +157 -0
- package/es/components/pisellDropSort/index.d.ts +3 -0
- package/es/components/pisellDropSort/index.js +2 -0
- package/es/components/pisellDropSort/types.d.ts +52 -0
- package/es/components/pisellDropSort/types.js +1 -0
- package/es/components/pisellEmpty/index.d.ts +2 -0
- package/es/components/pisellEmpty/index.js +6 -2
- package/es/components/pisellModal/components/Information/index.js +0 -1
- package/es/components/pisellModal/components/MobileModal/index.js +42 -2
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.js +218 -0
- package/es/components/pisellNavigationMenu/PisellNavigationMenu.less +65 -0
- package/es/components/pisellNavigationMenu/index.d.ts +3 -0
- package/es/components/pisellNavigationMenu/index.js +2 -0
- package/es/components/pisellNavigationMenu/types.d.ts +64 -0
- package/es/components/pisellNavigationMenu/types.js +1 -0
- package/es/components/pisellNavigationMenu/utils.d.ts +15 -0
- package/es/components/pisellNavigationMenu/utils.js +29 -0
- package/es/components/table/Table/utils.d.ts +1 -1
- package/es/components/versionModal/index.d.ts +8 -0
- package/es/components/versionModal/index.js +41 -9
- package/es/components/versionModal/index.less +9 -2
- package/es/components/versionSelect/index.d.ts +18 -0
- package/es/components/versionSelect/index.js +53 -0
- package/es/components/versionSelect/index.less +3 -0
- package/es/index.d.ts +11 -1
- package/es/index.js +11 -2
- package/es/locales/en-US.d.ts +25 -0
- package/es/locales/en-US.js +34 -1
- package/es/locales/zh-CN.d.ts +25 -0
- package/es/locales/zh-CN.js +33 -1
- package/es/locales/zh-TW.d.ts +26 -0
- package/es/locales/zh-TW.js +35 -1
- package/es/typings.d.ts +4 -0
- package/lib/components/Pagination/index.d.ts +1 -1
- package/lib/components/appVersionControl/index.d.ts +5 -0
- package/lib/components/appVersionControl/index.js +188 -0
- package/lib/components/appVersionControl/index.less +35 -0
- package/lib/components/appVersionControl/types.d.ts +24 -0
- package/lib/components/appVersionControl/types.js +17 -0
- package/lib/components/appVersionControl/utils.d.ts +13 -0
- package/lib/components/appVersionControl/utils.js +52 -0
- package/lib/components/customSelect/index.d.ts +17 -0
- package/lib/components/customSelect/index.js +59 -0
- package/lib/components/customSelect/index.less +7 -0
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.js +13 -6
- package/lib/components/dataSourceComponents/dataSourceForm/group/index.less +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/formSetting/FormSettingProvider.js +1 -1
- package/lib/components/dataSourceComponents/dataSourceForm/provider/jsonWrapper/JsonWrapperProvider.js +2 -2
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/submitButton/index.js +3 -2
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +6 -3
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +118 -16
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.d.ts +6 -2
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +27 -5
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useColumns.js +5 -4
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useFormat.js +58 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.d.ts +7 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +21 -10
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableQuery.js +7 -1
- package/lib/components/dataSourceComponents/dataSourceTable/index.d.ts +3 -2
- package/lib/components/dataSourceComponents/dataSourceTable/index.js +3 -3
- package/lib/components/dataSourceComponents/fields/DatePicker/index.js +9 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.d.ts +5 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.js +52 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/ReadPretty.less +6 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/WithMode.d.ts +4 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/WithMode.js +39 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/index.d.ts +3 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/index.js +38 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/fields/IconSelect/type.js +17 -0
- package/lib/components/dataSourceComponents/fields/Input/WithMode.d.ts +3 -3
- package/lib/components/dataSourceComponents/fields/Input/WithMode.js +6 -2
- package/lib/components/dataSourceComponents/fields/Input/type.d.ts +2 -0
- package/lib/components/dataSourceComponents/fields/Select/index.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/Select/index.js +2 -1
- package/lib/components/dataSourceComponents/fields/Upload/BaseUpload.js +0 -35
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.js +1 -1
- package/lib/components/dataSourceComponents/fields/Upload/ReadPretty.less +1 -0
- package/lib/components/dataSourceComponents/fields/Upload/index.js +25 -1
- package/lib/components/dataSourceComponents/fields/Upload/type.d.ts +1 -0
- package/lib/components/dataSourceComponents/fields/index.d.ts +5 -2
- package/lib/components/dataSourceComponents/fields/index.js +3 -1
- package/lib/components/dataSourceComponents/hooks/useActions.js +1 -1
- package/lib/components/dataSourceComponents/hooks/useValueMap.js +1 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.d.ts +8 -0
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceContext.js +3 -1
- package/lib/components/dataSourceComponents/provider/dataSource/DataSourceProvider.js +9 -1
- package/lib/components/dataSourceComponents/provider/variables/VariablesProvider.js +3 -0
- package/lib/components/iconSelect/index.d.ts +10 -0
- package/lib/components/iconSelect/index.js +189 -0
- package/lib/components/iconSelect/index.less +54 -0
- package/lib/components/iconSelect/utils.d.ts +14 -0
- package/lib/components/iconSelect/utils.js +119 -0
- package/lib/components/image/avatar.png +0 -0
- package/lib/components/image/image.png +0 -0
- package/lib/components/image/index.d.ts +10 -0
- package/lib/components/image/index.js +59 -0
- package/lib/components/image/product.png +0 -0
- package/lib/components/page-header/index.less +4 -4
- package/lib/components/pisellAppCard/PisellAppCard.d.ts +5 -0
- package/lib/components/pisellAppCard/PisellAppCard.js +107 -0
- package/lib/components/pisellAppCard/PisellAppCard.less +55 -0
- package/lib/components/pisellAppCard/index.d.ts +3 -0
- package/lib/components/pisellAppCard/index.js +36 -0
- package/lib/components/pisellAppCard/types.d.ts +34 -0
- package/lib/components/pisellAppCard/types.js +17 -0
- package/lib/components/pisellDraggable/components/TreeItem/SortableTreeItem.d.ts +1 -0
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.d.ts +2 -1
- package/lib/components/pisellDraggable/components/TreeItem/TreeItem.js +8 -2
- package/lib/components/pisellDraggable/index.d.ts +6 -3
- package/lib/components/pisellDraggable/index.js +8 -6
- package/lib/components/pisellDraggable/types.d.ts +1 -0
- package/lib/components/pisellDraggable/utilities.js +9 -6
- package/lib/components/pisellDropSort/PisellDropSort.d.ts +5 -0
- package/lib/components/pisellDropSort/PisellDropSort.js +143 -0
- package/lib/components/pisellDropSort/PisellDropSort.less +92 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.d.ts +25 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.js +171 -0
- package/lib/components/pisellDropSort/components/SortableItem/index.less +157 -0
- package/lib/components/pisellDropSort/index.d.ts +3 -0
- package/lib/components/pisellDropSort/index.js +36 -0
- package/lib/components/pisellDropSort/types.d.ts +52 -0
- package/lib/components/pisellDropSort/types.js +17 -0
- package/lib/components/pisellEmpty/index.d.ts +2 -0
- package/lib/components/pisellEmpty/index.js +2 -1
- package/lib/components/pisellModal/components/Information/index.js +0 -1
- package/lib/components/pisellModal/components/MobileModal/index.js +39 -1
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.d.ts +5 -0
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.js +231 -0
- package/lib/components/pisellNavigationMenu/PisellNavigationMenu.less +65 -0
- package/lib/components/pisellNavigationMenu/index.d.ts +3 -0
- package/lib/components/pisellNavigationMenu/index.js +36 -0
- package/lib/components/pisellNavigationMenu/types.d.ts +64 -0
- package/lib/components/pisellNavigationMenu/types.js +17 -0
- package/lib/components/pisellNavigationMenu/utils.d.ts +15 -0
- package/lib/components/pisellNavigationMenu/utils.js +44 -0
- package/lib/components/table/Table/utils.d.ts +1 -1
- package/lib/components/versionModal/index.d.ts +8 -0
- package/lib/components/versionModal/index.js +35 -8
- package/lib/components/versionModal/index.less +9 -2
- package/lib/components/versionSelect/index.d.ts +18 -0
- package/lib/components/versionSelect/index.js +91 -0
- package/lib/components/versionSelect/index.less +3 -0
- package/lib/index.d.ts +11 -1
- package/lib/index.js +26 -1
- package/lib/locales/en-US.d.ts +25 -0
- package/lib/locales/en-US.js +32 -1
- package/lib/locales/zh-CN.d.ts +25 -0
- package/lib/locales/zh-CN.js +31 -1
- package/lib/locales/zh-TW.d.ts +26 -0
- package/lib/locales/zh-TW.js +33 -1
- package/lib/typings.d.ts +4 -0
- package/lowcode/_setters/antd-icon-setter/index.tsx +11 -4
- package/lowcode/_utils/defaultSchema.ts +18 -1
- package/lowcode/app-version-control/meta.ts +92 -0
- package/lowcode/custom-select/meta.ts +202 -0
- package/lowcode/custom-select/snippets.ts +33 -0
- package/lowcode/data-source-form/constants.ts +2 -1
- package/lowcode/data-source-form/meta.ts +1 -1
- package/lowcode/data-source-image/meta.ts +1 -1
- package/lowcode/data-source-qrcode/meta.ts +1 -1
- package/lowcode/data-source-table/meta.ts +26 -4
- package/lowcode/data-source-table/snippets.ts +1 -1
- package/lowcode/data-source-typography.text/meta.ts +1 -1
- package/lowcode/data-source-wrapper/meta.ts +1 -1
- package/lowcode/form-group/meta.ts +1 -1
- package/lowcode/form-item-checkbox/meta.ts +1 -1
- package/lowcode/form-item-checkbox.group/meta.ts +1 -1
- package/lowcode/form-item-color-picker/meta.ts +1 -1
- package/lowcode/form-item-date-picker/meta.ts +14 -1
- package/lowcode/form-item-icon-select/meta.ts +65 -0
- package/lowcode/form-item-icon-select/snippets.ts +12 -0
- package/lowcode/form-item-input/meta.ts +13 -1
- package/lowcode/form-item-input-number/meta.ts +1 -1
- package/lowcode/form-item-input.email/meta.ts +1 -1
- package/lowcode/form-item-input.json/meta.ts +1 -1
- package/lowcode/form-item-input.mobile/meta.ts +1 -1
- package/lowcode/form-item-input.password/meta.ts +1 -1
- package/lowcode/form-item-input.phone/meta.ts +1 -1
- package/lowcode/form-item-input.subdomain/meta.ts +1 -1
- package/lowcode/form-item-input.text-area/meta.ts +1 -1
- package/lowcode/form-item-input.url/meta.ts +1 -1
- package/lowcode/form-item-radio/meta.ts +1 -1
- package/lowcode/form-item-radio.group/meta.ts +1 -1
- package/lowcode/form-item-select/meta.ts +1 -1
- package/lowcode/form-item-time-picker/meta.ts +1 -1
- package/lowcode/form-item-translation/meta.ts +1 -1
- package/lowcode/form-item-upload/meta.ts +1 -1
- package/lowcode/icon-select/meta.ts +98 -0
- package/lowcode/image/meta.ts +19 -0
- package/lowcode/image/snippets.ts +1 -0
- package/lowcode/json-wrapper/meta.ts +1 -1
- package/lowcode/pisell-app-card/meta.ts +286 -0
- package/lowcode/pisell-drop-sort/meta.ts +362 -0
- package/lowcode/pisell-navigation-menu/meta.ts +125 -0
- package/lowcode/submit-button/meta.ts +15 -1
- package/package.json +4 -4
- package/dist/umd/materials.min.css +0 -1
- package/dist/umd/materials.min.js +0 -1
- package/dist/umd/static/DotsSix.57d66266.svg +0 -1
- package/dist/umd/static/arrow-left.e542294f.svg +0 -1
- package/dist/umd/static/arrow-right.763f03e0.svg +0 -1
- package/dist/umd/static/filter-lines.04a54ae9.svg +0 -1
- package/dist/umd/static/help-circle.31c9be40.svg +0 -1
- package/dist/umd/static/switch-vertical-01.7ebe3ba8.svg +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import type { Props as TreeItem } from '../pisellDraggable/components/TreeItem/TreeItem';
|
|
3
|
+
import type { TreeItem as TreeItemType } from '../pisellDraggable/types';
|
|
4
|
+
export interface DropSortItem extends TreeItemType {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface PisellDropSortProps {
|
|
8
|
+
/** value */
|
|
9
|
+
value: DropSortItem[];
|
|
10
|
+
/** 允许拖拽 */
|
|
11
|
+
allowDrag?: boolean;
|
|
12
|
+
/** 允许删除 */
|
|
13
|
+
allowDelete?: boolean;
|
|
14
|
+
/** 允许添加子节点 */
|
|
15
|
+
allowAddChild?: boolean;
|
|
16
|
+
/** 允许添加根节点 */
|
|
17
|
+
allowAddRoot?: boolean;
|
|
18
|
+
/** 是否禁用 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 节点间距 */
|
|
21
|
+
spacing?: number;
|
|
22
|
+
/** 最大层级数 */
|
|
23
|
+
maxLevel?: number;
|
|
24
|
+
/** 是否显示边框 */
|
|
25
|
+
showBorder?: boolean;
|
|
26
|
+
/** 样式 */
|
|
27
|
+
style?: CSSProperties;
|
|
28
|
+
/** 类名 */
|
|
29
|
+
className?: string;
|
|
30
|
+
/** 数据源变化回调 */
|
|
31
|
+
onChange?: (items: DropSortItem[]) => void;
|
|
32
|
+
/** 删除节点回调 */
|
|
33
|
+
onDelete?: (itemProps: TreeItem) => void;
|
|
34
|
+
/** 添加节点回调 */
|
|
35
|
+
onAdd?: (itemProps: TreeItem) => void;
|
|
36
|
+
/** 自定义渲染节点 */
|
|
37
|
+
renderItem?: (itemProps: TreeItem) => React.ReactNode;
|
|
38
|
+
/** 添加根节点回调 */
|
|
39
|
+
onAddRoot?: () => void;
|
|
40
|
+
/** 左侧自定义内容 */
|
|
41
|
+
leftContent?: React.ReactNode;
|
|
42
|
+
/** 右侧自定义内容 */
|
|
43
|
+
rightContent?: React.ReactNode;
|
|
44
|
+
/** 空状态自定义内容 */
|
|
45
|
+
emptyContent?: React.ReactNode;
|
|
46
|
+
/** 设计模式 */
|
|
47
|
+
__designMode?: string;
|
|
48
|
+
/** 是否自定义操作 */
|
|
49
|
+
isCustomAction?: boolean;
|
|
50
|
+
/** 获取item样式 */
|
|
51
|
+
getItemStyle?: (itemProps: TreeItem) => React.CSSProperties;
|
|
52
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -11,6 +11,8 @@ export interface PisellEmptyProps extends EmptyProps {
|
|
|
11
11
|
icon?: React.ReactNode;
|
|
12
12
|
/** 自定义底部额外操作区域 */
|
|
13
13
|
footer?: React.ReactNode;
|
|
14
|
+
/** 最大宽度 */
|
|
15
|
+
maxWidth?: number;
|
|
14
16
|
}
|
|
15
17
|
declare const PisellEmpty: (props: PisellEmptyProps) => React.JSX.Element;
|
|
16
18
|
export default PisellEmpty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["description", "extraDescription", "icon", "footer", "className"];
|
|
1
|
+
var _excluded = ["description", "extraDescription", "icon", "footer", "className", "maxWidth"];
|
|
2
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); }
|
|
3
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
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; }
|
|
@@ -16,6 +16,7 @@ var PisellEmpty = function PisellEmpty(props) {
|
|
|
16
16
|
icon = props.icon,
|
|
17
17
|
footer = props.footer,
|
|
18
18
|
className = props.className,
|
|
19
|
+
maxWidth = props.maxWidth,
|
|
19
20
|
others = _objectWithoutProperties(props, _excluded);
|
|
20
21
|
return /*#__PURE__*/React.createElement(Empty, _extends({}, others, {
|
|
21
22
|
className: classNames('pisell-empty-wrap', className),
|
|
@@ -27,7 +28,10 @@ var PisellEmpty = function PisellEmpty(props) {
|
|
|
27
28
|
}
|
|
28
29
|
})),
|
|
29
30
|
description: /*#__PURE__*/React.createElement("div", {
|
|
30
|
-
className: "pisell-empty-wrap-description-wrap"
|
|
31
|
+
className: "pisell-empty-wrap-description-wrap",
|
|
32
|
+
style: {
|
|
33
|
+
maxWidth: maxWidth || 300
|
|
34
|
+
}
|
|
31
35
|
}, /*#__PURE__*/React.createElement("div", {
|
|
32
36
|
className: "pisell-empty-wrap-description"
|
|
33
37
|
}, description), /*#__PURE__*/React.createElement("div", {
|
|
@@ -14,7 +14,6 @@ var Information = function Information(props) {
|
|
|
14
14
|
mobileModalHeight: "auto",
|
|
15
15
|
headerDivider: false,
|
|
16
16
|
footerDivider: footerDivider,
|
|
17
|
-
size: "small",
|
|
18
17
|
transitionName: "pisell-move-down"
|
|
19
18
|
}), /*#__PURE__*/React.createElement("div", {
|
|
20
19
|
className: "pisell-modal-information-title"
|
|
@@ -3,13 +3,52 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
3
3
|
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; }
|
|
4
4
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
5
|
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); }
|
|
6
|
-
import React from 'react';
|
|
6
|
+
import React, { useEffect, useRef } from 'react';
|
|
7
7
|
import classNames from 'classnames';
|
|
8
8
|
import PcModal from "../PcModal";
|
|
9
9
|
import "./index.less";
|
|
10
|
+
var modalCount = 0;
|
|
10
11
|
var MobileModal = function MobileModal(props) {
|
|
11
12
|
var wrapClassName = props.wrapClassName,
|
|
12
13
|
mobileModalHeight = props.mobileModalHeight;
|
|
14
|
+
var ref = React.useRef(null);
|
|
15
|
+
var prevOpenRef = useRef(props.open);
|
|
16
|
+
var isFirstRender = useRef(true);
|
|
17
|
+
|
|
18
|
+
// 处理初始化时的open状态
|
|
19
|
+
useEffect(function () {
|
|
20
|
+
if (isFirstRender.current && props.open) {
|
|
21
|
+
modalCount++;
|
|
22
|
+
document.body.style.overflow = 'hidden';
|
|
23
|
+
}
|
|
24
|
+
isFirstRender.current = false;
|
|
25
|
+
}, []);
|
|
26
|
+
useEffect(function () {
|
|
27
|
+
if (!isFirstRender.current && props.open !== prevOpenRef.current) {
|
|
28
|
+
if (props.open) {
|
|
29
|
+
modalCount++;
|
|
30
|
+
document.body.style.overflow = 'hidden';
|
|
31
|
+
} else {
|
|
32
|
+
modalCount--;
|
|
33
|
+
if (modalCount <= 0) {
|
|
34
|
+
modalCount = 0;
|
|
35
|
+
document.body.style.overflow = '';
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
prevOpenRef.current = props.open;
|
|
39
|
+
}
|
|
40
|
+
}, [props.open]);
|
|
41
|
+
useEffect(function () {
|
|
42
|
+
return function () {
|
|
43
|
+
if (prevOpenRef.current) {
|
|
44
|
+
modalCount--;
|
|
45
|
+
if (modalCount <= 0) {
|
|
46
|
+
modalCount = 0;
|
|
47
|
+
document.body.style.overflow = '';
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
}, []);
|
|
13
52
|
return /*#__PURE__*/React.createElement(PcModal, _extends({}, props, {
|
|
14
53
|
transitionName: "pisell-move-down",
|
|
15
54
|
width: "100%",
|
|
@@ -19,7 +58,8 @@ var MobileModal = function MobileModal(props) {
|
|
|
19
58
|
className: classNames(_defineProperty({}, 'pisell-mobile-modal-render', mobileModalHeight)),
|
|
20
59
|
style: {
|
|
21
60
|
height: mobileModalHeight || '100%'
|
|
22
|
-
}
|
|
61
|
+
},
|
|
62
|
+
ref: ref
|
|
23
63
|
}, node);
|
|
24
64
|
}
|
|
25
65
|
}));
|
|
@@ -0,0 +1,218 @@
|
|
|
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, { useCallback, useMemo } from 'react';
|
|
8
|
+
import PisellDropSort from "../pisellDropSort";
|
|
9
|
+
import PisellTags from "../pisellTags";
|
|
10
|
+
import Icon from "../icon";
|
|
11
|
+
import Button from "../button";
|
|
12
|
+
import { getText } from "../../locales";
|
|
13
|
+
import { Dropdown } from 'antd';
|
|
14
|
+
import PisellEmpty from "../pisellEmpty";
|
|
15
|
+
import { formatTree } from "./utils";
|
|
16
|
+
import "./PisellNavigationMenu.less";
|
|
17
|
+
var PisellNavigationMenu = function PisellNavigationMenu(_ref) {
|
|
18
|
+
var _ref$value = _ref.value,
|
|
19
|
+
value = _ref$value === void 0 ? [] : _ref$value,
|
|
20
|
+
_ref$allowDrag = _ref.allowDrag,
|
|
21
|
+
allowDrag = _ref$allowDrag === void 0 ? true : _ref$allowDrag,
|
|
22
|
+
_ref$allowDelete = _ref.allowDelete,
|
|
23
|
+
allowDelete = _ref$allowDelete === void 0 ? true : _ref$allowDelete,
|
|
24
|
+
_ref$allowAddChild = _ref.allowAddChild,
|
|
25
|
+
allowAddChild = _ref$allowAddChild === void 0 ? true : _ref$allowAddChild,
|
|
26
|
+
_ref$allowAddRoot = _ref.allowAddRoot,
|
|
27
|
+
allowAddRoot = _ref$allowAddRoot === void 0 ? true : _ref$allowAddRoot,
|
|
28
|
+
_ref$disabled = _ref.disabled,
|
|
29
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
30
|
+
_ref$spacing = _ref.spacing,
|
|
31
|
+
spacing = _ref$spacing === void 0 ? 8 : _ref$spacing,
|
|
32
|
+
_ref$maxLevel = _ref.maxLevel,
|
|
33
|
+
maxLevel = _ref$maxLevel === void 0 ? 3 : _ref$maxLevel,
|
|
34
|
+
style = _ref.style,
|
|
35
|
+
className = _ref.className,
|
|
36
|
+
onChange = _ref.onChange,
|
|
37
|
+
onAddSubMenu = _ref.onAddSubMenu,
|
|
38
|
+
onAddPage = _ref.onAddPage,
|
|
39
|
+
onEdit = _ref.onEdit,
|
|
40
|
+
onDelete = _ref.onDelete,
|
|
41
|
+
__designMode = _ref.__designMode,
|
|
42
|
+
title = _ref.title;
|
|
43
|
+
// 将DropSortItem转换回NavigationMenuItem
|
|
44
|
+
var convertToNavigationItems = function convertToNavigationItems(items) {
|
|
45
|
+
return items.map(function (item) {
|
|
46
|
+
return {
|
|
47
|
+
id: String(item.id),
|
|
48
|
+
title: String(item.title || ''),
|
|
49
|
+
path: String(item.path || '/'),
|
|
50
|
+
children: item.children ? convertToNavigationItems(item.children) : []
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
var items = useMemo(function () {
|
|
55
|
+
return [{
|
|
56
|
+
label: getText('pisell-lowcode-navigation-menu-add-sub-menu'),
|
|
57
|
+
key: 'add-child'
|
|
58
|
+
}, {
|
|
59
|
+
label: getText('pisell-lowcode-navigation-menu-add-page'),
|
|
60
|
+
key: 'add-page'
|
|
61
|
+
}];
|
|
62
|
+
}, []);
|
|
63
|
+
var handleClick = useCallback(function (key, item) {
|
|
64
|
+
if (key === 'add-child') {
|
|
65
|
+
onAddSubMenu === null || onAddSubMenu === void 0 ? void 0 : onAddSubMenu(item);
|
|
66
|
+
} else if (key === 'add-page') {
|
|
67
|
+
onAddPage === null || onAddPage === void 0 ? void 0 : onAddPage(item);
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
70
|
+
|
|
71
|
+
// 自定义渲染菜单项
|
|
72
|
+
var renderMenuItem = useCallback(function (itemProps) {
|
|
73
|
+
var item = itemProps.item;
|
|
74
|
+
var _item$allowEdit = item.allowEdit,
|
|
75
|
+
allowEdit = _item$allowEdit === void 0 ? true : _item$allowEdit,
|
|
76
|
+
_item$allowDelete = item.allowDelete,
|
|
77
|
+
allowDelete = _item$allowDelete === void 0 ? true : _item$allowDelete,
|
|
78
|
+
_item$allowAddChild = item.allowAddChild,
|
|
79
|
+
allowAddChild = _item$allowAddChild === void 0 ? true : _item$allowAddChild,
|
|
80
|
+
_item$allowAddSubmenu = item.allowAddSubmenu,
|
|
81
|
+
allowAddSubmenu = _item$allowAddSubmenu === void 0 ? true : _item$allowAddSubmenu,
|
|
82
|
+
_item$allowAddPage = item.allowAddPage,
|
|
83
|
+
allowAddPage = _item$allowAddPage === void 0 ? true : _item$allowAddPage;
|
|
84
|
+
var isShowAddButton = item.isGroup && allowAddChild && (allowAddSubmenu || allowAddPage);
|
|
85
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
86
|
+
className: "pisell-lowcode-navigation-menu-item"
|
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
88
|
+
className: "pisell-lowcode-navigation-menu-item-content"
|
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
90
|
+
className: "pisell-lowcode-navigation-menu-item-content-icon"
|
|
91
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
92
|
+
type: item.icon
|
|
93
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
className: "pisell-lowcode-navigation-menu-item-content-text"
|
|
95
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
96
|
+
className: "pisell-lowcode-navigation-menu-item-title"
|
|
97
|
+
}, item.title), /*#__PURE__*/React.createElement("div", {
|
|
98
|
+
className: "pisell-lowcode-navigation-menu-item-description"
|
|
99
|
+
}, item.description, !item.isGroup && item.version && /*#__PURE__*/React.createElement(PisellTags, {
|
|
100
|
+
type: "pill_color",
|
|
101
|
+
color: "success"
|
|
102
|
+
}, item.version)))), /*#__PURE__*/React.createElement("div", {
|
|
103
|
+
className: "pisell-lowcode-navigation-menu-item-action-wrap"
|
|
104
|
+
}, allowEdit && /*#__PURE__*/React.createElement(Button, {
|
|
105
|
+
type: "text",
|
|
106
|
+
onClick: function onClick() {
|
|
107
|
+
return onEdit === null || onEdit === void 0 ? void 0 : onEdit(item);
|
|
108
|
+
},
|
|
109
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
110
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
111
|
+
type: "pisell2-edit-05",
|
|
112
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
113
|
+
})
|
|
114
|
+
}), isShowAddButton && /*#__PURE__*/React.createElement(Dropdown, {
|
|
115
|
+
menu: {
|
|
116
|
+
items: [allowAddSubmenu && {
|
|
117
|
+
key: 'add-child',
|
|
118
|
+
label: getText('pisell-lowcode-navigation-menu-add-sub-menu'),
|
|
119
|
+
onClick: function onClick() {
|
|
120
|
+
return handleClick('add-child', item);
|
|
121
|
+
}
|
|
122
|
+
}, allowAddPage && {
|
|
123
|
+
key: 'add-page',
|
|
124
|
+
label: getText('pisell-lowcode-navigation-menu-add-page'),
|
|
125
|
+
onClick: function onClick() {
|
|
126
|
+
return handleClick('add-page', item);
|
|
127
|
+
}
|
|
128
|
+
}].filter(Boolean)
|
|
129
|
+
}
|
|
130
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
131
|
+
type: "text",
|
|
132
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
133
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
134
|
+
type: "pisell2-plus",
|
|
135
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
136
|
+
})
|
|
137
|
+
})), allowDelete && /*#__PURE__*/React.createElement(Button, {
|
|
138
|
+
type: "text",
|
|
139
|
+
onClick: function onClick() {
|
|
140
|
+
return onDelete === null || onDelete === void 0 ? void 0 : onDelete(item);
|
|
141
|
+
},
|
|
142
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
143
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
144
|
+
type: "pisell2-trash-01",
|
|
145
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
146
|
+
})
|
|
147
|
+
})));
|
|
148
|
+
}, [value, onChange]);
|
|
149
|
+
|
|
150
|
+
// 处理数据变化
|
|
151
|
+
var handleChange = useCallback(function (items) {
|
|
152
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(convertToNavigationItems(items));
|
|
153
|
+
}, [onChange]);
|
|
154
|
+
var leftContent = useMemo(function () {
|
|
155
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
156
|
+
className: "pisell-lowcode-navigation-menu-left-content"
|
|
157
|
+
}, title);
|
|
158
|
+
}, [title]);
|
|
159
|
+
var rightContent = useMemo(function () {
|
|
160
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
161
|
+
className: "pisell-lowcode-navigation-menu-right-content"
|
|
162
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
163
|
+
size: "large",
|
|
164
|
+
type: "primary",
|
|
165
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
166
|
+
type: "pisell2-plus"
|
|
167
|
+
}),
|
|
168
|
+
onClick: function onClick() {
|
|
169
|
+
return onAddSubMenu === null || onAddSubMenu === void 0 ? void 0 : onAddSubMenu();
|
|
170
|
+
}
|
|
171
|
+
}, getText('pisell-lowcode-navigation-menu-add-sub-menu')), /*#__PURE__*/React.createElement(Button, {
|
|
172
|
+
size: "large",
|
|
173
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
|
174
|
+
type: "pisell2-plus"
|
|
175
|
+
}),
|
|
176
|
+
onClick: function onClick() {
|
|
177
|
+
return onAddPage === null || onAddPage === void 0 ? void 0 : onAddPage();
|
|
178
|
+
}
|
|
179
|
+
}, getText('pisell-lowcode-navigation-menu-add-page')));
|
|
180
|
+
}, [title]);
|
|
181
|
+
var formatValue = useMemo(function () {
|
|
182
|
+
return formatTree(value, function (item) {
|
|
183
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
184
|
+
disabledDrop: !item.isGroup
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}, [value]);
|
|
188
|
+
var getItemStyle = useCallback(function (itemProps) {
|
|
189
|
+
var item = itemProps.item;
|
|
190
|
+
return {
|
|
191
|
+
backgroundColor: item.isGroup ? '#fff' : 'var(--Gray-50, #F9FAFB)'
|
|
192
|
+
};
|
|
193
|
+
}, []);
|
|
194
|
+
return /*#__PURE__*/React.createElement(PisellDropSort, {
|
|
195
|
+
value: formatValue,
|
|
196
|
+
allowDrag: allowDrag,
|
|
197
|
+
allowDelete: allowDelete,
|
|
198
|
+
allowAddChild: allowAddChild,
|
|
199
|
+
allowAddRoot: allowAddRoot,
|
|
200
|
+
disabled: disabled,
|
|
201
|
+
spacing: spacing,
|
|
202
|
+
maxLevel: maxLevel,
|
|
203
|
+
style: style,
|
|
204
|
+
className: className,
|
|
205
|
+
onChange: handleChange,
|
|
206
|
+
renderItem: renderMenuItem,
|
|
207
|
+
isCustomAction: true,
|
|
208
|
+
__designMode: __designMode,
|
|
209
|
+
leftContent: leftContent,
|
|
210
|
+
rightContent: rightContent,
|
|
211
|
+
getItemStyle: getItemStyle,
|
|
212
|
+
emptyContent: /*#__PURE__*/React.createElement(PisellEmpty, {
|
|
213
|
+
maxWidth: 400,
|
|
214
|
+
description: getText('pisell-lowcode-navigation-menu-add-page-tip')
|
|
215
|
+
})
|
|
216
|
+
});
|
|
217
|
+
};
|
|
218
|
+
export default PisellNavigationMenu;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
.pisell-lowcode-navigation-menu-item {
|
|
2
|
+
display: flex;
|
|
3
|
+
justify-content: space-between;
|
|
4
|
+
align-items: center;
|
|
5
|
+
.pisell-lowcode-navigation-menu-item-content {
|
|
6
|
+
flex: 1;
|
|
7
|
+
display: flex;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
height: 100%;
|
|
10
|
+
align-items: center;
|
|
11
|
+
.pisell-lowcode-navigation-menu-item-content-icon {
|
|
12
|
+
height: 36px;
|
|
13
|
+
width: 36px;
|
|
14
|
+
display: flex;
|
|
15
|
+
align-items: center;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
font-size: 20px;
|
|
18
|
+
}
|
|
19
|
+
.pisell-lowcode-navigation-menu-item-content-text {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-direction: column;
|
|
22
|
+
gap: 6px;
|
|
23
|
+
}
|
|
24
|
+
.pisell-lowcode-navigation-menu-item-title {
|
|
25
|
+
color: var(--Gray-900, #101828);
|
|
26
|
+
font-size: 14px;
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
line-height: 20px; /* 142.857% */
|
|
29
|
+
}
|
|
30
|
+
.pisell-lowcode-navigation-menu-item-description {
|
|
31
|
+
color: var(--Gray-500, #667085);
|
|
32
|
+
font-size: 14px;
|
|
33
|
+
font-weight: 400;
|
|
34
|
+
line-height: 20px; /* 142.857% */
|
|
35
|
+
display: flex;
|
|
36
|
+
gap: 8px;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.pisell-lowcode-navigation-menu-item-action-wrap {
|
|
41
|
+
display: flex;
|
|
42
|
+
gap: 8px;
|
|
43
|
+
.pisell-lowcode-navigation-menu-item-action-button {
|
|
44
|
+
&:hover {
|
|
45
|
+
background: var(--Gray-300, #D0D5DD);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
.pisell-lowcode-navigation-menu-item-action-button-icon {
|
|
49
|
+
font-size: 20px;
|
|
50
|
+
color: #101828;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pisell-lowcode-navigation-menu-left-content {
|
|
56
|
+
color: var(--Gray-900, #101828);
|
|
57
|
+
font-size: 16px;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
line-height: 24px; /* 150% */
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pisell-lowcode-navigation-menu-right-content {
|
|
63
|
+
display: flex;
|
|
64
|
+
gap: 8px;
|
|
65
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export interface NavigationMenuItem {
|
|
3
|
+
id: string;
|
|
4
|
+
/** 标题 */
|
|
5
|
+
title: string;
|
|
6
|
+
/** 图标 */
|
|
7
|
+
icon?: string;
|
|
8
|
+
/** 描述 */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** 子菜单 */
|
|
11
|
+
children?: NavigationMenuItem[];
|
|
12
|
+
/** 版本 */
|
|
13
|
+
version?: string;
|
|
14
|
+
/** 是否是分组 */
|
|
15
|
+
isGroup?: boolean;
|
|
16
|
+
/** 是否允许添加子菜单 */
|
|
17
|
+
allowAddChild?: boolean;
|
|
18
|
+
/** 是否允许删除 */
|
|
19
|
+
allowDelete?: boolean;
|
|
20
|
+
/** 是否允许编辑 */
|
|
21
|
+
allowEdit?: boolean;
|
|
22
|
+
/** 是否允许添加子菜单 */
|
|
23
|
+
allowAddSubmenu?: boolean;
|
|
24
|
+
/** 是否允许添加页面 */
|
|
25
|
+
allowAddPage?: boolean;
|
|
26
|
+
/** 其他属性 */
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
}
|
|
29
|
+
export interface PisellNavigationMenuProps {
|
|
30
|
+
/** 导航菜单数据 */
|
|
31
|
+
value: NavigationMenuItem[];
|
|
32
|
+
/** 是否允许拖拽排序 */
|
|
33
|
+
allowDrag?: boolean;
|
|
34
|
+
/** 是否允许删除菜单项 */
|
|
35
|
+
allowDelete?: boolean;
|
|
36
|
+
/** 是否允许添加子菜单 */
|
|
37
|
+
allowAddChild?: boolean;
|
|
38
|
+
/** 是否允许添加根菜单 */
|
|
39
|
+
allowAddRoot?: boolean;
|
|
40
|
+
/** 是否禁用 */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** 菜单项间距 */
|
|
43
|
+
spacing?: number;
|
|
44
|
+
/** 最大层级数 */
|
|
45
|
+
maxLevel?: number;
|
|
46
|
+
/** 样式 */
|
|
47
|
+
style?: CSSProperties;
|
|
48
|
+
/** 类名 */
|
|
49
|
+
className?: string;
|
|
50
|
+
/** 数据变化回调 */
|
|
51
|
+
onChange?: (items: NavigationMenuItem[]) => void;
|
|
52
|
+
/** 设计模式 */
|
|
53
|
+
__designMode?: string;
|
|
54
|
+
/** 标题 */
|
|
55
|
+
title?: string;
|
|
56
|
+
/** 添加子菜单回调 */
|
|
57
|
+
onAddSubMenu?: (item?: NavigationMenuItem) => void;
|
|
58
|
+
/** 添加页面回调 */
|
|
59
|
+
onAddPage?: (item?: NavigationMenuItem) => void;
|
|
60
|
+
/** 编辑回调 */
|
|
61
|
+
onEdit?: (item: NavigationMenuItem) => void;
|
|
62
|
+
/** 删除回调 */
|
|
63
|
+
onDelete?: (item: NavigationMenuItem) => void;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 树节点的基本接口
|
|
3
|
+
*/
|
|
4
|
+
export interface TreeNode {
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
children?: TreeNode[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* 格式化树结构数据
|
|
10
|
+
* @param tree 要格式化的树结构数据
|
|
11
|
+
* @param formatter 格式化函数,用于处理每个节点
|
|
12
|
+
* @param childrenField 子节点字段名,默认为 'children'
|
|
13
|
+
* @returns 格式化后的树结构
|
|
14
|
+
*/
|
|
15
|
+
export declare function formatTree<T extends TreeNode, R = T>(tree: T[], formatter: (node: T, level: number, parent: T | null) => R, childrenField?: string): R[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 树节点的基本接口
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* 格式化树结构数据
|
|
7
|
+
* @param tree 要格式化的树结构数据
|
|
8
|
+
* @param formatter 格式化函数,用于处理每个节点
|
|
9
|
+
* @param childrenField 子节点字段名,默认为 'children'
|
|
10
|
+
* @returns 格式化后的树结构
|
|
11
|
+
*/
|
|
12
|
+
export function formatTree(tree, formatter) {
|
|
13
|
+
var childrenField = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'children';
|
|
14
|
+
var format = function format(nodes) {
|
|
15
|
+
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
16
|
+
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
|
17
|
+
return nodes.map(function (node) {
|
|
18
|
+
// 格式化当前节点
|
|
19
|
+
var formattedNode = formatter(node, level, parent);
|
|
20
|
+
|
|
21
|
+
// 如果有子节点,递归处理
|
|
22
|
+
if (node[childrenField] && Array.isArray(node[childrenField])) {
|
|
23
|
+
formattedNode[childrenField] = format(node[childrenField], level + 1, node);
|
|
24
|
+
}
|
|
25
|
+
return formattedNode;
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
return format(tree);
|
|
29
|
+
}
|
|
@@ -155,7 +155,7 @@ export declare const getSettingKeyArrByMode: ({ filter, columnSetting, dataSourc
|
|
|
155
155
|
sort?: SortType | undefined;
|
|
156
156
|
mode: "" | "localStorage" | "remote";
|
|
157
157
|
currentViewMode: ModeType;
|
|
158
|
-
}) => ("
|
|
158
|
+
}) => ("filter_setting" | "column_setting" | "gallery_setting" | "view_mode" | "group_by" | "order_by")[];
|
|
159
159
|
export declare const omit: (obj: Record<string, any>, keys: string[]) => Record<string, any>;
|
|
160
160
|
export declare const stringify: (obj: Record<string, any>) => string;
|
|
161
161
|
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Version } from '../versionSelect';
|
|
2
3
|
import './index.less';
|
|
3
4
|
interface PublishVersionModalProps {
|
|
4
5
|
visible: boolean;
|
|
@@ -6,10 +7,17 @@ interface PublishVersionModalProps {
|
|
|
6
7
|
onCancel: () => void;
|
|
7
8
|
onConfirm: (data: VersionData) => void;
|
|
8
9
|
isShowNote?: boolean;
|
|
10
|
+
confirmLoading?: boolean;
|
|
11
|
+
versions?: Version[];
|
|
12
|
+
isShowBasedOn?: boolean;
|
|
13
|
+
isShowCurrentVersion?: boolean;
|
|
14
|
+
isValidateVersion?: boolean;
|
|
9
15
|
}
|
|
10
16
|
interface VersionData {
|
|
11
17
|
version: string;
|
|
12
18
|
note: string;
|
|
19
|
+
baseVersion?: string;
|
|
20
|
+
versionType?: string;
|
|
13
21
|
}
|
|
14
22
|
declare const PublishVersionModal: React.FC<PublishVersionModalProps>;
|
|
15
23
|
export default PublishVersionModal;
|