@element-plus/nightly 0.0.20221031 → 0.0.20221102
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/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +153 -86
- package/dist/index.full.min.js +13 -13
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +16 -16
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +153 -86
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +2 -1
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/collapse/index.d.ts +20 -59
- package/es/components/collapse/index.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.d.ts +0 -2
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/es/components/collapse/src/collapse-item2.mjs +34 -55
- package/es/components/collapse/src/collapse-item2.mjs.map +1 -1
- package/es/components/collapse/src/collapse.d.ts +0 -2
- package/es/components/collapse/src/collapse.mjs.map +1 -1
- package/es/components/collapse/src/collapse.vue.d.ts +6 -25
- package/es/components/collapse/src/collapse2.mjs +5 -39
- package/es/components/collapse/src/collapse2.mjs.map +1 -1
- package/es/components/collapse/src/instance.d.ts +4 -0
- package/es/components/collapse/src/instance.mjs +2 -0
- package/es/components/collapse/src/instance.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/es/components/collapse/src/use-collapse-item.mjs +75 -0
- package/es/components/collapse/src/use-collapse-item.mjs.map +1 -0
- package/es/components/collapse/src/use-collapse.d.ts +9 -0
- package/es/components/collapse/src/use-collapse.mjs +52 -0
- package/es/components/collapse/src/use-collapse.mjs.map +1 -0
- package/es/components/input/index.d.ts +2 -0
- package/es/components/input/index.mjs.map +1 -1
- package/es/components/tree-v2/index.d.ts +0 -1
- package/es/components/tree-v2/src/tree-node.mjs +2 -2
- package/es/components/tree-v2/src/tree-node.mjs.map +1 -1
- package/es/components/tree-v2/src/tree-node.vue.d.ts +0 -1
- package/es/components/tree-v2/src/tree.vue.d.ts +0 -1
- package/es/utils/dom/style.mjs +4 -4
- package/es/utils/dom/style.mjs.map +1 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/types.d.ts +1 -0
- package/es/utils/types.mjs +8 -2
- package/es/utils/types.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +2 -1
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/collapse/index.d.ts +20 -59
- package/lib/components/collapse/index.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.d.ts +0 -2
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item.vue.d.ts +21 -32
- package/lib/components/collapse/src/collapse-item2.js +37 -58
- package/lib/components/collapse/src/collapse-item2.js.map +1 -1
- package/lib/components/collapse/src/collapse.d.ts +0 -2
- package/lib/components/collapse/src/collapse.js.map +1 -1
- package/lib/components/collapse/src/collapse.vue.d.ts +6 -25
- package/lib/components/collapse/src/collapse2.js +4 -38
- package/lib/components/collapse/src/collapse2.js.map +1 -1
- package/lib/components/collapse/src/instance.d.ts +4 -0
- package/lib/components/collapse/src/instance.js +3 -0
- package/lib/components/collapse/src/instance.js.map +1 -0
- package/lib/components/collapse/src/use-collapse-item.d.ts +20 -0
- package/lib/components/collapse/src/use-collapse-item.js +80 -0
- package/lib/components/collapse/src/use-collapse-item.js.map +1 -0
- package/lib/components/collapse/src/use-collapse.d.ts +9 -0
- package/lib/components/collapse/src/use-collapse.js +57 -0
- package/lib/components/collapse/src/use-collapse.js.map +1 -0
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/input/index.js.map +1 -1
- package/lib/components/tree-v2/index.d.ts +0 -1
- package/lib/components/tree-v2/src/tree-node.js +2 -2
- package/lib/components/tree-v2/src/tree-node.js.map +1 -1
- package/lib/components/tree-v2/src/tree-node.vue.d.ts +0 -1
- package/lib/components/tree-v2/src/tree.vue.d.ts +0 -1
- package/lib/utils/dom/style.js +4 -4
- package/lib/utils/dom/style.js.map +1 -1
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/types.d.ts +1 -0
- package/lib/utils/types.js +7 -0
- package/lib/utils/types.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-input-number.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/input-number.scss +1 -1
- package/web-types.json +1 -1
package/es/utils/dom/style.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isClient, isNumber } from '@vueuse/core';
|
|
2
|
-
import '../types.mjs';
|
|
2
|
+
import { isStringNumber } from '../types.mjs';
|
|
3
3
|
import '../strings.mjs';
|
|
4
4
|
import { entriesOf, keysOf } from '../objects.mjs';
|
|
5
5
|
import { debugWarn } from '../error.mjs';
|
|
@@ -63,10 +63,10 @@ const removeStyle = (element, style) => {
|
|
|
63
63
|
function addUnit(value, defaultUnit = "px") {
|
|
64
64
|
if (!value)
|
|
65
65
|
return "";
|
|
66
|
-
if (
|
|
67
|
-
return value;
|
|
68
|
-
} else if (isNumber(value)) {
|
|
66
|
+
if (isNumber(value) || isStringNumber(value)) {
|
|
69
67
|
return `${value}${defaultUnit}`;
|
|
68
|
+
} else if (isString(value)) {
|
|
69
|
+
return value;
|
|
70
70
|
}
|
|
71
71
|
debugWarn(SCOPE, "binding value must be a string or number");
|
|
72
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"style.mjs","sources":["../../../../../packages/utils/dom/style.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { isNumber, isObject, isString } from '../types'\nimport { camelize } from '../strings'\nimport { entriesOf, keysOf } from '../objects'\nimport { debugWarn } from '../error'\nimport type { CSSProperties } from 'vue'\n\nconst SCOPE = 'utils/dom/style'\n\nexport const classNameToArray = (cls = '') =>\n cls.split(' ').filter((item) => !!item.trim())\n\nexport const hasClass = (el: Element, cls: string): boolean => {\n if (!el || !cls) return false\n if (cls.includes(' ')) throw new Error('className should not contain space.')\n return el.classList.contains(cls)\n}\n\nexport const addClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.add(...classNameToArray(cls))\n}\n\nexport const removeClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.remove(...classNameToArray(cls))\n}\n\nexport const getStyle = (\n element: HTMLElement,\n styleName: keyof CSSProperties\n): string => {\n if (!isClient || !element || !styleName) return ''\n\n let key = camelize(styleName)\n if (key === 'float') key = 'cssFloat'\n try {\n const style = (element.style as any)[key]\n if (style) return style\n const computed: any = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[key] : ''\n } catch {\n return (element.style as any)[key]\n }\n}\n\nexport const setStyle = (\n element: HTMLElement,\n styleName: CSSProperties | keyof CSSProperties,\n value?: string | number\n) => {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(([prop, value]) =>\n setStyle(element, prop, value)\n )\n } else {\n const key: any = camelize(styleName)\n element.style[key] = value as any\n }\n}\n\nexport const removeStyle = (\n element: HTMLElement,\n style: CSSProperties | keyof CSSProperties\n) => {\n if (!element || !style) return\n\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop))\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\n if (!value) return ''\n if (
|
|
1
|
+
{"version":3,"file":"style.mjs","sources":["../../../../../packages/utils/dom/style.ts"],"sourcesContent":["import { isClient } from '@vueuse/core'\nimport { isNumber, isObject, isString, isStringNumber } from '../types'\nimport { camelize } from '../strings'\nimport { entriesOf, keysOf } from '../objects'\nimport { debugWarn } from '../error'\nimport type { CSSProperties } from 'vue'\n\nconst SCOPE = 'utils/dom/style'\n\nexport const classNameToArray = (cls = '') =>\n cls.split(' ').filter((item) => !!item.trim())\n\nexport const hasClass = (el: Element, cls: string): boolean => {\n if (!el || !cls) return false\n if (cls.includes(' ')) throw new Error('className should not contain space.')\n return el.classList.contains(cls)\n}\n\nexport const addClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.add(...classNameToArray(cls))\n}\n\nexport const removeClass = (el: Element, cls: string) => {\n if (!el || !cls.trim()) return\n el.classList.remove(...classNameToArray(cls))\n}\n\nexport const getStyle = (\n element: HTMLElement,\n styleName: keyof CSSProperties\n): string => {\n if (!isClient || !element || !styleName) return ''\n\n let key = camelize(styleName)\n if (key === 'float') key = 'cssFloat'\n try {\n const style = (element.style as any)[key]\n if (style) return style\n const computed: any = document.defaultView?.getComputedStyle(element, '')\n return computed ? computed[key] : ''\n } catch {\n return (element.style as any)[key]\n }\n}\n\nexport const setStyle = (\n element: HTMLElement,\n styleName: CSSProperties | keyof CSSProperties,\n value?: string | number\n) => {\n if (!element || !styleName) return\n\n if (isObject(styleName)) {\n entriesOf(styleName).forEach(([prop, value]) =>\n setStyle(element, prop, value)\n )\n } else {\n const key: any = camelize(styleName)\n element.style[key] = value as any\n }\n}\n\nexport const removeStyle = (\n element: HTMLElement,\n style: CSSProperties | keyof CSSProperties\n) => {\n if (!element || !style) return\n\n if (isObject(style)) {\n keysOf(style).forEach((prop) => removeStyle(element, prop))\n } else {\n setStyle(element, style, '')\n }\n}\n\nexport function addUnit(value?: string | number, defaultUnit = 'px') {\n if (!value) return ''\n if (isNumber(value) || isStringNumber(value)) {\n return `${value}${defaultUnit}`\n } else if (isString(value)) {\n return value\n }\n debugWarn(SCOPE, 'binding value must be a string or number')\n}\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,KAAK,GAAG,iBAAiB,CAAC;AACpB,MAAC,gBAAgB,GAAG,CAAC,GAAG,GAAG,EAAE,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;AACjF,MAAC,QAAQ,GAAG,CAAC,EAAE,EAAE,GAAG,KAAK;AACrC,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC,GAAG;AACjB,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,IAAI,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC;AACvB,IAAI,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;AAC3D,EAAE,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACpC,EAAE;AACU,MAAC,QAA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,MAAM,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE;AAC9B,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,SAAS,CAAC,KAAK,EAAE,0CAA0C,CAAC,CAAC;AAC/D;;;;"}
|
package/es/utils/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ export { entriesOf, getProp, keysOf } from './objects.mjs';
|
|
|
10
10
|
export { cAF, rAF } from './raf.mjs';
|
|
11
11
|
export { generateId, getRandomInt } from './rand.mjs';
|
|
12
12
|
export { capitalize, escapeStringRegexp } from './strings.mjs';
|
|
13
|
-
export { isElement, isEmpty, isPropAbsent, isUndefined } from './types.mjs';
|
|
13
|
+
export { isElement, isEmpty, isPropAbsent, isStringNumber, isUndefined } from './types.mjs';
|
|
14
14
|
export { mutable } from './typescript.mjs';
|
|
15
15
|
export { attemptFocus, focusNode, getSibling, isFocusable, isLeaf, isVisible, obtainAllFocusableElements, triggerEvent } from './dom/aria.mjs';
|
|
16
16
|
export { composeEventHandlers, whenMouse } from './dom/event.mjs';
|
package/es/utils/types.d.ts
CHANGED
|
@@ -5,3 +5,4 @@ export declare const isUndefined: (val: any) => val is undefined;
|
|
|
5
5
|
export declare const isEmpty: (val: unknown) => boolean;
|
|
6
6
|
export declare const isElement: (e: unknown) => e is Element;
|
|
7
7
|
export declare const isPropAbsent: (prop: unknown) => prop is null | undefined;
|
|
8
|
+
export declare const isStringNumber: (val: string) => boolean;
|
package/es/utils/types.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isArray, isObject } from '@vue/shared';
|
|
1
|
+
import { isArray, isObject, isString } from '@vue/shared';
|
|
2
2
|
export { isArray, isDate, isFunction, isObject, isPromise, isString, isSymbol } from '@vue/shared';
|
|
3
3
|
import { isNil } from 'lodash-unified';
|
|
4
4
|
export { isBoolean, isNumber } from '@vueuse/core';
|
|
@@ -14,6 +14,12 @@ const isElement = (e) => {
|
|
|
14
14
|
const isPropAbsent = (prop) => {
|
|
15
15
|
return isNil(prop);
|
|
16
16
|
};
|
|
17
|
+
const isStringNumber = (val) => {
|
|
18
|
+
if (!isString(val)) {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
return !Number.isNaN(Number(val));
|
|
22
|
+
};
|
|
17
23
|
|
|
18
|
-
export { isElement, isEmpty, isPropAbsent, isUndefined };
|
|
24
|
+
export { isElement, isEmpty, isPropAbsent, isStringNumber, isUndefined };
|
|
19
25
|
//# sourceMappingURL=types.mjs.map
|
package/es/utils/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n"],"names":[],"mappings":";;;;;;AAaY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK;AAChC,EAAE,IAAI,OAAO,OAAO,KAAK,WAAW;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,OAAO,CAAC,YAAY,OAAO,CAAC;AAC9B,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACrB;;;;"}
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../../../../packages/utils/types.ts"],"sourcesContent":["import { isArray, isObject, isString } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\n\nexport {\n isArray,\n isFunction,\n isObject,\n isString,\n isDate,\n isPromise,\n isSymbol,\n} from '@vue/shared'\nexport { isBoolean, isNumber } from '@vueuse/core'\nexport { isVNode } from 'vue'\n\nexport const isUndefined = (val: any): val is undefined => val === undefined\n\nexport const isEmpty = (val: unknown) =>\n (!val && val !== 0) ||\n (isArray(val) && val.length === 0) ||\n (isObject(val) && !Object.keys(val).length)\n\nexport const isElement = (e: unknown): e is Element => {\n if (typeof Element === 'undefined') return false\n return e instanceof Element\n}\n\nexport const isPropAbsent = (prop: unknown): prop is null | undefined => {\n return isNil(prop)\n}\n\nexport const isStringNumber = (val: string): boolean => {\n if (!isString(val)) {\n return false\n }\n return !Number.isNaN(Number(val))\n}\n"],"names":[],"mappings":";;;;;;AAaY,MAAC,WAAW,GAAG,CAAC,GAAG,KAAK,GAAG,KAAK,KAAK,EAAE;AACvC,MAAC,OAAO,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO;AACvH,MAAC,SAAS,GAAG,CAAC,CAAC,KAAK;AAChC,EAAE,IAAI,OAAO,OAAO,KAAK,WAAW;AACpC,IAAI,OAAO,KAAK,CAAC;AACjB,EAAE,OAAO,CAAC,YAAY,OAAO,CAAC;AAC9B,EAAE;AACU,MAAC,YAAY,GAAG,CAAC,IAAI,KAAK;AACtC,EAAE,OAAO,KAAK,CAAC,IAAI,CAAC,CAAC;AACrB,EAAE;AACU,MAAC,cAAc,GAAG,CAAC,GAAG,KAAK;AACvC,EAAE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;AACtB,IAAI,OAAO,KAAK,CAAC;AACjB,GAAG;AACH,EAAE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;AACpC;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20221102";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20221102'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n target: {\n type: String,\n default: '',\n },\n offset: {\n type: Number,\n default: 0,\n },\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n isNumber(scrollTop) && isBoolean(fixed),\n [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed),\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":["buildProps","definePropType","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;AAOY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAKC,aAAQ,CAAC,SAAS,CAAC,IAAIC,cAAS,CAAC,KAAK,CAAC;AAC3E,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,KAAKD,cAAS,CAAC,KAAK,CAAC;AAC7C;;;;;"}
|
|
1
|
+
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n /**\n * @description affix element zIndex value\n * */\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n /**\n * @description target container. (CSS selector)\n */\n target: {\n type: String,\n default: '',\n },\n /**\n * @description offset distance\n * */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description position of affix\n * */\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n isNumber(scrollTop) && isBoolean(fixed),\n [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed),\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":["buildProps","definePropType","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;AAOY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAKC,aAAQ,CAAC,SAAS,CAAC,IAAIC,cAAS,CAAC,KAAK,CAAC;AAC3E,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,KAAKD,cAAS,CAAC,KAAK,CAAC;AAC7C;;;;;"}
|
|
@@ -9,6 +9,7 @@ require('../../../hooks/index.js');
|
|
|
9
9
|
var affix = require('./affix.js');
|
|
10
10
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
11
11
|
var index = require('../../../hooks/use-namespace/index.js');
|
|
12
|
+
var style = require('../../../utils/dom/style.js');
|
|
12
13
|
var error = require('../../../utils/error.js');
|
|
13
14
|
var scroll = require('../../../utils/dom/scroll.js');
|
|
14
15
|
|
|
@@ -47,7 +48,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
47
48
|
const affixStyle = vue.computed(() => {
|
|
48
49
|
if (!fixed.value)
|
|
49
50
|
return {};
|
|
50
|
-
const offset = props.offset ?
|
|
51
|
+
const offset = props.offset ? style.addUnit(props.offset) : 0;
|
|
51
52
|
return {
|
|
52
53
|
height: `${rootHeight.value}px`,
|
|
53
54
|
width: `${rootWidth.value}px`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'\nimport {\n useElementBounding,\n useEventListener,\n useWindowSize,\n} from '@vueuse/core'\nimport { getScrollContainer, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElAffix'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\nconst { height: windowHeight } = useWindowSize()\nconst {\n height: rootHeight,\n width: rootWidth,\n top: rootTop,\n bottom: rootBottom,\n update: updateRoot,\n} = useElementBounding(root, { windowScroll: false })\nconst targetRect = useElementBounding(target)\n\nconst fixed = ref(false)\nconst scrollTop = ref(0)\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${rootHeight.value}px` : '',\n width: fixed.value ? `${rootWidth.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties>(() => {\n if (!fixed.value) return {}\n\n const offset = props.offset ?
|
|
1
|
+
{"version":3,"file":"affix2.js","sources":["../../../../../../packages/components/affix/src/affix.vue"],"sourcesContent":["<template>\n <div ref=\"root\" :class=\"ns.b()\" :style=\"rootStyle\">\n <div :class=\"{ [ns.m('fixed')]: fixed }\" :style=\"affixStyle\">\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, onMounted, ref, shallowRef, watch, watchEffect } from 'vue'\nimport {\n useElementBounding,\n useEventListener,\n useWindowSize,\n} from '@vueuse/core'\nimport { addUnit, getScrollContainer, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { affixEmits, affixProps } from './affix'\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElAffix'\ndefineOptions({\n name: COMPONENT_NAME,\n})\n\nconst props = defineProps(affixProps)\nconst emit = defineEmits(affixEmits)\n\nconst ns = useNamespace('affix')\n\nconst target = shallowRef<HTMLElement>()\nconst root = shallowRef<HTMLDivElement>()\nconst scrollContainer = shallowRef<HTMLElement | Window>()\nconst { height: windowHeight } = useWindowSize()\nconst {\n height: rootHeight,\n width: rootWidth,\n top: rootTop,\n bottom: rootBottom,\n update: updateRoot,\n} = useElementBounding(root, { windowScroll: false })\nconst targetRect = useElementBounding(target)\n\nconst fixed = ref(false)\nconst scrollTop = ref(0)\nconst transform = ref(0)\n\nconst rootStyle = computed<CSSProperties>(() => {\n return {\n height: fixed.value ? `${rootHeight.value}px` : '',\n width: fixed.value ? `${rootWidth.value}px` : '',\n }\n})\n\nconst affixStyle = computed<CSSProperties>(() => {\n if (!fixed.value) return {}\n\n const offset = props.offset ? addUnit(props.offset) : 0\n return {\n height: `${rootHeight.value}px`,\n width: `${rootWidth.value}px`,\n top: props.position === 'top' ? offset : '',\n bottom: props.position === 'bottom' ? offset : '',\n transform: transform.value ? `translateY(${transform.value}px)` : '',\n zIndex: props.zIndex,\n }\n})\n\nconst update = () => {\n if (!scrollContainer.value) return\n\n scrollTop.value =\n scrollContainer.value instanceof Window\n ? document.documentElement.scrollTop\n : scrollContainer.value.scrollTop || 0\n\n if (props.position === 'top') {\n if (props.target) {\n const difference =\n targetRect.bottom.value - props.offset - rootHeight.value\n fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0\n transform.value = difference < 0 ? difference : 0\n } else {\n fixed.value = props.offset > rootTop.value\n }\n } else if (props.target) {\n const difference =\n windowHeight.value -\n targetRect.top.value -\n props.offset -\n rootHeight.value\n fixed.value =\n windowHeight.value - props.offset < rootBottom.value &&\n windowHeight.value > targetRect.top.value\n transform.value = difference < 0 ? -difference : 0\n } else {\n fixed.value = windowHeight.value - props.offset < rootBottom.value\n }\n}\n\nconst handleScroll = () => {\n updateRoot()\n emit('scroll', {\n scrollTop: scrollTop.value,\n fixed: fixed.value,\n })\n}\n\nwatch(fixed, (val) => emit('change', val))\n\nonMounted(() => {\n if (props.target) {\n target.value =\n document.querySelector<HTMLElement>(props.target) ?? undefined\n if (!target.value)\n throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`)\n } else {\n target.value = document.documentElement\n }\n scrollContainer.value = getScrollContainer(root.value!, true)\n updateRoot()\n})\n\nuseEventListener(scrollContainer, 'scroll', handleScroll)\nwatchEffect(update)\n\ndefineExpose({\n /** @description update affix status */\n update,\n /** @description update rootRect info */\n updateRoot,\n})\n</script>\n"],"names":["useNamespace","shallowRef","useWindowSize","useElementBounding","ref","computed","addUnit","watch","onMounted","throwError","getScrollContainer","useEventListener","watchEffect"],"mappings":";;;;;;;;;;;;;;;;uCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,OAAO,CAAA,CAAA;AAE/B,IAAA,MAAM,SAASC,cAAwB,EAAA,CAAA;AACvC,IAAA,MAAM,OAAOA,cAA2B,EAAA,CAAA;AACxC,IAAA,MAAM,kBAAkBA,cAAiC,EAAA,CAAA;AACzD,IAAM,MAAA,EAAE,MAAQ,EAAA,YAAA,EAAA,GAAiBC,kBAAc,EAAA,CAAA;AAC/C,IAAM,MAAA;AAAA,MACJ,MAAQ,EAAA,UAAA;AAAA,MACR,KAAO,EAAA,SAAA;AAAA,MACP,GAAK,EAAA,OAAA;AAAA,MACL,MAAQ,EAAA,UAAA;AAAA,MACR,MAAQ,EAAA,UAAA;AAAA,KAAA,GACNC,uBAAmB,CAAA,IAAA,EAAM,EAAE,YAAA,EAAc,OAAO,CAAA,CAAA;AACpD,IAAM,MAAA,UAAA,GAAaA,wBAAmB,MAAM,CAAA,CAAA;AAE5C,IAAM,MAAA,KAAA,GAAQC,QAAI,KAAK,CAAA,CAAA;AACvB,IAAM,MAAA,SAAA,GAAYA,QAAI,CAAC,CAAA,CAAA;AACvB,IAAM,MAAA,SAAA,GAAYA,QAAI,CAAC,CAAA,CAAA;AAEvB,IAAM,MAAA,SAAA,GAAYC,aAAwB,MAAM;AAC9C,MAAO,OAAA;AAAA,QACL,MAAQ,EAAA,KAAA,CAAM,KAAQ,GAAA,CAAA,EAAG,WAAW,KAAY,CAAA,EAAA,CAAA,GAAA,EAAA;AAAA,QAChD,KAAO,EAAA,KAAA,CAAM,KAAQ,GAAA,CAAA,EAAG,UAAU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A,IAAI;AACF,MAAA,IAAA,KAAO,CACL,MAAA,EAAA;AACF,QAAA,MAAY,CAAA,KAAA,GAAA,CAAA,EAAA,GAAA,QAAA,CAAA,aAAA,CAAA,KAAA,CAAA,MAAA,CAAA,KAAA,IAAA,GAAA,EAAA,GAAA,KAAA,CAAA,CAAA;AACV,QAAW,IAAA,CAAA,MAAA,CAAA,KAAA;AAAwD,UAChEC,gBAAA,CAAA,cAAA,EAAA,CAAA,uBAAA,EAAA,KAAA,CAAA,MAAA,CAAA,CAAA,CAAA,CAAA;AACL,OAAA,MAAA;AAAwB,QAC1B,MAAA,CAAA,KAAA,GAAA,QAAA,CAAA,eAAA,CAAA;AACA,OAAA;AACA,MAAW,eAAA,CAAA,KAAA,GAAAC,yBAAA,CAAA,IAAA,CAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AAAA,MACZ,UAAA,EAAA,CAAA;AAED,KAAiB,CAAA,CAAA;AACjB,IAAAC,qBAAkB,CAAA,eAAA,EAAA,QAAA,EAAA,YAAA,CAAA,CAAA;AAElB,IAAaC,eAAA,CAAA,MAAA,CAAA,CAAA;AAAA,IAEX,MAAA,CAAA;AAAA,MAEA,MAAA;AAAA,MACD,UAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,27 +10,9 @@ export declare const ElCollapse: import("element-plus/es/utils").SFCWithInstall<
|
|
|
10
10
|
"onUpdate:modelValue"?: ((value: import("./src/collapse").CollapseModelValue) => any) | undefined;
|
|
11
11
|
}>>;
|
|
12
12
|
emit: ((event: "update:modelValue", value: import("./src/collapse").CollapseModelValue) => void) & ((event: "change", value: import("./src/collapse").CollapseModelValue) => void);
|
|
13
|
-
ns: {
|
|
14
|
-
namespace: import("vue").Ref<string>;
|
|
15
|
-
b: (blockSuffix?: string) => string;
|
|
16
|
-
e: (element?: string | undefined) => string;
|
|
17
|
-
m: (modifier?: string | undefined) => string;
|
|
18
|
-
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
19
|
-
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
20
|
-
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
21
|
-
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
22
|
-
is: {
|
|
23
|
-
(name: string, state: boolean | undefined): string;
|
|
24
|
-
(name: string): string;
|
|
25
|
-
};
|
|
26
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
27
|
-
cssVarName: (name: string) => string;
|
|
28
|
-
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
29
|
-
cssVarBlockName: (name: string) => string;
|
|
30
|
-
};
|
|
31
13
|
activeNames: import("vue").Ref<(string | number)[]>;
|
|
32
14
|
setActiveNames: (_activeNames: import("./src/collapse").CollapseActiveName[]) => void;
|
|
33
|
-
|
|
15
|
+
rootKls: import("vue").ComputedRef<string>;
|
|
34
16
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
17
|
"update:modelValue": (value: import("./src/collapse").CollapseModelValue) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
36
18
|
change: (value: import("./src/collapse").CollapseModelValue) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
|
|
@@ -56,32 +38,21 @@ export declare const ElCollapse: import("element-plus/es/utils").SFCWithInstall<
|
|
|
56
38
|
}>> & {
|
|
57
39
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
58
40
|
}>>;
|
|
59
|
-
collapse: import("../..").CollapseContext | undefined;
|
|
60
|
-
ns: {
|
|
61
|
-
namespace: import("vue").Ref<string>;
|
|
62
|
-
b: (blockSuffix?: string) => string;
|
|
63
|
-
e: (element?: string | undefined) => string;
|
|
64
|
-
m: (modifier?: string | undefined) => string;
|
|
65
|
-
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
66
|
-
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
67
|
-
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
68
|
-
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
69
|
-
is: {
|
|
70
|
-
(name: string, state: boolean | undefined): string;
|
|
71
|
-
(name: string): string;
|
|
72
|
-
};
|
|
73
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
74
|
-
cssVarName: (name: string) => string;
|
|
75
|
-
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
76
|
-
cssVarBlockName: (name: string) => string;
|
|
77
|
-
};
|
|
78
41
|
focusing: import("vue").Ref<boolean>;
|
|
79
|
-
isClick: import("vue").Ref<boolean>;
|
|
80
42
|
id: import("vue").Ref<number>;
|
|
81
43
|
isActive: import("vue").ComputedRef<boolean | undefined>;
|
|
82
44
|
handleFocus: () => void;
|
|
83
45
|
handleHeaderClick: () => void;
|
|
84
46
|
handleEnterClick: () => void;
|
|
47
|
+
arrowKls: import("vue").ComputedRef<string[]>;
|
|
48
|
+
headKls: import("vue").ComputedRef<(string | {
|
|
49
|
+
focusing: boolean | undefined;
|
|
50
|
+
})[]>;
|
|
51
|
+
rootKls: import("vue").ComputedRef<string[]>;
|
|
52
|
+
itemWrapperKls: import("vue").ComputedRef<string>;
|
|
53
|
+
itemContentKls: import("vue").ComputedRef<string>;
|
|
54
|
+
scopedContentId: import("vue").ComputedRef<string>;
|
|
55
|
+
scopedHeadId: import("vue").ComputedRef<string>;
|
|
85
56
|
ElCollapseTransition: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
86
57
|
ns: {
|
|
87
58
|
namespace: import("vue").Ref<string>;
|
|
@@ -197,32 +168,21 @@ export declare const ElCollapseItem: import("element-plus/es/utils").SFCWithInst
|
|
|
197
168
|
}>> & {
|
|
198
169
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
199
170
|
}>>;
|
|
200
|
-
collapse: import("../..").CollapseContext | undefined;
|
|
201
|
-
ns: {
|
|
202
|
-
namespace: import("vue").Ref<string>;
|
|
203
|
-
b: (blockSuffix?: string) => string;
|
|
204
|
-
e: (element?: string | undefined) => string;
|
|
205
|
-
m: (modifier?: string | undefined) => string;
|
|
206
|
-
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
207
|
-
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
208
|
-
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
209
|
-
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
210
|
-
is: {
|
|
211
|
-
(name: string, state: boolean | undefined): string;
|
|
212
|
-
(name: string): string;
|
|
213
|
-
};
|
|
214
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
215
|
-
cssVarName: (name: string) => string;
|
|
216
|
-
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
217
|
-
cssVarBlockName: (name: string) => string;
|
|
218
|
-
};
|
|
219
171
|
focusing: import("vue").Ref<boolean>;
|
|
220
|
-
isClick: import("vue").Ref<boolean>;
|
|
221
172
|
id: import("vue").Ref<number>;
|
|
222
173
|
isActive: import("vue").ComputedRef<boolean | undefined>;
|
|
223
174
|
handleFocus: () => void;
|
|
224
175
|
handleHeaderClick: () => void;
|
|
225
176
|
handleEnterClick: () => void;
|
|
177
|
+
arrowKls: import("vue").ComputedRef<string[]>;
|
|
178
|
+
headKls: import("vue").ComputedRef<(string | {
|
|
179
|
+
focusing: boolean | undefined;
|
|
180
|
+
})[]>;
|
|
181
|
+
rootKls: import("vue").ComputedRef<string[]>;
|
|
182
|
+
itemWrapperKls: import("vue").ComputedRef<string>;
|
|
183
|
+
itemContentKls: import("vue").ComputedRef<string>;
|
|
184
|
+
scopedContentId: import("vue").ComputedRef<string>;
|
|
185
|
+
scopedHeadId: import("vue").ComputedRef<string>;
|
|
226
186
|
ElCollapseTransition: import("element-plus/es/utils").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
227
187
|
ns: {
|
|
228
188
|
namespace: import("vue").Ref<string>;
|
|
@@ -326,3 +286,4 @@ export declare const ElCollapseItem: import("element-plus/es/utils").SFCWithInst
|
|
|
326
286
|
}>>;
|
|
327
287
|
export * from './src/collapse';
|
|
328
288
|
export * from './src/collapse-item';
|
|
289
|
+
export type { CollapseInstance, CollapseItemInstance } from './src/instance';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../packages/components/collapse/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\n\nimport Collapse from './src/collapse.vue'\nimport CollapseItem from './src/collapse-item.vue'\n\nexport const ElCollapse = withInstall(Collapse, {\n CollapseItem,\n})\nexport default ElCollapse\nexport const ElCollapseItem = withNoopInstall(CollapseItem)\n\nexport * from './src/collapse'\nexport * from './src/collapse-item'\n"],"names":["withInstall","Collapse","CollapseItem","withNoopInstall"],"mappings":";;;;;;;;;;;AAGY,MAAC,UAAU,GAAGA,mBAAW,CAACC,qBAAQ,EAAE;AAChD,gBAAEC,yBAAY;AACd,CAAC,EAAE;AAES,MAAC,cAAc,GAAGC,uBAAe,CAACD,yBAAY;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../packages/components/collapse/index.ts"],"sourcesContent":["import { withInstall, withNoopInstall } from '@element-plus/utils'\n\nimport Collapse from './src/collapse.vue'\nimport CollapseItem from './src/collapse-item.vue'\n\nexport const ElCollapse = withInstall(Collapse, {\n CollapseItem,\n})\nexport default ElCollapse\nexport const ElCollapseItem = withNoopInstall(CollapseItem)\n\nexport * from './src/collapse'\nexport * from './src/collapse-item'\nexport type { CollapseInstance, CollapseItemInstance } from './src/instance'\n"],"names":["withInstall","Collapse","CollapseItem","withNoopInstall"],"mappings":";;;;;;;;;;;AAGY,MAAC,UAAU,GAAGA,mBAAW,CAACC,qBAAQ,EAAE;AAChD,gBAAEC,yBAAY;AACd,CAAC,EAAE;AAES,MAAC,cAAc,GAAGC,uBAAe,CAACD,yBAAY;;;;;;;;;;"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { ExtractPropTypes } from 'vue';
|
|
2
2
|
import type { CollapseActiveName } from './collapse';
|
|
3
|
-
import type CollapseItem from './collapse-item.vue';
|
|
4
3
|
export declare const collapseItemProps: {
|
|
5
4
|
readonly title: import("element-plus/es/utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
6
5
|
readonly name: import("element-plus/es/utils").EpPropFinalized<(new (...args: any[]) => CollapseActiveName & {}) | (() => CollapseActiveName) | ((new (...args: any[]) => CollapseActiveName & {}) | (() => CollapseActiveName))[], unknown, unknown, () => number, boolean>;
|
|
7
6
|
readonly disabled: BooleanConstructor;
|
|
8
7
|
};
|
|
9
8
|
export declare type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>;
|
|
10
|
-
export declare type CollapseItemInstance = InstanceType<typeof CollapseItem>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collapse-item.js","sources":["../../../../../../packages/components/collapse/src/collapse-item.ts"],"sourcesContent":["import { buildProps, definePropType, generateId } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { CollapseActiveName } from './collapse'\
|
|
1
|
+
{"version":3,"file":"collapse-item.js","sources":["../../../../../../packages/components/collapse/src/collapse-item.ts"],"sourcesContent":["import { buildProps, definePropType, generateId } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { CollapseActiveName } from './collapse'\n\nexport const collapseItemProps = buildProps({\n title: {\n type: String,\n default: '',\n },\n name: {\n type: definePropType<CollapseActiveName>([String, Number]),\n default: () => generateId(),\n },\n disabled: Boolean,\n} as const)\nexport type CollapseItemProps = ExtractPropTypes<typeof collapseItemProps>\n"],"names":["buildProps","definePropType","generateId"],"mappings":";;;;;;;;AACY,MAAC,iBAAiB,GAAGA,kBAAU,CAAC;AAC5C,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,MAAMC,eAAU,EAAE;AAC/B,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,CAAC;;;;"}
|
|
@@ -1,42 +1,31 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
readonly title: import("
|
|
3
|
-
readonly name: import("
|
|
2
|
+
readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
3
|
+
readonly name: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName) | ((new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName))[], unknown, unknown, () => number, boolean>;
|
|
4
4
|
readonly disabled: BooleanConstructor;
|
|
5
5
|
}, {
|
|
6
6
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
7
|
-
readonly title: import("
|
|
8
|
-
readonly name: import("
|
|
7
|
+
readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
8
|
+
readonly name: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName) | ((new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName))[], unknown, unknown, () => number, boolean>;
|
|
9
9
|
readonly disabled: BooleanConstructor;
|
|
10
10
|
}>> & {
|
|
11
11
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
|
|
12
12
|
}>>;
|
|
13
|
-
collapse: import("element-plus/es/tokens").CollapseContext | undefined;
|
|
14
|
-
ns: {
|
|
15
|
-
namespace: import("vue").Ref<string>;
|
|
16
|
-
b: (blockSuffix?: string) => string;
|
|
17
|
-
e: (element?: string | undefined) => string;
|
|
18
|
-
m: (modifier?: string | undefined) => string;
|
|
19
|
-
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
20
|
-
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
21
|
-
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
22
|
-
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
23
|
-
is: {
|
|
24
|
-
(name: string, state: boolean | undefined): string;
|
|
25
|
-
(name: string): string;
|
|
26
|
-
};
|
|
27
|
-
cssVar: (object: Record<string, string>) => Record<string, string>;
|
|
28
|
-
cssVarName: (name: string) => string;
|
|
29
|
-
cssVarBlock: (object: Record<string, string>) => Record<string, string>;
|
|
30
|
-
cssVarBlockName: (name: string) => string;
|
|
31
|
-
};
|
|
32
13
|
focusing: import("vue").Ref<boolean>;
|
|
33
|
-
isClick: import("vue").Ref<boolean>;
|
|
34
14
|
id: import("vue").Ref<number>;
|
|
35
15
|
isActive: import("vue").ComputedRef<boolean | undefined>;
|
|
36
16
|
handleFocus: () => void;
|
|
37
17
|
handleHeaderClick: () => void;
|
|
38
18
|
handleEnterClick: () => void;
|
|
39
|
-
|
|
19
|
+
arrowKls: import("vue").ComputedRef<string[]>;
|
|
20
|
+
headKls: import("vue").ComputedRef<(string | {
|
|
21
|
+
focusing: boolean | undefined;
|
|
22
|
+
})[]>;
|
|
23
|
+
rootKls: import("vue").ComputedRef<string[]>;
|
|
24
|
+
itemWrapperKls: import("vue").ComputedRef<string>;
|
|
25
|
+
itemContentKls: import("vue").ComputedRef<string>;
|
|
26
|
+
scopedContentId: import("vue").ComputedRef<string>;
|
|
27
|
+
scopedHeadId: import("vue").ComputedRef<string>;
|
|
28
|
+
ElCollapseTransition: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{}, {
|
|
40
29
|
ns: {
|
|
41
30
|
namespace: import("vue").Ref<string>;
|
|
42
31
|
b: (blockSuffix?: string) => string;
|
|
@@ -64,9 +53,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
64
53
|
afterLeave(el: import("vue").RendererElement): void;
|
|
65
54
|
};
|
|
66
55
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>>;
|
|
67
|
-
ElIcon: import("
|
|
56
|
+
ElIcon: import("../../../utils").SFCWithInstall<import("vue").DefineComponent<{
|
|
68
57
|
readonly size: {
|
|
69
|
-
readonly type: import("vue").PropType<import("
|
|
58
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
70
59
|
readonly required: false;
|
|
71
60
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
72
61
|
__epPropKey: true;
|
|
@@ -80,7 +69,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
80
69
|
}, {
|
|
81
70
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
82
71
|
readonly size: {
|
|
83
|
-
readonly type: import("vue").PropType<import("
|
|
72
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
84
73
|
readonly required: false;
|
|
85
74
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
86
75
|
__epPropKey: true;
|
|
@@ -115,7 +104,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
104
|
style: import("vue").ComputedRef<import("vue").CSSProperties>;
|
|
116
105
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
117
106
|
readonly size: {
|
|
118
|
-
readonly type: import("vue").PropType<import("
|
|
107
|
+
readonly type: import("vue").PropType<import("../../../utils").EpPropMergeType<(new (...args: any[]) => (string | number) & {}) | (() => string | number) | ((new (...args: any[]) => (string | number) & {}) | (() => string | number))[], unknown, unknown>>;
|
|
119
108
|
readonly required: false;
|
|
120
109
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
121
110
|
__epPropKey: true;
|
|
@@ -129,12 +118,12 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
129
118
|
}>>, {}>> & Record<string, any>;
|
|
130
119
|
ArrowRight: import("vue").DefineComponent<{}, {}, {}, import("vue").ComputedOptions, import("vue").MethodOptions, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
131
120
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
132
|
-
readonly title: import("
|
|
133
|
-
readonly name: import("
|
|
121
|
+
readonly title: import("../../../utils").EpPropFinalized<StringConstructor, unknown, unknown, "", boolean>;
|
|
122
|
+
readonly name: import("../../../utils").EpPropFinalized<(new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName) | ((new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName))[], unknown, unknown, () => number, boolean>;
|
|
134
123
|
readonly disabled: BooleanConstructor;
|
|
135
124
|
}>>, {
|
|
136
125
|
readonly disabled: boolean;
|
|
137
|
-
readonly name: import("
|
|
126
|
+
readonly name: import("../../../utils").EpPropMergeType<(new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName) | ((new (...args: any[]) => import("./collapse").CollapseActiveName & {}) | (() => import("./collapse").CollapseActiveName))[], unknown, unknown>;
|
|
138
127
|
readonly title: string;
|
|
139
128
|
}>;
|
|
140
129
|
export default _default;
|
|
@@ -3,20 +3,15 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
-
require('
|
|
7
|
-
var index
|
|
8
|
-
var index$1 = require('../../icon/index.js');
|
|
6
|
+
var index$1 = require('../../collapse-transition/index.js');
|
|
7
|
+
var index = require('../../icon/index.js');
|
|
9
8
|
var iconsVue = require('@element-plus/icons-vue');
|
|
10
|
-
require('../../../hooks/index.js');
|
|
11
|
-
require('../../../tokens/index.js');
|
|
12
9
|
var collapseItem = require('./collapse-item.js');
|
|
10
|
+
var useCollapseItem = require('./use-collapse-item.js');
|
|
13
11
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
14
|
-
var collapse = require('../../../tokens/collapse.js');
|
|
15
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
16
|
-
var rand = require('../../../utils/rand.js');
|
|
17
12
|
|
|
18
13
|
const _hoisted_1 = ["aria-expanded", "aria-controls", "aria-describedby"];
|
|
19
|
-
const _hoisted_2 = ["id", "tabindex"
|
|
14
|
+
const _hoisted_2 = ["id", "tabindex"];
|
|
20
15
|
const _hoisted_3 = ["id", "aria-hidden", "aria-labelledby"];
|
|
21
16
|
const __default__ = vue.defineComponent({
|
|
22
17
|
name: "ElCollapseItem"
|
|
@@ -26,67 +21,51 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
26
21
|
props: collapseItem.collapseItemProps,
|
|
27
22
|
setup(__props, { expose }) {
|
|
28
23
|
const props = __props;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return;
|
|
47
|
-
collapse$1 == null ? void 0 : collapse$1.handleItemClick(props.name);
|
|
48
|
-
focusing.value = false;
|
|
49
|
-
isClick.value = true;
|
|
50
|
-
};
|
|
51
|
-
const handleEnterClick = () => {
|
|
52
|
-
collapse$1 == null ? void 0 : collapse$1.handleItemClick(props.name);
|
|
53
|
-
};
|
|
24
|
+
const {
|
|
25
|
+
focusing,
|
|
26
|
+
id,
|
|
27
|
+
isActive,
|
|
28
|
+
handleFocus,
|
|
29
|
+
handleHeaderClick,
|
|
30
|
+
handleEnterClick
|
|
31
|
+
} = useCollapseItem.useCollapseItem(props);
|
|
32
|
+
const {
|
|
33
|
+
arrowKls,
|
|
34
|
+
headKls,
|
|
35
|
+
rootKls,
|
|
36
|
+
itemWrapperKls,
|
|
37
|
+
itemContentKls,
|
|
38
|
+
scopedContentId,
|
|
39
|
+
scopedHeadId
|
|
40
|
+
} = useCollapseItem.useCollapseItemDOM(props, { focusing, isActive, id });
|
|
54
41
|
expose({
|
|
55
42
|
isActive
|
|
56
43
|
});
|
|
57
44
|
return (_ctx, _cache) => {
|
|
58
45
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
59
|
-
class: vue.normalizeClass(
|
|
60
|
-
vue.unref(ns).b("item"),
|
|
61
|
-
vue.unref(ns).is("active", vue.unref(isActive)),
|
|
62
|
-
vue.unref(ns).is("disabled", _ctx.disabled)
|
|
63
|
-
])
|
|
46
|
+
class: vue.normalizeClass(vue.unref(rootKls))
|
|
64
47
|
}, [
|
|
65
48
|
vue.createElementVNode("div", {
|
|
66
49
|
role: "tab",
|
|
67
50
|
"aria-expanded": vue.unref(isActive),
|
|
68
|
-
"aria-controls": vue.unref(
|
|
69
|
-
"aria-describedby": vue.unref(
|
|
51
|
+
"aria-controls": vue.unref(scopedContentId),
|
|
52
|
+
"aria-describedby": vue.unref(scopedContentId)
|
|
70
53
|
}, [
|
|
71
54
|
vue.createElementVNode("div", {
|
|
72
|
-
id: vue.unref(
|
|
73
|
-
class: vue.normalizeClass(
|
|
74
|
-
vue.unref(ns).be("item", "header"),
|
|
75
|
-
vue.unref(ns).is("active", vue.unref(isActive)),
|
|
76
|
-
{ focusing: focusing.value && !_ctx.disabled }
|
|
77
|
-
]),
|
|
55
|
+
id: vue.unref(scopedHeadId),
|
|
56
|
+
class: vue.normalizeClass(vue.unref(headKls)),
|
|
78
57
|
role: "button",
|
|
79
58
|
tabindex: _ctx.disabled ? -1 : 0,
|
|
80
|
-
onClick: handleHeaderClick,
|
|
81
|
-
onKeypress: vue.withKeys(vue.withModifiers(handleEnterClick, ["stop", "prevent"]), ["space", "enter"]),
|
|
82
|
-
onFocus: handleFocus,
|
|
83
|
-
onBlur: _cache[
|
|
59
|
+
onClick: _cache[0] || (_cache[0] = (...args) => vue.unref(handleHeaderClick) && vue.unref(handleHeaderClick)(...args)),
|
|
60
|
+
onKeypress: _cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers((...args) => vue.unref(handleEnterClick) && vue.unref(handleEnterClick)(...args), ["stop", "prevent"]), ["space", "enter"])),
|
|
61
|
+
onFocus: _cache[2] || (_cache[2] = (...args) => vue.unref(handleFocus) && vue.unref(handleFocus)(...args)),
|
|
62
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => focusing.value = false)
|
|
84
63
|
}, [
|
|
85
64
|
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
86
65
|
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
87
66
|
]),
|
|
88
|
-
vue.createVNode(vue.unref(index
|
|
89
|
-
class: vue.normalizeClass(
|
|
67
|
+
vue.createVNode(vue.unref(index.ElIcon), {
|
|
68
|
+
class: vue.normalizeClass(vue.unref(arrowKls))
|
|
90
69
|
}, {
|
|
91
70
|
default: vue.withCtx(() => [
|
|
92
71
|
vue.createVNode(vue.unref(iconsVue.ArrowRight))
|
|
@@ -95,17 +74,17 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
95
74
|
}, 8, ["class"])
|
|
96
75
|
], 42, _hoisted_2)
|
|
97
76
|
], 8, _hoisted_1),
|
|
98
|
-
vue.createVNode(vue.unref(index$
|
|
77
|
+
vue.createVNode(vue.unref(index$1["default"]), null, {
|
|
99
78
|
default: vue.withCtx(() => [
|
|
100
79
|
vue.withDirectives(vue.createElementVNode("div", {
|
|
101
|
-
id: vue.unref(
|
|
102
|
-
class: vue.normalizeClass(vue.unref(
|
|
80
|
+
id: vue.unref(scopedContentId),
|
|
81
|
+
class: vue.normalizeClass(vue.unref(itemWrapperKls)),
|
|
103
82
|
role: "tabpanel",
|
|
104
83
|
"aria-hidden": !vue.unref(isActive),
|
|
105
|
-
"aria-labelledby": vue.unref(
|
|
84
|
+
"aria-labelledby": vue.unref(scopedHeadId)
|
|
106
85
|
}, [
|
|
107
86
|
vue.createElementVNode("div", {
|
|
108
|
-
class: vue.normalizeClass(vue.unref(
|
|
87
|
+
class: vue.normalizeClass(vue.unref(itemContentKls))
|
|
109
88
|
}, [
|
|
110
89
|
vue.renderSlot(_ctx.$slots, "default")
|
|
111
90
|
], 2)
|