@baloise/angular-output-target 1.0.11 → 1.0.19

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,42 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.19](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.0.18...@baloise/angular-output-target@1.0.19) (2021-12-07)
7
+
8
+ **Note:** Version bump only for package @baloise/angular-output-target
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.0.18](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.0.13...@baloise/angular-output-target@1.0.18) (2021-12-02)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **angular:** import statements for types ([f9ae53e](https://github.com/baloise/stencil-ds-output-targets/commit/f9ae53e272b98c69a94d2874ab4f6e1953364977))
20
+ * **angular:** return detail instead of target.value ([19abbf2](https://github.com/baloise/stencil-ds-output-targets/commit/19abbf2b8e3b977c3ce055ee58b1f5663ccb6ad2))
21
+
22
+
23
+
24
+
25
+
26
+ ## [1.0.13](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.0.12...@baloise/angular-output-target@1.0.13) (2021-06-01)
27
+
28
+ **Note:** Version bump only for package @baloise/angular-output-target
29
+
30
+
31
+
32
+
33
+
34
+ ## [1.0.12](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.0.11...@baloise/angular-output-target@1.0.12) (2021-05-07)
35
+
36
+ **Note:** Version bump only for package @baloise/angular-output-target
37
+
38
+
39
+
40
+
41
+
6
42
  ## [1.0.11](https://github.com/baloise/stencil-ds-output-targets/compare/@baloise/angular-output-target@1.0.10...@baloise/angular-output-target@1.0.11) (2021-05-07)
7
43
 
8
44
 
@@ -26,7 +26,7 @@ export const createComponentDefinition = (componentCorePackage, distTypesDir, ro
26
26
  .filter(output => !!output.complexType.references &&
27
27
  Object.prototype.hasOwnProperty.call(output.complexType.references, output.complexType.original) &&
28
28
  output.complexType.references[output.complexType.original].location === 'import')
29
- .map(output => output.complexType.resolved)
29
+ .map(output => output.complexType.original)
30
30
  .filter((item, pos, self) => self.indexOf(item) === pos)
31
31
  .join(', ');
32
32
  if (outputsTypes.length > 0) {
@@ -1,14 +1,11 @@
1
1
  import path from 'path';
2
2
  export default async function generateValueAccessors(compilerCtx, components, outputTarget, config) {
3
- if (!Array.isArray(outputTarget.valueAccessorConfigs) ||
4
- outputTarget.valueAccessorConfigs.length === 0) {
3
+ if (!Array.isArray(outputTarget.valueAccessorConfigs) || outputTarget.valueAccessorConfigs.length === 0) {
5
4
  return;
6
5
  }
7
6
  const targetDir = path.dirname(outputTarget.directivesProxyFile);
8
7
  const normalizedValueAccessors = outputTarget.valueAccessorConfigs.reduce((allAccessors, va) => {
9
- const elementSelectors = Array.isArray(va.elementSelectors)
10
- ? va.elementSelectors
11
- : [va.elementSelectors];
8
+ const elementSelectors = Array.isArray(va.elementSelectors) ? va.elementSelectors : [va.elementSelectors];
12
9
  const type = va.type;
13
10
  let allElementSelectors = [];
14
11
  let allEventTargets = [];
@@ -33,7 +30,7 @@ export default async function generateValueAccessors(compilerCtx, components, ou
33
30
  await copyResources(config, ['value-accessor.ts'], targetDir);
34
31
  }
35
32
  function createValueAccessor(srcFileContents, valueAccessor) {
36
- const hostContents = valueAccessor.eventTargets.map((listItem) => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
33
+ const hostContents = valueAccessor.eventTargets.map(listItem => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
37
34
  return srcFileContents
38
35
  .replace(VALUE_ACCESSOR_SELECTORS, valueAccessor.elementSelectors.join(', '))
39
36
  .replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(',\n'));
@@ -42,7 +39,7 @@ function copyResources(config, resourcesFilesToCopy, directory) {
42
39
  if (!config.sys || !config.sys.copy) {
43
40
  throw new Error('stencil is not properly intialized at this step. Notify the developer');
44
41
  }
45
- const copyTasks = resourcesFilesToCopy.map((rf) => {
42
+ const copyTasks = resourcesFilesToCopy.map(rf => {
46
43
  return {
47
44
  src: path.join(__dirname, '../resources/control-value-accessors/', rf),
48
45
  dest: path.join(directory, rf),
@@ -55,4 +52,4 @@ function copyResources(config, resourcesFilesToCopy, directory) {
55
52
  const VALUE_ACCESSOR_SELECTORS = `<VALUE_ACCESSOR_SELECTORS>`;
56
53
  const VALUE_ACCESSOR_EVENT = `<VALUE_ACCESSOR_EVENT>`;
57
54
  const VALUE_ACCESSOR_TARGETATTR = '<VALUE_ACCESSOR_TARGETATTR>';
58
- const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`;
55
+ const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)'`;
package/dist/index.cjs.js CHANGED
@@ -114,7 +114,7 @@ const createComponentDefinition = (componentCorePackage, distTypesDir, rootDir)
114
114
  .filter(output => !!output.complexType.references &&
115
115
  Object.prototype.hasOwnProperty.call(output.complexType.references, output.complexType.original) &&
116
116
  output.complexType.references[output.complexType.original].location === 'import')
117
- .map(output => output.complexType.resolved)
117
+ .map(output => output.complexType.original)
118
118
  .filter((item, pos, self) => self.indexOf(item) === pos)
119
119
  .join(', ');
120
120
  if (outputsTypes.length > 0) {
@@ -181,15 +181,12 @@ ${directives}
181
181
  }
182
182
 
183
183
  async function generateValueAccessors(compilerCtx, components, outputTarget, config) {
184
- if (!Array.isArray(outputTarget.valueAccessorConfigs) ||
185
- outputTarget.valueAccessorConfigs.length === 0) {
184
+ if (!Array.isArray(outputTarget.valueAccessorConfigs) || outputTarget.valueAccessorConfigs.length === 0) {
186
185
  return;
187
186
  }
188
187
  const targetDir = path__default['default'].dirname(outputTarget.directivesProxyFile);
189
188
  const normalizedValueAccessors = outputTarget.valueAccessorConfigs.reduce((allAccessors, va) => {
190
- const elementSelectors = Array.isArray(va.elementSelectors)
191
- ? va.elementSelectors
192
- : [va.elementSelectors];
189
+ const elementSelectors = Array.isArray(va.elementSelectors) ? va.elementSelectors : [va.elementSelectors];
193
190
  const type = va.type;
194
191
  let allElementSelectors = [];
195
192
  let allEventTargets = [];
@@ -211,19 +208,19 @@ async function generateValueAccessors(compilerCtx, components, outputTarget, con
211
208
  const finalText = createValueAccessor(srcFileContents, normalizedValueAccessors[valueAccessorType]);
212
209
  await compilerCtx.fs.writeFile(targetFilePath, finalText);
213
210
  }));
214
- await copyResources(config, ['value-accessor.ts'], targetDir);
211
+ await copyResources$1(config, ['value-accessor.ts'], targetDir);
215
212
  }
216
213
  function createValueAccessor(srcFileContents, valueAccessor) {
217
- const hostContents = valueAccessor.eventTargets.map((listItem) => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
214
+ const hostContents = valueAccessor.eventTargets.map(listItem => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
218
215
  return srcFileContents
219
216
  .replace(VALUE_ACCESSOR_SELECTORS, valueAccessor.elementSelectors.join(', '))
220
217
  .replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(',\n'));
221
218
  }
222
- function copyResources(config, resourcesFilesToCopy, directory) {
219
+ function copyResources$1(config, resourcesFilesToCopy, directory) {
223
220
  if (!config.sys || !config.sys.copy) {
224
221
  throw new Error('stencil is not properly intialized at this step. Notify the developer');
225
222
  }
226
- const copyTasks = resourcesFilesToCopy.map((rf) => {
223
+ const copyTasks = resourcesFilesToCopy.map(rf => {
227
224
  return {
228
225
  src: path__default['default'].join(__dirname, '../resources/control-value-accessors/', rf),
229
226
  dest: path__default['default'].join(directory, rf),
@@ -236,7 +233,7 @@ function copyResources(config, resourcesFilesToCopy, directory) {
236
233
  const VALUE_ACCESSOR_SELECTORS = `<VALUE_ACCESSOR_SELECTORS>`;
237
234
  const VALUE_ACCESSOR_EVENT = `<VALUE_ACCESSOR_EVENT>`;
238
235
  const VALUE_ACCESSOR_TARGETATTR = '<VALUE_ACCESSOR_TARGETATTR>';
239
- const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`;
236
+ const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)'`;
240
237
 
241
238
  async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components, config) {
242
239
  const filteredComponents = getFilteredComponents(outputTarget.excludeComponents, components);
@@ -245,7 +242,7 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
245
242
  const finalText = generateProxies(filteredComponents, pkgData, outputTarget, config.rootDir);
246
243
  await Promise.all([
247
244
  compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, finalText),
248
- copyResources$1(config, outputTarget),
245
+ copyResources(config, outputTarget),
249
246
  generateAngularDirectivesFile(compilerCtx, filteredComponents, outputTarget),
250
247
  generateValueAccessors(compilerCtx, filteredComponents, outputTarget, config),
251
248
  ]);
@@ -253,7 +250,7 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
253
250
  function getFilteredComponents(excludeComponents = [], cmps) {
254
251
  return sortBy(cmps, (cmp) => cmp.tagName).filter((c) => !excludeComponents.includes(c.tagName) && !c.internal);
255
252
  }
256
- async function copyResources$1(config, outputTarget) {
253
+ async function copyResources(config, outputTarget) {
257
254
  if (!config.sys || !config.sys.copy || !config.sys.glob) {
258
255
  throw new Error('stencil is not properly initialized at this step. Notify the developer');
259
256
  }
package/dist/index.js CHANGED
@@ -105,7 +105,7 @@ const createComponentDefinition = (componentCorePackage, distTypesDir, rootDir)
105
105
  .filter(output => !!output.complexType.references &&
106
106
  Object.prototype.hasOwnProperty.call(output.complexType.references, output.complexType.original) &&
107
107
  output.complexType.references[output.complexType.original].location === 'import')
108
- .map(output => output.complexType.resolved)
108
+ .map(output => output.complexType.original)
109
109
  .filter((item, pos, self) => self.indexOf(item) === pos)
110
110
  .join(', ');
111
111
  if (outputsTypes.length > 0) {
@@ -172,15 +172,12 @@ ${directives}
172
172
  }
173
173
 
174
174
  async function generateValueAccessors(compilerCtx, components, outputTarget, config) {
175
- if (!Array.isArray(outputTarget.valueAccessorConfigs) ||
176
- outputTarget.valueAccessorConfigs.length === 0) {
175
+ if (!Array.isArray(outputTarget.valueAccessorConfigs) || outputTarget.valueAccessorConfigs.length === 0) {
177
176
  return;
178
177
  }
179
178
  const targetDir = path.dirname(outputTarget.directivesProxyFile);
180
179
  const normalizedValueAccessors = outputTarget.valueAccessorConfigs.reduce((allAccessors, va) => {
181
- const elementSelectors = Array.isArray(va.elementSelectors)
182
- ? va.elementSelectors
183
- : [va.elementSelectors];
180
+ const elementSelectors = Array.isArray(va.elementSelectors) ? va.elementSelectors : [va.elementSelectors];
184
181
  const type = va.type;
185
182
  let allElementSelectors = [];
186
183
  let allEventTargets = [];
@@ -202,19 +199,19 @@ async function generateValueAccessors(compilerCtx, components, outputTarget, con
202
199
  const finalText = createValueAccessor(srcFileContents, normalizedValueAccessors[valueAccessorType]);
203
200
  await compilerCtx.fs.writeFile(targetFilePath, finalText);
204
201
  }));
205
- await copyResources(config, ['value-accessor.ts'], targetDir);
202
+ await copyResources$1(config, ['value-accessor.ts'], targetDir);
206
203
  }
207
204
  function createValueAccessor(srcFileContents, valueAccessor) {
208
- const hostContents = valueAccessor.eventTargets.map((listItem) => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
205
+ const hostContents = valueAccessor.eventTargets.map(listItem => VALUE_ACCESSOR_EVENTTARGETS.replace(VALUE_ACCESSOR_EVENT, listItem[0]).replace(VALUE_ACCESSOR_TARGETATTR, listItem[1]));
209
206
  return srcFileContents
210
207
  .replace(VALUE_ACCESSOR_SELECTORS, valueAccessor.elementSelectors.join(', '))
211
208
  .replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(',\n'));
212
209
  }
213
- function copyResources(config, resourcesFilesToCopy, directory) {
210
+ function copyResources$1(config, resourcesFilesToCopy, directory) {
214
211
  if (!config.sys || !config.sys.copy) {
215
212
  throw new Error('stencil is not properly intialized at this step. Notify the developer');
216
213
  }
217
- const copyTasks = resourcesFilesToCopy.map((rf) => {
214
+ const copyTasks = resourcesFilesToCopy.map(rf => {
218
215
  return {
219
216
  src: path.join(__dirname, '../resources/control-value-accessors/', rf),
220
217
  dest: path.join(directory, rf),
@@ -227,7 +224,7 @@ function copyResources(config, resourcesFilesToCopy, directory) {
227
224
  const VALUE_ACCESSOR_SELECTORS = `<VALUE_ACCESSOR_SELECTORS>`;
228
225
  const VALUE_ACCESSOR_EVENT = `<VALUE_ACCESSOR_EVENT>`;
229
226
  const VALUE_ACCESSOR_TARGETATTR = '<VALUE_ACCESSOR_TARGETATTR>';
230
- const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`;
227
+ const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)'`;
231
228
 
232
229
  async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components, config) {
233
230
  const filteredComponents = getFilteredComponents(outputTarget.excludeComponents, components);
@@ -236,7 +233,7 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
236
233
  const finalText = generateProxies(filteredComponents, pkgData, outputTarget, config.rootDir);
237
234
  await Promise.all([
238
235
  compilerCtx.fs.writeFile(outputTarget.directivesProxyFile, finalText),
239
- copyResources$1(config, outputTarget),
236
+ copyResources(config, outputTarget),
240
237
  generateAngularDirectivesFile(compilerCtx, filteredComponents, outputTarget),
241
238
  generateValueAccessors(compilerCtx, filteredComponents, outputTarget, config),
242
239
  ]);
@@ -244,7 +241,7 @@ async function angularDirectiveProxyOutput(compilerCtx, outputTarget, components
244
241
  function getFilteredComponents(excludeComponents = [], cmps) {
245
242
  return sortBy(cmps, (cmp) => cmp.tagName).filter((c) => !excludeComponents.includes(c.tagName) && !c.internal);
246
243
  }
247
- async function copyResources$1(config, outputTarget) {
244
+ async function copyResources(config, outputTarget) {
248
245
  if (!config.sys || !config.sys.copy || !config.sys.glob) {
249
246
  throw new Error('stencil is not properly initialized at this step. Notify the developer');
250
247
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baloise/angular-output-target",
3
- "version": "1.0.11",
3
+ "version": "1.0.19",
4
4
  "description": "Angular output target for @stencil/core components.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.js",
@@ -37,9 +37,15 @@
37
37
  "url": "https://github.com/baloise/stencil-ds-output-targets/issues"
38
38
  },
39
39
  "devDependencies": {
40
- "@angular/core": "8.2.14",
41
- "@angular/forms": "8.2.14",
42
- "jest": "^26.6.3"
40
+ "@angular/common": "^10.2.5",
41
+ "@angular/core": "^10.2.5",
42
+ "@angular/forms": "^10.2.5",
43
+ "@angular/platform-browser": "^10.2.5",
44
+ "jest": "^26.6.3",
45
+ "rollup": "^2.56.3",
46
+ "rxjs": "^6.6.7",
47
+ "typescript": "^4.0.8",
48
+ "zone.js": "^0.10.3"
43
49
  },
44
50
  "jest": {
45
51
  "transform": {
@@ -55,5 +61,5 @@
55
61
  ],
56
62
  "testURL": "http://localhost"
57
63
  },
58
- "gitHead": "5a5a9d8ff993f69679bbc03087ad1a94cd3851b0"
64
+ "gitHead": "0a8622b3f316c270cfc2bcc97719d44c6c3c272d"
59
65
  }
@@ -1,27 +1,27 @@
1
- import { Directive, ElementRef } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
1
+ import { Directive, ElementRef } from '@angular/core'
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms'
3
3
 
4
- import { ValueAccessor } from './value-accessor';
4
+ import { ValueAccessor } from './value-accessor'
5
5
 
6
6
  @Directive({
7
7
  /* tslint:disable-next-line:directive-selector */
8
8
  selector: '<VALUE_ACCESSOR_SELECTORS>',
9
9
  host: {
10
- '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'
10
+ '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)',
11
11
  },
12
12
  providers: [
13
13
  {
14
14
  provide: NG_VALUE_ACCESSOR,
15
15
  useExisting: BooleanValueAccessor,
16
- multi: true
17
- }
18
- ]
16
+ multi: true,
17
+ },
18
+ ],
19
19
  })
20
20
  export class BooleanValueAccessor extends ValueAccessor {
21
21
  constructor(el: ElementRef) {
22
- super(el);
22
+ super(el)
23
23
  }
24
24
  writeValue(value: any) {
25
- this.el.nativeElement.checked = this.lastValue = value == null ? false : value;
25
+ this.el.nativeElement.checked = this.lastValue = value == null ? false : value
26
26
  }
27
27
  }
@@ -1,29 +1,29 @@
1
- import { Directive, ElementRef } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
1
+ import { Directive, ElementRef } from '@angular/core'
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms'
3
3
 
4
- import { ValueAccessor } from './value-accessor';
4
+ import { ValueAccessor } from './value-accessor'
5
5
 
6
6
  @Directive({
7
7
  /* tslint:disable-next-line:directive-selector */
8
8
  selector: '<VALUE_ACCESSOR_SELECTORS>',
9
9
  host: {
10
- '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'
10
+ '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)',
11
11
  },
12
12
  providers: [
13
13
  {
14
14
  provide: NG_VALUE_ACCESSOR,
15
15
  useExisting: NumericValueAccessor,
16
- multi: true
17
- }
18
- ]
16
+ multi: true,
17
+ },
18
+ ],
19
19
  })
20
20
  export class NumericValueAccessor extends ValueAccessor {
21
21
  constructor(el: ElementRef) {
22
- super(el);
22
+ super(el)
23
23
  }
24
24
  registerOnChange(fn: (_: number | null) => void) {
25
25
  super.registerOnChange(value => {
26
- fn(value === '' ? null : parseFloat(value));
27
- });
26
+ fn(value === '' ? null : parseFloat(value))
27
+ })
28
28
  }
29
29
  }
@@ -1,24 +1,24 @@
1
- import { Directive, ElementRef } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
1
+ import { Directive, ElementRef } from '@angular/core'
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms'
3
3
 
4
- import { ValueAccessor } from './value-accessor';
4
+ import { ValueAccessor } from './value-accessor'
5
5
 
6
6
  @Directive({
7
7
  /* tslint:disable-next-line:directive-selector */
8
8
  selector: '<VALUE_ACCESSOR_SELECTORS>',
9
9
  host: {
10
- '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'
10
+ '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)',
11
11
  },
12
12
  providers: [
13
13
  {
14
14
  provide: NG_VALUE_ACCESSOR,
15
15
  useExisting: RadioValueAccessor,
16
- multi: true
17
- }
18
- ]
16
+ multi: true,
17
+ },
18
+ ],
19
19
  })
20
20
  export class RadioValueAccessor extends ValueAccessor {
21
21
  constructor(el: ElementRef) {
22
- super(el);
22
+ super(el)
23
23
  }
24
24
  }
@@ -1,24 +1,24 @@
1
- import { Directive, ElementRef } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
1
+ import { Directive, ElementRef } from '@angular/core'
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms'
3
3
 
4
- import { ValueAccessor } from './value-accessor';
4
+ import { ValueAccessor } from './value-accessor'
5
5
 
6
6
  @Directive({
7
7
  /* tslint:disable-next-line:directive-selector */
8
8
  selector: '<VALUE_ACCESSOR_SELECTORS>',
9
9
  host: {
10
- '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'
10
+ '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)',
11
11
  },
12
12
  providers: [
13
13
  {
14
14
  provide: NG_VALUE_ACCESSOR,
15
15
  useExisting: SelectValueAccessor,
16
- multi: true
17
- }
18
- ]
16
+ multi: true,
17
+ },
18
+ ],
19
19
  })
20
20
  export class SelectValueAccessor extends ValueAccessor {
21
21
  constructor(el: ElementRef) {
22
- super(el);
22
+ super(el)
23
23
  }
24
24
  }
@@ -1,24 +1,24 @@
1
- import { Directive, ElementRef } from '@angular/core';
2
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
1
+ import { Directive, ElementRef } from '@angular/core'
2
+ import { NG_VALUE_ACCESSOR } from '@angular/forms'
3
3
 
4
- import { ValueAccessor } from './value-accessor';
4
+ import { ValueAccessor } from './value-accessor'
5
5
 
6
6
  @Directive({
7
7
  /* tslint:disable-next-line:directive-selector */
8
8
  selector: '<VALUE_ACCESSOR_SELECTORS>',
9
9
  host: {
10
- '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'
10
+ '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.detail)',
11
11
  },
12
12
  providers: [
13
13
  {
14
14
  provide: NG_VALUE_ACCESSOR,
15
15
  useExisting: TextValueAccessor,
16
- multi: true
17
- }
18
- ]
16
+ multi: true,
17
+ },
18
+ ],
19
19
  })
20
20
  export class TextValueAccessor extends ValueAccessor {
21
21
  constructor(el: ElementRef) {
22
- super(el);
22
+ super(el)
23
23
  }
24
24
  }