@sd-angular/core 0.0.987 → 0.0.991
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.
- package/bundles/sd-angular-core-grid-material.umd.js +29 -21
- package/bundles/sd-angular-core-grid-material.umd.js.map +1 -1
- package/bundles/sd-angular-core-grid-material.umd.min.js +2 -2
- package/bundles/sd-angular-core-grid-material.umd.min.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.js +45 -121
- package/bundles/sd-angular-core-select.umd.js.map +1 -1
- package/bundles/sd-angular-core-select.umd.min.js +2 -2
- package/bundles/sd-angular-core-select.umd.min.js.map +1 -1
- package/esm2015/grid-material/src/lib/components/desktop-cell/desktop-cell.component.js +2 -2
- package/esm2015/grid-material/src/lib/grid-material.component.js +1 -8
- package/esm2015/grid-material/src/lib/grid-material.module.js +2 -1
- package/esm2015/grid-material/src/lib/models/grid.model.js +1 -1
- package/esm2015/grid-material/src/lib/pipes/editor-handler-column.pipe.js +7 -7
- package/esm2015/grid-material/src/lib/pipes/editor-handler-row.pipe.js +2 -2
- package/esm2015/grid-material/src/lib/pipes/sd-id.pipe.js +6 -4
- package/esm2015/grid-material/src/lib/pipes/selection-visible-select-all.pipe.js +2 -2
- package/esm2015/select/src/lib/select.component.js +46 -122
- package/fesm2015/sd-angular-core-grid-material.js +31 -34
- package/fesm2015/sd-angular-core-grid-material.js.map +1 -1
- package/fesm2015/sd-angular-core-select.js +45 -121
- package/fesm2015/sd-angular-core-select.js.map +1 -1
- package/grid-material/sd-angular-core-grid-material.metadata.json +1 -1
- package/grid-material/src/lib/grid-material.component.d.ts +0 -1
- package/grid-material/src/lib/models/grid.model.d.ts +1 -0
- package/grid-material/src/lib/pipes/editor-handler-column.pipe.d.ts +2 -1
- package/grid-material/src/lib/pipes/sd-id.pipe.d.ts +2 -1
- package/package.json +1 -1
- package/{sd-angular-core-0.0.987.tgz → sd-angular-core-0.0.991.tgz} +0 -0
- package/select/sd-angular-core-select.metadata.json +1 -1
|
@@ -6,11 +6,10 @@ import { trigger, state, style, transition, animate } from '@angular/animations'
|
|
|
6
6
|
import * as uuid from 'uuid';
|
|
7
7
|
import { v4 } from 'uuid';
|
|
8
8
|
import { Subject, Subscription, isObservable } from 'rxjs';
|
|
9
|
-
import * as hash from 'object-hash';
|
|
10
|
-
import hash__default from 'object-hash';
|
|
11
9
|
import { SdNotifyService } from '@sd-angular/core/notify';
|
|
12
10
|
import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
|
|
13
11
|
import { startWith, debounceTime, map, switchMap } from 'rxjs/operators';
|
|
12
|
+
import hash from 'object-hash';
|
|
14
13
|
import { SdSettingService } from '@sd-angular/core/setting';
|
|
15
14
|
import { DeviceDetectorService } from 'ngx-device-detector';
|
|
16
15
|
import { SdLoadingService } from '@sd-angular/core/loading';
|
|
@@ -237,7 +236,7 @@ class SdGridFilterService {
|
|
|
237
236
|
prefix: __classPrivateFieldGet(this, _prefix),
|
|
238
237
|
key
|
|
239
238
|
});
|
|
240
|
-
key =
|
|
239
|
+
key = hash({
|
|
241
240
|
prefix: __classPrivateFieldGet(this, _prefix),
|
|
242
241
|
key
|
|
243
242
|
});
|
|
@@ -693,7 +692,7 @@ class SdPopupExport {
|
|
|
693
692
|
if (!((_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.export) === null || _b === void 0 ? void 0 : _b.key)) {
|
|
694
693
|
return null;
|
|
695
694
|
}
|
|
696
|
-
return
|
|
695
|
+
return hash({
|
|
697
696
|
prefix,
|
|
698
697
|
key: (_d = (_c = this.gridOption) === null || _c === void 0 ? void 0 : _c.export) === null || _d === void 0 ? void 0 : _d.key
|
|
699
698
|
});
|
|
@@ -764,7 +763,7 @@ class SdGridConfigurationService {
|
|
|
764
763
|
if (!((_a = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _a === void 0 ? void 0 : _a.key) && !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)) {
|
|
765
764
|
return null;
|
|
766
765
|
}
|
|
767
|
-
return
|
|
766
|
+
return hash({
|
|
768
767
|
prefix,
|
|
769
768
|
key: ((_b = gridOption === null || gridOption === void 0 ? void 0 : gridOption.config) === null || _b === void 0 ? void 0 : _b.key) || !(gridOption === null || gridOption === void 0 ? void 0 : gridOption.key)
|
|
770
769
|
});
|
|
@@ -1086,7 +1085,7 @@ class SdGridService {
|
|
|
1086
1085
|
obj: {}
|
|
1087
1086
|
};
|
|
1088
1087
|
}
|
|
1089
|
-
const hashKey =
|
|
1088
|
+
const hashKey = hash({
|
|
1090
1089
|
prefix: __classPrivateFieldGet(this, _prefix$1),
|
|
1091
1090
|
field: column.field,
|
|
1092
1091
|
key,
|
|
@@ -1107,7 +1106,7 @@ class SdGridService {
|
|
|
1107
1106
|
return __classPrivateFieldGet(this, _cache$1)[hashKey];
|
|
1108
1107
|
});
|
|
1109
1108
|
this.getValues = (column, key) => {
|
|
1110
|
-
const hashKey =
|
|
1109
|
+
const hashKey = hash({
|
|
1111
1110
|
prefix: __classPrivateFieldGet(this, _prefix$1),
|
|
1112
1111
|
field: column.field,
|
|
1113
1112
|
key,
|
|
@@ -1369,8 +1368,6 @@ class SdGridMaterial {
|
|
|
1369
1368
|
// this.isHiddenPaginator = this.filterInfo.pageNumber === 0 && this.total <= this.filterInfo.pageSize;
|
|
1370
1369
|
this.items.forEach((item) => {
|
|
1371
1370
|
item.originItem = Object.assign({}, item);
|
|
1372
|
-
const { sdId } = item, remain = __rest(item, ["sdId"]);
|
|
1373
|
-
item.sdId = hash(remain);
|
|
1374
1371
|
});
|
|
1375
1372
|
yield ((_c = (_b = (_a = this.gridOption) === null || _a === void 0 ? void 0 : _a.reload) === null || _b === void 0 ? void 0 : _b.onReload) === null || _c === void 0 ? void 0 : _c.call(_b, this.items));
|
|
1376
1373
|
this.isSelectAll = this.items.every(e => e.isSelected);
|
|
@@ -1833,10 +1830,6 @@ class SdGridMaterial {
|
|
|
1833
1830
|
return;
|
|
1834
1831
|
}
|
|
1835
1832
|
};
|
|
1836
|
-
this.reloadItem = (item) => {
|
|
1837
|
-
const { sdId } = item, remain = __rest(item, ["sdId"]);
|
|
1838
|
-
item.sdId = hash(remain);
|
|
1839
|
-
};
|
|
1840
1833
|
this.detectChanges = () => this.ref.detectChanges();
|
|
1841
1834
|
}
|
|
1842
1835
|
set _gridFilter(gridFilter) {
|
|
@@ -2522,7 +2515,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2522
2515
|
if ('children' in action) {
|
|
2523
2516
|
const children = [];
|
|
2524
2517
|
for (const childAction of action.children) {
|
|
2525
|
-
const key =
|
|
2518
|
+
const key = hash(childAction);
|
|
2526
2519
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2527
2520
|
children.push(childAction);
|
|
2528
2521
|
}
|
|
@@ -2532,7 +2525,7 @@ class SdSelectionActionFilterPipe {
|
|
|
2532
2525
|
}
|
|
2533
2526
|
}
|
|
2534
2527
|
else {
|
|
2535
|
-
const key =
|
|
2528
|
+
const key = hash(action);
|
|
2536
2529
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2537
2530
|
results.push(action);
|
|
2538
2531
|
}
|
|
@@ -2563,7 +2556,7 @@ class SdSelectionDisablePipe {
|
|
|
2563
2556
|
const availableActions = actions.filter(action => {
|
|
2564
2557
|
if ('children' in action) {
|
|
2565
2558
|
for (const childAction of action.children) {
|
|
2566
|
-
const key =
|
|
2559
|
+
const key = hash(childAction);
|
|
2567
2560
|
if (selectedItems.every(e => e.actions.includes(key))) {
|
|
2568
2561
|
return true;
|
|
2569
2562
|
}
|
|
@@ -2571,7 +2564,7 @@ class SdSelectionDisablePipe {
|
|
|
2571
2564
|
return false;
|
|
2572
2565
|
}
|
|
2573
2566
|
else {
|
|
2574
|
-
const key =
|
|
2567
|
+
const key = hash(action);
|
|
2575
2568
|
return selectedItems.every(e => e.actions.includes(key));
|
|
2576
2569
|
}
|
|
2577
2570
|
});
|
|
@@ -2579,13 +2572,13 @@ class SdSelectionDisablePipe {
|
|
|
2579
2572
|
for (const action of availableActions) {
|
|
2580
2573
|
if ('children' in action) {
|
|
2581
2574
|
for (const childAction of action.children) {
|
|
2582
|
-
if (rowData.actions.includes(
|
|
2575
|
+
if (rowData.actions.includes(hash(childAction))) {
|
|
2583
2576
|
return false;
|
|
2584
2577
|
}
|
|
2585
2578
|
}
|
|
2586
2579
|
}
|
|
2587
2580
|
else {
|
|
2588
|
-
if (rowData.actions.includes(
|
|
2581
|
+
if (rowData.actions.includes(hash(action))) {
|
|
2589
2582
|
return false;
|
|
2590
2583
|
}
|
|
2591
2584
|
}
|
|
@@ -2608,7 +2601,7 @@ class SdSelectionVisibleSelectAllPipe {
|
|
|
2608
2601
|
return true;
|
|
2609
2602
|
}
|
|
2610
2603
|
if (!items.length) {
|
|
2611
|
-
return
|
|
2604
|
+
return false;
|
|
2612
2605
|
}
|
|
2613
2606
|
yield new Promise(resolve => setTimeout(resolve, 500));
|
|
2614
2607
|
const first = items[0];
|
|
@@ -2636,7 +2629,7 @@ class SdGeneratedColumnService {
|
|
|
2636
2629
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.key)) {
|
|
2637
2630
|
return null;
|
|
2638
2631
|
}
|
|
2639
|
-
const key =
|
|
2632
|
+
const key = hash({
|
|
2640
2633
|
prefix: '260f5e94-5865-4425-8ced-b9c083c390dd',
|
|
2641
2634
|
key: configuration.key
|
|
2642
2635
|
});
|
|
@@ -2657,7 +2650,7 @@ class SdGeneratedColumnService {
|
|
|
2657
2650
|
if (!(configuration === null || configuration === void 0 ? void 0 : configuration.systemColumn)) {
|
|
2658
2651
|
return null;
|
|
2659
2652
|
}
|
|
2660
|
-
const key =
|
|
2653
|
+
const key = hash({
|
|
2661
2654
|
prefix: '8b8050ca-1f44-4860-bad3-20e646c0d68f',
|
|
2662
2655
|
key: configuration.key
|
|
2663
2656
|
});
|
|
@@ -2776,7 +2769,7 @@ class SdDesktopCell {
|
|
|
2776
2769
|
SdDesktopCell.decorators = [
|
|
2777
2770
|
{ type: Component, args: [{
|
|
2778
2771
|
selector: 'sd-desktop-cell',
|
|
2779
|
-
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <ng-container *sdLet=\"item[column.field] | sdId:item\"
|
|
2772
|
+
template: "<ng-container *ngIf=\"column && item\">\r\n <ng-container *ngIf=\"item.editorHandlerRow?.visible;else useView\">\r\n <!-- <ng-container *sdLet=\"item[column.field] | sdId:item:column\"> -->\r\n <ng-container *sdLet=\"item[column.field] | sdEditorHandlerColumn:item:column:gridOption\">\r\n <ng-container *ngIf=\"item.editorHandlerColumn[column.field]?.visible;else useView\">\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx, isEdited: true }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-editor *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-editor>\r\n </ng-container>\r\n </ng-container>\r\n <!-- </ng-container> -->\r\n </ng-container>\r\n <ng-template #useView>\r\n <ng-container *ngIf=\"cellDef[column.field]\">\r\n <ng-container *ngTemplateOutlet=\"\r\n cellDef[column.field].templateRef;\r\n context: { item: item, column: column, idx: idx }\r\n \">\r\n </ng-container>\r\n </ng-container>\r\n <sd-desktop-cell-view *ngIf=\"!cellDef[column.field]\" [sdId]=\"item.sdId\" [key]=\"key\" [column]=\"column\" [item]=\"item\">\r\n </sd-desktop-cell-view>\r\n </ng-template>\r\n</ng-container>",
|
|
2780
2773
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
2781
2774
|
},] }
|
|
2782
2775
|
];
|
|
@@ -2847,8 +2840,8 @@ class SdEditorHandlerRowPipe {
|
|
|
2847
2840
|
}
|
|
2848
2841
|
item.editorHandlerRow = Object.assign(Object.assign({}, item.editorHandlerRow), { visible: false, editable: !status, removable: false, savable: false, cancelable: false });
|
|
2849
2842
|
}
|
|
2850
|
-
const { sdId } = item, remain = __rest(item, ["sdId"]);
|
|
2851
|
-
item.sdId =
|
|
2843
|
+
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
2844
|
+
item.sdId = hash(remain);
|
|
2852
2845
|
return item.editorHandlerRow;
|
|
2853
2846
|
}
|
|
2854
2847
|
}
|
|
@@ -2875,14 +2868,15 @@ class SdEditorHandlerColumnPipe {
|
|
|
2875
2868
|
return true;
|
|
2876
2869
|
});
|
|
2877
2870
|
}
|
|
2878
|
-
transform(
|
|
2871
|
+
transform(value, item, column, gridOption) {
|
|
2879
2872
|
if (column.type === 'children' || column.type === 'children-col') {
|
|
2880
2873
|
return;
|
|
2881
2874
|
}
|
|
2882
|
-
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
2883
2875
|
item.editorHandlerColumn[column.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[column.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, column, item) });
|
|
2884
|
-
const {
|
|
2885
|
-
|
|
2876
|
+
const { columns } = gridOption;
|
|
2877
|
+
for (const col of columns) {
|
|
2878
|
+
item.editorHandlerColumn[col.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[col.field]), { visible: __classPrivateFieldGet(this, _visible).call(this, col, item) });
|
|
2879
|
+
}
|
|
2886
2880
|
return true;
|
|
2887
2881
|
}
|
|
2888
2882
|
}
|
|
@@ -3016,7 +3010,7 @@ class SdSelectionVisiblePipe {
|
|
|
3016
3010
|
let flag = false;
|
|
3017
3011
|
for (const childAction of action.children) {
|
|
3018
3012
|
const { hidden } = childAction;
|
|
3019
|
-
const key =
|
|
3013
|
+
const key = hash(childAction);
|
|
3020
3014
|
if (typeof (hidden) === 'function') {
|
|
3021
3015
|
if (!hidden(rowData)) {
|
|
3022
3016
|
rowData.actions.push(key);
|
|
@@ -3029,12 +3023,12 @@ class SdSelectionVisiblePipe {
|
|
|
3029
3023
|
}
|
|
3030
3024
|
}
|
|
3031
3025
|
if (flag) {
|
|
3032
|
-
rowData.actions.push(
|
|
3026
|
+
rowData.actions.push(hash(action));
|
|
3033
3027
|
}
|
|
3034
3028
|
}
|
|
3035
3029
|
else {
|
|
3036
3030
|
const { hidden } = action;
|
|
3037
|
-
const key =
|
|
3031
|
+
const key = hash(action);
|
|
3038
3032
|
if (typeof (hidden) === 'function') {
|
|
3039
3033
|
if (!hidden(rowData)) {
|
|
3040
3034
|
rowData.actions.push(key);
|
|
@@ -3056,9 +3050,11 @@ SdSelectionVisiblePipe.decorators = [
|
|
|
3056
3050
|
];
|
|
3057
3051
|
|
|
3058
3052
|
class SdIdPipe {
|
|
3059
|
-
transform(value, item) {
|
|
3060
|
-
const { sdId } = item, remain = __rest(item, ["sdId"]);
|
|
3053
|
+
transform(value, item, column) {
|
|
3054
|
+
const { sdId, editorHandlerColumn } = item, remain = __rest(item, ["sdId", "editorHandlerColumn"]);
|
|
3055
|
+
item.editorHandlerColumn = item.editorHandlerColumn || {};
|
|
3061
3056
|
item.sdId = hash(remain);
|
|
3057
|
+
item.editorHandlerColumn[column.field] = Object.assign(Object.assign({}, item.editorHandlerColumn[column.field]), { sdId: item.sdId });
|
|
3062
3058
|
return item.sdId;
|
|
3063
3059
|
}
|
|
3064
3060
|
}
|
|
@@ -3176,6 +3172,7 @@ SdGridMaterialModule.decorators = [
|
|
|
3176
3172
|
providers: [
|
|
3177
3173
|
DatePipe,
|
|
3178
3174
|
DecimalPipe,
|
|
3175
|
+
SdIdPipe,
|
|
3179
3176
|
CdkColumnDef,
|
|
3180
3177
|
SdGridService,
|
|
3181
3178
|
SdGridFilterService,
|