@stencil/vue-output-target
Advanced tools
Comparing version 0.8.1-dev.1680184182 to 0.8.1-dev.11690825475.1243803f
@@ -14,3 +14,3 @@ import { dashToPascalCase } from './utils'; | ||
const findModel = componentModelConfig && componentModelConfig.find((config) => config.elements.includes(cmpMeta.tagName)); | ||
const modelType = findModel !== undefined ? `, ${componentType}.${findModel.targetAttr}` : ''; | ||
const modelType = findModel !== undefined ? `, ${componentType}["${findModel.targetAttr}"]` : ''; | ||
let templateString = ` | ||
@@ -24,3 +24,3 @@ export const ${tagNameAsPascal} = /*@__PURE__*/ defineContainer<${componentType}${modelType}>('${cmpMeta.tagName}', ${importAs}`; | ||
* If there are no props, | ||
* but but v-model is still used, | ||
* but v-model is still used, | ||
* make sure we pass in an empty array | ||
@@ -27,0 +27,0 @@ * otherwise all of the defineContainer properties |
@@ -102,3 +102,3 @@ 'use strict'; | ||
const findModel = componentModelConfig && componentModelConfig.find((config) => config.elements.includes(cmpMeta.tagName)); | ||
const modelType = findModel !== undefined ? `, ${componentType}.${findModel.targetAttr}` : ''; | ||
const modelType = findModel !== undefined ? `, ${componentType}["${findModel.targetAttr}"]` : ''; | ||
let templateString = ` | ||
@@ -112,3 +112,3 @@ export const ${tagNameAsPascal} = /*@__PURE__*/ defineContainer<${componentType}${modelType}>('${cmpMeta.tagName}', ${importAs}`; | ||
* If there are no props, | ||
* but but v-model is still used, | ||
* but v-model is still used, | ||
* make sure we pass in an empty array | ||
@@ -115,0 +115,0 @@ * otherwise all of the defineContainer properties |
@@ -93,3 +93,3 @@ import path from 'path'; | ||
const findModel = componentModelConfig && componentModelConfig.find((config) => config.elements.includes(cmpMeta.tagName)); | ||
const modelType = findModel !== undefined ? `, ${componentType}.${findModel.targetAttr}` : ''; | ||
const modelType = findModel !== undefined ? `, ${componentType}["${findModel.targetAttr}"]` : ''; | ||
let templateString = ` | ||
@@ -103,3 +103,3 @@ export const ${tagNameAsPascal} = /*@__PURE__*/ defineContainer<${componentType}${modelType}>('${cmpMeta.tagName}', ${importAs}`; | ||
* If there are no props, | ||
* but but v-model is still used, | ||
* but v-model is still used, | ||
* make sure we pass in an empty array | ||
@@ -106,0 +106,0 @@ * otherwise all of the defineContainer properties |
{ | ||
"name": "@stencil/vue-output-target", | ||
"version": "0.8.1-dev.1680184182", | ||
"version": "0.8.1-dev.11690825475.1243803f", | ||
"description": "Vue output target for @stencil/core components.", | ||
@@ -39,3 +39,3 @@ "main": "dist/index.cjs.js", | ||
"peerDependencies": { | ||
"@stencil/core": "^2.9.0 || ^3.0.0" | ||
"@stencil/core": ">=2.0.0 || >=3 || >= 4.0.0-beta.0 || >= 4.0.0" | ||
}, | ||
@@ -56,3 +56,6 @@ "jest": { | ||
}, | ||
"gitHead": "a3588e905186a0e86e7f88418fd5b2f9531b55e0" | ||
"gitHead": "243803f02d0675190181da7ed8ad6ff432c3ee1d", | ||
"volta": { | ||
"extends": "../../package.json" | ||
} | ||
} |
@@ -0,1 +1,3 @@ | ||
// @ts-nocheck | ||
// It's easier and safer for Volar to disable typechecking and let the return type inference do its job. | ||
import { VNode, defineComponent, getCurrentInstance, h, inject, ref, Ref } from 'vue'; | ||
@@ -57,3 +59,3 @@ | ||
*/ | ||
export const defineContainer = <Props, VModelType = any>( | ||
export const defineContainer = <Props, VModelType = string | number | boolean>( | ||
name: string, | ||
@@ -76,3 +78,3 @@ defineCustomElement: any, | ||
const Container = defineComponent<Props & InputProps<VModelType>>((props: any, { attrs, slots, emit }) => { | ||
const Container = defineComponent<Props & InputProps<VModelType>>((props, { attrs, slots, emit }) => { | ||
let modelPropValue = props[modelProp]; | ||
@@ -189,15 +191,17 @@ const containerRef = ref<HTMLElement>(); | ||
Container.displayName = name; | ||
if (typeof Container !== 'function') { | ||
Container.name = name; | ||
Container.props = { | ||
[ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP, | ||
}; | ||
Container.props = { | ||
[ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP, | ||
}; | ||
componentProps.forEach((componentProp) => { | ||
Container.props[componentProp] = DEFAULT_EMPTY_PROP; | ||
}); | ||
componentProps.forEach((componentProp) => { | ||
Container.props[componentProp] = DEFAULT_EMPTY_PROP; | ||
}); | ||
if (modelProp) { | ||
Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP; | ||
Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent]; | ||
if (modelProp) { | ||
Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP; | ||
Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent]; | ||
} | ||
} | ||
@@ -204,0 +208,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55247
998