@tachybase/plugin-form-design 1.3.22

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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +1 -0
  3. package/client.d.ts +2 -0
  4. package/client.js +1 -0
  5. package/dist/client/constants.d.ts +3 -0
  6. package/dist/client/contexts/EditableSchemaSettingsContext.d.ts +7 -0
  7. package/dist/client/editable-schema-settings/EditableSchemaSettings.d.ts +10 -0
  8. package/dist/client/editable-schema-settings/EditableSchemaSettingsManager.d.ts +23 -0
  9. package/dist/client/editable-schema-settings/index.d.ts +3 -0
  10. package/dist/client/editable-schema-settings/types.d.ts +24 -0
  11. package/dist/client/fields/components/cascadeSelectComponentFieldEditableSettings.d.ts +2 -0
  12. package/dist/client/fields/components/cascaderComponentFieldEditableSettings.d.ts +2 -0
  13. package/dist/client/fields/components/checkboxComponentFieldEditableSettings.d.ts +2 -0
  14. package/dist/client/fields/components/customTitleComponentFieldEditableSettings.d.ts +2 -0
  15. package/dist/client/fields/components/datePickerComponentFieldEditableSettings.d.ts +2 -0
  16. package/dist/client/fields/components/drawerSubTableComponentFieldEditableSettings.d.ts +2 -0
  17. package/dist/client/fields/components/fileManagerComponentFieldEditableSettings.d.ts +2 -0
  18. package/dist/client/fields/components/index.d.ts +15 -0
  19. package/dist/client/fields/components/inputNumberComponentFieldEditableSettings.d.ts +2 -0
  20. package/dist/client/fields/components/radioComponentFieldEditableSettings.d.ts +2 -0
  21. package/dist/client/fields/components/recordPickerComponentFieldEditableSettings.d.ts +2 -0
  22. package/dist/client/fields/components/selectComponentFieldEditableSettings.d.ts +2 -0
  23. package/dist/client/fields/components/subTablePopoverComponentFieldEditableSettings.d.ts +2 -0
  24. package/dist/client/fields/components/subformComponentFieldEditableSettings.d.ts +2 -0
  25. package/dist/client/fields/components/subformPopoverComponentFieldEditableSettings.d.ts +2 -0
  26. package/dist/client/fields/components/tagComponentFieldEditableSettings.d.ts +2 -0
  27. package/dist/client/fields/components/unixTimestampComponentFieldEditableSettings.d.ts +2 -0
  28. package/dist/client/fields/components/uploadAttachmentComponentFieldEditableSettings.d.ts +2 -0
  29. package/dist/client/icons/AddFields.d.ts +1 -0
  30. package/dist/client/icons/index.d.ts +1 -0
  31. package/dist/client/index.d.ts +1 -0
  32. package/dist/client/index.js +194 -0
  33. package/dist/client/initializers/EditableDataBlockInitializer.d.ts +2 -0
  34. package/dist/client/initializers/EditableFormBlockInitialzer.d.ts +152 -0
  35. package/dist/client/initializers/FormDesignModalProvider.d.ts +3 -0
  36. package/dist/client/initializers/components/form-editor/EditableDesignable.d.ts +94 -0
  37. package/dist/client/initializers/components/form-editor/EditableDndContext.d.ts +2 -0
  38. package/dist/client/initializers/components/form-editor/EditableFormItemSchemaToolbar.d.ts +4 -0
  39. package/dist/client/initializers/components/form-editor/EditableFormSchemaToolbar.d.ts +1 -0
  40. package/dist/client/initializers/components/form-editor/EditableGrid.d.ts +1 -0
  41. package/dist/client/initializers/components/form-editor/EditableGrid.style.d.ts +4 -0
  42. package/dist/client/initializers/components/form-editor/EditableSelectedFieldContext.d.ts +19 -0
  43. package/dist/client/initializers/components/form-editor/EditableSelectedFormContent.d.ts +19 -0
  44. package/dist/client/initializers/components/form-editor/EditorContent.d.ts +6 -0
  45. package/dist/client/initializers/components/form-editor/EditorFieldFormProperty.d.ts +5 -0
  46. package/dist/client/initializers/components/form-editor/EditorFieldsSider.d.ts +5 -0
  47. package/dist/client/initializers/components/form-editor/EditorHeader.d.ts +4 -0
  48. package/dist/client/initializers/components/form-editor/FormSchemaEditor.d.ts +15 -0
  49. package/dist/client/initializers/components/form-editor/createFormBlockEditableSettings.d.ts +2 -0
  50. package/dist/client/initializers/components/form-editor/fieldsInterfaceEditableSettings.d.ts +3 -0
  51. package/dist/client/initializers/components/form-editor/formItemFieldEditableSettings.d.ts +18 -0
  52. package/dist/client/initializers/components/form-editor/index.d.ts +4 -0
  53. package/dist/client/initializers/components/form-editor/interfaceSchemaOptions.d.ts +2153 -0
  54. package/dist/client/initializers/components/form-editor/styles.d.ts +61 -0
  55. package/dist/client/initializers/components/schemaSetting/openFormEditablePage.d.ts +1 -0
  56. package/dist/client/initializers/constants/systemFields.d.ts +59 -0
  57. package/dist/client/initializers/contexts/FormDesign.d.ts +8 -0
  58. package/dist/client/initializers/contexts/PageRefresh.d.ts +4 -0
  59. package/dist/client/initializers/contexts/PageRefreshContext.d.ts +10 -0
  60. package/dist/client/initializers/formDesignInitializerItem.d.ts +2 -0
  61. package/dist/client/locale.d.ts +5 -0
  62. package/dist/client/plugin.d.ts +10 -0
  63. package/dist/client/schema-settings/openEditablePage.d.ts +7 -0
  64. package/dist/externalVersion.js +13 -0
  65. package/dist/index.d.ts +2 -0
  66. package/dist/index.js +39 -0
  67. package/dist/locale/en-US.json +13 -0
  68. package/dist/locale/zh-CN.json +13 -0
  69. package/dist/server/index.d.ts +1 -0
  70. package/dist/server/index.js +33 -0
  71. package/dist/server/plugin.d.ts +11 -0
  72. package/dist/server/plugin.js +45 -0
  73. package/package.json +25 -0
  74. package/server.d.ts +2 -0
  75. package/server.js +1 -0
@@ -0,0 +1,61 @@
1
+ export declare const useStyles: (props?: unknown) => import("antd-style").ReturnStyles<{
2
+ editModel: import("antd-style").SerializedStyles;
3
+ header: import("antd-style").SerializedStyles;
4
+ fieldsBlock: import("antd-style").SerializedStyles;
5
+ previewDrawer: import("antd-style").SerializedStyles;
6
+ toolbar: {
7
+ position: "absolute";
8
+ zIndex: number;
9
+ display: "none";
10
+ top: number;
11
+ left: number;
12
+ right: number;
13
+ bottom: number;
14
+ border: string;
15
+ background: string;
16
+ pointerEvents: "none";
17
+ '.ant-space-item .anticon': {
18
+ margin: number;
19
+ };
20
+ };
21
+ toolbarTitle: {
22
+ pointerEvents: "none";
23
+ position: "absolute";
24
+ fontSize: number;
25
+ padding: number;
26
+ lineHeight: string;
27
+ height: string;
28
+ borderBottomRightRadius: number;
29
+ borderRadius: number;
30
+ top: number;
31
+ left: number;
32
+ };
33
+ toolbarTitleTag: {
34
+ padding: string;
35
+ borderRadius: number;
36
+ background: string;
37
+ color: "#fff";
38
+ display: "block";
39
+ };
40
+ toolbarIcons: {
41
+ position: "absolute";
42
+ right: string;
43
+ top: string;
44
+ lineHeight: string;
45
+ pointerEvents: "all";
46
+ alignItems: "center";
47
+ borderRadius: string;
48
+ boxShadow: "0 1px 3px rgba(0, 0, 0, 0.05)";
49
+ backgroundColor: "rgba(255,255,255,0.8);";
50
+ padding: string;
51
+ '.ant-space-item': {
52
+ color: "rgba(30, 30, 30, 0.8)";
53
+ lineHeight: string;
54
+ width: string;
55
+ paddingLeft: string;
56
+ alignSelf: "stretch";
57
+ };
58
+ };
59
+ titleCss: import("antd-style").SerializedStyles;
60
+ overrideAntdCSS: import("antd-style").SerializedStyles;
61
+ }>;
@@ -0,0 +1 @@
1
+ export declare const SchemaSettingsEditablePage: (props: any) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,59 @@
1
+ export declare const systemFields: ({
2
+ name: string;
3
+ type: string;
4
+ autoIncrement: boolean;
5
+ primaryKey: boolean;
6
+ allowNull: boolean;
7
+ uiSchema: {
8
+ type: string;
9
+ title: string;
10
+ 'x-component': string;
11
+ 'x-read-pretty': boolean;
12
+ 'x-component-props'?: undefined;
13
+ };
14
+ interface: string;
15
+ field?: undefined;
16
+ target?: undefined;
17
+ foreignKey?: undefined;
18
+ } | {
19
+ name: string;
20
+ interface: string;
21
+ type: string;
22
+ field: string;
23
+ uiSchema: {
24
+ type: string;
25
+ title: string;
26
+ 'x-component': string;
27
+ 'x-component-props': {
28
+ fieldNames?: undefined;
29
+ };
30
+ 'x-read-pretty': boolean;
31
+ };
32
+ autoIncrement?: undefined;
33
+ primaryKey?: undefined;
34
+ allowNull?: undefined;
35
+ target?: undefined;
36
+ foreignKey?: undefined;
37
+ } | {
38
+ name: string;
39
+ interface: string;
40
+ type: string;
41
+ target: string;
42
+ foreignKey: string;
43
+ uiSchema: {
44
+ type: string;
45
+ title: string;
46
+ 'x-component': string;
47
+ 'x-component-props': {
48
+ fieldNames: {
49
+ value: string;
50
+ label: string;
51
+ };
52
+ };
53
+ 'x-read-pretty': boolean;
54
+ };
55
+ autoIncrement?: undefined;
56
+ primaryKey?: undefined;
57
+ allowNull?: undefined;
58
+ field?: undefined;
59
+ })[];
@@ -0,0 +1,8 @@
1
+ export declare const ProviderContextFormDesign: import("react").Provider<{
2
+ visible: boolean;
3
+ setVisible: (visible: boolean) => void;
4
+ }>;
5
+ export declare const useContextFormDesign: () => {
6
+ visible: boolean;
7
+ setVisible: (visible: boolean) => void;
8
+ };
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const WithPageRefresh: ({ children }: {
3
+ children: React.ReactNode;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ interface PageRefreshContextType {
3
+ refreshKey: string;
4
+ refresh: () => void;
5
+ }
6
+ export declare const PageRefreshProvider: ({ children }: {
7
+ children: ReactNode;
8
+ }) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const usePageRefresh: () => PageRefreshContextType;
10
+ export {};
@@ -0,0 +1,2 @@
1
+ import { SchemaInitializerItemType } from '@tachybase/client';
2
+ export declare const formDesignInitializerItem: SchemaInitializerItemType;
@@ -0,0 +1,5 @@
1
+ export declare function useTranslation(): import("react-i18next").UseTranslationResponse<[string, string], undefined>;
2
+ export declare function lang(key: string, options?: {}): string;
3
+ export declare const tval: (key: string, options?: {
4
+ ns: string;
5
+ }) => string;
@@ -0,0 +1,10 @@
1
+ import { Plugin } from '@tachybase/client';
2
+ import { EditableSchemaSettingsManager } from './editable-schema-settings';
3
+ declare class PluginFormDesignClient extends Plugin {
4
+ private editableSchemaSettingsManager;
5
+ afterAdd(): Promise<void>;
6
+ beforeLoad(): Promise<void>;
7
+ load(): Promise<void>;
8
+ getEditableSchemaSettingsManager(): EditableSchemaSettingsManager;
9
+ }
10
+ export default PluginFormDesignClient;
@@ -0,0 +1,7 @@
1
+ export declare const openEditablePage: {
2
+ name: string;
3
+ Component: string;
4
+ useComponentProps(): {
5
+ collectionName: string;
6
+ };
7
+ };
@@ -0,0 +1,13 @@
1
+ module.exports = {
2
+ "@tachybase/client": "1.3.23",
3
+ "@tego/server": "1.3.43",
4
+ "react": "18.3.1",
5
+ "@tachybase/schema": "1.3.43",
6
+ "@ant-design/icons": "5.6.1",
7
+ "lodash": "4.17.21",
8
+ "react-dom": "18.3.1",
9
+ "antd-style": "3.7.1",
10
+ "antd": "5.22.5",
11
+ "@tego/client": "1.3.43",
12
+ "@dnd-kit/core": "6.3.1"
13
+ };
@@ -0,0 +1,2 @@
1
+ export * from './server';
2
+ export { default } from './server';
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
+ default: () => import_server.default
32
+ });
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
+ var import_server = __toESM(require("./server"));
36
+ // Annotate the CommonJS export names for ESM import in node:
37
+ 0 && (module.exports = {
38
+ ...require("./server")
39
+ });
@@ -0,0 +1,13 @@
1
+ {
2
+ "Caution: Changing this will directly modify the collection name": "Caution: Changing this will directly modify the collection name",
3
+ "Click a field to start customizing its properties": "Click a field to start customizing its properties",
4
+ "Design the form by selecting fields, adjusting layout, and adding properties": "Design the form by selecting fields, adjusting layout, and adding properties",
5
+ "Field properties": "Field properties",
6
+ "Form design": "Form design",
7
+ "Form properties": "Form properties",
8
+ "Open editable page": "Open editable page",
9
+ "Other fields": "Other fields",
10
+ "Set default properties": "Set default properties",
11
+ "The target collection for the association field \"{{field}}\" is not selected": "The target collection for the association field \"{{field}}\" is not selected",
12
+ "Untitle collection": "Untitle collection"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "Caution: Changing this will directly modify the collection name": "警告:这将永久修改集合名称。",
3
+ "Click a field to start customizing its properties": "点击任意字段开始编辑其属性。",
4
+ "Design the form by selecting fields, adjusting layout, and adding properties": "通过选择字段、设置布局并添加属性来设计表单。",
5
+ "Field properties": "字段设置",
6
+ "Form design": "表单设计器",
7
+ "Form properties": "表单设置",
8
+ "Open editable page": "打开可编辑页面",
9
+ "Other fields": "其他字段",
10
+ "Set default properties": "设置默认字段值",
11
+ "The target collection for the association field \"{{field}}\" is not selected": "请为关联字段 \"{{field}}\" 选择目标集合。",
12
+ "Untitle collection": "未命名集合"
13
+ }
@@ -0,0 +1 @@
1
+ export { default } from './plugin';
@@ -0,0 +1,33 @@
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
+ var server_exports = {};
29
+ __export(server_exports, {
30
+ default: () => import_plugin.default
31
+ });
32
+ module.exports = __toCommonJS(server_exports);
33
+ var import_plugin = __toESM(require("./plugin"));
@@ -0,0 +1,11 @@
1
+ import { Plugin } from '@tego/server';
2
+ export declare class PluginFormDesignServer extends Plugin {
3
+ afterAdd(): Promise<void>;
4
+ beforeLoad(): Promise<void>;
5
+ load(): Promise<void>;
6
+ install(): Promise<void>;
7
+ afterEnable(): Promise<void>;
8
+ afterDisable(): Promise<void>;
9
+ remove(): Promise<void>;
10
+ }
11
+ export default PluginFormDesignServer;
@@ -0,0 +1,45 @@
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
+ var plugin_exports = {};
19
+ __export(plugin_exports, {
20
+ PluginFormDesignServer: () => PluginFormDesignServer,
21
+ default: () => plugin_default
22
+ });
23
+ module.exports = __toCommonJS(plugin_exports);
24
+ var import_server = require("@tego/server");
25
+ class PluginFormDesignServer extends import_server.Plugin {
26
+ async afterAdd() {
27
+ }
28
+ async beforeLoad() {
29
+ }
30
+ async load() {
31
+ }
32
+ async install() {
33
+ }
34
+ async afterEnable() {
35
+ }
36
+ async afterDisable() {
37
+ }
38
+ async remove() {
39
+ }
40
+ }
41
+ var plugin_default = PluginFormDesignServer;
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ PluginFormDesignServer
45
+ });
package/package.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@tachybase/plugin-form-design",
3
+ "displayName": "Form Design",
4
+ "version": "1.3.22",
5
+ "description": "WYSIWYG Form Design Plugin",
6
+ "keywords": [
7
+ "Collections",
8
+ "Blocks"
9
+ ],
10
+ "main": "dist/server/index.js",
11
+ "devDependencies": {
12
+ "@ant-design/icons": "^5.6.1",
13
+ "@ctrl/tinycolor": "^3.6.1",
14
+ "@dnd-kit/core": "^6.3.1",
15
+ "@tachybase/schema": "^1.3.43",
16
+ "@tachybase/test": "^1.3.43",
17
+ "@tego/client": "^1.3.43",
18
+ "@tego/server": "^1.3.43",
19
+ "antd": "5.22.5",
20
+ "antd-style": "3.7.1",
21
+ "lodash": "^4.17.21",
22
+ "@tachybase/client": "1.3.23"
23
+ },
24
+ "description.zh-CN": "所见即所得的表单设计插件"
25
+ }
package/server.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/server';
2
+ export { default } from './dist/server';
package/server.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/server/index.js');