@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.
@@ -8231,6 +8231,91 @@ function isTestEnv() {
8231
8231
  return !!window.Cypress;
8232
8232
  }
8233
8233
 
8234
+ /**
8235
+ * @license
8236
+ * Copyright Datorama. All Rights Reserved.
8237
+ *
8238
+ * Use of this source code is governed by an Apache License 2.0 license that can be
8239
+ * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
8240
+ */
8241
+ var DatoTriggerSingle = /** @class */ (function () {
8242
+ function DatoTriggerSingle(cdr) {
8243
+ this.cdr = cdr;
8244
+ this._placeholder = '';
8245
+ }
8246
+ Object.defineProperty(DatoTriggerSingle.prototype, "placeholder", {
8247
+ set: function (value) {
8248
+ this._placeholder = value;
8249
+ this.cdr.detectChanges();
8250
+ },
8251
+ enumerable: true,
8252
+ configurable: true
8253
+ });
8254
+ Object.defineProperty(DatoTriggerSingle.prototype, "context", {
8255
+ set: function (value) {
8256
+ this._model = { $implicit: value };
8257
+ this.cdr.detectChanges();
8258
+ },
8259
+ enumerable: true,
8260
+ configurable: true
8261
+ });
8262
+ Object.defineProperty(DatoTriggerSingle.prototype, "hidePlaceholder", {
8263
+ get: function () {
8264
+ return !this._model || !this._model.$implicit;
8265
+ },
8266
+ enumerable: true,
8267
+ configurable: true
8268
+ });
8269
+ DatoTriggerSingle.prototype.ngOnInit = function () {
8270
+ this.cdr.detach();
8271
+ };
8272
+ Object.defineProperty(DatoTriggerSingle.prototype, "getLabel", {
8273
+ get: function () {
8274
+ return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
8275
+ },
8276
+ enumerable: true,
8277
+ configurable: true
8278
+ });
8279
+ DatoTriggerSingle.prototype.triggerChangeDetection = function () {
8280
+ this.cdr.detectChanges();
8281
+ };
8282
+ DatoTriggerSingle.ctorParameters = function () { return [
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
+ return DatoTriggerSingle;
8317
+ }());
8318
+
8234
8319
  /**
8235
8320
  * @license
8236
8321
  * Copyright Datorama. All Rights Reserved.
@@ -9112,6 +9197,9 @@ var DatoSelectComponent = /** @class */ (function (_super) {
9112
9197
  setTimeout(function () { return _this.datoOverlay.scheduleUpdate(); }, 0);
9113
9198
  }
9114
9199
  };
9200
+ DatoSelectComponent.prototype.triggerChangeDetectionInDatoSingle = function () {
9201
+ this.datoTriggerSingle.triggerChangeDetection();
9202
+ };
9115
9203
  DatoSelectComponent.ctorParameters = function () { return [
9116
9204
  { type: ChangeDetectorRef },
9117
9205
  { type: DatoTranslateService },
@@ -9121,6 +9209,10 @@ var DatoSelectComponent = /** @class */ (function (_super) {
9121
9209
  { type: undefined, decorators: [{ type: Attribute, args: ['datoSize',] }] },
9122
9210
  { type: String, decorators: [{ type: Attribute, args: ['width',] }] }
9123
9211
  ]; };
9212
+ __decorate([
9213
+ ViewChild('datoTriggerSingle'),
9214
+ __metadata("design:type", DatoTriggerSingle)
9215
+ ], DatoSelectComponent.prototype, "datoTriggerSingle", void 0);
9124
9216
  __decorate([
9125
9217
  ViewChild('dropdown'),
9126
9218
  __metadata("design:type", TemplateRef)
@@ -9287,7 +9379,7 @@ var DatoSelectComponent = /** @class */ (function (_super) {
9287
9379
  DatoSelectComponent = __decorate([
9288
9380
  Component({
9289
9381
  selector: 'dato-select',
9290
- 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",
9382
+ 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",
9291
9383
  preserveWhitespaces: false,
9292
9384
  providers: [valueAccessor$3, DatoOverlay],
9293
9385
  encapsulation: ViewEncapsulation.None,
@@ -9305,88 +9397,6 @@ var DatoSelectComponent = /** @class */ (function (_super) {
9305
9397
  return DatoSelectComponent;
9306
9398
  }(BaseCustomControl));
9307
9399
 
9308
- /**
9309
- * @license
9310
- * Copyright Datorama. All Rights Reserved.
9311
- *
9312
- * Use of this source code is governed by an Apache License 2.0 license that can be
9313
- * found in the LICENSE file at https://github.com/datorama/client-core/blob/master/LICENSE
9314
- */
9315
- var DatoTriggerSingle = /** @class */ (function () {
9316
- function DatoTriggerSingle(cdr) {
9317
- this.cdr = cdr;
9318
- this._placeholder = '';
9319
- }
9320
- Object.defineProperty(DatoTriggerSingle.prototype, "placeholder", {
9321
- set: function (value) {
9322
- this._placeholder = value;
9323
- this.cdr.detectChanges();
9324
- },
9325
- enumerable: true,
9326
- configurable: true
9327
- });
9328
- Object.defineProperty(DatoTriggerSingle.prototype, "context", {
9329
- set: function (value) {
9330
- this._model = { $implicit: value };
9331
- this.cdr.detectChanges();
9332
- },
9333
- enumerable: true,
9334
- configurable: true
9335
- });
9336
- Object.defineProperty(DatoTriggerSingle.prototype, "hidePlaceholder", {
9337
- get: function () {
9338
- return !this._model || !this._model.$implicit;
9339
- },
9340
- enumerable: true,
9341
- configurable: true
9342
- });
9343
- DatoTriggerSingle.prototype.ngOnInit = function () {
9344
- this.cdr.detach();
9345
- };
9346
- Object.defineProperty(DatoTriggerSingle.prototype, "getLabel", {
9347
- get: function () {
9348
- return this._model && this._model.$implicit && this._model.$implicit[this.labelKey];
9349
- },
9350
- enumerable: true,
9351
- configurable: true
9352
- });
9353
- DatoTriggerSingle.ctorParameters = function () { return [
9354
- { type: ChangeDetectorRef }
9355
- ]; };
9356
- __decorate([
9357
- Input(),
9358
- __metadata("design:type", TemplateRef)
9359
- ], DatoTriggerSingle.prototype, "loadingTemplate", void 0);
9360
- __decorate([
9361
- Input(),
9362
- __metadata("design:type", DatoSelectActiveDirective)
9363
- ], DatoTriggerSingle.prototype, "active", void 0);
9364
- __decorate([
9365
- Input(),
9366
- __metadata("design:type", Object),
9367
- __metadata("design:paramtypes", [Object])
9368
- ], DatoTriggerSingle.prototype, "placeholder", null);
9369
- __decorate([
9370
- Input(),
9371
- __metadata("design:type", String)
9372
- ], DatoTriggerSingle.prototype, "labelKey", void 0);
9373
- __decorate([
9374
- Input(),
9375
- __metadata("design:type", Object),
9376
- __metadata("design:paramtypes", [Object])
9377
- ], DatoTriggerSingle.prototype, "context", null);
9378
- DatoTriggerSingle = __decorate([
9379
- Component({
9380
- selector: 'dato-trigger-single',
9381
- 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",
9382
- changeDetection: ChangeDetectionStrategy.OnPush,
9383
- 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}"]
9384
- }),
9385
- __metadata("design:paramtypes", [ChangeDetectorRef])
9386
- ], DatoTriggerSingle);
9387
- return DatoTriggerSingle;
9388
- }());
9389
-
9390
9400
  /**
9391
9401
  * @license
9392
9402
  * Copyright Datorama. All Rights Reserved.
@@ -25407,7 +25417,7 @@ function fixNgLeaks() {
25407
25417
  };
25408
25418
  }
25409
25419
 
25410
- window.coreVersion = '22.11.2';
25420
+ window.coreVersion = '22.12.0';
25411
25421
 
25412
25422
  /**
25413
25423
  * @license