@framework-m/desk 0.4.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/LICENSE +202 -0
- package/README.md +153 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.d.ts.map +1 -0
- package/dist/authConfig.d.ts +42 -0
- package/dist/authConfig.d.ts.map +1 -0
- package/dist/components/CommandPalette.d.ts +49 -0
- package/dist/components/CommandPalette.d.ts.map +1 -0
- package/dist/components/breadcrumb/index.d.ts +2 -0
- package/dist/components/breadcrumb/index.d.ts.map +1 -0
- package/dist/components/feedback/AlertBanner.d.ts +8 -0
- package/dist/components/feedback/AlertBanner.d.ts.map +1 -0
- package/dist/components/feedback/ConfirmDialog.d.ts +13 -0
- package/dist/components/feedback/ConfirmDialog.d.ts.map +1 -0
- package/dist/components/feedback/index.d.ts +5 -0
- package/dist/components/feedback/index.d.ts.map +1 -0
- package/dist/components/form/AutoForm.d.ts +61 -0
- package/dist/components/form/AutoForm.d.ts.map +1 -0
- package/dist/components/form/LinkWidget.d.ts +20 -0
- package/dist/components/form/LinkWidget.d.ts.map +1 -0
- package/dist/components/form/index.d.ts +10 -0
- package/dist/components/form/index.d.ts.map +1 -0
- package/dist/components/form/templates.d.ts +58 -0
- package/dist/components/form/templates.d.ts.map +1 -0
- package/dist/components/layout/index.d.ts +3 -0
- package/dist/components/layout/index.d.ts.map +1 -0
- package/dist/components/menu/index.d.ts +2 -0
- package/dist/components/menu/index.d.ts.map +1 -0
- package/dist/components/table/AutoTable.d.ts +47 -0
- package/dist/components/table/AutoTable.d.ts.map +1 -0
- package/dist/components/table/BulkActionsBar.d.ts +40 -0
- package/dist/components/table/BulkActionsBar.d.ts.map +1 -0
- package/dist/components/table/EditableCell.d.ts +54 -0
- package/dist/components/table/EditableCell.d.ts.map +1 -0
- package/dist/components/table/index.d.ts +12 -0
- package/dist/components/table/index.d.ts.map +1 -0
- package/dist/components/workflow/StateBadge.d.ts +29 -0
- package/dist/components/workflow/StateBadge.d.ts.map +1 -0
- package/dist/components/workflow/WorkflowActions.d.ts +37 -0
- package/dist/components/workflow/WorkflowActions.d.ts.map +1 -0
- package/dist/components/workflow/index.d.ts +10 -0
- package/dist/components/workflow/index.d.ts.map +1 -0
- package/dist/config/i18n.d.ts +3 -0
- package/dist/config/i18n.d.ts.map +1 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/registry.d.ts +75 -0
- package/dist/config/registry.d.ts.map +1 -0
- package/dist/config/types.d.ts +130 -0
- package/dist/config/types.d.ts.map +1 -0
- package/dist/config/useConfig.d.ts +18 -0
- package/dist/config/useConfig.d.ts.map +1 -0
- package/dist/constants.d.ts +35 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/data.d.ts +6 -0
- package/dist/data.d.ts.map +1 -0
- package/dist/hooks/index.d.ts +21 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/types.d.ts +113 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/useBulkActions.d.ts +82 -0
- package/dist/hooks/useBulkActions.d.ts.map +1 -0
- package/dist/hooks/useCommandPalette.d.ts +33 -0
- package/dist/hooks/useCommandPalette.d.ts.map +1 -0
- package/dist/hooks/useDocTypeMeta.d.ts +48 -0
- package/dist/hooks/useDocTypeMeta.d.ts.map +1 -0
- package/dist/hooks/useDocTypes.d.ts +66 -0
- package/dist/hooks/useDocTypes.d.ts.map +1 -0
- package/dist/hooks/useInlineEdit.d.ts +64 -0
- package/dist/hooks/useInlineEdit.d.ts.map +1 -0
- package/dist/hooks/useTranslation.d.ts +36 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/hooks/useUIMeta.d.ts +111 -0
- package/dist/hooks/useUIMeta.d.ts.map +1 -0
- package/dist/hooks/useWorkflowActions.d.ts +75 -0
- package/dist/hooks/useWorkflowActions.d.ts.map +1 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5302 -0
- package/dist/index.js.map +1 -0
- package/dist/live.d.ts +21 -0
- package/dist/live.d.ts.map +1 -0
- package/dist/pages/FormView.d.ts +40 -0
- package/dist/pages/FormView.d.ts.map +1 -0
- package/dist/pages/ListView.d.ts +39 -0
- package/dist/pages/ListView.d.ts.map +1 -0
- package/dist/pages/LoginPage.d.ts +32 -0
- package/dist/pages/LoginPage.d.ts.map +1 -0
- package/dist/plugins/Slot.d.ts +27 -0
- package/dist/plugins/Slot.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +14 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/registry.d.ts +104 -0
- package/dist/plugins/registry.d.ts.map +1 -0
- package/dist/plugins/types.d.ts +130 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/types.d.ts +51 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/views/CalendarView.d.ts +14 -0
- package/dist/views/CalendarView.d.ts.map +1 -0
- package/dist/views/GanttView.d.ts +14 -0
- package/dist/views/GanttView.d.ts.map +1 -0
- package/dist/views/KanbanView.d.ts +16 -0
- package/dist/views/KanbanView.d.ts.map +1 -0
- package/dist/views/TreeView.d.ts +15 -0
- package/dist/views/TreeView.d.ts.map +1 -0
- package/dist/views/index.d.ts +17 -0
- package/dist/views/index.d.ts.map +1 -0
- package/dist/views/registry.d.ts +32 -0
- package/dist/views/registry.d.ts.map +1 -0
- package/dist/views/types.d.ts +97 -0
- package/dist/views/types.d.ts.map +1 -0
- package/dist/workspace/WorkspaceSection.d.ts +16 -0
- package/dist/workspace/WorkspaceSection.d.ts.map +1 -0
- package/dist/workspace/index.d.ts +12 -0
- package/dist/workspace/index.d.ts.map +1 -0
- package/dist/workspace/types.d.ts +95 -0
- package/dist/workspace/types.d.ts.map +1 -0
- package/dist/workspace/useWorkspaces.d.ts +38 -0
- package/dist/workspace/useWorkspaces.d.ts.map +1 -0
- package/package.json +89 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { FieldTemplateProps, ObjectFieldTemplateProps, ArrayFieldTemplateProps, BaseInputTemplateProps, WidgetProps } from '@rjsf/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Field Template - wraps each field with label and error
|
|
4
|
+
*/
|
|
5
|
+
export declare function FieldTemplate(props: FieldTemplateProps): import("react/jsx-runtime").JSX.Element | null;
|
|
6
|
+
/**
|
|
7
|
+
* Object Field Template - renders object properties
|
|
8
|
+
*/
|
|
9
|
+
export declare function ObjectFieldTemplate(props: ObjectFieldTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
/**
|
|
11
|
+
* Array Field Template - renders array items with add/remove
|
|
12
|
+
* Note: RJSF v6 items are ReactElements, not objects with properties
|
|
13
|
+
*/
|
|
14
|
+
export declare function ArrayFieldTemplate(props: ArrayFieldTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
/**
|
|
16
|
+
* Base Input Template - standard input wrapper
|
|
17
|
+
*/
|
|
18
|
+
export declare function BaseInputTemplate(props: BaseInputTemplateProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
/**
|
|
20
|
+
* Text Widget - for string fields
|
|
21
|
+
*/
|
|
22
|
+
export declare function TextWidget(props: WidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
/**
|
|
24
|
+
* Checkbox Widget - for boolean fields
|
|
25
|
+
*/
|
|
26
|
+
export declare function CheckboxWidget(props: WidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
/**
|
|
28
|
+
* Select Widget - for enum fields
|
|
29
|
+
*/
|
|
30
|
+
export declare function SelectWidget(props: WidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
31
|
+
/**
|
|
32
|
+
* Date Widget - for date fields
|
|
33
|
+
*/
|
|
34
|
+
export declare function DateWidget(props: WidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
35
|
+
/**
|
|
36
|
+
* Textarea Widget - for long text fields
|
|
37
|
+
*/
|
|
38
|
+
export declare function TextareaWidget(props: WidgetProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
/**
|
|
40
|
+
* Custom widgets registry
|
|
41
|
+
*/
|
|
42
|
+
export declare const customWidgets: {
|
|
43
|
+
TextWidget: typeof TextWidget;
|
|
44
|
+
CheckboxWidget: typeof CheckboxWidget;
|
|
45
|
+
SelectWidget: typeof SelectWidget;
|
|
46
|
+
DateWidget: typeof DateWidget;
|
|
47
|
+
TextareaWidget: typeof TextareaWidget;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Custom templates registry
|
|
51
|
+
*/
|
|
52
|
+
export declare const customTemplates: {
|
|
53
|
+
FieldTemplate: typeof FieldTemplate;
|
|
54
|
+
ObjectFieldTemplate: typeof ObjectFieldTemplate;
|
|
55
|
+
ArrayFieldTemplate: typeof ArrayFieldTemplate;
|
|
56
|
+
BaseInputTemplate: typeof BaseInputTemplate;
|
|
57
|
+
};
|
|
58
|
+
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/components/form/templates.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,wBAAwB,EACxB,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACZ,MAAM,aAAa,CAAC;AAyDrB;;GAEG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,kDAyFtD;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,2CAYlE;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,2CA0RhE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CAmC9D;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,2CAoB5C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,2CAgBhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,2CAyB9C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,2CAmB5C;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,2CAqBhD;AAED;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;;CAMzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;CAK3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/layout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAU9C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/menu/index.tsx"],"names":[],"mappings":"AAGA,eAAO,MAAM,IAAI,+CAgBhB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ColumnDef } from '@tanstack/react-table';
|
|
2
|
+
import { DocTypeSchema } from '../../hooks/types';
|
|
3
|
+
/**
|
|
4
|
+
* AutoTable props
|
|
5
|
+
*/
|
|
6
|
+
export interface AutoTableProps<TData extends object = object> {
|
|
7
|
+
/** Resource name (DocType) */
|
|
8
|
+
resource: string;
|
|
9
|
+
/** Schema for generating columns */
|
|
10
|
+
schema?: DocTypeSchema;
|
|
11
|
+
/** Custom column definitions (overrides schema-generated) */
|
|
12
|
+
columns?: ColumnDef<TData, unknown>[];
|
|
13
|
+
/** Enable row selection */
|
|
14
|
+
enableSelection?: boolean;
|
|
15
|
+
/** Called when selection changes */
|
|
16
|
+
onSelectionChange?: (selectedRows: TData[]) => void;
|
|
17
|
+
/** Called when row is clicked */
|
|
18
|
+
onRowClick?: (row: TData) => void;
|
|
19
|
+
/** Additional className */
|
|
20
|
+
className?: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* AutoTable Component
|
|
24
|
+
*
|
|
25
|
+
* Uses Refine's useList for data fetching and TanStack Table for display.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { useDocTypeMeta } from "../hooks";
|
|
30
|
+
* import { AutoTable } from "../components/table";
|
|
31
|
+
*
|
|
32
|
+
* function TaskList() {
|
|
33
|
+
* const { schema } = useDocTypeMeta("Task");
|
|
34
|
+
*
|
|
35
|
+
* return (
|
|
36
|
+
* <AutoTable
|
|
37
|
+
* resource="Task"
|
|
38
|
+
* schema={schema}
|
|
39
|
+
* onRowClick={(row) => navigate(`/task/${row.id}`)}
|
|
40
|
+
* />
|
|
41
|
+
* );
|
|
42
|
+
* }
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function AutoTable<TData extends object = object>({ resource, schema, columns: customColumns, enableSelection, onSelectionChange, onRowClick, className, }: Readonly<AutoTableProps<TData>>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
export default AutoTable;
|
|
47
|
+
//# sourceMappingURL=AutoTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoTable.d.ts","sourceRoot":"","sources":["../../../src/components/table/AutoTable.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAML,KAAK,SAAS,EAIf,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAsB,MAAM,mBAAmB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM;IAC3D,8BAA8B;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,oCAAoC;IACpC,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;IACtC,2BAA2B;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,oCAAoC;IACpC,iBAAiB,CAAC,EAAE,CAAC,YAAY,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;IACpD,iCAAiC;IACjC,UAAU,CAAC,EAAE,CAAC,GAAG,EAAE,KAAK,KAAK,IAAI,CAAC;IAClC,2BAA2B;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsCD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,SAAS,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,EACvD,QAAQ,EACR,MAAM,EACN,OAAO,EAAE,aAAa,EACtB,eAAuB,EACvB,iBAAiB,EACjB,UAAU,EACV,SAAS,GACV,EAAE,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,2CAoRjC;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BulkActionsBar Component
|
|
3
|
+
*
|
|
4
|
+
* Toolbar for bulk actions when rows are selected.
|
|
5
|
+
* Per checklist 5.3: Bulk Operations.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* BulkActionsBar props
|
|
9
|
+
*/
|
|
10
|
+
export interface BulkActionsBarProps {
|
|
11
|
+
/** Number of selected items */
|
|
12
|
+
selectedCount: number;
|
|
13
|
+
/** Whether action is in progress */
|
|
14
|
+
isLoading?: boolean;
|
|
15
|
+
/** Handle bulk delete */
|
|
16
|
+
onDelete?: () => void;
|
|
17
|
+
/** Handle export as JSON */
|
|
18
|
+
onExportJson?: () => void;
|
|
19
|
+
/** Handle export as CSV */
|
|
20
|
+
onExportCsv?: () => void;
|
|
21
|
+
/** Handle bulk update */
|
|
22
|
+
onBulkUpdate?: (field: string, value: unknown) => void;
|
|
23
|
+
/** Available fields for bulk update */
|
|
24
|
+
updateFields?: Array<{
|
|
25
|
+
name: string;
|
|
26
|
+
label: string;
|
|
27
|
+
options?: Array<{
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}>;
|
|
31
|
+
}>;
|
|
32
|
+
/** Handle clear selection */
|
|
33
|
+
onClear?: () => void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* BulkActionsBar Component
|
|
37
|
+
*/
|
|
38
|
+
export declare function BulkActionsBar({ selectedCount, isLoading, onDelete, onExportJson, onExportCsv, onBulkUpdate, updateFields, onClear, }: Readonly<BulkActionsBarProps>): import("react/jsx-runtime").JSX.Element | null;
|
|
39
|
+
export default BulkActionsBar;
|
|
40
|
+
//# sourceMappingURL=BulkActionsBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BulkActionsBar.d.ts","sourceRoot":"","sources":["../../../src/components/table/BulkActionsBar.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,oCAAoC;IACpC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;IACzB,yBAAyB;IACzB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACvD,uCAAuC;IACvC,YAAY,CAAC,EAAE,KAAK,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,KAAK,CAAC;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KACnD,CAAC,CAAC;IACH,6BAA6B;IAC7B,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,EACb,SAAiB,EACjB,QAAQ,EACR,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAiB,EACjB,OAAO,GACR,EAAE,QAAQ,CAAC,mBAAmB,CAAC,kDAyO/B;AAWD,eAAe,cAAc,CAAC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Editable Cell Component
|
|
3
|
+
*
|
|
4
|
+
* Inline editable cell for list views.
|
|
5
|
+
* Per checklist 5.2: Inline Editing.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Click cell to edit
|
|
9
|
+
* - Save on blur
|
|
10
|
+
* - Show validation errors
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Editable cell props
|
|
14
|
+
*/
|
|
15
|
+
export interface EditableCellProps {
|
|
16
|
+
/** Resource/DocType name */
|
|
17
|
+
resource: string;
|
|
18
|
+
/** Row ID */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Field name */
|
|
21
|
+
field: string;
|
|
22
|
+
/** Current value */
|
|
23
|
+
value: unknown;
|
|
24
|
+
/** Field type for input */
|
|
25
|
+
type?: "text" | "number" | "date" | "select" | "checkbox";
|
|
26
|
+
/** Options for select type */
|
|
27
|
+
options?: Array<{
|
|
28
|
+
value: string;
|
|
29
|
+
label: string;
|
|
30
|
+
}>;
|
|
31
|
+
/** Whether editing is disabled */
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
/** Callback after successful save */
|
|
34
|
+
onSaveSuccess?: () => void;
|
|
35
|
+
/** Custom renderer for display mode */
|
|
36
|
+
renderValue?: (value: unknown) => React.ReactNode;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* EditableCell Component
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <EditableCell
|
|
44
|
+
* resource="Customer"
|
|
45
|
+
* id="CUST-001"
|
|
46
|
+
* field="customer_name"
|
|
47
|
+
* value="John Smith"
|
|
48
|
+
* type="text"
|
|
49
|
+
* />
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function EditableCell({ resource, id, field, value, type, options, disabled, onSaveSuccess, renderValue, }: EditableCellProps): import("react/jsx-runtime").JSX.Element;
|
|
53
|
+
export default EditableCell;
|
|
54
|
+
//# sourceMappingURL=EditableCell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditableCell.d.ts","sourceRoot":"","sources":["../../../src/components/table/EditableCell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAKH;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,4BAA4B;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa;IACb,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,oBAAoB;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,2BAA2B;IAC3B,IAAI,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,UAAU,CAAC;IAC1D,8BAA8B;IAC9B,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAClD,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,uCAAuC;IACvC,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,CAAC,SAAS,CAAC;CACnD;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,EAAE,EACF,KAAK,EACL,KAAK,EACL,IAAa,EACb,OAAO,EACP,QAAgB,EAChB,aAAa,EACb,WAAW,GACZ,EAAE,iBAAiB,2CA2OnB;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Table Components
|
|
3
|
+
*
|
|
4
|
+
* Re-exports table components.
|
|
5
|
+
*/
|
|
6
|
+
export { AutoTable } from './AutoTable';
|
|
7
|
+
export type { AutoTableProps } from './AutoTable';
|
|
8
|
+
export { EditableCell } from './EditableCell';
|
|
9
|
+
export type { EditableCellProps } from './EditableCell';
|
|
10
|
+
export { BulkActionsBar } from './BulkActionsBar';
|
|
11
|
+
export type { BulkActionsBarProps } from './BulkActionsBar';
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/table/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* StateBadge props
|
|
4
|
+
*/
|
|
5
|
+
export interface StateBadgeProps {
|
|
6
|
+
/** Current workflow state */
|
|
7
|
+
state?: string;
|
|
8
|
+
/** Document status (0=Draft, 1=Submitted, 2=Cancelled) */
|
|
9
|
+
docstatus?: number;
|
|
10
|
+
/** Custom className */
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Custom style */
|
|
13
|
+
style?: CSSProperties;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* StateBadge Component
|
|
17
|
+
*
|
|
18
|
+
* Displays workflow state as a styled badge.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```tsx
|
|
22
|
+
* <StateBadge state="Pending Approval" />
|
|
23
|
+
* <StateBadge state="Approved" />
|
|
24
|
+
* <StateBadge state="Draft" docstatus={0} />
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function StateBadge({ state, docstatus, className, style, }: StateBadgeProps): import("react/jsx-runtime").JSX.Element | null;
|
|
28
|
+
export default StateBadge;
|
|
29
|
+
//# sourceMappingURL=StateBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StateBadge.d.ts","sourceRoot":"","sources":["../../../src/components/workflow/StateBadge.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA6B3C;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,SAAS,EACT,SAAS,EACT,KAAK,GACN,EAAE,eAAe,kDA0BjB;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* WorkflowActions props
|
|
4
|
+
*/
|
|
5
|
+
export interface WorkflowActionsProps {
|
|
6
|
+
/** DocType name */
|
|
7
|
+
doctype: string;
|
|
8
|
+
/** Document ID */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** Show state badge */
|
|
11
|
+
showState?: boolean;
|
|
12
|
+
/** Callback after successful action */
|
|
13
|
+
onActionComplete?: (action: string) => void;
|
|
14
|
+
/** Custom className */
|
|
15
|
+
className?: string;
|
|
16
|
+
/** Custom style */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* WorkflowActions Component
|
|
21
|
+
*
|
|
22
|
+
* Fetches and renders workflow action buttons.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```tsx
|
|
26
|
+
* // In form header
|
|
27
|
+
* <WorkflowActions
|
|
28
|
+
* doctype="Todo"
|
|
29
|
+
* id={todoId}
|
|
30
|
+
* showState
|
|
31
|
+
* onActionComplete={() => refetch()}
|
|
32
|
+
* />
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export declare function WorkflowActions({ doctype, id, showState, onActionComplete, className, style, }: WorkflowActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
36
|
+
export default WorkflowActions;
|
|
37
|
+
//# sourceMappingURL=WorkflowActions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WorkflowActions.d.ts","sourceRoot":"","sources":["../../../src/components/workflow/WorkflowActions.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AA+B3C;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,kBAAkB;IAClB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,uBAAuB;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,uCAAuC;IACvC,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C,uBAAuB;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mBAAmB;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,eAAe,CAAC,EAC9B,OAAO,EACP,EAAE,EACF,SAAgB,EAChB,gBAAgB,EAChB,SAAS,EACT,KAAK,GACN,EAAE,oBAAoB,kDA8FtB;AAED,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Components
|
|
3
|
+
*
|
|
4
|
+
* Re-exports workflow-related components for convenient importing.
|
|
5
|
+
*/
|
|
6
|
+
export { StateBadge } from './StateBadge';
|
|
7
|
+
export type { StateBadgeProps } from './StateBadge';
|
|
8
|
+
export { WorkflowActions } from './WorkflowActions';
|
|
9
|
+
export type { WorkflowActionsProps } from './WorkflowActions';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/workflow/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/config/i18n.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,SAAS,CAAC;AA0H3B,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration System
|
|
3
|
+
*
|
|
4
|
+
* Level 1 customization - JSON configs without build step.
|
|
5
|
+
*
|
|
6
|
+
* Per checklist 2.6 "Zero Cliff":
|
|
7
|
+
* - Edit Labels/Visibility via Client Script or JSON overrides
|
|
8
|
+
* - No build step required
|
|
9
|
+
*/
|
|
10
|
+
export { registerConfig, registerClientScript, getConfig, getFormConfig, getListConfig, getFieldConfig, getClientScripts, loadConfigFromUrl, clearConfigs, } from './registry';
|
|
11
|
+
export { useConfig, useFormConfig, useListConfig, useFieldConfig, } from './useConfig';
|
|
12
|
+
export type { DocTypeConfig, FormConfig, ListConfig, FieldConfig, ColumnConfig, SectionConfig, ClientScript, ClientScriptContext, } from './types';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,GACb,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,aAAa,EACb,aAAa,EACb,cAAc,GACf,MAAM,aAAa,CAAC;AAGrB,YAAY,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,mBAAmB,GACpB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { DocTypeConfig, FormConfig, ListConfig, FieldConfig, ClientScript } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Register a DocType configuration
|
|
4
|
+
*
|
|
5
|
+
* @param config - DocType configuration
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* registerConfig({
|
|
10
|
+
* doctype: "Depot",
|
|
11
|
+
* form: {
|
|
12
|
+
* fields: {
|
|
13
|
+
* capacity: { label: "Max Capacity (MT)" },
|
|
14
|
+
* internal_code: { hidden: true }
|
|
15
|
+
* },
|
|
16
|
+
* sections: [
|
|
17
|
+
* { title: "Location", fields: ["location", "region"] }
|
|
18
|
+
* ]
|
|
19
|
+
* },
|
|
20
|
+
* list: {
|
|
21
|
+
* columns: ["name", "location", "capacity"],
|
|
22
|
+
* defaultSort: { field: "capacity", order: "desc" }
|
|
23
|
+
* }
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
export declare function registerConfig(config: DocTypeConfig): void;
|
|
28
|
+
/**
|
|
29
|
+
* Get configuration for a DocType
|
|
30
|
+
*/
|
|
31
|
+
export declare function getConfig(doctype: string): DocTypeConfig | undefined;
|
|
32
|
+
/**
|
|
33
|
+
* Get form configuration for a DocType
|
|
34
|
+
*/
|
|
35
|
+
export declare function getFormConfig(doctype: string): FormConfig | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Get list configuration for a DocType
|
|
38
|
+
*/
|
|
39
|
+
export declare function getListConfig(doctype: string): ListConfig | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Get field configuration override
|
|
42
|
+
*/
|
|
43
|
+
export declare function getFieldConfig(doctype: string, fieldName: string): FieldConfig | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Register a client script
|
|
46
|
+
*
|
|
47
|
+
* @param script - Client script definition
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* registerClientScript({
|
|
52
|
+
* doctype: "Sales Invoice",
|
|
53
|
+
* event: "onLoad",
|
|
54
|
+
* handler: (ctx) => {
|
|
55
|
+
* if (ctx.doc.status === "Draft") {
|
|
56
|
+
* ctx.setHidden("cancel_reason", true);
|
|
57
|
+
* }
|
|
58
|
+
* }
|
|
59
|
+
* });
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare function registerClientScript(script: ClientScript): void;
|
|
63
|
+
/**
|
|
64
|
+
* Get client scripts for a DocType and event
|
|
65
|
+
*/
|
|
66
|
+
export declare function getClientScripts(doctype: string, event: ClientScript["event"]): ClientScript[];
|
|
67
|
+
/**
|
|
68
|
+
* Load configuration from URL (fetches JSON)
|
|
69
|
+
*/
|
|
70
|
+
export declare function loadConfigFromUrl(url: string): Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Clear all configurations (for testing)
|
|
73
|
+
*/
|
|
74
|
+
export declare function clearConfigs(): void;
|
|
75
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/config/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,aAAa,EACb,UAAU,EACV,UAAU,EACV,WAAW,EACX,YAAY,EACb,MAAM,SAAS,CAAC;AAwCjB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAS1D;AAiDD;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAErE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAErE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,WAAW,GAAG,SAAS,CAEzB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,IAAI,CAK/D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAC3B,YAAY,EAAE,CAGhB;AAED;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYlE;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,IAAI,CAGnC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Types
|
|
3
|
+
*
|
|
4
|
+
* Types for Level 1 customization (Low Code).
|
|
5
|
+
* JSON-based configuration without build step required.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Field configuration override
|
|
9
|
+
*/
|
|
10
|
+
export interface FieldConfig {
|
|
11
|
+
/** Override label */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** Hide the field */
|
|
14
|
+
hidden?: boolean;
|
|
15
|
+
/** Make read-only */
|
|
16
|
+
readonly?: boolean;
|
|
17
|
+
/** Default value */
|
|
18
|
+
default?: unknown;
|
|
19
|
+
/** Help text */
|
|
20
|
+
description?: string;
|
|
21
|
+
/** Placeholder text */
|
|
22
|
+
placeholder?: string;
|
|
23
|
+
/** Required override */
|
|
24
|
+
required?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Form section configuration
|
|
28
|
+
*/
|
|
29
|
+
export interface SectionConfig {
|
|
30
|
+
/** Section title */
|
|
31
|
+
title: string;
|
|
32
|
+
/** Fields in this section */
|
|
33
|
+
fields: string[];
|
|
34
|
+
/** Collapsible section */
|
|
35
|
+
collapsible?: boolean;
|
|
36
|
+
/** Start collapsed */
|
|
37
|
+
collapsed?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Form configuration
|
|
41
|
+
*/
|
|
42
|
+
export interface FormConfig {
|
|
43
|
+
/** Field overrides */
|
|
44
|
+
fields?: Record<string, FieldConfig>;
|
|
45
|
+
/** Custom sections layout */
|
|
46
|
+
sections?: SectionConfig[];
|
|
47
|
+
/** Hide default submit button */
|
|
48
|
+
hideSubmitButton?: boolean;
|
|
49
|
+
/** Custom submit text */
|
|
50
|
+
submitText?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Column configuration for list view
|
|
54
|
+
*/
|
|
55
|
+
export interface ColumnConfig {
|
|
56
|
+
/** Field name */
|
|
57
|
+
field: string;
|
|
58
|
+
/** Column header */
|
|
59
|
+
header?: string;
|
|
60
|
+
/** Fixed width */
|
|
61
|
+
width?: number | string;
|
|
62
|
+
/** Hide column */
|
|
63
|
+
hidden?: boolean;
|
|
64
|
+
/** Enable sorting */
|
|
65
|
+
sortable?: boolean;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* List configuration
|
|
69
|
+
*/
|
|
70
|
+
export interface ListConfig {
|
|
71
|
+
/** Column order (field names or ColumnConfig) */
|
|
72
|
+
columns?: (string | ColumnConfig)[];
|
|
73
|
+
/** Default sort */
|
|
74
|
+
defaultSort?: {
|
|
75
|
+
field: string;
|
|
76
|
+
order: "asc" | "desc";
|
|
77
|
+
};
|
|
78
|
+
/** Page size */
|
|
79
|
+
pageSize?: number;
|
|
80
|
+
/** Enable row selection */
|
|
81
|
+
enableSelection?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Complete DocType configuration
|
|
85
|
+
*/
|
|
86
|
+
export interface DocTypeConfig {
|
|
87
|
+
/** DocType name */
|
|
88
|
+
doctype: string;
|
|
89
|
+
/** Form configuration */
|
|
90
|
+
form?: FormConfig;
|
|
91
|
+
/** List configuration */
|
|
92
|
+
list?: ListConfig;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Client script for runtime behavior
|
|
96
|
+
*/
|
|
97
|
+
export interface ClientScript {
|
|
98
|
+
/** DocType this script applies to */
|
|
99
|
+
doctype: string;
|
|
100
|
+
/** Event name */
|
|
101
|
+
event: "onLoad" | "beforeSave" | "afterSave" | "onRefresh" | "validate";
|
|
102
|
+
/** Script function */
|
|
103
|
+
handler: (context: ClientScriptContext) => void | Promise<void>;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Context passed to client scripts
|
|
107
|
+
*/
|
|
108
|
+
export interface ClientScriptContext {
|
|
109
|
+
/** Document data */
|
|
110
|
+
doc: Record<string, unknown>;
|
|
111
|
+
/** Update field value */
|
|
112
|
+
setValue: (field: string, value: unknown) => void;
|
|
113
|
+
/** Get field value */
|
|
114
|
+
getValue: (field: string) => unknown;
|
|
115
|
+
/** Set field as required */
|
|
116
|
+
setRequired: (field: string, required: boolean) => void;
|
|
117
|
+
/** Set field as hidden */
|
|
118
|
+
setHidden: (field: string, hidden: boolean) => void;
|
|
119
|
+
/** Set field as read-only */
|
|
120
|
+
setReadOnly: (field: string, readonly: boolean) => void;
|
|
121
|
+
/** Show alert message */
|
|
122
|
+
showAlert: (message: string, type?: "info" | "warning" | "error") => void;
|
|
123
|
+
/** User info */
|
|
124
|
+
user: {
|
|
125
|
+
id: string;
|
|
126
|
+
email: string;
|
|
127
|
+
roles: string[];
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/config/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DocTypeConfig, FormConfig, ListConfig, FieldConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Hook to get complete DocType configuration
|
|
4
|
+
*/
|
|
5
|
+
export declare function useConfig(doctype: string): DocTypeConfig | undefined;
|
|
6
|
+
/**
|
|
7
|
+
* Hook to get form configuration
|
|
8
|
+
*/
|
|
9
|
+
export declare function useFormConfig(doctype: string): FormConfig | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Hook to get list configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare function useListConfig(doctype: string): ListConfig | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Hook to get field configuration override
|
|
16
|
+
*/
|
|
17
|
+
export declare function useFieldConfig(doctype: string, fieldName: string): FieldConfig | undefined;
|
|
18
|
+
//# sourceMappingURL=useConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfig.d.ts","sourceRoot":"","sources":["../../src/config/useConfig.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AASH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAElF;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEpE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAErE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAErE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,WAAW,GAAG,SAAS,CAKzB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework M Frontend Configuration
|
|
3
|
+
*
|
|
4
|
+
* Configuration is loaded from window.__FRAMEWORK_CONFIG__ if available,
|
|
5
|
+
* otherwise uses same-origin defaults.
|
|
6
|
+
*/
|
|
7
|
+
declare global {
|
|
8
|
+
interface Window {
|
|
9
|
+
__FRAMEWORK_CONFIG__?: {
|
|
10
|
+
apiBaseUrl?: string;
|
|
11
|
+
metaBaseUrl?: string;
|
|
12
|
+
wsBaseUrl?: string;
|
|
13
|
+
/** Auth configuration */
|
|
14
|
+
auth?: {
|
|
15
|
+
authStrategy?: "cookie" | "oidc";
|
|
16
|
+
loginUrl?: string;
|
|
17
|
+
oidcConfig?: {
|
|
18
|
+
authority: string;
|
|
19
|
+
clientId: string;
|
|
20
|
+
redirectUri: string;
|
|
21
|
+
};
|
|
22
|
+
oauth?: {
|
|
23
|
+
providers?: string[] | Record<string, unknown>;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* API endpoints - uses same-origin by default, configurable via window config
|
|
31
|
+
*/
|
|
32
|
+
export declare const API_URL: any;
|
|
33
|
+
export declare const META_URL: any;
|
|
34
|
+
export declare const WS_URL: any;
|
|
35
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,oBAAoB,CAAC,EAAE;YACrB,UAAU,CAAC,EAAE,MAAM,CAAC;YACpB,WAAW,CAAC,EAAE,MAAM,CAAC;YACrB,SAAS,CAAC,EAAE,MAAM,CAAC;YACnB,yBAAyB;YACzB,IAAI,CAAC,EAAE;gBACL,YAAY,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC;gBACjC,QAAQ,CAAC,EAAE,MAAM,CAAC;gBAClB,UAAU,CAAC,EAAE;oBACX,SAAS,EAAE,MAAM,CAAC;oBAClB,QAAQ,EAAE,MAAM,CAAC;oBACjB,WAAW,EAAE,MAAM,CAAC;iBACrB,CAAC;gBACF,KAAK,CAAC,EAAE;oBACN,SAAS,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;iBAChD,CAAC;aACH,CAAC;SACH,CAAC;KACH;CACF;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,KAGT,CAAC;AAEZ,eAAO,MAAM,QAAQ,KAGR,CAAC;AAEd,eAAO,MAAM,MAAM,KAGD,CAAC"}
|