chore: run updated prettier
This commit is contained in:
@@ -17,7 +17,7 @@ const triggerEvent = (type: string, el: Element) => {
|
||||
const withVModel = (node: VNode, arg: any, mods?: any) =>
|
||||
withDirectives(node, [[vModelDynamic, arg, '', mods]])
|
||||
|
||||
const setValue = function(this: any, value: any) {
|
||||
const setValue = function (this: any, value: any) {
|
||||
this.value = value
|
||||
}
|
||||
|
||||
|
||||
@@ -41,9 +41,9 @@ describe('runtime-dom: v-on directive', () => {
|
||||
})
|
||||
|
||||
test('it should support key modifiers and system modifiers', () => {
|
||||
const keyNames = ["ctrl","shift","meta","alt"]
|
||||
const keyNames = ['ctrl', 'shift', 'meta', 'alt']
|
||||
|
||||
keyNames.forEach(keyName=>{
|
||||
keyNames.forEach(keyName => {
|
||||
const el = document.createElement('div')
|
||||
const fn = jest.fn()
|
||||
// <div @keyup[keyName].esc="test"/>
|
||||
@@ -52,28 +52,28 @@ describe('runtime-dom: v-on directive', () => {
|
||||
'arrow-left'
|
||||
])
|
||||
patchEvent(el, 'onKeyup', null, nextValue, null)
|
||||
|
||||
|
||||
triggerEvent(el, 'keyup', e => (e.key = 'a'))
|
||||
expect(fn).not.toBeCalled()
|
||||
|
||||
|
||||
triggerEvent(el, 'keyup', e => {
|
||||
e[`${keyName}Key`] = false
|
||||
e.key = 'esc'
|
||||
})
|
||||
expect(fn).not.toBeCalled()
|
||||
|
||||
|
||||
triggerEvent(el, 'keyup', e => {
|
||||
e[`${keyName}Key`] = true
|
||||
e.key = 'Escape'
|
||||
})
|
||||
expect(fn).toBeCalledTimes(1)
|
||||
|
||||
|
||||
triggerEvent(el, 'keyup', e => {
|
||||
e[`${keyName}Key`] = true
|
||||
e.key = 'ArrowLeft'
|
||||
})
|
||||
expect(fn).toBeCalledTimes(2)
|
||||
});
|
||||
})
|
||||
})
|
||||
|
||||
test('it should support "exact" modifier', () => {
|
||||
@@ -114,9 +114,11 @@ describe('runtime-dom: v-on directive', () => {
|
||||
const fn = jest.fn()
|
||||
const handler = withModifiers(fn, [button])
|
||||
patchEvent(el, 'onMousedown', null, handler, null)
|
||||
buttons.filter(b => b !== button).forEach(button => {
|
||||
triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
|
||||
})
|
||||
buttons
|
||||
.filter(b => b !== button)
|
||||
.forEach(button => {
|
||||
triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
|
||||
})
|
||||
expect(fn).not.toBeCalled()
|
||||
triggerEvent(el, 'mousedown', e => (e.button = buttonCodes[button]))
|
||||
expect(fn).toBeCalled()
|
||||
|
||||
@@ -155,10 +155,8 @@ describe('useCssVars', () => {
|
||||
setup() {
|
||||
useCssVars(() => state)
|
||||
return () =>
|
||||
h(
|
||||
Child,
|
||||
null,
|
||||
() => (value.value ? [h('div')] : [h('div'), h('div')])
|
||||
h(Child, null, () =>
|
||||
value.value ? [h('div')] : [h('div'), h('div')]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -157,9 +157,9 @@ export const defineSSRCustomElement = ((options: any) => {
|
||||
return defineCustomElement(options, hydrate)
|
||||
}) as typeof defineCustomElement
|
||||
|
||||
const BaseClass = (typeof HTMLElement !== 'undefined'
|
||||
? HTMLElement
|
||||
: class {}) as typeof HTMLElement
|
||||
const BaseClass = (
|
||||
typeof HTMLElement !== 'undefined' ? HTMLElement : class {}
|
||||
) as typeof HTMLElement
|
||||
|
||||
export class VueElement extends BaseClass {
|
||||
/**
|
||||
|
||||
@@ -69,11 +69,12 @@ const DOMTransitionPropsValidators = {
|
||||
leaveToClass: String
|
||||
}
|
||||
|
||||
export const TransitionPropsValidators = (Transition.props = /*#__PURE__*/ extend(
|
||||
{},
|
||||
(BaseTransition as any).props,
|
||||
DOMTransitionPropsValidators
|
||||
))
|
||||
export const TransitionPropsValidators = (Transition.props =
|
||||
/*#__PURE__*/ extend(
|
||||
{},
|
||||
(BaseTransition as any).props,
|
||||
DOMTransitionPropsValidators
|
||||
))
|
||||
|
||||
/**
|
||||
* #3227 Incoming hooks may be merged into arrays when wrapping Transition
|
||||
|
||||
@@ -159,7 +159,7 @@ if (__COMPAT__) {
|
||||
const removeMode = (props: any) => delete props.mode
|
||||
/*#__PURE__*/ removeMode(TransitionGroupImpl.props)
|
||||
|
||||
export const TransitionGroup = (TransitionGroupImpl as unknown) as {
|
||||
export const TransitionGroup = TransitionGroupImpl as unknown as {
|
||||
new (): {
|
||||
$props: TransitionGroupProps
|
||||
}
|
||||
@@ -210,9 +210,9 @@ function hasCSSTransform(
|
||||
}
|
||||
moveClass.split(/\s+/).forEach(c => c && clone.classList.add(c))
|
||||
clone.style.display = 'none'
|
||||
const container = (root.nodeType === 1
|
||||
? root
|
||||
: root.parentNode) as HTMLElement
|
||||
const container = (
|
||||
root.nodeType === 1 ? root : root.parentNode
|
||||
) as HTMLElement
|
||||
container.appendChild(clone)
|
||||
const { hasTransform } = getTransitionInfo(clone)
|
||||
container.removeChild(clone)
|
||||
|
||||
@@ -181,9 +181,8 @@ export const vModelSelect: ModelDirective<HTMLSelectElement> = {
|
||||
addEventListener(el, 'change', () => {
|
||||
const selectedVal = Array.prototype.filter
|
||||
.call(el.options, (o: HTMLOptionElement) => o.selected)
|
||||
.map(
|
||||
(o: HTMLOptionElement) =>
|
||||
number ? toNumber(getValue(o)) : getValue(o)
|
||||
.map((o: HTMLOptionElement) =>
|
||||
number ? toNumber(getValue(o)) : getValue(o)
|
||||
)
|
||||
el._assign(
|
||||
el.multiple
|
||||
|
||||
@@ -66,7 +66,7 @@ export const withKeys = (fn: Function, modifiers: string[]) => {
|
||||
compatUtils.isCompatEnabled(DeprecationTypes.CONFIG_KEY_CODES, instance)
|
||||
) {
|
||||
if (instance) {
|
||||
globalKeyCodes = ((instance.appContext.config as any) as LegacyConfig)
|
||||
globalKeyCodes = (instance.appContext.config as any as LegacyConfig)
|
||||
.keyCodes
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,8 @@ export function compatCoerceAttr(
|
||||
value === null
|
||||
? 'false'
|
||||
: typeof value !== 'boolean' && value !== undefined
|
||||
? 'true'
|
||||
: null
|
||||
? 'true'
|
||||
: null
|
||||
if (
|
||||
v2CocercedValue &&
|
||||
compatUtils.softAssertCompatEnabled(
|
||||
|
||||
@@ -8,9 +8,8 @@ export function patchClass(el: Element, value: string | null, isSVG: boolean) {
|
||||
// classes into account.
|
||||
const transitionClasses = (el as ElementWithTransition)._vtc
|
||||
if (transitionClasses) {
|
||||
value = (value
|
||||
? [value, ...transitionClasses]
|
||||
: [...transitionClasses]
|
||||
value = (
|
||||
value ? [value, ...transitionClasses] : [...transitionClasses]
|
||||
).join(' ')
|
||||
}
|
||||
if (value == null) {
|
||||
|
||||
@@ -37,8 +37,8 @@ export const patchProp: DOMRendererOptions['patchProp'] = (
|
||||
key[0] === '.'
|
||||
? ((key = key.slice(1)), true)
|
||||
: key[0] === '^'
|
||||
? ((key = key.slice(1)), false)
|
||||
: shouldSetAsProp(el, key, nextValue, isSVG)
|
||||
? ((key = key.slice(1)), false)
|
||||
: shouldSetAsProp(el, key, nextValue, isSVG)
|
||||
) {
|
||||
patchDOMProp(
|
||||
el,
|
||||
|
||||
Reference in New Issue
Block a user