@wemake4u/form-player-se 1.0.21 → 1.0.22

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.
@@ -7,4 +7,7 @@ export * from './lib/services/markdown.service';
7
7
  export * from './lib/services/data.service';
8
8
  export * from './lib/services/scope.service';
9
9
  export * from './lib/services/dialog.service';
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1zaXJpby9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDJDQUEyQyxDQUFDO0FBRTFELGNBQWMsd0JBQXdCLENBQUM7QUFFdkMsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYywrQkFBK0IsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2R5bmFtaWMtZm9ybS9keW5hbWljLWZvcm0uY29tcG9uZW50JztcclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWxzL3RvRm9ybURhdGEnO1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvdG9hc3Quc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL3Nhbml0aXplLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy9mZWVsLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy9tYXJrZG93bi5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvZGF0YS5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvc2NvcGUuc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL2RpYWxvZy5zZXJ2aWNlJztcclxuIl19
10
+ export * from './lib/interact/confirmation';
11
+ export * from './lib/interact/notification';
12
+ export * from './lib/interact/prompt';
13
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3Byb2plY3RzL25neC1zaXJpby9zcmMvcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDJDQUEyQyxDQUFDO0FBRTFELGNBQWMsd0JBQXdCLENBQUM7QUFFdkMsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGlDQUFpQyxDQUFDO0FBQ2hELGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyxpQ0FBaUMsQ0FBQztBQUNoRCxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsOEJBQThCLENBQUM7QUFDN0MsY0FBYywrQkFBK0IsQ0FBQztBQUU5QyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsNkJBQTZCLENBQUM7QUFDNUMsY0FBYyx1QkFBdUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliL2R5bmFtaWMtZm9ybS9keW5hbWljLWZvcm0uY29tcG9uZW50JztcclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3V0aWxzL3RvRm9ybURhdGEnO1xyXG5cclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvdG9hc3Quc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL3Nhbml0aXplLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy9mZWVsLnNlcnZpY2UnO1xyXG5leHBvcnQgKiBmcm9tICcuL2xpYi9zZXJ2aWNlcy9tYXJrZG93bi5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvZGF0YS5zZXJ2aWNlJztcclxuZXhwb3J0ICogZnJvbSAnLi9saWIvc2VydmljZXMvc2NvcGUuc2VydmljZSc7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL3NlcnZpY2VzL2RpYWxvZy5zZXJ2aWNlJztcclxuXHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2ludGVyYWN0L2NvbmZpcm1hdGlvbic7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2ludGVyYWN0L25vdGlmaWNhdGlvbic7XHJcbmV4cG9ydCAqIGZyb20gJy4vbGliL2ludGVyYWN0L3Byb21wdCc7XHJcbiJdfQ==
@@ -4,7 +4,7 @@ import * as i11 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1$1 from '@angular/forms';
6
6
  import { FormArray, FormControl as FormControl$1, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
7
- import { isObservable, take, tap, of, takeUntil, Subject, combineLatest } from 'rxjs';
7
+ import { isObservable, take, tap, of, takeUntil, Subject, combineLatest, Observable } from 'rxjs';
8
8
  import { evaluate } from 'feelers';
9
9
  import { evaluate as evaluate$1, unaryTest, parseExpression } from 'feelin';
10
10
  import { shareReplay, map, takeUntil as takeUntil$1 } from 'rxjs/operators';
@@ -177,17 +177,17 @@ class ToastService {
177
177
  constructor(sirioToast) {
178
178
  this.sirioToast = sirioToast;
179
179
  }
180
- notifyInfo(message, delay = 2000) {
181
- this.notify(message, "info", delay);
180
+ notifyInfo(message, title, delay = 2000) {
181
+ this.notify("info", message, title, delay);
182
182
  }
183
- notifySuccess(message, delay = 2000) {
184
- this.notify(message, "success", delay);
183
+ notifySuccess(message, title, delay = 2000) {
184
+ this.notify("success", message, title, delay);
185
185
  }
186
- notifyWarning(message, delay = 2000) {
187
- this.notify(message, "warning", delay);
186
+ notifyWarning(message, title, delay = 2000) {
187
+ this.notify("warning", message, title, delay);
188
188
  }
189
- notifyError(message, delay = 2000) {
190
- this.notify(message, "danger", delay);
189
+ notifyError(message, title, delay = 2000) {
190
+ this.notify("danger", message, title, delay);
191
191
  }
192
192
  getContext() {
193
193
  return ToBoundArrows(this, [
@@ -197,11 +197,12 @@ class ToastService {
197
197
  "notifyError"
198
198
  ]);
199
199
  }
200
- notify(message, type, delay = 2000) {
200
+ notify(type, message, title, delay = 2000) {
201
201
  this.sirioToast.openToast({
202
202
  delay: delay,
203
203
  text: message,
204
- type: type
204
+ type: type,
205
+ title: title
205
206
  });
206
207
  }
207
208
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: ToastService, deps: [{ token: i1.SirioToastService }], target: i0.ɵɵFactoryTarget.Injectable });
@@ -639,6 +640,20 @@ class DialogService {
639
640
  };
640
641
  this.showDialog(formSchema, formOptions);
641
642
  }
643
+ prompt(text, defaultValue, options) {
644
+ const formSchema = this.createInputSchema(text, defaultValue);
645
+ const formOptions = {
646
+ ...options,
647
+ type: "info",
648
+ buttons: 'OKCancel',
649
+ isDrawer: false,
650
+ showNav: false,
651
+ showNavButton: false,
652
+ showProgress: false,
653
+ showFormTitle: false
654
+ };
655
+ this.showDialog(formSchema, formOptions);
656
+ }
642
657
  getContext() {
643
658
  return ToBoundArrows(this, [
644
659
  'openDialog',
@@ -678,6 +693,30 @@ class DialogService {
678
693
  ]
679
694
  };
680
695
  }
696
+ createInputSchema(label, defaultValue) {
697
+ return {
698
+ "forms": [
699
+ {
700
+ "components": [
701
+ {
702
+ "label": label,
703
+ "defaultValue": defaultValue,
704
+ "type": "textfield",
705
+ "layout": {
706
+ "row": "Row_1wxz5gd",
707
+ "columns": null
708
+ },
709
+ "id": "Field_1tau53x",
710
+ "key": "input"
711
+ }
712
+ ],
713
+ "type": "default",
714
+ "id": "Form_1ontwnx",
715
+ "schemaVersion": 18
716
+ }
717
+ ]
718
+ };
719
+ }
681
720
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogService, deps: [{ token: i1.SirioDialogService }], target: i0.ɵɵFactoryTarget.Injectable });
682
721
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DialogService, providedIn: 'root' });
683
722
  }
@@ -1126,7 +1165,7 @@ class ProgrammabilityService {
1126
1165
  }
1127
1166
  return {
1128
1167
  ...parent.value,
1129
- formGroup: () => parent,
1168
+ formGroup: () => ToProxy(parent),
1130
1169
  parent: () => this.getParentContext(parent)
1131
1170
  };
1132
1171
  }
@@ -2926,7 +2965,8 @@ class DropdownDirective {
2926
2965
  const input = searchable.querySelector('input');
2927
2966
  this.renderer.insertBefore(dropDown, searchable, dropMenu);
2928
2967
  this.renderer.listen(input, 'blur', (event) => {
2929
- this.sirioSelect.panel.close();
2968
+ if (event.relatedTarget !== dropMenu)
2969
+ this.sirioSelect.panel.close();
2930
2970
  });
2931
2971
  this.renderer.listen(input, 'keyup', (event) => {
2932
2972
  this.onKeyUp(event, input);
@@ -4141,10 +4181,12 @@ class CollapseDirective {
4141
4181
  this.expanded = false;
4142
4182
  this.applyStyle();
4143
4183
  const element = this.el.nativeElement;
4144
- if (element.scrollHeight > this.maxHeight) {
4145
- this.applyButton();
4146
- this.applyFocusHandler();
4147
- }
4184
+ setTimeout(() => {
4185
+ if (element.scrollHeight > this.maxHeight) {
4186
+ this.applyButton();
4187
+ this.applyFocusHandler();
4188
+ }
4189
+ }, 100);
4148
4190
  }
4149
4191
  applyStyle() {
4150
4192
  const element = this.el.nativeElement;
@@ -5607,9 +5649,105 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
5607
5649
  }]
5608
5650
  }], ctorParameters: () => [{ type: i1$4.HttpClient }] });
5609
5651
 
5652
+ class DefaultConfirmationController {
5653
+ dialogService;
5654
+ constructor(dialogService) {
5655
+ this.dialogService = dialogService;
5656
+ }
5657
+ confirm(message, title) {
5658
+ return new Observable(observer => {
5659
+ const options = {
5660
+ title: title,
5661
+ type: 'info',
5662
+ onResult: result => {
5663
+ if (result.action === 'Yes') {
5664
+ observer.next(true);
5665
+ }
5666
+ else {
5667
+ observer.next(false);
5668
+ }
5669
+ observer.complete();
5670
+ }
5671
+ };
5672
+ this.dialogService.confirm(message ?? "", options);
5673
+ });
5674
+ }
5675
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultConfirmationController, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
5676
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultConfirmationController, providedIn: 'root' });
5677
+ }
5678
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultConfirmationController, decorators: [{
5679
+ type: Injectable,
5680
+ args: [{
5681
+ providedIn: 'root'
5682
+ }]
5683
+ }], ctorParameters: () => [{ type: DialogService }] });
5684
+
5685
+ class DefaultNotificationController {
5686
+ toast;
5687
+ constructor(toast) {
5688
+ this.toast = toast;
5689
+ }
5690
+ notify(type, message, title) {
5691
+ const delay = 5000;
5692
+ switch (type) {
5693
+ case 'info':
5694
+ this.toast.notifyInfo(message, title, delay);
5695
+ break;
5696
+ case 'warning':
5697
+ this.toast.notifyWarning(message, title, delay);
5698
+ break;
5699
+ case 'error':
5700
+ this.toast.notifyError(message, title, delay);
5701
+ break;
5702
+ case 'success':
5703
+ this.toast.notifySuccess(message, title, delay);
5704
+ break;
5705
+ default: break;
5706
+ }
5707
+ }
5708
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultNotificationController, deps: [{ token: ToastService }], target: i0.ɵɵFactoryTarget.Injectable });
5709
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultNotificationController, providedIn: 'root' });
5710
+ }
5711
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultNotificationController, decorators: [{
5712
+ type: Injectable,
5713
+ args: [{
5714
+ providedIn: 'root'
5715
+ }]
5716
+ }], ctorParameters: () => [{ type: ToastService }] });
5717
+
5718
+ class DefaultPromptController {
5719
+ dialogService;
5720
+ constructor(dialogService) {
5721
+ this.dialogService = dialogService;
5722
+ }
5723
+ prompt(message, defaultValue, title) {
5724
+ return new Observable(observer => {
5725
+ const options = {
5726
+ title: title,
5727
+ type: 'info',
5728
+ onResult: result => {
5729
+ if (result.action === 'OK') {
5730
+ observer.next(result.value.input);
5731
+ }
5732
+ observer.complete();
5733
+ }
5734
+ };
5735
+ this.dialogService.prompt(message ?? "Prompt", defaultValue, options);
5736
+ });
5737
+ }
5738
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultPromptController, deps: [{ token: DialogService }], target: i0.ɵɵFactoryTarget.Injectable });
5739
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultPromptController, providedIn: 'root' });
5740
+ }
5741
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DefaultPromptController, decorators: [{
5742
+ type: Injectable,
5743
+ args: [{
5744
+ providedIn: 'root'
5745
+ }]
5746
+ }], ctorParameters: () => [{ type: DialogService }] });
5747
+
5610
5748
  /**
5611
5749
  * Generated bundle index. Do not edit.
5612
5750
  */
5613
5751
 
5614
- export { DataService, DialogService, DynamicFormComponent, FeelService, MarkdownService, SanitizeService, ScopeService, ToastService, toFormData };
5752
+ export { DataService, DefaultConfirmationController, DefaultNotificationController, DefaultPromptController, DialogService, DynamicFormComponent, FeelService, MarkdownService, SanitizeService, ScopeService, ToastService, toFormData };
5615
5753
  //# sourceMappingURL=wemake4u-form-player-se.mjs.map