@element-plus/nightly 0.0.20240211 → 0.0.20240213
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +2 -2
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.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/alert/index.mjs +2 -2
- package/es/components/alert/src/alert.mjs +36 -96
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +96 -36
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +67 -32
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +32 -67
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +56 -11
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +11 -56
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/card/index.mjs +2 -2
- package/es/components/card/src/card.mjs +43 -21
- package/es/components/card/src/card.mjs.map +1 -1
- package/es/components/card/src/card2.mjs +21 -43
- package/es/components/card/src/card2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-group.mjs +28 -72
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-group2.mjs +72 -28
- package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +43 -66
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +66 -43
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/index.mjs +8 -8
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +4 -35
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +35 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +7 -75
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +75 -7
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/index.mjs +8 -8
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/alert/index.js +2 -2
- package/lib/components/alert/src/alert.js +37 -95
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +95 -37
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +67 -33
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +33 -67
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +56 -11
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +11 -56
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/card/index.js +2 -2
- package/lib/components/card/src/card.js +43 -21
- package/lib/components/card/src/card.js.map +1 -1
- package/lib/components/card/src/card2.js +21 -43
- package/lib/components/card/src/card2.js.map +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-group.js +29 -72
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group2.js +72 -29
- package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +43 -66
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +66 -43
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/index.js +8 -8
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +4 -35
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +35 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +7 -75
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +75 -7
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/index.js +8 -8
- 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/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { TabsPaneContext } from './constants'\nimport type TabBar from './tab-bar.vue'\n\nexport const tabBarProps = buildProps({\n tabs: {\n type: definePropType<TabsPaneContext[]>(Array),\n default: () => mutable([] as const),\n },\n} as const)\n\nexport type TabBarProps = ExtractPropTypes<typeof tabBarProps>\nexport type TabBarInstance = InstanceType<typeof TabBar>\n"],"names":[],"mappings":";;;;AACY,MAAC,WAAW,GAAG,UAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,OAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,13 +1,81 @@
|
|
|
1
|
+
import { defineComponent, getCurrentInstance, inject, ref, watch, nextTick, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';
|
|
2
|
+
import { useResizeObserver } from '@vueuse/core';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import { tabsRootContextKey } from './constants.mjs';
|
|
6
|
+
import { tabBarProps } from './tab-bar.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { throwError } from '../../../utils/error.mjs';
|
|
9
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
10
|
+
import { capitalize } from '../../../utils/strings.mjs';
|
|
4
11
|
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
12
|
+
const COMPONENT_NAME = "ElTabBar";
|
|
13
|
+
const __default__ = defineComponent({
|
|
14
|
+
name: COMPONENT_NAME
|
|
15
|
+
});
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: tabBarProps,
|
|
19
|
+
setup(__props, { expose }) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const instance = getCurrentInstance();
|
|
22
|
+
const rootTabs = inject(tabsRootContextKey);
|
|
23
|
+
if (!rootTabs)
|
|
24
|
+
throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
|
|
25
|
+
const ns = useNamespace("tabs");
|
|
26
|
+
const barRef = ref();
|
|
27
|
+
const barStyle = ref();
|
|
28
|
+
const getBarStyle = () => {
|
|
29
|
+
let offset = 0;
|
|
30
|
+
let tabSize = 0;
|
|
31
|
+
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
|
|
32
|
+
const sizeDir = sizeName === "width" ? "x" : "y";
|
|
33
|
+
const position = sizeDir === "x" ? "left" : "top";
|
|
34
|
+
props.tabs.every((tab) => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
|
|
37
|
+
if (!$el)
|
|
38
|
+
return false;
|
|
39
|
+
if (!tab.active) {
|
|
40
|
+
return true;
|
|
41
|
+
}
|
|
42
|
+
offset = $el[`offset${capitalize(position)}`];
|
|
43
|
+
tabSize = $el[`client${capitalize(sizeName)}`];
|
|
44
|
+
const tabStyles = window.getComputedStyle($el);
|
|
45
|
+
if (sizeName === "width") {
|
|
46
|
+
if (props.tabs.length > 1) {
|
|
47
|
+
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
|
48
|
+
}
|
|
49
|
+
offset += Number.parseFloat(tabStyles.paddingLeft);
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
return {
|
|
54
|
+
[sizeName]: `${tabSize}px`,
|
|
55
|
+
transform: `translate${capitalize(sizeDir)}(${offset}px)`
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
const update = () => barStyle.value = getBarStyle();
|
|
59
|
+
watch(() => props.tabs, async () => {
|
|
60
|
+
await nextTick();
|
|
61
|
+
update();
|
|
62
|
+
}, { immediate: true });
|
|
63
|
+
useResizeObserver(barRef, () => update());
|
|
64
|
+
expose({
|
|
65
|
+
ref: barRef,
|
|
66
|
+
update
|
|
67
|
+
});
|
|
68
|
+
return (_ctx, _cache) => {
|
|
69
|
+
return openBlock(), createElementBlock("div", {
|
|
70
|
+
ref_key: "barRef",
|
|
71
|
+
ref: barRef,
|
|
72
|
+
class: normalizeClass([unref(ns).e("active-bar"), unref(ns).is(unref(rootTabs).props.tabPosition)]),
|
|
73
|
+
style: normalizeStyle(barStyle.value)
|
|
74
|
+
}, null, 6);
|
|
75
|
+
};
|
|
9
76
|
}
|
|
10
77
|
});
|
|
78
|
+
var TabBar = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "tab-bar.vue"]]);
|
|
11
79
|
|
|
12
|
-
export {
|
|
80
|
+
export { TabBar as default };
|
|
13
81
|
//# sourceMappingURL=tab-bar2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar2.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar2.mjs","sources":["../../../../../../packages/components/tabs/src/tab-bar.vue"],"sourcesContent":["<template>\n <div\n ref=\"barRef\"\n :class=\"[ns.e('active-bar'), ns.is(rootTabs.props.tabPosition)]\"\n :style=\"barStyle\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, nextTick, ref, watch } from 'vue'\nimport { useResizeObserver } from '@vueuse/core'\nimport { capitalize, throwError } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { tabsRootContextKey } from './constants'\nimport { tabBarProps } from './tab-bar'\n\nimport type { CSSProperties } from 'vue'\n\nconst COMPONENT_NAME = 'ElTabBar'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(tabBarProps)\n\nconst instance = getCurrentInstance()!\nconst rootTabs = inject(tabsRootContextKey)\nif (!rootTabs) throwError(COMPONENT_NAME, '<el-tabs><el-tab-bar /></el-tabs>')\n\nconst ns = useNamespace('tabs')\n\nconst barRef = ref<HTMLDivElement>()\nconst barStyle = ref<CSSProperties>()\n\nconst getBarStyle = (): CSSProperties => {\n let offset = 0\n let tabSize = 0\n\n const sizeName = ['top', 'bottom'].includes(rootTabs.props.tabPosition)\n ? 'width'\n : 'height'\n const sizeDir = sizeName === 'width' ? 'x' : 'y'\n const position = sizeDir === 'x' ? 'left' : 'top'\n\n props.tabs.every((tab) => {\n const $el = instance.parent?.refs?.[`tab-${tab.uid}`] as HTMLElement\n if (!$el) return false\n\n if (!tab.active) {\n return true\n }\n\n offset = $el[`offset${capitalize(position)}`]\n tabSize = $el[`client${capitalize(sizeName)}`]\n\n const tabStyles = window.getComputedStyle($el)\n\n if (sizeName === 'width') {\n if (props.tabs.length > 1) {\n tabSize -=\n Number.parseFloat(tabStyles.paddingLeft) +\n Number.parseFloat(tabStyles.paddingRight)\n }\n offset += Number.parseFloat(tabStyles.paddingLeft)\n }\n return false\n })\n\n return {\n [sizeName]: `${tabSize}px`,\n transform: `translate${capitalize(sizeDir)}(${offset}px)`,\n }\n}\n\nconst update = () => (barStyle.value = getBarStyle())\n\nwatch(\n () => props.tabs,\n async () => {\n await nextTick()\n update()\n },\n { immediate: true }\n)\nuseResizeObserver(barRef, () => update())\n\ndefineExpose({\n /** @description tab root html element */\n ref: barRef,\n /** @description method to manually update tab bar style */\n update,\n})\n</script>\n"],"names":[],"mappings":"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"}
|
|
@@ -5,7 +5,7 @@ import '../../../constants/index.mjs';
|
|
|
5
5
|
import { ElIcon } from '../../icon/index.mjs';
|
|
6
6
|
import { ArrowLeft, ArrowRight, Close } from '@element-plus/icons-vue';
|
|
7
7
|
import '../../../hooks/index.mjs';
|
|
8
|
-
import TabBar from './tab-
|
|
8
|
+
import TabBar from './tab-bar2.mjs';
|
|
9
9
|
import { tabsRootContextKey } from './constants.mjs';
|
|
10
10
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
11
11
|
import { mutable } from '../../../utils/typescript.mjs';
|
package/es/index.mjs
CHANGED
|
@@ -8,18 +8,18 @@ export { makeInstaller } from './make-installer.mjs';
|
|
|
8
8
|
export { default as dayjs } from 'dayjs';
|
|
9
9
|
export { affixEmits, affixProps } from './components/affix/src/affix.mjs';
|
|
10
10
|
export { ElAffix } from './components/affix/index.mjs';
|
|
11
|
-
export { alertEffects, alertEmits, alertProps } from './components/alert/src/
|
|
11
|
+
export { alertEffects, alertEmits, alertProps } from './components/alert/src/alert.mjs';
|
|
12
12
|
export { ElAlert } from './components/alert/index.mjs';
|
|
13
13
|
export { autocompleteEmits, autocompleteProps } from './components/autocomplete/src/autocomplete.mjs';
|
|
14
14
|
export { ElAutocomplete } from './components/autocomplete/index.mjs';
|
|
15
|
-
export { avatarEmits, avatarProps } from './components/avatar/src/
|
|
15
|
+
export { avatarEmits, avatarProps } from './components/avatar/src/avatar2.mjs';
|
|
16
16
|
export { ElAvatar } from './components/avatar/index.mjs';
|
|
17
17
|
export { backtopEmits, backtopProps } from './components/backtop/src/backtop.mjs';
|
|
18
18
|
export { ElBacktop } from './components/backtop/index.mjs';
|
|
19
19
|
export { badgeProps } from './components/badge/src/badge.mjs';
|
|
20
20
|
export { ElBadge } from './components/badge/index.mjs';
|
|
21
21
|
export { breadcrumbProps } from './components/breadcrumb/src/breadcrumb.mjs';
|
|
22
|
-
export { breadcrumbItemProps } from './components/breadcrumb/src/breadcrumb-
|
|
22
|
+
export { breadcrumbItemProps } from './components/breadcrumb/src/breadcrumb-item2.mjs';
|
|
23
23
|
export { breadcrumbKey } from './components/breadcrumb/src/constants.mjs';
|
|
24
24
|
export { ElBreadcrumb, ElBreadcrumbItem } from './components/breadcrumb/index.mjs';
|
|
25
25
|
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './components/button/src/button.mjs';
|
|
@@ -27,7 +27,7 @@ export { buttonGroupContextKey } from './components/button/src/constants.mjs';
|
|
|
27
27
|
export { ElButton, ElButtonGroup } from './components/button/index.mjs';
|
|
28
28
|
export { calendarEmits, calendarProps } from './components/calendar/src/calendar.mjs';
|
|
29
29
|
export { ElCalendar } from './components/calendar/index.mjs';
|
|
30
|
-
export { cardProps } from './components/card/src/
|
|
30
|
+
export { cardProps } from './components/card/src/card2.mjs';
|
|
31
31
|
export { ElCard } from './components/card/index.mjs';
|
|
32
32
|
export { carouselEmits, carouselProps } from './components/carousel/src/carousel.mjs';
|
|
33
33
|
export { carouselItemProps } from './components/carousel/src/carousel-item.mjs';
|
|
@@ -40,11 +40,11 @@ export { CommonProps, DefaultProps, useCascaderConfig } from './components/casca
|
|
|
40
40
|
export { ElCascaderPanel } from './components/cascader-panel/index.mjs';
|
|
41
41
|
export { checkTagEmits, checkTagProps } from './components/check-tag/src/check-tag.mjs';
|
|
42
42
|
export { ElCheckTag } from './components/check-tag/index.mjs';
|
|
43
|
-
export { checkboxGroupEmits, checkboxGroupProps } from './components/checkbox/src/checkbox-
|
|
43
|
+
export { checkboxGroupEmits, checkboxGroupProps } from './components/checkbox/src/checkbox-group.mjs';
|
|
44
44
|
export { checkboxEmits, checkboxProps } from './components/checkbox/src/checkbox.mjs';
|
|
45
45
|
export { checkboxGroupContextKey } from './components/checkbox/src/constants.mjs';
|
|
46
46
|
export { ElCheckbox, ElCheckboxButton, ElCheckboxGroup } from './components/checkbox/index.mjs';
|
|
47
|
-
export { colProps } from './components/col/src/
|
|
47
|
+
export { colProps } from './components/col/src/col.mjs';
|
|
48
48
|
export { ElCol } from './components/col/index.mjs';
|
|
49
49
|
export { collapseEmits, collapseProps, emitChangeFn } from './components/collapse/src/collapse.mjs';
|
|
50
50
|
export { collapseItemProps } from './components/collapse/src/collapse-item2.mjs';
|
|
@@ -99,7 +99,7 @@ export { linkEmits, linkProps } from './components/link/src/link.mjs';
|
|
|
99
99
|
export { ElLink } from './components/link/index.mjs';
|
|
100
100
|
export { menuEmits, menuProps } from './components/menu/src/menu.mjs';
|
|
101
101
|
export { menuItemEmits, menuItemProps } from './components/menu/src/menu-item.mjs';
|
|
102
|
-
export { menuItemGroupProps } from './components/menu/src/menu-item-
|
|
102
|
+
export { menuItemGroupProps } from './components/menu/src/menu-item-group.mjs';
|
|
103
103
|
export { subMenuProps } from './components/menu/src/sub-menu.mjs';
|
|
104
104
|
export { ElMenu, ElMenuItem, ElMenuItemGroup, ElSubMenu } from './components/menu/index.mjs';
|
|
105
105
|
export { overlayEmits, overlayProps } from './components/overlay/src/overlay.mjs';
|
|
@@ -168,7 +168,7 @@ export { tableV2Props } from './components/table-v2/src/table.mjs';
|
|
|
168
168
|
export { tableV2RowProps } from './components/table-v2/src/row.mjs';
|
|
169
169
|
export { ElAutoResizer, ElTableV2 } from './components/table-v2/index.mjs';
|
|
170
170
|
export { tabsEmits, tabsProps } from './components/tabs/src/tabs.mjs';
|
|
171
|
-
export { tabBarProps } from './components/tabs/src/tab-
|
|
171
|
+
export { tabBarProps } from './components/tabs/src/tab-bar.mjs';
|
|
172
172
|
export { tabNavEmits, tabNavProps } from './components/tabs/src/tab-nav.mjs';
|
|
173
173
|
export { tabPaneProps } from './components/tabs/src/tab-pane.mjs';
|
|
174
174
|
export { tabsRootContextKey } from './components/tabs/src/constants.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20240213";
|
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.20240213'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var alert$1 = require('./src/
|
|
7
|
-
var alert = require('./src/
|
|
6
|
+
var alert$1 = require('./src/alert2.js');
|
|
7
|
+
var alert = require('./src/alert.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAlert = install.withInstall(alert$1["default"]);
|
|
@@ -2,105 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index$1 = require('../../icon/index.js');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
10
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var objects = require('../../../utils/objects.js');
|
|
11
8
|
var icon = require('../../../utils/vue/icon.js');
|
|
12
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
9
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, {
|
|
44
|
-
default: vue.withCtx(() => [
|
|
45
|
-
vue.withDirectives(vue.createElementVNode("div", {
|
|
46
|
-
class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.type), vue.unref(ns).is("center", _ctx.center), vue.unref(ns).is(_ctx.effect)]),
|
|
47
|
-
role: "alert"
|
|
48
|
-
}, [
|
|
49
|
-
_ctx.showIcon && vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
50
|
-
key: 0,
|
|
51
|
-
class: vue.normalizeClass(vue.unref(iconClass))
|
|
52
|
-
}, {
|
|
53
|
-
default: vue.withCtx(() => [
|
|
54
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
55
|
-
]),
|
|
56
|
-
_: 1
|
|
57
|
-
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
58
|
-
vue.createElementVNode("div", {
|
|
59
|
-
class: vue.normalizeClass(vue.unref(ns).e("content"))
|
|
60
|
-
}, [
|
|
61
|
-
_ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
62
|
-
key: 0,
|
|
63
|
-
class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(isBoldTitle)])
|
|
64
|
-
}, [
|
|
65
|
-
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
66
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
67
|
-
])
|
|
68
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
69
|
-
_ctx.$slots.default || _ctx.description ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
70
|
-
key: 1,
|
|
71
|
-
class: vue.normalizeClass(vue.unref(ns).e("description"))
|
|
72
|
-
}, [
|
|
73
|
-
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
74
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
|
|
75
|
-
])
|
|
76
|
-
], 2)) : vue.createCommentVNode("v-if", true),
|
|
77
|
-
_ctx.closable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
78
|
-
_ctx.closeText ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
79
|
-
key: 0,
|
|
80
|
-
class: vue.normalizeClass([vue.unref(ns).e("close-btn"), vue.unref(ns).is("customed")]),
|
|
81
|
-
onClick: close
|
|
82
|
-
}, vue.toDisplayString(_ctx.closeText), 3)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
83
|
-
key: 1,
|
|
84
|
-
class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
|
|
85
|
-
onClick: close
|
|
86
|
-
}, {
|
|
87
|
-
default: vue.withCtx(() => [
|
|
88
|
-
vue.createVNode(vue.unref(Close))
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}, 8, ["class"]))
|
|
92
|
-
], 64)) : vue.createCommentVNode("v-if", true)
|
|
93
|
-
], 2)
|
|
94
|
-
], 2), [
|
|
95
|
-
[vue.vShow, visible.value]
|
|
96
|
-
])
|
|
97
|
-
]),
|
|
98
|
-
_: 3
|
|
99
|
-
}, 8, ["name"]);
|
|
100
|
-
};
|
|
10
|
+
const alertEffects = ["light", "dark"];
|
|
11
|
+
const alertProps = runtime.buildProps({
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
description: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
type: {
|
|
21
|
+
type: String,
|
|
22
|
+
values: objects.keysOf(icon.TypeComponentsMap),
|
|
23
|
+
default: "info"
|
|
24
|
+
},
|
|
25
|
+
closable: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
closeText: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
showIcon: Boolean,
|
|
34
|
+
center: Boolean,
|
|
35
|
+
effect: {
|
|
36
|
+
type: String,
|
|
37
|
+
values: alertEffects,
|
|
38
|
+
default: "light"
|
|
101
39
|
}
|
|
102
40
|
});
|
|
103
|
-
|
|
41
|
+
const alertEmits = {
|
|
42
|
+
close: (evt) => evt instanceof MouseEvent
|
|
43
|
+
};
|
|
104
44
|
|
|
105
|
-
exports
|
|
45
|
+
exports.alertEffects = alertEffects;
|
|
46
|
+
exports.alertEmits = alertEmits;
|
|
47
|
+
exports.alertProps = alertProps;
|
|
106
48
|
//# sourceMappingURL=alert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.js","sources":["../../../../../../packages/components/alert/src/alert.
|
|
1
|
+
{"version":3,"file":"alert.js","sources":["../../../../../../packages/components/alert/src/alert.ts"],"sourcesContent":["import { TypeComponentsMap, buildProps, keysOf } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const alertEffects = ['light', 'dark'] as const\n\nexport const alertProps = buildProps({\n /**\n * @description alert title.\n */\n title: {\n type: String,\n default: '',\n },\n description: {\n type: String,\n default: '',\n },\n /**\n * @description alert type.\n */\n type: {\n type: String,\n values: keysOf(TypeComponentsMap),\n default: 'info',\n },\n /**\n * @description whether alert can be dismissed.\n */\n closable: {\n type: Boolean,\n default: true,\n },\n /**\n * @description text for replacing x button\n */\n closeText: {\n type: String,\n default: '',\n },\n /**\n * @description whether show icon\n */\n showIcon: Boolean,\n /**\n * @description should content be placed in center.\n */\n center: Boolean,\n effect: {\n type: String,\n values: alertEffects,\n default: 'light',\n },\n} as const)\nexport type AlertProps = ExtractPropTypes<typeof alertProps>\n\nexport const alertEmits = {\n close: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type AlertEmits = typeof alertEmits\n"],"names":["buildProps","keysOf","TypeComponentsMap"],"mappings":";;;;;;;;;AACY,MAAC,YAAY,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE;AAClC,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,cAAM,CAACC,sBAAiB,CAAC;AACrC,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,YAAY;AACxB,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;;;"}
|
|
@@ -2,47 +2,105 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index$1 = require('../../icon/index.js');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var alert = require('./alert.js');
|
|
10
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
8
11
|
var icon = require('../../../utils/vue/icon.js');
|
|
12
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
9
13
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
14
|
+
const __default__ = vue.defineComponent({
|
|
15
|
+
name: "ElAlert"
|
|
16
|
+
});
|
|
17
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
18
|
+
...__default__,
|
|
19
|
+
props: alert.alertProps,
|
|
20
|
+
emits: alert.alertEmits,
|
|
21
|
+
setup(__props, { emit }) {
|
|
22
|
+
const props = __props;
|
|
23
|
+
const { Close } = icon.TypeComponents;
|
|
24
|
+
const slots = vue.useSlots();
|
|
25
|
+
const ns = index.useNamespace("alert");
|
|
26
|
+
const visible = vue.ref(true);
|
|
27
|
+
const iconComponent = vue.computed(() => icon.TypeComponentsMap[props.type]);
|
|
28
|
+
const iconClass = vue.computed(() => [
|
|
29
|
+
ns.e("icon"),
|
|
30
|
+
{ [ns.is("big")]: !!props.description || !!slots.default }
|
|
31
|
+
]);
|
|
32
|
+
const isBoldTitle = vue.computed(() => {
|
|
33
|
+
return { [ns.is("bold")]: props.description || slots.default };
|
|
34
|
+
});
|
|
35
|
+
const close = (evt) => {
|
|
36
|
+
visible.value = false;
|
|
37
|
+
emit("close", evt);
|
|
38
|
+
};
|
|
39
|
+
return (_ctx, _cache) => {
|
|
40
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, {
|
|
41
|
+
name: vue.unref(ns).b("fade"),
|
|
42
|
+
persisted: ""
|
|
43
|
+
}, {
|
|
44
|
+
default: vue.withCtx(() => [
|
|
45
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
46
|
+
class: vue.normalizeClass([vue.unref(ns).b(), vue.unref(ns).m(_ctx.type), vue.unref(ns).is("center", _ctx.center), vue.unref(ns).is(_ctx.effect)]),
|
|
47
|
+
role: "alert"
|
|
48
|
+
}, [
|
|
49
|
+
_ctx.showIcon && vue.unref(iconComponent) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
50
|
+
key: 0,
|
|
51
|
+
class: vue.normalizeClass(vue.unref(iconClass))
|
|
52
|
+
}, {
|
|
53
|
+
default: vue.withCtx(() => [
|
|
54
|
+
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(vue.unref(iconComponent))))
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
}, 8, ["class"])) : vue.createCommentVNode("v-if", true),
|
|
58
|
+
vue.createElementVNode("div", {
|
|
59
|
+
class: vue.normalizeClass(vue.unref(ns).e("content"))
|
|
60
|
+
}, [
|
|
61
|
+
_ctx.title || _ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
62
|
+
key: 0,
|
|
63
|
+
class: vue.normalizeClass([vue.unref(ns).e("title"), vue.unref(isBoldTitle)])
|
|
64
|
+
}, [
|
|
65
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
66
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
67
|
+
])
|
|
68
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
69
|
+
_ctx.$slots.default || _ctx.description ? (vue.openBlock(), vue.createElementBlock("p", {
|
|
70
|
+
key: 1,
|
|
71
|
+
class: vue.normalizeClass(vue.unref(ns).e("description"))
|
|
72
|
+
}, [
|
|
73
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
74
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.description), 1)
|
|
75
|
+
])
|
|
76
|
+
], 2)) : vue.createCommentVNode("v-if", true),
|
|
77
|
+
_ctx.closable ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 2 }, [
|
|
78
|
+
_ctx.closeText ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
79
|
+
key: 0,
|
|
80
|
+
class: vue.normalizeClass([vue.unref(ns).e("close-btn"), vue.unref(ns).is("customed")]),
|
|
81
|
+
onClick: close
|
|
82
|
+
}, vue.toDisplayString(_ctx.closeText), 3)) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), {
|
|
83
|
+
key: 1,
|
|
84
|
+
class: vue.normalizeClass(vue.unref(ns).e("close-btn")),
|
|
85
|
+
onClick: close
|
|
86
|
+
}, {
|
|
87
|
+
default: vue.withCtx(() => [
|
|
88
|
+
vue.createVNode(vue.unref(Close))
|
|
89
|
+
]),
|
|
90
|
+
_: 1
|
|
91
|
+
}, 8, ["class"]))
|
|
92
|
+
], 64)) : vue.createCommentVNode("v-if", true)
|
|
93
|
+
], 2)
|
|
94
|
+
], 2), [
|
|
95
|
+
[vue.vShow, visible.value]
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
98
|
+
_: 3
|
|
99
|
+
}, 8, ["name"]);
|
|
100
|
+
};
|
|
39
101
|
}
|
|
40
102
|
});
|
|
41
|
-
|
|
42
|
-
close: (evt) => evt instanceof MouseEvent
|
|
43
|
-
};
|
|
103
|
+
var Alert = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "alert.vue"]]);
|
|
44
104
|
|
|
45
|
-
exports
|
|
46
|
-
exports.alertEmits = alertEmits;
|
|
47
|
-
exports.alertProps = alertProps;
|
|
105
|
+
exports["default"] = Alert;
|
|
48
106
|
//# sourceMappingURL=alert2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert2.js","sources":["../../../../../../packages/components/alert/src/alert.
|
|
1
|
+
{"version":3,"file":"alert2.js","sources":["../../../../../../packages/components/alert/src/alert.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"visible\"\n :class=\"[ns.b(), ns.m(type), ns.is('center', center), ns.is(effect)]\"\n role=\"alert\"\n >\n <el-icon v-if=\"showIcon && iconComponent\" :class=\"iconClass\">\n <component :is=\"iconComponent\" />\n </el-icon>\n\n <div :class=\"ns.e('content')\">\n <span\n v-if=\"title || $slots.title\"\n :class=\"[ns.e('title'), isBoldTitle]\"\n >\n <slot name=\"title\">{{ title }}</slot>\n </span>\n <p v-if=\"$slots.default || description\" :class=\"ns.e('description')\">\n <slot>\n {{ description }}\n </slot>\n </p>\n <template v-if=\"closable\">\n <div\n v-if=\"closeText\"\n :class=\"[ns.e('close-btn'), ns.is('customed')]\"\n @click=\"close\"\n >\n {{ closeText }}\n </div>\n <el-icon v-else :class=\"ns.e('close-btn')\" @click=\"close\">\n <Close />\n </el-icon>\n </template>\n </div>\n </div>\n </transition>\n</template>\n<script lang=\"ts\" setup>\nimport { computed, ref, useSlots } from 'vue'\nimport { ElIcon } from '@element-plus/components/icon'\nimport { TypeComponents, TypeComponentsMap } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { alertEmits, alertProps } from './alert'\n\nconst { Close } = TypeComponents\n\ndefineOptions({\n name: 'ElAlert',\n})\n\nconst props = defineProps(alertProps)\nconst emit = defineEmits(alertEmits)\nconst slots = useSlots()\n\nconst ns = useNamespace('alert')\n\nconst visible = ref(true)\n\nconst iconComponent = computed(() => TypeComponentsMap[props.type])\n\nconst iconClass = computed(() => [\n ns.e('icon'),\n { [ns.is('big')]: !!props.description || !!slots.default },\n])\n\nconst isBoldTitle = computed(() => {\n return { [ns.is('bold')]: props.description || slots.default }\n})\n\nconst close = (evt: MouseEvent) => {\n visible.value = false\n emit('close', evt)\n}\n</script>\n"],"names":["TypeComponents","useSlots","useNamespace","ref","computed","TypeComponentsMap"],"mappings":";;;;;;;;;;;;;uCAgDc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAJA,IAAA,MAAM,EAAE,KAAU,EAAA,GAAAA,mBAAA,CAAA;AAQlB,IAAA,MAAM,QAAQC,YAAS,EAAA,CAAA;AAEvB,IAAM,MAAA,EAAA,GAAKC,mBAAa,OAAO,CAAA,CAAA;AAE/B,IAAM,MAAA,OAAA,GAAUC,QAAI,IAAI,CAAA,CAAA;AAExB,IAAA,MAAM,aAAgB,GAAAC,YAAA,CAAS,MAAMC,sBAAA,CAAkB,MAAM,IAAK,CAAA,CAAA,CAAA;AAElE,IAAM,MAAA,SAAA,GAAYD,aAAS,MAAM;AAAA,MAC/B,EAAA,CAAG,EAAE,MAAM,CAAA;AAAA,MACX,EAAE,CAAC,EAAG,CAAA,EAAA,CAAG,KAAK,CAAA,GAAI,CAAC,CAAC,KAAM,CAAA,WAAA,IAAe,CAAC,CAAC,MAAM,OAAQ,EAAA;AAAA,KAC1D,CAAA,CAAA;AAED,IAAM,MAAA,WAAA,GAAcA,aAAS,MAAM;AACjC,MAAO,OAAA,EAAE,CAAC,EAAG,CAAA,EAAA,CAAG,MAAM,CAAI,GAAA,KAAA,CAAM,WAAe,IAAA,KAAA,CAAM,OAAQ,EAAA,CAAA;AAAA,KAC9D,CAAA,CAAA;AAED,IAAM,MAAA,KAAA,GAAQ,CAAC,GAAoB,KAAA;AACjC,MAAA,OAAA,CAAQ,KAAQ,GAAA,KAAA,CAAA;AAChB,MAAA,IAAA,CAAK,SAAS,GAAG,CAAA,CAAA;AAAA,KACnB,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var avatar$1 = require('./src/
|
|
7
|
-
var avatar = require('./src/
|
|
6
|
+
var avatar$1 = require('./src/avatar.js');
|
|
7
|
+
var avatar = require('./src/avatar2.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAvatar = install.withInstall(avatar$1["default"]);
|