@ai-table/grid 0.0.2 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/components/cell-editors/abstract-cell-editor.component.d.ts +2 -2
- package/components/cell-editors/abstract-cell-editor.component.d.ts.map +1 -1
- package/components/cell-editors/select/select-editor.component.d.ts +15 -0
- package/components/cell-editors/select/select-editor.component.d.ts.map +1 -0
- package/components/field-menu/field-menu.component.d.ts +14 -0
- package/components/field-menu/field-menu.component.d.ts.map +1 -0
- package/components/field-property-editor/field-property-editor.component.d.ts +13 -15
- package/components/field-property-editor/field-property-editor.component.d.ts.map +1 -1
- package/components/index.d.ts +2 -0
- package/components/index.d.ts.map +1 -0
- package/constants/editor.d.ts +1 -1
- package/constants/editor.d.ts.map +1 -1
- package/constants/field.d.ts +20 -0
- package/constants/field.d.ts.map +1 -0
- package/constants/grid.d.ts.map +1 -1
- package/constants/index.d.ts +1 -0
- package/constants/index.d.ts.map +1 -1
- package/core/action/field.d.ts +8 -2
- package/core/action/field.d.ts.map +1 -1
- package/core/action/general.d.ts.map +1 -1
- package/core/action/index.d.ts +5 -0
- package/core/action/index.d.ts.map +1 -1
- package/core/action/record.d.ts +7 -3
- package/core/action/record.d.ts.map +1 -1
- package/core/constants/field.d.ts +6 -8
- package/core/constants/field.d.ts.map +1 -1
- package/core/index.d.ts +1 -0
- package/core/index.d.ts.map +1 -1
- package/core/types/action.d.ts +38 -8
- package/core/types/action.d.ts.map +1 -1
- package/core/types/core.d.ts +36 -10
- package/core/types/core.d.ts.map +1 -1
- package/core/utils/common.d.ts +2 -1
- package/core/utils/common.d.ts.map +1 -1
- package/core/utils/field.d.ts +7 -1
- package/core/utils/field.d.ts.map +1 -1
- package/core/utils/queries.d.ts +4 -2
- package/core/utils/queries.d.ts.map +1 -1
- package/esm2022/components/cell-editors/abstract-cell-editor.component.mjs +11 -9
- package/esm2022/components/cell-editors/select/select-editor.component.mjs +46 -0
- package/esm2022/components/field-menu/field-menu.component.mjs +37 -0
- package/esm2022/components/field-property-editor/field-property-editor.component.mjs +35 -24
- package/esm2022/components/index.mjs +2 -0
- package/esm2022/constants/editor.mjs +8 -8
- package/esm2022/constants/field.mjs +27 -0
- package/esm2022/constants/grid.mjs +5 -5
- package/esm2022/constants/index.mjs +2 -1
- package/esm2022/core/action/field.mjs +43 -2
- package/esm2022/core/action/general.mjs +68 -14
- package/esm2022/core/action/record.mjs +22 -5
- package/esm2022/core/constants/field.mjs +22 -16
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/types/action.mjs +6 -1
- package/esm2022/core/types/core.mjs +11 -14
- package/esm2022/core/types/index.mjs +1 -1
- package/esm2022/core/utils/common.mjs +10 -1
- package/esm2022/core/utils/field.mjs +12 -1
- package/esm2022/core/utils/queries.mjs +36 -6
- package/esm2022/core/utils/record.mjs +3 -3
- package/esm2022/grid.component.mjs +72 -32
- package/esm2022/pipes/grid.mjs +1 -2
- package/esm2022/public-api.mjs +2 -1
- package/esm2022/services/event.service.mjs +13 -6
- package/esm2022/services/field.service.mjs +32 -0
- package/esm2022/services/selection.servive.mjs +64 -0
- package/esm2022/types/field.mjs +2 -0
- package/esm2022/types/grid.mjs +1 -1
- package/esm2022/types/index.mjs +2 -1
- package/esm2022/utils/build.mjs +13 -5
- package/fesm2022/ai-table-grid.mjs +655 -283
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid.component.d.ts +22 -11
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/pipes/grid.d.ts.map +1 -1
- package/public-api.d.ts +1 -0
- package/public-api.d.ts.map +1 -1
- package/services/event.service.d.ts +2 -0
- package/services/event.service.d.ts.map +1 -1
- package/services/field.service.d.ts +16 -0
- package/services/field.service.d.ts.map +1 -0
- package/services/selection.servive.d.ts +16 -0
- package/services/selection.servive.d.ts.map +1 -0
- package/styles/styles.scss +70 -3
- package/types/field.d.ts +11 -0
- package/types/field.d.ts.map +1 -0
- package/types/grid.d.ts +13 -3
- package/types/grid.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/utils/build.d.ts +2 -2
- package/utils/build.d.ts.map +1 -1
- package/components/cell-editors/single-select/single-select-editor.component.d.ts +0 -14
- package/components/cell-editors/single-select/single-select-editor.component.d.ts.map +0 -1
- package/esm2022/components/cell-editors/single-select/single-select-editor.component.mjs +0 -44
@@ -5,13 +5,13 @@ import * as i0 from "@angular/core";
|
|
5
5
|
export declare abstract class AbstractEditCellEditor<TValue, TFieldType extends AITableField = AITableField> implements OnInit {
|
6
6
|
field: import("@angular/core").InputSignal<TFieldType>;
|
7
7
|
record: import("@angular/core").InputSignal<AITableRecord>;
|
8
|
-
aiTable:
|
8
|
+
aiTable: AITable;
|
9
9
|
modelValue: TValue;
|
10
10
|
protected thyPopoverRef: ThyPopoverRef<any, any, any>;
|
11
11
|
ngOnInit(): void;
|
12
12
|
updateFieldValue(): void;
|
13
13
|
closePopover(): void;
|
14
14
|
static ɵfac: i0.ɵɵFactoryDeclaration<AbstractEditCellEditor<any, any>, never>;
|
15
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractEditCellEditor<any, any>, "abstract-edit-cell", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "record": { "alias": "record"; "required": true; "isSignal": true; }; "aiTable": { "alias": "aiTable"; "required": true;
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AbstractEditCellEditor<any, any>, "abstract-edit-cell", never, { "field": { "alias": "field"; "required": true; "isSignal": true; }; "record": { "alias": "record"; "required": true; "isSignal": true; }; "aiTable": { "alias": "aiTable"; "required": true; }; }, {}, never, never, true, never>;
|
16
16
|
}
|
17
17
|
//# sourceMappingURL=abstract-cell-editor.component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"abstract-cell-editor.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"abstract-cell-editor.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/cell-editors/abstract-cell-editor.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAA6B,OAAO,EAAE,YAAY,EAAkB,aAAa,EAAE,MAAM,YAAY,CAAC;;AAE7G,8BAMsB,sBAAsB,CAAC,MAAM,EAAE,UAAU,SAAS,YAAY,GAAG,YAAY,CAAE,YAAW,MAAM;IAClH,KAAK,kDAAgC;IAErC,MAAM,qDAAmC;IAEd,OAAO,EAAG,OAAO,CAAC;IAE7C,UAAU,EAAG,MAAM,CAAC;IAEpB,SAAS,CAAC,aAAa,+BAAyD;IAEhF,QAAQ,IAAI,IAAI;IAOhB,gBAAgB;IAKhB,YAAY;yCAvBM,sBAAsB;2CAAtB,sBAAsB;CA0B3C"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { AbstractEditCellEditor } from '../abstract-cell-editor.component';
|
2
|
+
import { AITableSelectOption, AITableField } from '../../../core';
|
3
|
+
import * as i0 from "@angular/core";
|
4
|
+
export interface AITableSingleSelectField extends AITableField<AITableSelectOption> {
|
5
|
+
options: AITableSelectOption[];
|
6
|
+
}
|
7
|
+
export declare class SelectCellEditorComponent extends AbstractEditCellEditor<string, AITableSingleSelectField> {
|
8
|
+
isMultiple: boolean;
|
9
|
+
selectOptions: import("@angular/core").Signal<AITableSelectOption[]>;
|
10
|
+
constructor();
|
11
|
+
updateValue(value: boolean): void;
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SelectCellEditorComponent, never>;
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SelectCellEditorComponent, "single-select-cell-editor", never, { "isMultiple": { "alias": "isMultiple"; "required": false; }; }, {}, never, never, true, never>;
|
14
|
+
}
|
15
|
+
//# sourceMappingURL=select-editor.component.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"select-editor.component.d.ts","sourceRoot":"","sources":["../../../../../packages/grid/src/components/cell-editors/select/select-editor.component.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAI3E,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;;AAElE,MAAM,WAAW,wBAAyB,SAAQ,YAAY,CAAC,mBAAmB,CAAC;IAC/E,OAAO,EAAE,mBAAmB,EAAE,CAAC;CAClC;AAED,qBAYa,yBAA0B,SAAQ,sBAAsB,CAAC,MAAM,EAAE,wBAAwB,CAAC;IAC1F,UAAU,EAAG,OAAO,CAAC;IAE9B,aAAa,wDAEV;;IAMH,WAAW,CAAC,KAAK,EAAE,OAAO;yCAXjB,yBAAyB;2CAAzB,yBAAyB;CAiBrC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ElementRef } from '@angular/core';
|
2
|
+
import { AITableFieldMenuItem } from '../../types/field';
|
3
|
+
import { AITable } from '../../core';
|
4
|
+
import * as i0 from "@angular/core";
|
5
|
+
export declare class FieldMenu {
|
6
|
+
fieldId: string;
|
7
|
+
aiTable: AITable;
|
8
|
+
fieldMenus: AITableFieldMenuItem[];
|
9
|
+
origin: HTMLElement | ElementRef<any>;
|
10
|
+
execute(menu: AITableFieldMenuItem): void;
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldMenu, never>;
|
12
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldMenu, "field-menu", never, { "fieldId": { "alias": "fieldId"; "required": true; }; "aiTable": { "alias": "aiTable"; "required": true; }; "fieldMenus": { "alias": "fieldMenus"; "required": true; }; "origin": { "alias": "origin"; "required": false; }; }, {}, never, never, true, never>;
|
13
|
+
}
|
14
|
+
//# sourceMappingURL=field-menu.component.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"field-menu.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/field-menu/field-menu.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,UAAU,EAAU,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;;AAWnD,qBAca,SAAS;IACS,OAAO,EAAG,MAAM,CAAC;IAEjB,OAAO,EAAG,OAAO,CAAC;IAElB,UAAU,EAAG,oBAAoB,EAAE,CAAC;IAEtD,MAAM,EAAG,WAAW,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;IAEhD,OAAO,CAAC,IAAI,EAAE,oBAAoB;yCATzB,SAAS;2CAAT,SAAS;CAarB"}
|
@@ -1,32 +1,30 @@
|
|
1
|
-
import {
|
1
|
+
import { TemplateRef } from '@angular/core';
|
2
2
|
import { ThyFormValidatorConfig } from 'ngx-tethys/form';
|
3
|
-
import { AITableField, AITableFieldType
|
3
|
+
import { AITable, AITableField, AITableFieldType } from '../../core';
|
4
4
|
import { ThyPopoverRef } from 'ngx-tethys/popover';
|
5
5
|
import * as i0 from "@angular/core";
|
6
|
-
export declare class
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
export declare class AITableFieldPropertyEditor {
|
7
|
+
aiField: import("@angular/core").ModelSignal<AITableField<unknown>>;
|
8
|
+
aiTable: AITable;
|
9
|
+
aiExternalTemplate: TemplateRef<any> | null;
|
10
|
+
isUpdate: boolean;
|
10
11
|
fieldType: import("@angular/core").Signal<{
|
11
12
|
type: AITableFieldType;
|
12
13
|
name: string;
|
13
14
|
icon: string;
|
15
|
+
width: number;
|
14
16
|
}>;
|
15
17
|
fieldMaxLength: number;
|
16
18
|
validatorConfig: ThyFormValidatorConfig;
|
17
|
-
selectableFields:
|
18
|
-
type: AITableFieldType;
|
19
|
-
name: string;
|
20
|
-
icon: string;
|
21
|
-
}[];
|
19
|
+
selectableFields: import("../../core").AITableFieldInfo[];
|
22
20
|
protected thyPopoverRef: ThyPopoverRef<any, any, any>;
|
23
21
|
constructor();
|
24
|
-
ngOnInit(): void;
|
25
22
|
checkUniqueName: (fieldName: string) => import("rxjs").Observable<boolean>;
|
26
23
|
selectFieldType(fieldType: AITableFieldType): void;
|
27
|
-
|
24
|
+
editFieldProperty(): void;
|
28
25
|
cancel(): void;
|
29
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<
|
30
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AITableFieldPropertyEditor, never>;
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AITableFieldPropertyEditor, "ai-table-field-property-editor", never, { "aiField": { "alias": "aiField"; "required": true; "isSignal": true; }; "aiTable": { "alias": "aiTable"; "required": true; }; "aiExternalTemplate": { "alias": "aiExternalTemplate"; "required": false; }; "isUpdate": { "alias": "isUpdate"; "required": false; }; }, { "aiField": "aiFieldChange"; }, never, never, true, never>;
|
28
|
+
static ngAcceptInputType_isUpdate: unknown;
|
31
29
|
}
|
32
30
|
//# sourceMappingURL=field-property-editor.component.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"field-property-editor.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/field-property-editor/field-property-editor.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,
|
1
|
+
{"version":3,"file":"field-property-editor.component.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/components/field-property-editor/field-property-editor.component.ts"],"names":[],"mappings":"AACA,OAAO,EAA6C,WAAW,EAA6C,MAAM,eAAe,CAAC;AAGlI,OAAO,EAAyD,sBAAsB,EAAiB,MAAM,iBAAiB,CAAC;AAS/H,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAsD,MAAM,YAAY,CAAC;AAEzH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;;AAKnD,qBAsCa,0BAA0B;IACnC,OAAO,6DAAkC;IAEd,OAAO,EAAG,OAAO,CAAC;IAEpC,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,IAAI,CAAQ;IAEpB,QAAQ,EAAG,OAAO,CAAC;IAE3D,SAAS;;;;;OAEN;IAEH,cAAc,SAAM;IAEpB,eAAe,EAAE,sBAAsB,CAOrC;IAEF,gBAAgB,0CAAU;IAE1B,SAAS,CAAC,aAAa,+BAAqD;;IAI5E,eAAe,cAAe,MAAM,wCAGlC;IAEF,eAAe,CAAC,SAAS,EAAE,gBAAgB;IAI3C,iBAAiB;IAUjB,MAAM;yCAjDG,0BAA0B;2CAA1B,0BAA0B;uCAqDyhxB,OAAQ;CADvkxB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAA"}
|
package/constants/editor.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQ3C,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,gBAAgB,EAAE,GAAG,
|
1
|
+
{"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/editor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAQ3C,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,gBAAgB,EAAE,GAAG,CAAC,CAOvE,CAAC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { AITable, AITableField } from '../core';
|
2
|
+
import { ElementRef, Signal } from '@angular/core';
|
3
|
+
import { AITableFieldMenuItem } from '../types';
|
4
|
+
export declare const DividerMenuItem: {
|
5
|
+
id: string;
|
6
|
+
};
|
7
|
+
export declare const EditFieldPropertyItem: {
|
8
|
+
id: string;
|
9
|
+
name: string;
|
10
|
+
icon: string;
|
11
|
+
exec: (aiTable: AITable, field: Signal<AITableField>, origin?: HTMLElement | ElementRef<any>) => void;
|
12
|
+
};
|
13
|
+
export declare const RemoveFieldItem: {
|
14
|
+
id: string;
|
15
|
+
name: string;
|
16
|
+
icon: string;
|
17
|
+
exec: (aiTable: AITable, field: Signal<AITableField>) => void;
|
18
|
+
};
|
19
|
+
export declare const DefaultFieldMenus: AITableFieldMenuItem[];
|
20
|
+
//# sourceMappingURL=field.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,OAAO,EAAE,YAAY,EAAkB,MAAM,SAAS,CAAC;AAEtF,OAAO,EAAE,UAAU,EAAU,MAAM,EAAkB,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAEhD,eAAO,MAAM,eAAe;;CAE3B,CAAC;AAEF,eAAO,MAAM,qBAAqB;;;;oBAId,OAAO,SAAS,OAAO,YAAY,CAAC,WAAW,WAAW,GAAG,WAAW,GAAG,CAAC;CAK/F,CAAC;AAEF,eAAO,MAAM,eAAe;;;;oBAIR,OAAO,SAAS,OAAO,YAAY,CAAC;CAIvD,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,oBAAoB,EAA6C,CAAC"}
|
package/constants/grid.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/grid.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/grid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,oBAAoB,MAAM,CAAC;AAExC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,eAAO,MAAM,mBAAmB,oBAK/B,CAAC;AAEF,eAAO,MAAM,SAAS;;;;;CAKrB,CAAC"}
|
package/constants/index.d.ts
CHANGED
package/constants/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/constants/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/core/action/field.d.ts
CHANGED
@@ -1,6 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
export declare function addField(aiTable: AITable, field: AITableField, path:
|
1
|
+
import { AIFieldPath, AITable, AITableField } from '../types';
|
2
|
+
export declare function addField(aiTable: AITable, field: AITableField, path: AIFieldPath): void;
|
3
|
+
export declare function moveField(aiTable: AITable, path: AIFieldPath, newPath: AIFieldPath): void;
|
4
|
+
export declare function removeField(aiTable: AITable, path: AIFieldPath): void;
|
5
|
+
export declare function setField(aiTable: AITable, value: Partial<AITableField>, path: AIFieldPath): void;
|
3
6
|
export declare const FieldActions: {
|
4
7
|
addField: typeof addField;
|
8
|
+
moveField: typeof moveField;
|
9
|
+
removeField: typeof removeField;
|
10
|
+
setField: typeof setField;
|
5
11
|
};
|
6
12
|
//# sourceMappingURL=field.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/field.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,WAAW,EACX,OAAO,EACP,YAAY,EAIf,MAAM,UAAU,CAAC;AAGlB,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,QAOhF;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,QAOlF;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,QAM9D;AAED,wBAAgB,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,WAAW,QAuBzF;AAED,eAAO,MAAM,YAAY;;;;;CAKxB,CAAC"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,aAAa,EAAiC,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/general.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,OAAO,EAAE,aAAa,EAAiC,MAAM,UAAU,CAAC;AA8F7F,eAAO,MAAM,cAAc;uBACJ,OAAO,MAAM,aAAa,GAAG,IAAI;CAWvD,CAAC"}
|
package/core/action/index.d.ts
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
export declare const Actions: {
|
2
2
|
addField: typeof import("./field").addField;
|
3
|
+
moveField: typeof import("./field").moveField;
|
4
|
+
removeField: typeof import("./field").removeField;
|
5
|
+
setField: typeof import("./field").setField;
|
3
6
|
addRecord: typeof import("./record").addRecord;
|
4
7
|
updateFieldValue: typeof import("./record").updateFieldValue;
|
8
|
+
moveRecord: typeof import("./record").moveRecord;
|
9
|
+
removeRecord: typeof import("./record").removeRecord;
|
5
10
|
transform(aiTable: import("@ai-table/grid").AITable, op: import("@ai-table/grid").AITableAction): void;
|
6
11
|
};
|
7
12
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO;;;;;;;;;;CAInB,CAAC"}
|
package/core/action/record.d.ts
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
import {
|
2
|
-
export declare function updateFieldValue(aiTable: AITable, value: any, path:
|
3
|
-
export declare function addRecord(aiTable: AITable, record: AITableRecord, path:
|
1
|
+
import { AIRecordPath, AITable, AITableRecord, AIFieldValuePath } from '../types';
|
2
|
+
export declare function updateFieldValue(aiTable: AITable, value: any, path: AIFieldValuePath): void;
|
3
|
+
export declare function addRecord(aiTable: AITable, record: AITableRecord, path: AIRecordPath): void;
|
4
|
+
export declare function moveRecord(aiTable: AITable, path: AIRecordPath, newPath: AIRecordPath): void;
|
5
|
+
export declare function removeRecord(aiTable: AITable, path: AIRecordPath): void;
|
4
6
|
export declare const RecordActions: {
|
5
7
|
addRecord: typeof addRecord;
|
6
8
|
updateFieldValue: typeof updateFieldValue;
|
9
|
+
moveRecord: typeof moveRecord;
|
10
|
+
removeRecord: typeof removeRecord;
|
7
11
|
};
|
8
12
|
//# sourceMappingURL=record.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/record.ts"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/action/record.ts"],"names":[],"mappings":"AAAA,OAAO,EAGH,YAAY,EAEZ,OAAO,EACP,aAAa,EACb,gBAAgB,EAGnB,MAAM,UAAU,CAAC;AAGlB,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,gBAAgB,QAWpF;AAED,wBAAgB,SAAS,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,YAAY,QAOpF;AAED,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,QAOrF;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,YAAY,QAMhE;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAC"}
|
@@ -1,19 +1,17 @@
|
|
1
|
-
import { AITableFieldType } from '../types';
|
2
|
-
export declare const
|
1
|
+
import { AITableFieldInfo, AITableFieldType } from '../types';
|
2
|
+
export declare const BasicFields: {
|
3
3
|
type: AITableFieldType;
|
4
4
|
name: string;
|
5
5
|
icon: string;
|
6
|
+
width: number;
|
6
7
|
}[];
|
7
|
-
export declare const
|
8
|
-
|
9
|
-
name: string;
|
10
|
-
icon: string;
|
11
|
-
}[];
|
12
|
-
export declare const FieldTypesMap: {
|
8
|
+
export declare const Fields: AITableFieldInfo[];
|
9
|
+
export declare const FieldsMap: {
|
13
10
|
[key: string]: {
|
14
11
|
type: AITableFieldType;
|
15
12
|
name: string;
|
16
13
|
icon: string;
|
14
|
+
width: number;
|
17
15
|
};
|
18
16
|
};
|
19
17
|
//# sourceMappingURL=field.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/constants/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/constants/field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG9D,eAAO,MAAM,WAAW;;;;;GAqCvB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,gBAAgB,EAAqB,CAAC;AAE3D,eAAO,MAAM,SAAS;;;;;;;CAA0C,CAAC"}
|
package/core/index.d.ts
CHANGED
package/core/index.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../packages/grid/src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC"}
|
package/core/types/action.d.ts
CHANGED
@@ -1,11 +1,17 @@
|
|
1
1
|
import { AITableField, AITableRecord } from './core';
|
2
|
-
export type
|
3
|
-
export type
|
4
|
-
export type
|
2
|
+
export type AIRecordPath = [number];
|
3
|
+
export type AIFieldPath = [number];
|
4
|
+
export type AIFieldValuePath = [number, number];
|
5
|
+
export type Path = AIRecordPath | AIFieldPath | AIFieldValuePath;
|
5
6
|
export declare enum ActionName {
|
6
7
|
UpdateFieldValue = "update_field_value",
|
7
8
|
AddRecord = "add_record",
|
8
|
-
AddField = "add_field"
|
9
|
+
AddField = "add_field",
|
10
|
+
MoveField = "move_field",
|
11
|
+
MoveRecord = "move_record",
|
12
|
+
RemoveField = "remove_field",
|
13
|
+
RemoveRecord = "remove_record",
|
14
|
+
SetField = "set_field"
|
9
15
|
}
|
10
16
|
export declare enum ExecuteType {
|
11
17
|
Execute = 0,
|
@@ -14,19 +20,43 @@ export declare enum ExecuteType {
|
|
14
20
|
}
|
15
21
|
export type UpdateFieldValueAction = {
|
16
22
|
type: ActionName.UpdateFieldValue;
|
17
|
-
path:
|
23
|
+
path: AIFieldValuePath;
|
18
24
|
fieldValue: any;
|
19
25
|
newFieldValue: any;
|
20
26
|
};
|
21
27
|
export type AddRecordAction = {
|
22
28
|
type: ActionName.AddRecord;
|
23
|
-
path:
|
29
|
+
path: AIRecordPath;
|
24
30
|
record: AITableRecord;
|
25
31
|
};
|
26
32
|
export type AddFieldAction = {
|
27
33
|
type: ActionName.AddField;
|
28
|
-
path:
|
34
|
+
path: AIFieldPath;
|
29
35
|
field: AITableField;
|
30
36
|
};
|
31
|
-
export type
|
37
|
+
export type MoveFieldAction = {
|
38
|
+
type: ActionName.MoveField;
|
39
|
+
path: AIFieldPath;
|
40
|
+
newPath: AIFieldPath;
|
41
|
+
};
|
42
|
+
export type MoveRecordAction = {
|
43
|
+
type: ActionName.MoveRecord;
|
44
|
+
path: AIRecordPath;
|
45
|
+
newPath: AIRecordPath;
|
46
|
+
};
|
47
|
+
export type RemoveFieldAction = {
|
48
|
+
type: ActionName.RemoveField;
|
49
|
+
path: AIFieldPath;
|
50
|
+
};
|
51
|
+
export type RemoveRecordAction = {
|
52
|
+
type: ActionName.RemoveRecord;
|
53
|
+
path: AIRecordPath;
|
54
|
+
};
|
55
|
+
export type SetFieldAction = {
|
56
|
+
type: ActionName.SetField;
|
57
|
+
path: AIFieldPath;
|
58
|
+
field: Partial<AITableField>;
|
59
|
+
newField: Partial<AITableField>;
|
60
|
+
};
|
61
|
+
export type AITableAction = UpdateFieldValueAction | AddRecordAction | AddFieldAction | RemoveRecordAction | RemoveFieldAction | SetFieldAction | MoveFieldAction | MoveRecordAction;
|
32
62
|
//# sourceMappingURL=action.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/types/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAErD,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/types/action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,gBAAgB,GAAG;IAC3B,IAAI,EAAE,UAAU,CAAC,UAAU,CAAC;IAC5B,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC;IAC7B,IAAI,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG;IAC7B,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9B,IAAI,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IACzB,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC7B,QAAQ,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;CACnC,CAAC;AAEF,MAAM,MAAM,aAAa,GACnB,sBAAsB,GACtB,eAAe,GACf,cAAc,GACd,kBAAkB,GAClB,iBAAiB,GACjB,cAAc,GACd,eAAe,GACf,gBAAgB,CAAC"}
|
package/core/types/core.d.ts
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
import { WritableSignal } from '@angular/core';
|
2
2
|
import { AITableAction } from './action';
|
3
|
+
import { AITableSelection } from '../../types';
|
4
|
+
import { Id } from 'ngx-tethys/types';
|
3
5
|
export declare enum AITableFieldType {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
text = "text",// 包含多行文本
|
7
|
+
richText = "rich_text",// 包含多行文本
|
8
|
+
select = "select",// 包含单选和多选
|
9
|
+
number = "number",
|
10
|
+
date = "date",
|
11
|
+
member = "member",// 包含单个和多个
|
12
|
+
progress = "progress",
|
13
|
+
rate = "rate",
|
14
|
+
link = "link"
|
10
15
|
}
|
11
16
|
export declare enum AITableStatType {
|
12
17
|
None = 0,
|
@@ -33,19 +38,32 @@ export interface AITableSelectOption {
|
|
33
38
|
name: string;
|
34
39
|
color?: string;
|
35
40
|
}
|
36
|
-
export interface AITableField {
|
41
|
+
export interface AITableField<T = unknown> {
|
37
42
|
id: string;
|
38
43
|
name: string;
|
39
44
|
type: AITableFieldType;
|
40
|
-
|
45
|
+
icon?: string;
|
46
|
+
width?: number;
|
41
47
|
hidden?: boolean;
|
42
48
|
frozen?: boolean;
|
43
49
|
statType?: AITableStatType;
|
44
|
-
|
50
|
+
isMultiple?: boolean;
|
51
|
+
[key: string]: T | any;
|
45
52
|
}
|
53
|
+
export type TextFieldValue = string;
|
54
|
+
export type SelectFieldValue = Id[];
|
55
|
+
export type NumberFieldValue = number;
|
56
|
+
export type DateFieldValue = {
|
57
|
+
timestamp: number;
|
58
|
+
};
|
59
|
+
export type MemberFieldValue = Id[];
|
60
|
+
export type ProgressFieldValue = number;
|
61
|
+
export type RateFieldValue = 1 | 2 | 3 | 4 | 5;
|
62
|
+
export type FieldValue = TextFieldValue | SelectFieldValue | NumberFieldValue | DateFieldValue | MemberFieldValue | ProgressFieldValue | RateFieldValue | any;
|
46
63
|
export interface AITableRecord {
|
47
64
|
id: string;
|
48
|
-
|
65
|
+
checked?: boolean;
|
66
|
+
values: Record<string, FieldValue>;
|
49
67
|
}
|
50
68
|
export type AITableRecords = AITableRecord[];
|
51
69
|
export type AITableFields = AITableField[];
|
@@ -57,6 +75,7 @@ export interface AITable {
|
|
57
75
|
records: WritableSignal<AITableRecords>;
|
58
76
|
fields: WritableSignal<AITableFields>;
|
59
77
|
actions: AITableAction[];
|
78
|
+
selection: WritableSignal<AITableSelection>;
|
60
79
|
onChange: () => void;
|
61
80
|
apply: (action: AITableAction) => void;
|
62
81
|
}
|
@@ -65,4 +84,11 @@ export interface AITableChangeOptions {
|
|
65
84
|
fields: AITableField[];
|
66
85
|
actions: AITableAction[];
|
67
86
|
}
|
87
|
+
export interface AITableFieldInfo {
|
88
|
+
type: AITableFieldType;
|
89
|
+
name: string;
|
90
|
+
icon: string;
|
91
|
+
width: number;
|
92
|
+
}
|
93
|
+
export type AIPlugin = (aiTable: AITable) => AITable;
|
68
94
|
//# sourceMappingURL=core.d.ts.map
|
package/core/types/core.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/types/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAEtC,oBAAY,gBAAgB;IACxB,IAAI,SAAS,CAAE,SAAS;IACxB,QAAQ,cAAc,CAAE,SAAS;IACjC,MAAM,WAAW,CAAE,UAAU;IAC7B,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW,CAAE,UAAU;IAE7B,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,IAAI,SAAS;CAChB;AAED,oBAAY,eAAe;IACvB,IAAI,IAAI;IACR,QAAQ,IAAI;IACZ,KAAK,IAAI;IACT,MAAM,IAAI;IACV,MAAM,IAAI;IACV,YAAY,IAAI;IAChB,aAAa,IAAI;IACjB,aAAa,IAAI;IACjB,GAAG,IAAI;IACP,OAAO,IAAI;IACX,GAAG,KAAK;IACR,GAAG,KAAK;IACR,eAAe,KAAK;IACpB,iBAAiB,KAAK;IACtB,OAAO,KAAK;IACZ,SAAS,KAAK;IACd,cAAc,KAAK;IACnB,gBAAgB,KAAK;CACxB;AAED,MAA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MAAM,MAAM,cAAc,GAAG,aAAa,EAAE,CAAC;AAE7C,MAAM,MAAM,aAAa,GAAG,YAAY,EAAE,CAAC;AAE3C,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,OAAO;IACpB,OAAO,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;IACxC,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;IACtC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,SAAS,EAAE,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC5C,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,KAAK,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAC1C;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,OAAO,EAAE,aAAa,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE,gBAAgB,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC"}
|
package/core/utils/common.d.ts
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
import { AITable, AITableFields, AITableRecords } from '../types';
|
1
|
+
import { AITable, AITableFields, AITableRecords, Path } from '../types';
|
2
2
|
import { WritableSignal } from '@angular/core';
|
3
3
|
export declare function createAITable(records: WritableSignal<AITableRecords>, fields: WritableSignal<AITableFields>): AITable;
|
4
|
+
export declare function isPathEqual(path: Path, another: Path): boolean;
|
4
5
|
//# sourceMappingURL=common.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAiB,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAiB,aAAa,EAAE,cAAc,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAEvF,OAAO,EAAE,cAAc,EAAU,MAAM,eAAe,CAAC;AAEvD,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,cAAc,CAAC,aAAa,CAAC,GAAG,OAAO,CA0BrH;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,OAAO,CAE9D"}
|
package/core/utils/field.d.ts
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
-
import { AITableFieldType } from '../types';
|
1
|
+
import { AITable, AITableFieldType } from '../types';
|
2
2
|
export declare function getDefaultFieldValue(type: AITableFieldType): string;
|
3
|
+
export declare function createDefaultFieldName(aiTable: AITable, type?: AITableFieldType): string;
|
4
|
+
export declare function createDefaultField(aiTable: AITable, type?: AITableFieldType): {
|
5
|
+
id: string;
|
6
|
+
type: AITableFieldType;
|
7
|
+
name: string;
|
8
|
+
};
|
3
9
|
//# sourceMappingURL=field.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/field.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"field.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/field.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGrD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,gBAAgB,UAE1D;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,gBAAwC,UAItG;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,GAAE,gBAAwC;;;;EAElG"}
|
package/core/utils/queries.d.ts
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { Path, AITable, AITableField, AITableRecord, AIRecordPath, AIFieldPath } from '../types';
|
2
2
|
export declare const AITableQueries: {
|
3
3
|
findPath(aiTable: AITable, field?: AITableField, record?: AITableRecord): Path;
|
4
|
-
getFieldValue(aiTable: AITable, path: [
|
4
|
+
getFieldValue(aiTable: AITable, path: [number, number]): any;
|
5
|
+
getField(aiTable: AITable, path: AIFieldPath): AITableField;
|
6
|
+
getRecord(aiTable: AITable, path: AIRecordPath): AITableRecord;
|
5
7
|
};
|
6
8
|
//# sourceMappingURL=queries.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/queries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"queries.d.ts","sourceRoot":"","sources":["../../../../packages/grid/src/core/utils/queries.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAoB,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEnH,eAAO,MAAM,cAAc;sBACL,OAAO,UAAU,YAAY,WAAW,aAAa,GAAG,IAAI;2BAcvD,OAAO,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG;sBAqB1C,OAAO,sBAAsB,YAAY;uBAUxC,OAAO,uBAAuB,aAAa;CASjE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, inject, input } from '@angular/core';
|
1
|
+
import { ChangeDetectionStrategy, Component, computed, inject, Input, input } from '@angular/core';
|
2
2
|
import { ThyPopoverRef } from 'ngx-tethys/popover';
|
3
3
|
import { Actions, AITableQueries } from '../../core';
|
4
4
|
import * as i0 from "@angular/core";
|
@@ -6,24 +6,23 @@ export class AbstractEditCellEditor {
|
|
6
6
|
constructor() {
|
7
7
|
this.field = input.required();
|
8
8
|
this.record = input.required();
|
9
|
-
this.aiTable = input.required();
|
10
9
|
this.thyPopoverRef = inject((ThyPopoverRef));
|
11
10
|
}
|
12
11
|
ngOnInit() {
|
13
12
|
this.modelValue = computed(() => {
|
14
|
-
const path = AITableQueries.findPath(this.aiTable
|
15
|
-
return AITableQueries.getFieldValue(this.aiTable
|
13
|
+
const path = AITableQueries.findPath(this.aiTable, this.field(), this.record());
|
14
|
+
return AITableQueries.getFieldValue(this.aiTable, path);
|
16
15
|
})();
|
17
16
|
}
|
18
17
|
updateFieldValue() {
|
19
|
-
const path = AITableQueries.findPath(this.aiTable
|
20
|
-
Actions.updateFieldValue(this.aiTable
|
18
|
+
const path = AITableQueries.findPath(this.aiTable, this.field(), this.record());
|
19
|
+
Actions.updateFieldValue(this.aiTable, this.modelValue, path);
|
21
20
|
}
|
22
21
|
closePopover() {
|
23
22
|
this.thyPopoverRef.close();
|
24
23
|
}
|
25
24
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AbstractEditCellEditor, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.2", type: AbstractEditCellEditor, isStandalone: true, selector: "abstract-edit-cell", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, record: { classPropertyName: "record", publicName: "record", isSignal: true, isRequired: true, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal:
|
25
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.2", type: AbstractEditCellEditor, isStandalone: true, selector: "abstract-edit-cell", inputs: { field: { classPropertyName: "field", publicName: "field", isSignal: true, isRequired: true, transformFunction: null }, record: { classPropertyName: "record", publicName: "record", isSignal: true, isRequired: true, transformFunction: null }, aiTable: { classPropertyName: "aiTable", publicName: "aiTable", isSignal: false, isRequired: true, transformFunction: null } }, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
27
26
|
}
|
28
27
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImport: i0, type: AbstractEditCellEditor, decorators: [{
|
29
28
|
type: Component,
|
@@ -33,5 +32,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.2", ngImpor
|
|
33
32
|
standalone: true,
|
34
33
|
changeDetection: ChangeDetectionStrategy.OnPush
|
35
34
|
}]
|
36
|
-
}]
|
37
|
-
|
35
|
+
}], propDecorators: { aiTable: [{
|
36
|
+
type: Input,
|
37
|
+
args: [{ required: true }]
|
38
|
+
}] } });
|
39
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWJzdHJhY3QtY2VsbC1lZGl0b3IuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvZ3JpZC9zcmMvY29tcG9uZW50cy9jZWxsLWVkaXRvcnMvYWJzdHJhY3QtY2VsbC1lZGl0b3IuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsUUFBUSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsS0FBSyxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQzNHLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNuRCxPQUFPLEVBQUU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