wacom 20.4.1 → 20.4.2

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.
@@ -514,6 +514,7 @@ class AlertService {
514
514
  bottom: 7,
515
515
  bottomRight: 8,
516
516
  };
517
+ this._translate = (phrase) => '';
517
518
  this._config = {
518
519
  ...DEFAULT_ALERT_CONFIG,
519
520
  ...(config?.alert || {}),
@@ -529,6 +530,9 @@ class AlertService {
529
530
  */
530
531
  show(opts) {
531
532
  opts = this._opts(opts);
533
+ if (opts.text && typeof this._translate === 'function') {
534
+ opts.text = this._translate(opts.text);
535
+ }
532
536
  if (opts.unique && this._alerts.find((m) => m.unique === opts.unique)) {
533
537
  return this._alerts.find((m) => m.unique === opts.unique);
534
538
  }
@@ -618,6 +622,9 @@ class AlertService {
618
622
  this._alerts[i].close?.();
619
623
  }
620
624
  }
625
+ setTranslate(_translate) {
626
+ this._translate = _translate;
627
+ }
621
628
  _opts(opts) {
622
629
  return typeof opts === 'string'
623
630
  ? {
@@ -1238,13 +1245,13 @@ class CrudComponent {
1238
1245
  /**
1239
1246
  * Loads documents for a given page.
1240
1247
  */
1241
- setDocuments(page = this.page) {
1248
+ setDocuments(page = this.page, query = '') {
1242
1249
  return new Promise((resolve) => {
1243
1250
  if (this.configType === 'server') {
1244
1251
  this.page = page;
1245
1252
  this.__core.afterWhile(this, () => {
1246
1253
  this.crudService
1247
- .get({ page }, this.getOptions())
1254
+ .get({ page, query }, this.getOptions())
1248
1255
  .subscribe((docs) => {
1249
1256
  this.documents.update(() => this.__core.toSignalsArray(docs));
1250
1257
  resolve();