Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@fastkit/vue-utils

Package Overview
Dependencies
Maintainers
1
Versions
218
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastkit/vue-utils - npm Package Compare versions

Comparing version 0.6.15 to 0.6.16

30

dist/vue-utils.cjs.js

@@ -12,14 +12,2 @@ 'use strict';

/**
* 以下がリリースされるまでのお茶濁し
*
* {@link https://github.com/vuejs/vue-next/pull/2164}
*/
function createEmitDefine(options) {
return {
props: undefined,
emits: options,
};
}
const rawNumberPropType = [String, Number];

@@ -120,5 +108,5 @@ function rawNumberProp(defaultValue) {

const navigationableEmits = createEmitDefine({
const navigationableEmits = {
click: (ev) => true,
});
};
const navigationableProps = {

@@ -147,5 +135,5 @@ tag: String,

type: String,
...navigationableEmits.props,
};
function useNavigationable(props, fallbackTag) {
function useNavigationable(props, fallbackTag, setupContext) {
const onClick = setupContext && setupContext.attrs.onClick;
const ctx = vue.computed(() => {

@@ -161,3 +149,5 @@ const _fallbackTag = typeof fallbackTag === 'function' ? fallbackTag() : fallbackTag;

};
let clickable = false;
if (to) {
clickable = true;
Tag = vueRouter.RouterLink;

@@ -172,2 +162,3 @@ attrs.to = to;

else if (href) {
clickable = true;
Tag = tag || 'a';

@@ -187,2 +178,5 @@ attrs.href = href;

}
if (Tag === 'a' || Tag === 'button' || typeof onClick === 'function') {
clickable = true;
}
}

@@ -198,6 +192,7 @@ if (!attrs.disabled) {

}
const clickable = Tag !== _fallbackTag;
// const clickable = Tag !== _fallbackTag || typeof onClick === 'function';
return {
Tag,
attrs,
clickable,
classes: clickable ? ['clickable'] : [],

@@ -658,3 +653,2 @@ };

exports.clickOutsideDirectiveArgument = clickOutsideDirectiveArgument;
exports.createEmitDefine = createEmitDefine;
exports.createJavaScriptTransition = createJavaScriptTransition;

@@ -661,0 +655,0 @@ exports.createPropsOptions = createPropsOptions;

@@ -12,14 +12,2 @@ 'use strict';

/**
* 以下がリリースされるまでのお茶濁し
*
* {@link https://github.com/vuejs/vue-next/pull/2164}
*/
function createEmitDefine(options) {
return {
props: undefined,
emits: options,
};
}
const rawNumberPropType = [String, Number];

@@ -120,5 +108,5 @@ function rawNumberProp(defaultValue) {

const navigationableEmits = createEmitDefine({
const navigationableEmits = {
click: (ev) => true,
});
};
const navigationableProps = {

@@ -147,5 +135,5 @@ tag: String,

type: String,
...navigationableEmits.props,
};
function useNavigationable(props, fallbackTag) {
function useNavigationable(props, fallbackTag, setupContext) {
const onClick = setupContext && setupContext.attrs.onClick;
const ctx = vue.computed(() => {

@@ -161,3 +149,5 @@ const _fallbackTag = typeof fallbackTag === 'function' ? fallbackTag() : fallbackTag;

};
let clickable = false;
if (to) {
clickable = true;
Tag = vueRouter.RouterLink;

@@ -172,2 +162,3 @@ attrs.to = to;

else if (href) {
clickable = true;
Tag = tag || 'a';

@@ -187,2 +178,5 @@ attrs.href = href;

}
if (Tag === 'a' || Tag === 'button' || typeof onClick === 'function') {
clickable = true;
}
}

@@ -198,6 +192,7 @@ if (!attrs.disabled) {

}
const clickable = Tag !== _fallbackTag;
// const clickable = Tag !== _fallbackTag || typeof onClick === 'function';
return {
Tag,
attrs,
clickable,
classes: clickable ? ['clickable'] : [],

@@ -658,3 +653,2 @@ };

exports.clickOutsideDirectiveArgument = clickOutsideDirectiveArgument;
exports.createEmitDefine = createEmitDefine;
exports.createJavaScriptTransition = createJavaScriptTransition;

@@ -661,0 +655,0 @@ exports.createPropsOptions = createPropsOptions;

59

dist/vue-utils.d.ts

@@ -19,4 +19,4 @@ import { BaseTransitionProps } from 'vue';

import { Prop } from '@vue/runtime-core';
import { PropType } from 'vue';
import { PropType as PropType_2 } from '@vue/runtime-core';
import { PropType } from '@vue/runtime-core';
import { PropType as PropType_2 } from 'vue';
import { RawKBSettings } from '@fastkit/keybord';

@@ -57,3 +57,3 @@ import type { RouteComponent } from 'vue-router';

export declare const BooleanishPropOption: {
type: PropType_2<Booleanish>;
type: PropType<Booleanish>;
default: boolean;

@@ -90,12 +90,2 @@ };

/**
* 以下がリリースされるまでのお茶濁し
*
* {@link https://github.com/vuejs/vue-next/pull/2164}
*/
export declare function createEmitDefine<Options = EmitsOptions>(options: Options): {
props: ExtractEmitEvents<Options>;
emits: Options;
};
export declare function createJavaScriptTransition<CustomProps extends Readonly<ComponentPropsOptions_2> = {}>(opts: JavaScriptTransitionOptions<CustomProps>): JavaScriptTransition<CustomProps>;

@@ -108,7 +98,5 @@

export declare function defineSlotsProps<R extends RawSlotsSettings>(): {
'v-slots': PropType<ResolveRawSlots<R>>;
'v-slots': PropType_2<ResolveRawSlots<R>>;
};
declare type EmitsOptions = ObjectEmitsOptions | string[];
export declare type ExtractComponentPropTypes<C extends {

@@ -118,10 +106,2 @@ setup?: DefineComponent<any>['setup'];

declare type ExtractEmitEvents<T> = T extends Readonly<Array<infer V>> ? {
[K in V & string as `on${Capitalize<K>}`]: PropType<(...args: any[]) => void>;
} : T extends any[] ? {
[K in T & string as `on${Capitalize<K>}`]: PropType<(...args: any[]) => void>;
} : {} extends T ? {} : {
[K in keyof T & string as `on${Capitalize<K>}`]: T[K] extends (...args: infer Args) => any ? PropType<(...args: Args) => void> : PropType<(...args: any[]) => void>;
};
export declare type ExtractPropInput<O> = O extends object ? {

@@ -213,17 +193,12 @@ [K in RequiredKeys<O>]: InferPropType<O[K]>;

classes: string[];
clickable: boolean;
}
export declare const navigationableEmits: {
props: {
onClick: PropType<(ev: MouseEvent) => void>;
};
emits: {
click: (ev: MouseEvent) => true;
};
click: (ev: MouseEvent) => boolean;
};
export declare const navigationableProps: {
readonly onClick: PropType<(ev: MouseEvent) => void>;
readonly tag: StringConstructor;
readonly to: PropType<RouteLocationRaw>;
readonly to: PropType_2<RouteLocationRaw>;
readonly replace: BooleanConstructor;

@@ -234,3 +209,3 @@ readonly activeClass: StringConstructor;

readonly ariaCurrentValue: {
readonly type: PropType<"page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined>;
readonly type: PropType_2<"page" | "step" | "location" | "date" | "time" | "true" | "false" | undefined>;
readonly default: "page";

@@ -245,7 +220,7 @@ };

readonly hreflang: StringConstructor;
readonly download: PropType<string | boolean>;
readonly download: PropType_2<string | boolean>;
readonly media: StringConstructor;
readonly ping: StringConstructor;
readonly referrerpolicy: StringConstructor;
readonly type: PropType<"submit" | "reset" | "button" | undefined>;
readonly type: PropType_2<"submit" | "reset" | "button" | undefined>;
};

@@ -258,7 +233,5 @@

export declare const NumberishPropOption: {
type: PropType_2<Numberish>;
type: PropType<Numberish>;
};
declare type ObjectEmitsOptions = Record<string, ((...args: any[]) => any) | null>;
declare type OptionalKeys<T> = Exclude<keyof T, RequiredKeys<T>>;

@@ -269,6 +242,6 @@

export declare type RawNumberProp<D extends number | string | undefined = undefined> = D extends undefined ? {
type: PropType_2<string | number>;
type: PropType<string | number>;
required: true;
} : {
type: PropType_2<string | number>;
type: PropType<string | number>;
default: string | number;

@@ -279,3 +252,3 @@ };

export declare const rawNumberPropType: PropType_2<string | number>;
export declare const rawNumberPropType: PropType<string | number>;

@@ -383,3 +356,3 @@ export declare type RawResizeDirectiveBindingValue = ResizeDirectiveHandler | ResizeDirectiveBindingValue;

export declare function useNavigationable(props: ExtractPropTypes<typeof navigationableProps>, fallbackTag?: string | (() => string | undefined)): ComputedRef<NavigationableContext>;
export declare function useNavigationable(props: ExtractPropTypes<typeof navigationableProps>, fallbackTag?: string | (() => string | undefined), setupContext?: SetupContext): ComputedRef<NavigationableContext>;

@@ -410,3 +383,3 @@ export declare function useVisibility(opts?: UseVisibilityOptions): UseVisibilityRef;

expand: {
type: PropType<"width" | "height">;
type: PropType_2<"width" | "height">;
default: "height";

@@ -413,0 +386,0 @@ };

@@ -8,14 +8,2 @@ import { Comment, Text, computed, BaseTransition, h, Transition, onBeforeMount, onBeforeUnmount, reactive } from 'vue';

/**
* 以下がリリースされるまでのお茶濁し
*
* {@link https://github.com/vuejs/vue-next/pull/2164}
*/
function createEmitDefine(options) {
return {
props: undefined,
emits: options,
};
}
const rawNumberPropType = [String, Number];

@@ -116,5 +104,5 @@ function rawNumberProp(defaultValue) {

const navigationableEmits = createEmitDefine({
const navigationableEmits = {
click: (ev) => true,
});
};
const navigationableProps = {

@@ -143,5 +131,5 @@ tag: String,

type: String,
...navigationableEmits.props,
};
function useNavigationable(props, fallbackTag) {
function useNavigationable(props, fallbackTag, setupContext) {
const onClick = setupContext && setupContext.attrs.onClick;
const ctx = computed(() => {

@@ -157,3 +145,5 @@ const _fallbackTag = typeof fallbackTag === 'function' ? fallbackTag() : fallbackTag;

};
let clickable = false;
if (to) {
clickable = true;
Tag = RouterLink;

@@ -168,2 +158,3 @@ attrs.to = to;

else if (href) {
clickable = true;
Tag = tag || 'a';

@@ -183,2 +174,5 @@ attrs.href = href;

}
if (Tag === 'a' || Tag === 'button' || typeof onClick === 'function') {
clickable = true;
}
}

@@ -194,6 +188,7 @@ if (!attrs.disabled) {

}
const clickable = Tag !== _fallbackTag;
// const clickable = Tag !== _fallbackTag || typeof onClick === 'function';
return {
Tag,
attrs,
clickable,
classes: clickable ? ['clickable'] : [],

@@ -643,2 +638,2 @@ };

export { BODY_SCROLL_LOCK_ATTRIBUTE, BODY_SCROLL_LOCK_SCROLLER_ATTRIBUTE, BooleanishPropOption, ClickOutsideDirectiveElementSymbol, NumberishPropOption, VExpandTransition, bodyScrollLockDirective, bodyScrollLockDirectiveArgument, cleanupEmptyVNodeChild, clickOutsideDirective, clickOutsideDirectiveArgument, createEmitDefine, createJavaScriptTransition, createPropsOptions, defineSlotsProps, extractRouteMatchedItems, findVNodeChild, getRouteMatchedComponents, navigationableEmits, navigationableProps, rawNumberProp, rawNumberPropType, renderSlotOrEmpty, resizeDirective, resizeDirectiveArgument, resolveBooleanish, resolveNumberish, resolveVNodeChildOrSlot, resolveVNodeChildOrSlots, state$1 as state, useKeybord, useNavigationable, useVisibility, useWindow };
export { BODY_SCROLL_LOCK_ATTRIBUTE, BODY_SCROLL_LOCK_SCROLLER_ATTRIBUTE, BooleanishPropOption, ClickOutsideDirectiveElementSymbol, NumberishPropOption, VExpandTransition, bodyScrollLockDirective, bodyScrollLockDirectiveArgument, cleanupEmptyVNodeChild, clickOutsideDirective, clickOutsideDirectiveArgument, createJavaScriptTransition, createPropsOptions, defineSlotsProps, extractRouteMatchedItems, findVNodeChild, getRouteMatchedComponents, navigationableEmits, navigationableProps, rawNumberProp, rawNumberPropType, renderSlotOrEmpty, resizeDirective, resizeDirectiveArgument, resolveBooleanish, resolveNumberish, resolveVNodeChildOrSlot, resolveVNodeChildOrSlots, state$1 as state, useKeybord, useNavigationable, useVisibility, useWindow };
{
"name": "@fastkit/vue-utils",
"version": "0.6.15",
"version": "0.6.16",
"description": "@fastkit/vue-utils",

@@ -34,7 +34,7 @@ "buildOptions": {

"dependencies": {
"@fastkit/body-scroll-lock": "0.6.15",
"@fastkit/visibility": "0.6.15",
"@fastkit/keybord": "0.6.15",
"@fastkit/helpers": "0.6.15"
"@fastkit/body-scroll-lock": "0.6.16",
"@fastkit/visibility": "0.6.16",
"@fastkit/keybord": "0.6.16",
"@fastkit/helpers": "0.6.16"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc