yuyeon 0.0.20 → 0.0.22

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.
Files changed (32) hide show
  1. package/dist/yuyeon.js +1893 -1785
  2. package/dist/yuyeon.umd.cjs +3 -3
  3. package/lib/components/index.mjs.map +1 -1
  4. package/lib/components/layer/YLayer.mjs +26 -3
  5. package/lib/components/layer/YLayer.mjs.map +1 -1
  6. package/lib/components/layer/active-delay.mjs +28 -0
  7. package/lib/components/layer/active-delay.mjs.map +1 -0
  8. package/lib/components/layer/active-stack.mjs +50 -0
  9. package/lib/components/layer/active-stack.mjs.map +1 -0
  10. package/lib/components/menu/YMenu.mjs +32 -8
  11. package/lib/components/menu/YMenu.mjs.map +1 -1
  12. package/lib/components/tab/YTab.mjs.map +1 -1
  13. package/lib/components/tab/YTabs.mjs.map +1 -1
  14. package/lib/components/tab/index.mjs.map +1 -1
  15. package/lib/components/tree-view/YTreeViewNode.mjs +2 -1
  16. package/lib/components/tree-view/YTreeViewNode.mjs.map +1 -1
  17. package/lib/composables/choice.mjs +186 -0
  18. package/lib/composables/choice.mjs.map +1 -0
  19. package/lib/util/dom.mjs +12 -0
  20. package/lib/util/dom.mjs.map +1 -1
  21. package/lib/util/vue-component.mjs.map +1 -1
  22. package/package.json +108 -108
  23. package/types/components/dialog/YDialog.d.ts +28 -0
  24. package/types/components/layer/YLayer.d.ts +61 -0
  25. package/types/components/layer/active-delay.d.ts +4 -0
  26. package/types/components/layer/active-stack.d.ts +16 -0
  27. package/types/components/menu/YMenu.d.ts +67 -10
  28. package/types/components/tab/YTab.d.ts +7 -0
  29. package/types/components/tab/YTabs.d.ts +15 -0
  30. package/types/components/tab/index.d.ts +2 -0
  31. package/types/components/tooltip/YTooltip.d.ts +29 -1
  32. package/types/util/dom.d.ts +1 -0
@@ -0,0 +1,186 @@
1
+ import { computed, getCurrentInstance, inject, onBeforeUnmount, onMounted, provide, reactive, toRef, watch } from 'vue';
2
+ import { wrapInArray } from "../util/array.mjs";
3
+ import { deepEqual } from "../util/common.mjs";
4
+ import { findChildrenWithProvide, getUid, propsFactory } from "../util/vue-component.mjs";
5
+ import { useModelDuplex } from "./communication.mjs";
6
+ export const pressChoicePropsOptions = propsFactory({
7
+ modelValue: {
8
+ type: null,
9
+ default: undefined
10
+ },
11
+ multiple: Boolean,
12
+ mandatory: [Boolean, String],
13
+ max: Number,
14
+ selectedClass: String,
15
+ disabled: Boolean
16
+ }, 'choice');
17
+ export const pressChoiceItemPropsOptions = propsFactory({
18
+ value: null,
19
+ disabled: Boolean,
20
+ selectedClass: String
21
+ }, 'choice-item');
22
+ export function useChoiceItem(props, injectKey) {
23
+ let required = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
24
+ const vm = getCurrentInstance();
25
+ if (!vm) {
26
+ throw new Error('"useChoiceItem" must be used inside a component setup function');
27
+ }
28
+ const id = getUid();
29
+ provide(Symbol.for(`${injectKey.description}:id`), id);
30
+ const choiceProvider = inject(injectKey, null);
31
+ if (!choiceProvider) {
32
+ if (!required) return choiceProvider;
33
+ throw new Error(`Not found provider`);
34
+ }
35
+ const value = toRef(props, 'value');
36
+ const disabled = computed(() => !!(choiceProvider.disabled.value || props.disabled));
37
+ choiceProvider.register({
38
+ id,
39
+ value,
40
+ disabled
41
+ }, vm);
42
+ onBeforeUnmount(() => {
43
+ choiceProvider.unregister(id);
44
+ });
45
+ const isSelected = computed(() => {
46
+ return choiceProvider.isSelected(id);
47
+ });
48
+ const selectedClass = computed(() => isSelected.value && [choiceProvider.selectedClass.value, props.selectedClass]);
49
+ watch(isSelected, value => {
50
+ vm.emit('group:selected', {
51
+ value
52
+ });
53
+ });
54
+ return {
55
+ id,
56
+ isSelected,
57
+ toggle: () => choiceProvider.select(id, !isSelected.value),
58
+ select: value => choiceProvider.select(id, value),
59
+ selectedClass,
60
+ value,
61
+ disabled,
62
+ provider: choiceProvider
63
+ };
64
+ }
65
+ export function useChoice(props, injectKey) {
66
+ let isUnmounted = false;
67
+ const items = reactive([]);
68
+ const selected = useModelDuplex(props, 'modelValue', [], v => {
69
+ if (v == null) return [];
70
+ return getIds(items, wrapInArray(v));
71
+ }, v => {
72
+ const arr = getValues(items, v);
73
+ return props.multiple ? arr : arr[0];
74
+ });
75
+ const groupVm = getCurrentInstance();
76
+ function register(item, vm) {
77
+ const unwrapped = item;
78
+ const key = Symbol.for(`${injectKey.description}:id`);
79
+ const children = findChildrenWithProvide(key, groupVm?.vnode);
80
+ const index = children.indexOf(vm);
81
+ if (index > -1) {
82
+ items.splice(index, 0, unwrapped);
83
+ } else {
84
+ items.push(unwrapped);
85
+ }
86
+ }
87
+ function unregister(id) {
88
+ if (isUnmounted) return;
89
+ forceMandatoryValue();
90
+ const index = items.findIndex(item => item.id === id);
91
+ items.splice(index, 1);
92
+ }
93
+ function forceMandatoryValue() {
94
+ const item = items.find(item => !item.disabled);
95
+ if (item && props.mandatory === 'force' && !selected.value.length) {
96
+ selected.value = [item.id];
97
+ }
98
+ }
99
+ onMounted(() => {
100
+ forceMandatoryValue();
101
+ });
102
+ onBeforeUnmount(() => {
103
+ isUnmounted = true;
104
+ });
105
+ function select(id, value) {
106
+ const item = items.find(item => item.id === id);
107
+ if (value && item?.disabled) return;
108
+ if (props.multiple) {
109
+ const internalValue = selected.value.slice();
110
+ const index = internalValue.findIndex(v => v === id);
111
+ const isSelected = ~index;
112
+ value = value ?? !isSelected;
113
+ if (isSelected && props.mandatory && internalValue.length <= 1) return;
114
+ if (!isSelected && props.max != null && internalValue.length + 1 > props.max) return;
115
+ if (index < 0 && value) internalValue.push(id);else if (index >= 0 && !value) internalValue.splice(index, 1);
116
+ selected.value = internalValue;
117
+ } else {
118
+ const isSelected = selected.value.includes(id);
119
+ if (props.mandatory && isSelected) return;
120
+ selected.value = value ?? !isSelected ? [id] : [];
121
+ }
122
+ }
123
+ function step(offset) {
124
+ if (props.multiple) {}
125
+ if (!selected.value.length) {
126
+ const item = items.find(item => !item.disabled);
127
+ item && (selected.value = [item.id]);
128
+ } else {
129
+ const currentId = selected.value[0];
130
+ const currentIndex = items.findIndex(i => i.id === currentId);
131
+ let newIndex = (currentIndex + offset) % items.length;
132
+ let newItem = items[newIndex];
133
+ while (newItem.disabled && newIndex !== currentIndex) {
134
+ newIndex = (newIndex + offset) % items.length;
135
+ newItem = items[newIndex];
136
+ }
137
+ if (newItem.disabled) return;
138
+ selected.value = [items[newIndex].id];
139
+ }
140
+ }
141
+ const state = {
142
+ register,
143
+ unregister,
144
+ selected,
145
+ select,
146
+ disabled: toRef(props, 'disabled'),
147
+ prev: () => step(items.length - 1),
148
+ next: () => step(1),
149
+ isSelected: id => selected.value.includes(id),
150
+ selectedClass: computed(() => props.selectedClass),
151
+ items: computed(() => items),
152
+ getItemIndex: value => getItemIndex(items, value)
153
+ };
154
+ provide(injectKey, state);
155
+ return state;
156
+ }
157
+ function getItemIndex(items, value) {
158
+ const ids = getIds(items, [value]);
159
+ if (!ids.length) return -1;
160
+ return items.findIndex(item => item.id === ids[0]);
161
+ }
162
+ function getIds(items, modelValue) {
163
+ const ids = [];
164
+ modelValue.forEach(value => {
165
+ const item = items.find(item => deepEqual(value, item.value));
166
+ const itemByIndex = items[value];
167
+ if (item?.value != null) {
168
+ ids.push(item.id);
169
+ } else if (itemByIndex != null) {
170
+ ids.push(itemByIndex.id);
171
+ }
172
+ });
173
+ return ids;
174
+ }
175
+ function getValues(items, ids) {
176
+ const values = [];
177
+ ids.forEach(id => {
178
+ const itemIndex = items.findIndex(item => item.id === id);
179
+ if (~itemIndex) {
180
+ const item = items[itemIndex];
181
+ values.push(item.value != null ? item.value : itemIndex);
182
+ }
183
+ });
184
+ return values;
185
+ }
186
+ //# sourceMappingURL=choice.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice.mjs","names":["computed","getCurrentInstance","inject","onBeforeUnmount","onMounted","provide","reactive","toRef","watch","wrapInArray","deepEqual","findChildrenWithProvide","getUid","propsFactory","useModelDuplex","pressChoicePropsOptions","modelValue","type","default","undefined","multiple","Boolean","mandatory","String","max","Number","selectedClass","disabled","pressChoiceItemPropsOptions","value","useChoiceItem","props","injectKey","required","arguments","length","vm","Error","id","Symbol","for","description","choiceProvider","register","unregister","isSelected","emit","toggle","select","provider","useChoice","isUnmounted","items","selected","v","getIds","arr","getValues","groupVm","item","unwrapped","key","children","vnode","index","indexOf","splice","push","forceMandatoryValue","findIndex","find","internalValue","slice","includes","step","offset","currentId","currentIndex","i","newIndex","newItem","state","prev","next","getItemIndex","ids","forEach","itemByIndex","values","itemIndex"],"sources":["../../src/composables/choice.ts"],"sourcesContent":["import type {\n ComponentInternalInstance,\n ComputedRef,\n ExtractPropTypes,\n InjectionKey,\n PropType,\n Ref,\n UnwrapRef,\n} from 'vue';\nimport {\n computed,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n toRef,\n watch,\n} from 'vue';\n\nimport { wrapInArray } from '../util/array';\nimport { deepEqual } from '../util/common';\nimport {\n findChildrenWithProvide,\n getUid,\n propsFactory,\n} from '../util/vue-component';\nimport { useModelDuplex } from './communication';\n\nexport interface ChoiceItem {\n id: number;\n value: Ref<unknown>;\n disabled: Ref<boolean | undefined>;\n}\n\nexport interface ChoiceProps {\n disabled: boolean;\n modelValue: unknown;\n multiple?: boolean;\n mandatory?: boolean | 'force' | undefined;\n max?: number | undefined;\n selectedClass: string | undefined;\n 'onUpdate:modelValue': ((value: unknown) => void) | undefined;\n}\n\nexport interface ChoiceProvide {\n register: (item: ChoiceItem, instance: ComponentInternalInstance) => void;\n unregister: (id: number) => void;\n select: (id: number, value: boolean) => void;\n selected: Ref<Readonly<number[]>>;\n selectedClass: Ref<string | undefined>;\n isSelected: (id: number) => boolean;\n disabled: Ref<boolean | undefined>;\n getItemIndex: (value: unknown) => number;\n prev: () => void;\n next: () => void;\n items: ComputedRef<\n { id: number; value: unknown; disabled: boolean | undefined }[]\n >;\n}\n\nexport interface ChoiceItemProvide {\n id: number;\n isSelected: Ref<boolean>;\n toggle: () => void;\n select: (value: boolean) => void;\n selectedClass: Ref<(string | undefined)[] | false>;\n value: Ref<unknown>;\n disabled: Ref<boolean | undefined>;\n provider: ChoiceProvide;\n}\n\nexport const pressChoicePropsOptions = propsFactory(\n {\n modelValue: {\n type: null,\n default: undefined,\n },\n multiple: Boolean,\n mandatory: [Boolean, String] as PropType<boolean | 'force'>,\n max: Number,\n selectedClass: String,\n disabled: Boolean,\n },\n 'choice',\n);\n\nexport const pressChoiceItemPropsOptions = propsFactory(\n {\n value: null,\n disabled: Boolean,\n selectedClass: String,\n },\n 'choice-item',\n);\n\nexport interface ChoiceItemProps\n extends ExtractPropTypes<ReturnType<typeof pressChoiceItemPropsOptions>> {\n 'onChoice:selected': ((val: { value: boolean }) => void) | undefined;\n}\n\nexport function useChoiceItem(\n props: ChoiceItemProps,\n injectKey: InjectionKey<ChoiceProvide>,\n required?: true,\n): ChoiceItemProvide;\nexport function useChoiceItem(\n props: ChoiceItemProps,\n injectKey: InjectionKey<ChoiceProvide>,\n required: false,\n): ChoiceItemProvide | null;\nexport function useChoiceItem(\n props: ChoiceItemProps,\n injectKey: InjectionKey<ChoiceProvide>,\n required = true,\n): ChoiceItemProvide | null {\n const vm = getCurrentInstance();\n\n if (!vm) {\n throw new Error(\n '\"useChoiceItem\" must be used inside a component setup function',\n );\n }\n\n const id = getUid() as number;\n\n provide(Symbol.for(`${injectKey.description}:id`), id);\n\n const choiceProvider = inject(injectKey, null);\n\n if (!choiceProvider) {\n if (!required) return choiceProvider as null;\n\n throw new Error(`Not found provider`);\n }\n\n const value = toRef(props, 'value');\n const disabled = computed(\n () => !!(choiceProvider.disabled.value || props.disabled),\n );\n\n choiceProvider.register(\n {\n id,\n value,\n disabled,\n },\n vm,\n );\n\n onBeforeUnmount(() => {\n choiceProvider.unregister(id);\n });\n\n const isSelected = computed(() => {\n return choiceProvider.isSelected(id);\n });\n\n const selectedClass = computed(\n () =>\n isSelected.value && [\n choiceProvider.selectedClass.value,\n props.selectedClass,\n ],\n );\n\n watch(isSelected, (value) => {\n vm.emit('group:selected', { value });\n });\n\n return {\n id,\n isSelected,\n toggle: () => choiceProvider.select(id, !isSelected.value),\n select: (value: boolean) => choiceProvider.select(id, value),\n selectedClass,\n value,\n disabled,\n provider: choiceProvider,\n };\n}\n\nexport function useChoice(\n props: ChoiceProps,\n injectKey: InjectionKey<ChoiceProvide>,\n) {\n let isUnmounted = false;\n const items = reactive<ChoiceItem[]>([]);\n const selected = useModelDuplex(\n props,\n 'modelValue',\n [],\n (v) => {\n if (v == null) return [];\n\n return getIds(items, wrapInArray(v));\n },\n (v) => {\n const arr = getValues(items, v);\n\n return props.multiple ? arr : arr[0];\n },\n );\n\n const groupVm = getCurrentInstance();\n\n function register(item: ChoiceItem, vm: ComponentInternalInstance) {\n const unwrapped = item as unknown as UnwrapRef<ChoiceItem>;\n\n const key = Symbol.for(`${injectKey.description}:id`);\n const children = findChildrenWithProvide(key, groupVm?.vnode);\n const index = children.indexOf(vm);\n\n if (index > -1) {\n items.splice(index, 0, unwrapped);\n } else {\n items.push(unwrapped);\n }\n }\n\n function unregister(id: number) {\n if (isUnmounted) return;\n forceMandatoryValue();\n const index = items.findIndex((item) => item.id === id);\n items.splice(index, 1);\n }\n\n function forceMandatoryValue() {\n const item = items.find((item) => !item.disabled);\n if (item && props.mandatory === 'force' && !selected.value.length) {\n selected.value = [item.id];\n }\n }\n\n onMounted(() => {\n forceMandatoryValue();\n });\n\n onBeforeUnmount(() => {\n isUnmounted = true;\n });\n\n function select(id: number, value?: boolean) {\n const item = items.find((item) => item.id === id);\n if (value && item?.disabled) return;\n\n if (props.multiple) {\n const internalValue = selected.value.slice();\n const index = internalValue.findIndex((v: any) => v === id);\n const isSelected = ~index;\n value = value ?? !isSelected;\n if (isSelected && props.mandatory && internalValue.length <= 1) return;\n if (\n !isSelected &&\n props.max != null &&\n internalValue.length + 1 > props.max\n )\n return;\n\n if (index < 0 && value) internalValue.push(id);\n else if (index >= 0 && !value) internalValue.splice(index, 1);\n\n selected.value = internalValue;\n } else {\n const isSelected = selected.value.includes(id);\n if (props.mandatory && isSelected) return;\n\n selected.value = value ?? !isSelected ? [id] : [];\n }\n }\n\n function step(offset: number) {\n if (props.multiple) {\n }\n\n if (!selected.value.length) {\n const item = items.find((item) => !item.disabled);\n item && (selected.value = [item.id]);\n } else {\n const currentId = selected.value[0];\n const currentIndex = items.findIndex((i) => i.id === currentId);\n\n let newIndex = (currentIndex + offset) % items.length;\n let newItem = items[newIndex];\n\n while (newItem.disabled && newIndex !== currentIndex) {\n newIndex = (newIndex + offset) % items.length;\n newItem = items[newIndex];\n }\n\n if (newItem.disabled) return;\n\n selected.value = [items[newIndex].id];\n }\n }\n\n const state: ChoiceProvide = {\n register,\n unregister,\n selected,\n select,\n disabled: toRef(props, 'disabled'),\n prev: () => step(items.length - 1),\n next: () => step(1),\n isSelected: (id: number) => selected.value.includes(id),\n selectedClass: computed(() => props.selectedClass),\n items: computed(() => items),\n getItemIndex: (value: unknown) => getItemIndex(items, value),\n };\n\n provide(injectKey, state);\n\n return state;\n}\n\nfunction getItemIndex(items: UnwrapRef<ChoiceItem[]>, value: unknown) {\n const ids = getIds(items, [value]);\n\n if (!ids.length) return -1;\n\n return items.findIndex((item) => item.id === ids[0]);\n}\n\nfunction getIds(items: UnwrapRef<ChoiceItem[]>, modelValue: any[]) {\n const ids: number[] = [];\n\n modelValue.forEach((value) => {\n const item = items.find((item) => deepEqual(value, item.value));\n const itemByIndex = items[value];\n\n if (item?.value != null) {\n ids.push(item.id);\n } else if (itemByIndex != null) {\n ids.push(itemByIndex.id);\n }\n });\n\n return ids;\n}\n\nfunction getValues(items: UnwrapRef<ChoiceItem[]>, ids: any[]) {\n const values: unknown[] = [];\n\n ids.forEach((id) => {\n const itemIndex = items.findIndex((item) => item.id === id);\n if (~itemIndex) {\n const item = items[itemIndex];\n values.push(item.value != null ? item.value : itemIndex);\n }\n });\n\n return values;\n}\n"],"mappings":"AASA,SACEA,QAAQ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root;
7
7
  }
8
+ export function hasElementMouseEvent(mouseEvent, element, include) {
9
+ if (!mouseEvent) {
10
+ return false;
11
+ }
12
+ const root = documentRoot(element);
13
+ if (typeof ShadowRoot !== 'undefined' && root instanceof ShadowRoot && root.host === mouseEvent.target) {
14
+ return false;
15
+ }
16
+ const elements = include ?? [];
17
+ elements.push(element);
18
+ return !elements.some(el => el?.contains(mouseEvent.target));
19
+ }
8
20
  //# sourceMappingURL=dom.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dom.mjs","names":["documentRoot","domNode","root","getRootNode","document","composed"],"sources":["../../src/util/dom.ts"],"sourcesContent":["export function documentRoot(domNode: Node): null | HTMLDocument | ShadowRoot {\n const root = domNode.getRootNode();\n if (root !== document && root.getRootNode({ composed: true }) !== document)\n return null;\n return root as HTMLDocument | ShadowRoot;\n}\n"],"mappings":"AAAA,OAAO,SAASA,YAAYA,CAACC,OAAa,EAAoC;EAC5E,MAAMC,IAAI,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC;EAClC,IAAID,IAAI,KAAKE,QAAQ,IAAIF,IAAI,CAACC,WAAW,CAAC;IAAEE,QAAQ,EAAE;EAAK,CAAC,CAAC,KAAKD,QAAQ,EACxE,OAAO,IAAI;EACb,OAAOF,IAAI;AACb"}
1
+ {"version":3,"file":"dom.mjs","names":["documentRoot","domNode","root","getRootNode","document","composed","hasElementMouseEvent","mouseEvent","element","include","ShadowRoot","host","target","elements","push","some","el","contains"],"sources":["../../src/util/dom.ts"],"sourcesContent":["export function documentRoot(domNode: Node): null | HTMLDocument | ShadowRoot {\r\n const root = domNode.getRootNode();\r\n if (root !== document && root.getRootNode({ composed: true }) !== document)\r\n return null;\r\n return root as HTMLDocument | ShadowRoot;\r\n}\r\n\r\nexport function hasElementMouseEvent(\r\n mouseEvent: Event,\r\n element: HTMLElement,\r\n include?: HTMLElement[],\r\n): boolean {\r\n if (!mouseEvent) {\r\n return false;\r\n }\r\n const root = documentRoot(element);\r\n if (\r\n typeof ShadowRoot !== 'undefined' &&\r\n root instanceof ShadowRoot &&\r\n root.host === mouseEvent.target\r\n ) {\r\n return false;\r\n }\r\n const elements = include ?? [];\r\n elements.push(element);\r\n return !elements.some((el) => el?.contains(mouseEvent.target as Node));\r\n}\r\n"],"mappings":"AAAA,OAAO,SAASA,YAAYA,CAACC,OAAa,EAAoC;EAC5E,MAAMC,IAAI,GAAGD,OAAO,CAACE,WAAW,CAAC,CAAC;EAClC,IAAID,IAAI,KAAKE,QAAQ,IAAIF,IAAI,CAACC,WAAW,CAAC;IAAEE,QAAQ,EAAE;EAAK,CAAC,CAAC,KAAKD,QAAQ,EACxE,OAAO,IAAI;EACb,OAAOF,IAAI;AACb;AAEA,OAAO,SAASI,oBAAoBA,CAClCC,UAAiB,EACjBC,OAAoB,EACpBC,OAAuB,EACd;EACT,IAAI,CAACF,UAAU,EAAE;IACf,OAAO,KAAK;EACd;EACA,MAAML,IAAI,GAAGF,YAAY,CAACQ,OAAO,CAAC;EAClC,IACE,OAAOE,UAAU,KAAK,WAAW,IACjCR,IAAI,YAAYQ,UAAU,IAC1BR,IAAI,CAACS,IAAI,KAAKJ,UAAU,CAACK,MAAM,EAC/B;IACA,OAAO,KAAK;EACd;EACA,MAAMC,QAAQ,GAAGJ,OAAO,IAAI,EAAE;EAC9BI,QAAQ,CAACC,IAAI,CAACN,OAAO,CAAC;EACtB,OAAO,CAACK,QAAQ,CAACE,IAAI,CAAEC,EAAE,IAAKA,EAAE,EAAEC,QAAQ,CAACV,UAAU,CAACK,MAAc,CAAC,CAAC;AACxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"vue-component.mjs","names":["getCurrentInstance","hasOwnProperty","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","chooseProps","props","target","Object","keys","reduce","acc","prop","bindClasses","classes","boundClasses","Array","isArray","clas","getHtmlElement","$el","propsFactory","source","defaults","options","option","isObjectOption","objectOption","type","default"],"sources":["../../src/util/vue-component.ts"],"sourcesContent":["import type { IfAny } from '@vue/shared';\nimport type {\n ComponentObjectPropsOptions,\n ComponentPublicInstance,\n ExtractPropTypes,\n Prop,\n PropType,\n VNode,\n} from 'vue';\nimport { getCurrentInstance } from 'vue';\n\nimport { hasOwnProperty } from './common';\n\nexport function getSlot(\n vm: ComponentPublicInstance | any,\n // eslint-disable-next-line default-param-last\n name = 'default',\n data?: any | (() => any),\n optional = false,\n): VNode[] | undefined {\n if (vm.$slots?.[name]) {\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\n return slot.filter((node: VNode) => {\n return node.el?.nodeType !== 8;\n });\n }\n return undefined;\n}\n\nexport function getUid() {\n const vm = getCurrentInstance();\n return vm?.uid;\n}\n\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\n props: any,\n target: PropsOptions,\n): ExtractPropTypes<PropsOptions> {\n return Object.keys(target).reduce((acc, prop) => {\n if (props && prop in props) {\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\n }\n return acc;\n }, {} as ExtractPropTypes<PropsOptions>);\n}\n\nexport function bindClasses(\n classes: string | string[] | Record<string, any> | undefined,\n) {\n const boundClasses = {} as Record<string, boolean>;\n if (typeof classes === 'string') {\n boundClasses[classes] = true;\n } else if (Array.isArray(classes)) {\n (classes as string[]).reduce((acc, clas) => {\n acc[clas] = true;\n return acc;\n }, boundClasses);\n } else if (typeof classes === 'object') {\n Object.keys(classes).reduce((acc, clas) => {\n acc[clas] = !!classes[clas];\n return acc;\n }, boundClasses);\n }\n return boundClasses;\n}\n\nexport function getHtmlElement<N extends object | undefined>(\n node: N,\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\n return node && hasOwnProperty(node, '$el')\n ? ((node as ComponentPublicInstance).$el as HTMLElement)\n : (node as HTMLElement);\n}\n\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\n props: PropsOptions,\n source: string,\n) {\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\n defaults?: Defaults,\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\n return Object.keys(props).reduce<any>((options, prop) => {\n const option = props[prop];\n const isObjectOption =\n typeof option === 'object' && option != null && !Array.isArray(option);\n const objectOption = isObjectOption ? option : { type: option };\n if (defaults && prop in defaults) {\n options[prop] = {\n ...objectOption,\n default: defaults[prop],\n };\n } else {\n options[prop] = objectOption;\n }\n\n if (source && !options[prop].source) {\n options[prop].source = source;\n }\n return options;\n }, {} as PropsOptions);\n };\n}\n\ntype OverwrittenPropOptions<\n T extends ComponentObjectPropsOptions,\n D extends PartialKeys<T>,\n> = {\n [P in keyof T]-?: unknown extends D[P]\n ? T[P]\n : T[P] extends Record<string, unknown>\n ? Omit<T[P], 'type' | 'default'> & {\n type: FollowPropType<Pick<T[P], 'type'>, T[P], D[P]>;\n default: MergeDefault<T[P], D[P]>;\n }\n : {\n type: PropType<MergeDefault<P, D>>;\n default: MergeDefault<T[P], D[P]>;\n };\n};\n\ntype MergeDefault<T, D> = unknown extends D\n ? InferPropType<T>\n : NonNullable<InferPropType<T>> | D;\n\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\n ? T\n : PropType<MergeDefault<P, D>>;\n\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\n\n// Copied from Vue\ntype InferPropType<T> = [T] extends [null]\n ? any // null & true would fail to infer\n : [T] extends [{ type: null | true }]\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\n any\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\n ? Record<string, any>\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\n ? boolean\n : [T] extends [DateConstructor | { type: DateConstructor }]\n ? Date\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\n ? U extends DateConstructor\n ? Date | InferPropType<U>\n : InferPropType<U>\n : [T] extends [Prop<infer V, infer D>]\n ? unknown extends V\n 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ACxE,MAAME,YAAY,GAAGD,cAAc,GAAGD,MAAM,GAAG;QAAEG,IAAI,EAAEH;MAAO,CAAC;MAC/D,IAAIF,QAAQ,IAAIX,IAAI,IAAIW,QAAQ,EAAE;QAChCC,OAAO,CAACZ,IAAI,CAAC,GAAG;UACd,GAAGe,YAAY;UACfE,OAAO,EAAEN,QAAQ,CAACX,IAAI;QACxB,CAAC;MACH,CAAC,MAAM;QACLY,OAAO,CAACZ,IAAI,CAAC,GAAGe,YAAY;MAC9B;MAEA,IAAIL,MAAM,IAAI,CAACE,OAAO,CAACZ,IAAI,CAAC,CAACU,MAAM,EAAE;QACnCE,OAAO,CAACZ,IAAI,CAAC,CAACU,MAAM,GAAGA,MAAM;MAC/B;MACA,OAAOE,OAAO;IAChB,CAAC,EAAE,CAAC,CAAiB,CAAC;EACxB,CAAC;AACH;;AA6BA"}
1
+ {"version":3,"file":"vue-component.mjs","names":["getCurrentInstance","hasOwnProperty","getSlot","vm","name","arguments","length","undefined","data","optional","$slots","slot","Function","filter","node","el","nodeType","getUid","uid","chooseProps","props","target","Object","keys","reduce","acc","prop","bindClasses","classes","boundClasses","Array","isArray","clas","getHtmlElement","$el","propsFactory","source","defaults","options","option","isObjectOption","objectOption","type","default"],"sources":["../../src/util/vue-component.ts"],"sourcesContent":["import type { IfAny } from '@vue/shared';\r\nimport type {\r\n ComponentObjectPropsOptions,\r\n ComponentPublicInstance,\r\n ExtractPropTypes,\r\n Prop,\r\n PropType,\r\n VNode,\r\n} from 'vue';\r\nimport { getCurrentInstance } from 'vue';\r\n\r\nimport { hasOwnProperty } from './common';\r\n\r\nexport function getSlot(\r\n vm: ComponentPublicInstance | any,\r\n // eslint-disable-next-line default-param-last\r\n name = 'default',\r\n data?: any | (() => any),\r\n optional = false,\r\n): VNode[] | undefined {\r\n if (vm.$slots?.[name]) {\r\n const slot = vm.$slots[name]!(data instanceof Function ? data() : data);\r\n return slot.filter((node: VNode) => {\r\n return node.el?.nodeType !== 8;\r\n });\r\n }\r\n return undefined;\r\n}\r\n\r\nexport function getUid() {\r\n const vm = getCurrentInstance();\r\n return vm?.uid;\r\n}\r\n\r\nexport function chooseProps<PropsOptions extends ComponentObjectPropsOptions>(\r\n props: any,\r\n target: PropsOptions,\r\n): ExtractPropTypes<PropsOptions> {\r\n return Object.keys(target).reduce((acc, prop) => {\r\n if (props && prop in props) {\r\n acc[prop as keyof ExtractPropTypes<PropsOptions>] = props[prop];\r\n }\r\n return acc;\r\n }, {} as ExtractPropTypes<PropsOptions>);\r\n}\r\n\r\nexport function bindClasses(\r\n classes: string | string[] | Record<string, any> | undefined,\r\n) {\r\n const boundClasses = {} as Record<string, boolean>;\r\n if (typeof classes === 'string') {\r\n boundClasses[classes] = true;\r\n } else if (Array.isArray(classes)) {\r\n (classes as string[]).reduce((acc, clas) => {\r\n acc[clas] = true;\r\n return acc;\r\n }, boundClasses);\r\n } else if (typeof classes === 'object') {\r\n Object.keys(classes).reduce((acc, clas) => {\r\n acc[clas] = !!classes[clas];\r\n return acc;\r\n }, boundClasses);\r\n }\r\n return boundClasses;\r\n}\r\n\r\nexport function getHtmlElement<N extends object | undefined>(\r\n node: N,\r\n): Exclude<N, ComponentPublicInstance> | HTMLElement {\r\n return node && hasOwnProperty(node, '$el')\r\n ? ((node as ComponentPublicInstance).$el as HTMLElement)\r\n : (node as HTMLElement);\r\n}\r\n\r\nexport function propsFactory<PropsOptions extends ComponentObjectPropsOptions>(\r\n props: PropsOptions,\r\n source: string,\r\n) {\r\n return <Defaults extends PartialKeys<PropsOptions> = {}>(\r\n defaults?: Defaults,\r\n ): OverwrittenPropOptions<PropsOptions, Defaults> => {\r\n return Object.keys(props).reduce<any>((options, prop) => {\r\n const option = props[prop];\r\n const isObjectOption =\r\n typeof option === 'object' && option != null && !Array.isArray(option);\r\n const objectOption = isObjectOption ? option : { type: option };\r\n if (defaults && prop in defaults) {\r\n options[prop] = {\r\n ...objectOption,\r\n default: defaults[prop],\r\n };\r\n } else {\r\n options[prop] = objectOption;\r\n }\r\n\r\n if (source && !options[prop].source) {\r\n options[prop].source = source;\r\n }\r\n return options;\r\n }, {} as PropsOptions);\r\n };\r\n}\r\n\r\ntype OverwrittenPropOptions<\r\n T extends ComponentObjectPropsOptions,\r\n D extends PartialKeys<T>,\r\n> = {\r\n [P in keyof T]-?: unknown extends D[P]\r\n ? T[P]\r\n : T[P] extends Record<string, unknown>\r\n ? Omit<T[P], 'type' | 'default'> & {\r\n type: FollowPropType<Pick<T[P], 'type'>, T[P], D[P]>;\r\n default: MergeDefault<T[P], D[P]>;\r\n }\r\n : {\r\n type: PropType<MergeDefault<P, D>>;\r\n default: MergeDefault<T[P], D[P]>;\r\n };\r\n};\r\n\r\ntype MergeDefault<T, D> = unknown extends D\r\n ? InferPropType<T>\r\n : NonNullable<InferPropType<T>> | D;\r\n\r\ntype FollowPropType<T, P, D> = [T] extends [PropType<unknown>]\r\n ? T\r\n : PropType<MergeDefault<P, D>>;\r\n\r\ntype PartialKeys<T> = { [P in keyof T]?: unknown };\r\n\r\n// Copied from Vue\r\ntype InferPropType<T> = [T] extends [null]\r\n ? any // null & true would fail to infer\r\n : [T] extends [{ type: null | true }]\r\n ? // As TS issue https://github.com/Microsoft/TypeScript/issues/14829\r\n // somehow `ObjectConstructor` when inferred from { (): T } becomes `any`\r\n // `BooleanConstructor` when inferred from PropConstructor(with PropMethod) becomes `Boolean`\r\n any\r\n : [T] extends [ObjectConstructor | { type: ObjectConstructor }]\r\n ? Record<string, any>\r\n : [T] extends [BooleanConstructor | { type: BooleanConstructor }]\r\n ? boolean\r\n : [T] extends [DateConstructor | { type: DateConstructor }]\r\n ? Date\r\n : [T] extends [(infer U)[] | { type: (infer U)[] }]\r\n ? U extends DateConstructor\r\n ? Date | InferPropType<U>\r\n : InferPropType<U>\r\n : [T] extends [Prop<infer V, infer D>]\r\n ? unknown extends V\r\n ? IfAny<V, V, D>\r\n : V\r\n : T;\r\n"],"mappings":"AASA,SAASA,kBAAkB,QAAQ,KAAK;AAAC,S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AAC;MAC/D,IAAIF,QAAQ,IAAIX,IAAI,IAAIW,QAAQ,EAAE;QAChCC,OAAO,CAACZ,IAAI,CAAC,GAAG;UACd,GAAGe,YAAY;UACfE,OAAO,EAAEN,QAAQ,CAACX,IAAI;QACxB,CAAC;MACH,CAAC,MAAM;QACLY,OAAO,CAACZ,IAAI,CAAC,GAAGe,YAAY;MAC9B;MAEA,IAAIL,MAAM,IAAI,CAACE,OAAO,CAACZ,IAAI,CAAC,CAACU,MAAM,EAAE;QACnCE,OAAO,CAACZ,IAAI,CAAC,CAACU,MAAM,GAAGA,MAAM;MAC/B;MACA,OAAOE,OAAO;IAChB,CAAC,EAAE,CAAC,CAAiB,CAAC;EACxB,CAAC;AACH;;AA6BA"}
package/package.json CHANGED
@@ -1,108 +1,108 @@
1
- {
2
- "name": "yuyeon",
3
- "version": "0.0.20",
4
- "keywords": [
5
- "UI Library",
6
- "Vue"
7
- ],
8
- "repository": {
9
- "type": "git",
10
- "url": "https://github.com/yuyeonUI/yuyeon",
11
- "directory": "packages/yuyeon"
12
- },
13
- "author": "yeonyew",
14
- "license": "Apache-2.0",
15
- "files": [
16
- "dist/",
17
- "lib/",
18
- "types/"
19
- ],
20
- "type": "module",
21
- "exports": {
22
- ".": {
23
- "types": "./types/index.d.ts",
24
- "default": "./lib/index.mjs"
25
- },
26
- "./styles/*": "./lib/styles/*",
27
- "./lib": {
28
- "types": "./types/index.d.ts"
29
- },
30
- "./components": {
31
- "types": "./types/components/index.d.ts",
32
- "module": "./lib/components/index.mjs"
33
- },
34
- "./components/*": "./lib/components/*/index.mjs",
35
- "./types/*": "./types/*",
36
- "./*": "./*"
37
- },
38
- "main": "lib/index.mjs",
39
- "module": "lib/index.mjs",
40
- "types": "types/index.d.ts",
41
- "typesVersions": {
42
- "*": {
43
- "lib/index.mjs": [
44
- "types/index.d.ts"
45
- ],
46
- "*": [
47
- "*",
48
- "types/*",
49
- "types/*.d.ts",
50
- "types/*/index.d.ts"
51
- ]
52
- }
53
- },
54
- "scripts": {
55
- "build": "vue-tsc && vite build",
56
- "build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\" --copy-files --no-copy-ignored --out-file-extension .mjs"
57
- },
58
- "dependencies": {
59
- "motion": "^10.15.5"
60
- },
61
- "devDependencies": {
62
- "@babel/cli": "^7.21.0",
63
- "@babel/core": "^7.21.3",
64
- "@babel/preset-env": "^7.20.2",
65
- "@babel/preset-typescript": "^7.21.0",
66
- "@rollup/plugin-alias": "^4.0.3",
67
- "@rollup/plugin-babel": "^6.0.3",
68
- "@rollup/plugin-node-resolve": "^15.0.1",
69
- "@rollup/plugin-typescript": "^11.0.0",
70
- "@trivago/prettier-plugin-sort-imports": "^4.1.1",
71
- "@types/jest": "^28.1.8",
72
- "@types/node": "^18.15.11",
73
- "@types/resize-observer-browser": "^0.1.7",
74
- "@vitejs/plugin-vue": "^4.2.3",
75
- "@vitejs/plugin-vue-jsx": "^3.0.1",
76
- "@vue/babel-plugin-jsx": "^1.1.1",
77
- "@vue/compiler-sfc": "^3.3.4",
78
- "@vue/runtime-core": "^3.3.4",
79
- "@vue/shared": "^3.3.4",
80
- "@vue/test-utils": "2.3.2",
81
- "autoprefixer": "^10.4.14",
82
- "babel-plugin-add-import-extension": "1.5.1",
83
- "babel-plugin-module-resolver": "^5.0.0",
84
- "babel-plugin-transform-define": "^2.1.0",
85
- "babel-polyfill": "^6.26.0",
86
- "concurrently": "^4.1.1",
87
- "cross-env": "^7.0.3",
88
- "rollup": "^3.20.2",
89
- "rollup-plugin-dts": "^5.3.0",
90
- "rollup-plugin-sass": "^1.2.19",
91
- "rollup-plugin-sourcemaps": "^0.6.3",
92
- "rollup-plugin-terser": "^7.0.2",
93
- "sass": "^1.63.3",
94
- "vite": "^4.3.8",
95
- "vite-plugin-dts": "^2.2.0",
96
- "vue": "^3.3.4",
97
- "vue-tsc": "^1.2.0"
98
- },
99
- "peerDependencies": {
100
- "vue": "^3.3.0",
101
- "vue-i18n": "^9.0.0"
102
- },
103
- "peerDependenciesMeta": {
104
- "vue-i18n": {
105
- "optional": true
106
- }
107
- }
108
- }
1
+ {
2
+ "name": "yuyeon",
3
+ "version": "0.0.22",
4
+ "keywords": [
5
+ "UI Library",
6
+ "Vue"
7
+ ],
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/yuyeonUI/yuyeon",
11
+ "directory": "packages/yuyeon"
12
+ },
13
+ "author": "yeonyew",
14
+ "license": "Apache-2.0",
15
+ "files": [
16
+ "dist/",
17
+ "lib/",
18
+ "types/"
19
+ ],
20
+ "type": "module",
21
+ "exports": {
22
+ ".": {
23
+ "types": "./types/index.d.ts",
24
+ "default": "./lib/index.mjs"
25
+ },
26
+ "./styles/*": "./lib/styles/*",
27
+ "./lib": {
28
+ "types": "./types/index.d.ts"
29
+ },
30
+ "./components": {
31
+ "types": "./types/components/index.d.ts",
32
+ "module": "./lib/components/index.mjs"
33
+ },
34
+ "./components/*": "./lib/components/*/index.mjs",
35
+ "./types/*": "./types/*",
36
+ "./*": "./*"
37
+ },
38
+ "main": "lib/index.mjs",
39
+ "module": "lib/index.mjs",
40
+ "types": "types/index.d.ts",
41
+ "typesVersions": {
42
+ "*": {
43
+ "lib/index.mjs": [
44
+ "types/index.d.ts"
45
+ ],
46
+ "*": [
47
+ "*",
48
+ "types/*",
49
+ "types/*.d.ts",
50
+ "types/*/index.d.ts"
51
+ ]
52
+ }
53
+ },
54
+ "scripts": {
55
+ "build": "vue-tsc && vite build",
56
+ "build:lib": "cross-env NODE_ENV=lib babel src --out-dir lib --source-maps --extensions \".ts\",\".tsx\" --copy-files --no-copy-ignored --out-file-extension .mjs"
57
+ },
58
+ "dependencies": {
59
+ "motion": "^10.15.5"
60
+ },
61
+ "devDependencies": {
62
+ "@babel/cli": "^7.21.0",
63
+ "@babel/core": "^7.21.3",
64
+ "@babel/preset-env": "^7.20.2",
65
+ "@babel/preset-typescript": "^7.21.0",
66
+ "@rollup/plugin-alias": "^4.0.3",
67
+ "@rollup/plugin-babel": "^6.0.3",
68
+ "@rollup/plugin-node-resolve": "^15.0.1",
69
+ "@rollup/plugin-typescript": "^11.0.0",
70
+ "@trivago/prettier-plugin-sort-imports": "^4.1.1",
71
+ "@types/jest": "^28.1.8",
72
+ "@types/node": "^18.15.11",
73
+ "@types/resize-observer-browser": "^0.1.7",
74
+ "@vitejs/plugin-vue": "^4.2.3",
75
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
76
+ "@vue/babel-plugin-jsx": "^1.1.1",
77
+ "@vue/compiler-sfc": "^3.3.4",
78
+ "@vue/runtime-core": "^3.3.4",
79
+ "@vue/shared": "^3.3.4",
80
+ "@vue/test-utils": "2.3.2",
81
+ "autoprefixer": "^10.4.14",
82
+ "babel-plugin-add-import-extension": "1.5.1",
83
+ "babel-plugin-module-resolver": "^5.0.0",
84
+ "babel-plugin-transform-define": "^2.1.0",
85
+ "babel-polyfill": "^6.26.0",
86
+ "concurrently": "^4.1.1",
87
+ "cross-env": "^7.0.3",
88
+ "rollup": "^3.20.2",
89
+ "rollup-plugin-dts": "^5.3.0",
90
+ "rollup-plugin-sass": "^1.2.19",
91
+ "rollup-plugin-sourcemaps": "^0.6.3",
92
+ "rollup-plugin-terser": "^7.0.2",
93
+ "sass": "^1.63.3",
94
+ "vite": "^4.3.8",
95
+ "vite-plugin-dts": "^2.2.0",
96
+ "vue": "^3.3.4",
97
+ "vue-tsc": "^1.2.0"
98
+ },
99
+ "peerDependencies": {
100
+ "vue": "^3.3.0",
101
+ "vue-i18n": "^9.0.0"
102
+ },
103
+ "peerDependenciesMeta": {
104
+ "vue-i18n": {
105
+ "optional": true
106
+ }
107
+ }
108
+ }
@@ -76,6 +76,18 @@ export declare const YDialog: import("vue").DefineComponent<{
76
76
  type: PropType<boolean>;
77
77
  default: boolean;
78
78
  };
79
+ openOnHover: {
80
+ type: PropType<boolean>;
81
+ default: boolean;
82
+ };
83
+ openDelay: {
84
+ type: PropType<number>;
85
+ default: number;
86
+ };
87
+ closeDelay: {
88
+ type: PropType<number>;
89
+ default: number;
90
+ };
79
91
  }, {
80
92
  complementClickOption: {
81
93
  handler: (mouseEvent: MouseEvent) => void;
@@ -85,6 +97,7 @@ export declare const YDialog: import("vue").DefineComponent<{
85
97
  layerGroup: import("vue").ComputedRef<string | HTMLElement>;
86
98
  active: import("vue").WritableComputedRef<boolean>;
87
99
  rendered: import("vue").ComputedRef<boolean>;
100
+ lazyValue: import("vue").ComputedRef<any>;
88
101
  onAfterUpdate: () => void;
89
102
  scrim$: import("vue").Ref<HTMLElement | undefined>;
90
103
  content$: import("vue").Ref<HTMLElement | undefined>;
@@ -1722,6 +1735,18 @@ export declare const YDialog: import("vue").DefineComponent<{
1722
1735
  type: PropType<boolean>;
1723
1736
  default: boolean;
1724
1737
  };
1738
+ openOnHover: {
1739
+ type: PropType<boolean>;
1740
+ default: boolean;
1741
+ };
1742
+ openDelay: {
1743
+ type: PropType<number>;
1744
+ default: number;
1745
+ };
1746
+ closeDelay: {
1747
+ type: PropType<number>;
1748
+ default: number;
1749
+ };
1725
1750
  }>> & {
1726
1751
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
1727
1752
  onAfterLeave?: (() => any) | undefined;
@@ -1729,6 +1754,9 @@ export declare const YDialog: import("vue").DefineComponent<{
1729
1754
  }, {
1730
1755
  disabled: boolean;
1731
1756
  contentStyles: import("vue").CSSProperties;
1757
+ openOnHover: boolean;
1758
+ openDelay: number;
1759
+ closeDelay: number;
1732
1760
  coordinateStrategy: "levitation" | "arrangement" | import("../../composables/coordinate").CoordinateStrategyFn;
1733
1761
  position: "default" | "top" | "end" | "right" | "bottom" | "left" | "start";
1734
1762
  align: "end" | "start" | "center";