yuyeon 0.0.36 → 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/style.css +1 -1
- package/dist/yuyeon.js +2615 -2544
- package/dist/yuyeon.umd.cjs +3 -3
- package/lib/components/dialog/YDialog.mjs +85 -14
- package/lib/components/dialog/YDialog.mjs.map +1 -1
- package/lib/components/dialog/YDialog.scss +31 -1
- package/lib/components/layer/YLayer.mjs +21 -6
- package/lib/components/layer/YLayer.mjs.map +1 -1
- package/lib/components/layer/YLayer.scss +7 -2
- package/lib/components/layer/active-stack.mjs +3 -2
- package/lib/components/layer/active-stack.mjs.map +1 -1
- package/lib/components/menu/YMenu.mjs +8 -7
- package/lib/components/menu/YMenu.mjs.map +1 -1
- package/lib/composables/layer-group.mjs +25 -2
- package/lib/composables/layer-group.mjs.map +1 -1
- package/lib/index.mjs +0 -2
- package/lib/index.mjs.map +1 -1
- package/lib/styles/base.scss +8 -0
- package/package.json +1 -1
- package/types/components/dialog/YDialog.d.ts +44 -11
- package/types/components/layer/YLayer.d.ts +21 -9
- package/types/components/menu/YMenu.d.ts +20 -6
- package/types/components/tooltip/YTooltip.d.ts +11 -3
- package/types/composables/layer-group.d.ts +4 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YMenu.mjs","names":["computed","defineComponent","ref","toRef","watch","useModelDuplex","useRender","polyTransitionPropOptions","toKebabCase","bindClasses","chooseProps","YLayer","pressYLayerProps","useDelay","useActiveStack","hasElementMouseEvent","NAME","CLASS_NAME","YMenuPropOptions","menuClasses","type","Array","String","Object","openOnClickBase","Boolean","default","closeCondition","Function","undefined","preventClip","coordinateStrategy","preventCloseBubble","YMenu","name","props","transition","emits","setup","_ref","slots","emit","expose","el$","classes","boundClasses","model","active","get","value","set","v","disabled","hovered","children","parent","startOpenDelay","startCloseDelay","changeActive","openOnHover","length","onMouseenter","e","onMouseleave","onClick","stopPropagation","currentActive","onComplementClick","parentContent","$el","content$","clear","bindHover","el","addEventListener","unbindHover","removeEventListener","baseEl","neo","old","computedContentClasses","contentClasses","_createVNode","_Fragment","_mergeProps","onAfterLeave","scrim","$event","_len","arguments","args","_key","base","_len2","_key2"],"sources":["../../../src/components/menu/YMenu.tsx"],"sourcesContent":["import type { PropType } from 'vue';\r\nimport {computed, defineComponent, ref, toRef, watch} from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport { polyTransitionPropOptions } from '../../composables/transition';\r\nimport { toKebabCase } from '../../util/string';\r\nimport { bindClasses, chooseProps } from '../../util/vue-component';\r\nimport { YLayer, pressYLayerProps } from '../layer';\r\nimport { useDelay } from '../layer/active-delay';\r\n\r\nimport './YMenu.scss';\r\nimport {useActiveStack} from \"../layer/active-stack\";\r\nimport {hasElementMouseEvent} from \"../../util/dom\";\r\n\r\nconst NAME = 'YMenu';\r\nconst CLASS_NAME = toKebabCase(NAME);\r\n\r\nexport const YMenuPropOptions = {\r\n menuClasses: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n openOnClickBase: {\r\n type: Boolean as PropType<boolean>,\r\n default: true,\r\n },\r\n closeCondition: {\r\n type: [Boolean, Function],\r\n default: undefined,\r\n },\r\n preventClip: {\r\n type: Boolean as PropType<boolean>,\r\n default: true,\r\n },\r\n ...pressYLayerProps({\r\n coordinateStrategy: 'levitation',\r\n }),\r\n preventCloseBubble: Boolean as PropType<boolean>,\r\n};\r\n\r\n/**\r\n * # Component\r\n */\r\nexport const YMenu = defineComponent({\r\n name: NAME,\r\n props: {\r\n ...YMenuPropOptions,\r\n transition: {\r\n ...polyTransitionPropOptions.transition,\r\n default: 'fade',\r\n },\r\n },\r\n emits: ['update:modelValue', 'afterLeave'],\r\n setup(props, { slots, emit, expose }) {\r\n const el$ = ref<typeof YLayer>();\r\n\r\n const classes = computed(() => {\r\n const boundClasses = bindClasses(props.menuClasses);\r\n return {\r\n ...boundClasses,\r\n 'y-menu': true,\r\n };\r\n });\r\n\r\n const model = useModelDuplex(props);\r\n\r\n const active = computed({\r\n get: (): boolean => {\r\n return !!model.value;\r\n },\r\n set: (v: boolean) => {\r\n if (!(v && props.disabled)) model.value = v;\r\n },\r\n });\r\n\r\n const hovered = computed(() => !!el$.value?.hovered);\r\n const { children, parent } = useActiveStack(el$, active, toRef(props, 'preventCloseBubble'));\r\n const { startOpenDelay, startCloseDelay } = useDelay(\r\n props,\r\n (changeActive) => {\r\n if (!changeActive && props.openOnHover && !hovered.value && children.value.length === 0) {\r\n active.value = false;\r\n } else if (changeActive) {\r\n active.value = true;\r\n }\r\n },\r\n );\r\n\r\n function onMouseenter(e: MouseEvent) {\r\n if (props.openOnHover) {\r\n startOpenDelay();\r\n }\r\n }\r\n\r\n function onMouseleave(e: MouseEvent) {\r\n if (props.openOnHover) {\r\n startCloseDelay();\r\n }\r\n }\r\n\r\n watch(hovered, (value) => {\r\n if (!value) {\r\n startCloseDelay();\r\n }\r\n });\r\n\r\n function onClick(e: MouseEvent) {\r\n e.stopPropagation();\r\n if (!props.openOnClickBase) {\r\n return;\r\n }\r\n const currentActive = active.value;\r\n if (!props.disabled) {\r\n active.value = !currentActive;\r\n }\r\n }\r\n\r\n function onComplementClick(e: Event) {\r\n if (props.closeCondition === false) {\r\n return;\r\n }\r\n if (typeof props.closeCondition === 'function') {\r\n if (props.closeCondition(e) === false) {\r\n active.value = false;\r\n }\r\n return;\r\n }\r\n if (active.value) {\r\n const parentContent = parent?.$el.value?.content$;\r\n active.value = false;\r\n if (!(parentContent && !hasElementMouseEvent(e, parentContent))) {\r\n parent?.clear();\r\n }\r\n }\r\n }\r\n\r\n function bindHover(el: HTMLElement) {\r\n el.addEventListener('mouseenter', onMouseenter);\r\n el.addEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n function unbindHover(el: HTMLElement) {\r\n el.removeEventListener('mouseenter', onMouseenter);\r\n el.removeEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n watch(\r\n () => el$.value?.baseEl,\r\n (neo, old) => {\r\n if (neo) {\r\n bindHover(neo);\r\n neo.addEventListener('click', onClick);\r\n } else if (old) {\r\n unbindHover(old);\r\n old.removeEventListener('click', onClick);\r\n }\r\n },\r\n );\r\n\r\n const computedContentClasses = computed<Record<string, boolean>>(() => {\r\n const boundClasses = bindClasses(props.contentClasses);\r\n return {\r\n ...boundClasses,\r\n };\r\n });\r\n\r\n useRender(() => {\r\n return (\r\n <>\r\n <YLayer\r\n ref={el$}\r\n transition={props.transition}\r\n onClick:complement={onComplementClick}\r\n onAfterLeave={() => emit('afterLeave')}\r\n {...{\r\n ...chooseProps(props, YLayer.props),\r\n classes: classes.value,\r\n scrim: false,\r\n contentClasses: {\r\n 'y-menu__content': true,\r\n ...computedContentClasses.value,\r\n },\r\n }}\r\n v-model={active.value}\r\n >\r\n {{\r\n default: (...args: any) => {\r\n return <>{slots.default?.(...args) ?? ''}</>;\r\n },\r\n base: (...args: any[]) => slots.base?.(...args),\r\n }}\r\n </YLayer>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n el$,\r\n classes,\r\n };\r\n },\r\n});\r\n\r\nexport type YMenu = InstanceType<typeof YMenu>;\r\n"],"mappings":";AACA,SAAQA,QAAQ,EAAEC,eAAe,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAO,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SAETC,yBAAyB;AAAA,SACzBC,WAAW;AAAA,SACXC,WAAW,EAAEC,WAAW;AAAA,SACxBC,MAAM,EAAEC,gBAAgB;AAAA,SACxBC,QAAQ;AAEjB;AAAsB,SACdC,cAAc;AAAA,SACdC,oBAAoB;AAE5B,MAAMC,IAAI,GAAG,OAAO;AACpB,MAAMC,UAAU,GAAGT,WAAW,CAACQ,IAAI,CAAC;AAEpC,OAAO,MAAME,gBAAgB,GAAG;EAC9BC,WAAW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AG,GAAGgE,IAAI,CAAC,IAAI,EAAE;QAC1C,CAAC;QACDE,IAAI,EAAE,SAAAA,CAAA;UAAA,SAAAC,KAAA,GAAAJ,SAAA,CAAA7B,MAAA,EAAI8B,IAAI,OAAArE,KAAA,CAAAwE,KAAA,GAAAC,KAAA,MAAAA,KAAA,GAAAD,KAAA,EAAAC,KAAA;YAAJJ,IAAI,CAAAI,KAAA,IAAAL,SAAA,CAAAK,KAAA;UAAA;UAAA,OAAYtD,KAAK,CAACoD,IAAI,GAAG,GAAGF,IAAI,CAAC;QAAA;MAAA;IAKzD,CAAC,CAAC;IAEF,OAAO;MACL/C,GAAG;MACHC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YMenu.mjs","names":["computed","defineComponent","ref","toRef","watch","useModelDuplex","useRender","polyTransitionPropOptions","toKebabCase","bindClasses","chooseProps","YLayer","pressYLayerProps","useDelay","useActiveStack","hasElementMouseEvent","NAME","CLASS_NAME","YMenuPropOptions","menuClasses","type","Array","String","Object","openOnClickBase","Boolean","default","closeCondition","Function","undefined","preventClip","coordinateStrategy","preventCloseBubble","YMenu","name","props","transition","emits","setup","_ref","slots","emit","expose","layer$","classes","boundClasses","model","active","get","value","set","v","disabled","hovered","children","parent","startOpenDelay","startCloseDelay","changeActive","openOnHover","length","onMouseenter","e","onMouseleave","onClick","stopPropagation","currentActive","onComplementClick","parentContent","$el","content$","parentModal","modal","clear","bindHover","el","addEventListener","unbindHover","removeEventListener","baseEl","neo","old","computedContentClasses","contentClasses","_createVNode","_Fragment","_mergeProps","onAfterLeave","scrim","$event","_len","arguments","args","_key","base","_len2","_key2","el$"],"sources":["../../../src/components/menu/YMenu.tsx"],"sourcesContent":["import type { PropType } from 'vue';\r\nimport {computed, defineComponent, ref, toRef, watch} from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport { polyTransitionPropOptions } from '../../composables/transition';\r\nimport { toKebabCase } from '../../util/string';\r\nimport { bindClasses, chooseProps } from '../../util/vue-component';\r\nimport { YLayer, pressYLayerProps } from '../layer';\r\nimport { useDelay } from '../layer/active-delay';\r\n\r\nimport './YMenu.scss';\r\nimport {useActiveStack} from \"../layer/active-stack\";\r\nimport {hasElementMouseEvent} from \"../../util/dom\";\r\n\r\nconst NAME = 'YMenu';\r\nconst CLASS_NAME = toKebabCase(NAME);\r\n\r\nexport const YMenuPropOptions = {\r\n menuClasses: {\r\n type: [Array, String, Object] as PropType<\r\n string[] | string | Record<string, any>\r\n >,\r\n },\r\n openOnClickBase: {\r\n type: Boolean as PropType<boolean>,\r\n default: true,\r\n },\r\n closeCondition: {\r\n type: [Boolean, Function],\r\n default: undefined,\r\n },\r\n preventClip: {\r\n type: Boolean as PropType<boolean>,\r\n default: true,\r\n },\r\n ...pressYLayerProps({\r\n coordinateStrategy: 'levitation',\r\n }),\r\n preventCloseBubble: Boolean as PropType<boolean>,\r\n};\r\n\r\n/**\r\n * # Component\r\n */\r\nexport const YMenu = defineComponent({\r\n name: NAME,\r\n props: {\r\n ...YMenuPropOptions,\r\n transition: {\r\n ...polyTransitionPropOptions.transition,\r\n default: 'fade',\r\n },\r\n },\r\n emits: ['update:modelValue', 'afterLeave'],\r\n setup(props, { slots, emit, expose }) {\r\n const layer$ = ref<typeof YLayer>();\r\n\r\n const classes = computed(() => {\r\n const boundClasses = bindClasses(props.menuClasses);\r\n return {\r\n ...boundClasses,\r\n 'y-menu': true,\r\n };\r\n });\r\n\r\n const model = useModelDuplex(props);\r\n\r\n const active = computed({\r\n get: (): boolean => {\r\n return !!model.value;\r\n },\r\n set: (v: boolean) => {\r\n if (!(v && props.disabled)) model.value = v;\r\n },\r\n });\r\n\r\n const hovered = computed(() => !!layer$.value?.hovered);\r\n const { children, parent } = useActiveStack(layer$, active, toRef(props, 'preventCloseBubble'));\r\n const { startOpenDelay, startCloseDelay } = useDelay(\r\n props,\r\n (changeActive) => {\r\n if (!changeActive && props.openOnHover && !hovered.value && children.value.length === 0) {\r\n active.value = false;\r\n } else if (changeActive) {\r\n active.value = true;\r\n }\r\n },\r\n );\r\n\r\n function onMouseenter(e: MouseEvent) {\r\n if (props.openOnHover) {\r\n startOpenDelay();\r\n }\r\n }\r\n\r\n function onMouseleave(e: MouseEvent) {\r\n if (props.openOnHover) {\r\n startCloseDelay();\r\n }\r\n }\r\n\r\n watch(hovered, (value) => {\r\n if (!value) {\r\n startCloseDelay();\r\n }\r\n });\r\n\r\n function onClick(e: MouseEvent) {\r\n e.stopPropagation();\r\n if (!props.openOnClickBase) {\r\n return;\r\n }\r\n const currentActive = active.value;\r\n if (!props.disabled) {\r\n active.value = !currentActive;\r\n }\r\n }\r\n\r\n function onComplementClick(e: Event) {\r\n if (props.closeCondition === false) {\r\n return;\r\n }\r\n if (typeof props.closeCondition === 'function') {\r\n if (props.closeCondition(e) === false) {\r\n active.value = false;\r\n }\r\n return;\r\n }\r\n if (active.value) {\r\n const parentContent = parent?.$el.value?.content$;\r\n const parentModal = parent?.$el.value?.modal;\r\n active.value = false;\r\n if (!(parentContent && !hasElementMouseEvent(e, parentContent)) && !parentModal) {\r\n parent?.clear();\r\n }\r\n }\r\n }\r\n\r\n function bindHover(el: HTMLElement) {\r\n el.addEventListener('mouseenter', onMouseenter);\r\n el.addEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n function unbindHover(el: HTMLElement) {\r\n el.removeEventListener('mouseenter', onMouseenter);\r\n el.removeEventListener('mouseleave', onMouseleave);\r\n }\r\n\r\n watch(\r\n () => layer$.value?.baseEl,\r\n (neo, old) => {\r\n if (neo) {\r\n bindHover(neo);\r\n neo.addEventListener('click', onClick);\r\n } else if (old) {\r\n unbindHover(old);\r\n old.removeEventListener('click', onClick);\r\n }\r\n },\r\n );\r\n\r\n const computedContentClasses = computed<Record<string, boolean>>(() => {\r\n const boundClasses = bindClasses(props.contentClasses);\r\n return {\r\n ...boundClasses,\r\n };\r\n });\r\n\r\n useRender(() => {\r\n return (\r\n <>\r\n <YLayer\r\n ref={layer$}\r\n transition={props.transition}\r\n onClick:complement={onComplementClick}\r\n onAfterLeave={() => emit('afterLeave')}\r\n {...{\r\n ...chooseProps(props, YLayer.props),\r\n classes: classes.value,\r\n scrim: false,\r\n contentClasses: {\r\n 'y-menu__content': true,\r\n ...computedContentClasses.value,\r\n },\r\n }}\r\n v-model={active.value}\r\n >\r\n {{\r\n default: (...args: any) => {\r\n return <>{slots.default?.(...args) ?? ''}</>;\r\n },\r\n base: (...args: any[]) => slots.base?.(...args),\r\n }}\r\n </YLayer>\r\n </>\r\n );\r\n });\r\n\r\n return {\r\n el$: layer$,\r\n classes,\r\n };\r\n },\r\n});\r\n\r\nexport type YMenu = InstanceType<typeof YMenu>;\r\n"],"mappings":";AACA,SAAQA,QAAQ,EAAEC,eAAe,EAAEC,GAAG,EAAEC,KAAK,EAAEC,KAAK,QAAO,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SAETC,yBAAyB;AAAA,SACzBC,WAAW;AAAA,SACXC,WAAW,EAAEC,WAAW;AAAA,SACxBC,MAAM,EAAEC,gBAAgB;AAAA,SACxBC,QAAQ;AAEjB;AAAsB,SACdC,cAAc;AAAA,SACdC,oBAAoB;AAE5B,MAAMC,IAAI,GAAG,OAAO;AACpB,MAAMC,UAAU,GAAGT,WAAW,CAACQ,IAAI,CAAC;AAEpC,OAAO,MAAME,gBAAgB,GAAG;EAC9BC,WAAW,EAAE;IACXC,IAAI,EAAE,CAACC,KAAK,EAAEC,MAAM,EAAEC,MAAM;EAG9B,CAAC;EACDC,eAAe,EAAE;IACfJ,IAAI,EAAEK,OAA4B;IAClCC,OAAO,EAAE;EACX,CAAC;EACDC,cAAc,EAAE;IACdP,IAAI,EAAE,CAACK,OAAO,EAAEG,QAAQ,CAAC;IACzBF,OAAO,EAAEG;EACX,CAAC;EACDC,WAAW,EAAE;IACXV,IAAI,EAAEK,OAA4B;IA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AAAD,KAAA,EAAAC,KAAA;YAAJJ,IAAI,CAAAI,KAAA,IAAAL,SAAA,CAAAK,KAAA;UAAA;UAAA,OAAYxD,KAAK,CAACsD,IAAI,GAAG,GAAGF,IAAI,CAAC;QAAA;MAAA;IAKzD,CAAC,CAAC;IAEF,OAAO;MACLK,GAAG,EAAEtD,MAAM;MACXC;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { computed, getCurrentInstance } from 'vue';
|
|
1
|
+
import { computed, getCurrentInstance, watch } from 'vue';
|
|
2
2
|
export const Y_LAYER_GROUP_CLASS_NAME = 'y-layer-group';
|
|
3
|
+
const layerGroupState = new WeakMap();
|
|
3
4
|
export function useLayerGroup(target) {
|
|
4
5
|
const vm = getCurrentInstance();
|
|
5
6
|
const layerGroup = computed(() => {
|
|
@@ -27,8 +28,30 @@ export function useLayerGroup(target) {
|
|
|
27
28
|
}
|
|
28
29
|
return layerEl;
|
|
29
30
|
});
|
|
31
|
+
watch(layerGroup, (neo, old) => {
|
|
32
|
+
if (old && layerGroupState.has(old)) {
|
|
33
|
+
layerGroupState.get(old)?.delete(vm);
|
|
34
|
+
}
|
|
35
|
+
if (!(layerGroupState.has(neo) && layerGroupState.get(neo))) {
|
|
36
|
+
layerGroupState.set(neo, new Set());
|
|
37
|
+
}
|
|
38
|
+
layerGroupState.get(neo)?.add(vm);
|
|
39
|
+
}, {
|
|
40
|
+
immediate: true
|
|
41
|
+
});
|
|
42
|
+
function getActiveLayers() {
|
|
43
|
+
const activeLayers = [];
|
|
44
|
+
layerGroupState.get(layerGroup.value)?.forEach(value => {
|
|
45
|
+
if (value?.ctx?.active) {
|
|
46
|
+
activeLayers.push(value);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
return activeLayers;
|
|
50
|
+
}
|
|
30
51
|
return {
|
|
31
|
-
layerGroup
|
|
52
|
+
layerGroup,
|
|
53
|
+
layerGroupState,
|
|
54
|
+
getActiveLayers
|
|
32
55
|
};
|
|
33
56
|
}
|
|
34
57
|
//# sourceMappingURL=layer-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layer-group.mjs","names":["computed","getCurrentInstance","Y_LAYER_GROUP_CLASS_NAME","useLayerGroup","target","vm","layerGroup","refTarget","value","targetEl","document","body","rootEl","root","vnode","el","parentElement","querySelector","nodeType","layerEl","createElement","className","appendChild"],"sources":["../../src/composables/layer-group.ts"],"sourcesContent":["import {computed, getCurrentInstance} from 'vue';\
|
|
1
|
+
{"version":3,"file":"layer-group.mjs","names":["computed","getCurrentInstance","watch","Y_LAYER_GROUP_CLASS_NAME","layerGroupState","WeakMap","useLayerGroup","target","vm","layerGroup","refTarget","value","targetEl","document","body","rootEl","root","vnode","el","parentElement","querySelector","nodeType","layerEl","createElement","className","appendChild","neo","old","has","get","delete","set","Set","add","immediate","getActiveLayers","activeLayers","forEach","ctx","active","push"],"sources":["../../src/composables/layer-group.ts"],"sourcesContent":["import { computed, getCurrentInstance, watch } from 'vue';\nimport type { Ref, ComponentInternalInstance } from 'vue';\n\nexport const Y_LAYER_GROUP_CLASS_NAME = 'y-layer-group';\n\nconst layerGroupState = new WeakMap<HTMLElement, Set<any>>();\n\nexport function useLayerGroup(target?: Ref<string | Element>) {\n const vm = getCurrentInstance()!;\n\n const layerGroup = computed<HTMLElement>(() => {\n const refTarget = target?.value;\n let targetEl: Element = document.body;\n\n const rootEl = vm.root.vnode.el?.parentElement as HTMLElement;\n if (rootEl) {\n targetEl = rootEl;\n }\n\n if (typeof refTarget === 'string') {\n const el = document.querySelector(refTarget);\n if (el) {\n targetEl = el;\n }\n }\n if (refTarget && (refTarget as Element).nodeType === 1) {\n targetEl = refTarget as Element;\n }\n //\n let layerEl = targetEl.querySelector(`.${Y_LAYER_GROUP_CLASS_NAME}`);\n if (!layerEl) {\n layerEl = document.createElement('div');\n layerEl.className = Y_LAYER_GROUP_CLASS_NAME;\n targetEl.appendChild(layerEl);\n }\n return layerEl as HTMLElement;\n });\n\n watch(\n layerGroup,\n (neo, old) => {\n if (old && layerGroupState.has(old)) {\n layerGroupState.get(old)?.delete(vm);\n }\n if (!(layerGroupState.has(neo) && layerGroupState.get(neo))) {\n layerGroupState.set(neo, new Set());\n }\n layerGroupState.get(neo)?.add(vm);\n },\n { immediate: true },\n );\n\n function getActiveLayers() {\n const activeLayers: ComponentInternalInstance[] = [];\n layerGroupState.get(layerGroup.value)?.forEach((value) => {\n if (value?.ctx?.active) {\n activeLayers.push(value);\n }\n });\n return activeLayers;\n }\n\n return { layerGroup, layerGroupState, getActiveLayers };\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,kBAAkB,EAAEC,KAAK,QAAQ,KAAK;AAGzD,OAAO,MAAMC,wBAAwB,GAAG,eAAe;AAEvD,MAAMC,eAAe,GAAG,IAAIC,OAAO,CAAwB,CAAC;AAE5D,OAAO,SAASC,aAAaA,CAACC,MAA8B,EAAE;EAC5D,MAAMC,EAAE,GAAGP,kBAAkB,CAAC,CAAE;EAEhC,MAAMQ,UAAU,GAAGT,QAAQ,CAAc,MAAM;IAC7C,MAAMU,SAAS,GAAGH,MAAM,EAAEI,KAAK;IAC/B,IAAIC,QAAiB,GAAGC,QAAQ,CAACC,IAAI;IAErC,MAAMC,MAAM,GAAGP,EAAE,CAACQ,IAAI,CAACC,KAAK,CAACC,EAAE,EAAEC,aAA4B;IAC7D,IAAIJ,MAAM,EAAE;MACVH,QAAQ,GAAGG,MAAM;IACnB;IAEA,IAAI,OAAOL,SAAS,KAAK,QAAQ,EAAE;MACjC,MAAMQ,EAAE,GAAGL,QAAQ,CAACO,aAAa,CAACV,SAAS,CAAC;MAC5C,IAAIQ,EAAE,EAAE;QACNN,QAAQ,GAAGM,EAAE;MACf;IACF;IACA,IAAIR,SAAS,IAAKA,SAAS,CAAaW,QAAQ,KAAK,CAAC,EAAE;MACtDT,QAAQ,GAAGF,SAAoB;IACjC;IACA;IACA,IAAIY,OAAO,GAAG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mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["components","YUYEON_LOGO","nextTick","reactive","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","defaultOptions","credit","init","options","arguments","length","undefined","themeModule","theme","install","app","yuyeon","root","instance","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_instance","_container","Error","$el","classList","add","setAttribute","console","log","unmount","scope","stop"],"sources":["../src/index.ts"],"sourcesContent":["import * as components from './components';\nimport { YUYEON_LOGO } from './etc';\nimport { Component, ComponentInternalInstance } from '@vue/runtime-core';\nimport type { App } from 'vue';\nimport { nextTick, reactive } from 'vue';\n\nimport {\n YUYEON_THEME_KEY,\n createThemeModule,\n useTheme,\n} from './composables/theme';\nimport PlateWave from './directives/plate-wave';\n\n//\nimport './styles/base.scss';\n\nconst defaultOptions = {\n credit: true,\n};\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $yuyeon: any;\n }\n}\n\nexport function init(options: any = defaultOptions) {\n const themeModule = createThemeModule(options?.theme);\n\n const install = (app: App): any => {\n themeModule.install(app);\n\n const yuyeon = reactive({\n app: null as ComponentInternalInstance | null,\n root: null as HTMLElement | null,\n theme: themeModule.instance,\n });\n\n Object.keys(components).forEach((componentName) => {\n const comp = components[componentName as keyof typeof components];\n app.component(componentName, comp as Component);\n });\n\n app.directive('plate-wave', PlateWave);\n\n app.provide(YUYEON_THEME_KEY, yuyeon.theme);\n\n app.config.globalProperties.$yuyeon = yuyeon;\n\n nextTick(() => {\n yuyeon.app = app._instance as any;\n yuyeon.root = app._container;\n if (!yuyeon.root) {\n throw new Error(`yuyeon: Can't found instance`);\n }\n const $el = yuyeon.root;\n $el.classList.add('y-root');\n $el.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n });\n if (options?.credit) {\n console.log(YUYEON_LOGO);\n }\n const { unmount } = app;\n app.unmount = () => {\n unmount();\n themeModule.scope.stop();\n app.unmount = unmount;\n };\n };\n\n return {\n install,\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["components","YUYEON_LOGO","nextTick","reactive","YUYEON_THEME_KEY","createThemeModule","useTheme","PlateWave","defaultOptions","credit","init","options","arguments","length","undefined","themeModule","theme","install","app","yuyeon","root","instance","Object","keys","forEach","componentName","comp","component","directive","provide","config","globalProperties","$yuyeon","_instance","_container","Error","$el","classList","add","setAttribute","console","log","unmount","scope","stop"],"sources":["../src/index.ts"],"sourcesContent":["import * as components from './components';\nimport { YUYEON_LOGO } from './etc';\nimport { Component, ComponentInternalInstance } from '@vue/runtime-core';\nimport type { App } from 'vue';\nimport { nextTick, reactive } from 'vue';\n\nimport {\n YUYEON_THEME_KEY,\n createThemeModule,\n useTheme,\n} from './composables/theme';\nimport PlateWave from './directives/plate-wave';\n\n//\nimport './styles/base.scss';\n\nconst defaultOptions = {\n credit: true,\n};\n\ndeclare module 'vue' {\n interface ComponentCustomProperties {\n $yuyeon: any;\n }\n}\n\nexport function init(options: any = defaultOptions) {\n const themeModule = createThemeModule(options?.theme);\n\n const install = (app: App): any => {\n themeModule.install(app);\n\n const yuyeon = reactive({\n app: null as ComponentInternalInstance | null,\n root: null as HTMLElement | null,\n theme: themeModule.instance,\n });\n\n Object.keys(components).forEach((componentName) => {\n const comp = components[componentName as keyof typeof components];\n app.component(componentName, comp as Component);\n });\n\n app.directive('plate-wave', PlateWave);\n\n app.provide(YUYEON_THEME_KEY, yuyeon.theme);\n\n app.config.globalProperties.$yuyeon = yuyeon;\n\n nextTick(() => {\n yuyeon.app = app._instance as any;\n yuyeon.root = app._container;\n if (!yuyeon.root) {\n throw new Error(`yuyeon: Can't found instance`);\n }\n const $el = yuyeon.root;\n $el.classList.add('y-root');\n $el.setAttribute('data-y-root', '');\n themeModule.init(yuyeon);\n });\n if (options?.credit) {\n console.log(YUYEON_LOGO);\n }\n const { unmount } = app;\n app.unmount = () => {\n unmount();\n themeModule.scope.stop();\n app.unmount = unmount;\n };\n };\n\n return {\n install,\n };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,IAAI,CAACf,MAAM,CAACC,IAAI,EAAE;QAChB,MAAM,IAAIe,KAAK,CAAE,8BAA6B,CAAC;MACjD;MACA,MAAMC,GAAG,GAAGjB,MAAM,CAACC,IAAI;MACvBgB,GAAG,CAACC,SAAS,CAACC,GAAG,CAAC,QAAQ,CAAC;MAC3BF,GAAG,CAACG,YAAY,CAAC,aAAa,EAAE,EAAE,CAAC;MACnCxB,WAAW,CAACL,IAAI,CAACS,MAAM,CAAC;IAC1B,CAAC,CAAC;IACF,IAAIR,OAAO,EAAEF,MAAM,EAAE;MACnB+B,OAAO,CAACC,GAAG,CAACxC,WAAW,CAAC;IAC1B;IACA,MAAM;MAAEyC;IAAQ,CAAC,GAAGxB,GAAG;IACvBA,GAAG,CAACwB,OAAO,GAAG,MAAM;MAClBA,OAAO,CAAC,CAAC;MACT3B,WAAW,CAAC4B,KAAK,CAACC,IAAI,CAAC,CAAC;MACxB1B,GAAG,CAACwB,OAAO,GAAGA,OAAO;IACvB,CAAC;EACH,CAAC;EAED,OAAO;IACLzB;EACF,CAAC;AACH;AAEA,SAASX,QAAQ"}
|
package/lib/styles/base.scss
CHANGED
package/package.json
CHANGED
|
@@ -3,13 +3,25 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
3
3
|
modelValue: {
|
|
4
4
|
type: PropType<boolean>;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
type:
|
|
6
|
+
persistent: {
|
|
7
|
+
type: PropType<boolean>;
|
|
8
|
+
default: boolean;
|
|
8
9
|
};
|
|
9
10
|
dialogClasses: {
|
|
10
11
|
type: PropType<string | string[] | Record<string, any>>;
|
|
11
12
|
};
|
|
12
|
-
|
|
13
|
+
closeClickScrim: {
|
|
14
|
+
type: PropType<boolean>;
|
|
15
|
+
};
|
|
16
|
+
disabled: PropType<boolean>;
|
|
17
|
+
maximized: PropType<boolean>;
|
|
18
|
+
scrim: {
|
|
19
|
+
type: PropType<boolean>;
|
|
20
|
+
default: boolean;
|
|
21
|
+
};
|
|
22
|
+
offset: {
|
|
23
|
+
type: PropType<string>;
|
|
24
|
+
};
|
|
13
25
|
}, {
|
|
14
26
|
active: import("vue").WritableComputedRef<any>;
|
|
15
27
|
layer: import("vue").Ref<import("vue").DefineComponent<{
|
|
@@ -55,6 +67,9 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
55
67
|
scrim: {
|
|
56
68
|
type: PropType<boolean>;
|
|
57
69
|
};
|
|
70
|
+
scrimOpacity: {
|
|
71
|
+
type: PropType<number>;
|
|
72
|
+
};
|
|
58
73
|
eager: {
|
|
59
74
|
type: PropType<boolean>;
|
|
60
75
|
};
|
|
@@ -67,7 +82,6 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
67
82
|
closeClickScrim: {
|
|
68
83
|
type: PropType<boolean>;
|
|
69
84
|
};
|
|
70
|
-
modal: PropType<boolean>;
|
|
71
85
|
contentStyles: {
|
|
72
86
|
type: PropType<import("vue").CSSProperties>;
|
|
73
87
|
default: () => void;
|
|
@@ -88,13 +102,14 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
88
102
|
type: PropType<number>;
|
|
89
103
|
default: number;
|
|
90
104
|
};
|
|
105
|
+
modal: PropType<boolean>;
|
|
91
106
|
}, {
|
|
92
107
|
complementClickOption: {
|
|
93
108
|
handler: (mouseEvent: MouseEvent) => void;
|
|
94
109
|
determine?: ((event: Event) => boolean) | undefined;
|
|
95
110
|
include?: (() => (HTMLElement | undefined)[]) | undefined;
|
|
96
111
|
};
|
|
97
|
-
layerGroup: import("vue").ComputedRef<
|
|
112
|
+
layerGroup: import("vue").ComputedRef<HTMLElement>;
|
|
98
113
|
active: import("vue").WritableComputedRef<boolean>;
|
|
99
114
|
rendered: import("vue").ComputedRef<boolean>;
|
|
100
115
|
lazyValue: import("vue").ComputedRef<any>;
|
|
@@ -1667,6 +1682,8 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
1667
1682
|
"text-anchor"?: import("csstype").Property.TextAnchor | undefined;
|
|
1668
1683
|
"vector-effect"?: import("csstype").Property.VectorEffect | undefined;
|
|
1669
1684
|
}>;
|
|
1685
|
+
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
1686
|
+
getActiveLayers: () => import("vue").ComponentInternalInstance[];
|
|
1670
1687
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1671
1688
|
'update:modelValue': (value: boolean) => true;
|
|
1672
1689
|
'click:complement': (mouseEvent: MouseEvent) => true;
|
|
@@ -1714,6 +1731,9 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
1714
1731
|
scrim: {
|
|
1715
1732
|
type: PropType<boolean>;
|
|
1716
1733
|
};
|
|
1734
|
+
scrimOpacity: {
|
|
1735
|
+
type: PropType<number>;
|
|
1736
|
+
};
|
|
1717
1737
|
eager: {
|
|
1718
1738
|
type: PropType<boolean>;
|
|
1719
1739
|
};
|
|
@@ -1726,7 +1746,6 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
1726
1746
|
closeClickScrim: {
|
|
1727
1747
|
type: PropType<boolean>;
|
|
1728
1748
|
};
|
|
1729
|
-
modal: PropType<boolean>;
|
|
1730
1749
|
contentStyles: {
|
|
1731
1750
|
type: PropType<import("vue").CSSProperties>;
|
|
1732
1751
|
default: () => void;
|
|
@@ -1747,6 +1766,7 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
1747
1766
|
type: PropType<number>;
|
|
1748
1767
|
default: number;
|
|
1749
1768
|
};
|
|
1769
|
+
modal: PropType<boolean>;
|
|
1750
1770
|
}>> & {
|
|
1751
1771
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1752
1772
|
onAfterLeave?: (() => any) | undefined;
|
|
@@ -1768,21 +1788,34 @@ export declare const YDialog: import("vue").DefineComponent<{
|
|
|
1768
1788
|
}, {}> | undefined>;
|
|
1769
1789
|
classes: import("vue").ComputedRef<{
|
|
1770
1790
|
'y-dialog': boolean;
|
|
1791
|
+
'y-dialog--maximized': boolean | undefined;
|
|
1771
1792
|
}>;
|
|
1772
1793
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1773
1794
|
modelValue: {
|
|
1774
1795
|
type: PropType<boolean>;
|
|
1775
1796
|
};
|
|
1776
|
-
|
|
1777
|
-
type:
|
|
1797
|
+
persistent: {
|
|
1798
|
+
type: PropType<boolean>;
|
|
1799
|
+
default: boolean;
|
|
1778
1800
|
};
|
|
1779
1801
|
dialogClasses: {
|
|
1780
1802
|
type: PropType<string | string[] | Record<string, any>>;
|
|
1781
1803
|
};
|
|
1782
|
-
|
|
1804
|
+
closeClickScrim: {
|
|
1805
|
+
type: PropType<boolean>;
|
|
1806
|
+
};
|
|
1807
|
+
disabled: PropType<boolean>;
|
|
1808
|
+
maximized: PropType<boolean>;
|
|
1809
|
+
scrim: {
|
|
1810
|
+
type: PropType<boolean>;
|
|
1811
|
+
default: boolean;
|
|
1812
|
+
};
|
|
1813
|
+
offset: {
|
|
1814
|
+
type: PropType<string>;
|
|
1815
|
+
};
|
|
1783
1816
|
}>> & {
|
|
1784
1817
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
1785
1818
|
}, {
|
|
1786
|
-
|
|
1787
|
-
|
|
1819
|
+
scrim: boolean;
|
|
1820
|
+
persistent: boolean;
|
|
1788
1821
|
}, {}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CSSProperties, PropType } from 'vue';
|
|
1
|
+
import type { CSSProperties, PropType, ComponentInternalInstance } from 'vue';
|
|
2
2
|
export declare const pressYLayerProps: <Defaults extends {
|
|
3
3
|
minWidth?: unknown;
|
|
4
4
|
width?: unknown;
|
|
@@ -16,11 +16,11 @@ export declare const pressYLayerProps: <Defaults extends {
|
|
|
16
16
|
theme?: unknown;
|
|
17
17
|
modelValue?: unknown;
|
|
18
18
|
scrim?: unknown;
|
|
19
|
+
scrimOpacity?: unknown;
|
|
19
20
|
eager?: unknown;
|
|
20
21
|
classes?: unknown;
|
|
21
22
|
contentClasses?: unknown;
|
|
22
23
|
closeClickScrim?: unknown;
|
|
23
|
-
modal?: unknown;
|
|
24
24
|
contentStyles?: unknown;
|
|
25
25
|
disabled?: unknown;
|
|
26
26
|
openOnHover?: unknown;
|
|
@@ -151,6 +151,14 @@ export declare const pressYLayerProps: <Defaults extends {
|
|
|
151
151
|
type: PropType<unknown extends Defaults["scrim"] ? boolean : boolean | Defaults["scrim"]>;
|
|
152
152
|
default: unknown extends Defaults["scrim"] ? boolean : boolean | Defaults["scrim"];
|
|
153
153
|
};
|
|
154
|
+
scrimOpacity: unknown extends Defaults["scrimOpacity"] ? {
|
|
155
|
+
type: PropType<number>;
|
|
156
|
+
} : Omit<{
|
|
157
|
+
type: PropType<number>;
|
|
158
|
+
}, "default" | "type"> & {
|
|
159
|
+
type: PropType<unknown extends Defaults["scrimOpacity"] ? number : number | Defaults["scrimOpacity"]>;
|
|
160
|
+
default: unknown extends Defaults["scrimOpacity"] ? number : number | Defaults["scrimOpacity"];
|
|
161
|
+
};
|
|
154
162
|
eager: unknown extends Defaults["eager"] ? {
|
|
155
163
|
type: PropType<boolean>;
|
|
156
164
|
} : Omit<{
|
|
@@ -183,10 +191,6 @@ export declare const pressYLayerProps: <Defaults extends {
|
|
|
183
191
|
type: PropType<unknown extends Defaults["closeClickScrim"] ? boolean : boolean | Defaults["closeClickScrim"]>;
|
|
184
192
|
default: unknown extends Defaults["closeClickScrim"] ? boolean : boolean | Defaults["closeClickScrim"];
|
|
185
193
|
};
|
|
186
|
-
modal: unknown extends Defaults["modal"] ? PropType<boolean> : {
|
|
187
|
-
type: PropType<unknown extends Defaults["modal"] ? boolean : boolean | Defaults["modal"]>;
|
|
188
|
-
default: unknown extends Defaults["modal"] ? boolean : boolean | Defaults["modal"];
|
|
189
|
-
};
|
|
190
194
|
contentStyles: unknown extends Defaults["contentStyles"] ? {
|
|
191
195
|
type: PropType<CSSProperties>;
|
|
192
196
|
default: () => void;
|
|
@@ -281,6 +285,9 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
281
285
|
scrim: {
|
|
282
286
|
type: PropType<boolean>;
|
|
283
287
|
};
|
|
288
|
+
scrimOpacity: {
|
|
289
|
+
type: PropType<number>;
|
|
290
|
+
};
|
|
284
291
|
eager: {
|
|
285
292
|
type: PropType<boolean>;
|
|
286
293
|
};
|
|
@@ -293,7 +300,6 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
293
300
|
closeClickScrim: {
|
|
294
301
|
type: PropType<boolean>;
|
|
295
302
|
};
|
|
296
|
-
modal: PropType<boolean>;
|
|
297
303
|
contentStyles: {
|
|
298
304
|
type: PropType<CSSProperties>;
|
|
299
305
|
default: () => void;
|
|
@@ -314,13 +320,14 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
314
320
|
type: PropType<number>;
|
|
315
321
|
default: number;
|
|
316
322
|
};
|
|
323
|
+
modal: PropType<boolean>;
|
|
317
324
|
}, {
|
|
318
325
|
complementClickOption: {
|
|
319
326
|
handler: (mouseEvent: MouseEvent) => void;
|
|
320
327
|
determine?: ((event: Event) => boolean) | undefined;
|
|
321
328
|
include?: (() => (HTMLElement | undefined)[]) | undefined;
|
|
322
329
|
};
|
|
323
|
-
layerGroup: import("vue").ComputedRef<
|
|
330
|
+
layerGroup: import("vue").ComputedRef<HTMLElement>;
|
|
324
331
|
active: import("vue").WritableComputedRef<boolean>;
|
|
325
332
|
rendered: import("vue").ComputedRef<boolean>;
|
|
326
333
|
lazyValue: import("vue").ComputedRef<any>;
|
|
@@ -1893,6 +1900,8 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
1893
1900
|
"text-anchor"?: import("csstype").Property.TextAnchor | undefined;
|
|
1894
1901
|
"vector-effect"?: import("csstype").Property.VectorEffect | undefined;
|
|
1895
1902
|
}>;
|
|
1903
|
+
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
1904
|
+
getActiveLayers: () => ComponentInternalInstance[];
|
|
1896
1905
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1897
1906
|
'update:modelValue': (value: boolean) => true;
|
|
1898
1907
|
'click:complement': (mouseEvent: MouseEvent) => true;
|
|
@@ -1940,6 +1949,9 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
1940
1949
|
scrim: {
|
|
1941
1950
|
type: PropType<boolean>;
|
|
1942
1951
|
};
|
|
1952
|
+
scrimOpacity: {
|
|
1953
|
+
type: PropType<number>;
|
|
1954
|
+
};
|
|
1943
1955
|
eager: {
|
|
1944
1956
|
type: PropType<boolean>;
|
|
1945
1957
|
};
|
|
@@ -1952,7 +1964,6 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
1952
1964
|
closeClickScrim: {
|
|
1953
1965
|
type: PropType<boolean>;
|
|
1954
1966
|
};
|
|
1955
|
-
modal: PropType<boolean>;
|
|
1956
1967
|
contentStyles: {
|
|
1957
1968
|
type: PropType<CSSProperties>;
|
|
1958
1969
|
default: () => void;
|
|
@@ -1973,6 +1984,7 @@ export declare const YLayer: import("vue").DefineComponent<{
|
|
|
1973
1984
|
type: PropType<number>;
|
|
1974
1985
|
default: number;
|
|
1975
1986
|
};
|
|
1987
|
+
modal: PropType<boolean>;
|
|
1976
1988
|
}>> & {
|
|
1977
1989
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1978
1990
|
onAfterLeave?: (() => any) | undefined;
|
|
@@ -46,6 +46,9 @@ export declare const YMenuPropOptions: {
|
|
|
46
46
|
scrim: {
|
|
47
47
|
type: PropType<boolean>;
|
|
48
48
|
};
|
|
49
|
+
scrimOpacity: {
|
|
50
|
+
type: PropType<number>;
|
|
51
|
+
};
|
|
49
52
|
eager: {
|
|
50
53
|
type: PropType<boolean>;
|
|
51
54
|
};
|
|
@@ -58,7 +61,6 @@ export declare const YMenuPropOptions: {
|
|
|
58
61
|
closeClickScrim: {
|
|
59
62
|
type: PropType<boolean>;
|
|
60
63
|
};
|
|
61
|
-
modal: PropType<boolean>;
|
|
62
64
|
contentStyles: {
|
|
63
65
|
type: PropType<import("vue").CSSProperties>;
|
|
64
66
|
default: () => void;
|
|
@@ -145,6 +147,9 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
145
147
|
scrim: {
|
|
146
148
|
type: PropType<boolean>;
|
|
147
149
|
};
|
|
150
|
+
scrimOpacity: {
|
|
151
|
+
type: PropType<number>;
|
|
152
|
+
};
|
|
148
153
|
eager: {
|
|
149
154
|
type: PropType<boolean>;
|
|
150
155
|
};
|
|
@@ -157,7 +162,6 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
157
162
|
closeClickScrim: {
|
|
158
163
|
type: PropType<boolean>;
|
|
159
164
|
};
|
|
160
|
-
modal: PropType<boolean>;
|
|
161
165
|
contentStyles: {
|
|
162
166
|
type: PropType<import("vue").CSSProperties>;
|
|
163
167
|
default: () => void;
|
|
@@ -237,6 +241,9 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
237
241
|
scrim: {
|
|
238
242
|
type: PropType<boolean>;
|
|
239
243
|
};
|
|
244
|
+
scrimOpacity: {
|
|
245
|
+
type: PropType<number>;
|
|
246
|
+
};
|
|
240
247
|
eager: {
|
|
241
248
|
type: PropType<boolean>;
|
|
242
249
|
};
|
|
@@ -249,7 +256,6 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
249
256
|
closeClickScrim: {
|
|
250
257
|
type: PropType<boolean>;
|
|
251
258
|
};
|
|
252
|
-
modal: PropType<boolean>;
|
|
253
259
|
contentStyles: {
|
|
254
260
|
type: PropType<import("vue").CSSProperties>;
|
|
255
261
|
default: () => void;
|
|
@@ -270,13 +276,14 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
270
276
|
type: PropType<number>;
|
|
271
277
|
default: number;
|
|
272
278
|
};
|
|
279
|
+
modal: PropType<boolean>;
|
|
273
280
|
}, {
|
|
274
281
|
complementClickOption: {
|
|
275
282
|
handler: (mouseEvent: MouseEvent) => void;
|
|
276
283
|
determine?: ((event: Event) => boolean) | undefined;
|
|
277
284
|
include?: (() => (HTMLElement | undefined)[]) | undefined;
|
|
278
285
|
};
|
|
279
|
-
layerGroup: import("vue").ComputedRef<
|
|
286
|
+
layerGroup: import("vue").ComputedRef<HTMLElement>;
|
|
280
287
|
active: import("vue").WritableComputedRef<boolean>;
|
|
281
288
|
rendered: import("vue").ComputedRef<boolean>;
|
|
282
289
|
lazyValue: import("vue").ComputedRef<any>;
|
|
@@ -1849,6 +1856,8 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
1849
1856
|
"text-anchor"?: import("csstype").Property.TextAnchor | undefined;
|
|
1850
1857
|
"vector-effect"?: import("csstype").Property.VectorEffect | undefined;
|
|
1851
1858
|
}>;
|
|
1859
|
+
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
1860
|
+
getActiveLayers: () => import("vue").ComponentInternalInstance[];
|
|
1852
1861
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1853
1862
|
'update:modelValue': (value: boolean) => true;
|
|
1854
1863
|
'click:complement': (mouseEvent: MouseEvent) => true;
|
|
@@ -1896,6 +1905,9 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
1896
1905
|
scrim: {
|
|
1897
1906
|
type: PropType<boolean>;
|
|
1898
1907
|
};
|
|
1908
|
+
scrimOpacity: {
|
|
1909
|
+
type: PropType<number>;
|
|
1910
|
+
};
|
|
1899
1911
|
eager: {
|
|
1900
1912
|
type: PropType<boolean>;
|
|
1901
1913
|
};
|
|
@@ -1908,7 +1920,6 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
1908
1920
|
closeClickScrim: {
|
|
1909
1921
|
type: PropType<boolean>;
|
|
1910
1922
|
};
|
|
1911
|
-
modal: PropType<boolean>;
|
|
1912
1923
|
contentStyles: {
|
|
1913
1924
|
type: PropType<import("vue").CSSProperties>;
|
|
1914
1925
|
default: () => void;
|
|
@@ -1929,6 +1940,7 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
1929
1940
|
type: PropType<number>;
|
|
1930
1941
|
default: number;
|
|
1931
1942
|
};
|
|
1943
|
+
modal: PropType<boolean>;
|
|
1932
1944
|
}>> & {
|
|
1933
1945
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1934
1946
|
onAfterLeave?: (() => any) | undefined;
|
|
@@ -1998,6 +2010,9 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
1998
2010
|
scrim: {
|
|
1999
2011
|
type: PropType<boolean>;
|
|
2000
2012
|
};
|
|
2013
|
+
scrimOpacity: {
|
|
2014
|
+
type: PropType<number>;
|
|
2015
|
+
};
|
|
2001
2016
|
eager: {
|
|
2002
2017
|
type: PropType<boolean>;
|
|
2003
2018
|
};
|
|
@@ -2010,7 +2025,6 @@ export declare const YMenu: import("vue").DefineComponent<{
|
|
|
2010
2025
|
closeClickScrim: {
|
|
2011
2026
|
type: PropType<boolean>;
|
|
2012
2027
|
};
|
|
2013
|
-
modal: PropType<boolean>;
|
|
2014
2028
|
contentStyles: {
|
|
2015
2029
|
type: PropType<import("vue").CSSProperties>;
|
|
2016
2030
|
default: () => void;
|
|
@@ -81,6 +81,9 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
81
81
|
scrim: {
|
|
82
82
|
type: PropType<boolean>;
|
|
83
83
|
};
|
|
84
|
+
scrimOpacity: {
|
|
85
|
+
type: PropType<number>;
|
|
86
|
+
};
|
|
84
87
|
eager: {
|
|
85
88
|
type: PropType<boolean>;
|
|
86
89
|
};
|
|
@@ -93,7 +96,6 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
93
96
|
closeClickScrim: {
|
|
94
97
|
type: PropType<boolean>;
|
|
95
98
|
};
|
|
96
|
-
modal: PropType<boolean>;
|
|
97
99
|
contentStyles: {
|
|
98
100
|
type: PropType<CSSProperties>;
|
|
99
101
|
default: () => void;
|
|
@@ -114,13 +116,14 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
114
116
|
type: PropType<number>;
|
|
115
117
|
default: number;
|
|
116
118
|
};
|
|
119
|
+
modal: PropType<boolean>;
|
|
117
120
|
}, {
|
|
118
121
|
complementClickOption: {
|
|
119
122
|
handler: (mouseEvent: MouseEvent) => void;
|
|
120
123
|
determine?: ((event: Event) => boolean) | undefined;
|
|
121
124
|
include?: (() => (HTMLElement | undefined)[]) | undefined;
|
|
122
125
|
};
|
|
123
|
-
layerGroup: import("vue").ComputedRef<
|
|
126
|
+
layerGroup: import("vue").ComputedRef<HTMLElement>;
|
|
124
127
|
active: import("vue").WritableComputedRef<boolean>;
|
|
125
128
|
rendered: import("vue").ComputedRef<boolean>;
|
|
126
129
|
lazyValue: import("vue").ComputedRef<any>;
|
|
@@ -1693,6 +1696,8 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
1693
1696
|
"text-anchor"?: import("csstype").Property.TextAnchor | undefined;
|
|
1694
1697
|
"vector-effect"?: import("csstype").Property.VectorEffect | undefined;
|
|
1695
1698
|
}>;
|
|
1699
|
+
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
1700
|
+
getActiveLayers: () => import("vue").ComponentInternalInstance[];
|
|
1696
1701
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
1697
1702
|
'update:modelValue': (value: boolean) => true;
|
|
1698
1703
|
'click:complement': (mouseEvent: MouseEvent) => true;
|
|
@@ -1740,6 +1745,9 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
1740
1745
|
scrim: {
|
|
1741
1746
|
type: PropType<boolean>;
|
|
1742
1747
|
};
|
|
1748
|
+
scrimOpacity: {
|
|
1749
|
+
type: PropType<number>;
|
|
1750
|
+
};
|
|
1743
1751
|
eager: {
|
|
1744
1752
|
type: PropType<boolean>;
|
|
1745
1753
|
};
|
|
@@ -1752,7 +1760,6 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
1752
1760
|
closeClickScrim: {
|
|
1753
1761
|
type: PropType<boolean>;
|
|
1754
1762
|
};
|
|
1755
|
-
modal: PropType<boolean>;
|
|
1756
1763
|
contentStyles: {
|
|
1757
1764
|
type: PropType<CSSProperties>;
|
|
1758
1765
|
default: () => void;
|
|
@@ -1773,6 +1780,7 @@ export declare const YTooltip: import("vue").DefineComponent<{
|
|
|
1773
1780
|
type: PropType<number>;
|
|
1774
1781
|
default: number;
|
|
1775
1782
|
};
|
|
1783
|
+
modal: PropType<boolean>;
|
|
1776
1784
|
}>> & {
|
|
1777
1785
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
1778
1786
|
onAfterLeave?: (() => any) | undefined;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type { Ref } from 'vue';
|
|
1
|
+
import type { Ref, ComponentInternalInstance } from 'vue';
|
|
2
2
|
export declare const Y_LAYER_GROUP_CLASS_NAME = "y-layer-group";
|
|
3
3
|
export declare function useLayerGroup(target?: Ref<string | Element>): {
|
|
4
|
-
layerGroup: import("vue").ComputedRef<
|
|
4
|
+
layerGroup: import("vue").ComputedRef<HTMLElement>;
|
|
5
|
+
layerGroupState: WeakMap<HTMLElement, Set<any>>;
|
|
6
|
+
getActiveLayers: () => ComponentInternalInstance[];
|
|
5
7
|
};
|