@datorama/core 22.11.1 → 22.12.0

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.
@@ -8430,6 +8430,91 @@
8430
8430
  return !!window.Cypress;
8431
8431
  }
8432
8432
 
8433
+ /**
8434
+ * @license
8435
+ * Copyright Datorama. All Rights Reserved.
8436
+ *
8437
+ * Use of this source code is governed by an Apache License 2.0 license that can be
8438
+ * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
8439
+ */
8440
+ var DatoTriggerSingle = /** @class */ (function () {
8441
+ function DatoTriggerSingle(cdr) {
8442
+ this.cdr = cdr;
8443
+ this._placeholder = '';
8444
+ }
8445
+ Object.defineProperty(DatoTriggerSingle.prototype, "placeholder", {
8446
+ set: function (value) {
8447
+ this._placeholder = value;
8448
+ this.cdr.detectChanges();
8449
+ },
8450
+ enumerable: true,
8451
+ configurable: true
8452
+ });
8453
+ Object.defineProperty(DatoTriggerSingle.prototype, "context", {
8454
+ set: function (value) {
8455
+ this._model = { $implicit: value };
8456
+ this.cdr.detectChanges();
8457
+ },
8458
+ enumerable: true,
8459
+ configurable: true
8460
+ });
8461
+ Object.defineProperty(DatoTriggerSingle.prototype, "hidePlaceholder", {
8462
+ get: function () {
8463
+ return !this._model || !this._model.$implicit;
8464
+ },
8465
+ enumerable: true,
8466
+ configurable: true
8467
+ });
8468
+ DatoTriggerSingle.prototype.ngOnInit = function () {
8469
+ this.cdr.detach();
8470
+ };
8471
+ Object.defineProperty(DatoTriggerSingle.prototype, "getLabel", {
8472
+ get: function () {
8473
+ return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
8474
+ },
8475
+ enumerable: true,
8476
+ configurable: true
8477
+ });
8478
+ DatoTriggerSingle.prototype.triggerChangeDetection = function () {
8479
+ this.cdr.detectChanges();
8480
+ };
8481
+ DatoTriggerSingle.ctorParameters = function () { return [
8482
+ { type: core.ChangeDetectorRef }
8483
+ ]; };
8484
+ __decorate([
8485
+ core.Input(),
8486
+ __metadata("design:type", core.TemplateRef)
8487
+ ], DatoTriggerSingle.prototype, "loadingTemplate", void 0);
8488
+ __decorate([
8489
+ core.Input(),
8490
+ __metadata("design:type", DatoSelectActiveDirective)
8491
+ ], DatoTriggerSingle.prototype, "active", void 0);
8492
+ __decorate([
8493
+ core.Input(),
8494
+ __metadata("design:type", Object),
8495
+ __metadata("design:paramtypes", [Object])
8496
+ ], DatoTriggerSingle.prototype, "placeholder", null);
8497
+ __decorate([
8498
+ core.Input(),
8499
+ __metadata("design:type", String)
8500
+ ], DatoTriggerSingle.prototype, "labelKey", void 0);
8501
+ __decorate([
8502
+ core.Input(),
8503
+ __metadata("design:type", Object),
8504
+ __metadata("design:paramtypes", [Object])
8505
+ ], DatoTriggerSingle.prototype, "context", null);
8506
+ DatoTriggerSingle = __decorate([
8507
+ core.Component({
8508
+ selector: 'dato-trigger-single',
8509
+ template: "<ng-template *ngIf=\"loadingTemplate\" [ngTemplateOutlet]=\"loadingTemplate\"></ng-template>\n<ng-container\n *ngIf=\"active && !hidePlaceholder\"\n [ngTemplateOutlet]=\"active.tpl\"\n [ngTemplateOutletContext]=\"_model\">\n</ng-container>\n<ng-container *ngIf=\"!active\">{{getLabel | translate}}</ng-container>\n<span class=\"dato-select__placeholder\" *ngIf=\"hidePlaceholder\">{{_placeholder}}</span>\n<dato-icon datoIcon=\"arrow-down\" datoSize=\"sm\" class=\"dato-select__single__arrow\"></dato-icon>\n",
8510
+ changeDetection: core.ChangeDetectionStrategy.OnPush,
8511
+ styles: [":host{display:block;position:relative;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host dato-icon{position:absolute;top:50%;transform:translateY(-50%);right:10px}"]
8512
+ }),
8513
+ __metadata("design:paramtypes", [core.ChangeDetectorRef])
8514
+ ], DatoTriggerSingle);
8515
+ return DatoTriggerSingle;
8516
+ }());
8517
+
8433
8518
  /**
8434
8519
  * @license
8435
8520
  * Copyright Datorama. All Rights Reserved.
@@ -9311,6 +9396,9 @@
9311
9396
  setTimeout(function () { return _this.datoOverlay.scheduleUpdate(); }, 0);
9312
9397
  }
9313
9398
  };
9399
+ DatoSelectComponent.prototype.triggerChangeDetectionInDatoSingle = function () {
9400
+ this.datoTriggerSingle.triggerChangeDetection();
9401
+ };
9314
9402
  DatoSelectComponent.ctorParameters = function () { return [
9315
9403
  { type: core.ChangeDetectorRef },
9316
9404
  { type: DatoTranslateService },
@@ -9320,6 +9408,10 @@
9320
9408
  { type: undefined, decorators: [{ type: core.Attribute, args: ['datoSize',] }] },
9321
9409
  { type: String, decorators: [{ type: core.Attribute, args: ['width',] }] }
9322
9410
  ]; };
9411
+ __decorate([
9412
+ core.ViewChild('datoTriggerSingle'),
9413
+ __metadata("design:type", DatoTriggerSingle)
9414
+ ], DatoSelectComponent.prototype, "datoTriggerSingle", void 0);
9323
9415
  __decorate([
9324
9416
  core.ViewChild('dropdown'),
9325
9417
  __metadata("design:type", core.TemplateRef)
@@ -9486,7 +9578,7 @@
9486
9578
  DatoSelectComponent = __decorate([
9487
9579
  core.Component({
9488
9580
  selector: 'dato-select',
9489
- template: "<section class=\"dato-select__trigger\" [class.dato-select--naked]=\"_naked\" [class.dato-select--disabled]=\"_disabled\">\n\n <div class=\"dato-select__single\" *ngIf=\"isSingle\" [ngClass]=\"_dropdownClass\">\n <dato-input [class.force-hide]=\"(!open && isCombo) || !isCombo\" [placeholder]=\"searchPlaceholder | translate\"\n (keyup)=\"keyup($event)\" [isFocused]=\"_focus\" [isLoading]=\"isLoading\" [formControl]=\"searchControl\" type=\"search\">\n </dato-input>\n\n <dato-trigger-single [loadingTemplate]=\"loadingTemplate\" [active]=\"active\" datoErrorValidationBorderAnchor tabindex=\"0\" [labelKey]=\"labelKey\"\n [context]=\"_model[0]\" [class.force-hide]=\"open && isCombo\" [placeholder]=\"placeholder | translate\"\n class=\"ontop-overlay\" (keydown)=\"preventBodyScroll($event)\" (keyup)=\"keyup($event)\" (click)=\"openDropdown()\">\n </dato-trigger-single>\n </div>\n\n <dato-trigger-multi [loadingTemplate]=\"loadingTemplate\" [options]=\"_model\" datoErrorValidationBorderAnchor [control]=\"searchControl\"\n [placeholder]=\"placeholder | translate\" [labelKey]=\"labelKey\" [idKey]=\"idKey\" (keyup)=\"keyup($event)\"\n [isLoading]=\"isLoading\" [keepFocus]=\"keepFocus\" [limitTo]=\"limitTo\" [clickOutside]=\"_clickOutside\" [isSortable]=\"isSortable\"\n [selectAllChipTxt]=\"selectAllChipTxt\"\n [showSelectAllChip]=\"selectAllChipTxt && showSelectAllChip\"\n (unselectAll)=\"checkAll(false)\"\n (removeOption)=\"removeOption($event)\" (reorderOptions)=\"reorderOptions($event)\" *ngIf=\"isMulti\"\n (click)=\"openDropdown($event)\"></dato-trigger-multi>\n\n</section>\n\n<ng-template #dropdown>\n <section class=\"dato-select__dropdown-container\" tabindex=\"0\" (keyup)=\"keyup($event)\">\n\n <!-- HEADER -->\n\n <header class=\"dato-select__header dato-select__option dato-select__option--simple\" data-is-floating\n *ngIf=\"isMulti && allowSelectAll\" [class.force-hide]=\"_showEmptyResults\" [class.ml-10]=\"containsGroups\">\n <dato-checkbox [checked]=\"_isAllChecked\" (check)=\"checkAll($event)\"\n [indeterminatelyChecked]=\"_isIndeterminatelyChecked\">\n {{'core.select-all' | translate}}<span class=\"primary-300-color note-italic ml-5\">{{_count}}</span>\n </dato-checkbox>\n </header>\n\n <!-- END HEADER -->\n\n <!-- DROPDOWN -->\n\n <div class=\"dato-select__dropdown\">\n\n <ng-content></ng-content>\n\n <dato-select-empty [show]=\"_showEmptyResults\">{{_noItemsLabel}}</dato-select-empty>\n <div class=\"dato-select__option dato-select-infinite-spinner\" data-is-floating *ngIf=\"infiniteScrollLoading\">\n <span class=\"dato-input__spinner\"></span>\n </div>\n\n </div>\n\n <!-- END DROPDOWN -->\n\n\n <!-- FOOTER -->\n\n <footer class=\"dato-select__footer d-flex\" [class.with-actions]=\"_withActions\">\n\n <ng-content select=\"[datoSelectFooter]\"></ng-content>\n\n <ng-container *ngIf=\"_withActions\">\n <dato-link class=\"mr-20\" datoType=\"secondary\" (click)=\"close()\">Cancel</dato-link>\n <dato-button datoSize=\"sm\" (click)=\"save.emit(); close();\">Save</dato-button>\n </ng-container>\n\n </footer>\n\n <!-- END FOOTER -->\n\n </section>\n\n</ng-template>\n",
9581
+ template: "<section class=\"dato-select__trigger\" [class.dato-select--naked]=\"_naked\" [class.dato-select--disabled]=\"_disabled\">\n\n <div class=\"dato-select__single\" *ngIf=\"isSingle\" [ngClass]=\"_dropdownClass\">\n <dato-input [class.force-hide]=\"(!open && isCombo) || !isCombo\" [placeholder]=\"searchPlaceholder | translate\"\n (keyup)=\"keyup($event)\" [isFocused]=\"_focus\" [isLoading]=\"isLoading\" [formControl]=\"searchControl\" type=\"search\">\n </dato-input>\n\n <dato-trigger-single #datoTriggerSingle [loadingTemplate]=\"loadingTemplate\" [active]=\"active\" datoErrorValidationBorderAnchor tabindex=\"0\" [labelKey]=\"labelKey\"\n [context]=\"_model[0]\" [class.force-hide]=\"open && isCombo\" [placeholder]=\"placeholder | translate\"\n class=\"ontop-overlay\" (keydown)=\"preventBodyScroll($event)\" (keyup)=\"keyup($event)\" (click)=\"openDropdown()\">\n </dato-trigger-single>\n </div>\n\n <dato-trigger-multi [loadingTemplate]=\"loadingTemplate\" [options]=\"_model\" datoErrorValidationBorderAnchor [control]=\"searchControl\"\n [placeholder]=\"placeholder | translate\" [labelKey]=\"labelKey\" [idKey]=\"idKey\" (keyup)=\"keyup($event)\"\n [isLoading]=\"isLoading\" [keepFocus]=\"keepFocus\" [limitTo]=\"limitTo\" [clickOutside]=\"_clickOutside\" [isSortable]=\"isSortable\"\n [selectAllChipTxt]=\"selectAllChipTxt\"\n [showSelectAllChip]=\"selectAllChipTxt && showSelectAllChip\"\n (unselectAll)=\"checkAll(false)\"\n (removeOption)=\"removeOption($event)\" (reorderOptions)=\"reorderOptions($event)\" *ngIf=\"isMulti\"\n (click)=\"openDropdown($event)\"></dato-trigger-multi>\n\n</section>\n\n<ng-template #dropdown>\n <section class=\"dato-select__dropdown-container\" tabindex=\"0\" (keyup)=\"keyup($event)\">\n\n <!-- HEADER -->\n\n <header class=\"dato-select__header dato-select__option dato-select__option--simple\" data-is-floating\n *ngIf=\"isMulti && allowSelectAll\" [class.force-hide]=\"_showEmptyResults\" [class.ml-10]=\"containsGroups\">\n <dato-checkbox [checked]=\"_isAllChecked\" (check)=\"checkAll($event)\"\n [indeterminatelyChecked]=\"_isIndeterminatelyChecked\">\n {{'core.select-all' | translate}}<span class=\"primary-300-color note-italic ml-5\">{{_count}}</span>\n </dato-checkbox>\n </header>\n\n <!-- END HEADER -->\n\n <!-- DROPDOWN -->\n\n <div class=\"dato-select__dropdown\">\n\n <ng-content></ng-content>\n\n <dato-select-empty [show]=\"_showEmptyResults\">{{_noItemsLabel}}</dato-select-empty>\n <div class=\"dato-select__option dato-select-infinite-spinner\" data-is-floating *ngIf=\"infiniteScrollLoading\">\n <span class=\"dato-input__spinner\"></span>\n </div>\n\n </div>\n\n <!-- END DROPDOWN -->\n\n\n <!-- FOOTER -->\n\n <footer class=\"dato-select__footer d-flex\" [class.with-actions]=\"_withActions\">\n\n <ng-content select=\"[datoSelectFooter]\"></ng-content>\n\n <ng-container *ngIf=\"_withActions\">\n <dato-link class=\"mr-20\" datoType=\"secondary\" (click)=\"close()\">Cancel</dato-link>\n <dato-button datoSize=\"sm\" (click)=\"save.emit(); close();\">Save</dato-button>\n </ng-container>\n\n </footer>\n\n <!-- END FOOTER -->\n\n </section>\n\n</ng-template>\n",
9490
9582
  preserveWhitespaces: false,
9491
9583
  providers: [valueAccessor$3, DatoOverlay],
9492
9584
  encapsulation: core.ViewEncapsulation.None,
@@ -9504,88 +9596,6 @@
9504
9596
  return DatoSelectComponent;
9505
9597
  }(BaseCustomControl));
9506
9598
 
9507
- /**
9508
- * @license
9509
- * Copyright Datorama. All Rights Reserved.
9510
- *
9511
- * Use of this source code is governed by an Apache License 2.0 license that can be
9512
- * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
9513
- */
9514
- var DatoTriggerSingle = /** @class */ (function () {
9515
- function DatoTriggerSingle(cdr) {
9516
- this.cdr = cdr;
9517
- this._placeholder = '';
9518
- }
9519
- Object.defineProperty(DatoTriggerSingle.prototype, "placeholder", {
9520
- set: function (value) {
9521
- this._placeholder = value;
9522
- this.cdr.detectChanges();
9523
- },
9524
- enumerable: true,
9525
- configurable: true
9526
- });
9527
- Object.defineProperty(DatoTriggerSingle.prototype, "context", {
9528
- set: function (value) {
9529
- this._model = { $implicit: value };
9530
- this.cdr.detectChanges();
9531
- },
9532
- enumerable: true,
9533
- configurable: true
9534
- });
9535
- Object.defineProperty(DatoTriggerSingle.prototype, "hidePlaceholder", {
9536
- get: function () {
9537
- return !this._model || !this._model.$implicit;
9538
- },
9539
- enumerable: true,
9540
- configurable: true
9541
- });
9542
- DatoTriggerSingle.prototype.ngOnInit = function () {
9543
- this.cdr.detach();
9544
- };
9545
- Object.defineProperty(DatoTriggerSingle.prototype, "getLabel", {
9546
- get: function () {
9547
- return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
9548
- },
9549
- enumerable: true,
9550
- configurable: true
9551
- });
9552
- DatoTriggerSingle.ctorParameters = function () { return [
9553
- { type: core.ChangeDetectorRef }
9554
- ]; };
9555
- __decorate([
9556
- core.Input(),
9557
- __metadata("design:type", core.TemplateRef)
9558
- ], DatoTriggerSingle.prototype, "loadingTemplate", void 0);
9559
- __decorate([
9560
- core.Input(),
9561
- __metadata("design:type", DatoSelectActiveDirective)
9562
- ], DatoTriggerSingle.prototype, "active", void 0);
9563
- __decorate([
9564
- core.Input(),
9565
- __metadata("design:type", Object),
9566
- __metadata("design:paramtypes", [Object])
9567
- ], DatoTriggerSingle.prototype, "placeholder", null);
9568
- __decorate([
9569
- core.Input(),
9570
- __metadata("design:type", String)
9571
- ], DatoTriggerSingle.prototype, "labelKey", void 0);
9572
- __decorate([
9573
- core.Input(),
9574
- __metadata("design:type", Object),
9575
- __metadata("design:paramtypes", [Object])
9576
- ], DatoTriggerSingle.prototype, "context", null);
9577
- DatoTriggerSingle = __decorate([
9578
- core.Component({
9579
- selector: 'dato-trigger-single',
9580
- template: "<ng-template *ngIf=\"loadingTemplate\" [ngTemplateOutlet]=\"loadingTemplate\"></ng-template>\n<ng-container\n *ngIf=\"active && !hidePlaceholder\"\n [ngTemplateOutlet]=\"active.tpl\"\n [ngTemplateOutletContext]=\"_model\">\n</ng-container>\n<ng-container *ngIf=\"!active\">{{getLabel | translate}}</ng-container>\n<span class=\"dato-select__placeholder\" *ngIf=\"hidePlaceholder\">{{_placeholder}}</span>\n<dato-icon datoIcon=\"arrow-down\" datoSize=\"sm\" class=\"dato-select__single__arrow\"></dato-icon>\n",
9581
- changeDetection: core.ChangeDetectionStrategy.OnPush,
9582
- styles: [":host{display:block;position:relative;cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host dato-icon{position:absolute;top:50%;transform:translateY(-50%);right:10px}"]
9583
- }),
9584
- __metadata("design:paramtypes", [core.ChangeDetectorRef])
9585
- ], DatoTriggerSingle);
9586
- return DatoTriggerSingle;
9587
- }());
9588
-
9589
9599
  /**
9590
9600
  * @license
9591
9601
  * Copyright Datorama. All Rights Reserved.
@@ -11516,6 +11526,8 @@
11516
11526
  //@internal
11517
11527
  _this._serverDataLoaded = new rxjs.Subject();
11518
11528
  _this.serverDataLoaded$ = _this._serverDataLoaded.asObservable();
11529
+ _this._rowActionVisibilityChanged = new rxjs.Subject();
11530
+ _this.rowActionVisibilityChanged$ = _this._rowActionVisibilityChanged.asObservable();
11519
11531
  _this.rowDataChanged$ = _this.waitForGrid(function () {
11520
11532
  return rxjs.merge(_this.gridRef.rowDataChanged, _this.gridRef.rowDataUpdated, _this.gridRef.filterChanged, _this.serverDataLoaded$);
11521
11533
  });
@@ -15154,6 +15166,9 @@
15154
15166
  this.setServerSidePagination({ selectAllRowsEnabled: false, excludedFromSelectAll: [] });
15155
15167
  }
15156
15168
  };
15169
+ GridService.prototype.resolveRowActionsVisibility = function () {
15170
+ this.gridQuery._rowActionVisibilityChanged.next();
15171
+ };
15157
15172
  /**
15158
15173
  * When pivoting,
15159
15174
  * we add the field name to the column header class in order to access it through the auto generated pivot column.
@@ -16973,7 +16988,7 @@
16973
16988
  DatoGridV2ToolbarComponent.prototype.ngOnInit = function () {
16974
16989
  var _this = this;
16975
16990
  var dataChanges = this.gridController.gridQuery.waitForGrid(function () {
16976
- return rxjs.merge(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated).pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16991
+ return rxjs.merge(_this.gridQuery.gridRef.cellValueChanged, _this.gridQuery.gridRef.rowDataUpdated, _this.gridQuery.rowActionVisibilityChanged$).pipe(operators.debounceTime(100), ngxTakeUntilDestroy.untilDestroyed(_this));
16977
16992
  });
16978
16993
  var gridInit = this.gridQuery.gridReady$.pipe(operators.take(1));
16979
16994
  gridInit.pipe(ngxTakeUntilDestroy.untilDestroyed(this)).subscribe(function () {
@@ -25601,7 +25616,7 @@
25601
25616
  };
25602
25617
  }
25603
25618
 
25604
- window.coreVersion = '22.11.1';
25619
+ window.coreVersion = '22.12.0';
25605
25620
 
25606
25621
  exports.APP_TRANSLATE = APP_TRANSLATE;
25607
25622
  exports.AceService = AceService;