@tachybase/client 1.0.18 → 1.0.25

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.
Files changed (106) hide show
  1. package/es/application/Application.d.ts +2 -0
  2. package/es/application/Application.mjs +15 -0
  3. package/es/application/TrackingManager.d.ts +13 -0
  4. package/es/application/TrackingManager.mjs +30 -0
  5. package/es/application/components/SharePage.d.ts +4 -0
  6. package/es/application/components/SharePage.mjs +113 -0
  7. package/es/application/components/ShareSchemaComponent.d.ts +1 -0
  8. package/es/application/components/ShareSchemaComponent.mjs +10 -0
  9. package/es/application/components/index.d.ts +2 -0
  10. package/es/application/components/index.mjs +2 -0
  11. package/es/built-in/admin-layout/index.d.ts +1 -0
  12. package/es/built-in/admin-layout/index.mjs +1 -0
  13. package/es/collection-manager/interfaces/__tests__/json.mjs +2 -2
  14. package/es/collection-manager/interfaces/integer.d.ts +12 -0
  15. package/es/collection-manager/interfaces/integer.mjs +13 -1
  16. package/es/collection-manager/interfaces/number.d.ts +16 -0
  17. package/es/collection-manager/interfaces/number.mjs +22 -1
  18. package/es/collection-manager/interfaces/percent.d.ts +12 -0
  19. package/es/collection-manager/interfaces/percent.mjs +12 -0
  20. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.d.ts +3 -0
  21. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.mjs +67 -0
  22. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.d.ts +3 -0
  23. package/es/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.mjs +37 -0
  24. package/es/data-source/collection-fields-to-initializer-items/index.d.ts +1 -0
  25. package/es/data-source/collection-fields-to-initializer-items/index.mjs +1 -0
  26. package/es/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.d.ts +3 -0
  27. package/es/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.mjs +59 -0
  28. package/es/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.d.ts +3 -0
  29. package/es/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.mjs +34 -0
  30. package/es/data-source/collection-fields-to-initializer-items/items/SelfFields.d.ts +3 -0
  31. package/es/data-source/collection-fields-to-initializer-items/items/SelfFields.mjs +14 -0
  32. package/es/data-source/collection-fields-to-initializer-items/items/index.d.ts +3 -0
  33. package/es/data-source/collection-fields-to-initializer-items/items/index.mjs +7 -0
  34. package/es/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.d.ts +5 -0
  35. package/es/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.mjs +91 -0
  36. package/es/data-source/collection-fields-to-initializer-items/utils/index.d.ts +3 -0
  37. package/es/data-source/collection-fields-to-initializer-items/utils/index.mjs +3 -0
  38. package/es/data-source/collection-fields-to-initializer-items/utils/type.d.ts +108 -0
  39. package/es/data-source/collection-fields-to-initializer-items/utils/type.mjs +0 -0
  40. package/es/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.d.ts +21 -0
  41. package/es/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.mjs +31 -0
  42. package/es/data-source/index.d.ts +1 -0
  43. package/es/data-source/index.mjs +1 -0
  44. package/es/modules/blocks/data-blocks/form/fieldSettingsFormItem.mjs +0 -8
  45. package/es/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.d.ts +1 -3
  46. package/es/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.mjs +4 -1
  47. package/es/modules/fields/component/InputNumber/inputNumberComponentFieldSettings.mjs +91 -0
  48. package/es/schema-component/antd/index.d.ts +2 -0
  49. package/es/schema-component/antd/index.mjs +2 -0
  50. package/es/schema-component/antd/page/Page.Settings.mjs +33 -0
  51. package/es/schema-component/antd/page/Page.mjs +113 -18
  52. package/es/schema-component/antd/page/hooks/index.d.ts +1 -0
  53. package/es/schema-component/antd/page/hooks/index.mjs +1 -0
  54. package/es/schema-component/antd/page/hooks/useShareActions.d.ts +7 -0
  55. package/es/schema-component/antd/page/hooks/useShareActions.mjs +245 -0
  56. package/es/schema-component/antd/page/index.d.ts +1 -0
  57. package/es/schema-component/antd/page/index.mjs +1 -0
  58. package/es/schema-component/antd/page/style.d.ts +5 -0
  59. package/es/schema-component/antd/page/style.mjs +59 -2
  60. package/es/schema-component/antd/slider/index.d.ts +1 -0
  61. package/es/schema-component/antd/slider/index.mjs +1 -0
  62. package/es/schema-component/antd/slider/slider.d.ts +3 -0
  63. package/es/schema-component/antd/slider/slider.mjs +11 -0
  64. package/es/schema-component/antd/tracking-link/index.d.ts +10 -0
  65. package/es/schema-component/antd/tracking-link/index.mjs +25 -0
  66. package/es/schema-initializer/utils.d.ts +1 -0
  67. package/es/schema-initializer/utils.mjs +1 -1
  68. package/lib/application/Application.js +15 -0
  69. package/lib/application/TrackingManager.js +66 -0
  70. package/lib/application/components/SharePage.js +150 -0
  71. package/lib/application/components/ShareSchemaComponent.js +44 -0
  72. package/lib/application/components/index.js +18 -0
  73. package/lib/block-provider/hooks/index.js +2 -2
  74. package/lib/built-in/admin-layout/index.js +9 -0
  75. package/lib/collection-manager/interfaces/__tests__/json.js +4 -4
  76. package/lib/collection-manager/interfaces/integer.js +13 -1
  77. package/lib/collection-manager/interfaces/number.js +22 -1
  78. package/lib/collection-manager/interfaces/percent.js +12 -0
  79. package/lib/data-source/collection-fields-to-initializer-items/CollectionFieldsToFormInitializerItems.js +102 -0
  80. package/lib/data-source/collection-fields-to-initializer-items/CollectionFieldsToInitializerItems.js +71 -0
  81. package/lib/data-source/collection-fields-to-initializer-items/index.js +65 -0
  82. package/lib/data-source/collection-fields-to-initializer-items/items/AssociationCollectionFields.js +93 -0
  83. package/lib/data-source/collection-fields-to-initializer-items/items/ParentCollectionFields.js +68 -0
  84. package/lib/data-source/collection-fields-to-initializer-items/items/SelfFields.js +48 -0
  85. package/lib/data-source/collection-fields-to-initializer-items/items/index.js +40 -0
  86. package/lib/data-source/collection-fields-to-initializer-items/utils/getInitializerItemsByFields.js +127 -0
  87. package/lib/data-source/collection-fields-to-initializer-items/utils/index.js +83 -0
  88. package/lib/data-source/collection-fields-to-initializer-items/utils/type.js +19 -0
  89. package/lib/data-source/collection-fields-to-initializer-items/utils/useCollectionFieldContext.js +65 -0
  90. package/lib/data-source/index.js +12 -3
  91. package/lib/locale/zh-CN.js +18 -0
  92. package/lib/modules/blocks/data-blocks/form/fieldSettingsFormItem.js +0 -8
  93. package/lib/modules/blocks/data-blocks/form/hooks/useEditFormBlockDecoratorProps.js +4 -1
  94. package/lib/modules/fields/component/InputNumber/inputNumberComponentFieldSettings.js +91 -0
  95. package/lib/schema-component/antd/index.js +161 -133
  96. package/lib/schema-component/antd/page/Page.Settings.js +33 -0
  97. package/lib/schema-component/antd/page/Page.js +113 -18
  98. package/lib/schema-component/antd/page/hooks/index.js +65 -0
  99. package/lib/schema-component/antd/page/hooks/useShareActions.js +293 -0
  100. package/lib/schema-component/antd/page/index.js +9 -0
  101. package/lib/schema-component/antd/page/style.js +60 -2
  102. package/lib/schema-component/antd/slider/index.js +65 -0
  103. package/lib/schema-component/antd/slider/slider.js +46 -0
  104. package/lib/schema-component/antd/tracking-link/index.js +59 -0
  105. package/lib/schema-initializer/utils.js +2 -1
  106. package/package.json +8 -7
@@ -14,6 +14,7 @@ import { ComponentTypeAndString, RouterManager, RouterOptions } from './RouterMa
14
14
  import { SchemaInitializer, SchemaInitializerManager } from './schema-initializer';
15
15
  import { SchemaSettings, SchemaSettingsManager } from './schema-settings';
16
16
  import { PluginSettingOptions, SystemSettingsManager } from './SystemSettingsManager';
17
+ import { TrackingManager } from './TrackingManager';
17
18
  import { UserSettingOptions, UserSettingsManager } from './UserSettingsManager';
18
19
  import { WebSocketClient, WebSocketClientOptions } from './WebSocketClient';
19
20
  declare global {
@@ -68,6 +69,7 @@ export declare class Application {
68
69
  schemaSettingsManager: SchemaSettingsManager;
69
70
  dataSourceManager: DataSourceManager;
70
71
  noticeManager: NoticeManager;
72
+ trackingManager: TrackingManager;
71
73
  pluginContextMenu: PluginContextMenu;
72
74
  AttachmentPreviewManager: AttachmentPreviewManager;
73
75
  name: string;
@@ -26,6 +26,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_index_mjs__ from "./sc
26
26
  import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_components_index_mjs__ from "./schema-initializer/components/index.mjs";
27
27
  import * as __WEBPACK_EXTERNAL_MODULE__schema_settings_index_mjs__ from "./schema-settings/index.mjs";
28
28
  import * as __WEBPACK_EXTERNAL_MODULE__SystemSettingsManager_mjs__ from "./SystemSettingsManager.mjs";
29
+ import * as __WEBPACK_EXTERNAL_MODULE__TrackingManager_mjs__ from "./TrackingManager.mjs";
29
30
  import * as __WEBPACK_EXTERNAL_MODULE__UserSettingsManager_mjs__ from "./UserSettingsManager.mjs";
30
31
  import * as __WEBPACK_EXTERNAL_MODULE__utils_index_mjs__ from "./utils/index.mjs";
31
32
  import * as __WEBPACK_EXTERNAL_MODULE__utils_globalDeps_mjs__ from "./utils/globalDeps.mjs";
@@ -86,6 +87,18 @@ class Application {
86
87
  path: '*',
87
88
  Component: this.components['AppNotFound']
88
89
  });
90
+ this.router.add('share', {
91
+ path: '/share',
92
+ Component: __WEBPACK_EXTERNAL_MODULE__components_index_mjs__.SharePage
93
+ });
94
+ this.router.add('share.page', {
95
+ path: '/share/:name',
96
+ Component: __WEBPACK_EXTERNAL_MODULE__components_index_mjs__.ShareSchemaComponent
97
+ });
98
+ this.router.add('share.notAuthorized', {
99
+ path: '/share/not-authorized',
100
+ element: null
101
+ });
89
102
  }
90
103
  getOptions() {
91
104
  return this.options;
@@ -272,6 +285,7 @@ class Application {
272
285
  _define_property(this, "schemaSettingsManager", void 0);
273
286
  _define_property(this, "dataSourceManager", void 0);
274
287
  _define_property(this, "noticeManager", void 0);
288
+ _define_property(this, "trackingManager", void 0);
275
289
  _define_property(this, "pluginContextMenu", void 0);
276
290
  _define_property(this, "AttachmentPreviewManager", void 0);
277
291
  _define_property(this, "name", void 0);
@@ -313,6 +327,7 @@ class Application {
313
327
  this.schemaInitializerManager = new __WEBPACK_EXTERNAL_MODULE__schema_initializer_index_mjs__.SchemaInitializerManager(options.schemaInitializers, this);
314
328
  this.dataSourceManager = new __WEBPACK_EXTERNAL_MODULE__data_source_data_source_DataSourceManager_mjs__.DataSourceManager(options.dataSourceManager, this);
315
329
  this.noticeManager = new __WEBPACK_EXTERNAL_MODULE__NoticesManager_mjs__.NoticeManager(this);
330
+ this.trackingManager = new __WEBPACK_EXTERNAL_MODULE__TrackingManager_mjs__.TrackingManager(this);
316
331
  this.addDefaultProviders();
317
332
  this.addReactRouterComponents();
318
333
  this.addProviders(options.providers || []);
@@ -0,0 +1,13 @@
1
+ import { Application } from '.';
2
+ import { APIClient } from '../api-client';
3
+ export interface TrackingData {
4
+ type: string;
5
+ key: string;
6
+ values?: Record<string, any>;
7
+ }
8
+ export declare class TrackingManager {
9
+ private app;
10
+ api: APIClient;
11
+ constructor(app: Application);
12
+ logEvent(type: string, key: string, values?: Record<string, any>): Promise<void>;
13
+ }
@@ -0,0 +1,30 @@
1
+ function _define_property(obj, key, value) {
2
+ if (key in obj) Object.defineProperty(obj, key, {
3
+ value: value,
4
+ enumerable: true,
5
+ configurable: true,
6
+ writable: true
7
+ });
8
+ else obj[key] = value;
9
+ return obj;
10
+ }
11
+ class TrackingManager {
12
+ async logEvent(type, key, values) {
13
+ const data = {
14
+ type,
15
+ key,
16
+ values
17
+ };
18
+ this.api.resource('instrumentation').create({
19
+ values: {
20
+ ...data
21
+ }
22
+ });
23
+ }
24
+ constructor(app){
25
+ _define_property(this, "app", void 0);
26
+ _define_property(this, "api", void 0);
27
+ this.app = app;
28
+ }
29
+ }
30
+ export { TrackingManager };
@@ -0,0 +1,4 @@
1
+ export declare function useShareToken(): string;
2
+ export declare const ShareLayout: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const SharePage: () => import("react/jsx-runtime").JSX.Element;
4
+ export declare function NotAuthorityResult(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,113 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__emotion_css__ from "@emotion/css";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_antd__ from "antd";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_react_router__ from "react-router";
6
+ import * as __WEBPACK_EXTERNAL_MODULE_react_router_dom__ from "react-router-dom";
7
+ import * as __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__ from "../../api-client/index.mjs";
8
+ import * as __WEBPACK_EXTERNAL_MODULE__built_in_admin_layout_index_mjs__ from "../../built-in/admin-layout/index.mjs";
9
+ import * as __WEBPACK_EXTERNAL_MODULE__built_in_pinned_list_index_mjs__ from "../../built-in/pinned-list/index.mjs";
10
+ import * as __WEBPACK_EXTERNAL_MODULE__built_in_system_settings_index_mjs__ from "../../built-in/system-settings/index.mjs";
11
+ import * as __WEBPACK_EXTERNAL_MODULE__user_index_mjs__ from "../../user/index.mjs";
12
+ import * as __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__ from "../hooks/index.mjs";
13
+ function _tagged_template_literal(strings, raw) {
14
+ if (!raw) raw = strings.slice(0);
15
+ return Object.freeze(Object.defineProperties(strings, {
16
+ raw: {
17
+ value: Object.freeze(raw)
18
+ }
19
+ }));
20
+ }
21
+ function _templateObject() {
22
+ const data = _tagged_template_literal([
23
+ "\n display: flex;\n flex-direction: column;\n position: relative;\n overflow-y: auto;\n > div {\n position: relative;\n }\n .ant-layout-footer {\n position: absolute;\n bottom: 0;\n text-align: center;\n width: 100%;\n z-index: 0;\n padding: 0px 50px;\n }\n "
24
+ ]);
25
+ _templateObject = function() {
26
+ return data;
27
+ };
28
+ return data;
29
+ }
30
+ function useShareToken() {
31
+ const url = new URL(window.location.href);
32
+ const api = (0, __WEBPACK_EXTERNAL_MODULE__api_client_index_mjs__.useAPIClient)();
33
+ const token = url.searchParams.get('token');
34
+ return token && api.auth.setToken(token), api.auth.getToken();
35
+ }
36
+ const ShareLayout = ()=>{
37
+ var _result_data_data_logo, _result_data_data, _result_data, _result_data_data1, _result_data1;
38
+ const { styles } = (0, __WEBPACK_EXTERNAL_MODULE__built_in_admin_layout_index_mjs__.useStyles)();
39
+ const app = (0, __WEBPACK_EXTERNAL_MODULE__hooks_index_mjs__.useApp)();
40
+ const result = (0, __WEBPACK_EXTERNAL_MODULE__built_in_system_settings_index_mjs__.useSystemSettings)();
41
+ const sideMenuRef = (0, __WEBPACK_EXTERNAL_MODULE_react__.useRef)();
42
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Layout, {
43
+ style: {
44
+ height: '100%'
45
+ },
46
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_antd__.Layout.Content, {
47
+ className: (0, __WEBPACK_EXTERNAL_MODULE__emotion_css__.css)(_templateObject()),
48
+ children: [
49
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_antd__.Layout.Header, {
50
+ className: styles.header,
51
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
52
+ className: styles.headerA,
53
+ children: [
54
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
55
+ className: styles.headerB,
56
+ children: [
57
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
58
+ className: styles.titleContainer,
59
+ onClick: ()=>{
60
+ location.href = app.adminUrl;
61
+ },
62
+ children: [
63
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("img", {
64
+ className: styles.logo,
65
+ src: null == result ? void 0 : null === (_result_data = result.data) || void 0 === _result_data ? void 0 : null === (_result_data_data = _result_data.data) || void 0 === _result_data_data ? void 0 : null === (_result_data_data_logo = _result_data_data.logo) || void 0 === _result_data_data_logo ? void 0 : _result_data_data_logo.url
66
+ }),
67
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("h1", {
68
+ className: styles.title,
69
+ children: null == result ? void 0 : null === (_result_data1 = result.data) || void 0 === _result_data1 ? void 0 : null === (_result_data_data1 = _result_data1.data) || void 0 === _result_data_data1 ? void 0 : _result_data_data1.title
70
+ })
71
+ ]
72
+ }),
73
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__built_in_admin_layout_index_mjs__.MenuEditor, {
74
+ sideMenuRef: sideMenuRef
75
+ }),
76
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)("div", {
77
+ className: styles.headerTabs,
78
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__built_in_admin_layout_index_mjs__.AdminTabs, {})
79
+ })
80
+ ]
81
+ }),
82
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)("div", {
83
+ className: styles.right,
84
+ children: [
85
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__built_in_pinned_list_index_mjs__.PinnedPluginList, {
86
+ belongToFilter: "pinnedmenu"
87
+ }),
88
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__user_index_mjs__.CurrentUser, {})
89
+ ]
90
+ })
91
+ ]
92
+ })
93
+ }),
94
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_router_dom__.Outlet, {})
95
+ ]
96
+ })
97
+ });
98
+ };
99
+ const SharePage = ()=>{
100
+ const shareToken = useShareToken();
101
+ return shareToken ? /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__built_in_admin_layout_index_mjs__.AdminProvider, {
102
+ children: /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(ShareLayout, {})
103
+ }) : /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(NotAuthorityResult, {});
104
+ };
105
+ function NotAuthorityResult() {
106
+ const { pathname, search } = (0, __WEBPACK_EXTERNAL_MODULE_react_router__.useLocation)();
107
+ const redirect = "?redirect=".concat(pathname).concat(search);
108
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE_react_router__.Navigate, {
109
+ replace: true,
110
+ to: "/signin".concat(redirect)
111
+ });
112
+ }
113
+ export { NotAuthorityResult, ShareLayout, SharePage, useShareToken };
@@ -0,0 +1 @@
1
+ export declare function ShareSchemaComponent(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_react_router__ from "react-router";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__ from "../../schema-component/index.mjs";
4
+ function ShareSchemaComponent() {
5
+ const params = (0, __WEBPACK_EXTERNAL_MODULE_react_router__.useParams)();
6
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__schema_component_index_mjs__.RemoteSchemaComponent, {
7
+ uid: params.name
8
+ });
9
+ }
10
+ export { ShareSchemaComponent };
@@ -2,3 +2,5 @@ export * from './AppComponent';
2
2
  export * from './BlankComponent';
3
3
  export * from './defaultComponents';
4
4
  export * from './RouterContextCleaner';
5
+ export * from './SharePage';
6
+ export * from './ShareSchemaComponent';
@@ -2,3 +2,5 @@ export * from "./AppComponent.mjs";
2
2
  export * from "./BlankComponent.mjs";
3
3
  export * from "./defaultComponents.mjs";
4
4
  export * from "./RouterContextCleaner.mjs";
5
+ export * from "./SharePage.mjs";
6
+ export * from "./ShareSchemaComponent.mjs";
@@ -7,3 +7,4 @@ export * from './InternalAdminLayout';
7
7
  export * from './MenuEditor';
8
8
  export * from './NoticeArea';
9
9
  export * from './filterByACL';
10
+ export * from './style';
@@ -7,3 +7,4 @@ export * from "./InternalAdminLayout.mjs";
7
7
  export * from "./MenuEditor.mjs";
8
8
  export * from "./NoticeArea.mjs";
9
9
  export * from "./filterByACL.mjs";
10
+ export * from "./style.mjs";
@@ -1,7 +1,7 @@
1
1
  import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
2
  import "react";
3
3
  import * as __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__ from "@tachybase/test/client";
4
- import * as __WEBPACK_EXTERNAL_MODULE__appInfo_mjs__ from "../../../appInfo.mjs";
4
+ import * as __WEBPACK_EXTERNAL_MODULE__common_appInfo_index_mjs__ from "../../../common/appInfo/index.mjs";
5
5
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_checkbox_index_mjs__ from "../../../schema-component/antd/checkbox/index.mjs";
6
6
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_antd_input_index_mjs__ from "../../../schema-component/antd/input/index.mjs";
7
7
  import * as __WEBPACK_EXTERNAL_MODULE__schema_component_core_SchemaComponent_mjs__ from "../../../schema-component/core/SchemaComponent.mjs";
@@ -21,7 +21,7 @@ describe('JSON', ()=>{
21
21
  (0, __WEBPACK_EXTERNAL_MODULE__tachybase_test_client__.render)(/*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(Component, {}), {
22
22
  wrapper: (param)=>{
23
23
  let { children } = param;
24
- return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__appInfo_mjs__.CurrentAppInfoContext.Provider, {
24
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__common_appInfo_index_mjs__.CurrentAppInfoContext.Provider, {
25
25
  value: {
26
26
  data: {
27
27
  database: {
@@ -72,6 +72,18 @@ export declare class IntegerFieldInterface extends CollectionFieldInterface {
72
72
  'x-component': string;
73
73
  'x-disabled': string;
74
74
  };
75
+ 'uiSchema.x-component-props.addonBefore': {
76
+ type: string;
77
+ title: string;
78
+ 'x-decorator': string;
79
+ 'x-component': string;
80
+ };
81
+ 'uiSchema.x-component-props.addonAfter': {
82
+ type: string;
83
+ title: string;
84
+ 'x-decorator': string;
85
+ 'x-component': string;
86
+ };
75
87
  'uiSchema.title': {
76
88
  type: string;
77
89
  title: string;
@@ -50,7 +50,19 @@ class IntegerFieldInterface extends __WEBPACK_EXTERNAL_MODULE__data_source_colle
50
50
  unique: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.unique
51
51
  }
52
52
  },
53
- autoIncrement: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.autoIncrement
53
+ autoIncrement: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.autoIncrement,
54
+ 'uiSchema.x-component-props.addonBefore': {
55
+ type: 'string',
56
+ title: '{{t("Prefix")}}',
57
+ 'x-decorator': 'FormItem',
58
+ 'x-component': 'Input'
59
+ },
60
+ 'uiSchema.x-component-props.addonAfter': {
61
+ type: 'string',
62
+ title: '{{t("Suffix")}}',
63
+ 'x-decorator': 'FormItem',
64
+ 'x-component': 'Input'
65
+ }
54
66
  }), _define_property(this, "filterable", {
55
67
  operators: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.operators.number
56
68
  }), _define_property(this, "titleUsable", true), _define_property(this, "validateSchema", (fieldSchema)=>({
@@ -17,6 +17,10 @@ export declare class NumberFieldInterface extends CollectionFieldInterface {
17
17
  };
18
18
  };
19
19
  };
20
+ componentOptions: {
21
+ label: string;
22
+ value: string;
23
+ }[];
20
24
  availableTypes: string[];
21
25
  hasDefaultValue: boolean;
22
26
  properties: {
@@ -46,6 +50,18 @@ export declare class NumberFieldInterface extends CollectionFieldInterface {
46
50
  label: string;
47
51
  }[];
48
52
  };
53
+ 'uiSchema.x-component-props.addonBefore': {
54
+ type: string;
55
+ title: string;
56
+ 'x-decorator': string;
57
+ 'x-component': string;
58
+ };
59
+ 'uiSchema.x-component-props.addonAfter': {
60
+ type: string;
61
+ title: string;
62
+ 'x-decorator': string;
63
+ 'x-component': string;
64
+ };
49
65
  'uiSchema.title': {
50
66
  type: string;
51
67
  title: string;
@@ -83,7 +83,16 @@ class NumberFieldInterface extends __WEBPACK_EXTERNAL_MODULE__data_source_collec
83
83
  step: '1'
84
84
  }
85
85
  }
86
- }), _define_property(this, "availableTypes", [
86
+ }), _define_property(this, "componentOptions", [
87
+ {
88
+ label: '{{t("InputNumber")}}',
89
+ value: 'InputNumber'
90
+ },
91
+ {
92
+ label: '{{t("Slider")}}',
93
+ value: 'Slider'
94
+ }
95
+ ]), _define_property(this, "availableTypes", [
87
96
  'double',
88
97
  'float',
89
98
  'decimal'
@@ -122,6 +131,18 @@ class NumberFieldInterface extends __WEBPACK_EXTERNAL_MODULE__data_source_collec
122
131
  label: '1.00000'
123
132
  }
124
133
  ]
134
+ },
135
+ 'uiSchema.x-component-props.addonBefore': {
136
+ type: 'string',
137
+ title: '{{t("Prefix")}}',
138
+ 'x-decorator': 'FormItem',
139
+ 'x-component': 'Input'
140
+ },
141
+ 'uiSchema.x-component-props.addonAfter': {
142
+ type: 'string',
143
+ title: '{{t("Suffix")}}',
144
+ 'x-decorator': 'FormItem',
145
+ 'x-component': 'Input'
125
146
  }
126
147
  }), _define_property(this, "filterable", {
127
148
  operators: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.operators.number
@@ -54,6 +54,18 @@ export declare class PercentFieldInterface extends CollectionFieldInterface {
54
54
  label: string;
55
55
  }[];
56
56
  };
57
+ 'uiSchema.x-component-props.addonBefore': {
58
+ type: string;
59
+ title: string;
60
+ 'x-decorator': string;
61
+ 'x-component': string;
62
+ };
63
+ 'uiSchema.x-component-props.addonAfter': {
64
+ type: string;
65
+ title: string;
66
+ 'x-decorator': string;
67
+ 'x-component': string;
68
+ };
57
69
  'uiSchema.title': {
58
70
  type: string;
59
71
  title: string;
@@ -98,6 +98,18 @@ class PercentFieldInterface extends __WEBPACK_EXTERNAL_MODULE__data_source_colle
98
98
  label: '1.00000%'
99
99
  }
100
100
  ]
101
+ },
102
+ 'uiSchema.x-component-props.addonBefore': {
103
+ type: 'string',
104
+ title: '{{t("Prefix")}}',
105
+ 'x-decorator': 'FormItem',
106
+ 'x-component': 'Input'
107
+ },
108
+ 'uiSchema.x-component-props.addonAfter': {
109
+ type: 'string',
110
+ title: '{{t("Suffix")}}',
111
+ 'x-decorator': 'FormItem',
112
+ 'x-component': 'Input'
101
113
  }
102
114
  }), _define_property(this, "filterable", {
103
115
  operators: __WEBPACK_EXTERNAL_MODULE__properties_index_mjs__.operators.number
@@ -0,0 +1,3 @@
1
+ import { Schema } from '@tachybase/schema';
2
+ export declare const findKanbanFormItem: (schema: Schema, key: string, action: string) => any;
3
+ export declare const CollectionFieldsToFormInitializerItems: (props: any) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__ from "../../schema-initializer/utils.mjs";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__CollectionFieldsToInitializerItems_mjs__ from "./CollectionFieldsToInitializerItems.mjs";
4
+ const findKanbanFormItem = (schema, key, action)=>{
5
+ const s = (0, __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__.findSchema)(schema, 'x-component', 'Kanban');
6
+ return (0, __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__.findSchema)(s, key, action);
7
+ };
8
+ const CollectionFieldsToFormInitializerItems = (props)=>{
9
+ const block = (null == props ? void 0 : props.block) || 'Form';
10
+ const fieldItemSchema = {
11
+ 'x-toolbar': 'FormItemSchemaToolbar',
12
+ 'x-settings': 'fieldSettings:FormItem',
13
+ 'x-decorator': 'FormItem'
14
+ };
15
+ const initializerItem = {
16
+ remove: __WEBPACK_EXTERNAL_MODULE__schema_initializer_utils_mjs__.removeGridFormItem
17
+ };
18
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__CollectionFieldsToInitializerItems_mjs__.CollectionFieldsToInitializerItems, {
19
+ block: block,
20
+ selfField: {
21
+ filter: (field)=>!field.treeChildren,
22
+ getSchema: (field, param)=>{
23
+ let { targetCollection } = param;
24
+ var _field_uiSchema_xcomponentprops, _field_uiSchema;
25
+ const isFileCollection = (null == targetCollection ? void 0 : targetCollection.template) === 'file';
26
+ const isAssociationField = targetCollection;
27
+ const fieldNames = null == field ? void 0 : null === (_field_uiSchema = field.uiSchema) || void 0 === _field_uiSchema ? void 0 : null === (_field_uiSchema_xcomponentprops = _field_uiSchema['x-component-props']) || void 0 === _field_uiSchema_xcomponentprops ? void 0 : _field_uiSchema_xcomponentprops['fieldNames'];
28
+ return {
29
+ ...fieldItemSchema,
30
+ 'x-component-props': isFileCollection ? {
31
+ fieldNames: {
32
+ label: 'preview',
33
+ value: 'id'
34
+ }
35
+ } : isAssociationField && fieldNames ? {
36
+ fieldNames: {
37
+ ...fieldNames,
38
+ label: (null == targetCollection ? void 0 : targetCollection.titleField) || fieldNames.label
39
+ }
40
+ } : {}
41
+ };
42
+ },
43
+ getInitializerItem: ()=>({
44
+ ...initializerItem,
45
+ find: (null == props ? void 0 : props.block) === 'Kanban' ? findKanbanFormItem : void 0
46
+ })
47
+ },
48
+ parentField: {
49
+ getSchema: ()=>fieldItemSchema,
50
+ getInitializerItem: ()=>initializerItem
51
+ },
52
+ associationField: {
53
+ filterSelfField: (field)=>{
54
+ if ('Form' !== block) return true;
55
+ return (null == field ? void 0 : field.interface) === 'm2o';
56
+ },
57
+ filterAssociationField (collectionField) {
58
+ return (null == collectionField ? void 0 : collectionField.interface) && ![
59
+ 'subTable'
60
+ ].includes(null == collectionField ? void 0 : collectionField.interface) && !collectionField.treeChildren;
61
+ },
62
+ getSchema: ()=>fieldItemSchema,
63
+ getInitializerItem: ()=>initializerItem
64
+ }
65
+ });
66
+ };
67
+ export { CollectionFieldsToFormInitializerItems, findKanbanFormItem };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { CollectionFieldsProps } from './utils';
3
+ export declare const CollectionFieldsToInitializerItems: FC<CollectionFieldsProps>;
@@ -0,0 +1,37 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__items_index_mjs__ from "./items/index.mjs";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_index_mjs__ from "./utils/index.mjs";
4
+ const CollectionFieldsToInitializerItems = (props)=>{
5
+ const { selfField, parentField, associationField, block } = props;
6
+ const context = (0, __WEBPACK_EXTERNAL_MODULE__utils_index_mjs__.useCollectionFieldContext)();
7
+ if (!context.collection) return null;
8
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsxs)(__WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.Fragment, {
9
+ children: [
10
+ /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__items_index_mjs__.SelfFields, {
11
+ block: block,
12
+ ...selfField,
13
+ context: {
14
+ ...context,
15
+ collection: context.collection
16
+ }
17
+ }),
18
+ parentField && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__items_index_mjs__.ParentCollectionFields, {
19
+ block: block,
20
+ ...parentField,
21
+ context: {
22
+ ...context,
23
+ collection: context.collection
24
+ }
25
+ }),
26
+ associationField && /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__items_index_mjs__.AssociationCollectionFields, {
27
+ block: block,
28
+ ...associationField,
29
+ context: {
30
+ ...context,
31
+ collection: context.collection
32
+ }
33
+ })
34
+ ]
35
+ });
36
+ };
37
+ export { CollectionFieldsToInitializerItems };
@@ -0,0 +1 @@
1
+ export * from './CollectionFieldsToFormInitializerItems';
@@ -0,0 +1 @@
1
+ export * from "./CollectionFieldsToFormInitializerItems.mjs";
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { AssociationCollectionFieldsProps } from '../utils';
3
+ export declare const AssociationCollectionFields: FC<AssociationCollectionFieldsProps>;
@@ -0,0 +1,59 @@
1
+ import * as __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__ from "react/jsx-runtime";
2
+ import * as __WEBPACK_EXTERNAL_MODULE__application_schema_initializer_index_mjs__ from "../../../application/schema-initializer/index.mjs";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__utils_index_mjs__ from "../utils/index.mjs";
4
+ const AssociationCollectionFields = (props)=>{
5
+ const { filterAssociationField, filterSelfField = ()=>true, getSchema, ...otherProps } = props;
6
+ const { collection, t, collectionManager } = props.context;
7
+ const fields = collection.getFields();
8
+ const associationInterfaces = [
9
+ 'o2o',
10
+ 'oho',
11
+ 'obo',
12
+ 'm2o'
13
+ ];
14
+ const associationFields = fields.filter((field)=>associationInterfaces.includes(field.interface)).filter((field)=>filterSelfField(field, props.context));
15
+ if (!associationFields.length) return null;
16
+ const children = associationFields.map((associationField)=>{
17
+ const associationCollection = collectionManager.getCollection(associationField.target);
18
+ if (!associationCollection) return null;
19
+ const associationCollectionFields = null == associationCollection ? void 0 : associationCollection.getAllFields();
20
+ if (!associationCollectionFields.length) return null;
21
+ return {
22
+ associationField,
23
+ associationCollection,
24
+ associationCollectionFields
25
+ };
26
+ }).filter(Boolean).map((param)=>{
27
+ let { associationField, associationCollection, associationCollectionFields } = param;
28
+ var _associationField_uiSchema, _associationField_uiSchema1;
29
+ const newContext = {
30
+ ...props.context,
31
+ collection: associationCollection
32
+ };
33
+ const getAssociationFieldSchema = (field, context)=>{
34
+ const schema = getSchema(field, context);
35
+ return {
36
+ ...schema || {},
37
+ 'x-read-pretty': true,
38
+ name: "".concat(associationField.name, ".").concat(field.name),
39
+ 'x-collection-field': "".concat(collection.name, ".").concat(associationField.name, ".").concat(field.name)
40
+ };
41
+ };
42
+ return {
43
+ type: 'subMenu',
44
+ name: null === (_associationField_uiSchema = associationField.uiSchema) || void 0 === _associationField_uiSchema ? void 0 : _associationField_uiSchema.title,
45
+ title: null === (_associationField_uiSchema1 = associationField.uiSchema) || void 0 === _associationField_uiSchema1 ? void 0 : _associationField_uiSchema1.title,
46
+ children: (0, __WEBPACK_EXTERNAL_MODULE__utils_index_mjs__.getInitializerItemsByFields)({
47
+ ...otherProps,
48
+ filter: filterAssociationField,
49
+ getSchema: getAssociationFieldSchema
50
+ }, associationCollectionFields, newContext)
51
+ };
52
+ });
53
+ if (!children.length) return null;
54
+ return /*#__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_react_jsx_runtime__.jsx)(__WEBPACK_EXTERNAL_MODULE__application_schema_initializer_index_mjs__.SchemaInitializerItemGroup, {
55
+ title: t('Display association fields'),
56
+ children: children
57
+ });
58
+ };
59
+ export { AssociationCollectionFields };
@@ -0,0 +1,3 @@
1
+ import { FC } from 'react';
2
+ import { ParentCollectionFieldsProps } from '../utils';
3
+ export declare const ParentCollectionFields: FC<ParentCollectionFieldsProps>;