@datorama/core 22.11.2 → 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.
@@ -7362,6 +7362,74 @@ function isTestEnv() {
7362
7362
  return !!window.Cypress;
7363
7363
  }
7364
7364
 
7365
+ /**
7366
+ * @license
7367
+ * Copyright Datorama. All Rights Reserved.
7368
+ *
7369
+ * Use of this source code is governed by an Apache License 2.0 license that can be
7370
+ * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
7371
+ */
7372
+ let DatoTriggerSingle = class DatoTriggerSingle {
7373
+ constructor(cdr) {
7374
+ this.cdr = cdr;
7375
+ this._placeholder = '';
7376
+ }
7377
+ set placeholder(value) {
7378
+ this._placeholder = value;
7379
+ this.cdr.detectChanges();
7380
+ }
7381
+ set context(value) {
7382
+ this._model = { $implicit: value };
7383
+ this.cdr.detectChanges();
7384
+ }
7385
+ get hidePlaceholder() {
7386
+ return !this._model || !this._model.$implicit;
7387
+ }
7388
+ ngOnInit() {
7389
+ this.cdr.detach();
7390
+ }
7391
+ get getLabel() {
7392
+ return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
7393
+ }
7394
+ triggerChangeDetection() {
7395
+ this.cdr.detectChanges();
7396
+ }
7397
+ };
7398
+ DatoTriggerSingle.ctorParameters = () => [
7399
+ { type: ChangeDetectorRef }
7400
+ ];
7401
+ __decorate([
7402
+ Input(),
7403
+ __metadata("design:type", TemplateRef)
7404
+ ], DatoTriggerSingle.prototype, "loadingTemplate", void 0);
7405
+ __decorate([
7406
+ Input(),
7407
+ __metadata("design:type", DatoSelectActiveDirective)
7408
+ ], DatoTriggerSingle.prototype, "active", void 0);
7409
+ __decorate([
7410
+ Input(),
7411
+ __metadata("design:type", Object),
7412
+ __metadata("design:paramtypes", [Object])
7413
+ ], DatoTriggerSingle.prototype, "placeholder", null);
7414
+ __decorate([
7415
+ Input(),
7416
+ __metadata("design:type", String)
7417
+ ], DatoTriggerSingle.prototype, "labelKey", void 0);
7418
+ __decorate([
7419
+ Input(),
7420
+ __metadata("design:type", Object),
7421
+ __metadata("design:paramtypes", [Object])
7422
+ ], DatoTriggerSingle.prototype, "context", null);
7423
+ DatoTriggerSingle = __decorate([
7424
+ Component({
7425
+ selector: 'dato-trigger-single',
7426
+ 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",
7427
+ changeDetection: ChangeDetectionStrategy.OnPush,
7428
+ 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}"]
7429
+ }),
7430
+ __metadata("design:paramtypes", [ChangeDetectorRef])
7431
+ ], DatoTriggerSingle);
7432
+
7365
7433
  /**
7366
7434
  * @license
7367
7435
  * Copyright Datorama. All Rights Reserved.
@@ -8057,6 +8125,9 @@ let DatoSelectComponent = class DatoSelectComponent extends BaseCustomControl {
8057
8125
  setTimeout(() => this.datoOverlay.scheduleUpdate(), 0);
8058
8126
  }
8059
8127
  }
8128
+ triggerChangeDetectionInDatoSingle() {
8129
+ this.datoTriggerSingle.triggerChangeDetection();
8130
+ }
8060
8131
  };
8061
8132
  DatoSelectComponent.ctorParameters = () => [
8062
8133
  { type: ChangeDetectorRef },
@@ -8067,6 +8138,10 @@ DatoSelectComponent.ctorParameters = () => [
8067
8138
  { type: undefined, decorators: [{ type: Attribute, args: ['datoSize',] }] },
8068
8139
  { type: String, decorators: [{ type: Attribute, args: ['width',] }] }
8069
8140
  ];
8141
+ __decorate([
8142
+ ViewChild('datoTriggerSingle'),
8143
+ __metadata("design:type", DatoTriggerSingle)
8144
+ ], DatoSelectComponent.prototype, "datoTriggerSingle", void 0);
8070
8145
  __decorate([
8071
8146
  ViewChild('dropdown'),
8072
8147
  __metadata("design:type", TemplateRef)
@@ -8233,7 +8308,7 @@ __decorate([
8233
8308
  DatoSelectComponent = __decorate([
8234
8309
  Component({
8235
8310
  selector: 'dato-select',
8236
- 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",
8311
+ 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",
8237
8312
  preserveWhitespaces: false,
8238
8313
  providers: [valueAccessor$3, DatoOverlay],
8239
8314
  encapsulation: ViewEncapsulation.None,
@@ -8249,71 +8324,6 @@ DatoSelectComponent = __decorate([
8249
8324
  DatoOverlay, Object, Object, String])
8250
8325
  ], DatoSelectComponent);
8251
8326
 
8252
- /**
8253
- * @license
8254
- * Copyright Datorama. All Rights Reserved.
8255
- *
8256
- * Use of this source code is governed by an Apache License 2.0 license that can be
8257
- * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
8258
- */
8259
- let DatoTriggerSingle = class DatoTriggerSingle {
8260
- constructor(cdr) {
8261
- this.cdr = cdr;
8262
- this._placeholder = '';
8263
- }
8264
- set placeholder(value) {
8265
- this._placeholder = value;
8266
- this.cdr.detectChanges();
8267
- }
8268
- set context(value) {
8269
- this._model = { $implicit: value };
8270
- this.cdr.detectChanges();
8271
- }
8272
- get hidePlaceholder() {
8273
- return !this._model || !this._model.$implicit;
8274
- }
8275
- ngOnInit() {
8276
- this.cdr.detach();
8277
- }
8278
- get getLabel() {
8279
- return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
8280
- }
8281
- };
8282
- DatoTriggerSingle.ctorParameters = () => [
8283
- { type: ChangeDetectorRef }
8284
- ];
8285
- __decorate([
8286
- Input(),
8287
- __metadata("design:type", TemplateRef)
8288
- ], DatoTriggerSingle.prototype, "loadingTemplate", void 0);
8289
- __decorate([
8290
- Input(),
8291
- __metadata("design:type", DatoSelectActiveDirective)
8292
- ], DatoTriggerSingle.prototype, "active", void 0);
8293
- __decorate([
8294
- Input(),
8295
- __metadata("design:type", Object),
8296
- __metadata("design:paramtypes", [Object])
8297
- ], DatoTriggerSingle.prototype, "placeholder", null);
8298
- __decorate([
8299
- Input(),
8300
- __metadata("design:type", String)
8301
- ], DatoTriggerSingle.prototype, "labelKey", void 0);
8302
- __decorate([
8303
- Input(),
8304
- __metadata("design:type", Object),
8305
- __metadata("design:paramtypes", [Object])
8306
- ], DatoTriggerSingle.prototype, "context", null);
8307
- DatoTriggerSingle = __decorate([
8308
- Component({
8309
- selector: 'dato-trigger-single',
8310
- 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",
8311
- changeDetection: ChangeDetectionStrategy.OnPush,
8312
- 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}"]
8313
- }),
8314
- __metadata("design:paramtypes", [ChangeDetectorRef])
8315
- ], DatoTriggerSingle);
8316
-
8317
8327
  /**
8318
8328
  * @license
8319
8329
  * Copyright Datorama. All Rights Reserved.
@@ -22841,7 +22851,7 @@ function fixNgLeaks() {
22841
22851
  };
22842
22852
  }
22843
22853
 
22844
- window.coreVersion = '22.11.2';
22854
+ window.coreVersion = '22.12.0';
22845
22855
 
22846
22856
  /**
22847
22857
  * @license