@ai-table/grid 0.0.17 → 0.0.18
Sign up to get free protection for your applications and to get access to all the features.
- package/esm2022/components/field-menu/field-menu.component.mjs +3 -3
- package/esm2022/core/coordinate.mjs +2 -2
- package/esm2022/dom-grid.component.mjs +2 -2
- package/esm2022/grid-base.component.mjs +4 -5
- package/esm2022/grid.component.mjs +10 -6
- package/esm2022/renderer/components/add-field-column.component.mjs +14 -7
- package/esm2022/renderer/renderer.component.mjs +9 -5
- package/esm2022/services/field.service.mjs +2 -1
- package/esm2022/types/component-config.mjs +1 -1
- package/esm2022/types/grid.mjs +1 -1
- package/esm2022/utils/build.mjs +3 -3
- package/fesm2022/ai-table-grid.mjs +40 -26
- package/fesm2022/ai-table-grid.mjs.map +1 -1
- package/grid-base.component.d.ts +4 -5
- package/grid-base.component.d.ts.map +1 -1
- package/grid.component.d.ts.map +1 -1
- package/package.json +1 -1
- package/renderer/components/add-field-column.component.d.ts.map +1 -1
- package/renderer/renderer.component.d.ts +2 -0
- package/renderer/renderer.component.d.ts.map +1 -1
- package/services/field.service.d.ts.map +1 -1
- package/types/component-config.d.ts +1 -0
- package/types/component-config.d.ts.map +1 -1
- package/types/grid.d.ts +1 -0
- package/types/grid.d.ts.map +1 -1
- package/utils/build.d.ts +1 -1
- package/utils/build.d.ts.map +1 -1
package/esm2022/types/grid.mjs
CHANGED
@@ -13,4 +13,4 @@ export var AITableAreaType;
|
|
13
13
|
AITableAreaType["grid"] = "grid";
|
14
14
|
AITableAreaType["none"] = "none";
|
15
15
|
})(AITableAreaType || (AITableAreaType = {}));
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ3JpZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3BhY2thZ2VzL2dyaWQvc3JjL3R5cGVzL2dyaWQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBaURB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xhbnk+KSA9PiB2b2lkO1xufVxuXG5leHBvcnQgaW50ZXJmYWNlIEFJVGFibGVDb250ZXh0IHtcbiAgICBsaW5lYXJSb3dzOiBTaWduYWw8QUlUYWJsZUxpbmVhclJvd1tdPjtcbiAgICBwb2ludFBvc2l0aW9uOiBXcml0YWJsZVNpZ25hbDxBSVRhYmxlUG9pbnRQb3NpdGlvbj47XG4gICAgc2Nyb2xsU3RhdGU6IFdyaXRhYmxlU2lnbmFsPEFJVGFibGVTY3JvbGxTdGF0ZT47XG4gICAgc2Nyb2xsQWN0aW9uOiAob3B0aW9uczogU2Nyb2xsQWN0aW9uT3B0aW9ucykgPT4gdm9pZDtcbiAgICB2aXNpYmxlQ29sdW1uc01hcDogU2lnbmFsPE1hcDxzdHJpbmcsIG51bWJlcj4+O1xuICAgIHZpc2libGVSb3dzSW5kZXhNYXA6IFNpZ25hbDxNYXA8c3RyaW5nLCBudW1iZXI+Pjtcbn1cbiJdfQ==
|
package/esm2022/utils/build.mjs
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FieldOptions } from '../core';
|
2
2
|
import { AITableRowType } from '../types/row';
|
3
|
-
export const buildGridLinearRows = (visibleRecords) => {
|
3
|
+
export const buildGridLinearRows = (visibleRecords, isAddingVisible = true) => {
|
4
4
|
const linearRows = [];
|
5
5
|
let displayRowIndex = 0;
|
6
6
|
[...visibleRecords, { _id: '' }].forEach((row) => {
|
@@ -12,7 +12,7 @@ export const buildGridLinearRows = (visibleRecords) => {
|
|
12
12
|
displayIndex: displayRowIndex
|
13
13
|
});
|
14
14
|
}
|
15
|
-
if (!row._id) {
|
15
|
+
if (isAddingVisible && !row._id) {
|
16
16
|
linearRows.push({
|
17
17
|
type: AITableRowType.add,
|
18
18
|
_id: ''
|
@@ -36,4 +36,4 @@ export const buildGridData = (recordValue, fieldsValue) => {
|
|
36
36
|
records: recordValue
|
37
37
|
};
|
38
38
|
};
|
39
|
-
//# sourceMappingURL=data:application/json;base64,
|
39
|
+
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XNpYmxlUmVjb3JkczogQUlUYWJsZVJlY29yZHMsIGlzQWRkaW5nVmlzaWJsZTogYm9vbGVhbiA9IHRydWUpOiBBSVRhYmxlTGluZWFyUm93W10gPT4ge1xuICAgIGNvbnN0IGxpbmVhclJvd3M6IEFJVGFibGVMaW5lYXJSb3dbXSA9IFtdO1xuICAgIGxldCBkaXNwbGF5Um93SW5kZXggPSAwO1xuICAgIFsuLi52aXNpYmxlUmVjb3JkcywgeyBfaWQ6ICcnIH1dLmZvckVhY2goKHJvdykgPT4ge1xuICAgICAgICBpZiAocm93Ll9pZCkge1xuICAgICAgICAgICAgZGlzcGxheVJvd0luZGV4Kys7XG4gICAgICAgICAgICBsaW5lYXJSb3dzLnB1c2goe1xuICAgICAgICAgICAgICAgIHR5cGU6IEFJVGFibGVSb3dUeXBlLnJlY29yZCxcbiAgICAgICAgICAgICAgICBfaWQ6IHJvdy5faWQsXG4gICAgICAgICAgICAgICAgZGlzcGxheUluZGV4OiBkaXNwbGF5Um93SW5kZXhcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgICAgIGlmIChpc0FkZGluZ1Zpc2libGUgJiYgIXJvdy5faWQpIHtcbiAgICAgICAgICAgIGxpbmVhclJvd3MucHVzaCh7XG4gICAgICAgICAgICAgICAgdHlwZTogQUlUYWJsZVJvd1R5cGUuYWRkLFxuICAgICAgICAgICAgICAgIF9pZDogJydcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfSk7XG4gICAgcmV0dXJuIGxpbmVhclJvd3M7XG59O1xuXG5leHBvcnQgY29uc3QgYnVpbGRHcmlkRGF0YSA9IChyZWNvcmRWYWx1ZTogQUlUYWJsZVJlY29yZHMsIGZpZWxkc1ZhbHVlOiBBSVRhYmxlRmllbGRzKTogQUlUYWJsZUdyaWREYXRhID0+IHtcbiAgICBjb25zdCBmaWVsZHMgPSBmaWVsZHNWYWx1ZS5tYXAoKHZhbHVlKSA9PiB7XG4gICAgICAgIGNvbnN0IGZpZWxkT3B0aW9uID0gRmllbGRPcHRpb25zLmZpbmQoKGl0ZW0pID0+IGl0ZW0udHlwZSA9PT0gdmFsdWUudHlwZSkhO1xuICAgICAgICByZXR1cm4ge1xuICAgICAgICAgICAgLi4udmFsdWUsXG4gICAgICAgICAgICBpY29uOiB2YWx1ZS5pY29uIHx8IGZpZWxkT3B0aW9uLmljb24sXG4gICAgICAgICAgICB3aWR0aDogdmFsdWUud2lkdGggfHwgZmllbGRPcHRpb24ud2lkdGhcbiAgICAgICAgfTtcbiAgICB9KTtcbiAgICByZXR1cm4ge1xuICAgICAgICB0eXBlOiAnZ3JpZCcsXG4gICAgICAgIGZpZWxkcyxcbiAgICAgICAgcmVjb3JkczogcmVjb3JkVmFsdWVcbiAgICB9O1xufTtcbiJdfQ==
|
@@ -19,7 +19,7 @@ import { ThyButton } from 'ngx-tethys/button';
|
|
19
19
|
import * as i2 from 'ngx-tethys/form';
|
20
20
|
import { ThyFormSubmitDirective, ThyFormModule, ThyUniqueCheckValidator, ThyConfirmValidatorDirective } from 'ngx-tethys/form';
|
21
21
|
import * as _ from 'lodash';
|
22
|
-
import ___default from 'lodash';
|
22
|
+
import ___default, { isNil } from 'lodash';
|
23
23
|
import { ThyNotifyService } from 'ngx-tethys/notify';
|
24
24
|
import { ThyInputNumber } from 'ngx-tethys/input-number';
|
25
25
|
import { ThySlider } from 'ngx-tethys/slider';
|
@@ -406,7 +406,7 @@ class Coordinate {
|
|
406
406
|
offset = itemMetadata.offset + itemMetadata.size;
|
407
407
|
}
|
408
408
|
for (let i = lastMeasuredIndex + 1; i <= index; i++) {
|
409
|
-
const size = isColumnType ? this.columnIndicesMap[i] : this.rowIndicesMap[i] ?? this.rowHeight;
|
409
|
+
const size = isColumnType ? this.columnIndicesMap[i] : (this.rowIndicesMap[i] ?? this.rowHeight);
|
410
410
|
cellMetadataMap[i] = {
|
411
411
|
offset,
|
412
412
|
size
|
@@ -1603,7 +1603,7 @@ class FieldMenu extends ThyDropdownAbstractMenu {
|
|
1603
1603
|
}
|
1604
1604
|
}
|
1605
1605
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FieldMenu, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
1606
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: FieldMenu, isStandalone: true, selector: "field-menu", inputs: { fieldId: "fieldId", aiTable: "aiTable", fieldMenus: "fieldMenus", origin: "origin", position: "position" }, usesInheritance: true, ngImport: i0, template: "@for (menu of fieldMenus; track index; let index = $index) {\n @if (menu.type === 'divider') {\n
|
1606
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: FieldMenu, isStandalone: true, selector: "field-menu", inputs: { fieldId: "fieldId", aiTable: "aiTable", fieldMenus: "fieldMenus", origin: "origin", position: "position" }, usesInheritance: true, ngImport: i0, template: "@for (menu of fieldMenus; track index; let index = $index) {\n @if ((menu.hidden && !menu.hidden(aiTable, field)) || !menu.hidden) {\n @if (menu.type === 'divider') {\n <thy-divider [thyStyle]=\"'solid'\"></thy-divider>\n } @else {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"!!(menu.disabled && menu.disabled(aiTable, field))\"\n >\n <thy-icon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span>{{ menu.name! }}</span>\n </a>\n }\n }\n}\n", dependencies: [{ kind: "component", type: ThyIcon, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "component", type: ThyDivider, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }, { kind: "directive", type: ThyDropdownMenuItemDirective, selector: "[thyDropdownMenuItem]", inputs: ["thyType", "thyDisabled"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
1607
1607
|
}
|
1608
1608
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: FieldMenu, decorators: [{
|
1609
1609
|
type: Component,
|
@@ -1614,7 +1614,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
1614
1614
|
ThyDropdownMenuItemDirective,
|
1615
1615
|
ThyDropdownMenuItemNameDirective,
|
1616
1616
|
ThyDropdownMenuItemIconDirective
|
1617
|
-
], template: "@for (menu of fieldMenus; track index; let index = $index) {\n @if (menu.type === 'divider') {\n
|
1617
|
+
], template: "@for (menu of fieldMenus; track index; let index = $index) {\n @if ((menu.hidden && !menu.hidden(aiTable, field)) || !menu.hidden) {\n @if (menu.type === 'divider') {\n <thy-divider [thyStyle]=\"'solid'\"></thy-divider>\n } @else {\n <a\n thyDropdownMenuItem\n href=\"javascript:;\"\n (click)=\"execute(menu)\"\n [thyDisabled]=\"!!(menu.disabled && menu.disabled(aiTable, field))\"\n >\n <thy-icon [thyIconName]=\"menu.icon!\"></thy-icon>\n <span>{{ menu.name! }}</span>\n </a>\n }\n }\n}\n" }]
|
1618
1618
|
}], propDecorators: { fieldId: [{
|
1619
1619
|
type: Input,
|
1620
1620
|
args: [{ required: true }]
|
@@ -1630,7 +1630,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
1630
1630
|
type: Input
|
1631
1631
|
}] } });
|
1632
1632
|
|
1633
|
-
const buildGridLinearRows = (visibleRecords) => {
|
1633
|
+
const buildGridLinearRows = (visibleRecords, isAddingVisible = true) => {
|
1634
1634
|
const linearRows = [];
|
1635
1635
|
let displayRowIndex = 0;
|
1636
1636
|
[...visibleRecords, { _id: '' }].forEach((row) => {
|
@@ -1642,7 +1642,7 @@ const buildGridLinearRows = (visibleRecords) => {
|
|
1642
1642
|
displayIndex: displayRowIndex
|
1643
1643
|
});
|
1644
1644
|
}
|
1645
|
-
if (!row._id) {
|
1645
|
+
if (isAddingVisible && !row._id) {
|
1646
1646
|
linearRows.push({
|
1647
1647
|
type: AITableRowType.add,
|
1648
1648
|
_id: ''
|
@@ -1682,6 +1682,7 @@ class AITableGridFieldService {
|
|
1682
1682
|
origin,
|
1683
1683
|
originPosition: position,
|
1684
1684
|
placement: 'bottomLeft',
|
1685
|
+
manualClosure: true,
|
1685
1686
|
originActiveClass: undefined,
|
1686
1687
|
initialState: {
|
1687
1688
|
aiTable,
|
@@ -2506,6 +2507,9 @@ class AITableGridBase {
|
|
2506
2507
|
this.aiAddRecord = output();
|
2507
2508
|
this.aiAddField = output();
|
2508
2509
|
this.aiUpdateFieldValue = output();
|
2510
|
+
this.fieldMenus = computed(() => {
|
2511
|
+
return this.aiFieldConfig()?.fieldMenus || [];
|
2512
|
+
});
|
2509
2513
|
this.gridData = computed(() => {
|
2510
2514
|
if (this.aiBuildRenderDataFn && this.aiBuildRenderDataFn() && this.aiTable) {
|
2511
2515
|
return this.aiBuildRenderDataFn()(this.aiTable);
|
@@ -2525,7 +2529,6 @@ class AITableGridBase {
|
|
2525
2529
|
ngOnInit() {
|
2526
2530
|
this.initAITable();
|
2527
2531
|
this.initService();
|
2528
|
-
this.buildFieldMenus();
|
2529
2532
|
}
|
2530
2533
|
initAITable() {
|
2531
2534
|
this.aiTable = createAITable(this.aiRecords, this.aiFields);
|
@@ -2541,9 +2544,6 @@ class AITableGridBase {
|
|
2541
2544
|
this.aiTableGridFieldService.initAIFieldConfig(this.aiFieldConfig());
|
2542
2545
|
AI_TABLE_GRID_FIELD_SERVICE_MAP.set(this.aiTable, this.aiTableGridFieldService);
|
2543
2546
|
}
|
2544
|
-
buildFieldMenus() {
|
2545
|
-
this.fieldMenus = this.aiFieldConfig()?.fieldMenus || [];
|
2546
|
-
}
|
2547
2547
|
addRecord() {
|
2548
2548
|
const records = this.gridData().records;
|
2549
2549
|
const recordCount = records.length;
|
@@ -2644,7 +2644,7 @@ class AITableDomGrid extends AITableGridBase {
|
|
2644
2644
|
origin: moreBtn,
|
2645
2645
|
editOrigin: fieldAction,
|
2646
2646
|
fieldId: field._id,
|
2647
|
-
fieldMenus: this.fieldMenus
|
2647
|
+
fieldMenus: this.fieldMenus()
|
2648
2648
|
});
|
2649
2649
|
}
|
2650
2650
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableDomGrid, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
@@ -3195,13 +3195,13 @@ class AITableAddField {
|
|
3195
3195
|
return lastColumnWidth + lastColumnOffset;
|
3196
3196
|
});
|
3197
3197
|
this.rectConfig = computed(() => {
|
3198
|
-
const { targetName } = this.config()
|
3198
|
+
const { pointPosition: { targetName }, readonly } = this.config();
|
3199
3199
|
const fill = targetName === AI_TABLE_FIELD_ADD_BUTTON ? Colors.gray80 : Colors.white;
|
3200
3200
|
return {
|
3201
3201
|
name: generateTargetName({
|
3202
3202
|
targetName: AI_TABLE_FIELD_ADD_BUTTON,
|
3203
3203
|
fieldId: this.config().fields[this.config().columnStopIndex]._id,
|
3204
|
-
mouseStyle: 'pointer'
|
3204
|
+
mouseStyle: readonly ? 'default' : 'pointer'
|
3205
3205
|
}),
|
3206
3206
|
x: AI_TABLE_OFFSET,
|
3207
3207
|
y: AI_TABLE_OFFSET,
|
@@ -3216,24 +3216,28 @@ class AITableAddField {
|
|
3216
3216
|
};
|
3217
3217
|
});
|
3218
3218
|
this.addIconConfig = computed(() => {
|
3219
|
+
const { readonly } = this.config();
|
3219
3220
|
const offsetY = (this.config().coordinate.rowInitSize - AI_TABLE_ICON_COMMON_SIZE) / 2;
|
3220
3221
|
return {
|
3221
3222
|
x: AI_TABLE_CELL_PADDING,
|
3222
3223
|
y: offsetY,
|
3223
3224
|
data: AddOutlinedPath,
|
3224
3225
|
fill: Colors.gray600,
|
3225
|
-
listening: false
|
3226
|
+
listening: false,
|
3227
|
+
visible: isNil(readonly) ? true : !readonly
|
3226
3228
|
};
|
3227
3229
|
});
|
3228
3230
|
}
|
3229
3231
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableAddField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
3230
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
3232
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AITableAddField, isStandalone: true, selector: "ai-table-add-field", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: `
|
3231
3233
|
<ko-group [config]="{ x: x() }">
|
3232
3234
|
<ko-group>
|
3233
3235
|
<ko-rect [config]="rectConfig()"></ko-rect>
|
3234
3236
|
</ko-group>
|
3235
3237
|
<ko-group>
|
3236
|
-
|
3238
|
+
@if (addIconConfig().visible) {
|
3239
|
+
<ai-table-icon [config]="addIconConfig()"></ai-table-icon>
|
3240
|
+
}
|
3237
3241
|
</ko-group>
|
3238
3242
|
</ko-group>
|
3239
3243
|
`, isInline: true, dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableIcon, selector: "ai-table-icon", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
@@ -3248,7 +3252,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
3248
3252
|
<ko-rect [config]="rectConfig()"></ko-rect>
|
3249
3253
|
</ko-group>
|
3250
3254
|
<ko-group>
|
3251
|
-
|
3255
|
+
@if (addIconConfig().visible) {
|
3256
|
+
<ai-table-icon [config]="addIconConfig()"></ai-table-icon>
|
3257
|
+
}
|
3252
3258
|
</ko-group>
|
3253
3259
|
</ko-group>
|
3254
3260
|
`,
|
@@ -5936,6 +5942,9 @@ class AITableRenderer {
|
|
5936
5942
|
this.fields = computed(() => {
|
5937
5943
|
return AITable.getVisibleFields(this.config().aiTable);
|
5938
5944
|
});
|
5945
|
+
this.readonly = computed(() => {
|
5946
|
+
return this.config()?.readonly;
|
5947
|
+
});
|
5939
5948
|
this.coordinate = computed(() => {
|
5940
5949
|
return this.config()?.coordinate;
|
5941
5950
|
});
|
@@ -6024,7 +6033,7 @@ class AITableRenderer {
|
|
6024
6033
|
});
|
6025
6034
|
this.columnHeadOrAddFieldConfig = computed(() => {
|
6026
6035
|
const { columnStartIndex, columnStopIndex } = this.visibleRangeInfo();
|
6027
|
-
const { aiTable, coordinate } = this.config();
|
6036
|
+
const { aiTable, coordinate, readonly } = this.config();
|
6028
6037
|
const { pointPosition } = aiTable.context;
|
6029
6038
|
const fields = this.fields();
|
6030
6039
|
return {
|
@@ -6033,7 +6042,8 @@ class AITableRenderer {
|
|
6033
6042
|
fields,
|
6034
6043
|
columnStartIndex,
|
6035
6044
|
columnStopIndex,
|
6036
|
-
pointPosition: pointPosition()
|
6045
|
+
pointPosition: pointPosition(),
|
6046
|
+
readonly
|
6037
6047
|
};
|
6038
6048
|
});
|
6039
6049
|
this.cellsConfig = computed(() => {
|
@@ -6066,7 +6076,7 @@ class AITableRenderer {
|
|
6066
6076
|
this.koDblclick.emit(e);
|
6067
6077
|
}
|
6068
6078
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableRenderer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
6069
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field
|
6079
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AITableRenderer, isStandalone: true, selector: "ai-table-renderer", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: true, transformFunction: null } }, outputs: { koMousemove: "koMousemove", koMousedown: "koMousedown", koWheel: "koWheel", koClick: "koClick", koDblclick: "koDblclick" }, ngImport: i0, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n", dependencies: [{ kind: "component", type: KoContainer, selector: "ko-layer, ko-fastlayer, ko-group" }, { kind: "component", type: KoStage, selector: "ko-stage", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: KoShape, selector: "ko-shape, ko-circle, ko-label, ko-rect, ko-ellipse, ko-wedge, ko-line, ko-sprite, ko-image, ko-text, ko-text-path, ko-star, ko-ring, ko-arc, ko-tag, ko-path, ko-regular-polygon, ko-arrow, ko-transformer", inputs: ["config"], outputs: ["koMouseover", "koMousemove", "koMouseout", "koMouseenter", "koMouseleave", "koMousedown", "koMouseup", "koWheel", "koContextmenu", "koClick", "koDblclick", "koTouchstart", "koTouchmove", "koTouchend", "koTap", "koDbltap", "koDragstart", "koDragmove", "koDragend"] }, { kind: "component", type: AITableColumnHeads, selector: "ai-table-column-heads", inputs: ["config"] }, { kind: "component", type: AITableFrozenColumnHeads, selector: "ai-table-frozen-column-heads", inputs: ["config"] }, { kind: "component", type: AITableCells, selector: "ai-table-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenCells, selector: "ai-table-frozen-cells", inputs: ["config"] }, { kind: "component", type: AITableFrozenPlaceholderCells, selector: "ai-table-frozen-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITablePlaceholderCells, selector: "ai-table-placeholder-cells", inputs: ["config"] }, { kind: "component", type: AITableAddField, selector: "ai-table-add-field", inputs: ["config"] }, { kind: "component", type: AITableHoverRowHeads, selector: "ai-table-hover-row-heads", inputs: ["config"] }, { kind: "component", type: AITableOtherRows, selector: "ai-table-other-rows", inputs: ["config"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
6070
6080
|
}
|
6071
6081
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AITableRenderer, decorators: [{
|
6072
6082
|
type: Component,
|
@@ -6083,7 +6093,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
6083
6093
|
AITableAddField,
|
6084
6094
|
AITableHoverRowHeads,
|
6085
6095
|
AITableOtherRows
|
6086
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field
|
6096
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<ko-stage\n [config]=\"stageConfig()\"\n (koMousemove)=\"stageMousemove($event)\"\n (koMousedown)=\"stageMousedown($event)\"\n (koClick)=\"stageClick($event)\"\n (koDblclick)=\"stageDblclick($event)\"\n>\n <ko-layer>\n <ko-group [config]=\"gridGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n <ai-table-frozen-cells [config]=\"cellsConfig()\"></ai-table-frozen-cells>\n <ai-table-other-rows [config]=\"cellsConfig()\"></ai-table-other-rows>\n <ai-table-hover-row-heads [config]=\"cellsConfig()\"></ai-table-hover-row-heads>\n <ai-table-frozen-placeholder-cells [config]=\"cellsConfig()\"></ai-table-frozen-placeholder-cells>\n </ko-group>\n\n <ko-group>\n <ai-table-frozen-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-frozen-column-heads>\n </ko-group>\n\n <ko-group [config]=\"commonGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-cells [config]=\"cellsConfig()\"></ai-table-cells>\n </ko-group>\n\n <ko-group [config]=\"offsetXConfig()\">\n <ai-table-column-heads [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-column-heads>\n <ai-table-add-field [config]=\"columnHeadOrAddFieldConfig()\"></ai-table-add-field>\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"attachGroupConfig()\">\n <ko-group [config]=\"offsetConfig()\">\n <ai-table-placeholder-cells [config]=\"cellsConfig()\"></ai-table-placeholder-cells>\n @if (activeCellBorderConfig().activeCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().activeCellBorder!\"></ko-rect>\n }\n </ko-group>\n </ko-group>\n\n <ko-group [config]=\"frozenAttachGroupConfig()\">\n <ko-group [config]=\"offsetYConfig()\">\n @if (activeCellBorderConfig().frozenActiveCellBorder) {\n <ko-rect [config]=\"activeCellBorderConfig().frozenActiveCellBorder!\"></ko-rect>\n }\n </ko-group>\n </ko-group>\n </ko-group>\n </ko-layer>\n</ko-stage>\n\n<ng-content></ng-content>\n" }]
|
6087
6097
|
}] });
|
6088
6098
|
|
6089
6099
|
class AITableGrid extends AITableGridBase {
|
@@ -6098,7 +6108,7 @@ class AITableGrid extends AITableGridBase {
|
|
6098
6108
|
this.verticalBarRef = viewChild('verticalBar');
|
6099
6109
|
this.horizontalBarRef = viewChild('horizontalBar');
|
6100
6110
|
this.linearRows = computed(() => {
|
6101
|
-
return buildGridLinearRows(this.gridData().records);
|
6111
|
+
return buildGridLinearRows(this.gridData().records, !this.aiReadonly());
|
6102
6112
|
});
|
6103
6113
|
this.visibleColumnsMap = computed(() => {
|
6104
6114
|
const columns = AITable.getVisibleFields(this.aiTable);
|
@@ -6129,7 +6139,8 @@ class AITableGrid extends AITableGridBase {
|
|
6129
6139
|
coordinate: coordinate,
|
6130
6140
|
containerWidth: this.containerRect().width,
|
6131
6141
|
containerHeight: this.containerRect().height,
|
6132
|
-
references: this.aiReferences()
|
6142
|
+
references: this.aiReferences(),
|
6143
|
+
readonly: this.aiReadonly()
|
6133
6144
|
};
|
6134
6145
|
});
|
6135
6146
|
this.coordinate = computed(() => {
|
@@ -6186,7 +6197,7 @@ class AITableGrid extends AITableGridBase {
|
|
6186
6197
|
}
|
6187
6198
|
});
|
6188
6199
|
effect(() => {
|
6189
|
-
if (this.aiTable.context?.pointPosition()) {
|
6200
|
+
if (!this.aiReadonly() && this.aiTable.context?.pointPosition()) {
|
6190
6201
|
this.toggleHoverCellEditor();
|
6191
6202
|
}
|
6192
6203
|
});
|
@@ -6257,7 +6268,7 @@ class AITableGrid extends AITableGridBase {
|
|
6257
6268
|
mouseEvent.preventDefault();
|
6258
6269
|
const { context } = this.aiTable;
|
6259
6270
|
const { targetName, rowIndex: pointRowIndex } = context.pointPosition();
|
6260
|
-
if (mouseEvent.button !== AITableMouseDownType.Left)
|
6271
|
+
if (mouseEvent.button !== AITableMouseDownType.Left || (targetName !== AI_TABLE_FIELD_HEAD_MORE && this.aiReadonly()))
|
6261
6272
|
return;
|
6262
6273
|
switch (targetName) {
|
6263
6274
|
case AI_TABLE_ROW_ADD_BUTTON: {
|
@@ -6304,7 +6315,7 @@ class AITableGrid extends AITableGridBase {
|
|
6304
6315
|
const editOrigin = this.containerElement().querySelector('.konvajs-content');
|
6305
6316
|
this.aiTableGridFieldService.openFieldMenu(this.aiTable, {
|
6306
6317
|
fieldId: fieldId,
|
6307
|
-
fieldMenus: this.fieldMenus,
|
6318
|
+
fieldMenus: this.fieldMenus(),
|
6308
6319
|
origin: this.containerElement(),
|
6309
6320
|
position,
|
6310
6321
|
editOrigin: editOrigin,
|
@@ -6315,6 +6326,9 @@ class AITableGrid extends AITableGridBase {
|
|
6315
6326
|
}
|
6316
6327
|
}
|
6317
6328
|
stageDblclick(e) {
|
6329
|
+
if (this.aiReadonly()) {
|
6330
|
+
return;
|
6331
|
+
}
|
6318
6332
|
const _targetName = e.event.target.name();
|
6319
6333
|
const { fieldId, recordId } = getDetailByTargetName(_targetName);
|
6320
6334
|
if (!recordId || !fieldId) {
|