@moda-grid/vue2 0.1.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.
@@ -0,0 +1,7 @@
1
+ export { useGrid, useGridState } from "./useGrid.js";
2
+ export type { UseGridReturn } from "./useGrid.js";
3
+ export { default as DataGrid } from "./DataGrid.vue";
4
+ export type { Grid, GridSnapshot, ColumnDef, GridOptions, RowData, SortState, VirtualScrollState, } from "@moda-grid/core";
5
+ export { matchFilterValue } from "@moda-grid/core";
6
+ export type { ServerSideDataSource, ServerSideGetRowsParams, ServerSideGetRowsResult, ServerSideOptions, ServerSideState, TreeDataOptions, CellClassParams, ClassSource, RowClassParams, } from "@moda-grid/core";
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACrD,YAAY,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EACV,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,WAAW,EACX,OAAO,EACP,SAAS,EACT,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,YAAY,EACV,oBAAoB,EACpB,uBAAuB,EACvB,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,eAAe,EACf,WAAW,EACX,cAAc,GACf,MAAM,iBAAiB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { useGrid, useGridState } from "./useGrid.js";
2
+ export { default as DataGrid } from "./DataGrid.vue";
3
+ // 서버 사이드 데이터 모델 (무한 스크롤/스켈레톤)
4
+ export { matchFilterValue } from "@moda-grid/core";
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAWrD,8BAA8B;AAC9B,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1 @@
1
+ @import "@moda-grid/core/styles.css";
@@ -0,0 +1,18 @@
1
+ import type { ShallowRef } from "vue";
2
+ import type { Grid, GridOptions, GridSnapshot, RowData, Unsubscribe } from "@moda-grid/core";
3
+ export interface UseGridReturn<TData extends object> {
4
+ grid: Grid<TData>;
5
+ /** 현재 그리드 스냅샷 — 읽기 전용으로 취급할 것 */
6
+ state: ShallowRef<GridSnapshot<TData>>;
7
+ /** 수동 구독 해제 (컴포넌트 스코프 외에서 사용 시) */
8
+ unsubscribe: Unsubscribe;
9
+ }
10
+ /** 외부에서 생성한 GridCore 인스턴스의 스냅샷만 구독한다. */
11
+ export declare function useGridState<TData extends object>(grid: Grid<TData>): Pick<UseGridReturn<TData>, "state" | "unsubscribe">;
12
+ /**
13
+ * Grid 인스턴스를 생성하고 반응형 스냅샷을 반환한다.
14
+ * Vue 2.7의 내장 Composition API 기반이며, 컴포넌트 스코프 안에서
15
+ * 호출하면 스코프 종료 시 자동으로 구독 해제된다.
16
+ */
17
+ export declare function useGrid<TData extends object = RowData>(options: GridOptions<TData>): UseGridReturn<TData>;
18
+ //# sourceMappingURL=useGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGrid.d.ts","sourceRoot":"","sources":["../src/useGrid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEtC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7F,MAAM,WAAW,aAAa,CAAC,KAAK,SAAS,MAAM;IACjD,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,iCAAiC;IACjC,KAAK,EAAE,UAAU,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,mCAAmC;IACnC,WAAW,EAAE,WAAW,CAAC;CAC1B;AAED,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,KAAK,SAAS,MAAM,EAC/C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,GAChB,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC,CAOrD;AAED;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,KAAK,SAAS,MAAM,GAAG,OAAO,EACpD,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,GAC1B,aAAa,CAAC,KAAK,CAAC,CAKtB"}
@@ -0,0 +1,23 @@
1
+ import { getCurrentScope, onScopeDispose, shallowRef } from "vue";
2
+ import { createGrid } from "@moda-grid/core";
3
+ /** 외부에서 생성한 GridCore 인스턴스의 스냅샷만 구독한다. */
4
+ export function useGridState(grid) {
5
+ const state = shallowRef(grid.getSnapshot());
6
+ const unsubscribe = grid.subscribe(() => {
7
+ state.value = grid.getSnapshot();
8
+ });
9
+ if (getCurrentScope())
10
+ onScopeDispose(unsubscribe);
11
+ return { state, unsubscribe };
12
+ }
13
+ /**
14
+ * Grid 인스턴스를 생성하고 반응형 스냅샷을 반환한다.
15
+ * Vue 2.7의 내장 Composition API 기반이며, 컴포넌트 스코프 안에서
16
+ * 호출하면 스코프 종료 시 자동으로 구독 해제된다.
17
+ */
18
+ export function useGrid(options) {
19
+ const grid = createGrid(options);
20
+ const { state, unsubscribe } = useGridState(grid);
21
+ return { grid, state, unsubscribe };
22
+ }
23
+ //# sourceMappingURL=useGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGrid.js","sourceRoot":"","sources":["../src/useGrid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAW7C,yCAAyC;AACzC,MAAM,UAAU,YAAY,CAC1B,IAAiB;IAEjB,MAAM,KAAK,GAAG,UAAU,CAAsB,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAClE,MAAM,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,EAAE;QACtC,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACnC,CAAC,CAAC,CAAC;IACH,IAAI,eAAe,EAAE;QAAE,cAAc,CAAC,WAAW,CAAC,CAAC;IACnD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AAChC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CACrB,OAA2B;IAE3B,MAAM,IAAI,GAAG,UAAU,CAAQ,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC,IAAI,CAAC,CAAC;IAElD,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC;AACtC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@moda-grid/vue2",
3
+ "version": "0.1.0",
4
+ "description": "Vue 2.7 adapter for @moda-grid — DataGrid SFC and useGrid composable",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "exports": {
8
+ ".": {
9
+ "types": "./dist/index.d.ts",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./styles.css": "./dist/styles.css"
13
+ },
14
+ "types": "./dist/index.d.ts",
15
+ "files": [
16
+ "src",
17
+ "dist"
18
+ ],
19
+ "sideEffects": [
20
+ "**/*.css"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ },
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/park-taejoon/moda-grid.git",
28
+ "directory": "packages/vue2"
29
+ },
30
+ "keywords": [
31
+ "vue",
32
+ "vue2",
33
+ "data-grid",
34
+ "datagrid",
35
+ "table",
36
+ "grid"
37
+ ],
38
+ "dependencies": {
39
+ "@moda-grid/core": "0.1.0"
40
+ },
41
+ "peerDependencies": {
42
+ "vue": "^2.7.0"
43
+ },
44
+ "devDependencies": {
45
+ "typescript": "~5.9.2",
46
+ "vue": "2.7.16"
47
+ },
48
+ "scripts": {
49
+ "build": "tsc -p tsconfig.json && cp src/styles.css src/DataGrid.vue dist/",
50
+ "typecheck": "tsc -p tsconfig.json --noEmit",
51
+ "dev": "tsc -p tsconfig.json --watch"
52
+ },
53
+ "main": "./dist/index.js"
54
+ }