@vuu-ui/vuu-datatable 0.13.111-alpha.2 → 0.13.111
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.
|
@@ -45,7 +45,6 @@ const TreeTable = ({
|
|
|
45
45
|
...config,
|
|
46
46
|
columns: dataSourceRef.current?.columnDescriptors ?? [],
|
|
47
47
|
columnSeparators: false,
|
|
48
|
-
selectionBookendWidth: 0,
|
|
49
48
|
rowSeparators: false
|
|
50
49
|
};
|
|
51
50
|
}, [config]);
|
|
@@ -64,7 +63,8 @@ const TreeTable = ({
|
|
|
64
63
|
navigationStyle: "tree",
|
|
65
64
|
rowToObject: rowToTreeNodeObject,
|
|
66
65
|
showColumnHeaderMenus: false,
|
|
67
|
-
selectionModel: "single"
|
|
66
|
+
selectionModel: "single",
|
|
67
|
+
selectionBookendWidth: 0
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
70
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeTable.js","sources":["../../../../packages/vuu-datatable/src/tree-table/TreeTable.tsx"],"sourcesContent":["import { TableProps } from \"@vuu-ui/vuu-table\";\nimport { Table } from \"@vuu-ui/vuu-table\";\nimport { TreeDataSource } from \"@vuu-ui/vuu-data-local\";\nimport { useMemo, useRef } from \"react\";\nimport { TableConfig } from \"@vuu-ui/vuu-table-types\";\nimport {\n metadataKeys,\n type RowToObjectMapper,\n type TreeSourceNode,\n} from \"@vuu-ui/vuu-utils\";\n\nconst { DEPTH, IS_LEAF, KEY, IDX, SELECTED } = metadataKeys;\n\ninterface Props extends Omit<TableProps, \"config\" | \"dataSource\"> {\n config?: Pick<\n TableConfig,\n \"columnSeparators\" | \"rowSeparators\" | \"zebraStripes\"\n >;\n dataSource?: TreeDataSource;\n source?: TreeSourceNode[];\n}\n\nexport type TreeTableProps = Props &\n ({ dataSource: TreeDataSource } | { source: TreeSourceNode[] });\n\nconst rowToTreeNodeObject: RowToObjectMapper = (row, columnMap) => {\n const { [IS_LEAF]: isLeaf, [KEY]: key, [IDX]: index, [DEPTH]: depth } = row;\n const firstColIdx = columnMap.nodeData;\n const labelColIdx = firstColIdx + depth;\n\n return {\n key,\n index,\n isGroupRow: !isLeaf,\n isSelected: row[SELECTED] !== 0,\n data: {\n label: row[labelColIdx],\n nodeData: row[firstColIdx],\n },\n };\n};\n\nexport const TreeTable = ({\n config,\n dataSource,\n source,\n ...tableProps\n}: TreeTableProps) => {\n const dataSourceRef = useRef<TreeDataSource>(undefined);\n useMemo(() => {\n if (dataSource) {\n dataSourceRef.current = dataSource;\n } else if (source) {\n dataSourceRef.current = new TreeDataSource({\n data: source,\n });\n } else {\n throw Error(`TreeTable either source or dataSource must be provided`);\n }\n }, [dataSource, source]);\n\n const tableConfig = useMemo<TableConfig>(() => {\n return {\n ...config,\n columns: dataSourceRef.current?.columnDescriptors ?? [],\n columnSeparators: false,\n
|
|
1
|
+
{"version":3,"file":"TreeTable.js","sources":["../../../../packages/vuu-datatable/src/tree-table/TreeTable.tsx"],"sourcesContent":["import { TableProps } from \"@vuu-ui/vuu-table\";\nimport { Table } from \"@vuu-ui/vuu-table\";\nimport { TreeDataSource } from \"@vuu-ui/vuu-data-local\";\nimport { useMemo, useRef } from \"react\";\nimport { TableConfig } from \"@vuu-ui/vuu-table-types\";\nimport {\n metadataKeys,\n type RowToObjectMapper,\n type TreeSourceNode,\n} from \"@vuu-ui/vuu-utils\";\n\nconst { DEPTH, IS_LEAF, KEY, IDX, SELECTED } = metadataKeys;\n\ninterface Props extends Omit<TableProps, \"config\" | \"dataSource\"> {\n config?: Pick<\n TableConfig,\n \"columnSeparators\" | \"rowSeparators\" | \"zebraStripes\"\n >;\n dataSource?: TreeDataSource;\n source?: TreeSourceNode[];\n}\n\nexport type TreeTableProps = Props &\n ({ dataSource: TreeDataSource } | { source: TreeSourceNode[] });\n\nconst rowToTreeNodeObject: RowToObjectMapper = (row, columnMap) => {\n const { [IS_LEAF]: isLeaf, [KEY]: key, [IDX]: index, [DEPTH]: depth } = row;\n const firstColIdx = columnMap.nodeData;\n const labelColIdx = firstColIdx + depth;\n\n return {\n key,\n index,\n isGroupRow: !isLeaf,\n isSelected: row[SELECTED] !== 0,\n data: {\n label: row[labelColIdx],\n nodeData: row[firstColIdx],\n },\n };\n};\n\nexport const TreeTable = ({\n config,\n dataSource,\n source,\n ...tableProps\n}: TreeTableProps) => {\n const dataSourceRef = useRef<TreeDataSource>(undefined);\n useMemo(() => {\n if (dataSource) {\n dataSourceRef.current = dataSource;\n } else if (source) {\n dataSourceRef.current = new TreeDataSource({\n data: source,\n });\n } else {\n throw Error(`TreeTable either source or dataSource must be provided`);\n }\n }, [dataSource, source]);\n\n const tableConfig = useMemo<TableConfig>(() => {\n return {\n ...config,\n columns: dataSourceRef.current?.columnDescriptors ?? [],\n columnSeparators: false,\n rowSeparators: false,\n };\n }, [config]);\n\n console.log({ tableConfig, dataSource: dataSourceRef.current });\n\n if (dataSourceRef.current === undefined) {\n return null;\n }\n\n return (\n <Table\n {...tableProps}\n className=\"vuuTreeTable\"\n config={tableConfig}\n dataSource={dataSourceRef.current}\n groupToggleTarget=\"toggle-icon\"\n navigationStyle=\"tree\"\n rowToObject={rowToTreeNodeObject}\n showColumnHeaderMenus={false}\n selectionModel=\"single\"\n selectionBookendWidth={0}\n />\n );\n};\n"],"names":["metadataKeys","useRef","useMemo","TreeDataSource","jsx","Table"],"mappings":";;;;;;;;AAWA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,GAAK,EAAA,GAAA,EAAK,UAAa,GAAAA,qBAAA;AAc/C,MAAM,mBAAA,GAAyC,CAAC,GAAA,EAAK,SAAc,KAAA;AACjE,EAAA,MAAM,EAAE,CAAC,OAAO,GAAG,MAAA,EAAQ,CAAC,GAAG,GAAG,GAAK,EAAA,CAAC,GAAG,GAAG,KAAA,EAAO,CAAC,KAAK,GAAG,OAAU,GAAA,GAAA;AACxE,EAAA,MAAM,cAAc,SAAU,CAAA,QAAA;AAC9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AA;AACvC,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAAE,cAAA;AAAA,IAACC,cAAA;AAAA,IAAA;AAAA,MACE,GAAG,UAAA;AAAA,MACJ,SAAU,EAAA,cAAA;AAAA,MACV,MAAQ,EAAA,WAAA;AAAA,MACR,YAAY,aAAc,CAAA,OAAA;AAAA,MAC1B,iBAAkB,EAAA,aAAA;AAAA,MAClB,eAAgB,EAAA,MAAA;AAAA,MAChB,WAAa,EAAA,mBAAA;AAAA,MACb,qBAAuB,EAAA,KAAA;AAAA,MACvB,cAAe,EAAA,QAAA;AAAA,MACf,qBAAuB,EAAA;AAAA;AAAA,GACzB;AAEJ;;;;"}
|
|
@@ -43,7 +43,6 @@ const TreeTable = ({
|
|
|
43
43
|
...config,
|
|
44
44
|
columns: dataSourceRef.current?.columnDescriptors ?? [],
|
|
45
45
|
columnSeparators: false,
|
|
46
|
-
selectionBookendWidth: 0,
|
|
47
46
|
rowSeparators: false
|
|
48
47
|
};
|
|
49
48
|
}, [config]);
|
|
@@ -62,7 +61,8 @@ const TreeTable = ({
|
|
|
62
61
|
navigationStyle: "tree",
|
|
63
62
|
rowToObject: rowToTreeNodeObject,
|
|
64
63
|
showColumnHeaderMenus: false,
|
|
65
|
-
selectionModel: "single"
|
|
64
|
+
selectionModel: "single",
|
|
65
|
+
selectionBookendWidth: 0
|
|
66
66
|
}
|
|
67
67
|
);
|
|
68
68
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TreeTable.js","sources":["../../../../packages/vuu-datatable/src/tree-table/TreeTable.tsx"],"sourcesContent":["import { TableProps } from \"@vuu-ui/vuu-table\";\nimport { Table } from \"@vuu-ui/vuu-table\";\nimport { TreeDataSource } from \"@vuu-ui/vuu-data-local\";\nimport { useMemo, useRef } from \"react\";\nimport { TableConfig } from \"@vuu-ui/vuu-table-types\";\nimport {\n metadataKeys,\n type RowToObjectMapper,\n type TreeSourceNode,\n} from \"@vuu-ui/vuu-utils\";\n\nconst { DEPTH, IS_LEAF, KEY, IDX, SELECTED } = metadataKeys;\n\ninterface Props extends Omit<TableProps, \"config\" | \"dataSource\"> {\n config?: Pick<\n TableConfig,\n \"columnSeparators\" | \"rowSeparators\" | \"zebraStripes\"\n >;\n dataSource?: TreeDataSource;\n source?: TreeSourceNode[];\n}\n\nexport type TreeTableProps = Props &\n ({ dataSource: TreeDataSource } | { source: TreeSourceNode[] });\n\nconst rowToTreeNodeObject: RowToObjectMapper = (row, columnMap) => {\n const { [IS_LEAF]: isLeaf, [KEY]: key, [IDX]: index, [DEPTH]: depth } = row;\n const firstColIdx = columnMap.nodeData;\n const labelColIdx = firstColIdx + depth;\n\n return {\n key,\n index,\n isGroupRow: !isLeaf,\n isSelected: row[SELECTED] !== 0,\n data: {\n label: row[labelColIdx],\n nodeData: row[firstColIdx],\n },\n };\n};\n\nexport const TreeTable = ({\n config,\n dataSource,\n source,\n ...tableProps\n}: TreeTableProps) => {\n const dataSourceRef = useRef<TreeDataSource>(undefined);\n useMemo(() => {\n if (dataSource) {\n dataSourceRef.current = dataSource;\n } else if (source) {\n dataSourceRef.current = new TreeDataSource({\n data: source,\n });\n } else {\n throw Error(`TreeTable either source or dataSource must be provided`);\n }\n }, [dataSource, source]);\n\n const tableConfig = useMemo<TableConfig>(() => {\n return {\n ...config,\n columns: dataSourceRef.current?.columnDescriptors ?? [],\n columnSeparators: false,\n
|
|
1
|
+
{"version":3,"file":"TreeTable.js","sources":["../../../../packages/vuu-datatable/src/tree-table/TreeTable.tsx"],"sourcesContent":["import { TableProps } from \"@vuu-ui/vuu-table\";\nimport { Table } from \"@vuu-ui/vuu-table\";\nimport { TreeDataSource } from \"@vuu-ui/vuu-data-local\";\nimport { useMemo, useRef } from \"react\";\nimport { TableConfig } from \"@vuu-ui/vuu-table-types\";\nimport {\n metadataKeys,\n type RowToObjectMapper,\n type TreeSourceNode,\n} from \"@vuu-ui/vuu-utils\";\n\nconst { DEPTH, IS_LEAF, KEY, IDX, SELECTED } = metadataKeys;\n\ninterface Props extends Omit<TableProps, \"config\" | \"dataSource\"> {\n config?: Pick<\n TableConfig,\n \"columnSeparators\" | \"rowSeparators\" | \"zebraStripes\"\n >;\n dataSource?: TreeDataSource;\n source?: TreeSourceNode[];\n}\n\nexport type TreeTableProps = Props &\n ({ dataSource: TreeDataSource } | { source: TreeSourceNode[] });\n\nconst rowToTreeNodeObject: RowToObjectMapper = (row, columnMap) => {\n const { [IS_LEAF]: isLeaf, [KEY]: key, [IDX]: index, [DEPTH]: depth } = row;\n const firstColIdx = columnMap.nodeData;\n const labelColIdx = firstColIdx + depth;\n\n return {\n key,\n index,\n isGroupRow: !isLeaf,\n isSelected: row[SELECTED] !== 0,\n data: {\n label: row[labelColIdx],\n nodeData: row[firstColIdx],\n },\n };\n};\n\nexport const TreeTable = ({\n config,\n dataSource,\n source,\n ...tableProps\n}: TreeTableProps) => {\n const dataSourceRef = useRef<TreeDataSource>(undefined);\n useMemo(() => {\n if (dataSource) {\n dataSourceRef.current = dataSource;\n } else if (source) {\n dataSourceRef.current = new TreeDataSource({\n data: source,\n });\n } else {\n throw Error(`TreeTable either source or dataSource must be provided`);\n }\n }, [dataSource, source]);\n\n const tableConfig = useMemo<TableConfig>(() => {\n return {\n ...config,\n columns: dataSourceRef.current?.columnDescriptors ?? [],\n columnSeparators: false,\n rowSeparators: false,\n };\n }, [config]);\n\n console.log({ tableConfig, dataSource: dataSourceRef.current });\n\n if (dataSourceRef.current === undefined) {\n return null;\n }\n\n return (\n <Table\n {...tableProps}\n className=\"vuuTreeTable\"\n config={tableConfig}\n dataSource={dataSourceRef.current}\n groupToggleTarget=\"toggle-icon\"\n navigationStyle=\"tree\"\n rowToObject={rowToTreeNodeObject}\n showColumnHeaderMenus={false}\n selectionModel=\"single\"\n selectionBookendWidth={0}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;AAWA,MAAM,EAAE,KAAO,EAAA,OAAA,EAAS,GAAK,EAAA,GAAA,EAAK,UAAa,GAAA,YAAA;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AC;AAAA,MACtD,gBAAkB,EAAA,KAAA;AAAA,MAClB,aAAe,EAAA;AAAA,KACjB;AAAA,GACF,EAAG,CAAC,MAAM,CAAC,CAAA;AAEX,EAAA,OAAA,CAAQ,IAAI,EAAE,WAAA,EAAa,UAAY,EAAA,aAAA,CAAc,SAAS,CAAA;AAE9D,EAAI,IAAA,aAAA,CAAc,YAAY,KAAW,CAAA,EAAA;AACvC,IAAO,OAAA,IAAA;AAAA;AAGT,EACE,uBAAA,GAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACE,GAAG,UAAA;AAAA,MACJ,SAAU,EAAA,cAAA;AAAA,MACV,MAAQ,EAAA,WAAA;AAAA,MACR,YAAY,aAAc,CAAA,OAAA;AAAA,MAC1B,iBAAkB,EAAA,aAAA;AAAA,MAClB,eAAgB,EAAA,MAAA;AAAA,MAChB,WAAa,EAAA,mBAAA;AAAA,MACb,qBAAuB,EAAA,KAAA;AAAA,MACvB,cAAe,EAAA,QAAA;AAAA,MACf,qBAAuB,EAAA;AAAA;AAAA,GACzB;AAEJ;;;;"}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.13.111
|
|
2
|
+
"version": "0.13.111",
|
|
3
3
|
"author": "heswell",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"dependencies": {
|
|
6
|
-
"@salt-ds/core": "1.
|
|
6
|
+
"@salt-ds/core": "1.48.0",
|
|
7
7
|
"@salt-ds/styles": "0.2.1",
|
|
8
8
|
"@salt-ds/window": "0.1.1",
|
|
9
|
-
"@vuu-ui/vuu-data-local": "0.13.111
|
|
10
|
-
"@vuu-ui/vuu-table-types": "0.13.111
|
|
11
|
-
"@vuu-ui/vuu-filters": "0.13.111
|
|
12
|
-
"@vuu-ui/vuu-layout": "0.13.111
|
|
13
|
-
"@vuu-ui/vuu-popups": "0.13.111
|
|
14
|
-
"@vuu-ui/vuu-shell": "0.13.111
|
|
15
|
-
"@vuu-ui/vuu-table": "0.13.111
|
|
16
|
-
"@vuu-ui/vuu-table-extras": "0.13.111
|
|
17
|
-
"@vuu-ui/vuu-ui-controls": "0.13.111
|
|
18
|
-
"@vuu-ui/vuu-utils": "0.13.111
|
|
9
|
+
"@vuu-ui/vuu-data-local": "0.13.111",
|
|
10
|
+
"@vuu-ui/vuu-table-types": "0.13.111",
|
|
11
|
+
"@vuu-ui/vuu-filters": "0.13.111",
|
|
12
|
+
"@vuu-ui/vuu-layout": "0.13.111",
|
|
13
|
+
"@vuu-ui/vuu-popups": "0.13.111",
|
|
14
|
+
"@vuu-ui/vuu-shell": "0.13.111",
|
|
15
|
+
"@vuu-ui/vuu-table": "0.13.111",
|
|
16
|
+
"@vuu-ui/vuu-table-extras": "0.13.111",
|
|
17
|
+
"@vuu-ui/vuu-ui-controls": "0.13.111",
|
|
18
|
+
"@vuu-ui/vuu-utils": "0.13.111"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"clsx": "^2.0.0",
|