@wavemaker/app-ng-runtime 12.0.0-next.45078 → 12.0.0-next.45081

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. app-ng-runtime/build-task/bundles/index.umd.js +8 -1
  2. app-ng-runtime/build-task/esm2022/data/form/form-field/form-field.build.mjs +9 -2
  3. app-ng-runtime/build-task/fesm2022/index.mjs +8 -1
  4. app-ng-runtime/build-task/fesm2022/index.mjs.map +1 -1
  5. app-ng-runtime/components/advanced/custom/bundles/index.umd.js +49 -12
  6. app-ng-runtime/components/advanced/custom/custom-widget-container/custom-widget-container.directive.d.ts +11 -4
  7. app-ng-runtime/components/advanced/custom/esm2022/custom-widget-container/custom-widget-container.directive.mjs +51 -11
  8. app-ng-runtime/components/advanced/custom/fesm2022/index.mjs +50 -10
  9. app-ng-runtime/components/advanced/custom/fesm2022/index.mjs.map +1 -1
  10. app-ng-runtime/components/base/bundles/index.umd.js +13 -3
  11. app-ng-runtime/components/base/esm2022/widgets/common/base/base.component.mjs +14 -4
  12. app-ng-runtime/components/base/esm2022/widgets/framework/property-change-handler.mjs +2 -2
  13. app-ng-runtime/components/base/fesm2022/index.mjs +14 -4
  14. app-ng-runtime/components/base/fesm2022/index.mjs.map +1 -1
  15. app-ng-runtime/components/base/widgets/common/base/base.component.d.ts +1 -0
  16. app-ng-runtime/components/basic/search/bundles/index.umd.js +36 -24
  17. app-ng-runtime/components/basic/search/esm2022/search.component.mjs +33 -24
  18. app-ng-runtime/components/basic/search/esm2022/search.props.mjs +5 -2
  19. app-ng-runtime/components/basic/search/fesm2022/index.mjs +36 -24
  20. app-ng-runtime/components/basic/search/fesm2022/index.mjs.map +1 -1
  21. app-ng-runtime/components/basic/search/search.component.d.ts +3 -0
  22. app-ng-runtime/components/data/form/bundles/index.umd.js +23 -11
  23. app-ng-runtime/components/data/form/esm2022/form-field/form-field.directive.mjs +24 -12
  24. app-ng-runtime/components/data/form/fesm2022/index.mjs +23 -11
  25. app-ng-runtime/components/data/form/fesm2022/index.mjs.map +1 -1
  26. app-ng-runtime/components/data/form/form-field/form-field.directive.d.ts +1 -0
  27. app-ng-runtime/components/input/default/base-form-custom.component.d.ts +2 -1
  28. app-ng-runtime/components/input/default/bundles/index.umd.js +13 -4
  29. app-ng-runtime/components/input/default/dataset-aware-form.component.d.ts +2 -2
  30. app-ng-runtime/components/input/default/esm2022/base-form-custom.component.mjs +6 -1
  31. app-ng-runtime/components/input/default/esm2022/checkboxset/checkboxset.component.mjs +3 -1
  32. app-ng-runtime/components/input/default/esm2022/dataset-aware-form.component.mjs +5 -5
  33. app-ng-runtime/components/input/default/esm2022/radioset/radioset.component.mjs +3 -1
  34. app-ng-runtime/components/input/default/fesm2022/index.mjs +13 -4
  35. app-ng-runtime/components/input/default/fesm2022/index.mjs.map +1 -1
  36. app-ng-runtime/core/bundles/index.umd.js +6 -6
  37. app-ng-runtime/core/enums/enums.d.ts +2 -2
  38. app-ng-runtime/core/esm2022/enums/enums.mjs +2 -2
  39. app-ng-runtime/core/esm2022/utils/build-utils.mjs +6 -6
  40. app-ng-runtime/core/fesm2022/index.mjs +6 -6
  41. app-ng-runtime/core/fesm2022/index.mjs.map +1 -1
  42. app-ng-runtime/package.json +1 -1
  43. app-ng-runtime/runtime/base/bundles/index.umd.js +9 -0
  44. app-ng-runtime/runtime/base/components/base-custom-widget.component.d.ts +2 -0
  45. app-ng-runtime/runtime/base/esm2022/components/base-custom-widget.component.mjs +10 -1
  46. app-ng-runtime/runtime/base/fesm2022/index.mjs +9 -0
  47. app-ng-runtime/runtime/base/fesm2022/index.mjs.map +1 -1
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@wm/components/base'), require('@wm/core'), require('lodash-es')) :
3
- typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@wm/components/base', '@wm/core', 'lodash-es'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.advanced = global.wm.components.advanced || {}, global.wm.components.advanced.custom = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.core, global._));
5
- })(this, (function (exports, i0, common, base, i1, lodashEs) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@wm/components/base'), require('@wm/core'), require('lodash-es'), require('@angular/forms'), require('@wm/components/input'), require('rxjs')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/common', '@wm/components/base', '@wm/core', 'lodash-es', '@angular/forms', '@wm/components/input', 'rxjs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wm = global.wm || {}, global.wm.components = global.wm.components || {}, global.wm.components.advanced = global.wm.components.advanced || {}, global.wm.components.advanced.custom = {}), global.ng.core, global.ng.common, global.wm.components.base, global.wm.core, global._, global.ng.forms, global.wm.components.input, global.rxjs));
5
+ })(this, (function (exports, i0, common, base, i1, lodashEs, forms, input, rxjs) { 'use strict';
6
6
 
7
7
  function _interopNamespaceDefault(e) {
8
8
  var n = Object.create(null);
@@ -38,15 +38,16 @@
38
38
  const registeredPropsSet = new Set();
39
39
  let customWidgetPropsMap = {};
40
40
  const DEFAULT_CLS$1 = 'app-html-container';
41
- class CustomWidgetContainerDirective extends base.StylableComponent {
41
+ class CustomWidgetContainerDirective extends input.DatasetAwareFormComponent {
42
42
  static { this.initializeProps = registerProps$1(); }
43
- constructor(inj, elRef, widgetname) {
43
+ constructor(inj, elRef, widgetname, explicitContext) {
44
44
  const widgetType = `wm-custom-${widgetname}`;
45
45
  const WIDGET_CONFIG = { widgetType, hostClass: DEFAULT_CLS$1 };
46
46
  let resolveFn = i1.noop;
47
- super(inj, WIDGET_CONFIG, undefined, new Promise(res => resolveFn = res));
47
+ super(inj, WIDGET_CONFIG, explicitContext, undefined, new Promise(res => resolveFn = res));
48
48
  this.props = {};
49
49
  this.propsReady = resolveFn;
50
+ this.configSubject = new rxjs.Subject();
50
51
  this.widgetType = widgetType;
51
52
  this.name = elRef.nativeElement.getAttribute('name');
52
53
  base.styler(this.nativeElement, this);
@@ -63,6 +64,17 @@
63
64
  }
64
65
  }));
65
66
  }
67
+ get datavalue() {
68
+ if (this.nativeElement.children.length) {
69
+ let value = this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue;
70
+ this.updateDataValue(value);
71
+ return value;
72
+ }
73
+ }
74
+ set datavalue(value) {
75
+ if (this.nativeElement.children.length)
76
+ this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue = value;
77
+ }
66
78
  setBaseWidgetName(baseWidgetType) {
67
79
  let splitArr = baseWidgetType.split('-'), modifiedArr = [];
68
80
  modifiedArr = splitArr.map((item) => {
@@ -72,7 +84,11 @@
72
84
  this.baseWidgetName = modifiedArr.join('');
73
85
  }
74
86
  setProps(config, resolveFn) {
75
- this.setBaseWidgetName(config.widgetType);
87
+ this.config = config;
88
+ this.configSubject.next();
89
+ this.asAttr = this.nativeElement.children[0].children[0].hasAttribute('as');
90
+ if (this.asAttr)
91
+ this.setBaseWidgetName(config.widgetType);
76
92
  if (!config || !config.properties) {
77
93
  return;
78
94
  }
@@ -105,14 +121,28 @@
105
121
  customWidgetPropsMap[this.widgetType] = this.props;
106
122
  return propsMap;
107
123
  }
124
+ updateDataValue(value) {
125
+ if (this.formControl && this.formControl.control && value !== this.formControl.control.value)
126
+ this.formControl.control.setValue(value);
127
+ }
108
128
  updateData(key, value) {
109
129
  let modifiedKey = key.replace('base-', '');
110
- this[this.baseWidgetName][modifiedKey] = value;
111
- this.nativeElement.childNodes[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
112
- this[this.baseWidgetName].initDatasetItems();
130
+ if (this.asAttr) {
131
+ this[this.baseWidgetName][modifiedKey] = value;
132
+ this.nativeElement.children[0].children[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
133
+ this[this.baseWidgetName].initDatasetItems();
134
+ }
135
+ else {
136
+ this[modifiedKey] = value;
137
+ this.nativeElement.children[0].children[0]['widget'].viewParent[modifiedKey] = value;
138
+ }
139
+ if (this.formControl && modifiedKey === 'datavalue')
140
+ this.updateDataValue(value);
113
141
  }
114
- static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵinjectAttribute('widgetname')); }; }
142
+ static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0__namespace.ɵɵdirectiveInject(i0__namespace.Injector), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵinjectAttribute('widgetname'), i0__namespace.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
115
143
  static { this.ɵdir = /*@__PURE__*/ i0__namespace.ɵɵdefineDirective({ type: CustomWidgetContainerDirective, selectors: [["", "wmWidgetContainer", ""]], exportAs: ["wmWidgetContainer"], features: [i0__namespace.ɵɵProvidersFeature([
144
+ base.provideAs(CustomWidgetContainerDirective, forms.NG_VALUE_ACCESSOR, true),
145
+ base.provideAs(CustomWidgetContainerDirective, forms.NG_VALIDATORS, true),
116
146
  base.provideAsWidgetRef(CustomWidgetContainerDirective)
117
147
  ]), i0__namespace.ɵɵInheritDefinitionFeature] }); }
118
148
  }
@@ -121,6 +151,8 @@
121
151
  args: [{
122
152
  selector: '[wmWidgetContainer]',
123
153
  providers: [
154
+ base.provideAs(CustomWidgetContainerDirective, forms.NG_VALUE_ACCESSOR, true),
155
+ base.provideAs(CustomWidgetContainerDirective, forms.NG_VALIDATORS, true),
124
156
  base.provideAsWidgetRef(CustomWidgetContainerDirective)
125
157
  ],
126
158
  exportAs: 'wmWidgetContainer'
@@ -128,6 +160,11 @@
128
160
  }], () => [{ type: i0__namespace.Injector }, { type: i0__namespace.ElementRef }, { type: undefined, decorators: [{
129
161
  type: i0.Attribute,
130
162
  args: ['widgetname']
163
+ }] }, { type: undefined, decorators: [{
164
+ type: i0.Inject,
165
+ args: ['EXPLICIT_CONTEXT']
166
+ }, {
167
+ type: i0.Optional
131
168
  }] }], null); })();
132
169
 
133
170
  const registerProps = () => {
@@ -1,19 +1,26 @@
1
1
  import { ElementRef, Injector, OnInit } from '@angular/core';
2
- import { StylableComponent } from '@wm/components/base';
2
+ import { DatasetAwareFormComponent } from "@wm/components/input";
3
+ import { Subject } from "rxjs";
3
4
  import * as i0 from "@angular/core";
4
- export declare class CustomWidgetContainerDirective extends StylableComponent implements OnInit {
5
+ export declare class CustomWidgetContainerDirective extends DatasetAwareFormComponent implements OnInit {
5
6
  static initializeProps: void;
6
7
  widgetType: string;
7
8
  name: string;
8
9
  propsReady: Function;
9
10
  widgetName: string;
11
+ config: any;
10
12
  private props;
11
13
  private baseWidgetName;
12
- constructor(inj: Injector, elRef: ElementRef, widgetname: string);
14
+ asAttr: boolean;
15
+ configSubject: Subject<any>;
16
+ constructor(inj: Injector, elRef: ElementRef, widgetname: string, explicitContext: any);
17
+ get datavalue(): any;
18
+ set datavalue(value: any);
13
19
  setBaseWidgetName(baseWidgetType: string): void;
14
20
  setProps(config: any, resolveFn: Function): void;
15
21
  private prepareProps;
22
+ updateDataValue(value: any): void;
16
23
  updateData(key: string, value: any): void;
17
- static ɵfac: i0.ɵɵFactoryDeclaration<CustomWidgetContainerDirective, [null, null, { attribute: "widgetname"; }]>;
24
+ static ɵfac: i0.ɵɵFactoryDeclaration<CustomWidgetContainerDirective, [null, null, { attribute: "widgetname"; }, { optional: true; }]>;
18
25
  static ɵdir: i0.ɵɵDirectiveDeclaration<CustomWidgetContainerDirective, "[wmWidgetContainer]", ["wmWidgetContainer"], {}, {}, never, never, false, never>;
19
26
  }
@@ -1,22 +1,26 @@
1
- import { Attribute, Directive, ElementRef, Injector } from '@angular/core';
1
+ import { Attribute, Directive, ElementRef, Inject, Injector, Optional } from '@angular/core';
2
2
  import { noop } from '@wm/core';
3
- import { PROP_TYPE, provideAsWidgetRef, register, StylableComponent, styler } from '@wm/components/base';
3
+ import { PROP_TYPE, provideAs, provideAsWidgetRef, register, styler } from '@wm/components/base';
4
4
  import { customWidgetProps } from './custom-widget.props';
5
5
  import { registerProps } from "../custom-widget-container/custom-widget.props";
6
6
  import { capitalize, cloneDeep } from 'lodash-es';
7
+ import { NG_VALIDATORS, NG_VALUE_ACCESSOR } from "@angular/forms";
8
+ import { DatasetAwareFormComponent } from "@wm/components/input";
9
+ import { Subject } from "rxjs";
7
10
  import * as i0 from "@angular/core";
8
11
  const registeredPropsSet = new Set();
9
12
  let customWidgetPropsMap = {};
10
13
  const DEFAULT_CLS = 'app-html-container';
11
- export class CustomWidgetContainerDirective extends StylableComponent {
14
+ export class CustomWidgetContainerDirective extends DatasetAwareFormComponent {
12
15
  static { this.initializeProps = registerProps(); }
13
- constructor(inj, elRef, widgetname) {
16
+ constructor(inj, elRef, widgetname, explicitContext) {
14
17
  const widgetType = `wm-custom-${widgetname}`;
15
18
  const WIDGET_CONFIG = { widgetType, hostClass: DEFAULT_CLS };
16
19
  let resolveFn = noop;
17
- super(inj, WIDGET_CONFIG, undefined, new Promise(res => resolveFn = res));
20
+ super(inj, WIDGET_CONFIG, explicitContext, undefined, new Promise(res => resolveFn = res));
18
21
  this.props = {};
19
22
  this.propsReady = resolveFn;
23
+ this.configSubject = new Subject();
20
24
  this.widgetType = widgetType;
21
25
  this.name = elRef.nativeElement.getAttribute('name');
22
26
  styler(this.nativeElement, this);
@@ -33,6 +37,17 @@ export class CustomWidgetContainerDirective extends StylableComponent {
33
37
  }
34
38
  }));
35
39
  }
40
+ get datavalue() {
41
+ if (this.nativeElement.children.length) {
42
+ let value = this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue;
43
+ this.updateDataValue(value);
44
+ return value;
45
+ }
46
+ }
47
+ set datavalue(value) {
48
+ if (this.nativeElement.children.length)
49
+ this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue = value;
50
+ }
36
51
  setBaseWidgetName(baseWidgetType) {
37
52
  let splitArr = baseWidgetType.split('-'), modifiedArr = [];
38
53
  modifiedArr = splitArr.map((item) => {
@@ -42,7 +57,11 @@ export class CustomWidgetContainerDirective extends StylableComponent {
42
57
  this.baseWidgetName = modifiedArr.join('');
43
58
  }
44
59
  setProps(config, resolveFn) {
45
- this.setBaseWidgetName(config.widgetType);
60
+ this.config = config;
61
+ this.configSubject.next();
62
+ this.asAttr = this.nativeElement.children[0].children[0].hasAttribute('as');
63
+ if (this.asAttr)
64
+ this.setBaseWidgetName(config.widgetType);
46
65
  if (!config || !config.properties) {
47
66
  return;
48
67
  }
@@ -75,14 +94,28 @@ export class CustomWidgetContainerDirective extends StylableComponent {
75
94
  customWidgetPropsMap[this.widgetType] = this.props;
76
95
  return propsMap;
77
96
  }
97
+ updateDataValue(value) {
98
+ if (this.formControl && this.formControl.control && value !== this.formControl.control.value)
99
+ this.formControl.control.setValue(value);
100
+ }
78
101
  updateData(key, value) {
79
102
  let modifiedKey = key.replace('base-', '');
80
- this[this.baseWidgetName][modifiedKey] = value;
81
- this.nativeElement.childNodes[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
82
- this[this.baseWidgetName].initDatasetItems();
103
+ if (this.asAttr) {
104
+ this[this.baseWidgetName][modifiedKey] = value;
105
+ this.nativeElement.children[0].children[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
106
+ this[this.baseWidgetName].initDatasetItems();
107
+ }
108
+ else {
109
+ this[modifiedKey] = value;
110
+ this.nativeElement.children[0].children[0]['widget'].viewParent[modifiedKey] = value;
111
+ }
112
+ if (this.formControl && modifiedKey === 'datavalue')
113
+ this.updateDataValue(value);
83
114
  }
84
- static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵinjectAttribute('widgetname')); }; }
115
+ static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵinjectAttribute('widgetname'), i0.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
85
116
  static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CustomWidgetContainerDirective, selectors: [["", "wmWidgetContainer", ""]], exportAs: ["wmWidgetContainer"], features: [i0.ɵɵProvidersFeature([
117
+ provideAs(CustomWidgetContainerDirective, NG_VALUE_ACCESSOR, true),
118
+ provideAs(CustomWidgetContainerDirective, NG_VALIDATORS, true),
86
119
  provideAsWidgetRef(CustomWidgetContainerDirective)
87
120
  ]), i0.ɵɵInheritDefinitionFeature] }); }
88
121
  }
@@ -91,6 +124,8 @@ export class CustomWidgetContainerDirective extends StylableComponent {
91
124
  args: [{
92
125
  selector: '[wmWidgetContainer]',
93
126
  providers: [
127
+ provideAs(CustomWidgetContainerDirective, NG_VALUE_ACCESSOR, true),
128
+ provideAs(CustomWidgetContainerDirective, NG_VALIDATORS, true),
94
129
  provideAsWidgetRef(CustomWidgetContainerDirective)
95
130
  ],
96
131
  exportAs: 'wmWidgetContainer'
@@ -98,5 +133,10 @@ export class CustomWidgetContainerDirective extends StylableComponent {
98
133
  }], () => [{ type: i0.Injector }, { type: i0.ElementRef }, { type: undefined, decorators: [{
99
134
  type: Attribute,
100
135
  args: ['widgetname']
136
+ }] }, { type: undefined, decorators: [{
137
+ type: Inject,
138
+ args: ['EXPLICIT_CONTEXT']
139
+ }, {
140
+ type: Optional
101
141
  }] }], null); })();
102
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3VzdG9tLXdpZGdldC1jb250YWluZXIuZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4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IE9iamVjdC5lbnRyaWVzKHByb3BzKS5mb3JFYWNoKChbaywgdl06IFtzdHJpbmcsIGFueV0pID0+IHtcbiAgICAgICAgICAgIGxldCB0eXBlID0gUFJPUF9UWVBFLlNUUklORztcblxuICAgICAgICAgICAgaWYgKHYudHlwZSA9PT0gJ2Jvb2xlYW4nKSB7XG4gICAgICAgICAgICAgICAgdHlwZSA9IFBST1BfVFlQRS5CT09MRUFOO1xuICAgICAgICAgICAgfSBlbHNlIGlmICh2LnR5cGUgPT09ICdudW1iZXInKSB7XG4gICAgICAgICAgICAgICAgdHlwZSA9IFBST1BfVFlQRS5OVU1CRVI7XG4gICAgICAgICAgICB9IGVsc2UgaWYgKHYudHlwZSAhPT0gJ3N0cmluZycpIHtcbiAgICAgICAgICAgICAgICB0eXBlID0gdi50eXBlO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAvLyBEbyBub3Qgc2V0IHRoZSAnYmluZDoqJyB2YWx1ZXNcbiAgICAgICAgICAgIHByb3BzTWFwLnNldChgcHJvcC0ke2t9YCwgeyB0eXBlLCB2YWx1ZTogXy5zdGFydHNXaXRoKHYudmFsdWUsICdiaW5kOicpID8gdW5kZWZpbmVkIDogdi52YWx1ZSB9KTtcbiAgICAgICAgICAgIHRoaXMucHJvcHNba10gPSB2LnZhbHVlO1xuICAgICAgICB9KTtcblxuICAgICAgICByZWdpc3RlcmVkUHJvcHNTZXQuYWRkKHRoaXMud2lkZ2V0VHlwZSk7XG4gICAgICAgIGN1c3RvbVdpZGdldFByb3BzTWFwW3RoaXMud2lkZ2V0VHlwZV0gPSB0aGlzLnByb3BzXG5cbiAgICAgICAgcmV0dXJuIHByb3BzTWFwO1xuICAgIH1cblxuICAgIHVwZGF0ZURhdGEoa2V5OiBzdHJpbmcsIHZhbHVlOiBhbnkpIHtcbiAgICAgICAgbGV0IG1vZGlmaWVkS2V5ID0ga2V5LnJlcGxhY2UoJ2Jhc2UtJywgJycpO1xuICAgICAgICB0aGlzW3RoaXM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gICAgICB0aGlzLmJhc2VXaWRnZXROYW1lID0gbW9kaWZpZWRBcnIuam9pbignJyk7XG4gICAgfVxuXG4gICAgcHVibGljIHNldFByb3BzKGNvbmZpZywgcmVzb2x2ZUZuOiBGdW5jdGlvbikge1xuICAgICAgICB0aGlzLmNvbmZpZyA9IGNvbmZpZztcbiAgICAgICAgdGhpcy5jb25maWdTdWJqZWN0Lm5leHQoKTtcbiAgICAgICAgdGhpcy5hc0F0dHIgPSB0aGlzLm5hdGl2ZUVsZW1lbnQuY2hpbGRyZW5bMF0uY2hpbGRyZW5bMF0uaGFzQXR0cmlidXRlKCdhcycpO1xuICAgICAgICBpZih0aGlzLmFzQXR0cilcbiAgICAgICAgICAgIHRoaXMuc2V0QmFzZVdpZGdldE5hbWUoY29uZmlnLndpZGdldFR5cGUpO1xuICAgICAgICBpZiAoIWNvbmZpZyB8fCAhY29uZmlnLnByb3BlcnRpZXMpIHtcbiAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgfVxuICAgICAgICBpZiAoIXJlZ2lzdGVyZWRQcm9wc1NldC5oYXModGhpcy53aWRnZXRUeXBlKSkge1xuICAgICAgICAgICAgcmVnaXN0ZXIodGhpcy53aWRnZXRUeXBlLCB0aGlzLnByZXBhcmVQcm9wcyhjb25maWcucHJvcGVydGllcykpO1xuICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgIHRoaXMucHJvcHMgPSBPYmplY3QuYXNzaWduKHRoaXMucHJvcHMsIGNsb25lRGVlcChjdXN0b21XaWRnZXRQcm9wc01hcFt0aGlzLndpZGdldFR5cGVdKSlcbiAgICAgICAgfVxuXG4gICAgICAgIHRoaXMucHJvcHNSZWFkeShyZXNvbHZlRm4pO1xuICAgIH1cblxuICAgIHByaXZhdGUgcHJlcGFyZVByb3BzKHByb3BzID0ge30pIHtcbiAgICAgICAgY29uc3QgcHJvcHNNYXAgPSBuZXcgTWFwKGN1c3RvbVdpZGdldFByb3BzKTtcbiAgICAgICAgT2JqZWN0LmVud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2wudmFsdWUpXG4gICAgICAgICAgICB0aGlzLmZvcm1Db250cm9sLmNvbnRyb2wuc2V0VmFsdWUodmFsdWUpO1xuICAgIH1cblxuICAgIHVwZGF0ZURhdGEoa2V5OiBzdHJpbmcsIHZhbHVlOiBhbnkpIHtcbiAgICAgICAgbGV0IG1vZGlmaWVkS2V5ID0ga2V5LnJlcGxhY2UoJ2Jhc2UtJywgJycpO1xuICAgICAgICBpZih0aGlzLmFzQXR0cikge1xuICAgICAgICAgICAgdGhpc1t0aGlzLmJhc2VXaWRnZXROYW1lXVttb2RpZmllZEtleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMubmF0aXZlRWxlbWVudC5jaGlsZHJlblswXS5jaGlsZHJlblswXVsnd2lkZ2V0J10udmlld1BhcmVudFt0aGlzLmJhc2VXaWRnZXROYW1lXVttb2RpZmllZEtleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXNbdGhpcy5iYXNlV2lkZ2V0TmFtZV0uaW5pdERhdGFzZXRJdGVtcygpO1xuICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgdGhpc1ttb2RpZmllZEtleV0gPSB2YWx1ZTtcbiAgICAgICAgICAgIHRoaXMubmF0aXZlRWxlbWVudC5jaGlsZHJlblswXS5jaGlsZHJlblswXVsnd2lkZ2V0J10udmlld1BhcmVudFttb2RpZmllZEtleV0gPSB2YWx1ZTtcbiAgICAgICAgfVxuICAgICAgICBpZih0aGlzLmZvcm1Db250cm9sICYmIG1vZGlmaWVkS2V5ID09PSAnZGF0YXZhbHVlJylcbiAgICAgICAgICAgIHRoaXMudXBkYXRlRGF0YVZhbHVlKHZhbHVlKTtcbiAgICB9XG59XG4iXX0=
@@ -1,10 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Directive, Attribute, NgModule } from '@angular/core';
2
+ import { Directive, Attribute, Inject, Optional, NgModule } from '@angular/core';
3
3
  import { CommonModule } from '@angular/common';
4
- import { PROP_STRING, PROP_BOOLEAN, register, StylableComponent, styler, PROP_TYPE, provideAsWidgetRef, getWidgetPropsByType, WmComponentsModule } from '@wm/components/base';
4
+ import { PROP_STRING, PROP_BOOLEAN, register, styler, PROP_TYPE, provideAs, provideAsWidgetRef, StylableComponent, getWidgetPropsByType, WmComponentsModule } from '@wm/components/base';
5
5
  import * as i1 from '@wm/core';
6
6
  import { noop } from '@wm/core';
7
7
  import { capitalize, cloneDeep } from 'lodash-es';
8
+ import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
9
+ import { DatasetAwareFormComponent } from '@wm/components/input';
10
+ import { Subject } from 'rxjs';
8
11
 
9
12
  const customWidgetProps = new Map([
10
13
  ['class', PROP_STRING],
@@ -20,15 +23,16 @@ const registerProps$1 = () => {
20
23
  const registeredPropsSet = new Set();
21
24
  let customWidgetPropsMap = {};
22
25
  const DEFAULT_CLS$1 = 'app-html-container';
23
- class CustomWidgetContainerDirective extends StylableComponent {
26
+ class CustomWidgetContainerDirective extends DatasetAwareFormComponent {
24
27
  static { this.initializeProps = registerProps$1(); }
25
- constructor(inj, elRef, widgetname) {
28
+ constructor(inj, elRef, widgetname, explicitContext) {
26
29
  const widgetType = `wm-custom-${widgetname}`;
27
30
  const WIDGET_CONFIG = { widgetType, hostClass: DEFAULT_CLS$1 };
28
31
  let resolveFn = noop;
29
- super(inj, WIDGET_CONFIG, undefined, new Promise(res => resolveFn = res));
32
+ super(inj, WIDGET_CONFIG, explicitContext, undefined, new Promise(res => resolveFn = res));
30
33
  this.props = {};
31
34
  this.propsReady = resolveFn;
35
+ this.configSubject = new Subject();
32
36
  this.widgetType = widgetType;
33
37
  this.name = elRef.nativeElement.getAttribute('name');
34
38
  styler(this.nativeElement, this);
@@ -45,6 +49,17 @@ class CustomWidgetContainerDirective extends StylableComponent {
45
49
  }
46
50
  }));
47
51
  }
52
+ get datavalue() {
53
+ if (this.nativeElement.children.length) {
54
+ let value = this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue;
55
+ this.updateDataValue(value);
56
+ return value;
57
+ }
58
+ }
59
+ set datavalue(value) {
60
+ if (this.nativeElement.children.length)
61
+ this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue = value;
62
+ }
48
63
  setBaseWidgetName(baseWidgetType) {
49
64
  let splitArr = baseWidgetType.split('-'), modifiedArr = [];
50
65
  modifiedArr = splitArr.map((item) => {
@@ -54,7 +69,11 @@ class CustomWidgetContainerDirective extends StylableComponent {
54
69
  this.baseWidgetName = modifiedArr.join('');
55
70
  }
56
71
  setProps(config, resolveFn) {
57
- this.setBaseWidgetName(config.widgetType);
72
+ this.config = config;
73
+ this.configSubject.next();
74
+ this.asAttr = this.nativeElement.children[0].children[0].hasAttribute('as');
75
+ if (this.asAttr)
76
+ this.setBaseWidgetName(config.widgetType);
58
77
  if (!config || !config.properties) {
59
78
  return;
60
79
  }
@@ -87,14 +106,28 @@ class CustomWidgetContainerDirective extends StylableComponent {
87
106
  customWidgetPropsMap[this.widgetType] = this.props;
88
107
  return propsMap;
89
108
  }
109
+ updateDataValue(value) {
110
+ if (this.formControl && this.formControl.control && value !== this.formControl.control.value)
111
+ this.formControl.control.setValue(value);
112
+ }
90
113
  updateData(key, value) {
91
114
  let modifiedKey = key.replace('base-', '');
92
- this[this.baseWidgetName][modifiedKey] = value;
93
- this.nativeElement.childNodes[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
94
- this[this.baseWidgetName].initDatasetItems();
115
+ if (this.asAttr) {
116
+ this[this.baseWidgetName][modifiedKey] = value;
117
+ this.nativeElement.children[0].children[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;
118
+ this[this.baseWidgetName].initDatasetItems();
119
+ }
120
+ else {
121
+ this[modifiedKey] = value;
122
+ this.nativeElement.children[0].children[0]['widget'].viewParent[modifiedKey] = value;
123
+ }
124
+ if (this.formControl && modifiedKey === 'datavalue')
125
+ this.updateDataValue(value);
95
126
  }
96
- static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵinjectAttribute('widgetname')); }; }
127
+ static { this.ɵfac = function CustomWidgetContainerDirective_Factory(t) { return new (t || CustomWidgetContainerDirective)(i0.ɵɵdirectiveInject(i0.Injector), i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵinjectAttribute('widgetname'), i0.ɵɵdirectiveInject('EXPLICIT_CONTEXT', 8)); }; }
97
128
  static { this.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: CustomWidgetContainerDirective, selectors: [["", "wmWidgetContainer", ""]], exportAs: ["wmWidgetContainer"], features: [i0.ɵɵProvidersFeature([
129
+ provideAs(CustomWidgetContainerDirective, NG_VALUE_ACCESSOR, true),
130
+ provideAs(CustomWidgetContainerDirective, NG_VALIDATORS, true),
98
131
  provideAsWidgetRef(CustomWidgetContainerDirective)
99
132
  ]), i0.ɵɵInheritDefinitionFeature] }); }
100
133
  }
@@ -103,6 +136,8 @@ class CustomWidgetContainerDirective extends StylableComponent {
103
136
  args: [{
104
137
  selector: '[wmWidgetContainer]',
105
138
  providers: [
139
+ provideAs(CustomWidgetContainerDirective, NG_VALUE_ACCESSOR, true),
140
+ provideAs(CustomWidgetContainerDirective, NG_VALIDATORS, true),
106
141
  provideAsWidgetRef(CustomWidgetContainerDirective)
107
142
  ],
108
143
  exportAs: 'wmWidgetContainer'
@@ -110,6 +145,11 @@ class CustomWidgetContainerDirective extends StylableComponent {
110
145
  }], () => [{ type: i0.Injector }, { type: i0.ElementRef }, { type: undefined, decorators: [{
111
146
  type: Attribute,
112
147
  args: ['widgetname']
148
+ }] }, { type: undefined, decorators: [{
149
+ type: Inject,
150
+ args: ['EXPLICIT_CONTEXT']
151
+ }, {
152
+ type: Optional
113
153
  }] }], null); })();
114
154
 
115
155
  const registerProps = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/advanced/custom/src/custom-widget-container/custom-widget.props.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget-container/custom-widget-container.directive.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget-prop.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget.directive.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget.module.ts","../../../../../projects/components/widgets/advanced/custom/src/index.ts"],"sourcesContent":["import {PROP_BOOLEAN, PROP_STRING, register} from '@wm/components/base';\n\nexport const customWidgetProps =\n new Map(\n [\n ['class', PROP_STRING],\n ['hint', PROP_STRING],\n ['name', PROP_STRING],\n ['widgetname', PROP_STRING],\n ['show', { value: true, ...PROP_BOOLEAN }]\n ]\n )\n\nexport const registerProps = () => {\n register(\n 'wm-custom-widget',\n customWidgetProps\n );\n};\n","import { Attribute, Directive, ElementRef, Injector, OnInit } from '@angular/core';\n\nimport { noop } from '@wm/core';\nimport { PROP_TYPE, provideAsWidgetRef, register, StylableComponent, styler } from '@wm/components/base';\n\nimport { customWidgetProps } from './custom-widget.props';\nimport { registerProps } from \"../custom-widget-container/custom-widget.props\";\nimport {capitalize, cloneDeep} from 'lodash-es';\n\nconst registeredPropsSet = new Set<string>();\n\nlet customWidgetPropsMap: { [key: string]: any } = {};\n\nconst DEFAULT_CLS = 'app-html-container';\n\ndeclare const _;\n\n@Directive({\n selector: '[wmWidgetContainer]',\n providers: [\n provideAsWidgetRef(CustomWidgetContainerDirective)\n ],\n exportAs: 'wmWidgetContainer'\n})\nexport class CustomWidgetContainerDirective extends StylableComponent implements OnInit {\n static initializeProps = registerProps();\n\n widgetType: string;\n name: string;\n propsReady: Function;\n widgetName: string;\n private props: any = {};\n private baseWidgetName: string;\n\n constructor(\n inj: Injector, elRef: ElementRef,\n @Attribute('widgetname') widgetname: string,\n ) {\n const widgetType = `wm-custom-${widgetname}`;\n const WIDGET_CONFIG = { widgetType, hostClass: DEFAULT_CLS };\n let resolveFn: Function = noop;\n\n super(inj, WIDGET_CONFIG, undefined, new Promise(res => resolveFn = res));\n this.propsReady = resolveFn;\n this.widgetType = widgetType;\n this.name = elRef.nativeElement.getAttribute('name');\n\n styler(this.nativeElement, this);\n\n // Call on property change on name to set name attribute on element.\n this.registerReadyStateListener(() => {\n super.onPropertyChange('name', this.name);\n });\n\n this.registerPropertyChangeListener(((key: string, nv: any, ov?: any) => {\n if (!key.startsWith('prop-')) return;\n const propName = key.slice(5)\n if (this.props.hasOwnProperty(propName) && this.props[propName] !== nv) {\n this.props[propName] = nv;\n }\n }))\n }\n\n setBaseWidgetName(baseWidgetType: string) {\n let splitArr = baseWidgetType.split('-'), modifiedArr = [];\n modifiedArr = splitArr.map((item: any) => {\n item = item !== 'wm' ? capitalize(item) : item;\n return item;\n });\n this.baseWidgetName = modifiedArr.join('');\n }\n\n public setProps(config, resolveFn: Function) {\n this.setBaseWidgetName(config.widgetType);\n if (!config || !config.properties) {\n return;\n }\n if (!registeredPropsSet.has(this.widgetType)) {\n register(this.widgetType, this.prepareProps(config.properties));\n }else{\n this.props = Object.assign(this.props, cloneDeep(customWidgetPropsMap[this.widgetType]))\n }\n\n this.propsReady(resolveFn);\n }\n\n private prepareProps(props = {}) {\n const propsMap = new Map(customWidgetProps);\n Object.entries(props).forEach(([k, v]: [string, any]) => {\n let type = PROP_TYPE.STRING;\n\n if (v.type === 'boolean') {\n type = PROP_TYPE.BOOLEAN;\n } else if (v.type === 'number') {\n type = PROP_TYPE.NUMBER;\n } else if (v.type !== 'string') {\n type = v.type;\n }\n\n // Do not set the 'bind:*' values\n propsMap.set(`prop-${k}`, { type, value: _.startsWith(v.value, 'bind:') ? undefined : v.value });\n this.props[k] = v.value;\n });\n\n registeredPropsSet.add(this.widgetType);\n customWidgetPropsMap[this.widgetType] = this.props\n\n return propsMap;\n }\n\n updateData(key: string, value: any) {\n let modifiedKey = key.replace('base-', '');\n this[this.baseWidgetName][modifiedKey] = value;\n this.nativeElement.childNodes[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;\n this[this.baseWidgetName].initDatasetItems();\n }\n}\n","import {PROP_STRING, register} from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-custom-widget-container',\n new Map(\n [\n ['name', PROP_STRING],\n ['class', PROP_STRING]\n ]\n )\n );\n};\n","import { AfterContentInit, Directive, ElementRef, Injector, OnDestroy, Optional } from '@angular/core';\n\nimport {Viewport, ViewportEvent} from '@wm/core';\nimport { registerProps } from './custom-widget-prop';\nimport { StylableComponent, provideAsWidgetRef, getWidgetPropsByType } from '@wm/components/base';\n\nconst DEFAULT_CLS = 'app-custom-widget-container clearfix';\nconst WIDGET_CONFIG = {widgetType: 'wm-custom-widget-container', hostClass: DEFAULT_CLS};\ndeclare const _;\n\n@Directive({\n selector: '[wmCustomWidget]',\n providers: [\n provideAsWidgetRef(CustomWidgetDirective)\n ]\n})\nexport class CustomWidgetDirective extends StylableComponent implements OnDestroy, AfterContentInit {\n static initializeProps = registerProps();\n\n constructor(inj: Injector, private viewport: Viewport) {\n super(inj, WIDGET_CONFIG);\n this.registerDestroyListener(this.viewport.subscribe(ViewportEvent.RESIZE, data => this.callback('resize', data)));\n this.registerDestroyListener(this.viewport.subscribe(ViewportEvent.ORIENTATION_CHANGE, data => this.callback('orientationchange', data)));\n }\n ngAfterContentInit() {\n let customWidget = this.nativeElement.closest('[customwidgetcontainer]'),\n inheritedProps = {},\n customWidgetProps = Array.from(getWidgetPropsByType(\"wm-custom-widget-container\").keys());\n for(let i = 0; i < customWidget.attributes.length; i++) {\n let attr = customWidget.attributes.item(i);\n if(attr.value && attr.value !== '' && !customWidgetProps.includes(attr.name))\n inheritedProps[attr.name] = attr.value;\n }\n this.processChildren(this.nativeElement.children, inheritedProps);\n }\n\n processChildren(children: any, inheritedProps: { [key: string]: string }) {\n Array.from(children).forEach((child: any) => {\n if(!child.hasAttribute('base-widget'))\n this.processChildren(child.children, inheritedProps);\n else {\n for (const [key, value] of Object.entries(inheritedProps)) {\n if(key.includes(\".event\") || key.includes('.bind'))\n this.processAttr(key, value, {widget: child.widget, nativeElement: child});\n else\n child.widget[key] = value;\n }\n }\n });\n }\n\n private callback(eventName, locals?: object) {\n locals = _.assign({ widget: this }, locals);\n this.invokeEventCallback(eventName, locals);\n }\n\n public ngOnAttach() {\n this.callback('attach');\n }\n\n public ngOnDetach() {\n this.callback('detach');\n }\n\n public ngOnDestroy() {\n this.callback('destroy');\n super.ngOnDestroy();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { WmComponentsModule } from '@wm/components/base';\n\nimport { CustomWidgetContainerDirective } from './custom-widget-container/custom-widget-container.directive';\nimport { CustomWidgetDirective } from './custom-widget.directive'\nconst components = [\n CustomWidgetContainerDirective,\n CustomWidgetDirective\n];\n\n@NgModule({\n imports: [\n CommonModule,\n WmComponentsModule\n ],\n declarations: [...components],\n exports: [...components]\n})\nexport class CustomModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["registerProps","DEFAULT_CLS"],"mappings":";;;;;;;;AAEO,MAAM,iBAAiB,GAC1B,IAAI,GAAG,CACH;IACI,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,YAAY,EAAE,WAAW,CAAC;IAC3B,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC;AAC7C,CAAA,CACJ,CAAA;AAEE,MAAMA,eAAa,GAAG,MAAK;AAC9B,IAAA,QAAQ,CACJ,kBAAkB,EAClB,iBAAiB,CACpB,CAAC;AACN,CAAC;;ACTD,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE7C,IAAI,oBAAoB,GAA2B,EAAE,CAAC;AAEtD,MAAMC,aAAW,GAAG,oBAAoB,CAAC;AAWnC,MAAO,8BAA+B,SAAQ,iBAAiB,CAAA;AAC1D,IAAA,SAAA,I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AAE,CAAC,GAAG,UAAU,CAAC;AAC7B,gBAAA,OAAO,EAAE,CAAC,GAAG,UAAU,CAAC;AAC3B,aAAA,CAAA;;AACY,CAAA,YAAA,EAAA,CAAA,OAAA,SAAA,KAAA,WAAA,IAAA,SAAA,KAAA,EAAA,CAAA,kBAAA,CAAA,YAAY,mBAZrB,8BAA8B;AAC9B,QAAA,qBAAqB,aAKjB,YAAY;AACZ,QAAA,kBAAkB,aAPtB,8BAA8B;QAC9B,qBAAqB,CAAA,EAAA,CAAA,CAAA,EAAA,GAAA;;ACTzB;;AAEG;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../../../../projects/components/widgets/advanced/custom/src/custom-widget-container/custom-widget.props.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget-container/custom-widget-container.directive.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget-prop.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget.directive.ts","../../../../../projects/components/widgets/advanced/custom/src/custom-widget.module.ts","../../../../../projects/components/widgets/advanced/custom/src/index.ts"],"sourcesContent":["import {PROP_BOOLEAN, PROP_STRING, register} from '@wm/components/base';\n\nexport const customWidgetProps =\n new Map(\n [\n ['class', PROP_STRING],\n ['hint', PROP_STRING],\n ['name', PROP_STRING],\n ['widgetname', PROP_STRING],\n ['show', { value: true, ...PROP_BOOLEAN }]\n ]\n )\n\nexport const registerProps = () => {\n register(\n 'wm-custom-widget',\n customWidgetProps\n );\n};\n","import {Attribute, Directive, ElementRef, Inject, Injector, OnInit, Optional} from '@angular/core';\n\nimport { noop } from '@wm/core';\nimport {PROP_TYPE, provideAs, provideAsWidgetRef, register, StylableComponent, styler} from '@wm/components/base';\n\nimport { customWidgetProps } from './custom-widget.props';\nimport { registerProps } from \"../custom-widget-container/custom-widget.props\";\nimport {capitalize, cloneDeep} from 'lodash-es';\nimport {NG_VALIDATORS, NG_VALUE_ACCESSOR} from \"@angular/forms\";\nimport {DatasetAwareFormComponent} from \"@wm/components/input\";\nimport {Subject} from \"rxjs\";\n\nconst registeredPropsSet = new Set<string>();\n\nlet customWidgetPropsMap: { [key: string]: any } = {};\n\nconst DEFAULT_CLS = 'app-html-container';\n\ndeclare const _;\n\n@Directive({\n selector: '[wmWidgetContainer]',\n providers: [\n provideAs(CustomWidgetContainerDirective, NG_VALUE_ACCESSOR, true),\n provideAs(CustomWidgetContainerDirective, NG_VALIDATORS, true),\n provideAsWidgetRef(CustomWidgetContainerDirective)\n ],\n exportAs: 'wmWidgetContainer'\n})\nexport class CustomWidgetContainerDirective extends DatasetAwareFormComponent implements OnInit {\n static initializeProps = registerProps();\n\n widgetType: string;\n name: string;\n propsReady: Function;\n widgetName: string;\n config: any;\n private props: any = {};\n private baseWidgetName: string;\n asAttr: boolean;\n configSubject: Subject<any>;\n\n constructor(\n inj: Injector, elRef: ElementRef,\n @Attribute('widgetname') widgetname: string,\n @Inject('EXPLICIT_CONTEXT') @Optional() explicitContext: any\n ) {\n const widgetType = `wm-custom-${widgetname}`;\n const WIDGET_CONFIG = { widgetType, hostClass: DEFAULT_CLS };\n let resolveFn: Function = noop;\n\n super(inj, WIDGET_CONFIG, explicitContext, undefined, new Promise(res => resolveFn = res));\n this.propsReady = resolveFn;\n this.configSubject = new Subject();\n this.widgetType = widgetType;\n this.name = elRef.nativeElement.getAttribute('name');\n\n styler(this.nativeElement, this);\n\n // Call on property change on name to set name attribute on element.\n this.registerReadyStateListener(() => {\n super.onPropertyChange('name', this.name);\n });\n\n this.registerPropertyChangeListener(((key: string, nv: any, ov?: any) => {\n if (!key.startsWith('prop-')) return;\n const propName = key.slice(5)\n if (this.props.hasOwnProperty(propName) && this.props[propName] !== nv) {\n this.props[propName] = nv;\n }\n }))\n }\n\n get datavalue() {\n if(this.nativeElement.children.length) {\n let value = this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue;\n this.updateDataValue(value);\n return value;\n }\n }\n\n set datavalue(value) {\n if(this.nativeElement.children.length)\n this.nativeElement.children[0].children[0]['widget'].viewParent.datavalue = value;\n }\n\n setBaseWidgetName(baseWidgetType: string) {\n let splitArr = baseWidgetType.split('-'), modifiedArr = [];\n modifiedArr = splitArr.map((item: any) => {\n item = item !== 'wm' ? capitalize(item) : item;\n return item;\n });\n this.baseWidgetName = modifiedArr.join('');\n }\n\n public setProps(config, resolveFn: Function) {\n this.config = config;\n this.configSubject.next();\n this.asAttr = this.nativeElement.children[0].children[0].hasAttribute('as');\n if(this.asAttr)\n this.setBaseWidgetName(config.widgetType);\n if (!config || !config.properties) {\n return;\n }\n if (!registeredPropsSet.has(this.widgetType)) {\n register(this.widgetType, this.prepareProps(config.properties));\n }else{\n this.props = Object.assign(this.props, cloneDeep(customWidgetPropsMap[this.widgetType]))\n }\n\n this.propsReady(resolveFn);\n }\n\n private prepareProps(props = {}) {\n const propsMap = new Map(customWidgetProps);\n Object.entries(props).forEach(([k, v]: [string, any]) => {\n let type = PROP_TYPE.STRING;\n\n if (v.type === 'boolean') {\n type = PROP_TYPE.BOOLEAN;\n } else if (v.type === 'number') {\n type = PROP_TYPE.NUMBER;\n } else if (v.type !== 'string') {\n type = v.type;\n }\n\n // Do not set the 'bind:*' values\n propsMap.set(`prop-${k}`, { type, value: _.startsWith(v.value, 'bind:') ? undefined : v.value });\n this.props[k] = v.value;\n });\n\n registeredPropsSet.add(this.widgetType);\n customWidgetPropsMap[this.widgetType] = this.props\n\n return propsMap;\n }\n\n updateDataValue(value) {\n if(this.formControl && this.formControl.control && value !== this.formControl.control.value)\n this.formControl.control.setValue(value);\n }\n\n updateData(key: string, value: any) {\n let modifiedKey = key.replace('base-', '');\n if(this.asAttr) {\n this[this.baseWidgetName][modifiedKey] = value;\n this.nativeElement.children[0].children[0]['widget'].viewParent[this.baseWidgetName][modifiedKey] = value;\n this[this.baseWidgetName].initDatasetItems();\n } else {\n this[modifiedKey] = value;\n this.nativeElement.children[0].children[0]['widget'].viewParent[modifiedKey] = value;\n }\n if(this.formControl && modifiedKey === 'datavalue')\n this.updateDataValue(value);\n }\n}\n","import {PROP_STRING, register} from '@wm/components/base';\n\nexport const registerProps = () => {\n register(\n 'wm-custom-widget-container',\n new Map(\n [\n ['name', PROP_STRING],\n ['class', PROP_STRING]\n ]\n )\n );\n};\n","import { AfterContentInit, Directive, ElementRef, Injector, OnDestroy, Optional } from '@angular/core';\n\nimport {Viewport, ViewportEvent} from '@wm/core';\nimport { registerProps } from './custom-widget-prop';\nimport { StylableComponent, provideAsWidgetRef, getWidgetPropsByType } from '@wm/components/base';\n\nconst DEFAULT_CLS = 'app-custom-widget-container clearfix';\nconst WIDGET_CONFIG = {widgetType: 'wm-custom-widget-container', hostClass: DEFAULT_CLS};\ndeclare const _;\n\n@Directive({\n selector: '[wmCustomWidget]',\n providers: [\n provideAsWidgetRef(CustomWidgetDirective)\n ]\n})\nexport class CustomWidgetDirective extends StylableComponent implements OnDestroy, AfterContentInit {\n static initializeProps = registerProps();\n\n constructor(inj: Injector, private viewport: Viewport) {\n super(inj, WIDGET_CONFIG);\n this.registerDestroyListener(this.viewport.subscribe(ViewportEvent.RESIZE, data => this.callback('resize', data)));\n this.registerDestroyListener(this.viewport.subscribe(ViewportEvent.ORIENTATION_CHANGE, data => this.callback('orientationchange', data)));\n }\n ngAfterContentInit() {\n let customWidget = this.nativeElement.closest('[customwidgetcontainer]'),\n inheritedProps = {},\n customWidgetProps = Array.from(getWidgetPropsByType(\"wm-custom-widget-container\").keys());\n for(let i = 0; i < customWidget.attributes.length; i++) {\n let attr = customWidget.attributes.item(i);\n if(attr.value && attr.value !== '' && !customWidgetProps.includes(attr.name))\n inheritedProps[attr.name] = attr.value;\n }\n this.processChildren(this.nativeElement.children, inheritedProps);\n }\n\n processChildren(children: any, inheritedProps: { [key: string]: string }) {\n Array.from(children).forEach((child: any) => {\n if(!child.hasAttribute('base-widget'))\n this.processChildren(child.children, inheritedProps);\n else {\n for (const [key, value] of Object.entries(inheritedProps)) {\n if(key.includes(\".event\") || key.includes('.bind'))\n this.processAttr(key, value, {widget: child.widget, nativeElement: child});\n else\n child.widget[key] = value;\n }\n }\n });\n }\n\n private callback(eventName, locals?: object) {\n locals = _.assign({ widget: this }, locals);\n this.invokeEventCallback(eventName, locals);\n }\n\n public ngOnAttach() {\n this.callback('attach');\n }\n\n public ngOnDetach() {\n this.callback('detach');\n }\n\n public ngOnDestroy() {\n this.callback('destroy');\n super.ngOnDestroy();\n }\n\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\nimport { WmComponentsModule } from '@wm/components/base';\n\nimport { CustomWidgetContainerDirective } from './custom-widget-container/custom-widget-container.directive';\nimport { CustomWidgetDirective } from './custom-widget.directive'\nconst components = [\n CustomWidgetContainerDirective,\n CustomWidgetDirective\n];\n\n@NgModule({\n imports: [\n CommonModule,\n WmComponentsModule\n ],\n declarations: [...components],\n exports: [...components]\n})\nexport class CustomModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["registerProps","DEFAULT_CLS"],"mappings":";;;;;;;;;;;AAEO,MAAM,iBAAiB,GAC1B,IAAI,GAAG,CACH;IACI,CAAC,OAAO,EAAE,WAAW,CAAC;IACtB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,MAAM,EAAE,WAAW,CAAC;IACrB,CAAC,YAAY,EAAE,WAAW,CAAC;IAC3B,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,CAAC;AAC7C,CAAA,CACJ,CAAA;AAEE,MAAMA,eAAa,GAAG,MAAK;AAC9B,IAAA,QAAQ,CACJ,kBAAkB,EAClB,iBAAiB,CACpB,CAAC;AACN,CAAC;;ACND,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE7C,IAAI,oBAAoB,GAA2B,EAAE,CAAC;AAEtD,MAAMC,aAAW,GAAG,oBAAoB,CAAC;AAanC,MAAO,8BAA+B,SAAQ,yBAAyB,CAAA;AAClE,IAAA,SAAA,IAAA,CAAA,eAAe,GA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- const propInfo = widgetProps.get(key);
792
+ const propInfo = widgetProps ? widgetProps.get(key) : undefined;
793
793
  if (propInfo) {
794
794
  const type = propInfo.type;
795
795
  if (type) {
@@ -1024,6 +1024,10 @@
1024
1024
  else {
1025
1025
  this.delayedInit = true;
1026
1026
  initPromise.then((resolveFn) => {
1027
+ let formFieldCW = this.widgetSubType === 'wm-form-field-custom-widget', cw = this.widgetSubType.startsWith('wm-custom-');
1028
+ if (formFieldCW || cw) {
1029
+ this.customWidgetSubType = formFieldCW ? 'wm-form-field-' + lodashEs.last(this["formWidget"].config.widgetType.split('-')) : this["config"].widgetType;
1030
+ }
1027
1031
  this.initWidget();
1028
1032
  this.setInitProps();
1029
1033
  resolveFn && resolveFn();
@@ -1283,7 +1287,7 @@
1283
1287
  this.initState.delete(propName);
1284
1288
  let viewParent = child ? child.widget.viewParent.viewParent : this.viewParent, context = child ? child.widget.context : this.context, widget = child ? child.widget : this.widget, isMuted = child ? child.widget.isMuted : this.isMuted, widgetProps = child ? child.widget.widgetProps : this.widgetProps, widgetId = child ? child.widget.widgetId : this.widgetId;
1285
1289
  this.registerDestroyListener(i1.$watch(expr, viewParent, context, nv => {
1286
- if (propName.startsWith('base-'))
1290
+ if (propName.startsWith('base-') && widget.updateData)
1287
1291
  widget.updateData(propName, nv);
1288
1292
  widget[propName] = nv;
1289
1293
  }, getWatchIdentifier(widgetId, propName), propName === 'datasource', widgetProps.get(propName), () => isMuted));
@@ -1320,7 +1324,7 @@
1320
1324
  const { 0: propName, 1: type, 2: meta, length } = attrName.split('.');
1321
1325
  if (type === 'bind') {
1322
1326
  // if the show property is bound, set the initial value to false
1323
- if (propName === 'show') {
1327
+ if (propName === 'show' && !this.widgetSubType.startsWith('wm-custom-')) {
1324
1328
  this.nativeElement.hidden = true;
1325
1329
  }
1326
1330
  this.processBindAttr(propName, attrValue, child);
@@ -1392,6 +1396,12 @@
1392
1396
  this.initState = new Map();
1393
1397
  // get the widget properties
1394
1398
  const widgetProps = getWidgetPropsByType(this.widgetSubType);
1399
+ if (this.customWidgetSubType) {
1400
+ const customWidgetProps = getWidgetPropsByType(this.customWidgetSubType);
1401
+ customWidgetProps.forEach((v, k) => {
1402
+ widgetProps.set(k, v);
1403
+ });
1404
+ }
1395
1405
  widgetProps.forEach((v, k) => {
1396
1406
  if (i1.isDefined(v.value)) {
1397
1407
  this.initState.set(k, v.value);