yuyeon 0.0.35 → 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/components/select/YSelect.mjs +1 -1
- package/lib/components/select/YSelect.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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UACf,OAAAT,YAAA,CAAAC,SAAA,SAAU3C,KAAK,CAACd,OAAO,GAAG,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,EAAE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AI,OAAAvE,KAAA,CAAA0E,KAAA,GAAAC,KAAA,MAAAA,KAAA,GAAAD,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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"YSelect.mjs","names":["shallowRef","computed","defineComponent","mergeProps","ref","useModelDuplex","useRender","pressCoordinateProps","pressListItemsPropsOptions","useItems","wrapInArray","deepEqual","getObjectValueByPath","omit","chooseProps","propsFactory","YCard","YFieldInput","pressYFieldInputPropsOptions","YIconDropdown","YList","YListItem","YMenu","returnItemEquals","optionsItem","valueItem","valueKey","arguments","length","undefined","valueItemType","itemValue","pressSelectPropsOptions","opened","Boolean","multiple","weakEquals","valueEquals","type","Function","default","defaultSelect","pressYSelectPropsOptions","maxHeight","Number","String","expandIcon","Object","position","YSelect","name","props","emits","value","setup","_ref","slots","fieldInputRef","menuRef","listRef","focused","items","toRefineItems","toEmitItems","model","v","emitValue","selections","map","filter","item","selected","selection","isSelected","find","selectedItem","onMousedownDisplay","event","disabled","onBlur","$el","contains","relatedTarget","onClickItem","select","onAfterLeave","focus","index","findIndex","neo","slice","splice","displayText","text","join","fieldInputProps","_createVNode","$event","offset","origin","base","_len","args","Array","_key","_mergeProps","leading","_len2","_key2","trailing","menu","e","_createTextVNode"],"sources":["../../../src/components/select/YSelect.tsx"],"sourcesContent":["import { shallowRef } from '@vue/runtime-core';\r\nimport type { PropType } from 'vue';\r\nimport { computed, defineComponent, mergeProps, ref } from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport {\r\n ListItem,\r\n pressListItemsPropsOptions,\r\n useItems,\r\n} from '../../composables/list-items';\r\nimport { wrapInArray } from '../../util/array';\r\nimport {deepEqual, getObjectValueByPath, getPropertyFromItem, omit} from '../../util/common';\r\nimport { chooseProps, propsFactory } from '../../util/vue-component';\r\nimport { YCard } from '../card';\r\nimport { YFieldInput, pressYFieldInputPropsOptions } from '../field-input';\r\nimport { YIconDropdown } from '../icons/YIconDropdown';\r\nimport { YList, YListItem } from '../list';\r\nimport { YMenu } from '../menu';\r\n\r\nimport './YSelect.scss';\r\n\r\nexport type SelectEquals = (\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey?: string,\r\n) => boolean;\r\n\r\nexport function returnItemEquals(\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey = 'value',\r\n) {\r\n const valueItemType = typeof valueItem;\r\n const itemValue =\r\n valueItemType === 'string' || valueItemType === 'number'\r\n ? getObjectValueByPath(optionsItem, valueKey)\r\n : optionsItem;\r\n return deepEqual(itemValue, valueItem);\r\n}\r\n\r\nexport const pressSelectPropsOptions = propsFactory(\r\n {\r\n opened: Boolean as PropType<boolean>,\r\n multiple: Boolean,\r\n weakEquals: Boolean,\r\n valueEquals: {\r\n type: Function as PropType<SelectEquals>,\r\n default: deepEqual,\r\n },\r\n defaultSelect: Boolean,\r\n ...pressListItemsPropsOptions(),\r\n },\r\n 'Select',\r\n);\r\n\r\nexport const pressYSelectPropsOptions = propsFactory(\r\n {\r\n maxHeight: {\r\n type: [Number, String],\r\n default: 310,\r\n },\r\n expandIcon: {\r\n type: Object,\r\n },\r\n ...pressSelectPropsOptions(),\r\n ...pressYFieldInputPropsOptions(),\r\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\r\n 'coordinateStrategy',\r\n ]),\r\n },\r\n 'YSelect',\r\n);\r\n\r\nexport const YSelect = defineComponent({\r\n name: 'YSelect',\r\n props: {\r\n ...pressYSelectPropsOptions(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: any) => true,\r\n 'update:opened': (opened: boolean) => true,\r\n },\r\n setup(props, { slots }) {\r\n const fieldInputRef = ref();\r\n const menuRef = ref();\r\n const listRef = ref<InstanceType<typeof YList>>();\r\n\r\n const opened = useModelDuplex(props, 'opened');\r\n const focused = shallowRef(false);\r\n\r\n const { items, toRefineItems, toEmitItems } = useItems(props);\r\n const model = useModelDuplex(\r\n props,\r\n 'modelValue',\r\n [],\r\n (v) => toRefineItems(v === null ? [null] : wrapInArray(v)),\r\n (v) => {\r\n const emitValue = toEmitItems(wrapInArray(v));\r\n return props.multiple ? emitValue : emitValue[0] ?? null;\r\n },\r\n );\r\n\r\n const selections = computed<ListItem[]>(() => {\r\n return model.value.map((v: any) => {\r\n return items.value.filter((item) => {\r\n return props.valueEquals(item.value, v.value);\r\n });\r\n });\r\n });\r\n\r\n const selected = computed(() => {\r\n return selections.value.map((selection) => selection.props.value);\r\n });\r\n\r\n function isSelected(item: ListItem) {\r\n return !!selections.value.find((selectedItem) => {\r\n return selectedItem.value === item.value;\r\n });\r\n }\r\n\r\n // Field\r\n function onMousedownDisplay(event: MouseEvent) {\r\n if (props.disabled) {\r\n return;\r\n }\r\n opened.value = !opened.value;\r\n }\r\n\r\n function onBlur(event: FocusEvent) {\r\n if (listRef.value?.$el.contains(event.relatedTarget)) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n // Menu Contents\r\n function onClickItem(item: ListItem) {\r\n select(item);\r\n if (!props.multiple) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n function onAfterLeave() {\r\n if (focused.value) {\r\n fieldInputRef.value?.focus();\r\n }\r\n }\r\n\r\n function select(item: ListItem) {\r\n if (props.multiple) {\r\n const index = selections.value.findIndex((selectedItem) => {\r\n return selectedItem.value === item.value;\r\n });\r\n if (index === -1) {\r\n model.value = [...model.value, item];\r\n } else {\r\n const neo = model.value.slice();\r\n neo.splice(index, 1);\r\n model.value = neo;\r\n }\r\n } else {\r\n model.value = [item];\r\n }\r\n }\r\n\r\n const displayText = computed(() => {\r\n if (props.multiple) {\r\n return selections.value.map((item) => item.text).join(', ');\r\n }\r\n return selections.value?.[0]?.text ?? '';\r\n });\r\n\r\n useRender(() => {\r\n const fieldInputProps = chooseProps(props, YFieldInput.props);\r\n return (\r\n <YMenu\r\n v-model={opened.value}\r\n ref={menuRef}\r\n offset={props.offset}\r\n position={props.position}\r\n origin={props.origin}\r\n content-classes={['y-select__content']}\r\n maxHeight={props.maxHeight}\r\n open-on-click-base={false}\r\n onAfterLeave={onAfterLeave}\r\n >\r\n {{\r\n base: (...args: any[]) =>\r\n slots.base ? (\r\n slots.base?.(...args)\r\n ) : (\r\n <YFieldInput\r\n {...{\r\n ...fieldInputProps,\r\n ...mergeProps({ ...args[0].props }, { ref: fieldInputRef }),\r\n }}\r\n onMousedown:display={onMousedownDisplay}\r\n onBlur={onBlur}\r\n readonly\r\n class={['y-select', { 'y-select--opened': opened.value }]}\r\n v-model:focused={focused.value}\r\n >\r\n {{\r\n default: () => {\r\n return (\r\n <div class={['y-select__selection']}>\r\n {slots.selection\r\n ? slots.selection?.()\r\n : displayText.value}\r\n </div>\r\n );\r\n },\r\n leading: slots.leading\r\n ? (...args: any[]) => slots.leading?.(...args)\r\n : undefined,\r\n trailing: (...args: any[]) => {\r\n return slots['expand-icon'] ? (\r\n slots['expand-icon']()\r\n ) : (\r\n <i class=\"y-select__icon\">\r\n <YIconDropdown></YIconDropdown>\r\n </i>\r\n );\r\n },\r\n 'helper-text': slots['helper-text']\r\n ? slots['helper-text']?.()\r\n : undefined,\r\n }}\r\n </YFieldInput>\r\n ),\r\n default: () =>\r\n slots.menu ? (\r\n slots.menu()\r\n ) : (\r\n <YCard>\r\n {items.value.length > 0 ? (\r\n <YList ref={listRef}>\r\n {items.value.map((item) => {\r\n return (\r\n <YListItem\r\n onClick={(e) => onClickItem(item)}\r\n class={{ 'y-list-item--active': isSelected(item) }}\r\n >\r\n {item.text}\r\n </YListItem>\r\n );\r\n })}\r\n </YList>\r\n ) : (\r\n <div class=\"y-select__no-options\">항목이 없습니다.</div>\r\n )}\r\n </YCard>\r\n ),\r\n }}\r\n </YMenu>\r\n );\r\n });\r\n\r\n return {\r\n fieldInputRef,\r\n model,\r\n selections,\r\n selected,\r\n };\r\n },\r\n});\r\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,QAAQ,EAAEC,eAAe,EAAEC,UAAU,EAAEC,GAAG,QAAQ,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SAG3BC,0BAA0B,EAC1BC,QAAQ;AAAA,SAEDC,WAAW;AAAA,SACZC,SAAS,EAAEC,oBAAoB,EAAuBC,IAAI;AAAA,SACzDC,WAAW,EAAEC,YAAY;AAAA,SACzBC,KAAK;AAAA,SACLC,WAAW,EAAEC,4BAA4B;AAAA,SACzCC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAEd;AAQA,OAAO,SAASC,gBAAgBA,CAC9BC,WAAgB,EAChBC,SAAc,EAEd;EAAA,IADAC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,OAAO;EAElB,MAAMG,aAAa,GAAG,OAAOL,SAAS;EACtC,MAAMM,SAAS,GACbD,aAAa,KAAK,QAAQ,IAAIA,aAAa,KAAK,QAAQ,GACpDlB,oBAAoB,CAACY,WAAW,EAAEE,QAAQ,CAAC,GAC3CF,WAAW;EACjB,OAAOb,SAAS,CAACoB,SAAS,EAAEN,SAAS,CAAC;AACxC;AAEA,OAAO,MAAMO,uBAAuB,GAAGjB,YAAY,CACjD;EACEkB,MAAM,EAAEC,OAA4B;EACpCC,QAAQ,EAAED,OAAO;EACjBE,UAAU,EAAEF,OAAO;EACnBG,WAAW,EAAE;IACXC,IAAI,EAAEC,QAAkC;IACxCC,OAAO,EAAE7B;EACX,CAAC;EACD8B,aAAa,EAAEP,OAAO;EAC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AACR,KAAK,CAACe,GAAG,CAAEE,IAAI,IAAK;cACzB,OAAA0B,YAAA,CAAA3E,SAAA;gBAAA,WAEc0F,CAAC,IAAK5B,WAAW,CAACb,IAAI,CAAC;gBAAA,SAC1B;kBAAE,qBAAqB,EAAEG,UAAU,CAACH,IAAI;gBAAE;cAAC;gBAAA9B,OAAA,EAAAA,CAAA,MAEjD8B,IAAI,CAACuB,IAAI;cAAA;YAGhB,CAAC,CAAC;UAAA,KAAAG,YAAA;YAAA,SAGO;UAAsB,IAAAgB,gBAAA,kDAClC;QAAA;MAEJ;IAIX,CAAC,CAAC;IAEF,OAAO;MACLvD,aAAa;MACbO,KAAK;MACLG,UAAU;MACVI;IACF,CAAC;EACH;AACF,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"YSelect.mjs","names":["shallowRef","computed","defineComponent","mergeProps","ref","useModelDuplex","useRender","pressCoordinateProps","pressListItemsPropsOptions","useItems","wrapInArray","deepEqual","getObjectValueByPath","omit","chooseProps","propsFactory","YCard","YFieldInput","pressYFieldInputPropsOptions","YIconDropdown","YList","YListItem","YMenu","returnItemEquals","optionsItem","valueItem","valueKey","arguments","length","undefined","valueItemType","itemValue","pressSelectPropsOptions","opened","Boolean","multiple","weakEquals","valueEquals","type","Function","default","defaultSelect","pressYSelectPropsOptions","maxHeight","Number","String","expandIcon","Object","position","YSelect","name","props","emits","value","setup","_ref","slots","fieldInputRef","menuRef","listRef","focused","items","toRefineItems","toEmitItems","model","v","emitValue","selections","map","find","item","selected","selection","isSelected","selectedItem","onMousedownDisplay","event","disabled","onBlur","$el","contains","relatedTarget","onClickItem","select","onAfterLeave","focus","index","findIndex","neo","slice","splice","displayText","text","join","fieldInputProps","_createVNode","$event","offset","origin","base","_len","args","Array","_key","_mergeProps","leading","_len2","_key2","trailing","menu","e","_createTextVNode"],"sources":["../../../src/components/select/YSelect.tsx"],"sourcesContent":["import { shallowRef } from '@vue/runtime-core';\r\nimport type { PropType } from 'vue';\r\nimport { computed, defineComponent, mergeProps, ref } from 'vue';\r\n\r\nimport { useModelDuplex } from '../../composables/communication';\r\nimport { useRender } from '../../composables/component';\r\nimport { pressCoordinateProps } from '../../composables/coordinate';\r\nimport {\r\n ListItem,\r\n pressListItemsPropsOptions,\r\n useItems,\r\n} from '../../composables/list-items';\r\nimport { wrapInArray } from '../../util/array';\r\nimport {deepEqual, getObjectValueByPath, getPropertyFromItem, omit} from '../../util/common';\r\nimport { chooseProps, propsFactory } from '../../util/vue-component';\r\nimport { YCard } from '../card';\r\nimport { YFieldInput, pressYFieldInputPropsOptions } from '../field-input';\r\nimport { YIconDropdown } from '../icons/YIconDropdown';\r\nimport { YList, YListItem } from '../list';\r\nimport { YMenu } from '../menu';\r\n\r\nimport './YSelect.scss';\r\n\r\nexport type SelectEquals = (\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey?: string,\r\n) => boolean;\r\n\r\nexport function returnItemEquals(\r\n optionsItem: any,\r\n valueItem: any,\r\n valueKey = 'value',\r\n) {\r\n const valueItemType = typeof valueItem;\r\n const itemValue =\r\n valueItemType === 'string' || valueItemType === 'number'\r\n ? getObjectValueByPath(optionsItem, valueKey)\r\n : optionsItem;\r\n return deepEqual(itemValue, valueItem);\r\n}\r\n\r\nexport const pressSelectPropsOptions = propsFactory(\r\n {\r\n opened: Boolean as PropType<boolean>,\r\n multiple: Boolean,\r\n weakEquals: Boolean,\r\n valueEquals: {\r\n type: Function as PropType<SelectEquals>,\r\n default: deepEqual,\r\n },\r\n defaultSelect: Boolean,\r\n ...pressListItemsPropsOptions(),\r\n },\r\n 'Select',\r\n);\r\n\r\nexport const pressYSelectPropsOptions = propsFactory(\r\n {\r\n maxHeight: {\r\n type: [Number, String],\r\n default: 310,\r\n },\r\n expandIcon: {\r\n type: Object,\r\n },\r\n ...pressSelectPropsOptions(),\r\n ...pressYFieldInputPropsOptions(),\r\n ...omit(pressCoordinateProps({ position: 'bottom' as 'bottom' }), [\r\n 'coordinateStrategy',\r\n ]),\r\n },\r\n 'YSelect',\r\n);\r\n\r\nexport const YSelect = defineComponent({\r\n name: 'YSelect',\r\n props: {\r\n ...pressYSelectPropsOptions(),\r\n },\r\n emits: {\r\n 'update:modelValue': (value: any) => true,\r\n 'update:opened': (opened: boolean) => true,\r\n },\r\n setup(props, { slots }) {\r\n const fieldInputRef = ref();\r\n const menuRef = ref();\r\n const listRef = ref<InstanceType<typeof YList>>();\r\n\r\n const opened = useModelDuplex(props, 'opened');\r\n const focused = shallowRef(false);\r\n\r\n const { items, toRefineItems, toEmitItems } = useItems(props);\r\n const model = useModelDuplex(\r\n props,\r\n 'modelValue',\r\n [],\r\n (v) => toRefineItems(v === null ? [null] : wrapInArray(v)),\r\n (v) => {\r\n const emitValue = toEmitItems(wrapInArray(v));\r\n return props.multiple ? emitValue : emitValue[0] ?? null;\r\n },\r\n );\r\n\r\n const selections = computed<ListItem[]>(() => {\r\n return model.value.map((v: any) => {\r\n return items.value.find((item) => {\r\n return props.valueEquals(item.value, v.value);\r\n });\r\n });\r\n });\r\n\r\n const selected = computed(() => {\r\n return selections.value.map((selection) => selection.props.value);\r\n });\r\n\r\n function isSelected(item: ListItem) {\r\n return !!selections.value.find((selectedItem) => {\r\n return selectedItem.value === item.value;\r\n });\r\n }\r\n\r\n // Field\r\n function onMousedownDisplay(event: MouseEvent) {\r\n if (props.disabled) {\r\n return;\r\n }\r\n opened.value = !opened.value;\r\n }\r\n\r\n function onBlur(event: FocusEvent) {\r\n if (listRef.value?.$el.contains(event.relatedTarget)) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n // Menu Contents\r\n function onClickItem(item: ListItem) {\r\n select(item);\r\n if (!props.multiple) {\r\n opened.value = false;\r\n }\r\n }\r\n\r\n function onAfterLeave() {\r\n if (focused.value) {\r\n fieldInputRef.value?.focus();\r\n }\r\n }\r\n\r\n function select(item: ListItem) {\r\n if (props.multiple) {\r\n const index = selections.value.findIndex((selectedItem) => {\r\n return selectedItem.value === item.value;\r\n });\r\n if (index === -1) {\r\n model.value = [...model.value, item];\r\n } else {\r\n const neo = model.value.slice();\r\n neo.splice(index, 1);\r\n model.value = neo;\r\n }\r\n } else {\r\n model.value = [item];\r\n }\r\n }\r\n\r\n const displayText = computed(() => {\r\n if (props.multiple) {\r\n return selections.value.map((item) => item.text).join(', ');\r\n }\r\n return selections.value?.[0]?.text ?? '';\r\n });\r\n\r\n useRender(() => {\r\n const fieldInputProps = chooseProps(props, YFieldInput.props);\r\n return (\r\n <YMenu\r\n v-model={opened.value}\r\n ref={menuRef}\r\n offset={props.offset}\r\n position={props.position}\r\n origin={props.origin}\r\n content-classes={['y-select__content']}\r\n maxHeight={props.maxHeight}\r\n open-on-click-base={false}\r\n onAfterLeave={onAfterLeave}\r\n >\r\n {{\r\n base: (...args: any[]) =>\r\n slots.base ? (\r\n slots.base?.(...args)\r\n ) : (\r\n <YFieldInput\r\n {...{\r\n ...fieldInputProps,\r\n ...mergeProps({ ...args[0].props }, { ref: fieldInputRef }),\r\n }}\r\n onMousedown:display={onMousedownDisplay}\r\n onBlur={onBlur}\r\n readonly\r\n class={['y-select', { 'y-select--opened': opened.value }]}\r\n v-model:focused={focused.value}\r\n >\r\n {{\r\n default: () => {\r\n return (\r\n <div class={['y-select__selection']}>\r\n {slots.selection\r\n ? slots.selection?.()\r\n : displayText.value}\r\n </div>\r\n );\r\n },\r\n leading: slots.leading\r\n ? (...args: any[]) => slots.leading?.(...args)\r\n : undefined,\r\n trailing: (...args: any[]) => {\r\n return slots['expand-icon'] ? (\r\n slots['expand-icon']()\r\n ) : (\r\n <i class=\"y-select__icon\">\r\n <YIconDropdown></YIconDropdown>\r\n </i>\r\n );\r\n },\r\n 'helper-text': slots['helper-text']\r\n ? slots['helper-text']?.()\r\n : undefined,\r\n }}\r\n </YFieldInput>\r\n ),\r\n default: () =>\r\n slots.menu ? (\r\n slots.menu()\r\n ) : (\r\n <YCard>\r\n {items.value.length > 0 ? (\r\n <YList ref={listRef}>\r\n {items.value.map((item) => {\r\n return (\r\n <YListItem\r\n onClick={(e) => onClickItem(item)}\r\n class={{ 'y-list-item--active': isSelected(item) }}\r\n >\r\n {item.text}\r\n </YListItem>\r\n );\r\n })}\r\n </YList>\r\n ) : (\r\n <div class=\"y-select__no-options\">항목이 없습니다.</div>\r\n )}\r\n </YCard>\r\n ),\r\n }}\r\n </YMenu>\r\n );\r\n });\r\n\r\n return {\r\n fieldInputRef,\r\n model,\r\n selections,\r\n selected,\r\n };\r\n },\r\n});\r\n"],"mappings":";AAAA,SAASA,UAAU,QAAQ,mBAAmB;AAE9C,SAASC,QAAQ,EAAEC,eAAe,EAAEC,UAAU,EAAEC,GAAG,QAAQ,KAAK;AAAC,SAExDC,cAAc;AAAA,SACdC,SAAS;AAAA,SACTC,oBAAoB;AAAA,SAG3BC,0BAA0B,EAC1BC,QAAQ;AAAA,SAEDC,WAAW;AAAA,SACZC,SAAS,EAAEC,oBAAoB,EAAuBC,IAAI;AAAA,SACzDC,WAAW,EAAEC,YAAY;AAAA,SACzBC,KAAK;AAAA,SACLC,WAAW,EAAEC,4BAA4B;AAAA,SACzCC,aAAa;AAAA,SACbC,KAAK,EAAEC,SAAS;AAAA,SAChBC,KAAK;AAEd;AAQA,OAAO,SAASC,gBAAgBA,CAC9BC,WAAgB,EAChBC,SAAc,EAEd;EAAA,IADAC,QAAQ,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,OAAO;EAElB,MAAMG,aAAa,GAAG,OAAOL,SAAS;EACtC,MAAMM,SAAS,GACbD,aAAa,KAAK,QAAQ,IAAIA,aAAa,KAAK,QAAQ,GACpDlB,oBAAoB,CAACY,WAAW,EAAEE,QAAQ,CAAC,GAC3CF,WAAW;EACjB,OAAOb,SAAS,CAACoB,SAAS,EAAEN,SAAS,CAAC;AACxC;AAEA,OAAO,MAAMO,uBAAuB,GAAGjB,YAAY,CACjD;EACEkB,MAAM,EAAEC,OAA4B;EACpCC,QAAQ,EAAED,OAAO;EACjBE,UA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,CAACR,KAAK,CAACzB,MAAM,GAAG,CAAC,GAAAmE,YAAA,CAAA3E,KAAA;YAAA,OACTuC;UAAO;YAAAnB,OAAA,EAAAA,CAAA,MAChBqB,KAAK,CAACR,KAAK,CAACe,GAAG,CAAEE,IAAI,IAAK;cACzB,OAAAyB,YAAA,CAAA1E,SAAA;gBAAA,WAEcyF,CAAC,IAAK5B,WAAW,CAACZ,IAAI,CAAC;gBAAA,SAC1B;kBAAE,qBAAqB,EAAEG,UAAU,CAACH,IAAI;gBAAE;cAAC;gBAAA9B,OAAA,EAAAA,CAAA,MAEjD8B,IAAI,CAACsB,IAAI;cAAA;YAGhB,CAAC,CAAC;UAAA,KAAAG,YAAA;YAAA,SAGO;UAAsB,IAAAgB,gBAAA,kDAClC;QAAA;MAEJ;IAIX,CAAC,CAAC;IAEF,OAAO;MACLtD,aAAa;MACbO,KAAK;MACLG,UAAU;MACVI;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,MA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ACpDhC,eAAe,CAACyB,GAAG,CAACpB,UAAU,CAACE,KAAK,CAAC,EAAE0B,OAAO,CAAE1B,KAAK,IAAK;MACxD,IAAIA,KAAK,EAAE2B,GAAG,EAAEC,MAAM,EAAE;QACtBH,YAAY,CAACI,IAAI,CAAC7B,KAAK,CAAC;MAC1B;IACF,CAAC,CAAC;IACF,OAAOyB,YAAY;EACrB;EAEA,OAAO;IAAE3B,UAAU;IAAEL,eAAe;IAAE+B;EAAgB,CAAC;AACzD"}
|
package/lib/index.mjs
CHANGED
package/lib/index.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 };\n}\n\nexport { useTheme };\n"],"mappings":"OAAO,KAAKA,UAAU;AAAA,SACbC,WAAW;AAGpB,SAASC,QAAQ,EAAEC,QAAQ,QAAQ,KAAK;AAAC,SAGvCC,gBAAgB,EAChBC,iBAAiB,EACjBC,QAAQ;AAAA,OAEHC,SAAS,2CAEhB;AACA;AAEA,MAAMC,cAAc,GAAG;EACrBC,MAAM,EAAE;AACV,CAAC;AAQD,OAAO,SAASC,IAAIA,CAAA,EAAgC;EAAA,IAA/BC,OAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAGJ,cAAc;EAChD,MAAMO,WAAW,GAAGV,iBAAiB,CAACM,OAAO,EAAEK,KAAK,CAAC;EAErD,MAAMC,OAAO,GAAIC,GAAQ,IAAU;IACjCH,WAAW,CAACE,OAAO,CAACC,GAAG,CAAC;IAExB,MAAMC,MAAM,GAAGhB,QAAQ,CAAC;MACtBe,GAAG,EAAE,IAAwC;MAC7CE,IAAI,EAAE,IAA0B;MAChCJ,KAAK,EAAED,WAAW,CAACM;IACrB,CAAC,CAAC;IAEFC,MAAM,CAACC,IAAI,CAACvB,UAAU,CAAC,CAACwB,OAAO,CAAEC,aAAa,IAAK;MACjD,MAAMC,IAAI,GAAG1B,UAAU,CAACyB,aAAa,CAA4B;MACjEP,GAAG,CAACS,SAAS,CAACF,aAAa,EAAEC,IAAiB,CAAC;IACjD,CAAC,CAAC;IAEFR,GAAG,CAACU,SAAS,CAAC,YAAY,EAAErB,SAAS,CAAC;IAEtCW,GAAG,CAACW,OAAO,CAACzB,gBAAgB,EAAEe,MAAM,CAACH,KAAK,CAAC;IAE3CE,GAAG,CAACY,MAAM,CAACC,gBAAgB,CAACC,OAAO,GAAGb,MAAM;IAE5CjB,QAAQ,CAAC,MAAM;MACbiB,MAAM,CAACD,GAAG,GAAGA,GAAG,CAACe,SAAgB;MACjCd,MAAM,CAACC,IAAI,GAAGF,GAAG,CAACgB,UAAU;MAC5B,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;
|