@owp/core 1.6.0 → 1.6.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/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { aL as r, aJ as o, V as i, F as l, h as p, i as d, aD as n, aE as w, aF as b, aG as c, aK as g, aI as O, aH as u, c4 as m, bk as C, bl as T, aM as S, aN as L, aO as h, aB as G, aP as I, bs as y, bt as B, aQ as D, aR as v, aS as N, a$ as E, aV as R, aW as P, aX as f, aU as x, aY as k, b0 as V, a_ as A, b3 as H, b4 as _, b5 as F, b1 as M, b2 as U, b6 as z, b7 as Q, aT as W, b8 as Z, b9 as K, ba as Y, bb as j, bc as q, bd as J, be as X, bf as $, bg as ee, bh as ae, bi as se, bj as te, d as re, bo as oe, bp as ie, bq as le, br as pe, aC as de, c0 as ne, c1 as we, cf as be, c2 as ce, c3 as ge, O as Oe, ci as ue, c7 as me, cj as Ce, c9 as Te, ca as Se, cb as Le, cc as he, ce as Ge, a0 as Ie, c8 as ye, bm as Be, bn as De, ch as ve, c5 as Ne, c6 as Ee, a5 as Re, a6 as Pe, a4 as fe, a3 as xe, cd as ke, aa as Ve, ao as Ae, e as He, U as _e, bw as Fe, ae as Me, Q as Ue, bv as ze, Y as Qe, a2 as We, ac as Ze, aq as Ke, R as Ye, a1 as je, bx as qe, ab as Je, a8 as Xe, bH as $e, bL as ea, $ as aa, a7 as sa, W as ta, X as ra, bI as oa, bJ as ia, ad as la, bK as pa, al as da, am as na, ap as wa, ar as ba, at as ca, aZ as ga, bu as Oa, N as ua, o as ma, bz as Ca, a9 as Ta, an as Sa, ai as La, ag as ha, aj as Ga, ah as Ia, bZ as ya, aw as Ba, ax as Da, au as va, av as Na, az as Ea, bM as Ra, bG as Pa, bW as fa, bX as xa, bY as ka, bN as Va, bO as Aa, bP as Ha, bQ as _a, bR as Fa, bS as Ma, bA as Ua, bB as za, bF as Qa, bC as Wa, bE as Za, bD as Ka, bT as Ya, bU as ja, bV as qa, Z as Ja, by as Xa, ak as $a, af as es, b_ as as, _ as ss, b$ as ts, ay as rs, as as os, g as is, P as ls, aA as ps, T as ds, S as ns, cg as ws, n as bs, z as cs, G as gs, H as Os, E as us, l as ms, q as Cs, v as Ts, x as Ss, p as Ls, A as hs, I as Gs, k as Is, D as ys, C as Bs, m as Ds, r as vs, w as Ns, y as Es, B as Rs, J as Ps, K as fs, L as xs, M as ks } from "./index-CPi4nNXt.js";
1
+ import { aL as r, aJ as o, V as i, F as l, h as p, i as d, aD as n, aE as w, aF as b, aG as c, aK as g, aI as O, aH as u, c4 as m, bk as C, bl as T, aM as S, aN as L, aO as h, aB as G, aP as I, bs as y, bt as B, aQ as D, aR as v, aS as N, a$ as E, aV as R, aW as P, aX as f, aU as x, aY as k, b0 as V, a_ as A, b3 as H, b4 as _, b5 as F, b1 as M, b2 as U, b6 as z, b7 as Q, aT as W, b8 as Z, b9 as K, ba as Y, bb as j, bc as q, bd as J, be as X, bf as $, bg as ee, bh as ae, bi as se, bj as te, d as re, bo as oe, bp as ie, bq as le, br as pe, aC as de, c0 as ne, c1 as we, cf as be, c2 as ce, c3 as ge, O as Oe, ci as ue, c7 as me, cj as Ce, c9 as Te, ca as Se, cb as Le, cc as he, ce as Ge, a0 as Ie, c8 as ye, bm as Be, bn as De, ch as ve, c5 as Ne, c6 as Ee, a5 as Re, a6 as Pe, a4 as fe, a3 as xe, cd as ke, aa as Ve, ao as Ae, e as He, U as _e, bw as Fe, ae as Me, Q as Ue, bv as ze, Y as Qe, a2 as We, ac as Ze, aq as Ke, R as Ye, a1 as je, bx as qe, ab as Je, a8 as Xe, bH as $e, bL as ea, $ as aa, a7 as sa, W as ta, X as ra, bI as oa, bJ as ia, ad as la, bK as pa, al as da, am as na, ap as wa, ar as ba, at as ca, aZ as ga, bu as Oa, N as ua, o as ma, bz as Ca, a9 as Ta, an as Sa, ai as La, ag as ha, aj as Ga, ah as Ia, bZ as ya, aw as Ba, ax as Da, au as va, av as Na, az as Ea, bM as Ra, bG as Pa, bW as fa, bX as xa, bY as ka, bN as Va, bO as Aa, bP as Ha, bQ as _a, bR as Fa, bS as Ma, bA as Ua, bB as za, bF as Qa, bC as Wa, bE as Za, bD as Ka, bT as Ya, bU as ja, bV as qa, Z as Ja, by as Xa, ak as $a, af as es, b_ as as, _ as ss, b$ as ts, ay as rs, as as os, g as is, P as ls, aA as ps, T as ds, S as ns, cg as ws, n as bs, z as cs, G as gs, H as Os, E as us, l as ms, q as Cs, v as Ts, x as Ss, p as Ls, A as hs, I as Gs, k as Is, D as ys, C as Bs, m as Ds, r as vs, w as Ns, y as Es, B as Rs, J as Ps, K as fs, L as xs, M as ks } from "./index-CWtbF1dU.js";
2
2
  import { DialogsProvider as As } from "@toolpad/core/useDialogs";
3
3
  import "@mui/material/styles";
4
4
  import "@mui/material/Typography";
@@ -1,44 +1,53 @@
1
- export type THeader = {
2
- Header?: {
3
- [key: string]: string | number | {
4
- [key: string]: string | number;
5
- };
6
- };
7
- Toolbar?: {
8
- [key: string]: string | number;
9
- };
10
- Foot?: {
11
- [key: string]: string | number;
12
- };
13
- };
14
- export type TData<T> = Record<string, never> | [] | undefined | T[];
15
- interface OwpTreeGridProps<T> {
1
+ import { type CSSProperties } from 'react';
2
+ type TreeGridLayoutScalarValue = string | number;
3
+ type TreeGridNestedLayoutFields = Record<string, TreeGridLayoutScalarValue>;
4
+ type TreeGridLayoutFields = Record<string, TreeGridLayoutScalarValue | TreeGridNestedLayoutFields>;
5
+ type TreeGridSectionFields = Record<string, TreeGridLayoutScalarValue>;
6
+ export interface OwpTreeGridLayout {
7
+ Header?: TreeGridLayoutFields;
8
+ Toolbar?: TreeGridSectionFields;
9
+ Foot?: TreeGridSectionFields;
10
+ }
11
+ export type OwpTreeGridLayoutConfig = OwpTreeGridLayout;
12
+ export type THeader = OwpTreeGridLayoutConfig;
13
+ export type OwpTreeGridBodyData<T> = Record<string, never> | [] | undefined | T[];
14
+ export type OwpTreeGridData<T> = OwpTreeGridBodyData<T>;
15
+ export type TData<T> = OwpTreeGridBodyData<T>;
16
+ export type OwpTreeGridRowModel<T> = TRow & T;
17
+ export type OwpTreeGridSelectedRows<T> = OwpTreeGridRowModel<T>[];
18
+ type OwpTreeGridSelectHandler<T> = (selectedRows: OwpTreeGridSelectedRows<T>) => void;
19
+ type OwpTreeGridRowAddHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;
20
+ type OwpTreeGridRowDeleteHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>, deleteType: number) => void;
21
+ type OwpTreeGridRowUndeleteHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>) => void;
22
+ type OwpTreeGridButtonClickHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>, col: string, event: Event) => void;
23
+ type OwpTreeGridRowClickHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>, col: string, x: number, y: number, event: Event) => void;
24
+ type OwpTreeGridSaveHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>, autoupdate: boolean | number) => void;
25
+ type OwpTreeGridCellValue = unknown;
26
+ type OwpTreeGridAfterValueChangedHandler<T> = (grid: TGrid, row: OwpTreeGridRowModel<T>, col: string, value: OwpTreeGridCellValue) => void;
27
+ export interface OwpTreeGridProps<T> {
16
28
  id: string;
17
29
  className?: string;
18
- containerStyle?: {
19
- [key: string]: string | number;
20
- };
30
+ containerStyle?: CSSProperties;
21
31
  containerClassName?: string;
22
32
  LayoutUrl?: string;
33
+ layoutUrl?: string;
23
34
  DataUrl?: string;
24
- data?: TData<T>;
25
- layout?: THeader;
26
- style?: {
27
- [key: string]: string | number;
28
- };
35
+ data?: OwpTreeGridBodyData<T>;
36
+ layout?: OwpTreeGridLayoutConfig;
37
+ style?: CSSProperties;
29
38
  height?: string | number;
30
39
  width?: string | number;
31
40
  useDataUrl?: boolean;
32
- onSelect?: (data: T[] | []) => void;
33
- onRowAdd?: (data: T[]) => void;
34
- onRowDelete?: (data: T[]) => void;
35
- onRowUndelete?: (data: T[]) => void;
36
- onRowChange?: (data: T[]) => void;
37
- onClickButton?: (grid: TGrid, row: TRow & T, col: string, event: Event) => void;
41
+ onSelect?: OwpTreeGridSelectHandler<T>;
42
+ onRowAdd?: OwpTreeGridRowAddHandler<T>;
43
+ onRowDelete?: OwpTreeGridRowDeleteHandler<T>;
44
+ onRowUndelete?: OwpTreeGridRowUndeleteHandler<T>;
45
+ onRowChange?: OwpTreeGridAfterValueChangedHandler<T>;
46
+ onClickButton?: OwpTreeGridButtonClickHandler<T>;
38
47
  onReady?: (grid: TGrid) => void;
39
- onRowClick?: (grid: TGrid, row: TRow & T, col: string, x: number, y: number, event: Event) => void;
40
- onSave?: (grid: TGrid, row: TRow & T, autoupdate: boolean | number) => void;
41
- onAfterValueChanged?: (grid: TGrid, row: TRow & T, col: string, val: any) => void;
48
+ onRowClick?: OwpTreeGridRowClickHandler<T>;
49
+ onSave?: OwpTreeGridSaveHandler<T>;
50
+ onAfterValueChanged?: OwpTreeGridAfterValueChangedHandler<T>;
42
51
  }
43
- declare const OwpTreeGrid: <T>({ id, containerStyle, containerClassName, className, style, height, width, LayoutUrl, DataUrl, data, layout, useDataUrl, onSelect, onRowClick, onRowAdd, onRowDelete, onRowUndelete, onRowChange, onClickButton, onSave, onReady, onAfterValueChanged, }: OwpTreeGridProps<T>) => import("react/jsx-runtime").JSX.Element;
52
+ declare const OwpTreeGrid: <T>({ id, containerStyle, containerClassName, className, style, height, width, LayoutUrl, layoutUrl, DataUrl: dataUrl, data, layout, useDataUrl, onSelect, onRowClick, onRowAdd, onRowDelete, onRowUndelete, onRowChange, onClickButton, onSave, onReady, onAfterValueChanged, }: OwpTreeGridProps<T>) => import("react/jsx-runtime").JSX.Element;
44
53
  export { OwpTreeGrid };
@@ -1,8 +1,20 @@
1
- import { THeader } from './OwpTreeGrid';
1
+ import { type OwpTreeGridLayoutConfig } from './OwpTreeGrid';
2
+ type TreeGridHeaderLayoutConfig = NonNullable<OwpTreeGridLayoutConfig['Header']>;
3
+ export declare const TREE_GRID_HEADER_SECTION = "Header";
4
+ export declare const TREE_GRID_TOOLBAR_SECTION = "Toolbar";
5
+ export declare const TREE_GRID_FOOT_SECTION = "Foot";
6
+ export declare const TREE_GRID_NEXT_SIBLING_KEY = "nextSibling";
7
+ export declare const TREE_GRID_LAYOUT_SECTION_KEYS: readonly ["Header", "Toolbar", "Foot"];
2
8
  export declare const HEADER = "Header";
3
9
  export declare const TOOLBAR = "Toolbar";
4
10
  export declare const FOOTER = "Foot";
5
11
  export declare const NEXT_SIBLING = "nextSibling";
6
- export declare const changeSubHeaderLayoutTextByGrid: (grid: TTGrid, header: THeader, siblingKeys?: string[]) => void;
12
+ export declare const applyTreeGridSubHeaderLayoutText: (grid: TTGrid, headerLayout?: TreeGridHeaderLayoutConfig) => void;
13
+ export declare const applySubHeaderLayoutTextToGrid: (grid: TTGrid, headerLayout?: TreeGridHeaderLayoutConfig) => void;
14
+ export declare const changeSubHeaderLayoutTextByGrid: (grid: TTGrid, headerLayout?: TreeGridHeaderLayoutConfig) => void;
15
+ export declare const parseTreeGridXmlToJson: (xmlString?: string) => {}[];
7
16
  export declare const convertXmlToJson: (xmlString?: string) => {}[];
8
- export declare const updateLayoutByGrid: (grid: TTGrid | TGrid, layout?: THeader, disableReloadBody?: boolean) => void;
17
+ export declare const applyTreeGridLayoutToGrid: (grid: TTGrid | TGrid, layoutConfig?: OwpTreeGridLayoutConfig, disableBodyReload?: boolean) => void;
18
+ export declare const updateLayoutByGrid: (grid: TTGrid | TGrid, layoutConfig?: OwpTreeGridLayoutConfig, disableBodyReload?: boolean) => void;
19
+ export declare const applyTreeGridLayoutByGrid: (grid: TTGrid | TGrid, layoutConfig?: OwpTreeGridLayoutConfig, disableBodyReload?: boolean) => void;
20
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@owp/core",
3
3
  "private": false,
4
- "version": "1.6.0",
4
+ "version": "1.6.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",