dbgate-datalib 5.2.2 → 5.2.4-alpha.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.
@@ -1,59 +0,0 @@
1
- import type { ColumnInfo } from 'dbgate-types';
2
- import { GridDisplay, ChangeCacheFunc, ChangeConfigFunc } from './GridDisplay';
3
- import { GridConfig, GridCache } from './GridConfig';
4
- import { FreeTableModel } from './FreeTableModel';
5
- export declare class FreeTableGridDisplay extends GridDisplay {
6
- model: FreeTableModel;
7
- constructor(model: FreeTableModel, config: GridConfig, setConfig: ChangeConfigFunc, cache: GridCache, setCache: ChangeCacheFunc);
8
- getDisplayColumns(model: FreeTableModel): {
9
- isChecked: boolean;
10
- pureName: string;
11
- schemaName: string;
12
- headerText: string;
13
- uniqueName: string;
14
- uniquePath: string[];
15
- pairingId?: string;
16
- columnName: string;
17
- notNull?: boolean;
18
- autoIncrement?: boolean;
19
- dataType: string;
20
- precision?: number;
21
- scale?: number;
22
- length?: number;
23
- computedExpression?: string;
24
- isPersisted?: boolean;
25
- isSparse?: boolean;
26
- defaultValue?: string;
27
- defaultConstraint?: string;
28
- columnComment?: string;
29
- isUnsigned?: boolean;
30
- isZerofill?: boolean;
31
- contentHash?: string;
32
- engine?: string;
33
- }[];
34
- getDisplayColumn(col: ColumnInfo): {
35
- pureName: string;
36
- schemaName: string;
37
- headerText: string;
38
- uniqueName: string;
39
- uniquePath: string[];
40
- pairingId?: string;
41
- columnName: string;
42
- notNull?: boolean;
43
- autoIncrement?: boolean;
44
- dataType: string;
45
- precision?: number;
46
- scale?: number;
47
- length?: number;
48
- computedExpression?: string;
49
- isPersisted?: boolean;
50
- isSparse?: boolean;
51
- defaultValue?: string;
52
- defaultConstraint?: string;
53
- columnComment?: string;
54
- isUnsigned?: boolean;
55
- isZerofill?: boolean;
56
- contentHash?: string;
57
- engine?: string;
58
- };
59
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FreeTableGridDisplay = void 0;
7
- const lodash_1 = __importDefault(require("lodash"));
8
- const GridDisplay_1 = require("./GridDisplay");
9
- const _1 = require(".");
10
- class FreeTableGridDisplay extends GridDisplay_1.GridDisplay {
11
- constructor(model, config, setConfig, cache, setCache) {
12
- var _a;
13
- super(config, setConfig, cache, setCache);
14
- this.model = model;
15
- this.columns = ((_a = model === null || model === void 0 ? void 0 : model.structure) === null || _a === void 0 ? void 0 : _a.__isDynamicStructure)
16
- ? (0, _1.analyseCollectionDisplayColumns)(model === null || model === void 0 ? void 0 : model.rows, this)
17
- : this.getDisplayColumns(model);
18
- this.filterable = false;
19
- this.sortable = false;
20
- }
21
- getDisplayColumns(model) {
22
- var _a, _b, _c;
23
- return lodash_1.default.uniqBy(((_c = (_b = (_a = model === null || model === void 0 ? void 0 : model.structure) === null || _a === void 0 ? void 0 : _a.columns) === null || _b === void 0 ? void 0 : _b.map(col => this.getDisplayColumn(col))) === null || _c === void 0 ? void 0 : _c.map(col => (Object.assign(Object.assign({}, col), { isChecked: this.isColumnChecked(col) })))) || [], col => col.uniqueName);
24
- }
25
- getDisplayColumn(col) {
26
- const uniquePath = [col.columnName];
27
- const uniqueName = uniquePath.join('.');
28
- return Object.assign(Object.assign({}, col), { pureName: 'data', schemaName: '', headerText: col.columnName, uniqueName,
29
- uniquePath });
30
- }
31
- }
32
- exports.FreeTableGridDisplay = FreeTableGridDisplay;
@@ -1,16 +0,0 @@
1
- import type { TableInfo } from 'dbgate-types';
2
- export interface FreeTableModel {
3
- structure: TableInfo;
4
- rows: any[];
5
- }
6
- export declare function createFreeTableModel(): {
7
- structure: {
8
- columns: {
9
- columnName: string;
10
- }[];
11
- foreignKeys: any[];
12
- };
13
- rows: {
14
- col1: string;
15
- }[];
16
- };
@@ -1,24 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createFreeTableModel = void 0;
4
- function createFreeTableModel() {
5
- return {
6
- structure: {
7
- columns: [
8
- {
9
- columnName: 'col1',
10
- },
11
- ],
12
- foreignKeys: [],
13
- },
14
- rows: [
15
- {
16
- col1: 'val1',
17
- },
18
- {
19
- col1: 'val2',
20
- },
21
- ],
22
- };
23
- }
24
- exports.createFreeTableModel = createFreeTableModel;