devject-design 0.1.2 → 0.2.2
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/README.md +484 -162
- package/dist/core/builtin/components/checkbox.d.ts +1 -0
- package/dist/core/builtin/components/collapse.d.ts +1 -0
- package/dist/core/builtin/components/fileUpload.d.ts +1 -0
- package/dist/core/builtin/components/flexRow.d.ts +1 -0
- package/dist/core/builtin/components/imageUpload.d.ts +1 -0
- package/dist/core/builtin/components/input.d.ts +1 -0
- package/dist/core/builtin/components/radio.d.ts +1 -0
- package/dist/core/builtin/components/select.d.ts +1 -0
- package/dist/core/builtin/components/staticTable.d.ts +1 -0
- package/dist/core/builtin/components/switch.d.ts +1 -0
- package/dist/core/builtin/components/table.d.ts +1 -0
- package/dist/core/builtin/components/tabs.d.ts +1 -0
- package/dist/core/builtin/components/textarea.d.ts +1 -0
- package/dist/core/builtin/components/title.d.ts +1 -0
- package/dist/core/builtin/components/tree.d.ts +1 -0
- package/dist/core/builtin/editors.d.ts +1 -0
- package/dist/core/builtin/index.d.ts +1 -0
- package/dist/core/builtin/utils.d.ts +13 -0
- package/dist/core/editors.d.ts +17 -0
- package/dist/core/registry.d.ts +38 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.es.js +11940 -2586
- package/dist/index.umd.js +39 -1
- package/dist/pages/FormDesigner.d.ts +28 -1
- package/dist/style.css +1 -1
- package/dist/ui/PaletteItem.d.ts +2 -0
- package/dist/ui/PreviewDialog.d.ts +42 -1
- package/dist/ui/components/Checkbox.d.ts +11 -0
- package/dist/ui/components/Collapse.d.ts +11 -0
- package/dist/ui/components/FileUpload.d.ts +11 -0
- package/dist/ui/components/FlexRow.d.ts +11 -0
- package/dist/ui/components/ImageUpload.d.ts +11 -0
- package/dist/ui/components/Input.d.ts +11 -0
- package/dist/ui/components/Radio.d.ts +11 -0
- package/dist/ui/components/Select.d.ts +11 -0
- package/dist/ui/components/StaticTable.d.ts +7 -0
- package/dist/ui/components/Switch.d.ts +11 -0
- package/dist/ui/components/Table.d.ts +11 -0
- package/dist/ui/components/Tabs.d.ts +11 -0
- package/dist/ui/components/Textarea.d.ts +11 -0
- package/dist/ui/components/Title.d.ts +7 -0
- package/dist/ui/components/Tree.d.ts +13 -0
- package/dist/ui/designer/DesignerDialogs.d.ts +9 -0
- package/dist/ui/designer/DesignerToolbar.d.ts +10 -0
- package/dist/ui/editors/CollapseEditor.d.ts +5 -0
- package/dist/ui/editors/ExcelIOEditor.d.ts +5 -0
- package/dist/ui/editors/FlexLayoutEditor.d.ts +5 -0
- package/dist/ui/editors/JsonDataEditor.d.ts +9 -0
- package/dist/ui/editors/OptionsEditor.d.ts +9 -0
- package/dist/ui/editors/TableColumnsEditor.d.ts +12 -0
- package/dist/ui/editors/TabsEditor.d.ts +5 -0
- package/dist/ui/node-renderers/CollapseRenderer.d.ts +6 -0
- package/dist/ui/node-renderers/FieldRenderer.d.ts +6 -0
- package/dist/ui/node-renderers/FlexRowRenderer.d.ts +6 -0
- package/dist/ui/node-renderers/StaticTableRenderer.d.ts +6 -0
- package/dist/ui/node-renderers/TableRenderer.d.ts +6 -0
- package/dist/ui/node-renderers/TabsRenderer.d.ts +6 -0
- package/dist/ui/preview/FormRenderer.d.ts +15 -2
- package/dist/ui/state/designerState.d.ts +35 -1410
- package/dist/ui/state/dragState.d.ts +11 -6
- package/dist/ui/state/injectionKeys.d.ts +4 -0
- package/dist/ui/state/schemaOps.d.ts +2 -3
- package/dist/ui/state/types.d.ts +29 -92
- package/dist/ui/state/useDragLogic.d.ts +11 -0
- package/dist/ui/state/useHotkeys.d.ts +4 -0
- package/dist/ui/state/validator.d.ts +45 -0
- package/package.json +7 -2
- package/dist/ui/state/history.d.ts +0 -8413
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerTabs(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerTextarea(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerTitle(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerTree(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerBuiltinEditors(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerBuiltins(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { FormItemRule } from 'element-plus';
|
|
3
|
+
import { PropConfigItem } from '../registry';
|
|
4
|
+
import { SchemaNode, FormDataModel } from '../../ui/state/types';
|
|
5
|
+
export declare function commonFieldConfig(includePlaceholder?: boolean): PropConfigItem[];
|
|
6
|
+
export declare const commonDefault: (label: string, fieldPrefix: string) => {
|
|
7
|
+
label: string;
|
|
8
|
+
field: string;
|
|
9
|
+
placeholder: string;
|
|
10
|
+
required: boolean;
|
|
11
|
+
labelWidth: number;
|
|
12
|
+
};
|
|
13
|
+
export declare function useValidator(nodeSource: SchemaNode | (() => SchemaNode), formData: Ref<FormDataModel>): import('vue').ComputedRef<FormItemRule[]>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Register a custom property editor component.
|
|
4
|
+
* @param name The unique name of the editor (e.g., 'options-editor').
|
|
5
|
+
* @param component The Vue component for the editor.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerEditor(name: string, component: Component): void;
|
|
8
|
+
/**
|
|
9
|
+
* Retrieve a registered property editor component by name.
|
|
10
|
+
* @param name The name of the editor to retrieve.
|
|
11
|
+
* @returns The editor component, or undefined if not found.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getEditor(name: string): Component | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Get all registered editors (useful for debugging or listing).
|
|
16
|
+
*/
|
|
17
|
+
export declare function getAllEditors(): Map<string, Component>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Component } from 'vue';
|
|
2
|
+
import { SchemaNode } from '../ui/state/types';
|
|
3
|
+
export interface PropConfigItem {
|
|
4
|
+
label: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: 'input' | 'number' | 'switch' | 'select' | 'color' | 'custom';
|
|
7
|
+
editor?: string;
|
|
8
|
+
props?: Record<string, any>;
|
|
9
|
+
options?: {
|
|
10
|
+
label: string;
|
|
11
|
+
value: any;
|
|
12
|
+
}[];
|
|
13
|
+
}
|
|
14
|
+
export interface DataProcessor {
|
|
15
|
+
export?: (value: any) => any;
|
|
16
|
+
import?: (value: any) => any;
|
|
17
|
+
}
|
|
18
|
+
export interface ComponentDefinition {
|
|
19
|
+
type: string;
|
|
20
|
+
component: Component;
|
|
21
|
+
palette: {
|
|
22
|
+
label: string;
|
|
23
|
+
group: string;
|
|
24
|
+
icon?: string | Component;
|
|
25
|
+
};
|
|
26
|
+
defaultProps: (id: string) => SchemaNode;
|
|
27
|
+
propsConfig?: PropConfigItem[];
|
|
28
|
+
dataProcessor?: DataProcessor;
|
|
29
|
+
validate?: (value: any, node: SchemaNode, formData: any) => string | boolean | Promise<string | boolean>;
|
|
30
|
+
}
|
|
31
|
+
export declare function registerComponent(def: ComponentDefinition): void;
|
|
32
|
+
export declare function getComponentDef(type: string): ComponentDefinition | undefined;
|
|
33
|
+
export declare function getAllComponentDefs(): ComponentDefinition[];
|
|
34
|
+
export declare function getPaletteGroups(): Record<string, {
|
|
35
|
+
label: string;
|
|
36
|
+
items: ComponentDefinition[];
|
|
37
|
+
}>;
|
|
38
|
+
export declare function getNodeDefaults(type: string, id: string): SchemaNode;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
import { App, Plugin } from 'vue';
|
|
1
2
|
import { default as FormDesigner } from './pages/FormDesigner';
|
|
2
3
|
import { default as FormRenderer } from './ui/preview/FormRenderer';
|
|
3
|
-
|
|
4
|
+
declare const install: (app: App) => void;
|
|
5
|
+
export { FormDesigner, FormRenderer, install };
|
|
4
6
|
export * from './ui/state/types';
|
|
7
|
+
export { registerComponent } from './core/registry';
|
|
8
|
+
export type { ComponentDefinition, DataProcessor } from './core/registry';
|
|
9
|
+
export { registerEditor, getEditor } from './core/editors';
|
|
10
|
+
export { useValidator } from './core/builtin/utils';
|
|
11
|
+
declare const _default: Plugin;
|
|
12
|
+
export default _default;
|