@stencil/angular-output-target
Advanced tools
Comparing version
@@ -15,3 +15,3 @@ import { createComponentEventTypeImports, dashToPascalCase, formatToQuotedList } from './utils'; | ||
// If a member name includes a dash or a forward slash, we need to wrap it in quotes. | ||
// https://github.com/ionic-team/stencil-ds-output-targets/issues/212 | ||
// https://github.com/stenciljs/output-targets/issues/212 | ||
eventName = `'${prop.name}'`; | ||
@@ -63,4 +63,4 @@ } | ||
let standaloneOption = ''; | ||
if (standalone && includeImportCustomElements) { | ||
standaloneOption = `\n standalone: true`; | ||
if (!standalone) { | ||
standaloneOption = `\n standalone: false`; | ||
} | ||
@@ -67,0 +67,0 @@ const propertyDeclarations = inlineComponentProps.map((m) => createPropertyDeclaration(m, `Components.${tagNameAsPascal}['${m.name}']`, true)); |
@@ -39,3 +39,3 @@ import { EOL } from 'os'; | ||
.replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(`,${EOL}`)) | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType === OutputTypes.Standalone ? ',standalone: true' : ''); | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType !== OutputTypes.Standalone ? ',\nstandalone: false' : ''); | ||
} | ||
@@ -61,2 +61,2 @@ function copyResources(config, resourcesFilesToCopy, directory) { | ||
const VALUE_ACCESSOR_STANDALONE = '<VALUE_ACCESSOR_STANDALONE>'; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])'`; |
@@ -160,3 +160,3 @@ 'use strict'; | ||
// If a member name includes a dash or a forward slash, we need to wrap it in quotes. | ||
// https://github.com/ionic-team/stencil-ds-output-targets/issues/212 | ||
// https://github.com/stenciljs/output-targets/issues/212 | ||
eventName = `'${prop.name}'`; | ||
@@ -208,4 +208,4 @@ } | ||
let standaloneOption = ''; | ||
if (standalone && includeImportCustomElements) { | ||
standaloneOption = `\n standalone: true`; | ||
if (!standalone) { | ||
standaloneOption = `\n standalone: false`; | ||
} | ||
@@ -394,3 +394,3 @@ const propertyDeclarations = inlineComponentProps.map((m) => createPropertyDeclaration(m, `Components.${tagNameAsPascal}['${m.name}']`, true)); | ||
.replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(`,${os.EOL}`)) | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType === OutputTypes.Standalone ? ',standalone: true' : ''); | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType !== OutputTypes.Standalone ? ',\nstandalone: false' : ''); | ||
} | ||
@@ -416,3 +416,3 @@ function copyResources$1(config, resourcesFilesToCopy, directory) { | ||
const VALUE_ACCESSOR_STANDALONE = '<VALUE_ACCESSOR_STANDALONE>'; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])'`; | ||
@@ -588,3 +588,4 @@ /** | ||
function normalizeOutputTarget(config, outputTarget) { | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component }); | ||
var _a, _b; | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: (_a = outputTarget.customElementsDir) !== null && _a !== void 0 ? _a : 'components', outputType: (_b = outputTarget.outputType) !== null && _b !== void 0 ? _b : OutputTypes.Standalone }); | ||
if (config.rootDir == null) { | ||
@@ -591,0 +592,0 @@ throw new Error('rootDir is not set and it should be set by stencil itself'); |
@@ -152,3 +152,3 @@ import path from 'path'; | ||
// If a member name includes a dash or a forward slash, we need to wrap it in quotes. | ||
// https://github.com/ionic-team/stencil-ds-output-targets/issues/212 | ||
// https://github.com/stenciljs/output-targets/issues/212 | ||
eventName = `'${prop.name}'`; | ||
@@ -200,4 +200,4 @@ } | ||
let standaloneOption = ''; | ||
if (standalone && includeImportCustomElements) { | ||
standaloneOption = `\n standalone: true`; | ||
if (!standalone) { | ||
standaloneOption = `\n standalone: false`; | ||
} | ||
@@ -386,3 +386,3 @@ const propertyDeclarations = inlineComponentProps.map((m) => createPropertyDeclaration(m, `Components.${tagNameAsPascal}['${m.name}']`, true)); | ||
.replace(VALUE_ACCESSOR_EVENTTARGETS, hostContents.join(`,${EOL}`)) | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType === OutputTypes.Standalone ? ',standalone: true' : ''); | ||
.replace(VALUE_ACCESSOR_STANDALONE, outputType && outputType !== OutputTypes.Standalone ? ',\nstandalone: false' : ''); | ||
} | ||
@@ -408,3 +408,3 @@ function copyResources$1(config, resourcesFilesToCopy, directory) { | ||
const VALUE_ACCESSOR_STANDALONE = '<VALUE_ACCESSOR_STANDALONE>'; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)'`; | ||
const VALUE_ACCESSOR_EVENTTARGETS = ` '(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])'`; | ||
@@ -580,3 +580,4 @@ /** | ||
function normalizeOutputTarget(config, outputTarget) { | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component }); | ||
var _a, _b; | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: (_a = outputTarget.customElementsDir) !== null && _a !== void 0 ? _a : 'components', outputType: (_b = outputTarget.outputType) !== null && _b !== void 0 ? _b : OutputTypes.Standalone }); | ||
if (config.rootDir == null) { | ||
@@ -583,0 +584,0 @@ throw new Error('rootDir is not set and it should be set by stencil itself'); |
@@ -20,3 +20,4 @@ import { OutputTypes, normalizePath } from './utils'; | ||
export function normalizeOutputTarget(config, outputTarget) { | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: outputTarget.customElementsDir || 'components', outputType: outputTarget.outputType || OutputTypes.Component }); | ||
var _a, _b; | ||
const results = Object.assign(Object.assign({}, outputTarget), { excludeComponents: outputTarget.excludeComponents || [], valueAccessorConfigs: outputTarget.valueAccessorConfigs || [], customElementsDir: (_a = outputTarget.customElementsDir) !== null && _a !== void 0 ? _a : 'components', outputType: (_b = outputTarget.outputType) !== null && _b !== void 0 ? _b : OutputTypes.Standalone }); | ||
if (config.rootDir == null) { | ||
@@ -23,0 +24,0 @@ throw new Error('rootDir is not set and it should be set by stencil itself'); |
@@ -5,3 +5,3 @@ /** | ||
* - `scam` - Generate a Single Component Angular Module for each component. | ||
* - `standalone` - Generate a component with the `standalone` flag set to `true`. | ||
* - `standalone` - Generates standalone components. | ||
*/ | ||
@@ -28,3 +28,3 @@ export type OutputType = 'component' | 'scam' | 'standalone'; | ||
* - `scam` - Generate a Single Component Angular Module for each component. | ||
* - `standalone` - Generate a component with the `standalone` flag set to `true`. | ||
* - `standalone` - (default) Generates standalone components. | ||
*/ | ||
@@ -31,0 +31,0 @@ outputType?: OutputType; |
{ | ||
"name": "@stencil/angular-output-target", | ||
"version": "0.10.2", | ||
"version": "1.0.0", | ||
"description": "Angular output target for @stencil/core components.", | ||
@@ -42,3 +42,3 @@ "main": "dist/index.cjs.js", | ||
"type": "git", | ||
"url": "git+https://github.com/ionic-team/stencil-ds-output-targets.git" | ||
"url": "git+https://github.com/stenciljs/output-targets.git" | ||
}, | ||
@@ -49,3 +49,3 @@ "author": "Ionic Team", | ||
"bugs": { | ||
"url": "https://github.com/ionic-team/stencil-ds-output-targets/issues" | ||
"url": "https://github.com/stenciljs/output-targets/issues" | ||
}, | ||
@@ -55,2 +55,3 @@ "devDependencies": { | ||
"@angular/forms": "8.2.14", | ||
"@stencil/core": "4.32.0", | ||
"@types/node": "^18.0.0", | ||
@@ -57,0 +58,0 @@ "npm-run-all2": "^6.2.4", |
@@ -17,2 +17,9 @@ # @stencil/angular-output-target | ||
## Angular Support | ||
| **@stencil/angular-output-target** | **Angular** | | ||
|------------------------------------|-----------------| | ||
| 0.10.2 | v18.x and lower | | ||
| 1.0.0 | v19.x and above | | ||
## Usage | ||
@@ -19,0 +26,0 @@ |
@@ -10,3 +10,3 @@ import { Directive, ElementRef } from '@angular/core'; | ||
host: { | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)' | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])' | ||
}, | ||
@@ -13,0 +13,0 @@ providers: [ |
@@ -10,3 +10,3 @@ import { Directive, ElementRef } from '@angular/core'; | ||
host: { | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)' | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])' | ||
}, | ||
@@ -13,0 +13,0 @@ providers: [ |
@@ -10,3 +10,3 @@ import { Directive, ElementRef } from '@angular/core'; | ||
host: { | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)' | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])' | ||
}, | ||
@@ -13,0 +13,0 @@ providers: [ |
@@ -10,3 +10,3 @@ import { Directive, ElementRef } from '@angular/core'; | ||
host: { | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)' | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])' | ||
}, | ||
@@ -13,0 +13,0 @@ providers: [ |
@@ -10,3 +10,3 @@ import { Directive, ElementRef } from '@angular/core'; | ||
host: { | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target.<VALUE_ACCESSOR_TARGETATTR>)' | ||
'(<VALUE_ACCESSOR_EVENT>)': 'handleChangeEvent($event.target?.["<VALUE_ACCESSOR_TARGETATTR>"])' | ||
}, | ||
@@ -13,0 +13,0 @@ providers: [ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
111046
0.37%2132
0.14%0
-100%60
13.21%9
12.5%