@pisell/materials 6.0.14 → 6.0.16
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 +10 -5
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +38 -15
- 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/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 +10 -5
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useTableProps.js +35 -19
- 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/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 +3 -3
- 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,231 @@
|
|
|
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/pisellNavigationMenu/PisellNavigationMenu.tsx
|
|
30
|
+
var PisellNavigationMenu_exports = {};
|
|
31
|
+
__export(PisellNavigationMenu_exports, {
|
|
32
|
+
default: () => PisellNavigationMenu_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(PisellNavigationMenu_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_pisellDropSort = __toESM(require("../pisellDropSort"));
|
|
37
|
+
var import_pisellTags = __toESM(require("../pisellTags"));
|
|
38
|
+
var import_icon = __toESM(require("../icon"));
|
|
39
|
+
var import_button = __toESM(require("../button"));
|
|
40
|
+
var import_locales = require("../../locales");
|
|
41
|
+
var import_antd = require("antd");
|
|
42
|
+
var import_pisellEmpty = __toESM(require("../pisellEmpty"));
|
|
43
|
+
var import_utils = require("./utils");
|
|
44
|
+
var import_PisellNavigationMenu = require("./PisellNavigationMenu.less");
|
|
45
|
+
var PisellNavigationMenu = ({
|
|
46
|
+
value = [],
|
|
47
|
+
allowDrag = true,
|
|
48
|
+
allowDelete = true,
|
|
49
|
+
allowAddChild = true,
|
|
50
|
+
allowAddRoot = true,
|
|
51
|
+
disabled = false,
|
|
52
|
+
spacing = 8,
|
|
53
|
+
maxLevel = 3,
|
|
54
|
+
style,
|
|
55
|
+
className,
|
|
56
|
+
onChange,
|
|
57
|
+
onAddSubMenu,
|
|
58
|
+
onAddPage,
|
|
59
|
+
onEdit,
|
|
60
|
+
onDelete,
|
|
61
|
+
__designMode,
|
|
62
|
+
title
|
|
63
|
+
}) => {
|
|
64
|
+
const convertToNavigationItems = (items2) => {
|
|
65
|
+
return items2.map((item) => ({
|
|
66
|
+
id: String(item.id),
|
|
67
|
+
title: String(item.title || ""),
|
|
68
|
+
path: String(item.path || "/"),
|
|
69
|
+
children: item.children ? convertToNavigationItems(item.children) : []
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
72
|
+
const items = (0, import_react.useMemo)(() => {
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
label: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-sub-menu"),
|
|
76
|
+
key: "add-child"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page"),
|
|
80
|
+
key: "add-page"
|
|
81
|
+
}
|
|
82
|
+
];
|
|
83
|
+
}, []);
|
|
84
|
+
const handleClick = (0, import_react.useCallback)((key, item) => {
|
|
85
|
+
if (key === "add-child") {
|
|
86
|
+
onAddSubMenu == null ? void 0 : onAddSubMenu(item);
|
|
87
|
+
} else if (key === "add-page") {
|
|
88
|
+
onAddPage == null ? void 0 : onAddPage(item);
|
|
89
|
+
}
|
|
90
|
+
}, []);
|
|
91
|
+
const renderMenuItem = (0, import_react.useCallback)(
|
|
92
|
+
(itemProps) => {
|
|
93
|
+
const { item } = itemProps;
|
|
94
|
+
const { allowEdit = true, allowDelete: allowDelete2 = true, allowAddChild: allowAddChild2 = true, allowAddSubmenu = true, allowAddPage = true } = item;
|
|
95
|
+
const isShowAddButton = item.isGroup && allowAddChild2 && (allowAddSubmenu || allowAddPage);
|
|
96
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-icon" }, /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: item.icon })), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-content-text" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-description" }, item.description, !item.isGroup && item.version && /* @__PURE__ */ import_react.default.createElement(import_pisellTags.default, { type: "pill_color", color: "success" }, item.version)))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-item-action-wrap" }, allowEdit && /* @__PURE__ */ import_react.default.createElement(
|
|
97
|
+
import_button.default,
|
|
98
|
+
{
|
|
99
|
+
type: "text",
|
|
100
|
+
onClick: () => onEdit == null ? void 0 : onEdit(item),
|
|
101
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
102
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
103
|
+
import_icon.default,
|
|
104
|
+
{
|
|
105
|
+
type: "pisell2-edit-05",
|
|
106
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
107
|
+
}
|
|
108
|
+
)
|
|
109
|
+
}
|
|
110
|
+
), isShowAddButton && /* @__PURE__ */ import_react.default.createElement(
|
|
111
|
+
import_antd.Dropdown,
|
|
112
|
+
{
|
|
113
|
+
menu: {
|
|
114
|
+
items: [
|
|
115
|
+
allowAddSubmenu && {
|
|
116
|
+
key: "add-child",
|
|
117
|
+
label: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-sub-menu"),
|
|
118
|
+
onClick: () => handleClick("add-child", item)
|
|
119
|
+
},
|
|
120
|
+
allowAddPage && {
|
|
121
|
+
key: "add-page",
|
|
122
|
+
label: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page"),
|
|
123
|
+
onClick: () => handleClick("add-page", item)
|
|
124
|
+
}
|
|
125
|
+
].filter(Boolean)
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
129
|
+
import_button.default,
|
|
130
|
+
{
|
|
131
|
+
type: "text",
|
|
132
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
133
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
134
|
+
import_icon.default,
|
|
135
|
+
{
|
|
136
|
+
type: "pisell2-plus",
|
|
137
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
138
|
+
}
|
|
139
|
+
)
|
|
140
|
+
}
|
|
141
|
+
)
|
|
142
|
+
), allowDelete2 && /* @__PURE__ */ import_react.default.createElement(
|
|
143
|
+
import_button.default,
|
|
144
|
+
{
|
|
145
|
+
type: "text",
|
|
146
|
+
onClick: () => onDelete == null ? void 0 : onDelete(item),
|
|
147
|
+
className: "pisell-lowcode-navigation-menu-item-action-button",
|
|
148
|
+
icon: /* @__PURE__ */ import_react.default.createElement(
|
|
149
|
+
import_icon.default,
|
|
150
|
+
{
|
|
151
|
+
type: "pisell2-trash-01",
|
|
152
|
+
className: "pisell-lowcode-navigation-menu-item-action-button-icon"
|
|
153
|
+
}
|
|
154
|
+
)
|
|
155
|
+
}
|
|
156
|
+
)));
|
|
157
|
+
},
|
|
158
|
+
[value, onChange]
|
|
159
|
+
);
|
|
160
|
+
const handleChange = (0, import_react.useCallback)(
|
|
161
|
+
(items2) => {
|
|
162
|
+
onChange == null ? void 0 : onChange(convertToNavigationItems(items2));
|
|
163
|
+
},
|
|
164
|
+
[onChange]
|
|
165
|
+
);
|
|
166
|
+
const leftContent = (0, import_react.useMemo)(() => {
|
|
167
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-left-content" }, title);
|
|
168
|
+
}, [title]);
|
|
169
|
+
const rightContent = (0, import_react.useMemo)(() => {
|
|
170
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-navigation-menu-right-content" }, /* @__PURE__ */ import_react.default.createElement(
|
|
171
|
+
import_button.default,
|
|
172
|
+
{
|
|
173
|
+
size: "large",
|
|
174
|
+
type: "primary",
|
|
175
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-plus" }),
|
|
176
|
+
onClick: () => onAddSubMenu == null ? void 0 : onAddSubMenu()
|
|
177
|
+
},
|
|
178
|
+
(0, import_locales.getText)("pisell-lowcode-navigation-menu-add-sub-menu")
|
|
179
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
180
|
+
import_button.default,
|
|
181
|
+
{
|
|
182
|
+
size: "large",
|
|
183
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icon.default, { type: "pisell2-plus" }),
|
|
184
|
+
onClick: () => onAddPage == null ? void 0 : onAddPage()
|
|
185
|
+
},
|
|
186
|
+
(0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page")
|
|
187
|
+
));
|
|
188
|
+
}, [title]);
|
|
189
|
+
const formatValue = (0, import_react.useMemo)(() => {
|
|
190
|
+
return (0, import_utils.formatTree)(value, (item) => ({
|
|
191
|
+
...item,
|
|
192
|
+
disabledDrop: !item.isGroup
|
|
193
|
+
}));
|
|
194
|
+
}, [value]);
|
|
195
|
+
const getItemStyle = (0, import_react.useCallback)((itemProps) => {
|
|
196
|
+
const { item } = itemProps;
|
|
197
|
+
return {
|
|
198
|
+
backgroundColor: item.isGroup ? "#fff" : "var(--Gray-50, #F9FAFB)"
|
|
199
|
+
};
|
|
200
|
+
}, []);
|
|
201
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
202
|
+
import_pisellDropSort.default,
|
|
203
|
+
{
|
|
204
|
+
value: formatValue,
|
|
205
|
+
allowDrag,
|
|
206
|
+
allowDelete,
|
|
207
|
+
allowAddChild,
|
|
208
|
+
allowAddRoot,
|
|
209
|
+
disabled,
|
|
210
|
+
spacing,
|
|
211
|
+
maxLevel,
|
|
212
|
+
style,
|
|
213
|
+
className,
|
|
214
|
+
onChange: handleChange,
|
|
215
|
+
renderItem: renderMenuItem,
|
|
216
|
+
isCustomAction: true,
|
|
217
|
+
__designMode,
|
|
218
|
+
leftContent,
|
|
219
|
+
rightContent,
|
|
220
|
+
getItemStyle,
|
|
221
|
+
emptyContent: /* @__PURE__ */ import_react.default.createElement(
|
|
222
|
+
import_pisellEmpty.default,
|
|
223
|
+
{
|
|
224
|
+
maxWidth: 400,
|
|
225
|
+
description: (0, import_locales.getText)("pisell-lowcode-navigation-menu-add-page-tip")
|
|
226
|
+
}
|
|
227
|
+
)
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
var PisellNavigationMenu_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,36 @@
|
|
|
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/pisellNavigationMenu/index.tsx
|
|
30
|
+
var pisellNavigationMenu_exports = {};
|
|
31
|
+
__export(pisellNavigationMenu_exports, {
|
|
32
|
+
default: () => pisellNavigationMenu_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(pisellNavigationMenu_exports);
|
|
35
|
+
var import_PisellNavigationMenu = __toESM(require("./PisellNavigationMenu"));
|
|
36
|
+
var pisellNavigationMenu_default = import_PisellNavigationMenu.default;
|
|
@@ -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,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/components/pisellNavigationMenu/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
|
@@ -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,44 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/pisellNavigationMenu/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
formatTree: () => formatTree
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
function formatTree(tree, formatter, childrenField = "children") {
|
|
26
|
+
const format = (nodes, level = 0, parent = null) => {
|
|
27
|
+
return nodes.map((node) => {
|
|
28
|
+
const formattedNode = formatter(node, level, parent);
|
|
29
|
+
if (node[childrenField] && Array.isArray(node[childrenField])) {
|
|
30
|
+
formattedNode[childrenField] = format(
|
|
31
|
+
node[childrenField],
|
|
32
|
+
level + 1,
|
|
33
|
+
node
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
return formattedNode;
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
return format(tree);
|
|
40
|
+
}
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
formatTree
|
|
44
|
+
});
|
|
@@ -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;
|
|
@@ -35,6 +35,7 @@ module.exports = __toCommonJS(versionModal_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_pisellModal = __toESM(require("../pisellModal"));
|
|
38
|
+
var import_versionSelect = __toESM(require("../versionSelect"));
|
|
38
39
|
var import_locales = require("../../locales");
|
|
39
40
|
var import_index = require("./index.less");
|
|
40
41
|
var style = {
|
|
@@ -70,19 +71,26 @@ var PublishVersionModal = ({
|
|
|
70
71
|
currentVersion = "1.0.0",
|
|
71
72
|
onCancel,
|
|
72
73
|
onConfirm,
|
|
73
|
-
isShowNote
|
|
74
|
+
isShowNote,
|
|
75
|
+
confirmLoading = false,
|
|
76
|
+
versions = [],
|
|
77
|
+
isShowBasedOn,
|
|
78
|
+
isShowCurrentVersion,
|
|
79
|
+
isValidateVersion = true
|
|
74
80
|
}) => {
|
|
75
81
|
const [form] = import_antd.Form.useForm();
|
|
76
|
-
const [versionType, setVersionType] = (0, import_react.useState)("
|
|
82
|
+
const [versionType, setVersionType] = (0, import_react.useState)("");
|
|
77
83
|
const { patch, minor, major } = getNextVersions(currentVersion);
|
|
78
84
|
const handleVersionChange = (e) => {
|
|
79
85
|
setVersionType(e.target.value);
|
|
80
86
|
};
|
|
81
87
|
const handleSubmit = () => {
|
|
82
88
|
form.validateFields().then((values) => {
|
|
83
|
-
let { version, note } = values;
|
|
89
|
+
let { version, note, baseVersion } = values;
|
|
90
|
+
let versionType2 = "";
|
|
84
91
|
if (version === "custom") {
|
|
85
|
-
|
|
92
|
+
versionType2 = "custom";
|
|
93
|
+
if (isValidateVersion && !isVersionValid(
|
|
86
94
|
`${values.major}.${values.minor}.${values.patch}`,
|
|
87
95
|
currentVersion
|
|
88
96
|
)) {
|
|
@@ -91,16 +99,18 @@ var PublishVersionModal = ({
|
|
|
91
99
|
}
|
|
92
100
|
version = `${values.major}.${values.minor}.${values.patch}`;
|
|
93
101
|
}
|
|
94
|
-
onConfirm({ version, note });
|
|
102
|
+
onConfirm({ version, note, baseVersion, versionType: versionType2 });
|
|
95
103
|
});
|
|
96
104
|
};
|
|
97
105
|
(0, import_react.useEffect)(() => {
|
|
98
106
|
if (visible) {
|
|
107
|
+
setVersionType("");
|
|
99
108
|
form.setFieldsValue({
|
|
100
109
|
version: patch,
|
|
101
110
|
major: parseVersion(patch)[0] || 0,
|
|
102
111
|
minor: parseVersion(patch)[1] || 0,
|
|
103
|
-
patch: parseVersion(patch)[2] || 0
|
|
112
|
+
patch: parseVersion(patch)[2] || 0,
|
|
113
|
+
baseVersion: currentVersion
|
|
104
114
|
});
|
|
105
115
|
}
|
|
106
116
|
}, [visible]);
|
|
@@ -113,7 +123,8 @@ var PublishVersionModal = ({
|
|
|
113
123
|
destroyOnClose: true,
|
|
114
124
|
onOk: handleSubmit,
|
|
115
125
|
okText: (0, import_locales.getText)("pisell-version-modal-confirm"),
|
|
116
|
-
cancelText: (0, import_locales.getText)("pisell-version-modal-cancel")
|
|
126
|
+
cancelText: (0, import_locales.getText)("pisell-version-modal-cancel"),
|
|
127
|
+
confirmLoading
|
|
117
128
|
},
|
|
118
129
|
/* @__PURE__ */ import_react.default.createElement(
|
|
119
130
|
import_antd.Form,
|
|
@@ -123,7 +134,23 @@ var PublishVersionModal = ({
|
|
|
123
134
|
preserve: false,
|
|
124
135
|
className: "pisell-lowcode-version-modal-form"
|
|
125
136
|
},
|
|
126
|
-
/* @__PURE__ */ import_react.default.createElement("p",
|
|
137
|
+
isShowCurrentVersion && /* @__PURE__ */ import_react.default.createElement("p", { className: "pisell-lowcode-version-modal-current-version" }, (0, import_locales.getText)("pisell-version-modal-current-version"), ": ", currentVersion),
|
|
138
|
+
isShowBasedOn && /* @__PURE__ */ import_react.default.createElement(
|
|
139
|
+
import_antd.Form.Item,
|
|
140
|
+
{
|
|
141
|
+
label: (0, import_locales.getText)("pisell-version-modal-based-on-version"),
|
|
142
|
+
name: "baseVersion",
|
|
143
|
+
initialValue: currentVersion,
|
|
144
|
+
rules: [{ required: true }]
|
|
145
|
+
},
|
|
146
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
147
|
+
import_versionSelect.default,
|
|
148
|
+
{
|
|
149
|
+
versions,
|
|
150
|
+
fieldNames: { label: "label", value: "version", options: "options" }
|
|
151
|
+
}
|
|
152
|
+
)
|
|
153
|
+
),
|
|
127
154
|
/* @__PURE__ */ import_react.default.createElement(
|
|
128
155
|
import_antd.Form.Item,
|
|
129
156
|
{
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
.pisell-lowcode-version-modal-form {
|
|
2
|
-
|
|
3
|
-
}
|
|
2
|
+
padding: 16px 0 0 !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.pisell-lowcode-version-modal-current-version {
|
|
6
|
+
color: var(--Gray-500, #667085);
|
|
7
|
+
font-size: 16px;
|
|
8
|
+
font-weight: 400;
|
|
9
|
+
line-height: 24px; /* 150% */
|
|
10
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SelectProps } from 'antd';
|
|
3
|
+
import './index.less';
|
|
4
|
+
export interface Version {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
status: 'live' | 'draft' | 'deprecated';
|
|
9
|
+
version: string;
|
|
10
|
+
avatar?: string;
|
|
11
|
+
}
|
|
12
|
+
interface VersionSelectProps extends Omit<SelectProps<string>, 'onChange' | 'options'> {
|
|
13
|
+
versions: Version[];
|
|
14
|
+
value?: string;
|
|
15
|
+
onChange?: (value: string, version: Version) => void;
|
|
16
|
+
}
|
|
17
|
+
declare const VersionSelect: (props: VersionSelectProps) => React.JSX.Element;
|
|
18
|
+
export default VersionSelect;
|