@element-plus/nightly 0.0.20240210 → 0.0.20240211
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 +96 -36
- package/es/components/alert/src/alert.mjs.map +1 -1
- package/es/components/alert/src/alert2.mjs +36 -96
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +4 -4
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox-group.mjs +72 -28
- package/es/components/checkbox/src/checkbox-group.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox-group2.mjs +28 -72
- package/es/components/checkbox/src/checkbox-group2.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox.mjs +50 -117
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +117 -50
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/col/index.mjs +2 -2
- package/es/components/col/src/col.mjs +66 -43
- package/es/components/col/src/col.mjs.map +1 -1
- package/es/components/col/src/col2.mjs +43 -66
- package/es/components/col/src/col2.mjs.map +1 -1
- package/es/components/collapse/index.mjs +2 -2
- package/es/components/collapse/src/collapse-item.mjs +91 -13
- package/es/components/collapse/src/collapse-item.mjs.map +1 -1
- package/es/components/collapse/src/collapse-item2.mjs +13 -91
- package/es/components/collapse/src/collapse-item2.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 +35 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -35
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-button.mjs +1 -1
- package/es/components/radio/src/radio-group.mjs +1 -1
- package/es/components/radio/src/radio.mjs +30 -73
- package/es/components/radio/src/radio.mjs.map +1 -1
- package/es/components/radio/src/radio2.mjs +73 -30
- package/es/components/radio/src/radio2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +1 -1
- package/es/components/tabs/src/tab-bar.mjs +75 -7
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +7 -75
- 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 +95 -37
- package/lib/components/alert/src/alert.js.map +1 -1
- package/lib/components/alert/src/alert2.js +37 -95
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/checkbox/index.js +4 -4
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox-group.js +72 -29
- package/lib/components/checkbox/src/checkbox-group.js.map +1 -1
- package/lib/components/checkbox/src/checkbox-group2.js +29 -72
- package/lib/components/checkbox/src/checkbox-group2.js.map +1 -1
- package/lib/components/checkbox/src/checkbox.js +51 -117
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +117 -51
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/col/index.js +2 -2
- package/lib/components/col/src/col.js +66 -43
- package/lib/components/col/src/col.js.map +1 -1
- package/lib/components/col/src/col2.js +43 -66
- package/lib/components/col/src/col2.js.map +1 -1
- package/lib/components/collapse/index.js +2 -2
- package/lib/components/collapse/src/collapse-item.js +91 -13
- package/lib/components/collapse/src/collapse-item.js.map +1 -1
- package/lib/components/collapse/src/collapse-item2.js +13 -91
- package/lib/components/collapse/src/collapse-item2.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 +35 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -35
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-button.js +1 -1
- package/lib/components/radio/src/radio-group.js +1 -1
- package/lib/components/radio/src/radio.js +32 -73
- package/lib/components/radio/src/radio.js.map +1 -1
- package/lib/components/radio/src/radio2.js +73 -32
- package/lib/components/radio/src/radio2.js.map +1 -1
- package/lib/components/tabs/index.js +1 -1
- package/lib/components/tabs/src/tab-bar.js +75 -7
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +7 -75
- 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
|
@@ -2,40 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
5
|
+
const menuItemGroupProps = {
|
|
6
|
+
title: String
|
|
7
|
+
};
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
const _sfc_main = vue.defineComponent({
|
|
13
|
-
name: COMPONENT_NAME,
|
|
14
|
-
props: menuItemGroup.menuItemGroupProps,
|
|
15
|
-
setup() {
|
|
16
|
-
const ns = index.useNamespace("menu-item-group");
|
|
17
|
-
return {
|
|
18
|
-
ns
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
24
|
-
class: vue.normalizeClass(_ctx.ns.b())
|
|
25
|
-
}, [
|
|
26
|
-
vue.createElementVNode("div", {
|
|
27
|
-
class: vue.normalizeClass(_ctx.ns.e("title"))
|
|
28
|
-
}, [
|
|
29
|
-
!_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
30
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
31
|
-
], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
|
|
32
|
-
], 2),
|
|
33
|
-
vue.createElementVNode("ul", null, [
|
|
34
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
35
|
-
])
|
|
36
|
-
], 2);
|
|
37
|
-
}
|
|
38
|
-
var MenuItemGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "menu-item-group.vue"]]);
|
|
39
|
-
|
|
40
|
-
exports["default"] = MenuItemGroup;
|
|
9
|
+
exports.menuItemGroupProps = menuItemGroupProps;
|
|
41
10
|
//# sourceMappingURL=menu-item-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.
|
|
1
|
+
{"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const menuItemGroupProps = {\n title: String,\n} as const\nexport type MenuItemGroupProps = ExtractPropTypes<typeof menuItemGroupProps>\n"],"names":[],"mappings":";;;;AAAY,MAAC,kBAAkB,GAAG;AAClC,EAAE,KAAK,EAAE,MAAM;AACf;;;;"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var radio$1 = require('./src/
|
|
6
|
+
var radio$1 = require('./src/radio2.js');
|
|
7
7
|
var radioButton$1 = require('./src/radio-button2.js');
|
|
8
8
|
var radioGroup$1 = require('./src/radio-group2.js');
|
|
9
|
-
var radio = require('./src/
|
|
9
|
+
var radio = require('./src/radio.js');
|
|
10
10
|
var radioGroup = require('./src/radio-group.js');
|
|
11
11
|
var radioButton = require('./src/radio-button.js');
|
|
12
12
|
var constants = require('./src/constants.js');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
|
-
var radio = require('./
|
|
6
|
+
var radio = require('./radio.js');
|
|
7
7
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
8
|
|
|
9
9
|
const radioButtonProps = runtime.buildProps({
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
6
|
require('../../../hooks/index.js');
|
|
7
|
-
var radio = require('./
|
|
7
|
+
var radio = require('./radio.js');
|
|
8
8
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
9
|
var index = require('../../../hooks/use-size/index.js');
|
|
10
10
|
|
|
@@ -2,82 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
require('../../../utils/index.js');
|
|
6
|
+
require('../../../constants/index.js');
|
|
6
7
|
require('../../../hooks/index.js');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
8
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
9
|
+
var index = require('../../../hooks/use-size/index.js');
|
|
10
|
+
var event = require('../../../constants/event.js');
|
|
11
|
+
var shared = require('@vue/shared');
|
|
12
|
+
var types = require('../../../utils/types.js');
|
|
11
13
|
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
props: radio.radioProps,
|
|
19
|
-
emits: radio.radioEmits,
|
|
20
|
-
setup(__props, { emit }) {
|
|
21
|
-
const props = __props;
|
|
22
|
-
const ns = index.useNamespace("radio");
|
|
23
|
-
const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio.useRadio(props, emit);
|
|
24
|
-
function handleChange() {
|
|
25
|
-
vue.nextTick(() => emit("change", modelValue.value));
|
|
26
|
-
}
|
|
27
|
-
return (_ctx, _cache) => {
|
|
28
|
-
var _a;
|
|
29
|
-
return vue.openBlock(), vue.createElementBlock("label", {
|
|
30
|
-
class: vue.normalizeClass([
|
|
31
|
-
vue.unref(ns).b(),
|
|
32
|
-
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
33
|
-
vue.unref(ns).is("focus", vue.unref(focus)),
|
|
34
|
-
vue.unref(ns).is("bordered", _ctx.border),
|
|
35
|
-
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
|
|
36
|
-
vue.unref(ns).m(vue.unref(size))
|
|
37
|
-
])
|
|
38
|
-
}, [
|
|
39
|
-
vue.createElementVNode("span", {
|
|
40
|
-
class: vue.normalizeClass([
|
|
41
|
-
vue.unref(ns).e("input"),
|
|
42
|
-
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
43
|
-
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
|
|
44
|
-
])
|
|
45
|
-
}, [
|
|
46
|
-
vue.withDirectives(vue.createElementVNode("input", {
|
|
47
|
-
ref_key: "radioRef",
|
|
48
|
-
ref: radioRef,
|
|
49
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
|
|
50
|
-
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
51
|
-
value: _ctx.label,
|
|
52
|
-
name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
|
|
53
|
-
disabled: vue.unref(disabled),
|
|
54
|
-
type: "radio",
|
|
55
|
-
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
|
|
56
|
-
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
|
|
57
|
-
onChange: handleChange,
|
|
58
|
-
onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
59
|
-
}, ["stop"]))
|
|
60
|
-
}, null, 42, _hoisted_1), [
|
|
61
|
-
[vue.vModelRadio, vue.unref(modelValue)]
|
|
62
|
-
]),
|
|
63
|
-
vue.createElementVNode("span", {
|
|
64
|
-
class: vue.normalizeClass(vue.unref(ns).e("inner"))
|
|
65
|
-
}, null, 2)
|
|
66
|
-
], 2),
|
|
67
|
-
vue.createElementVNode("span", {
|
|
68
|
-
class: vue.normalizeClass(vue.unref(ns).e("label")),
|
|
69
|
-
onKeydown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
70
|
-
}, ["stop"]))
|
|
71
|
-
}, [
|
|
72
|
-
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
73
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
74
|
-
])
|
|
75
|
-
], 34)
|
|
76
|
-
], 2);
|
|
77
|
-
};
|
|
14
|
+
const radioPropsBase = runtime.buildProps({
|
|
15
|
+
size: index.useSizeProp,
|
|
16
|
+
disabled: Boolean,
|
|
17
|
+
label: {
|
|
18
|
+
type: [String, Number, Boolean],
|
|
19
|
+
default: ""
|
|
78
20
|
}
|
|
79
21
|
});
|
|
80
|
-
|
|
22
|
+
const radioProps = runtime.buildProps({
|
|
23
|
+
...radioPropsBase,
|
|
24
|
+
modelValue: {
|
|
25
|
+
type: [String, Number, Boolean],
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
name: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ""
|
|
31
|
+
},
|
|
32
|
+
border: Boolean
|
|
33
|
+
});
|
|
34
|
+
const radioEmits = {
|
|
35
|
+
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val),
|
|
36
|
+
[event.CHANGE_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val)
|
|
37
|
+
};
|
|
81
38
|
|
|
82
|
-
exports
|
|
39
|
+
exports.radioEmits = radioEmits;
|
|
40
|
+
exports.radioProps = radioProps;
|
|
41
|
+
exports.radioPropsBase = radioPropsBase;
|
|
83
42
|
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio.js","sources":["../../../../../../packages/components/radio/src/radio.
|
|
1
|
+
{"version":3,"file":"radio.js","sources":["../../../../../../packages/components/radio/src/radio.ts"],"sourcesContent":["import { buildProps, isBoolean, isNumber, isString } from '@element-plus/utils'\nimport { CHANGE_EVENT, UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport type { ExtractPropTypes } from 'vue'\nimport type Radio from './radio.vue'\n\nexport const radioPropsBase = buildProps({\n /**\n * @description size of the Radio\n */\n size: useSizeProp,\n /**\n * @description whether Radio is disabled\n */\n disabled: Boolean,\n /**\n * @description the value of Radio\n */\n label: {\n type: [String, Number, Boolean],\n default: '',\n },\n})\n\nexport const radioProps = buildProps({\n ...radioPropsBase,\n /**\n * @description binding value\n */\n modelValue: {\n type: [String, Number, Boolean],\n default: '',\n },\n /**\n * @description native `name` attribute\n */\n name: {\n type: String,\n default: '',\n },\n /**\n * @description whether to add a border around Radio\n */\n border: Boolean,\n} as const)\n\nexport const radioEmits = {\n [UPDATE_MODEL_EVENT]: (val: string | number | boolean) =>\n isString(val) || isNumber(val) || isBoolean(val),\n [CHANGE_EVENT]: (val: string | number | boolean) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type RadioProps = ExtractPropTypes<typeof radioProps>\nexport type RadioEmits = typeof radioEmits\nexport type RadioInstance = InstanceType<typeof Radio>\n"],"names":["buildProps","useSizeProp","UPDATE_MODEL_EVENT","isString","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;;;;AAGY,MAAC,cAAc,GAAGA,kBAAU,CAAC;AACzC,EAAE,IAAI,EAAEC,iBAAW;AACnB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAGD,kBAAU,CAAC;AACrC,EAAE,GAAG,cAAc;AACnB,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,CAACE,wBAAkB,GAAG,CAAC,GAAG,KAAKC,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AACjF,EAAE,CAACC,kBAAY,GAAG,CAAC,GAAG,KAAKH,eAAQ,CAAC,GAAG,CAAC,IAAIC,cAAQ,CAAC,GAAG,CAAC,IAAIC,eAAS,CAAC,GAAG,CAAC;AAC3E;;;;;;"}
|
|
@@ -2,41 +2,82 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
require('
|
|
6
|
-
require('../../../constants/index.js');
|
|
5
|
+
var vue = require('vue');
|
|
7
6
|
require('../../../hooks/index.js');
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var types = require('../../../utils/types.js');
|
|
7
|
+
var radio = require('./radio.js');
|
|
8
|
+
var useRadio = require('./use-radio.js');
|
|
9
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
13
11
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
label: {
|
|
18
|
-
type: [String, Number, Boolean],
|
|
19
|
-
default: ""
|
|
20
|
-
}
|
|
12
|
+
const _hoisted_1 = ["value", "name", "disabled"];
|
|
13
|
+
const __default__ = vue.defineComponent({
|
|
14
|
+
name: "ElRadio"
|
|
21
15
|
});
|
|
22
|
-
const
|
|
23
|
-
...
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
16
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
17
|
+
...__default__,
|
|
18
|
+
props: radio.radioProps,
|
|
19
|
+
emits: radio.radioEmits,
|
|
20
|
+
setup(__props, { emit }) {
|
|
21
|
+
const props = __props;
|
|
22
|
+
const ns = index.useNamespace("radio");
|
|
23
|
+
const { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio.useRadio(props, emit);
|
|
24
|
+
function handleChange() {
|
|
25
|
+
vue.nextTick(() => emit("change", modelValue.value));
|
|
26
|
+
}
|
|
27
|
+
return (_ctx, _cache) => {
|
|
28
|
+
var _a;
|
|
29
|
+
return vue.openBlock(), vue.createElementBlock("label", {
|
|
30
|
+
class: vue.normalizeClass([
|
|
31
|
+
vue.unref(ns).b(),
|
|
32
|
+
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
33
|
+
vue.unref(ns).is("focus", vue.unref(focus)),
|
|
34
|
+
vue.unref(ns).is("bordered", _ctx.border),
|
|
35
|
+
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label),
|
|
36
|
+
vue.unref(ns).m(vue.unref(size))
|
|
37
|
+
])
|
|
38
|
+
}, [
|
|
39
|
+
vue.createElementVNode("span", {
|
|
40
|
+
class: vue.normalizeClass([
|
|
41
|
+
vue.unref(ns).e("input"),
|
|
42
|
+
vue.unref(ns).is("disabled", vue.unref(disabled)),
|
|
43
|
+
vue.unref(ns).is("checked", vue.unref(modelValue) === _ctx.label)
|
|
44
|
+
])
|
|
45
|
+
}, [
|
|
46
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
47
|
+
ref_key: "radioRef",
|
|
48
|
+
ref: radioRef,
|
|
49
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(modelValue) ? modelValue.value = $event : null),
|
|
50
|
+
class: vue.normalizeClass(vue.unref(ns).e("original")),
|
|
51
|
+
value: _ctx.label,
|
|
52
|
+
name: _ctx.name || ((_a = vue.unref(radioGroup)) == null ? void 0 : _a.name),
|
|
53
|
+
disabled: vue.unref(disabled),
|
|
54
|
+
type: "radio",
|
|
55
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => focus.value = true),
|
|
56
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => focus.value = false),
|
|
57
|
+
onChange: handleChange,
|
|
58
|
+
onClick: _cache[3] || (_cache[3] = vue.withModifiers(() => {
|
|
59
|
+
}, ["stop"]))
|
|
60
|
+
}, null, 42, _hoisted_1), [
|
|
61
|
+
[vue.vModelRadio, vue.unref(modelValue)]
|
|
62
|
+
]),
|
|
63
|
+
vue.createElementVNode("span", {
|
|
64
|
+
class: vue.normalizeClass(vue.unref(ns).e("inner"))
|
|
65
|
+
}, null, 2)
|
|
66
|
+
], 2),
|
|
67
|
+
vue.createElementVNode("span", {
|
|
68
|
+
class: vue.normalizeClass(vue.unref(ns).e("label")),
|
|
69
|
+
onKeydown: _cache[4] || (_cache[4] = vue.withModifiers(() => {
|
|
70
|
+
}, ["stop"]))
|
|
71
|
+
}, [
|
|
72
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
73
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.label), 1)
|
|
74
|
+
])
|
|
75
|
+
], 34)
|
|
76
|
+
], 2);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
33
79
|
});
|
|
34
|
-
|
|
35
|
-
[event.UPDATE_MODEL_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val),
|
|
36
|
-
[event.CHANGE_EVENT]: (val) => shared.isString(val) || types.isNumber(val) || types.isBoolean(val)
|
|
37
|
-
};
|
|
80
|
+
var Radio = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "radio.vue"]]);
|
|
38
81
|
|
|
39
|
-
exports
|
|
40
|
-
exports.radioProps = radioProps;
|
|
41
|
-
exports.radioPropsBase = radioPropsBase;
|
|
82
|
+
exports["default"] = Radio;
|
|
42
83
|
//# sourceMappingURL=radio2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio2.js","sources":["../../../../../../packages/components/radio/src/radio.
|
|
1
|
+
{"version":3,"file":"radio2.js","sources":["../../../../../../packages/components/radio/src/radio.vue"],"sourcesContent":["<template>\n <label\n :class=\"[\n ns.b(),\n ns.is('disabled', disabled),\n ns.is('focus', focus),\n ns.is('bordered', border),\n ns.is('checked', modelValue === label),\n ns.m(size),\n ]\"\n >\n <span\n :class=\"[\n ns.e('input'),\n ns.is('disabled', disabled),\n ns.is('checked', modelValue === label),\n ]\"\n >\n <input\n ref=\"radioRef\"\n v-model=\"modelValue\"\n :class=\"ns.e('original')\"\n :value=\"label\"\n :name=\"name || radioGroup?.name\"\n :disabled=\"disabled\"\n type=\"radio\"\n @focus=\"focus = true\"\n @blur=\"focus = false\"\n @change=\"handleChange\"\n @click.stop\n />\n <span :class=\"ns.e('inner')\" />\n </span>\n <span :class=\"ns.e('label')\" @keydown.stop>\n <slot>\n {{ label }}\n </slot>\n </span>\n </label>\n</template>\n\n<script lang=\"ts\" setup>\nimport { nextTick } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { radioEmits, radioProps } from './radio'\nimport { useRadio } from './use-radio'\n\ndefineOptions({\n name: 'ElRadio',\n})\n\nconst props = defineProps(radioProps)\nconst emit = defineEmits(radioEmits)\n\nconst ns = useNamespace('radio')\nconst { radioRef, radioGroup, focus, size, disabled, modelValue } = useRadio(\n props,\n emit\n)\n\nfunction handleChange() {\n nextTick(() => emit('change', modelValue.value))\n}\n</script>\n"],"names":["useNamespace","useRadio","nextTick"],"mappings":";;;;;;;;;;;;uCA+Cc,CAAA;AAAA,EACZ,IAAM,EAAA,SAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAKA,mBAAa,OAAO,CAAA,CAAA;AAC/B,IAAM,MAAA,EAAE,UAAU,UAAY,EAAA,KAAA,EAAO,MAAM,QAAU,EAAA,UAAA,EAAA,GAAeC,iBAClE,CAAA,KAAA,EACA,IACF,CAAA,CAAA;AAEA,IAAwB,SAAA,YAAA,GAAA;AACtB,MAAAC,YAAA,CAAS,MAAM,IAAA,CAAK,QAAU,EAAA,UAAA,CAAW,KAAK,CAAC,CAAA,CAAA;AAAA,KACjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var tabs = require('./src/tabs.js');
|
|
7
7
|
var tabPane$1 = require('./src/tab-pane2.js');
|
|
8
|
-
var tabBar = require('./src/tab-
|
|
8
|
+
var tabBar = require('./src/tab-bar2.js');
|
|
9
9
|
var tabNav = require('./src/tab-nav.js');
|
|
10
10
|
var tabPane = require('./src/tab-pane.js');
|
|
11
11
|
var constants = require('./src/constants.js');
|
|
@@ -2,16 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
5
7
|
require('../../../utils/index.js');
|
|
6
|
-
|
|
7
|
-
var
|
|
8
|
+
require('../../../hooks/index.js');
|
|
9
|
+
var constants = require('./constants.js');
|
|
10
|
+
var tabBar = require('./tab-bar2.js');
|
|
11
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
+
var error = require('../../../utils/error.js');
|
|
13
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
+
var strings = require('../../../utils/strings.js');
|
|
8
15
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
16
|
+
const COMPONENT_NAME = "ElTabBar";
|
|
17
|
+
const __default__ = vue.defineComponent({
|
|
18
|
+
name: COMPONENT_NAME
|
|
19
|
+
});
|
|
20
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
+
...__default__,
|
|
22
|
+
props: tabBar.tabBarProps,
|
|
23
|
+
setup(__props, { expose }) {
|
|
24
|
+
const props = __props;
|
|
25
|
+
const instance = vue.getCurrentInstance();
|
|
26
|
+
const rootTabs = vue.inject(constants.tabsRootContextKey);
|
|
27
|
+
if (!rootTabs)
|
|
28
|
+
error.throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
|
|
29
|
+
const ns = index.useNamespace("tabs");
|
|
30
|
+
const barRef = vue.ref();
|
|
31
|
+
const barStyle = vue.ref();
|
|
32
|
+
const getBarStyle = () => {
|
|
33
|
+
let offset = 0;
|
|
34
|
+
let tabSize = 0;
|
|
35
|
+
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
|
|
36
|
+
const sizeDir = sizeName === "width" ? "x" : "y";
|
|
37
|
+
const position = sizeDir === "x" ? "left" : "top";
|
|
38
|
+
props.tabs.every((tab) => {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
|
|
41
|
+
if (!$el)
|
|
42
|
+
return false;
|
|
43
|
+
if (!tab.active) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
offset = $el[`offset${strings.capitalize(position)}`];
|
|
47
|
+
tabSize = $el[`client${strings.capitalize(sizeName)}`];
|
|
48
|
+
const tabStyles = window.getComputedStyle($el);
|
|
49
|
+
if (sizeName === "width") {
|
|
50
|
+
if (props.tabs.length > 1) {
|
|
51
|
+
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
|
52
|
+
}
|
|
53
|
+
offset += Number.parseFloat(tabStyles.paddingLeft);
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
});
|
|
57
|
+
return {
|
|
58
|
+
[sizeName]: `${tabSize}px`,
|
|
59
|
+
transform: `translate${strings.capitalize(sizeDir)}(${offset}px)`
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
const update = () => barStyle.value = getBarStyle();
|
|
63
|
+
vue.watch(() => props.tabs, async () => {
|
|
64
|
+
await vue.nextTick();
|
|
65
|
+
update();
|
|
66
|
+
}, { immediate: true });
|
|
67
|
+
core.useResizeObserver(barRef, () => update());
|
|
68
|
+
expose({
|
|
69
|
+
ref: barRef,
|
|
70
|
+
update
|
|
71
|
+
});
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
74
|
+
ref_key: "barRef",
|
|
75
|
+
ref: barRef,
|
|
76
|
+
class: vue.normalizeClass([vue.unref(ns).e("active-bar"), vue.unref(ns).is(vue.unref(rootTabs).props.tabPosition)]),
|
|
77
|
+
style: vue.normalizeStyle(barStyle.value)
|
|
78
|
+
}, null, 6);
|
|
79
|
+
};
|
|
13
80
|
}
|
|
14
81
|
});
|
|
82
|
+
var TabBar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "tab-bar.vue"]]);
|
|
15
83
|
|
|
16
|
-
exports
|
|
84
|
+
exports["default"] = TabBar;
|
|
17
85
|
//# sourceMappingURL=tab-bar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar.js","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":["getCurrentInstance","inject","tabsRootContextKey","throwError","useNamespace","ref","capitalize","watch","nextTick","useResizeObserver"],"mappings":"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"}
|
|
@@ -2,84 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var core = require('@vueuse/core');
|
|
7
5
|
require('../../../utils/index.js');
|
|
8
|
-
require('../../../
|
|
9
|
-
var
|
|
10
|
-
var tabBar = require('./tab-bar.js');
|
|
11
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var error = require('../../../utils/error.js');
|
|
13
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
14
|
-
var strings = require('../../../utils/strings.js');
|
|
6
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
7
|
+
var typescript = require('../../../utils/typescript.js');
|
|
15
8
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
21
|
-
...__default__,
|
|
22
|
-
props: tabBar.tabBarProps,
|
|
23
|
-
setup(__props, { expose }) {
|
|
24
|
-
const props = __props;
|
|
25
|
-
const instance = vue.getCurrentInstance();
|
|
26
|
-
const rootTabs = vue.inject(constants.tabsRootContextKey);
|
|
27
|
-
if (!rootTabs)
|
|
28
|
-
error.throwError(COMPONENT_NAME, "<el-tabs><el-tab-bar /></el-tabs>");
|
|
29
|
-
const ns = index.useNamespace("tabs");
|
|
30
|
-
const barRef = vue.ref();
|
|
31
|
-
const barStyle = vue.ref();
|
|
32
|
-
const getBarStyle = () => {
|
|
33
|
-
let offset = 0;
|
|
34
|
-
let tabSize = 0;
|
|
35
|
-
const sizeName = ["top", "bottom"].includes(rootTabs.props.tabPosition) ? "width" : "height";
|
|
36
|
-
const sizeDir = sizeName === "width" ? "x" : "y";
|
|
37
|
-
const position = sizeDir === "x" ? "left" : "top";
|
|
38
|
-
props.tabs.every((tab) => {
|
|
39
|
-
var _a, _b;
|
|
40
|
-
const $el = (_b = (_a = instance.parent) == null ? void 0 : _a.refs) == null ? void 0 : _b[`tab-${tab.uid}`];
|
|
41
|
-
if (!$el)
|
|
42
|
-
return false;
|
|
43
|
-
if (!tab.active) {
|
|
44
|
-
return true;
|
|
45
|
-
}
|
|
46
|
-
offset = $el[`offset${strings.capitalize(position)}`];
|
|
47
|
-
tabSize = $el[`client${strings.capitalize(sizeName)}`];
|
|
48
|
-
const tabStyles = window.getComputedStyle($el);
|
|
49
|
-
if (sizeName === "width") {
|
|
50
|
-
if (props.tabs.length > 1) {
|
|
51
|
-
tabSize -= Number.parseFloat(tabStyles.paddingLeft) + Number.parseFloat(tabStyles.paddingRight);
|
|
52
|
-
}
|
|
53
|
-
offset += Number.parseFloat(tabStyles.paddingLeft);
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
});
|
|
57
|
-
return {
|
|
58
|
-
[sizeName]: `${tabSize}px`,
|
|
59
|
-
transform: `translate${strings.capitalize(sizeDir)}(${offset}px)`
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
const update = () => barStyle.value = getBarStyle();
|
|
63
|
-
vue.watch(() => props.tabs, async () => {
|
|
64
|
-
await vue.nextTick();
|
|
65
|
-
update();
|
|
66
|
-
}, { immediate: true });
|
|
67
|
-
core.useResizeObserver(barRef, () => update());
|
|
68
|
-
expose({
|
|
69
|
-
ref: barRef,
|
|
70
|
-
update
|
|
71
|
-
});
|
|
72
|
-
return (_ctx, _cache) => {
|
|
73
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
74
|
-
ref_key: "barRef",
|
|
75
|
-
ref: barRef,
|
|
76
|
-
class: vue.normalizeClass([vue.unref(ns).e("active-bar"), vue.unref(ns).is(vue.unref(rootTabs).props.tabPosition)]),
|
|
77
|
-
style: vue.normalizeStyle(barStyle.value)
|
|
78
|
-
}, null, 6);
|
|
79
|
-
};
|
|
9
|
+
const tabBarProps = runtime.buildProps({
|
|
10
|
+
tabs: {
|
|
11
|
+
type: runtime.definePropType(Array),
|
|
12
|
+
default: () => typescript.mutable([])
|
|
80
13
|
}
|
|
81
14
|
});
|
|
82
|
-
var TabBar = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "tab-bar.vue"]]);
|
|
83
15
|
|
|
84
|
-
exports
|
|
16
|
+
exports.tabBarProps = tabBarProps;
|
|
85
17
|
//# sourceMappingURL=tab-bar2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-bar2.js","sources":["../../../../../../packages/components/tabs/src/tab-bar.
|
|
1
|
+
{"version":3,"file":"tab-bar2.js","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":["buildProps","definePropType","mutable"],"mappings":";;;;;;;;AACY,MAAC,WAAW,GAAGA,kBAAU,CAAC;AACtC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAMC,kBAAO,CAAC,EAAE,CAAC;AAC9B,GAAG;AACH,CAAC;;;;"}
|
|
@@ -9,7 +9,7 @@ require('../../../constants/index.js');
|
|
|
9
9
|
var index$1 = require('../../icon/index.js');
|
|
10
10
|
var iconsVue = require('@element-plus/icons-vue');
|
|
11
11
|
require('../../../hooks/index.js');
|
|
12
|
-
var tabBar = require('./tab-
|
|
12
|
+
var tabBar = require('./tab-bar.js');
|
|
13
13
|
var constants = require('./constants.js');
|
|
14
14
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
15
15
|
var typescript = require('../../../utils/typescript.js');
|