init component
This commit is contained in:
1
node_modules/buetify/lib/composables/message/index.d.ts
generated
vendored
Executable file
1
node_modules/buetify/lib/composables/message/index.d.ts
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
export * from './useMessage';
|
||||
2
node_modules/buetify/lib/composables/message/index.js
generated
vendored
Executable file
2
node_modules/buetify/lib/composables/message/index.js
generated
vendored
Executable file
@@ -0,0 +1,2 @@
|
||||
export * from './useMessage';
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/buetify/lib/composables/message/index.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/composables/message/index.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/composables/message/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAd","sourcesContent":["export * from './useMessage';\n"],"sourceRoot":"","file":"index.js"}
|
||||
126
node_modules/buetify/lib/composables/message/useMessage.d.ts
generated
vendored
Executable file
126
node_modules/buetify/lib/composables/message/useMessage.d.ts
generated
vendored
Executable file
@@ -0,0 +1,126 @@
|
||||
import { PropType, ExtractPropTypes, ComponentOptions, FunctionalComponent } from 'vue';
|
||||
import { AllColorsVariant } from '../../types/ColorVariants';
|
||||
export declare type MessageSize = 'is-small' | 'is-medium' | 'is-large' | '';
|
||||
export declare type MessageIcons = {
|
||||
[K in AllColorsVariant]: ComponentOptions | FunctionalComponent;
|
||||
};
|
||||
export declare function getMessageIcons(icons: Partial<MessageIcons>): {
|
||||
""?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-black-ter"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-orange"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-primary"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-info"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-link"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-success"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-warning"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-danger"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-white"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-black"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-light"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-dark"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-black-bis"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-grey-darker"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-grey-dark"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-grey"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-grey-light"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-grey-lighter"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-white-ter"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
"is-white-bis"?: FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined;
|
||||
};
|
||||
export declare const UseMessagePropsDefinition: {
|
||||
title: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
isClosable: {
|
||||
type: BooleanConstructor;
|
||||
default: boolean;
|
||||
};
|
||||
message: {
|
||||
type: PropType<string>;
|
||||
};
|
||||
variant: {
|
||||
type: PropType<AllColorsVariant>;
|
||||
default: "";
|
||||
};
|
||||
size: {
|
||||
type: PropType<import("../..").SizeVariant>;
|
||||
default: "";
|
||||
};
|
||||
iconSize: {
|
||||
type: PropType<import("../..").SizeVariant>;
|
||||
default: "";
|
||||
};
|
||||
useAutoClose: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
duration: {
|
||||
type: PropType<number>;
|
||||
default: number;
|
||||
};
|
||||
useIcon: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
icons: {
|
||||
type: PropType<Partial<MessageIcons>>;
|
||||
default: import("fp-ts/lib/function").Lazy<Partial<MessageIcons>>;
|
||||
};
|
||||
icon: {
|
||||
type: PropType<FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any>>;
|
||||
};
|
||||
onToggle: {
|
||||
type: PropType<import("fp-ts/lib/function").FunctionN<[boolean], void>>;
|
||||
required: false;
|
||||
};
|
||||
onSetOn: {
|
||||
type: PropType<import("fp-ts/lib/IO").IO<void>>;
|
||||
required: false;
|
||||
};
|
||||
onSetOff: {
|
||||
type: PropType<import("fp-ts/lib/IO").IO<void>>;
|
||||
required: false;
|
||||
};
|
||||
isActive: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
hasPopup: {
|
||||
type: PropType<boolean>;
|
||||
default: boolean;
|
||||
};
|
||||
};
|
||||
export declare type UseMessageProps = ExtractPropTypes<typeof UseMessagePropsDefinition>;
|
||||
export declare function useMessage(props: UseMessageProps): {
|
||||
icon: import("vue").ComputedRef<FunctionalComponent<{}, {}> | ComponentOptions<{}, any, any, any, any, any, any, any> | undefined>;
|
||||
iconSize: import("vue").ComputedRef<"is-small" | "is-medium" | "is-large">;
|
||||
setAutoClose: () => void;
|
||||
isOn: import("vue").WritableComputedRef<boolean>;
|
||||
isOff: import("vue").ComputedRef<boolean>;
|
||||
attrs: import("vue").ComputedRef<{
|
||||
'aria-haspopup'?: boolean;
|
||||
tabindex: number;
|
||||
role: string;
|
||||
type: string;
|
||||
'aria-pressed': boolean;
|
||||
'aria-expanded': boolean;
|
||||
}>;
|
||||
listeners: {
|
||||
onClick: import("fp-ts/lib/IO").IO<void>;
|
||||
onKeydown: (e: KeyboardEvent) => void;
|
||||
};
|
||||
props: import("vue").ComputedRef<{
|
||||
onClick: import("fp-ts/lib/IO").IO<void>;
|
||||
onKeydown: (e: KeyboardEvent) => void;
|
||||
'aria-haspopup'?: boolean;
|
||||
tabindex: number;
|
||||
role: string;
|
||||
type: string;
|
||||
'aria-pressed': boolean;
|
||||
'aria-expanded': boolean;
|
||||
}>;
|
||||
setOn: (e?: Event | undefined) => void;
|
||||
setOff: (e?: Event | undefined) => void;
|
||||
toggle: (e?: Event | undefined) => void;
|
||||
};
|
||||
export declare type Message = ReturnType<typeof useMessage>;
|
||||
79
node_modules/buetify/lib/composables/message/useMessage.js
generated
vendored
Executable file
79
node_modules/buetify/lib/composables/message/useMessage.js
generated
vendored
Executable file
@@ -0,0 +1,79 @@
|
||||
import { constant } from 'fp-ts/lib/function';
|
||||
import { defineAsyncComponent, computed } from 'vue';
|
||||
import { getUseTogglePropsDefinition, useToggle } from '../toggle';
|
||||
const DEFAULT_MESSAGE_ICONS = {
|
||||
'is-info': defineAsyncComponent(() => import('../../components/icons/infoCircle')),
|
||||
'is-success': defineAsyncComponent(() => import('../../components/icons/checkCircle')),
|
||||
'is-warning': defineAsyncComponent(() => import('../../components/icons/exclamationTriangle')),
|
||||
'is-danger': defineAsyncComponent(() => import('../../components/icons/exclamationCircle'))
|
||||
};
|
||||
export function getMessageIcons(icons) {
|
||||
return { ...DEFAULT_MESSAGE_ICONS,
|
||||
...icons
|
||||
};
|
||||
}
|
||||
export const UseMessagePropsDefinition = { ...getUseTogglePropsDefinition('isActive', true),
|
||||
title: {
|
||||
type: String
|
||||
},
|
||||
isClosable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
message: {
|
||||
type: String
|
||||
},
|
||||
variant: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
iconSize: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
useAutoClose: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
duration: {
|
||||
type: Number,
|
||||
default: 2000
|
||||
},
|
||||
useIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
icons: {
|
||||
type: Object,
|
||||
default: constant(DEFAULT_MESSAGE_ICONS)
|
||||
},
|
||||
icon: {
|
||||
type: [Object, Function]
|
||||
}
|
||||
};
|
||||
export function useMessage(props) {
|
||||
const toggle = useToggle(props, 'isActive');
|
||||
const icon = computed(() => props.icon ?? props.icons[props.variant]);
|
||||
const iconSize = computed(() => props.iconSize || props.size || 'is-large');
|
||||
|
||||
function setAutoClose() {
|
||||
if (props.useAutoClose) {
|
||||
setTimeout(() => {
|
||||
if (toggle.isOn.value) {
|
||||
toggle.setOff();
|
||||
}
|
||||
}, props.duration);
|
||||
}
|
||||
}
|
||||
|
||||
return { ...toggle,
|
||||
icon,
|
||||
iconSize,
|
||||
setAutoClose
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=useMessage.js.map
|
||||
1
node_modules/buetify/lib/composables/message/useMessage.js.map
generated
vendored
Executable file
1
node_modules/buetify/lib/composables/message/useMessage.js.map
generated
vendored
Executable file
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/composables/message/useMessage.ts"],"names":[],"mappings":"AAAA,SAAS,QAAT,QAAyB,oBAAzB;AACA,SAAS,oBAAT,EAAkG,QAAlG,QAAkH,KAAlH;AAEA,SAAS,2BAAT,EAAsC,SAAtC,QAAuD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;AAoCvC,EAAA,KAAK,EAAE;AACL,IAAA,IAAI,EAAE,MADD;AAEL,IAAA,OAAO,EAAE,QAAQ,CAAC,qBAAD;AAFZ,GApCgC;AAwCvC,EAAA,IAAI,EAAE;AACJ,IAAA,IAAI,EAAE,CAAC,MAAD,EAAS,QAAT;AADF;AAxCiC,CAAlC;AA+CP,OAAM,SAAU,UAAV,CAAqB,KAArB,EAA2C;AAC/C,QAAM,MAAM,GAAG,SAAS,CAAC,KAAD,EAAQ,UAAR,CAAxB;AACA,QAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAN,IAAc,KAAK,CAAC,KAAN,CAAY,KAAK,CAAC,OAAlB,CAArB,CAArB;AACA,QAAM,QAAQ,GAAG,QAAQ,CAAC,MAAM,KAAK,CAAC,QAAN,IAAkB,KAAK,CAAC,IAAxB,IAAgC,UAAvC,CAAzB;;AACA,WAAS,YAAT,GAAqB;AACnB,QAAI,KAAK,CAAC,YAAV,EAAwB;AACtB,MAAA,UAAU,CAAC,MAAK;AACd,YAAI,MAAM,CAAC,IAAP,CAAY,KAAhB,EAAuB;AACrB,UAAA,MAAM,CAAC,MAAP;AACD;AACF,OAJS,EAIP,KAAK,CAAC,QAJC,CAAV;AAKD;AACF;;AACD,SAAO,EACL,GAAG,MADE;AAEL,IAAA,IAFK;AAGL,IAAA,QAHK;AAIL,IAAA;AAJK,GAAP;AAMD","sourcesContent":["import { constant } from 'fp-ts/lib/function';\nimport { defineAsyncComponent, PropType, ExtractPropTypes, ComponentOptions, FunctionalComponent, computed } from 'vue';\nimport { AllColorsVariant } from '../../types/ColorVariants';\nimport { getUseTogglePropsDefinition, useToggle } from '../toggle';\n\nexport type MessageSize = 'is-small' | 'is-medium' | 'is-large' | '';\n\nexport type MessageIcons = {\n [K in AllColorsVariant]: ComponentOptions | FunctionalComponent;\n};\n\nconst DEFAULT_MESSAGE_ICONS: Partial<MessageIcons> = {\n 'is-info': defineAsyncComponent(() => import('../../components/icons/infoCircle')),\n 'is-success': defineAsyncComponent(() => import('../../components/icons/checkCircle')),\n 'is-warning': defineAsyncComponent(() => import('../../components/icons/exclamationTriangle')),\n 'is-danger': defineAsyncComponent(() => import('../../components/icons/exclamationCircle'))\n};\n\nexport function getMessageIcons(icons: Partial<MessageIcons>) {\n return {\n ...DEFAULT_MESSAGE_ICONS,\n ...icons\n };\n}\n\nexport const UseMessagePropsDefinition = {\n ...getUseTogglePropsDefinition('isActive', true),\n title: {\n type: String as PropType<string>\n },\n isClosable: {\n type: Boolean,\n default: true\n },\n message: {\n type: String as PropType<string>\n },\n variant: {\n type: String as PropType<AllColorsVariant>,\n default: '' as const\n },\n size: {\n type: String as PropType<MessageSize>,\n default: '' as const\n },\n iconSize: {\n type: String as PropType<MessageSize>,\n default: '' as const\n },\n useAutoClose: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n duration: {\n type: Number as PropType<number>,\n default: 2000\n },\n useIcon: {\n type: Boolean as PropType<boolean>,\n default: false\n },\n icons: {\n type: Object as PropType<Partial<MessageIcons>>,\n default: constant(DEFAULT_MESSAGE_ICONS)\n },\n icon: {\n type: [Object, Function] as PropType<ComponentOptions | FunctionalComponent>\n }\n};\n\nexport type UseMessageProps = ExtractPropTypes<typeof UseMessagePropsDefinition>;\n\nexport function useMessage(props: UseMessageProps) {\n const toggle = useToggle(props, 'isActive');\n const icon = computed(() => props.icon ?? props.icons[props.variant]);\n const iconSize = computed(() => props.iconSize || props.size || 'is-large');\n function setAutoClose() {\n if (props.useAutoClose) {\n setTimeout(() => {\n if (toggle.isOn.value) {\n toggle.setOff();\n }\n }, props.duration);\n }\n }\n return {\n ...toggle,\n icon,\n iconSize,\n setAutoClose\n };\n}\n\nexport type Message = ReturnType<typeof useMessage>;\n"],"sourceRoot":"","file":"useMessage.js"}
|
||||
Reference in New Issue
Block a user