devject-design 0.1.1 → 0.2.1
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 +482 -127
- package/dist/core/builtin/advanced.d.ts +1 -0
- package/dist/core/builtin/basics.d.ts +1 -0
- package/dist/core/builtin/containers.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 +9 -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 +11899 -2785
- package/dist/index.umd.js +39 -1
- package/dist/pages/FormDesigner.d.ts +16 -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 +7 -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 +10 -0
- package/dist/ui/editors/TabsEditor.d.ts +5 -0
- package/dist/ui/hooks/useValidator.d.ts +4 -0
- package/dist/ui/preview/FormRenderer.d.ts +15 -2
- package/dist/ui/state/designerState.d.ts +30 -1405
- 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 +1 -3
- package/dist/ui/state/types.d.ts +29 -92
- package/dist/ui/state/useDragLogic.d.ts +10 -0
- package/dist/ui/state/useHotkeys.d.ts +4 -0
- package/dist/ui/state/validator.d.ts +36 -0
- package/package.json +7 -2
- package/dist/ui/state/history.d.ts +0 -8413
|
@@ -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 './ui/hooks/useValidator';
|
|
11
|
+
declare const _default: Plugin;
|
|
12
|
+
export default _default;
|