@sneat/grid 0.1.2 → 0.1.4

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,2 @@
1
+ export * from './lib/grid-models';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../libs/grid/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC","sourcesContent":["export * from './lib/grid-models';\n"]}
@@ -1,16 +1,3 @@
1
- import { ColumnDefinition } from 'tabulator-tables';
2
-
3
- export interface IGridDef {
4
- columns: IGridColumn[];
5
- rows?: Record<string, unknown>[];
6
- groupBy?: string;
7
- }
8
-
9
- export interface IGridColumn extends ColumnDefinition {
10
- dbType: string;
11
- colName?: string;
12
- }
13
-
14
1
  // export interface IGridColumn {
15
2
  // field: string;
16
3
  // colName?: string;
@@ -24,10 +11,9 @@ export interface IGridColumn extends ColumnDefinition {
24
11
  // widthGrow?: number;
25
12
  // width?: number | string;
26
13
  // }
27
-
28
- export const getTabulatorCols = (cols: IGridColumn[]): unknown[] =>
29
- cols.map((c) => {
30
- const v = { ...c } as { dbType?: unknown };
14
+ export const getTabulatorCols = (cols) => cols.map((c) => {
15
+ const v = { ...c };
31
16
  delete v.dbType;
32
17
  return v;
33
- });
18
+ });
19
+ //# sourceMappingURL=grid-models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grid-models.js","sourceRoot":"","sources":["../../../../../libs/grid/src/lib/grid-models.ts"],"names":[],"mappings":"AAaA,iCAAiC;AACjC,kBAAkB;AAClB,qBAAqB;AACrB,mBAAmB;AACnB,kBAAkB;AAClB,wCAAwC;AACxC,mGAAmG;AACnG,gCAAgC;AAChC,sCAAsC;AACtC,yBAAyB;AACzB,uBAAuB;AACvB,4BAA4B;AAC5B,IAAI;AAEJ,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAmB,EAAa,EAAE,CACjE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;IACb,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,EAA0B,CAAC;IAC3C,OAAO,CAAC,CAAC,MAAM,CAAC;IAChB,OAAO,CAAC,CAAC;AACX,CAAC,CAAC,CAAC","sourcesContent":["import { ColumnDefinition } from 'tabulator-tables';\n\nexport interface IGridDef {\n columns: IGridColumn[];\n rows?: Record<string, unknown>[];\n groupBy?: string;\n}\n\nexport interface IGridColumn extends ColumnDefinition {\n dbType: string;\n colName?: string;\n}\n\n// export interface IGridColumn {\n// \tfield: string;\n// \tcolName?: string;\n// \tdbType: string;\n// \ttitle: string;\n// \ttooltip?: (cell: unknown) => string;\n// \tformatter?: 'link' | 'progress' | 'html' | 'text' | 'number' | 'money' | 'image' | 'tickCross';\n// \thozAlign?: 'left' | 'right';\n// \theaderHozAlign?: 'left' | 'right';\n// \twidthShrink?: number;\n// \twidthGrow?: number;\n// \twidth?: number | string;\n// }\n\nexport const getTabulatorCols = (cols: IGridColumn[]): unknown[] =>\n cols.map((c) => {\n const v = { ...c } as { dbType?: unknown };\n delete v.dbType;\n return v;\n });\n"]}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ export * from './index';
5
+ //# sourceMappingURL=sneat-grid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sneat-grid.js","sourceRoot":"","sources":["../../../../libs/grid/src/sneat-grid.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,SAAS,CAAC","sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"]}
@@ -0,0 +1,11 @@
1
+ import { ColumnDefinition } from 'tabulator-tables';
2
+ export interface IGridDef {
3
+ columns: IGridColumn[];
4
+ rows?: Record<string, unknown>[];
5
+ groupBy?: string;
6
+ }
7
+ export interface IGridColumn extends ColumnDefinition {
8
+ dbType: string;
9
+ colName?: string;
10
+ }
11
+ export declare const getTabulatorCols: (cols: IGridColumn[]) => unknown[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sneat/grid",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -10,5 +10,17 @@
10
10
  },
11
11
  "dependencies": {
12
12
  "tslib": "2.8.1"
13
- }
13
+ },
14
+ "module": "esm2022/sneat-grid.js",
15
+ "typings": "sneat-grid.d.ts",
16
+ "exports": {
17
+ "./package.json": {
18
+ "default": "./package.json"
19
+ },
20
+ ".": {
21
+ "types": "./sneat-grid.d.ts",
22
+ "default": "./esm2022/sneat-grid.js"
23
+ }
24
+ },
25
+ "sideEffects": false
14
26
  }
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@sneat/grid" />
5
+ export * from './index';
package/eslint.config.js DELETED
@@ -1,7 +0,0 @@
1
- const baseConfig = require('../../eslint.config.js');
2
- const { sneatLibConfig } = require('../../eslint.lib.config.js');
3
-
4
- module.exports = [
5
- ...baseConfig,
6
- ...sneatLibConfig(__dirname),
7
- ];
package/ng-package.json DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/libs/grid",
4
- "lib": {
5
- "entryFile": "src/index.ts"
6
- }
7
- }
package/project.json DELETED
@@ -1,38 +0,0 @@
1
- {
2
- "name": "grid",
3
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
4
- "projectType": "library",
5
- "sourceRoot": "libs/grid/src",
6
- "prefix": "sneat",
7
- "targets": {
8
- "build": {
9
- "executor": "@nx/angular:ng-packagr-lite",
10
- "outputs": [
11
- "{workspaceRoot}/dist/libs/grid"
12
- ],
13
- "options": {
14
- "project": "libs/grid/ng-package.json",
15
- "tsConfig": "libs/grid/tsconfig.lib.json"
16
- },
17
- "configurations": {
18
- "production": {
19
- "tsConfig": "libs/grid/tsconfig.lib.prod.json"
20
- },
21
- "development": {}
22
- },
23
- "defaultConfiguration": "production"
24
- },
25
- "test": {
26
- "executor": "@nx/vitest:test",
27
- "outputs": [
28
- "{workspaceRoot}/coverage/libs/grid"
29
- ],
30
- "options": {
31
- "tsConfig": "libs/grid/tsconfig.spec.json"
32
- }
33
- },
34
- "lint": {
35
- "executor": "@nx/eslint:lint"
36
- }
37
- }
38
- }
@@ -1,22 +0,0 @@
1
- import { getTabulatorCols, IGridColumn } from './grid-models';
2
-
3
- describe('grid-models', () => {
4
- describe('getTabulatorCols', () => {
5
- it('should remove dbType from column definitions', () => {
6
- const cols: IGridColumn[] = [
7
- { field: 'id', title: 'ID', dbType: 'string' },
8
- { field: 'name', title: 'Name', dbType: 'string' },
9
- ];
10
- const result = getTabulatorCols(cols);
11
- expect(result).toHaveLength(2);
12
- expect(result[0]).not.toHaveProperty('dbType');
13
- expect(result[1]).not.toHaveProperty('dbType');
14
- expect(result[0]).toMatchObject({ field: 'id', title: 'ID' });
15
- expect(result[1]).toMatchObject({ field: 'name', title: 'Name' });
16
- });
17
-
18
- it('should return empty array for empty input', () => {
19
- expect(getTabulatorCols([])).toEqual([]);
20
- });
21
- });
22
- });
package/src/test-setup.ts DELETED
@@ -1,3 +0,0 @@
1
- import { setupTestEnvironment } from '@sneat/core/testing';
2
-
3
- setupTestEnvironment();
package/tsconfig.json DELETED
@@ -1,13 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.angular.json",
3
- "files": [],
4
- "include": [],
5
- "references": [
6
- {
7
- "path": "./tsconfig.lib.json"
8
- },
9
- {
10
- "path": "./tsconfig.spec.json"
11
- }
12
- ]
13
- }
package/tsconfig.lib.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.lib.base.json",
3
- "exclude": [
4
- "vite.config.ts",
5
- "vite.config.mts",
6
- "vitest.config.ts",
7
- "vitest.config.mts",
8
- "src/**/*.test.ts",
9
- "src/**/*.spec.ts",
10
- "src/**/*.test.tsx",
11
- "src/**/*.spec.tsx",
12
- "src/**/*.test.js",
13
- "src/**/*.spec.js",
14
- "src/**/*.test.jsx",
15
- "src/**/*.spec.jsx",
16
- "src/test-setup.ts",
17
- "src/lib/testing/**/*"
18
- ]
19
- }
@@ -1,7 +0,0 @@
1
- {
2
- "extends": "./tsconfig.lib.json",
3
- "compilerOptions": {
4
- "declarationMap": false
5
- },
6
- "angularCompilerOptions": {}
7
- }
@@ -1,31 +0,0 @@
1
- {
2
- "extends": "./tsconfig.json",
3
- "compilerOptions": {
4
- "outDir": "../../dist/out-tsc",
5
- "types": [
6
- "vitest/globals",
7
- "vitest/importMeta",
8
- "vite/client",
9
- "node",
10
- "vitest"
11
- ]
12
- },
13
- "include": [
14
- "vite.config.ts",
15
- "vite.config.mts",
16
- "vitest.config.ts",
17
- "vitest.config.mts",
18
- "src/**/*.test.ts",
19
- "src/**/*.spec.ts",
20
- "src/**/*.test.tsx",
21
- "src/**/*.spec.tsx",
22
- "src/**/*.test.js",
23
- "src/**/*.spec.js",
24
- "src/**/*.test.jsx",
25
- "src/**/*.spec.jsx",
26
- "src/**/*.d.ts"
27
- ],
28
- "files": [
29
- "src/test-setup.ts"
30
- ]
31
- }
package/vite.config.mts DELETED
@@ -1,10 +0,0 @@
1
- /// <reference types='vitest' />
2
- import { defineConfig } from 'vitest/config';
3
- import { createBaseViteConfig } from '../../vite.config.base';
4
-
5
- export default defineConfig(() =>
6
- createBaseViteConfig({
7
- dirname: __dirname,
8
- name: 'grid',
9
- }),
10
- );
File without changes