This commit is contained in:
2025-09-19 14:25:20 +08:00
parent 269893a435
commit fbf3f77229
24949 changed files with 2839404 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
import CollapseTransition from './src/collapse-transition.vue';
import type { SFCWithInstall } from 'element-plus/es/utils';
export declare const ElCollapseTransition: SFCWithInstall<typeof CollapseTransition>;
export default ElCollapseTransition;

View File

@@ -0,0 +1,7 @@
import CollapseTransition from './src/collapse-transition.mjs';
import { withInstall } from '../../utils/vue/install.mjs';
const ElCollapseTransition = withInstall(CollapseTransition);
export { ElCollapseTransition, ElCollapseTransition as default };
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../../../../packages/components/collapse-transition/index.ts"],"sourcesContent":["import { withInstall } from '@element-plus/utils'\nimport CollapseTransition from './src/collapse-transition.vue'\n\nimport type { SFCWithInstall } from '@element-plus/utils'\n\nexport const ElCollapseTransition: SFCWithInstall<typeof CollapseTransition> =\n withInstall(CollapseTransition)\n\nexport default ElCollapseTransition\n"],"names":[],"mappings":";;;AAEY,MAAC,oBAAoB,GAAG,WAAW,CAAC,kBAAkB;;;;"}

View File

@@ -0,0 +1,90 @@
import { defineComponent, openBlock, createBlock, Transition, mergeProps, unref, toHandlers, withCtx, renderSlot } from 'vue';
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
const __default__ = defineComponent({
name: "ElCollapseTransition"
});
const _sfc_main = /* @__PURE__ */ defineComponent({
...__default__,
setup(__props) {
const ns = useNamespace("collapse-transition");
const reset = (el) => {
el.style.maxHeight = "";
el.style.overflow = el.dataset.oldOverflow;
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
};
const on = {
beforeEnter(el) {
if (!el.dataset)
el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
if (el.style.height)
el.dataset.elExistsHeight = el.style.height;
el.style.maxHeight = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
},
enter(el) {
requestAnimationFrame(() => {
el.dataset.oldOverflow = el.style.overflow;
if (el.dataset.elExistsHeight) {
el.style.maxHeight = el.dataset.elExistsHeight;
} else if (el.scrollHeight !== 0) {
el.style.maxHeight = `${el.scrollHeight}px`;
} else {
el.style.maxHeight = 0;
}
el.style.paddingTop = el.dataset.oldPaddingTop;
el.style.paddingBottom = el.dataset.oldPaddingBottom;
el.style.overflow = "hidden";
});
},
afterEnter(el) {
el.style.maxHeight = "";
el.style.overflow = el.dataset.oldOverflow;
},
enterCancelled(el) {
reset(el);
},
beforeLeave(el) {
if (!el.dataset)
el.dataset = {};
el.dataset.oldPaddingTop = el.style.paddingTop;
el.dataset.oldPaddingBottom = el.style.paddingBottom;
el.dataset.oldOverflow = el.style.overflow;
el.style.maxHeight = `${el.scrollHeight}px`;
el.style.overflow = "hidden";
},
leave(el) {
if (el.scrollHeight !== 0) {
el.style.maxHeight = 0;
el.style.paddingTop = 0;
el.style.paddingBottom = 0;
}
},
afterLeave(el) {
reset(el);
},
leaveCancelled(el) {
reset(el);
}
};
return (_ctx, _cache) => {
return openBlock(), createBlock(Transition, mergeProps({
name: unref(ns).b()
}, toHandlers(on)), {
default: withCtx(() => [
renderSlot(_ctx.$slots, "default")
]),
_: 3
}, 16, ["name"]);
};
}
});
var CollapseTransition = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "collapse-transition.vue"]]);
export { CollapseTransition as default };
//# sourceMappingURL=collapse-transition.mjs.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,11 @@
declare function __VLS_template(): {
default?(_: {}): any;
};
declare const __VLS_component: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
export default _default;
type __VLS_WithTemplateSlots<T, S> = T & {
new (): {
$slots: S;
};
};

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style/css';
import 'element-plus/theme-chalk/el-collapse-transition.css';

View File

@@ -0,0 +1,3 @@
import '../../base/style/css.mjs';
import 'element-plus/theme-chalk/el-collapse-transition.css';
//# sourceMappingURL=css.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"css.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}

View File

@@ -0,0 +1,2 @@
import 'element-plus/es/components/base/style';
import 'element-plus/theme-chalk/src/collapse-transition.scss';

View File

@@ -0,0 +1,3 @@
import '../../base/style/index.mjs';
import 'element-plus/theme-chalk/src/collapse-transition.scss';
//# sourceMappingURL=index.mjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}