@stencil/angular-output-target 0.3.0 → 0.4.0-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.
|
@@ -43,11 +43,13 @@ export const defineCustomElement = (tagName: string, customElement: any) => {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
// tslint:disable-next-line: only-arrow-functions
|
|
46
|
-
export function ProxyCmp(opts: { tagName: string,
|
|
46
|
+
export function ProxyCmp(opts: { tagName: string, defineCustomElementFn?: () => void, inputs?: any; methods?: any }) {
|
|
47
47
|
const decorator = function (cls: any) {
|
|
48
48
|
const { tagName, customElement, inputs, methods } = opts;
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
if (defineCustomElementFn !== undefined) {
|
|
51
|
+
defineCustomElementFn();
|
|
52
|
+
}
|
|
51
53
|
|
|
52
54
|
if (inputs) {
|
|
53
55
|
proxyInputs(cls, inputs);
|
|
@@ -92,7 +92,7 @@ function getProxyCmp(tagName, includeCustomElement, inputs, methods) {
|
|
|
92
92
|
const hasMethods = methods.length > 0;
|
|
93
93
|
const proxMeta = [
|
|
94
94
|
`tagName: \'${tagName}\'`,
|
|
95
|
-
`customElement: ${includeCustomElement ? dashToPascalCase(tagName)
|
|
95
|
+
`customElement: ${includeCustomElement ? 'define' + dashToPascalCase(tagName) : 'undefined'}`
|
|
96
96
|
];
|
|
97
97
|
if (hasInputs)
|
|
98
98
|
proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
|
package/dist/index.cjs.js
CHANGED
|
@@ -178,7 +178,7 @@ function getProxyCmp(tagName, includeCustomElement, inputs, methods) {
|
|
|
178
178
|
const hasMethods = methods.length > 0;
|
|
179
179
|
const proxMeta = [
|
|
180
180
|
`tagName: \'${tagName}\'`,
|
|
181
|
-
`customElement: ${includeCustomElement ? dashToPascalCase(tagName)
|
|
181
|
+
`customElement: ${includeCustomElement ? 'define' + dashToPascalCase(tagName) : 'undefined'}`
|
|
182
182
|
];
|
|
183
183
|
if (hasInputs)
|
|
184
184
|
proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
|
|
@@ -325,7 +325,7 @@ import { ProxyCmp, proxyOutputs } from './angular-component-lib/utils';\n`;
|
|
|
325
325
|
if (outputTarget.includeImportCustomElements && outputTarget.componentCorePackage !== undefined) {
|
|
326
326
|
const cmpImports = components.map(component => {
|
|
327
327
|
const pascalImport = dashToPascalCase(component.tagName);
|
|
328
|
-
return `import {
|
|
328
|
+
return `import { defineCustomElement as define${pascalImport} } from '${normalizePath(outputTarget.componentCorePackage)}/${outputTarget.customElementsDir ||
|
|
329
329
|
'components'}/${component.tagName}.js';`;
|
|
330
330
|
});
|
|
331
331
|
sourceImports = cmpImports.join('\n');
|
package/dist/index.js
CHANGED
|
@@ -170,7 +170,7 @@ function getProxyCmp(tagName, includeCustomElement, inputs, methods) {
|
|
|
170
170
|
const hasMethods = methods.length > 0;
|
|
171
171
|
const proxMeta = [
|
|
172
172
|
`tagName: \'${tagName}\'`,
|
|
173
|
-
`customElement: ${includeCustomElement ? dashToPascalCase(tagName)
|
|
173
|
+
`customElement: ${includeCustomElement ? 'define' + dashToPascalCase(tagName) : 'undefined'}`
|
|
174
174
|
];
|
|
175
175
|
if (hasInputs)
|
|
176
176
|
proxMeta.push(`inputs: ['${inputs.join(`', '`)}']`);
|
|
@@ -317,7 +317,7 @@ import { ProxyCmp, proxyOutputs } from './angular-component-lib/utils';\n`;
|
|
|
317
317
|
if (outputTarget.includeImportCustomElements && outputTarget.componentCorePackage !== undefined) {
|
|
318
318
|
const cmpImports = components.map(component => {
|
|
319
319
|
const pascalImport = dashToPascalCase(component.tagName);
|
|
320
|
-
return `import {
|
|
320
|
+
return `import { defineCustomElement as define${pascalImport} } from '${normalizePath(outputTarget.componentCorePackage)}/${outputTarget.customElementsDir ||
|
|
321
321
|
'components'}/${component.tagName}.js';`;
|
|
322
322
|
});
|
|
323
323
|
sourceImports = cmpImports.join('\n');
|
package/dist/output-angular.js
CHANGED
|
@@ -63,7 +63,7 @@ import { ProxyCmp, proxyOutputs } from './angular-component-lib/utils';\n`;
|
|
|
63
63
|
if (outputTarget.includeImportCustomElements && outputTarget.componentCorePackage !== undefined) {
|
|
64
64
|
const cmpImports = components.map(component => {
|
|
65
65
|
const pascalImport = dashToPascalCase(component.tagName);
|
|
66
|
-
return `import {
|
|
66
|
+
return `import { defineCustomElement as define${pascalImport} } from '${normalizePath(outputTarget.componentCorePackage)}/${outputTarget.customElementsDir ||
|
|
67
67
|
'components'}/${component.tagName}.js';`;
|
|
68
68
|
});
|
|
69
69
|
sourceImports = cmpImports.join('\n');
|