@tachybase/client 0.23.48 → 1.0.6
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/es/api-client/APIClient.d.ts +5 -2
- package/es/api-client/APIClient.mjs +93 -49
- package/es/api-client/hooks/useRequest.d.ts +2 -0
- package/es/application/Application.d.ts +6 -0
- package/es/application/Application.mjs +19 -0
- package/es/application/CustomRouterContextProvider.d.ts +54 -0
- package/es/application/CustomRouterContextProvider.mjs +209 -0
- package/es/application/RouterManager.d.ts +8 -3
- package/es/application/RouterManager.mjs +48 -15
- package/es/application/hooks/index.d.ts +1 -0
- package/es/application/hooks/index.mjs +1 -0
- package/es/application/hooks/useGlobalVariable.d.ts +1 -0
- package/es/application/hooks/useGlobalVariable.mjs +18 -0
- package/es/application/schema-initializer/context/index.d.ts +1 -1
- package/es/application/schema-settings/hooks/index.d.ts +1 -1
- package/es/application/schema-settings/hooks/index.mjs +6 -8
- package/es/block-provider/hooks/index.d.ts +2 -0
- package/es/block-provider/hooks/index.mjs +29 -22
- package/es/built-in/context-menu/ContextMenu.provider.mjs +6 -6
- package/es/built-in/context-menu/ContextMenuItemsProps.d.ts +4 -4
- package/es/built-in/context-menu/ContextMenuItemsProps.mjs +6 -6
- package/es/built-in/context-menu/index.mjs +1 -1
- package/es/built-in/context-menu/useContextMenu.d.ts +2 -2
- package/es/built-in/index.mjs +8 -0
- package/es/built-in/locale/LocalePlugin.mjs +5 -1
- package/es/built-in/page-style/PageStyle.provider.mjs +2 -2
- package/es/built-in/system-settings/SystemSettingsProvider.d.ts +2 -3
- package/es/built-in/system-settings/SystemSettingsProvider.mjs +4 -3
- package/es/built-in/system-settings/SystemSettingsShortcut.mjs +11 -8
- package/es/collection-manager/Configuration/AddCollectionAction.mjs +12 -2
- package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.d.ts +2 -0
- package/es/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.mjs +255 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.d.ts +89 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.mjs +96 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.d.ts +3 -0
- package/es/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.mjs +47 -0
- package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.d.ts +3 -0
- package/es/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.mjs +44 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.mjs +380 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.d.ts +8 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.mjs +4 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxImportAction.mjs +187 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.d.ts +1 -0
- package/es/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.mjs +30 -0
- package/es/collection-manager/collectionPlugin.mjs +3 -1
- package/es/collection-manager/templates/import.mjs +1 -1
- package/es/collection-manager/templates/sql.d.ts +1 -1
- package/es/collection-manager/templates/view.d.ts +1 -1
- package/es/collection-manager/templates/xlsx.d.ts +11 -0
- package/es/collection-manager/templates/xlsx.mjs +19 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterface.d.ts +1 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterface.mjs +18 -0
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.d.ts +8 -1
- package/es/data-source/collection-field-interface/CollectionFieldInterfaceManager.mjs +20 -0
- package/es/data-source/commonsSettingsItem/fieldComponent.mjs +3 -1
- package/es/data-source/data-source/DataSource.d.ts +1 -1
- package/es/filter-provider/utils.mjs +6 -0
- package/es/i18n/i18n.mjs +7 -12
- package/es/modules/actions/delete/deleteActionSettings.mjs +10 -0
- package/es/modules/blocks/data-blocks/form/FilterItemCustomSettings.mjs +1 -1
- package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +9 -4
- package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +6 -4
- package/es/modules/blocks/data-blocks/table/tableBlockSettings.mjs +4 -0
- package/es/modules/blocks/data-blocks/table/tableColumnSettings.mjs +44 -0
- package/es/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.mjs +4 -0
- package/es/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.mjs +9 -0
- package/es/modules/fields/component/Radio/radioComponentFieldSettings.mjs +0 -4
- package/es/modules/fields/component/SubTable/secondLevelSelect.d.ts +11 -0
- package/es/modules/fields/component/SubTable/secondLevelSelect.mjs +102 -0
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.d.ts +79 -41
- package/es/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.mjs +103 -100
- package/es/powered-by/index.mjs +4 -7
- package/es/schema-component/antd/action/Action.Designer.mjs +43 -5
- package/es/schema-component/antd/action/Action.Modal.mjs +19 -31
- package/es/schema-component/antd/action/Action.Modal.style.d.ts +4 -0
- package/es/schema-component/antd/action/Action.Modal.style.mjs +35 -0
- package/es/schema-component/antd/action/Action.mjs +1 -3
- package/es/schema-component/antd/action/utils.d.ts +1 -1
- package/es/schema-component/antd/action/utils.mjs +70 -70
- package/es/schema-component/antd/association-field/SubTabs/InternalCollapse.mjs +2 -1
- package/es/schema-component/antd/checkbox/Checkbox.mjs +9 -2
- package/es/schema-component/antd/index.d.ts +1 -0
- package/es/schema-component/antd/index.mjs +1 -0
- package/es/schema-component/antd/media-card/MediaCard.d.ts +11 -0
- package/es/schema-component/antd/media-card/MediaCard.mjs +35 -0
- package/es/schema-component/antd/media-card/index.d.ts +1 -0
- package/es/schema-component/antd/media-card/index.mjs +1 -0
- package/es/schema-component/antd/media-card/style.d.ts +3 -0
- package/es/schema-component/antd/media-card/style.mjs +25 -0
- package/es/schema-component/antd/page/Page.d.ts +1 -5
- package/es/schema-component/antd/page/Page.mjs +235 -144
- package/es/schema-component/antd/page/Page.style.d.ts +5 -0
- package/es/schema-component/antd/page/Page.style.mjs +45 -0
- package/es/schema-component/antd/page/PageDesigner.d.ts +3 -0
- package/es/schema-component/antd/page/PageDesigner.mjs +28 -0
- package/es/schema-component/antd/page/PageTabDesigner.d.ts +0 -3
- package/es/schema-component/antd/page/PageTabDesigner.mjs +3 -50
- package/es/schema-component/antd/page/style.d.ts +1 -1
- package/es/schema-component/antd/page/style.mjs +3 -13
- package/es/schema-component/antd/password/Password.d.ts +1 -1
- package/es/schema-component/antd/password/utils.d.ts +1 -1
- package/es/schema-component/antd/scroll-area/ScrollArea.d.ts +1 -1
- package/es/schema-component/antd/scroll-area/ScrollArea.mjs +2 -1
- package/es/schema-component/antd/variable/TextArea.mjs +1 -1
- package/es/schema-component/antd/variable/TextAreaWithGlobalScope.d.ts +13 -0
- package/es/schema-component/antd/variable/TextAreaWithGlobalScope.mjs +59 -0
- package/es/schema-component/antd/variable/index.d.ts +1 -0
- package/es/schema-component/antd/variable/index.mjs +3 -0
- package/es/schema-component/common/dnd-context/index.mjs +1 -7
- package/es/schema-component/common/sortable-item/DragHandlePageTab.d.ts +1 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.mjs +71 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.d.ts +3 -0
- package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +25 -0
- package/es/schema-items/GeneralSettings.mjs +5 -0
- package/es/schema-settings/EditCustomDefaultValue.mjs +1 -1
- package/es/schema-settings/SchemaSettings.mjs +1 -1
- package/es/schema-settings/SchemaSettingsDefaultValue.mjs +2 -0
- package/es/schema-settings/utils/createModalSettingsItem.d.ts +26 -0
- package/es/schema-settings/utils/createModalSettingsItem.mjs +46 -0
- package/es/schema-settings/utils/createSelectSettingsItem.d.ts +25 -0
- package/es/schema-settings/utils/createSelectSettingsItem.mjs +40 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.d.ts +21 -0
- package/es/schema-settings/utils/createSwitchSettingsItem.mjs +38 -0
- package/es/schema-settings/utils/createTextSettingsItem.d.ts +9 -0
- package/es/schema-settings/utils/createTextSettingsItem.mjs +21 -0
- package/es/schema-settings/utils/index.d.ts +4 -0
- package/es/schema-settings/utils/index.mjs +4 -0
- package/es/schema-settings/utils/util.d.ts +12 -0
- package/es/schema-settings/utils/util.mjs +24 -0
- package/es/user/CurrentUserProvider.mjs +6 -3
- package/lib/api-client/APIClient.js +93 -49
- package/lib/application/Application.js +19 -0
- package/lib/application/CustomRouterContextProvider.js +276 -0
- package/lib/application/RouterManager.js +49 -15
- package/lib/application/hooks/index.js +9 -0
- package/lib/application/hooks/useGlobalVariable.js +52 -0
- package/lib/application/schema-initializer/hooks/index.js +2 -2
- package/lib/application/schema-settings/hooks/index.js +6 -8
- package/lib/block-provider/hooks/index.js +80 -59
- package/lib/built-in/context-menu/ContextMenu.provider.js +6 -6
- package/lib/built-in/context-menu/ContextMenuItemsProps.js +6 -6
- package/lib/built-in/context-menu/index.js +1 -1
- package/lib/built-in/index.js +8 -0
- package/lib/built-in/locale/LocalePlugin.js +5 -1
- package/lib/built-in/page-style/PageStyle.provider.js +2 -2
- package/lib/built-in/system-settings/SystemSettingsProvider.js +4 -3
- package/lib/built-in/system-settings/SystemSettingsShortcut.js +11 -8
- package/lib/collection-manager/Configuration/AddCollectionAction.js +12 -2
- package/lib/collection-manager/Configuration/ImportXlsx/ImportXlsxMetaAction.js +304 -0
- package/lib/collection-manager/Configuration/ImportXlsx/XlsxCollectionSchema.js +130 -0
- package/lib/collection-manager/Configuration/ImportXlsx/XlsxEditFieldAction.js +81 -0
- package/lib/collection-manager/Configuration/ImportXlsx/setUpdateXlsxCollectionField.js +78 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxFieldsConfigure.js +414 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxFormValueContextProvider.js +53 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxImportAction.js +235 -0
- package/lib/collection-manager/Configuration/ImportXlsx/xlsxPreviewTable.js +64 -0
- package/lib/collection-manager/collectionPlugin.js +3 -1
- package/lib/collection-manager/templates/import.js +1 -1
- package/lib/collection-manager/templates/xlsx.js +53 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterface.js +18 -0
- package/lib/data-source/collection-field-interface/CollectionFieldInterfaceManager.js +20 -0
- package/lib/data-source/commonsSettingsItem/fieldComponent.js +3 -1
- package/lib/filter-provider/utils.js +6 -0
- package/lib/i18n/i18n.js +7 -12
- package/lib/locale/en_US.js +1 -0
- package/lib/locale/zh-CN.js +14 -2
- package/lib/modules/actions/delete/deleteActionSettings.js +10 -0
- package/lib/modules/blocks/data-blocks/form/FilterItemCustomSettings.js +1 -1
- package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +9 -4
- package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +6 -4
- package/lib/modules/blocks/data-blocks/table/tableBlockSettings.js +4 -0
- package/lib/modules/blocks/data-blocks/table/tableColumnSettings.js +44 -0
- package/lib/modules/blocks/filter-blocks/collapse/filterCollapseItemFieldSettings.js +4 -0
- package/lib/modules/blocks/filter-blocks/form/filterFormItemFieldSettings.js +9 -0
- package/lib/modules/fields/component/Radio/radioComponentFieldSettings.js +0 -4
- package/lib/modules/fields/component/SubTable/secondLevelSelect.js +136 -0
- package/lib/modules/fields/component/SubTable/subTablePopoverComponentFieldSettings.js +104 -103
- package/lib/powered-by/index.js +4 -7
- package/lib/schema-component/antd/action/Action.Designer.js +43 -5
- package/lib/schema-component/antd/action/Action.Modal.js +19 -31
- package/lib/schema-component/antd/action/Action.Modal.style.js +69 -0
- package/lib/schema-component/antd/action/Action.js +1 -3
- package/lib/schema-component/antd/action/utils.js +70 -70
- package/lib/schema-component/antd/association-field/SubTabs/InternalCollapse.js +2 -1
- package/lib/schema-component/antd/checkbox/Checkbox.js +9 -2
- package/lib/schema-component/antd/index.js +18 -4
- package/lib/schema-component/antd/media-card/MediaCard.js +69 -0
- package/lib/schema-component/antd/media-card/index.js +65 -0
- package/lib/schema-component/antd/media-card/style.js +59 -0
- package/lib/schema-component/antd/page/Page.js +235 -144
- package/lib/schema-component/antd/page/Page.style.js +79 -0
- package/lib/schema-component/antd/page/PageDesigner.js +62 -0
- package/lib/schema-component/antd/page/PageTabDesigner.js +2 -50
- package/lib/schema-component/antd/page/style.js +3 -13
- package/lib/schema-component/antd/scroll-area/ScrollArea.js +2 -1
- package/lib/schema-component/antd/variable/TextArea.js +1 -1
- package/lib/schema-component/antd/variable/TextAreaWithGlobalScope.js +94 -0
- package/lib/schema-component/antd/variable/index.js +13 -1
- package/lib/schema-component/common/dnd-context/index.js +1 -7
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.js +105 -0
- package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +59 -0
- package/lib/schema-items/GeneralSettings.js +5 -0
- package/lib/schema-settings/EditCustomDefaultValue.js +1 -1
- package/lib/schema-settings/SchemaSettings.js +1 -1
- package/lib/schema-settings/SchemaSettingsDefaultValue.js +2 -0
- package/lib/schema-settings/utils/createModalSettingsItem.js +94 -0
- package/lib/schema-settings/utils/createSelectSettingsItem.js +88 -0
- package/lib/schema-settings/utils/createSwitchSettingsItem.js +86 -0
- package/lib/schema-settings/utils/createTextSettingsItem.js +55 -0
- package/lib/schema-settings/utils/index.js +92 -0
- package/lib/schema-settings/utils/util.js +74 -0
- package/lib/user/CurrentUserProvider.js +6 -3
- package/package.json +7 -7
|
@@ -4,7 +4,9 @@ import * as __WEBPACK_EXTERNAL_MODULE__tachybase_components__ from "@tachybase/c
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_pro_layout__ from "@ant-design/pro-layout";
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__ from "@dnd-kit/core";
|
|
7
8
|
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
9
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
|
|
8
10
|
import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames";
|
|
9
11
|
import * as __WEBPACK_EXTERNAL_MODULE_react_error_boundary__ from "react-error-boundary";
|
|
10
12
|
import * as __WEBPACK_EXTERNAL_MODULE_react_i18next__ from "react-i18next";
|
|
@@ -20,39 +22,23 @@ import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_hooks_useGetAriaLabelO
|
|
|
20
22
|
import * as __WEBPACK_EXTERNAL_MODULE__style_theme_index_mjs__ from "../../../style/theme/index.mjs";
|
|
21
23
|
import * as __WEBPACK_EXTERNAL_MODULE__common_index_mjs__ from "../../common/index.mjs";
|
|
22
24
|
import * as __WEBPACK_EXTERNAL_MODULE__common_sortable_item_index_mjs__ from "../../common/sortable-item/index.mjs";
|
|
25
|
+
import * as __WEBPACK_EXTERNAL_MODULE__common_sortable_item_DragHandlePageTab_mjs__ from "../../common/sortable-item/DragHandlePageTab.mjs";
|
|
23
26
|
import * as __WEBPACK_EXTERNAL_MODULE__core_index_mjs__ from "../../core/index.mjs";
|
|
24
27
|
import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "../../hooks/index.mjs";
|
|
25
28
|
import * as __WEBPACK_EXTERNAL_MODULE__error_fallback_index_mjs__ from "../error-fallback/index.mjs";
|
|
26
29
|
import * as __WEBPACK_EXTERNAL_MODULE__FixedBlock_mjs__ from "./FixedBlock.mjs";
|
|
30
|
+
import * as __WEBPACK_EXTERNAL_MODULE__Page_style_mjs__ from "./Page.style.mjs";
|
|
31
|
+
import * as __WEBPACK_EXTERNAL_MODULE__PageDesigner_mjs__ from "./PageDesigner.mjs";
|
|
27
32
|
import * as __WEBPACK_EXTERNAL_MODULE__PageTabDesigner_mjs__ from "./PageTabDesigner.mjs";
|
|
28
33
|
import * as __WEBPACK_EXTERNAL_MODULE__style_mjs__ from "./style.mjs";
|
|
29
34
|
const Page = (props)=>{
|
|
30
|
-
var _fieldSchema_xcomponentprops, _fieldSchema_xcomponentprops1
|
|
35
|
+
var _fieldSchema_xcomponentprops, _fieldSchema_xcomponentprops1;
|
|
31
36
|
const { children, ...others } = props;
|
|
32
37
|
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
33
|
-
const compile = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useCompile)();
|
|
34
38
|
const { title, setTitle } = (0, __WEBPACK_EXTERNAL_MODULE__built_in_document_title_index_mjs__.useDocumentTitle)();
|
|
35
39
|
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
36
|
-
const dn = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useDesignable)();
|
|
37
|
-
const { theme } = (0, __WEBPACK_EXTERNAL_MODULE__style_theme_index_mjs__.useGlobalTheme)();
|
|
38
|
-
const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__schema_initializer_hooks_useGetAriaLabelOfSchemaInitializer_mjs__.useGetAriaLabelOfSchemaInitializer)();
|
|
39
|
-
const { hiddenScrollArea } = (0, __WEBPACK_EXTERNAL_MODULE__built_in_context_menu_useContextMenu_mjs__.useContextMenu)();
|
|
40
|
-
const [hasMounted, setHasMounted] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
41
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
42
|
-
setTimeout(()=>{
|
|
43
|
-
setHasMounted(true);
|
|
44
|
-
});
|
|
45
|
-
}, []);
|
|
46
|
-
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
47
|
-
if (!title) setTitle(t(fieldSchema.title));
|
|
48
|
-
}, [
|
|
49
|
-
fieldSchema.title,
|
|
50
|
-
title
|
|
51
|
-
]);
|
|
52
40
|
const disablePageHeader = null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops.disablePageHeader;
|
|
53
41
|
const enablePageTabs = null === (_fieldSchema_xcomponentprops1 = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops1 ? void 0 : _fieldSchema_xcomponentprops1.enablePageTabs;
|
|
54
|
-
const hidePageTitle = null === (_fieldSchema_xcomponentprops2 = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops2 ? void 0 : _fieldSchema_xcomponentprops2.hidePageTitle;
|
|
55
|
-
const options = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaOptionsContext);
|
|
56
42
|
const [searchParams, setSearchParams] = (0, __WEBPACK_EXTERNAL_MODULE_react_router_dom__.useSearchParams)();
|
|
57
43
|
const [loading, setLoading] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
58
44
|
const activeKey = (0, __WEBPACK_EXTERNAL_MODULE_react__.useMemo)(()=>searchParams.get('tab') || Object.keys(fieldSchema.properties || {}).shift(), [
|
|
@@ -60,144 +46,248 @@ const Page = (props)=>{
|
|
|
60
46
|
searchParams
|
|
61
47
|
]);
|
|
62
48
|
const [height, setHeight] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(0);
|
|
63
|
-
const { wrapSSR, hashId, componentCls } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.useStyles)();
|
|
64
49
|
const aclStyles = (0, __WEBPACK_EXTERNAL_MODULE__built_in_acl_style_mjs__.useStyles)();
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
50
|
+
const { wrapSSR, hashId, componentCls } = (0, __WEBPACK_EXTERNAL_MODULE__style_mjs__.getStyles)();
|
|
51
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
52
|
+
if (!title) setTitle(t(fieldSchema.title));
|
|
53
|
+
}, [
|
|
54
|
+
fieldSchema.title,
|
|
55
|
+
title
|
|
56
|
+
]);
|
|
71
57
|
return wrapSSR(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__filter_provider_FilterProvider_mjs__.FilterBlockProvider, {
|
|
72
58
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
|
|
73
59
|
className: "".concat(componentCls, " ").concat(hashId, " ").concat(aclStyles.styles),
|
|
74
60
|
children: [
|
|
75
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(
|
|
61
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__PageDesigner_mjs__.PageDesigner, {
|
|
76
62
|
title: fieldSchema.title || title
|
|
77
63
|
}),
|
|
78
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(PageHeader, {
|
|
65
|
+
disablePageHeader: disablePageHeader,
|
|
66
|
+
enablePageTabs: enablePageTabs,
|
|
67
|
+
activeKey: activeKey,
|
|
68
|
+
title: title,
|
|
69
|
+
fieldSchema: fieldSchema,
|
|
70
|
+
parentProps: others,
|
|
71
|
+
setHeight: setHeight,
|
|
72
|
+
setLoading: setLoading,
|
|
73
|
+
setSearchParams: setSearchParams
|
|
74
|
+
}),
|
|
75
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(PageContentComponent, {
|
|
76
|
+
loading: loading,
|
|
77
|
+
disablePageHeader: disablePageHeader,
|
|
78
|
+
enablePageTabs: enablePageTabs,
|
|
79
|
+
fieldSchema: fieldSchema,
|
|
80
|
+
activeKey: activeKey,
|
|
81
|
+
height: height,
|
|
82
|
+
children: children
|
|
83
|
+
})
|
|
84
|
+
]
|
|
85
|
+
})
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
const PageHeader = (props)=>{
|
|
89
|
+
var _fieldSchema_xcomponentprops;
|
|
90
|
+
const { disablePageHeader, enablePageTabs, setHeight, activeKey, setLoading, setSearchParams, fieldSchema, title, parentProps } = props;
|
|
91
|
+
const { theme } = (0, __WEBPACK_EXTERNAL_MODULE__style_theme_index_mjs__.useGlobalTheme)();
|
|
92
|
+
const options = (0, __WEBPACK_EXTERNAL_MODULE_react__.useContext)(__WEBPACK_EXTERNAL_MODULE__tachybase_schema__.SchemaOptionsContext);
|
|
93
|
+
const compile = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useCompile)();
|
|
94
|
+
const { showScrollArea } = (0, __WEBPACK_EXTERNAL_MODULE__built_in_context_menu_useContextMenu_mjs__.useContextMenu)();
|
|
95
|
+
const hidePageTitle = null === (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) || void 0 === _fieldSchema_xcomponentprops ? void 0 : _fieldSchema_xcomponentprops.hidePageTitle;
|
|
96
|
+
const pageHeaderTitle = hidePageTitle ? void 0 : fieldSchema.title || compile(title);
|
|
97
|
+
const items = fieldSchema.mapProperties((schema)=>({
|
|
98
|
+
key: schema.name,
|
|
99
|
+
label: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(TabItem, {
|
|
100
|
+
schema: schema
|
|
101
|
+
})
|
|
102
|
+
}));
|
|
103
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
104
|
+
ref: (ref)=>{
|
|
105
|
+
setHeight(Math.floor((null == ref ? void 0 : ref.getBoundingClientRect().height) || 0) + 1);
|
|
106
|
+
},
|
|
107
|
+
className: "tb-page-header-wrapper",
|
|
108
|
+
children: !disablePageHeader && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_pro_layout__.PageHeader, {
|
|
109
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('pageHeaderCss', pageHeaderTitle || enablePageTabs ? '' : 'height0'),
|
|
110
|
+
ghost: false,
|
|
111
|
+
title: pageHeaderTitle || ' ',
|
|
112
|
+
...parentProps,
|
|
113
|
+
extra: !enablePageTabs && showScrollArea && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.ScrollArea, {}),
|
|
114
|
+
footer: enablePageTabs && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(TabComponent, {
|
|
115
|
+
activeKey: activeKey,
|
|
116
|
+
setLoading: setLoading,
|
|
117
|
+
setSearchParams: setSearchParams,
|
|
118
|
+
showScrollArea: showScrollArea,
|
|
119
|
+
options: options,
|
|
120
|
+
theme: theme,
|
|
121
|
+
items: items
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
});
|
|
125
|
+
};
|
|
126
|
+
const TabComponent = (props)=>{
|
|
127
|
+
const { activeKey, setLoading, setSearchParams, showScrollArea, options, theme, items } = props;
|
|
128
|
+
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__Page_style_mjs__.useStyles)();
|
|
129
|
+
const [hasMounted, setHasMounted] = (0, __WEBPACK_EXTERNAL_MODULE_react__.useState)(false);
|
|
130
|
+
const sensors = (0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useSensors)((0, __WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.useSensor)(__WEBPACK_EXTERNAL_MODULE__dnd_kit_core__.PointerSensor, {
|
|
131
|
+
activationConstraint: {
|
|
132
|
+
distance: 5
|
|
133
|
+
}
|
|
134
|
+
}));
|
|
135
|
+
const handleTabClick = (activeKey)=>{
|
|
136
|
+
setLoading(true);
|
|
137
|
+
setSearchParams([
|
|
138
|
+
[
|
|
139
|
+
'tab',
|
|
140
|
+
activeKey
|
|
141
|
+
]
|
|
142
|
+
]);
|
|
143
|
+
setTimeout(()=>{
|
|
144
|
+
setLoading(false);
|
|
145
|
+
}, 50);
|
|
146
|
+
};
|
|
147
|
+
(0, __WEBPACK_EXTERNAL_MODULE_react__.useEffect)(()=>{
|
|
148
|
+
setTimeout(()=>{
|
|
149
|
+
setHasMounted(true);
|
|
150
|
+
});
|
|
151
|
+
}, []);
|
|
152
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__common_index_mjs__.DndContext, {
|
|
153
|
+
sensors: sensors,
|
|
154
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tabs, {
|
|
155
|
+
className: styles.tabComponentClass,
|
|
156
|
+
type: "card",
|
|
157
|
+
size: 'small',
|
|
158
|
+
animated: hasMounted,
|
|
159
|
+
activeKey: activeKey,
|
|
160
|
+
items: items,
|
|
161
|
+
onTabClick: handleTabClick,
|
|
162
|
+
tabBarExtraContent: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(TabBarExtraContent, {
|
|
163
|
+
theme: theme,
|
|
164
|
+
showScrollArea: showScrollArea,
|
|
165
|
+
options: options
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
};
|
|
170
|
+
const TabItem = (props)=>{
|
|
171
|
+
const { schema } = props;
|
|
172
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
173
|
+
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__Page_style_mjs__.useStyles)();
|
|
174
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__common_sortable_item_index_mjs__.SortableItem, {
|
|
175
|
+
id: schema.name,
|
|
176
|
+
schema: schema,
|
|
177
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-action-link', 'designerCss', props.className, styles.tabItemClass),
|
|
178
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE__common_sortable_item_DragHandlePageTab_mjs__.DragHandlePageTab, {
|
|
179
|
+
children: [
|
|
180
|
+
schema['x-icon'] && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
|
|
181
|
+
style: {
|
|
182
|
+
marginRight: 8
|
|
81
183
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
title: pageHeaderTitle || ' ',
|
|
87
|
-
...others,
|
|
88
|
-
footer: enablePageTabs && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__common_index_mjs__.DndContext, {
|
|
89
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Tabs, {
|
|
90
|
-
size: 'small',
|
|
91
|
-
animated: hasMounted,
|
|
92
|
-
activeKey: activeKey,
|
|
93
|
-
onTabClick: (activeKey)=>{
|
|
94
|
-
setLoading(true);
|
|
95
|
-
setSearchParams([
|
|
96
|
-
[
|
|
97
|
-
'tab',
|
|
98
|
-
activeKey
|
|
99
|
-
]
|
|
100
|
-
]);
|
|
101
|
-
setTimeout(()=>{
|
|
102
|
-
setLoading(false);
|
|
103
|
-
}, 50);
|
|
104
|
-
},
|
|
105
|
-
tabBarExtraContent: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
|
|
106
|
-
className: "tb-tabs-wrapper",
|
|
107
|
-
children: [
|
|
108
|
-
!hiddenScrollArea && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.ScrollArea, {}),
|
|
109
|
-
dn.designable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
|
|
110
|
-
"aria-label": getAriaLabel('tabs'),
|
|
111
|
-
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.PlusOutlined, {}),
|
|
112
|
-
className: 'addTabBtn',
|
|
113
|
-
type: 'dashed',
|
|
114
|
-
onClick: async ()=>{
|
|
115
|
-
const values = await (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.FormDialog)(t('Add tab'), ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__core_index_mjs__.SchemaComponentOptions, {
|
|
116
|
-
scope: options.scope,
|
|
117
|
-
components: {
|
|
118
|
-
...options.components
|
|
119
|
-
},
|
|
120
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_components__.FormLayout, {
|
|
121
|
-
layout: 'vertical',
|
|
122
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__core_index_mjs__.SchemaComponent, {
|
|
123
|
-
schema: {
|
|
124
|
-
properties: {
|
|
125
|
-
title: {
|
|
126
|
-
title: t('Tab name'),
|
|
127
|
-
'x-component': 'Input',
|
|
128
|
-
'x-decorator': 'FormItem',
|
|
129
|
-
required: true
|
|
130
|
-
},
|
|
131
|
-
icon: {
|
|
132
|
-
title: t('Icon'),
|
|
133
|
-
'x-component': 'IconPicker',
|
|
134
|
-
'x-decorator': 'FormItem'
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
})
|
|
139
|
-
})
|
|
140
|
-
}), theme).open({
|
|
141
|
-
initialValues: {}
|
|
142
|
-
});
|
|
143
|
-
const { title, icon } = values;
|
|
144
|
-
dn.insertBeforeEnd({
|
|
145
|
-
type: 'void',
|
|
146
|
-
title,
|
|
147
|
-
'x-icon': icon,
|
|
148
|
-
'x-component': 'Grid',
|
|
149
|
-
'x-initializer': 'page:addBlock',
|
|
150
|
-
properties: {}
|
|
151
|
-
});
|
|
152
|
-
},
|
|
153
|
-
children: t('Add tab')
|
|
154
|
-
})
|
|
155
|
-
]
|
|
156
|
-
}),
|
|
157
|
-
items: fieldSchema.mapProperties((schema)=>({
|
|
158
|
-
label: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE__common_sortable_item_index_mjs__.SortableItem, {
|
|
159
|
-
id: schema.name,
|
|
160
|
-
schema: schema,
|
|
161
|
-
className: (0, __WEBPACK_EXTERNAL_MODULE_classnames__["default"])('tb-action-link', 'designerCss', props.className),
|
|
162
|
-
children: [
|
|
163
|
-
schema['x-icon'] && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__icon_index_mjs__.Icon, {
|
|
164
|
-
style: {
|
|
165
|
-
marginRight: 8
|
|
166
|
-
},
|
|
167
|
-
type: schema['x-icon']
|
|
168
|
-
}),
|
|
169
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
|
|
170
|
-
children: schema.title || t('Unnamed')
|
|
171
|
-
}),
|
|
172
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__PageTabDesigner_mjs__.PageTabDesigner, {
|
|
173
|
-
schema: schema
|
|
174
|
-
})
|
|
175
|
-
]
|
|
176
|
-
}),
|
|
177
|
-
key: schema.name
|
|
178
|
-
}))
|
|
179
|
-
})
|
|
180
|
-
}),
|
|
181
|
-
extra: !enablePageTabs && !hiddenScrollArea && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.ScrollArea, {})
|
|
182
|
-
})
|
|
184
|
+
type: schema['x-icon']
|
|
185
|
+
}),
|
|
186
|
+
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("span", {
|
|
187
|
+
children: schema.title || t('Unnamed')
|
|
183
188
|
}),
|
|
184
189
|
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
185
|
-
className: "
|
|
186
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(
|
|
187
|
-
|
|
188
|
-
onError: handleErrors,
|
|
189
|
-
children: PageContent(loading, disablePageHeader, enablePageTabs, fieldSchema, activeKey, height, props)
|
|
190
|
+
className: "tab-designer-wrapper",
|
|
191
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__PageTabDesigner_mjs__.PageTabDesigner, {
|
|
192
|
+
schema: schema
|
|
190
193
|
})
|
|
191
194
|
})
|
|
192
195
|
]
|
|
193
196
|
})
|
|
194
|
-
})
|
|
197
|
+
});
|
|
198
|
+
};
|
|
199
|
+
const TabBarExtraContent = (props)=>{
|
|
200
|
+
const { showScrollArea, options, theme } = props;
|
|
201
|
+
const dn = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useDesignable)();
|
|
202
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
203
|
+
const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__schema_initializer_hooks_useGetAriaLabelOfSchemaInitializer_mjs__.useGetAriaLabelOfSchemaInitializer)();
|
|
204
|
+
const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__Page_style_mjs__.useStyles)();
|
|
205
|
+
const handleAddTab = async ()=>{
|
|
206
|
+
const values = await (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.FormDialog)(t('Add tab'), ()=>/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(AddTabForm, {
|
|
207
|
+
options: options
|
|
208
|
+
}), theme).open({
|
|
209
|
+
initialValues: {}
|
|
210
|
+
});
|
|
211
|
+
const { title, icon } = values;
|
|
212
|
+
dn.insertBeforeEnd({
|
|
213
|
+
type: 'void',
|
|
214
|
+
title,
|
|
215
|
+
'x-icon': icon,
|
|
216
|
+
'x-component': 'Grid',
|
|
217
|
+
'x-initializer': 'page:addBlock',
|
|
218
|
+
properties: {}
|
|
219
|
+
});
|
|
220
|
+
};
|
|
221
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
|
|
222
|
+
className: (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.cx)(styles.tabWrapper, {
|
|
223
|
+
designable: dn.designable
|
|
224
|
+
}),
|
|
225
|
+
children: [
|
|
226
|
+
dn.designable && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Button, {
|
|
227
|
+
className: "add-tab-btn",
|
|
228
|
+
type: "text",
|
|
229
|
+
"aria-label": getAriaLabel('tabs'),
|
|
230
|
+
icon: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.PlusOutlined, {}),
|
|
231
|
+
onClick: handleAddTab
|
|
232
|
+
}),
|
|
233
|
+
showScrollArea && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.ScrollArea, {
|
|
234
|
+
className: "scroll-area-extra-content"
|
|
235
|
+
})
|
|
236
|
+
]
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
const AddTabForm = (props)=>{
|
|
240
|
+
const { options } = props;
|
|
241
|
+
const { t } = (0, __WEBPACK_EXTERNAL_MODULE_react_i18next__.useTranslation)();
|
|
242
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__core_index_mjs__.SchemaComponentOptions, {
|
|
243
|
+
scope: options.scope,
|
|
244
|
+
components: {
|
|
245
|
+
...options.components
|
|
246
|
+
},
|
|
247
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__tachybase_components__.FormLayout, {
|
|
248
|
+
layout: 'vertical',
|
|
249
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__core_index_mjs__.SchemaComponent, {
|
|
250
|
+
schema: {
|
|
251
|
+
properties: {
|
|
252
|
+
title: {
|
|
253
|
+
title: t('Tab name'),
|
|
254
|
+
'x-component': 'Input',
|
|
255
|
+
'x-decorator': 'FormItem',
|
|
256
|
+
required: true
|
|
257
|
+
},
|
|
258
|
+
icon: {
|
|
259
|
+
title: t('Icon'),
|
|
260
|
+
'x-component': 'IconPicker',
|
|
261
|
+
'x-decorator': 'FormItem'
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
})
|
|
266
|
+
})
|
|
267
|
+
});
|
|
195
268
|
};
|
|
196
|
-
|
|
197
|
-
|
|
269
|
+
const PageContentComponent = (props)=>{
|
|
270
|
+
const handleErrors = (error)=>{
|
|
271
|
+
var _window_Sentry, _window;
|
|
272
|
+
null === (_window = window) || void 0 === _window || null === (_window_Sentry = _window.Sentry) || void 0 === _window_Sentry || _window_Sentry.captureException(error);
|
|
273
|
+
console.error(error);
|
|
274
|
+
};
|
|
275
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
276
|
+
className: "tb-page-wrapper",
|
|
277
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_error_boundary__.ErrorBoundary, {
|
|
278
|
+
FallbackComponent: __WEBPACK_EXTERNAL_MODULE__error_fallback_index_mjs__.ErrorFallback,
|
|
279
|
+
onError: handleErrors,
|
|
280
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(PageContent, {
|
|
281
|
+
...props
|
|
282
|
+
})
|
|
283
|
+
})
|
|
284
|
+
});
|
|
285
|
+
};
|
|
286
|
+
const PageContent = (props)=>{
|
|
287
|
+
const { loading, disablePageHeader, enablePageTabs, fieldSchema, activeKey, height, children } = props;
|
|
198
288
|
const { token } = (0, __WEBPACK_EXTERNAL_MODULE__builtins_index_mjs__.useToken)();
|
|
199
289
|
if (loading) return;
|
|
200
|
-
|
|
290
|
+
if (!disablePageHeader && enablePageTabs) return fieldSchema.mapProperties((schema)=>{
|
|
201
291
|
if (schema.name !== activeKey) return null;
|
|
202
292
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__FixedBlock_mjs__["default"], {
|
|
203
293
|
height: "calc(".concat(height, "px + 46px + ").concat(token.marginLG, "px * 2)"),
|
|
@@ -209,12 +299,13 @@ function PageContent(loading, disablePageHeader, enablePageTabs, fieldSchema, ac
|
|
|
209
299
|
})
|
|
210
300
|
})
|
|
211
301
|
}, schema.name);
|
|
212
|
-
})
|
|
302
|
+
});
|
|
303
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__FixedBlock_mjs__["default"], {
|
|
213
304
|
height: "calc(".concat(height, "px + 46px + ").concat(token.marginLG, "px * 2)"),
|
|
214
305
|
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
215
306
|
className: "pageWithFixedBlockCss tb-page-content",
|
|
216
|
-
children:
|
|
307
|
+
children: children
|
|
217
308
|
})
|
|
218
309
|
});
|
|
219
|
-
}
|
|
310
|
+
};
|
|
220
311
|
export { Page };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd_style__ from "antd-style";
|
|
2
|
+
function _tagged_template_literal(strings, raw) {
|
|
3
|
+
if (!raw) raw = strings.slice(0);
|
|
4
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
5
|
+
raw: {
|
|
6
|
+
value: Object.freeze(raw)
|
|
7
|
+
}
|
|
8
|
+
}));
|
|
9
|
+
}
|
|
10
|
+
function _templateObject() {
|
|
11
|
+
const data = _tagged_template_literal([
|
|
12
|
+
"\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab {\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
|
|
13
|
+
]);
|
|
14
|
+
_templateObject = function() {
|
|
15
|
+
return data;
|
|
16
|
+
};
|
|
17
|
+
return data;
|
|
18
|
+
}
|
|
19
|
+
function _templateObject1() {
|
|
20
|
+
const data = _tagged_template_literal([
|
|
21
|
+
"\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n\n &.designable {\n justify-content: space-between;\n }\n\n .scroll-area-extra-content {\n align-self: flex-end;\n }\n "
|
|
22
|
+
]);
|
|
23
|
+
_templateObject1 = function() {
|
|
24
|
+
return data;
|
|
25
|
+
};
|
|
26
|
+
return data;
|
|
27
|
+
}
|
|
28
|
+
function _templateObject2() {
|
|
29
|
+
const data = _tagged_template_literal([
|
|
30
|
+
"\n position: relative;\n &:hover {\n .tab-designer-wrapper {\n display: block;\n }\n }\n .tab-designer-wrapper {\n display: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 0 2px;\n border-radius: 3px;\n color: #000000;\n background-color: #ffffff;\n\n &:hover {\n color: #ffffff;\n background-color: var(--colorSettings);\n }\n }\n "
|
|
31
|
+
]);
|
|
32
|
+
_templateObject2 = function() {
|
|
33
|
+
return data;
|
|
34
|
+
};
|
|
35
|
+
return data;
|
|
36
|
+
}
|
|
37
|
+
const useStyles = (0, __WEBPACK_EXTERNAL_MODULE_antd_style__.createStyles)((param)=>{
|
|
38
|
+
let { css, token } = param;
|
|
39
|
+
return {
|
|
40
|
+
tabComponentClass: css(_templateObject()),
|
|
41
|
+
tabWrapper: css(_templateObject1()),
|
|
42
|
+
tabItemClass: css(_templateObject2())
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
export { useStyles };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../index.mjs";
|
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__ from "../../../application/schema-settings/hooks/index.mjs";
|
|
6
|
+
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__ from "../../../application/schema-toolbar/context/index.mjs";
|
|
7
|
+
const PageDesigner = (param)=>{
|
|
8
|
+
let { title } = param;
|
|
9
|
+
const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
|
|
10
|
+
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
11
|
+
const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageSettings', fieldSchema['x-settings-props']);
|
|
12
|
+
if (!designable) return null;
|
|
13
|
+
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
|
|
14
|
+
title: title,
|
|
15
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
16
|
+
className: 'general-schema-designer',
|
|
17
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
18
|
+
className: 'general-schema-designer-icons',
|
|
19
|
+
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
|
|
20
|
+
size: 2,
|
|
21
|
+
align: 'center',
|
|
22
|
+
children: render()
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export { PageDesigner };
|
|
@@ -1,64 +1,17 @@
|
|
|
1
1
|
import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
|
|
2
|
-
import "react";
|
|
3
2
|
import * as __WEBPACK_EXTERNAL_MODULE__tachybase_schema__ from "@tachybase/schema";
|
|
4
|
-
import * as __WEBPACK_EXTERNAL_MODULE__ant_design_icons__ from "@ant-design/icons";
|
|
5
|
-
import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
|
|
6
3
|
import * as __WEBPACK_EXTERNAL_MODULE__index_mjs__ from "../../index.mjs";
|
|
7
4
|
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__ from "../../../application/schema-settings/hooks/index.mjs";
|
|
8
5
|
import * as __WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__ from "../../../application/schema-toolbar/context/index.mjs";
|
|
9
|
-
import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useGetAriaLabelOfDesigner_mjs__ from "../../../schema-settings/hooks/useGetAriaLabelOfDesigner.mjs";
|
|
10
|
-
const PageDesigner = (param)=>{
|
|
11
|
-
let { title } = param;
|
|
12
|
-
const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
|
|
13
|
-
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
14
|
-
const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageSettings', fieldSchema['x-settings-props']);
|
|
15
|
-
if (!designable) return null;
|
|
16
|
-
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
|
|
17
|
-
title: title,
|
|
18
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
19
|
-
className: 'general-schema-designer',
|
|
20
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
21
|
-
className: 'general-schema-designer-icons',
|
|
22
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
|
|
23
|
-
size: 2,
|
|
24
|
-
align: 'center',
|
|
25
|
-
children: render()
|
|
26
|
-
})
|
|
27
|
-
})
|
|
28
|
-
})
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
6
|
const PageTabDesigner = (param)=>{
|
|
32
7
|
let { schema } = param;
|
|
33
8
|
const { designable } = (0, __WEBPACK_EXTERNAL_MODULE__index_mjs__.useDesignable)();
|
|
34
|
-
const { getAriaLabel } = (0, __WEBPACK_EXTERNAL_MODULE__schema_settings_hooks_useGetAriaLabelOfDesigner_mjs__.useGetAriaLabelOfDesigner)();
|
|
35
9
|
const fieldSchema = (0, __WEBPACK_EXTERNAL_MODULE__tachybase_schema__.useFieldSchema)();
|
|
36
|
-
const { render } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageTabSettings', fieldSchema['x-settings-props']);
|
|
10
|
+
const { render: renderDesigner } = (0, __WEBPACK_EXTERNAL_MODULE__application_schema_settings_hooks_index_mjs__.useSchemaSettingsRender)(fieldSchema['x-settings'] || 'PageTabSettings', fieldSchema['x-settings-props']);
|
|
37
11
|
if (!designable) return null;
|
|
38
12
|
return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_toolbar_context_index_mjs__.SchemaToolbarProvider, {
|
|
39
13
|
schema: schema,
|
|
40
|
-
children:
|
|
41
|
-
className: 'general-schema-designer',
|
|
42
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
|
|
43
|
-
className: 'general-schema-designer-icons',
|
|
44
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Space, {
|
|
45
|
-
size: 3,
|
|
46
|
-
align: 'center',
|
|
47
|
-
children: [
|
|
48
|
-
/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__index_mjs__.DragHandler, {
|
|
49
|
-
children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__ant_design_icons__.DragOutlined, {
|
|
50
|
-
style: {
|
|
51
|
-
marginRight: 0
|
|
52
|
-
},
|
|
53
|
-
role: "button",
|
|
54
|
-
"aria-label": getAriaLabel('drag-handler', 'tab')
|
|
55
|
-
})
|
|
56
|
-
}),
|
|
57
|
-
render()
|
|
58
|
-
]
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
})
|
|
14
|
+
children: renderDesigner()
|
|
62
15
|
});
|
|
63
16
|
};
|
|
64
|
-
export {
|
|
17
|
+
export { PageTabDesigner };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const getStyles: (props?: any) => import("./../__builtins__").UseComponentStyleResult;
|