@taocompany/magic-grid 0.14.3 → 0.15.0
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/AGENTS.md +49 -47
- package/README.md +4317 -4341
- package/dist/api-manifest.json +29 -47
- package/dist/components/MagicGrid/MagicGrid.vue.d.ts +68 -104
- package/dist/components/MagicGrid/MagicGrid.vue.d.ts.map +1 -1
- package/dist/components/MagicGrid/index.d.ts +72 -3
- package/dist/components/MagicGrid/index.d.ts.map +1 -1
- package/dist/components/MagicGrid/magicGridProps.d.ts +2 -18
- package/dist/components/MagicGrid/magicGridProps.d.ts.map +1 -1
- package/dist/components/MagicGrid/magicGridSlotBridge.d.ts.map +1 -1
- package/dist/components/MagicGrid/useMagicGrid.d.ts.map +1 -1
- package/dist/components/cellRenderer/vueCellRendererHost.d.ts.map +1 -1
- package/dist/components/vueHostSafeUnmount.d.ts.map +1 -1
- package/dist/core/cell/cellCtrl.d.ts +3 -1
- package/dist/core/cell/cellCtrl.d.ts.map +1 -1
- package/dist/core/column/applyHeaderCells.d.ts.map +1 -1
- package/dist/core/column/columnModel.d.ts +4 -1
- package/dist/core/column/columnModel.d.ts.map +1 -1
- package/dist/core/column/createGroupColumnDef.d.ts +0 -2
- package/dist/core/column/createGroupColumnDef.d.ts.map +1 -1
- package/dist/core/column/prepareGridColumnDefs.d.ts +2 -2
- package/dist/core/column/prepareGridColumnDefs.d.ts.map +1 -1
- package/dist/core/column/renderGroupCell.d.ts +7 -4
- package/dist/core/column/renderGroupCell.d.ts.map +1 -1
- package/dist/core/column/renderTreeHeaderCell.d.ts +1 -1
- package/dist/core/editing/cellEditPipeline.d.ts +3 -1
- package/dist/core/editing/cellEditPipeline.d.ts.map +1 -1
- package/dist/core/editing/cellEditorHost.d.ts.map +1 -1
- package/dist/core/grid/grid.d.ts +9 -1
- package/dist/core/grid/grid.d.ts.map +1 -1
- package/dist/core/grid/gridBootstrap.d.ts.map +1 -1
- package/dist/core/grid/gridHierarchyOps.d.ts +1 -0
- package/dist/core/grid/gridHierarchyOps.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/cellBodyInteractionHandlers.d.ts +2 -0
- package/dist/core/grid/gridInteraction/cellBodyInteractionHandlers.d.ts.map +1 -1
- package/dist/core/grid/gridInteraction/focusController.d.ts.map +1 -1
- package/dist/core/pipeline/stages/mapStage.d.ts +0 -3
- package/dist/core/pipeline/stages/mapStage.d.ts.map +1 -1
- package/dist/core/row/cellComp.d.ts +11 -2
- package/dist/core/row/cellComp.d.ts.map +1 -1
- package/dist/core/row/rowComp.d.ts.map +1 -1
- package/dist/core/selection/cellClipboardCell.d.ts.map +1 -1
- package/dist/core/treeTable/resolveGridHierarchyMode.d.ts +2 -1
- package/dist/core/treeTable/resolveGridHierarchyMode.d.ts.map +1 -1
- package/dist/core/treeTable/treeHierarchyMove.d.ts.map +1 -1
- package/dist/core/treeTable/treeTableService.d.ts.map +1 -1
- package/dist/core/types/column.d.ts +5 -0
- package/dist/core/types/column.d.ts.map +1 -1
- package/dist/core/types/index.d.ts +2 -2
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/core/types/treeTable.d.ts +37 -33
- package/dist/core/types/treeTable.d.ts.map +1 -1
- package/dist/getRowDragCommitHierarchy-DoMf_SY8.cjs.map +1 -1
- package/dist/getRowDragCommitHierarchy-pWgukMAX.js.map +1 -1
- package/dist/index.cjs.js +6 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +4678 -4633
- package/dist/index.es.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/token-catalog.json +2 -2
- package/dist/types/core.d.ts +22 -22
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/magic-grid.d.ts +19 -14
- package/dist/types/magic-grid.d.ts.map +1 -1
- package/dist/validation-BHqm5Flb.js.map +1 -1
- package/dist/validation-CD6lt5wS.cjs.map +1 -1
- package/llms.txt +19 -19
- package/package.json +126 -126
package/dist/api-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"manifestVersion": 1,
|
|
3
|
-
"libraryVersion": "0.
|
|
4
|
-
"generatedAt": "2026-11-
|
|
3
|
+
"libraryVersion": "0.15.0",
|
|
4
|
+
"generatedAt": "2026-11-06T08:32:34.980Z",
|
|
5
5
|
"props": [
|
|
6
6
|
{
|
|
7
7
|
"name": "columns",
|
|
@@ -808,45 +808,17 @@
|
|
|
808
808
|
},
|
|
809
809
|
{
|
|
810
810
|
"name": "tree",
|
|
811
|
-
"type": "boolean",
|
|
811
|
+
"type": "boolean | string",
|
|
812
812
|
"default": "false",
|
|
813
813
|
"required": false,
|
|
814
|
-
"notes": "
|
|
814
|
+
"notes": "树形开关。默认 `false`。与 `rowGrouping` 互斥。"
|
|
815
815
|
},
|
|
816
816
|
{
|
|
817
817
|
"name": "getDataPath",
|
|
818
818
|
"type": "GetDataPathFn",
|
|
819
819
|
"default": "undefined",
|
|
820
820
|
"required": false,
|
|
821
|
-
"notes": "
|
|
822
|
-
},
|
|
823
|
-
{
|
|
824
|
-
"name": "showTreeColumn",
|
|
825
|
-
"type": "boolean",
|
|
826
|
-
"default": "undefined",
|
|
827
|
-
"required": false,
|
|
828
|
-
"notes": "是否展示 tree 系统列。默认 `true`"
|
|
829
|
-
},
|
|
830
|
-
{
|
|
831
|
-
"name": "autoTreeColumnDef",
|
|
832
|
-
"type": "Partial<ColumnDef<TData>>",
|
|
833
|
-
"default": "undefined",
|
|
834
|
-
"required": false,
|
|
835
|
-
"notes": "覆盖 tree 系统列 colDef"
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
"name": "treeValueGetter",
|
|
839
|
-
"type": "TreeValueGetterFn",
|
|
840
|
-
"default": "undefined",
|
|
841
|
-
"required": false,
|
|
842
|
-
"notes": "自定义 tree 列展示值"
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
"name": "treeDisplayType",
|
|
846
|
-
"type": "TreeDisplayType",
|
|
847
|
-
"default": "undefined",
|
|
848
|
-
"required": false,
|
|
849
|
-
"notes": "树节点展示列模式。当前仅支持 `singleColumn`"
|
|
821
|
+
"notes": "树形路径回调。开启 `tree` 时必填;缺失则不建树并 console.warn"
|
|
850
822
|
},
|
|
851
823
|
{
|
|
852
824
|
"name": "treeDragScope",
|
|
@@ -2451,6 +2423,16 @@
|
|
|
2451
2423
|
"type": "string",
|
|
2452
2424
|
"notes": "覆盖 Grid `groupFooterLabel` 的本列小计文案"
|
|
2453
2425
|
},
|
|
2426
|
+
{
|
|
2427
|
+
"name": "isTree",
|
|
2428
|
+
"type": "boolean",
|
|
2429
|
+
"notes": "树列候选。是否成为树列由 Grid `tree` 决定:"
|
|
2430
|
+
},
|
|
2431
|
+
{
|
|
2432
|
+
"name": "showTree",
|
|
2433
|
+
"type": "boolean",
|
|
2434
|
+
"notes": "选中的树列是否绘制缩进与展开按钮。默认 true。"
|
|
2435
|
+
},
|
|
2454
2436
|
{
|
|
2455
2437
|
"name": "autoHeight",
|
|
2456
2438
|
"type": "boolean",
|
|
@@ -2801,67 +2783,67 @@
|
|
|
2801
2783
|
{
|
|
2802
2784
|
"id": "basic",
|
|
2803
2785
|
"intent": "基础只读表格:columns / data / rowKey 与样式引入 -->",
|
|
2804
|
-
"code": "<!-- @intent 基础只读表格:columns / data / rowKey 与样式引入 -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; name: string }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'id', label: 'ID', width: 80 },\n { prop: 'name', label: '名称' },\n])\nconst data = ref<Row[]>([\n { id: 1, name: 'Alpha' },\n { id: 2, name: 'Beta' },\n])\n</script>\n\n<template>\n <MagicGrid :columns=\"columns\" :data=\"data\" row-key=\"id\" height=\"360\" />\n</template>\n"
|
|
2786
|
+
"code": "<!-- @intent 基础只读表格:columns / data / rowKey 与样式引入 -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; name: string }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'id', label: 'ID', width: 80 },\r\n { prop: 'name', label: '名称' },\r\n])\r\nconst data = ref<Row[]>([\r\n { id: 1, name: 'Alpha' },\r\n { id: 2, name: 'Beta' },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid :columns=\"columns\" :data=\"data\" row-key=\"id\" height=\"360\" />\r\n</template>\r\n"
|
|
2805
2787
|
},
|
|
2806
2788
|
{
|
|
2807
2789
|
"id": "edit-validation",
|
|
2808
2790
|
"intent": "单击编辑与列级 cellValidator -->",
|
|
2809
|
-
"code": "<!-- @intent 单击编辑与列级 cellValidator -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; qty: number }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'id', label: 'ID', width: 80, editable: false },\n {\n prop: 'qty',\n label: '数量',\n editable: true,\n cellValidator: (p) =>\n Number(p.parsedValue) >= 0 ? undefined : ['须 ≥ 0'],\n },\n])\nconst data = ref<Row[]>([{ id: 1, qty: 10 }])\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n edit-type=\"singleClick\"\n invalid-edit-value-mode=\"block\"\n height=\"360\"\n />\n</template>\n"
|
|
2791
|
+
"code": "<!-- @intent 单击编辑与列级 cellValidator -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; qty: number }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'id', label: 'ID', width: 80, editable: false },\r\n {\r\n prop: 'qty',\r\n label: '数量',\r\n editable: true,\r\n cellValidator: (p) =>\r\n Number(p.parsedValue) >= 0 ? undefined : ['须 ≥ 0'],\r\n },\r\n])\r\nconst data = ref<Row[]>([{ id: 1, qty: 10 }])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n edit-type=\"singleClick\"\r\n invalid-edit-value-mode=\"block\"\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2810
2792
|
},
|
|
2811
2793
|
{
|
|
2812
2794
|
"id": "pinned-summary",
|
|
2813
2795
|
"intent": "固定列与表尾汇总 -->",
|
|
2814
|
-
"code": "<!-- @intent 固定列与表尾汇总 -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; region: string; amount: number }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'id', label: 'ID', width: 70, fixed: 'left' },\n { prop: 'region', label: '区域' },\n { prop: 'amount', label: '金额', summaryAgg: 'sum' },\n])\nconst data = ref<Row[]>([\n { id: 1, region: '华东', amount: 100 },\n { id: 2, region: '华北', amount: 200 },\n])\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n show-summary\n summary-scope=\"displayed\"\n height=\"360\"\n />\n</template>\n"
|
|
2796
|
+
"code": "<!-- @intent 固定列与表尾汇总 -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; region: string; amount: number }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'id', label: 'ID', width: 70, fixed: 'left' },\r\n { prop: 'region', label: '区域' },\r\n { prop: 'amount', label: '金额', summaryAgg: 'sum' },\r\n])\r\nconst data = ref<Row[]>([\r\n { id: 1, region: '华东', amount: 100 },\r\n { id: 2, region: '华北', amount: 200 },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n show-summary\r\n summary-scope=\"displayed\"\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2815
2797
|
},
|
|
2816
2798
|
{
|
|
2817
2799
|
"id": "filter-quick",
|
|
2818
2800
|
"intent": "列筛选与 quickFilterText -->",
|
|
2819
|
-
"code": "<!-- @intent 列筛选与 quickFilterText -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; sku: string }\n\nconst quickFilterText = ref('')\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'id', label: 'ID', width: 80 },\n { prop: 'sku', label: 'SKU', filterable: true },\n])\nconst data = ref<Row[]>([\n { id: 1, sku: 'A-001' },\n { id: 2, sku: 'B-002' },\n])\n</script>\n\n<template>\n <MagicGrid\n :quick-filter-text=\"quickFilterText\"\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n filterable\n height=\"360\"\n />\n</template>\n"
|
|
2801
|
+
"code": "<!-- @intent 列筛选与 quickFilterText -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; sku: string }\r\n\r\nconst quickFilterText = ref('')\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'id', label: 'ID', width: 80 },\r\n { prop: 'sku', label: 'SKU', filterable: true },\r\n])\r\nconst data = ref<Row[]>([\r\n { id: 1, sku: 'A-001' },\r\n { id: 2, sku: 'B-002' },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :quick-filter-text=\"quickFilterText\"\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n filterable\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2820
2802
|
},
|
|
2821
2803
|
{
|
|
2822
2804
|
"id": "selection-index",
|
|
2823
2805
|
"intent": "行选择与索引列 -->",
|
|
2824
|
-
"code": "<!-- @intent 行选择与索引列 -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; name: string }\n\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'name', label: '名称' }])\nconst data = ref<Row[]>([\n { id: 1, name: 'One' },\n { id: 2, name: 'Two' },\n])\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n row-selection=\"multiple\"\n show-index-column\n height=\"360\"\n />\n</template>\n"
|
|
2806
|
+
"code": "<!-- @intent 行选择与索引列 -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; name: string }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'name', label: '名称' }])\r\nconst data = ref<Row[]>([\r\n { id: 1, name: 'One' },\r\n { id: 2, name: 'Two' },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n row-selection=\"multiple\"\r\n show-index-column\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2825
2807
|
},
|
|
2826
2808
|
{
|
|
2827
2809
|
"id": "row-grouping",
|
|
2828
2810
|
"intent": "行分组 rowGrouping -->",
|
|
2829
|
-
"code": "<!-- @intent 行分组 rowGrouping -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; country: string; city: string }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'country', label: '国家', rowGroup: true },\n { prop: 'city', label: '城市' },\n])\nconst data = ref<Row[]>([\n { id: 1, country: 'CN', city: '上海' },\n { id: 2, country: 'CN', city: '北京' },\n])\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n row-grouping\n :group-default-expanded=\"1\"\n height=\"360\"\n />\n</template>\n"
|
|
2811
|
+
"code": "<!-- @intent 行分组 rowGrouping -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; country: string; city: string }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'country', label: '国家', rowGroup: true },\r\n { prop: 'city', label: '城市' },\r\n])\r\nconst data = ref<Row[]>([\r\n { id: 1, country: 'CN', city: '上海' },\r\n { id: 2, country: 'CN', city: '北京' },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n row-grouping\r\n :group-default-expanded=\"1\"\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2830
2812
|
},
|
|
2831
2813
|
{
|
|
2832
2814
|
"id": "tree",
|
|
2833
|
-
"intent": "树形表格 tree +
|
|
2834
|
-
"code": "<!-- @intent 树形表格 tree +
|
|
2815
|
+
"intent": "树形表格 tree + getDataPath + 列 isTree -->",
|
|
2816
|
+
"code": "<!-- @intent 树形表格 tree + getDataPath + 列 isTree -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: string; name: string; pathSegments: string[] }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'name', label: '节点', isTree: true }])\r\nconst data = ref<Row[]>([\r\n { id: '1', name: '根', pathSegments: ['根'] },\r\n { id: '1-1', name: '子', pathSegments: ['根', '子'] },\r\n])\r\n\r\nfunction getDataPath({ data }: { data: Row }) {\r\n return data.pathSegments\r\n}\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n tree\r\n :get-data-path=\"getDataPath\"\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2835
2817
|
},
|
|
2836
2818
|
{
|
|
2837
2819
|
"id": "tree-lazy",
|
|
2838
2820
|
"intent": "树形懒加载 loadTreeChildren -->",
|
|
2839
|
-
"code": "<!-- @intent 树形懒加载 loadTreeChildren -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: string; name: string; pathSegments: string[] }\n\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'name', label: '节点' }])\nconst data = ref<Row[]>([{ id: 'r', name: '根', pathSegments: ['根'] }])\n\nfunction getDataPath(
|
|
2821
|
+
"code": "<!-- @intent 树形懒加载 loadTreeChildren -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: string; name: string; pathSegments: string[] }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'name', label: '节点', isTree: true }])\r\nconst data = ref<Row[]>([{ id: 'r', name: '根', pathSegments: ['根'] }])\r\n\r\nfunction getDataPath({ data }: { data: Row }) {\r\n return data.pathSegments\r\n}\r\n\r\nasync function loadTreeChildren({\r\n parentData,\r\n dataPath,\r\n}: {\r\n parentData: Row\r\n dataPath: string[]\r\n}) {\r\n return [{ id: `${parentData.id}-1`, name: '懒加载子节点', pathSegments: [...dataPath, '子'] }]\r\n}\r\n\r\nfunction hasTreeChildren({ dataPath }: { dataPath: string[] }) {\r\n return dataPath.length < 2\r\n}\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n tree\r\n tree-lazy-load\r\n :get-data-path=\"getDataPath\"\r\n :load-tree-children=\"loadTreeChildren\"\r\n :has-tree-children=\"hasTreeChildren\"\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2840
2822
|
},
|
|
2841
2823
|
{
|
|
2842
2824
|
"id": "master-detail",
|
|
2843
2825
|
"intent": "主从展开 masterDetail + getDetailRowData -->",
|
|
2844
|
-
"code": "<!-- @intent 主从展开 masterDetail + getDetailRowData -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; orderNo: string }\n\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'orderNo', label: '订单号' }])\nconst data = ref<Row[]>([{ id: 1, orderNo: 'SO-1001' }])\n\nasync function getDetailRowData(_row: Row) {\n return { lines: [{ sku: 'X', qty: 1 }] }\n}\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n master-detail\n :get-detail-row-data=\"getDetailRowData\"\n height=\"360\"\n >\n <template #detail-row=\"{ detailRowData }\">\n <pre>{{ detailRowData }}</pre>\n </template>\n </MagicGrid>\n</template>\n"
|
|
2826
|
+
"code": "<!-- @intent 主从展开 masterDetail + getDetailRowData -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; orderNo: string }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([{ prop: 'orderNo', label: '订单号' }])\r\nconst data = ref<Row[]>([{ id: 1, orderNo: 'SO-1001' }])\r\n\r\nasync function getDetailRowData(_row: Row) {\r\n return { lines: [{ sku: 'X', qty: 1 }] }\r\n}\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n master-detail\r\n :get-detail-row-data=\"getDetailRowData\"\r\n height=\"360\"\r\n >\r\n <template #detail-row=\"{ detailRowData }\">\r\n <pre>{{ detailRowData }}</pre>\r\n </template>\r\n </MagicGrid>\r\n</template>\r\n"
|
|
2845
2827
|
},
|
|
2846
2828
|
{
|
|
2847
2829
|
"id": "cell-selection",
|
|
2848
2830
|
"intent": "框选与粘贴 cellSelection -->",
|
|
2849
|
-
"code": "<!-- @intent 框选与粘贴 cellSelection -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; a: number; b: number }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'a', label: 'A' },\n { prop: 'b', label: 'B' },\n])\nconst data = ref<Row[]>([\n { id: 1, a: 1, b: 2 },\n { id: 2, a: 3, b: 4 },\n])\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n :cell-selection=\"{ handleMode: 'range' }\"\n enable-cell-paste\n height=\"360\"\n />\n</template>\n"
|
|
2831
|
+
"code": "<!-- @intent 框选与粘贴 cellSelection -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; a: number; b: number }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'a', label: 'A' },\r\n { prop: 'b', label: 'B' },\r\n])\r\nconst data = ref<Row[]>([\r\n { id: 1, a: 1, b: 2 },\r\n { id: 2, a: 3, b: 4 },\r\n])\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n :cell-selection=\"{ handleMode: 'range' }\"\r\n enable-cell-paste\r\n height=\"360\"\r\n />\r\n</template>\r\n"
|
|
2850
2832
|
},
|
|
2851
2833
|
{
|
|
2852
2834
|
"id": "row-move",
|
|
2853
2835
|
"intent": "编程式行移动 GridApi.moveRow + indexMode -->",
|
|
2854
|
-
"code": "<!-- @intent 编程式行移动 GridApi.moveRow + indexMode -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { MagicGrid, type MagicGridComponent } from '@taocompany/magic-grid'\nimport type {\n ColumnDef,\n MagicGridExpose,\n RowIndexMode,\n} from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; name: string }\n\ntype MagicGridInstance = InstanceType<MagicGridComponent> & MagicGridExpose\n\nconst gridRef = ref<MagicGridInstance>()\nconst columns = ref<ColumnDef[]>([{ prop: 'name', label: '名称' }])\nconst data = ref<Row[]>([\n { id: 1, name: 'First' },\n { id: 2, name: 'Second' },\n])\n\nconst indexMode: RowIndexMode = 'source'\n\nfunction moveUp() {\n void gridRef.value?.api?.moveRow(2, 0, indexMode)\n}\n</script>\n\n<template>\n <button type=\"button\" @click=\"moveUp\">上移第二行</button>\n <MagicGrid ref=\"gridRef\" :columns=\"columns\" :data=\"data\" row-key=\"id\" show-index-column height=\"360\" />\n</template>\n"
|
|
2836
|
+
"code": "<!-- @intent 编程式行移动 GridApi.moveRow + indexMode -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport { MagicGrid, type MagicGridComponent } from '@taocompany/magic-grid'\r\nimport type {\r\n ColumnDef,\r\n MagicGridExpose,\r\n RowIndexMode,\r\n} from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; name: string }\r\n\r\ntype MagicGridInstance = InstanceType<MagicGridComponent> & MagicGridExpose\r\n\r\nconst gridRef = ref<MagicGridInstance>()\r\nconst columns = ref<ColumnDef[]>([{ prop: 'name', label: '名称' }])\r\nconst data = ref<Row[]>([\r\n { id: 1, name: 'First' },\r\n { id: 2, name: 'Second' },\r\n])\r\n\r\nconst indexMode: RowIndexMode = 'source'\r\n\r\nfunction moveUp() {\r\n void gridRef.value?.api?.moveRow(2, 0, indexMode)\r\n}\r\n</script>\r\n\r\n<template>\r\n <button type=\"button\" @click=\"moveUp\">上移第二行</button>\r\n <MagicGrid ref=\"gridRef\" :columns=\"columns\" :data=\"data\" row-key=\"id\" show-index-column height=\"360\" />\r\n</template>\r\n"
|
|
2855
2837
|
},
|
|
2856
2838
|
{
|
|
2857
2839
|
"id": "performance",
|
|
2858
2840
|
"intent": "虚拟滚动与渲染性能调参 -->",
|
|
2859
|
-
"code": "<!-- @intent 虚拟滚动与渲染性能调参 -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport MagicGrid from '@taocompany/magic-grid'\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ninterface Row { id: number; value: string }\n\nconst columns = ref<ColumnDef<Row>[]>([\n { prop: 'id', label: 'ID', width: 90 },\n { prop: 'value', label: '值' },\n])\nconst data = ref<Row[]>(\n Array.from({ length: 5000 }, (_, i) => ({ id: i + 1, value: `row-${i + 1}` })),\n)\n</script>\n\n<template>\n <MagicGrid\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n :row-buffer=\"20\"\n :scroll-end-flush-ms=\"16\"\n cell-renderer-presentation=\"deferred\"\n height=\"480\"\n />\n</template>\n"
|
|
2841
|
+
"code": "<!-- @intent 虚拟滚动与渲染性能调参 -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport MagicGrid from '@taocompany/magic-grid'\r\nimport type { ColumnDef } from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ninterface Row { id: number; value: string }\r\n\r\nconst columns = ref<ColumnDef<Row>[]>([\r\n { prop: 'id', label: 'ID', width: 90 },\r\n { prop: 'value', label: '值' },\r\n])\r\nconst data = ref<Row[]>(\r\n Array.from({ length: 5000 }, (_, i) => ({ id: i + 1, value: `row-${i + 1}` })),\r\n)\r\n</script>\r\n\r\n<template>\r\n <MagicGrid\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n :row-buffer=\"20\"\r\n :scroll-end-flush-ms=\"16\"\r\n cell-renderer-presentation=\"deferred\"\r\n height=\"480\"\r\n />\r\n</template>\r\n"
|
|
2860
2842
|
},
|
|
2861
2843
|
{
|
|
2862
2844
|
"id": "add-rows",
|
|
2863
2845
|
"intent": "新增行 插入行 applyTransaction addRows setData getData index indexMode 临时行 -->",
|
|
2864
|
-
"code": "<!-- @intent 新增行 插入行 applyTransaction addRows setData getData index indexMode 临时行 -->\n<script setup lang=\"ts\">\nimport { ref } from 'vue'\nimport { MagicGrid, type MagicGridComponent } from '@taocompany/magic-grid'\nimport type {\n ColumnDef,\n MagicGridExpose,\n RowData,\n} from '@taocompany/magic-grid/types/core'\nimport '@taocompany/magic-grid/tokens.css'\nimport '@taocompany/magic-grid/style.css'\n\ntype GridRef = InstanceType<MagicGridComponent> & MagicGridExpose\n\nconst gridRef = ref<GridRef>()\nconst columns = ref<ColumnDef[]>([\n { prop: 'id', label: 'ID', width: 80 },\n { prop: 'name', label: '名称', editable: true },\n])\nconst data = ref<RowData[]>([\n { id: 1, name: 'A' },\n { id: 2, name: 'B' },\n])\n\n/** applyTransaction:末尾追加一行 */\nasync function addByTransaction() {\n const api = gridRef.value?.api\n if (!api) return\n await api.applyTransaction({\n add: [{ id: Date.now(), name: 'New' }],\n })\n}\n\n/** applyTransaction:指定 source 下标插入 */\nasync function insertAtIndex() {\n const api = gridRef.value?.api\n if (!api) return\n await api.applyTransaction({\n add: [{ data: { id: Date.now(), name: 'Inserted' }, index: 1, indexMode: 'source' }],\n })\n}\n\n/** addRows:声明式批量新增(推荐) */\nasync function addByApi() {\n const api = gridRef.value?.api\n if (!api) return\n await api.addRows({\n rows: [{ data: { name: 'Temp' } }],\n index: 0,\n indexMode: 'source',\n })\n}\n\nfunction readAll() {\n return gridRef.value?.api?.getData() ?? gridRef.value?.getData() ?? []\n}\n\nfunction replaceAll(rows: RowData[]) {\n gridRef.value?.api?.setData(rows)\n}\n</script>\n\n<template>\n <div class=\"toolbar\">\n <button type=\"button\" @click=\"addByTransaction\">transaction 追加</button>\n <button type=\"button\" @click=\"insertAtIndex\">transaction 插入 index=1</button>\n <button type=\"button\" @click=\"addByApi\">addRows 组内首位</button>\n </div>\n <MagicGrid\n ref=\"gridRef\"\n :columns=\"columns\"\n :data=\"data\"\n row-key=\"id\"\n edit-type=\"singleClick\"\n height=\"360\"\n />\n</template>\n\n<style scoped>\n.toolbar {\n display: flex;\n gap: 8px;\n margin-bottom: 8px;\n}\n</style>\n"
|
|
2846
|
+
"code": "<!-- @intent 新增行 插入行 applyTransaction addRows setData getData index indexMode 临时行 -->\r\n<script setup lang=\"ts\">\r\nimport { ref } from 'vue'\r\nimport { MagicGrid, type MagicGridComponent } from '@taocompany/magic-grid'\r\nimport type {\r\n ColumnDef,\r\n MagicGridExpose,\r\n RowData,\r\n} from '@taocompany/magic-grid/types/core'\r\nimport '@taocompany/magic-grid/tokens.css'\r\nimport '@taocompany/magic-grid/style.css'\r\n\r\ntype GridRef = InstanceType<MagicGridComponent> & MagicGridExpose\r\n\r\nconst gridRef = ref<GridRef>()\r\nconst columns = ref<ColumnDef[]>([\r\n { prop: 'id', label: 'ID', width: 80 },\r\n { prop: 'name', label: '名称', editable: true },\r\n])\r\nconst data = ref<RowData[]>([\r\n { id: 1, name: 'A' },\r\n { id: 2, name: 'B' },\r\n])\r\n\r\n/** applyTransaction:末尾追加一行 */\r\nasync function addByTransaction() {\r\n const api = gridRef.value?.api\r\n if (!api) return\r\n await api.applyTransaction({\r\n add: [{ id: Date.now(), name: 'New' }],\r\n })\r\n}\r\n\r\n/** applyTransaction:指定 source 下标插入 */\r\nasync function insertAtIndex() {\r\n const api = gridRef.value?.api\r\n if (!api) return\r\n await api.applyTransaction({\r\n add: [{ data: { id: Date.now(), name: 'Inserted' }, index: 1, indexMode: 'source' }],\r\n })\r\n}\r\n\r\n/** addRows:声明式批量新增(推荐) */\r\nasync function addByApi() {\r\n const api = gridRef.value?.api\r\n if (!api) return\r\n await api.addRows({\r\n rows: [{ data: { name: 'Temp' } }],\r\n index: 0,\r\n indexMode: 'source',\r\n })\r\n}\r\n\r\nfunction readAll() {\r\n return gridRef.value?.api?.getData() ?? gridRef.value?.getData() ?? []\r\n}\r\n\r\nfunction replaceAll(rows: RowData[]) {\r\n gridRef.value?.api?.setData(rows)\r\n}\r\n</script>\r\n\r\n<template>\r\n <div class=\"toolbar\">\r\n <button type=\"button\" @click=\"addByTransaction\">transaction 追加</button>\r\n <button type=\"button\" @click=\"insertAtIndex\">transaction 插入 index=1</button>\r\n <button type=\"button\" @click=\"addByApi\">addRows 组内首位</button>\r\n </div>\r\n <MagicGrid\r\n ref=\"gridRef\"\r\n :columns=\"columns\"\r\n :data=\"data\"\r\n row-key=\"id\"\r\n edit-type=\"singleClick\"\r\n height=\"360\"\r\n />\r\n</template>\r\n\r\n<style scoped>\r\n.toolbar {\r\n display: flex;\r\n gap: 8px;\r\n margin-bottom: 8px;\r\n}\r\n</style>\r\n"
|
|
2865
2847
|
}
|
|
2866
2848
|
],
|
|
2867
2849
|
"types": [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GridApi } from '../../core/api/gridApi';
|
|
2
2
|
import { GridSize, StatusBarHeightInput } from '../../core/theme/gridSize';
|
|
3
|
-
import { DetailRowSlotParams, OverlaySlotParams, ColumnDef, RowData, GridBorder, GridTheme
|
|
3
|
+
import { DetailRowSlotParams, OverlaySlotParams, ColumnDef, RowData, GridBorder, GridTheme } from '../../types/magic-grid';
|
|
4
4
|
import { StatusBarContext, StatusBarRangeAggregationPosition } from '../../types/status-bar';
|
|
5
5
|
import { DefineComponent, ExtractPropTypes, PropType, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
6
|
-
import { InfiniteRowDatasource, CellEditorFn, CellStyle, IndexColumnOptions, SelectionColumnOptions, SummaryScope, SummaryMethod, GridHorizontalAlign, GridVerticalAlign, RowSelectionInput, SelectableFn, IsRowDisabledFn, RowStyle, CellEditBehavior, CellEditType, EditorOptions, InvalidEditValueMode, RowValidator, AsyncRowMutationHandlers, SortModelItem, GetRowHeightFn, IsRowMasterFn, DetailRowHeightFn, GetDetailRowDataFn, DetailCellRendererFn, LoadMoreRowRendererFn, GroupDisplayType, GroupKeyCreatorFn, GroupComparatorFn, GroupCellRendererFn, GetDataPathFn,
|
|
7
|
-
import { DefaultSelectedRowsInput, ApplyDefaultSelectedRowsOptions, TooltipComponentFactory, OverlayComponentFactory } from '../../types/core';
|
|
6
|
+
import { InfiniteRowDatasource, CellEditorFn, CellStyle, IndexColumnOptions, SelectionColumnOptions, SummaryScope, SummaryMethod, GridHorizontalAlign, GridVerticalAlign, RowSelectionInput, SelectableFn, IsRowDisabledFn, RowStyle, CellEditBehavior, CellEditType, EditorOptions, InvalidEditValueMode, RowValidator, AsyncRowMutationHandlers, SortModelItem, GetRowHeightFn, IsRowMasterFn, DetailRowHeightFn, GetDetailRowDataFn, DetailCellRendererFn, LoadMoreRowRendererFn, GroupDisplayType, GroupKeyCreatorFn, GroupComparatorFn, GroupCellRendererFn, GetDataPathFn, TreeDragScope, SetDataPathFn, HasTreeChildrenFn, LoadTreeChildrenFn, CellCommentsDataSource, CellCommentTrigger, CellSelectionOptions, TooltipShowMode, TooltipComponentType, OverlayType, OverlayComponentType, GridMetrics, FilterModel, GetDataOptions, RowTransaction, RowNodeTransaction, ScrollEvent, LoadMoreEvent, CellClickedEvent, RowClickedEvent, RowDoubleClickedEvent, SelectionChangedEvent, IndexFocusChangedEvent, CellValueChangedEvent, RowDataChangedEvent, RowsDataChangedEvent, CellEditingStartedEvent, CellEditingStoppedEvent, CellCommitStartedEvent, CellCommitFinishedEvent, EditCommitAbortedEvent, RowCommitStartedEvent, RowCommitFinishedEvent, RowEditingStartedEvent, RowEditingStoppedEvent, RowValueChangedEvent, CellValidationFailedEvent, RowValidationFailedEvent, ColumnMovedEvent, ColumnResizedEvent, ColumnPinnedEvent, ColumnHiddenChangedEvent, RowsAddedEvent, RowsRemovedEvent, RowIdPromotedEvent, RowMovedEvent, RowDragEndEvent, RowDragCommitStartedEvent, RowDragCommitFinishedEvent, RowHeightChangedEvent, RowExpansionChangedEvent, RowGroupOpenedEvent, RowGroupChangedEvent, TreeNodeOpenedEvent, TreeChildrenLoadingEvent, TreeChildrenLoadedEvent, TreeChildrenLoadFailedEvent, CellCommentChangedEvent, CellSelectionChangedEvent, CellSelectionDeleteStartEvent, CellSelectionDeleteEndEvent, OverlayShownEvent, OverlayHiddenEvent, InfiniteBlockLoadingEvent, InfiniteBlockLoadedEvent, InfiniteBlockLoadFailedEvent, InfiniteCachePurgedEvent } from '../../core';
|
|
7
|
+
import { DefaultSelectedRowsInput, AutoSizeStrategy, ProcessCellForClipboardFn, ProcessCellFromClipboardFn, ProcessDataFromClipboardFn, ApplyDefaultSelectedRowsOptions, TooltipComponentFactory, OverlayComponentFactory } from '../../types/core';
|
|
8
8
|
import { StatusBarRangeAggregationPrecisionInput } from '../StatusBar/resolveStatusBarRangeAggregationPrecision';
|
|
9
9
|
import { GridReadyEvent, GridDestroyedEvent, FirstRenderedEvent } from '../..';
|
|
10
10
|
type __VLS_Slots = {
|
|
@@ -496,29 +496,13 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
496
496
|
readonly default: undefined;
|
|
497
497
|
};
|
|
498
498
|
readonly tree: {
|
|
499
|
-
readonly type:
|
|
499
|
+
readonly type: PropType<boolean | string>;
|
|
500
500
|
readonly default: false;
|
|
501
501
|
};
|
|
502
502
|
readonly getDataPath: {
|
|
503
503
|
readonly type: PropType<GetDataPathFn>;
|
|
504
504
|
readonly default: undefined;
|
|
505
505
|
};
|
|
506
|
-
readonly showTreeColumn: {
|
|
507
|
-
readonly type: BooleanConstructor;
|
|
508
|
-
readonly default: undefined;
|
|
509
|
-
};
|
|
510
|
-
readonly autoTreeColumnDef: {
|
|
511
|
-
readonly type: PropType<Partial< ColumnDef>>;
|
|
512
|
-
readonly default: undefined;
|
|
513
|
-
};
|
|
514
|
-
readonly treeValueGetter: {
|
|
515
|
-
readonly type: PropType<TreeValueGetterFn>;
|
|
516
|
-
readonly default: undefined;
|
|
517
|
-
};
|
|
518
|
-
readonly treeDisplayType: {
|
|
519
|
-
readonly type: PropType<TreeDisplayType>;
|
|
520
|
-
readonly default: undefined;
|
|
521
|
-
};
|
|
522
506
|
readonly treeDragScope: {
|
|
523
507
|
readonly type: PropType<TreeDragScope>;
|
|
524
508
|
readonly default: undefined;
|
|
@@ -1250,29 +1234,13 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1250
1234
|
readonly default: undefined;
|
|
1251
1235
|
};
|
|
1252
1236
|
readonly tree: {
|
|
1253
|
-
readonly type:
|
|
1237
|
+
readonly type: PropType<boolean | string>;
|
|
1254
1238
|
readonly default: false;
|
|
1255
1239
|
};
|
|
1256
1240
|
readonly getDataPath: {
|
|
1257
1241
|
readonly type: PropType<GetDataPathFn>;
|
|
1258
1242
|
readonly default: undefined;
|
|
1259
1243
|
};
|
|
1260
|
-
readonly showTreeColumn: {
|
|
1261
|
-
readonly type: BooleanConstructor;
|
|
1262
|
-
readonly default: undefined;
|
|
1263
|
-
};
|
|
1264
|
-
readonly autoTreeColumnDef: {
|
|
1265
|
-
readonly type: PropType<Partial< ColumnDef>>;
|
|
1266
|
-
readonly default: undefined;
|
|
1267
|
-
};
|
|
1268
|
-
readonly treeValueGetter: {
|
|
1269
|
-
readonly type: PropType<TreeValueGetterFn>;
|
|
1270
|
-
readonly default: undefined;
|
|
1271
|
-
};
|
|
1272
|
-
readonly treeDisplayType: {
|
|
1273
|
-
readonly type: PropType<TreeDisplayType>;
|
|
1274
|
-
readonly default: undefined;
|
|
1275
|
-
};
|
|
1276
1244
|
readonly treeDragScope: {
|
|
1277
1245
|
readonly type: PropType<TreeDragScope>;
|
|
1278
1246
|
readonly default: undefined;
|
|
@@ -1518,15 +1486,6 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1518
1486
|
"onInfinite-cache-purged"?: ((event: InfiniteCachePurgedEvent) => any) | undefined;
|
|
1519
1487
|
}>, {
|
|
1520
1488
|
readonly rounded: number | boolean;
|
|
1521
|
-
readonly tree: boolean;
|
|
1522
|
-
readonly loading: boolean;
|
|
1523
|
-
readonly rowModelType: "clientSide" | "infinite";
|
|
1524
|
-
readonly infiniteDatasource: InfiniteRowDatasource;
|
|
1525
|
-
readonly blockSize: number;
|
|
1526
|
-
readonly maxBlocksInCache: number;
|
|
1527
|
-
readonly infiniteInitialRowCount: number;
|
|
1528
|
-
readonly infiniteMaxRetries: number;
|
|
1529
|
-
readonly infiniteLoadingRowVisible: boolean;
|
|
1530
1489
|
readonly data: RowData[];
|
|
1531
1490
|
readonly rowHeight: number;
|
|
1532
1491
|
readonly cellSelection: boolean | CellSelectionOptions;
|
|
@@ -1554,7 +1513,8 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1554
1513
|
readonly summaryRowHeight: number;
|
|
1555
1514
|
readonly summaryMethod: SummaryMethod;
|
|
1556
1515
|
readonly isRowDisabled: boolean | IsRowDisabledFn;
|
|
1557
|
-
readonly
|
|
1516
|
+
readonly loading: boolean;
|
|
1517
|
+
readonly colResizeDefault: "shift";
|
|
1558
1518
|
readonly suppressOverlays: OverlayType[];
|
|
1559
1519
|
readonly suppressLoadingOverlay: boolean;
|
|
1560
1520
|
readonly suppressNoRowsOverlay: boolean;
|
|
@@ -1571,21 +1531,22 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1571
1531
|
readonly overlayComponent: OverlayComponentFactory;
|
|
1572
1532
|
readonly overlayComponentParams: Record<string, unknown>;
|
|
1573
1533
|
readonly overlayInteraction: boolean;
|
|
1574
|
-
readonly border: GridBorder;
|
|
1575
|
-
readonly colResizeDefault: "shift";
|
|
1576
|
-
readonly cellEditorRegistry: Record<string, CellEditorFn>;
|
|
1577
|
-
readonly rowKey: string;
|
|
1578
|
-
readonly stripe: boolean;
|
|
1579
|
-
readonly cellColor: CellStyle;
|
|
1580
|
-
readonly theme: GridTheme;
|
|
1581
1534
|
readonly size: GridSize;
|
|
1535
|
+
readonly editorOptions: EditorOptions;
|
|
1536
|
+
readonly autoSizeStrategy: AutoSizeStrategy;
|
|
1537
|
+
readonly tree: string | boolean;
|
|
1538
|
+
readonly rowKey: string;
|
|
1582
1539
|
readonly headerHeight: number;
|
|
1583
|
-
readonly showIndexColumn: boolean;
|
|
1584
|
-
readonly indexColumn: IndexColumnOptions;
|
|
1585
|
-
readonly selectionColumn: SelectionColumnOptions;
|
|
1586
|
-
readonly navigateHeader: boolean;
|
|
1587
|
-
readonly navigateFooter: boolean;
|
|
1588
1540
|
readonly rowBuffer: number;
|
|
1541
|
+
readonly editBehavior: CellEditBehavior;
|
|
1542
|
+
readonly invalidEditValueMode: InvalidEditValueMode;
|
|
1543
|
+
readonly rowValidator: RowValidator;
|
|
1544
|
+
readonly asyncRowMutation: AsyncRowMutationHandlers;
|
|
1545
|
+
readonly selectable: SelectableFn;
|
|
1546
|
+
readonly reserveSelection: boolean;
|
|
1547
|
+
readonly preserveScrollOnSetData: boolean;
|
|
1548
|
+
readonly quickFilterText: string;
|
|
1549
|
+
readonly floatingFilter: boolean;
|
|
1589
1550
|
readonly scrollEndFlushMs: number;
|
|
1590
1551
|
readonly frameBudgetMs: number;
|
|
1591
1552
|
readonly scrollEndFrameBudgetMs: number;
|
|
@@ -1593,41 +1554,20 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1593
1554
|
readonly deferRowDestroyOnScroll: boolean;
|
|
1594
1555
|
readonly rendererFrameBudgetMs: number;
|
|
1595
1556
|
readonly cellRendererPresentation: "immediate" | "deferred" | "placeholder-then-vue";
|
|
1596
|
-
readonly
|
|
1597
|
-
readonly
|
|
1598
|
-
readonly
|
|
1599
|
-
readonly editableCellStyle: CellStyle;
|
|
1600
|
-
readonly showEditableCellIcon: boolean;
|
|
1601
|
-
readonly disabledCellStyle: CellStyle;
|
|
1602
|
-
readonly showDisabledCellIcon: boolean;
|
|
1603
|
-
readonly reserveSelection: boolean;
|
|
1604
|
-
readonly preserveScrollOnSetData: boolean;
|
|
1605
|
-
readonly defaultSelectedRows: DefaultSelectedRowsInput;
|
|
1606
|
-
readonly editBehavior: CellEditBehavior;
|
|
1607
|
-
readonly editorOptions: EditorOptions;
|
|
1608
|
-
readonly invalidEditValueMode: InvalidEditValueMode;
|
|
1609
|
-
readonly rowValidator: RowValidator;
|
|
1610
|
-
readonly asyncRowMutation: AsyncRowMutationHandlers;
|
|
1611
|
-
readonly height: string | number;
|
|
1557
|
+
readonly showIndexColumn: boolean;
|
|
1558
|
+
readonly indexColumn: IndexColumnOptions;
|
|
1559
|
+
readonly selectionColumn: SelectionColumnOptions;
|
|
1612
1560
|
readonly defaultSort: SortModelItem[];
|
|
1613
1561
|
readonly enableHeaderSortClick: boolean;
|
|
1562
|
+
readonly showUnsortedSortHintOnHover: boolean;
|
|
1614
1563
|
readonly columnMovable: boolean;
|
|
1615
|
-
readonly skipHeaderOnAutoSize: boolean;
|
|
1616
|
-
readonly autoSizePadding: number;
|
|
1617
1564
|
readonly suppressMoveWhenColumnDragging: boolean;
|
|
1618
1565
|
readonly suppressColumnMoveAnimation: boolean;
|
|
1619
1566
|
readonly allowCrossLaneColumnMove: boolean;
|
|
1620
|
-
readonly
|
|
1621
|
-
readonly
|
|
1622
|
-
readonly floatingFilter: boolean;
|
|
1567
|
+
readonly skipHeaderOnAutoSize: boolean;
|
|
1568
|
+
readonly autoSizePadding: number;
|
|
1623
1569
|
readonly filterSetValueMode: "current" | "reserve";
|
|
1624
|
-
readonly filterSetDateLayoutMode: "
|
|
1625
|
-
readonly showStatusBar: boolean;
|
|
1626
|
-
readonly showDefaultStatusBarPanels: boolean;
|
|
1627
|
-
readonly statusBarHeight: StatusBarHeightInput;
|
|
1628
|
-
readonly showStatusBarRangeAggregation: boolean;
|
|
1629
|
-
readonly statusBarRangeAggregationPosition: StatusBarRangeAggregationPosition;
|
|
1630
|
-
readonly statusBarRangeAggregationPrecision: StatusBarRangeAggregationPrecisionInput;
|
|
1570
|
+
readonly filterSetDateLayoutMode: "list" | "tree";
|
|
1631
1571
|
readonly rowDragManaged: boolean;
|
|
1632
1572
|
readonly getRowHeight: GetRowHeightFn;
|
|
1633
1573
|
readonly rowHeightMin: number;
|
|
@@ -1644,18 +1584,6 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1644
1584
|
readonly showExpandColumn: boolean;
|
|
1645
1585
|
readonly getDetailRowData: GetDetailRowDataFn;
|
|
1646
1586
|
readonly detailCellRenderer: DetailCellRendererFn;
|
|
1647
|
-
readonly loadMoreRow: {
|
|
1648
|
-
enabled?: boolean;
|
|
1649
|
-
height?: number;
|
|
1650
|
-
loading?: boolean;
|
|
1651
|
-
hasMore?: boolean;
|
|
1652
|
-
labels?: {
|
|
1653
|
-
loadMore?: string;
|
|
1654
|
-
loading?: string;
|
|
1655
|
-
exhausted?: string;
|
|
1656
|
-
};
|
|
1657
|
-
};
|
|
1658
|
-
readonly loadMoreRowRenderer: LoadMoreRowRendererFn;
|
|
1659
1587
|
readonly rowGrouping: boolean;
|
|
1660
1588
|
readonly groupDefaultExpanded: number;
|
|
1661
1589
|
readonly showGroupHeader: boolean;
|
|
@@ -1668,13 +1596,9 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1668
1596
|
readonly groupSortKey: string;
|
|
1669
1597
|
readonly groupCellRenderer: GroupCellRendererFn;
|
|
1670
1598
|
readonly getDataPath: GetDataPathFn;
|
|
1671
|
-
readonly showTreeColumn: boolean;
|
|
1672
|
-
readonly autoTreeColumnDef: Partial< ColumnDef<RowData>>;
|
|
1673
|
-
readonly treeValueGetter: TreeValueGetterFn;
|
|
1674
|
-
readonly treeDisplayType: "singleColumn";
|
|
1675
1599
|
readonly treeDragScope: TreeDragScope;
|
|
1676
|
-
readonly treeHierarchyActions: boolean;
|
|
1677
1600
|
readonly setDataPath: SetDataPathFn;
|
|
1601
|
+
readonly treeHierarchyActions: boolean;
|
|
1678
1602
|
readonly treeLazyLoad: boolean;
|
|
1679
1603
|
readonly hasTreeChildren: HasTreeChildrenFn;
|
|
1680
1604
|
readonly loadTreeChildren: LoadTreeChildrenFn;
|
|
@@ -1682,6 +1606,11 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1682
1606
|
readonly cellCommentTrigger: CellCommentTrigger;
|
|
1683
1607
|
readonly cellCommentShowDelay: number;
|
|
1684
1608
|
readonly cellCommentHideDelay: number;
|
|
1609
|
+
readonly rowStyle: RowStyle;
|
|
1610
|
+
readonly editableCellStyle: CellStyle;
|
|
1611
|
+
readonly showEditableCellIcon: boolean;
|
|
1612
|
+
readonly disabledCellStyle: CellStyle;
|
|
1613
|
+
readonly showDisabledCellIcon: boolean;
|
|
1685
1614
|
readonly processCellForClipboard: ProcessCellForClipboardFn;
|
|
1686
1615
|
readonly processCellFromClipboard: ProcessCellFromClipboardFn;
|
|
1687
1616
|
readonly processDataFromClipboard: ProcessDataFromClipboardFn;
|
|
@@ -1692,6 +1621,41 @@ declare const __VLS_base: DefineComponent<ExtractPropTypes<{
|
|
|
1692
1621
|
readonly tooltipHideDelay: number;
|
|
1693
1622
|
readonly tooltipInteraction: boolean;
|
|
1694
1623
|
readonly tooltipMouseTrack: boolean;
|
|
1624
|
+
readonly navigateHeader: boolean;
|
|
1625
|
+
readonly navigateFooter: boolean;
|
|
1626
|
+
readonly rowModelType: "clientSide" | "infinite";
|
|
1627
|
+
readonly infiniteDatasource: InfiniteRowDatasource;
|
|
1628
|
+
readonly blockSize: number;
|
|
1629
|
+
readonly maxBlocksInCache: number;
|
|
1630
|
+
readonly infiniteInitialRowCount: number;
|
|
1631
|
+
readonly infiniteMaxRetries: number;
|
|
1632
|
+
readonly infiniteLoadingRowVisible: boolean;
|
|
1633
|
+
readonly height: string | number;
|
|
1634
|
+
readonly theme: GridTheme;
|
|
1635
|
+
readonly stripe: boolean;
|
|
1636
|
+
readonly rowSelection: RowSelectionInput;
|
|
1637
|
+
readonly border: GridBorder;
|
|
1638
|
+
readonly cellEditorRegistry: Record<string, CellEditorFn>;
|
|
1639
|
+
readonly cellColor: CellStyle;
|
|
1640
|
+
readonly defaultSelectedRows: DefaultSelectedRowsInput;
|
|
1641
|
+
readonly showStatusBar: boolean;
|
|
1642
|
+
readonly showDefaultStatusBarPanels: boolean;
|
|
1643
|
+
readonly statusBarHeight: StatusBarHeightInput;
|
|
1644
|
+
readonly showStatusBarRangeAggregation: boolean;
|
|
1645
|
+
readonly statusBarRangeAggregationPosition: StatusBarRangeAggregationPosition;
|
|
1646
|
+
readonly statusBarRangeAggregationPrecision: StatusBarRangeAggregationPrecisionInput;
|
|
1647
|
+
readonly loadMoreRow: {
|
|
1648
|
+
enabled?: boolean;
|
|
1649
|
+
height?: number;
|
|
1650
|
+
loading?: boolean;
|
|
1651
|
+
hasMore?: boolean;
|
|
1652
|
+
labels?: {
|
|
1653
|
+
loadMore?: string;
|
|
1654
|
+
loading?: string;
|
|
1655
|
+
exhausted?: string;
|
|
1656
|
+
};
|
|
1657
|
+
};
|
|
1658
|
+
readonly loadMoreRowRenderer: LoadMoreRowRendererFn;
|
|
1695
1659
|
}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
|
|
1696
1660
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
1697
1661
|
declare const _default: typeof __VLS_export;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MagicGrid.vue.d.ts","sourceRoot":"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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAAvD,CAAC;mBAAyB,CAAC;qBAA2B,CAAC;;;;4EARn4B,CAAC;AACH,QAAA,MAAM,YAAY,EAAS,eAAe,CAAC,OAAO,UAAU,EAAE,WAAW,CAAC,CAAC;wBACtD,OAAO,YAAY;AAAxC,wBAAyC;AACzC,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KACV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,78 @@
|
|
|
1
|
-
import { DefineComponent } from 'vue';
|
|
1
|
+
import { DefineComponent, EmitsToProps, PublicProps } from 'vue';
|
|
2
|
+
import { ColumnDef, RowData } from '../../types/magic-grid.js';
|
|
2
3
|
import { MagicGridEmits } from './magicGridProps.js';
|
|
3
4
|
import { MagicGridPublicProps } from './publicProps.js';
|
|
5
|
+
/**
|
|
6
|
+
* 运行时 props 的公开形状。
|
|
7
|
+
*
|
|
8
|
+
* `columns` 来自 `required: true`;`data` 有默认值,故为可选;其余字段均为可选。
|
|
9
|
+
* 模板检查不直接使用这里的 `columns` / `data`(二者被固定为 `RowData`),
|
|
10
|
+
* 而使用 {@link MagicGridTemplateProps}。
|
|
11
|
+
*/
|
|
4
12
|
export type { MagicGridPublicProps } from './publicProps.js';
|
|
5
|
-
/**
|
|
6
|
-
|
|
13
|
+
/**
|
|
14
|
+
* `<MagicGrid>` 在模板里的 props。
|
|
15
|
+
*
|
|
16
|
+
* 在 {@link MagicGridPublicProps} 上替换 `columns` / `data`,使二者共用同一个行类型。
|
|
17
|
+
* 交叉 {@link EmitsToProps} 后,`@cell-value-changed` 等事件仍按 {@link MagicGridEmits} 检查。
|
|
18
|
+
* 交叉 {@link PublicProps} 后,`class`、`style`、`key` 等 Vue 内置属性仍可传入。
|
|
19
|
+
*
|
|
20
|
+
* @template [TData=RowData] 业务行类型。由 `columns` 与 `data` 共同推断;两边都未给出具体类型时为 {@link RowData}。
|
|
21
|
+
* 无 `extends` 约束,与 {@link ColumnDef} 一致,普通 interface 也可作为行类型。
|
|
22
|
+
*/
|
|
23
|
+
type MagicGridTemplateProps<TData = RowData> = Omit<MagicGridPublicProps, 'columns' | 'data'> & {
|
|
24
|
+
/**
|
|
25
|
+
* 列定义。回调里的行参数为 `TData`。
|
|
26
|
+
* 须与 `data` 使用同一个类型参数,不能声明成 `ColumnDef<RowData>[]` 再传入更具体的列数组。
|
|
27
|
+
*/
|
|
28
|
+
columns: ColumnDef<TData>[];
|
|
29
|
+
/**
|
|
30
|
+
* 行数据。元素类型为 `TData`。
|
|
31
|
+
* 运行时默认 `[]`。`rowModelType="infinite"` 时由 datasource 供数,可不传。
|
|
32
|
+
*/
|
|
33
|
+
data?: TData[];
|
|
34
|
+
} & EmitsToProps<MagicGridEmits> & PublicProps;
|
|
35
|
+
/**
|
|
36
|
+
* 未带行类型参数时的 Vue 实例。
|
|
37
|
+
*
|
|
38
|
+
* 用 `DefineComponent` 保住 `$emit`、`$el` 等实例成员,以及 {@link MagicGridEmits} 的事件签名。
|
|
39
|
+
* 此实例的 `$props.columns` 仍是 `ColumnDef<RowData>`,不能直接当作模板 props。
|
|
40
|
+
*/
|
|
41
|
+
type MagicGridVueInstance = InstanceType<DefineComponent<MagicGridPublicProps, {}, {}, {}, {}, {}, {}, MagicGridEmits>>;
|
|
42
|
+
/**
|
|
43
|
+
* 带行类型参数的组件实例。
|
|
44
|
+
*
|
|
45
|
+
* 去掉 {@link MagicGridVueInstance} 上固定为 `RowData` 的 `$props`,改成 {@link MagicGridTemplateProps}。
|
|
46
|
+
* 这样 Volar 从 `new MagicGrid(props)` 的返回值读取 `$props` 时,能看到推断出的 `TData`。
|
|
47
|
+
*
|
|
48
|
+
* @template [TData=RowData] 与构造签名相同的业务行类型。
|
|
49
|
+
*/
|
|
50
|
+
type MagicGridInstance<TData> = Omit<MagicGridVueInstance, '$props'> & {
|
|
51
|
+
/** 本次构造推断出的模板 props,含 `ColumnDef<TData>` 与事件监听器 */
|
|
52
|
+
$props: MagicGridTemplateProps<TData>;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* 消费端组件类型。
|
|
56
|
+
*
|
|
57
|
+
* 泛型在构造签名上,而不是在接口本身:`<MagicGrid>` 会按本次传入的 `columns` / `data` 推断 `TData`。
|
|
58
|
+
* `InstanceType<MagicGridComponent>` 取默认 `TData = RowData` 的实例;命令式 API 再与 `MagicGridExpose` 相交。
|
|
59
|
+
*
|
|
60
|
+
* 该签名只服务模板类型检查。运行时不要调用 `new MagicGrid(...)`。
|
|
61
|
+
*/
|
|
62
|
+
export interface MagicGridComponent {
|
|
63
|
+
/**
|
|
64
|
+
* @template [TData=RowData] 业务行类型。默认 {@link RowData}。
|
|
65
|
+
* @param props 模板 props。`columns` 为 `ColumnDef<TData>[]`,`data` 为 `TData[]`(可省略)。
|
|
66
|
+
* @returns 组件实例。`$props` 使用推断后的 `TData`,其余成员与默认 Vue 实例相同。
|
|
67
|
+
*/
|
|
68
|
+
new <TData = RowData>(props: MagicGridTemplateProps<TData>): MagicGridInstance<TData>;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* MagicGrid 组件。
|
|
72
|
+
*
|
|
73
|
+
* 类型收窄为 {@link MagicGridComponent},使 `ColumnDef<具体行>[]` 能传给 `:columns`。
|
|
74
|
+
* `MagicGrid.vue` 的实现类型与该构造签名不重叠,所以经 `unknown` 断言;断言不改变运行时行为。
|
|
75
|
+
*/
|
|
7
76
|
declare const MagicGrid: MagicGridComponent;
|
|
8
77
|
export default MagicGrid;
|
|
9
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MagicGrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/MagicGrid/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAErE,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAA;AAEnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D;;;;;;GAMG;AACH,YAAY,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAE5D;;;;;;;;;GASG;AACH,KAAK,sBAAsB,CAAC,KAAK,GAAG,OAAO,IAAI,IAAI,CAAC,oBAAoB,EAAE,SAAS,GAAG,MAAM,CAAC,GAAG;IAC9F;;;OAGG;IACH,OAAO,EAAE,SAAS,CAAC,KAAK,CAAC,EAAE,CAAA;IAC3B;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,EAAE,CAAA;CACf,GAAG,YAAY,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAA;AAEb;;;;;GAKG;AACH,KAAK,oBAAoB,GAAG,YAAY,CACtC,eAAe,CAAC,oBAAoB,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,cAAc,CAAC,CAC9E,CAAA;AAED;;;;;;;GAOG;AACH,KAAK,iBAAiB,CAAC,KAAK,IAAI,IAAI,CAAC,oBAAoB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