@element-plus/nightly 0.0.20240222 → 0.0.20240225
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.css +1 -1
- package/dist/index.full.js +6 -6
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +3 -3
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +6 -6
- 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.d.ts +2 -2
- package/es/components/alert/src/alert.vue.d.ts +2 -2
- package/es/components/alert/src/alert2.mjs +3 -3
- package/es/components/alert/src/alert2.mjs.map +1 -1
- package/es/components/checkbox/index.mjs +2 -2
- package/es/components/checkbox/src/checkbox-button.mjs +1 -1
- package/es/components/checkbox/src/checkbox.mjs +117 -50
- package/es/components/checkbox/src/checkbox.mjs.map +1 -1
- package/es/components/checkbox/src/checkbox2.mjs +50 -117
- package/es/components/checkbox/src/checkbox2.mjs.map +1 -1
- package/es/components/index.mjs +1 -1
- package/es/components/message/src/instance.mjs +1 -1
- package/es/components/message/src/instance.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +93 -21
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +21 -93
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/index.mjs +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/alert/index.d.ts +2 -2
- package/lib/components/alert/src/alert.vue.d.ts +2 -2
- package/lib/components/alert/src/alert2.js +3 -3
- package/lib/components/alert/src/alert2.js.map +1 -1
- package/lib/components/checkbox/index.js +2 -2
- package/lib/components/checkbox/src/checkbox-button.js +1 -1
- package/lib/components/checkbox/src/checkbox.js +117 -51
- package/lib/components/checkbox/src/checkbox.js.map +1 -1
- package/lib/components/checkbox/src/checkbox2.js +51 -117
- package/lib/components/checkbox/src/checkbox2.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/message/src/instance.js +1 -1
- package/lib/components/message/src/instance.js.map +1 -1
- package/lib/components/slider/src/button.js +93 -22
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +22 -93
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/index.js +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-alert.css +1 -1
- package/theme-chalk/el-message.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/alert.scss +13 -9
- package/theme-chalk/src/common/var.scss +6 -5
- package/theme-chalk/src/message.scss +1 -14
- package/web-types.json +1 -1
|
@@ -2,7 +2,7 @@ import { defineComponent, useSlots, inject, computed, openBlock, createElementBl
|
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import { checkboxGroupContextKey } from './constants.mjs';
|
|
4
4
|
import './composables/index.mjs';
|
|
5
|
-
import { checkboxProps, checkboxEmits } from './
|
|
5
|
+
import { checkboxProps, checkboxEmits } from './checkbox2.mjs';
|
|
6
6
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
7
|
import { useCheckbox } from './composables/use-checkbox.mjs';
|
|
8
8
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
@@ -1,55 +1,122 @@
|
|
|
1
|
-
import '
|
|
1
|
+
import { defineComponent, useSlots, computed, openBlock, createBlock, resolveDynamicComponent, unref, normalizeClass, withCtx, createElementVNode, withDirectives, createElementBlock, isRef, withModifiers, vModelCheckbox, renderSlot, Fragment, createTextVNode, toDisplayString, createCommentVNode } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import '
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { checkboxProps, checkboxEmits } from './checkbox2.mjs';
|
|
4
|
+
import './composables/index.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useCheckbox } from './composables/use-checkbox.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
9
|
+
const _hoisted_1 = ["id", "indeterminate", "name", "tabindex", "disabled", "true-value", "false-value"];
|
|
10
|
+
const _hoisted_2 = ["id", "indeterminate", "disabled", "value", "name", "tabindex"];
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElCheckbox"
|
|
13
|
+
});
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: checkboxProps,
|
|
17
|
+
emits: checkboxEmits,
|
|
18
|
+
setup(__props) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const slots = useSlots();
|
|
21
|
+
const {
|
|
22
|
+
inputId,
|
|
23
|
+
isLabeledByFormItem,
|
|
24
|
+
isChecked,
|
|
25
|
+
isDisabled,
|
|
26
|
+
isFocused,
|
|
27
|
+
checkboxSize,
|
|
28
|
+
hasOwnLabel,
|
|
29
|
+
model,
|
|
30
|
+
handleChange,
|
|
31
|
+
onClickRoot
|
|
32
|
+
} = useCheckbox(props, slots);
|
|
33
|
+
const ns = useNamespace("checkbox");
|
|
34
|
+
const compKls = computed(() => {
|
|
35
|
+
return [
|
|
36
|
+
ns.b(),
|
|
37
|
+
ns.m(checkboxSize.value),
|
|
38
|
+
ns.is("disabled", isDisabled.value),
|
|
39
|
+
ns.is("bordered", props.border),
|
|
40
|
+
ns.is("checked", isChecked.value)
|
|
41
|
+
];
|
|
42
|
+
});
|
|
43
|
+
const spanKls = computed(() => {
|
|
44
|
+
return [
|
|
45
|
+
ns.e("input"),
|
|
46
|
+
ns.is("disabled", isDisabled.value),
|
|
47
|
+
ns.is("checked", isChecked.value),
|
|
48
|
+
ns.is("indeterminate", props.indeterminate),
|
|
49
|
+
ns.is("focus", isFocused.value)
|
|
50
|
+
];
|
|
51
|
+
});
|
|
52
|
+
return (_ctx, _cache) => {
|
|
53
|
+
return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
|
|
54
|
+
class: normalizeClass(unref(compKls)),
|
|
55
|
+
"aria-controls": _ctx.indeterminate ? _ctx.controls : null,
|
|
56
|
+
onClick: unref(onClickRoot)
|
|
57
|
+
}, {
|
|
58
|
+
default: withCtx(() => [
|
|
59
|
+
createElementVNode("span", {
|
|
60
|
+
class: normalizeClass(unref(spanKls))
|
|
61
|
+
}, [
|
|
62
|
+
_ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
|
|
63
|
+
key: 0,
|
|
64
|
+
id: unref(inputId),
|
|
65
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
66
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
67
|
+
type: "checkbox",
|
|
68
|
+
indeterminate: _ctx.indeterminate,
|
|
69
|
+
name: _ctx.name,
|
|
70
|
+
tabindex: _ctx.tabindex,
|
|
71
|
+
disabled: unref(isDisabled),
|
|
72
|
+
"true-value": _ctx.trueLabel,
|
|
73
|
+
"false-value": _ctx.falseLabel,
|
|
74
|
+
onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
|
|
75
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
|
|
76
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
|
|
77
|
+
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
78
|
+
}, ["stop"]))
|
|
79
|
+
}, null, 42, _hoisted_1)), [
|
|
80
|
+
[vModelCheckbox, unref(model)]
|
|
81
|
+
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
82
|
+
key: 1,
|
|
83
|
+
id: unref(inputId),
|
|
84
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(model) ? model.value = $event : null),
|
|
85
|
+
class: normalizeClass(unref(ns).e("original")),
|
|
86
|
+
type: "checkbox",
|
|
87
|
+
indeterminate: _ctx.indeterminate,
|
|
88
|
+
disabled: unref(isDisabled),
|
|
89
|
+
value: _ctx.label,
|
|
90
|
+
name: _ctx.name,
|
|
91
|
+
tabindex: _ctx.tabindex,
|
|
92
|
+
onChange: _cache[6] || (_cache[6] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
|
|
93
|
+
onFocus: _cache[7] || (_cache[7] = ($event) => isFocused.value = true),
|
|
94
|
+
onBlur: _cache[8] || (_cache[8] = ($event) => isFocused.value = false),
|
|
95
|
+
onClick: _cache[9] || (_cache[9] = withModifiers(() => {
|
|
96
|
+
}, ["stop"]))
|
|
97
|
+
}, null, 42, _hoisted_2)), [
|
|
98
|
+
[vModelCheckbox, unref(model)]
|
|
99
|
+
]),
|
|
100
|
+
createElementVNode("span", {
|
|
101
|
+
class: normalizeClass(unref(ns).e("inner"))
|
|
102
|
+
}, null, 2)
|
|
103
|
+
], 2),
|
|
104
|
+
unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
|
|
105
|
+
key: 0,
|
|
106
|
+
class: normalizeClass(unref(ns).e("label"))
|
|
107
|
+
}, [
|
|
108
|
+
renderSlot(_ctx.$slots, "default"),
|
|
109
|
+
!_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
110
|
+
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
111
|
+
], 64)) : createCommentVNode("v-if", true)
|
|
112
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
113
|
+
]),
|
|
114
|
+
_: 3
|
|
115
|
+
}, 8, ["class", "aria-controls", "onClick"]);
|
|
116
|
+
};
|
|
47
117
|
}
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
51
|
-
change: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
52
|
-
};
|
|
118
|
+
});
|
|
119
|
+
var Checkbox = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "checkbox.vue"]]);
|
|
53
120
|
|
|
54
|
-
export {
|
|
121
|
+
export { Checkbox as default };
|
|
55
122
|
//# sourceMappingURL=checkbox.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.
|
|
1
|
+
{"version":3,"file":"checkbox.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.vue"],"sourcesContent":["<template>\n <component\n :is=\"!hasOwnLabel && isLabeledByFormItem ? 'span' : 'label'\"\n :class=\"compKls\"\n :aria-controls=\"indeterminate ? controls : null\"\n @click=\"onClickRoot\"\n >\n <span :class=\"spanKls\">\n <input\n v-if=\"trueLabel || falseLabel\"\n :id=\"inputId\"\n v-model=\"model\"\n :class=\"ns.e('original')\"\n type=\"checkbox\"\n :indeterminate=\"indeterminate\"\n :name=\"name\"\n :tabindex=\"tabindex\"\n :disabled=\"isDisabled\"\n :true-value=\"trueLabel\"\n :false-value=\"falseLabel\"\n @change=\"handleChange\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n @click.stop\n />\n <input\n v-else\n :id=\"inputId\"\n v-model=\"model\"\n :class=\"ns.e('original')\"\n type=\"checkbox\"\n :indeterminate=\"indeterminate\"\n :disabled=\"isDisabled\"\n :value=\"label\"\n :name=\"name\"\n :tabindex=\"tabindex\"\n @change=\"handleChange\"\n @focus=\"isFocused = true\"\n @blur=\"isFocused = false\"\n @click.stop\n />\n <span :class=\"ns.e('inner')\" />\n </span>\n <span v-if=\"hasOwnLabel\" :class=\"ns.e('label')\">\n <slot />\n <template v-if=\"!$slots.default\">{{ label }}</template>\n </span>\n </component>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, useSlots } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { checkboxEmits, checkboxProps } from './checkbox'\nimport { useCheckbox } from './composables'\n\ndefineOptions({\n name: 'ElCheckbox',\n})\n\nconst props = defineProps(checkboxProps)\ndefineEmits(checkboxEmits)\nconst slots = useSlots()\n\nconst {\n inputId,\n isLabeledByFormItem,\n isChecked,\n isDisabled,\n isFocused,\n checkboxSize,\n hasOwnLabel,\n model,\n handleChange,\n onClickRoot,\n} = useCheckbox(props, slots)\n\nconst ns = useNamespace('checkbox')\n\nconst compKls = computed(() => {\n return [\n ns.b(),\n ns.m(checkboxSize.value),\n ns.is('disabled', isDisabled.value),\n ns.is('bordered', props.border),\n ns.is('checked', isChecked.value),\n ]\n})\n\nconst spanKls = computed(() => {\n return [\n ns.e('input'),\n ns.is('disabled', isDisabled.value),\n ns.is('checked', isChecked.value),\n ns.is('indeterminate', props.indeterminate),\n ns.is('focus', isFocused.value),\n ]\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCAwDc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAIA,IAAA,MAAM,QAAQ,QAAS,EAAA,CAAA;AAEvB,IAAM,MAAA;AAAA,MACJ,OAAA;AAAA,MACA,mBAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,MACA,KAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,WAAA,CAAY,OAAO,KAAK,CAAA,CAAA;AAE5B,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAElC,IAAM,MAAA,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QACL,EAAA,CAAG,CAAE,CAAA,YAAA,CAAa,KAAK,CAAA;AAAA,QACvB,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,QAClC,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,KAAA,CAAM,MAAM,CAAA;AAAA,QAC9B,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,OAClC,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,OAAA,GAAU,SAAS,MAAM;AAC7B,MAAO,OAAA;AAAA,QACL,EAAA,CAAG,EAAE,OAAO,CAAA;AAAA,QACZ,EAAG,CAAA,EAAA,CAAG,UAAY,EAAA,UAAA,CAAW,KAAK,CAAA;AAAA,QAClC,EAAG,CAAA,EAAA,CAAG,SAAW,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,QAChC,EAAG,CAAA,EAAA,CAAG,eAAiB,EAAA,KAAA,CAAM,aAAa,CAAA;AAAA,QAC1C,EAAG,CAAA,EAAA,CAAG,OAAS,EAAA,SAAA,CAAU,KAAK,CAAA;AAAA,OAChC,CAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,122 +1,55 @@
|
|
|
1
|
-
import
|
|
1
|
+
import '../../../constants/index.mjs';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import '../../../utils/index.mjs';
|
|
4
|
+
import { useSizeProp } from '../../../hooks/use-size/index.mjs';
|
|
5
|
+
import { UPDATE_MODEL_EVENT } from '../../../constants/event.mjs';
|
|
6
|
+
import { isString } from '@vue/shared';
|
|
7
|
+
import { isNumber, isBoolean } from '../../../utils/types.mjs';
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
ns.is("checked", isChecked.value),
|
|
48
|
-
ns.is("indeterminate", props.indeterminate),
|
|
49
|
-
ns.is("focus", isFocused.value)
|
|
50
|
-
];
|
|
51
|
-
});
|
|
52
|
-
return (_ctx, _cache) => {
|
|
53
|
-
return openBlock(), createBlock(resolveDynamicComponent(!unref(hasOwnLabel) && unref(isLabeledByFormItem) ? "span" : "label"), {
|
|
54
|
-
class: normalizeClass(unref(compKls)),
|
|
55
|
-
"aria-controls": _ctx.indeterminate ? _ctx.controls : null,
|
|
56
|
-
onClick: unref(onClickRoot)
|
|
57
|
-
}, {
|
|
58
|
-
default: withCtx(() => [
|
|
59
|
-
createElementVNode("span", {
|
|
60
|
-
class: normalizeClass(unref(spanKls))
|
|
61
|
-
}, [
|
|
62
|
-
_ctx.trueLabel || _ctx.falseLabel ? withDirectives((openBlock(), createElementBlock("input", {
|
|
63
|
-
key: 0,
|
|
64
|
-
id: unref(inputId),
|
|
65
|
-
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => isRef(model) ? model.value = $event : null),
|
|
66
|
-
class: normalizeClass(unref(ns).e("original")),
|
|
67
|
-
type: "checkbox",
|
|
68
|
-
indeterminate: _ctx.indeterminate,
|
|
69
|
-
name: _ctx.name,
|
|
70
|
-
tabindex: _ctx.tabindex,
|
|
71
|
-
disabled: unref(isDisabled),
|
|
72
|
-
"true-value": _ctx.trueLabel,
|
|
73
|
-
"false-value": _ctx.falseLabel,
|
|
74
|
-
onChange: _cache[1] || (_cache[1] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
|
|
75
|
-
onFocus: _cache[2] || (_cache[2] = ($event) => isFocused.value = true),
|
|
76
|
-
onBlur: _cache[3] || (_cache[3] = ($event) => isFocused.value = false),
|
|
77
|
-
onClick: _cache[4] || (_cache[4] = withModifiers(() => {
|
|
78
|
-
}, ["stop"]))
|
|
79
|
-
}, null, 42, _hoisted_1)), [
|
|
80
|
-
[vModelCheckbox, unref(model)]
|
|
81
|
-
]) : withDirectives((openBlock(), createElementBlock("input", {
|
|
82
|
-
key: 1,
|
|
83
|
-
id: unref(inputId),
|
|
84
|
-
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => isRef(model) ? model.value = $event : null),
|
|
85
|
-
class: normalizeClass(unref(ns).e("original")),
|
|
86
|
-
type: "checkbox",
|
|
87
|
-
indeterminate: _ctx.indeterminate,
|
|
88
|
-
disabled: unref(isDisabled),
|
|
89
|
-
value: _ctx.label,
|
|
90
|
-
name: _ctx.name,
|
|
91
|
-
tabindex: _ctx.tabindex,
|
|
92
|
-
onChange: _cache[6] || (_cache[6] = (...args) => unref(handleChange) && unref(handleChange)(...args)),
|
|
93
|
-
onFocus: _cache[7] || (_cache[7] = ($event) => isFocused.value = true),
|
|
94
|
-
onBlur: _cache[8] || (_cache[8] = ($event) => isFocused.value = false),
|
|
95
|
-
onClick: _cache[9] || (_cache[9] = withModifiers(() => {
|
|
96
|
-
}, ["stop"]))
|
|
97
|
-
}, null, 42, _hoisted_2)), [
|
|
98
|
-
[vModelCheckbox, unref(model)]
|
|
99
|
-
]),
|
|
100
|
-
createElementVNode("span", {
|
|
101
|
-
class: normalizeClass(unref(ns).e("inner"))
|
|
102
|
-
}, null, 2)
|
|
103
|
-
], 2),
|
|
104
|
-
unref(hasOwnLabel) ? (openBlock(), createElementBlock("span", {
|
|
105
|
-
key: 0,
|
|
106
|
-
class: normalizeClass(unref(ns).e("label"))
|
|
107
|
-
}, [
|
|
108
|
-
renderSlot(_ctx.$slots, "default"),
|
|
109
|
-
!_ctx.$slots.default ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
110
|
-
createTextVNode(toDisplayString(_ctx.label), 1)
|
|
111
|
-
], 64)) : createCommentVNode("v-if", true)
|
|
112
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
113
|
-
]),
|
|
114
|
-
_: 3
|
|
115
|
-
}, 8, ["class", "aria-controls", "onClick"]);
|
|
116
|
-
};
|
|
9
|
+
const checkboxProps = {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [Number, String, Boolean],
|
|
12
|
+
default: void 0
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: [String, Boolean, Number, Object],
|
|
16
|
+
default: void 0
|
|
17
|
+
},
|
|
18
|
+
indeterminate: Boolean,
|
|
19
|
+
disabled: Boolean,
|
|
20
|
+
checked: Boolean,
|
|
21
|
+
name: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: void 0
|
|
24
|
+
},
|
|
25
|
+
trueLabel: {
|
|
26
|
+
type: [String, Number],
|
|
27
|
+
default: void 0
|
|
28
|
+
},
|
|
29
|
+
falseLabel: {
|
|
30
|
+
type: [String, Number],
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
id: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: void 0
|
|
36
|
+
},
|
|
37
|
+
controls: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: void 0
|
|
40
|
+
},
|
|
41
|
+
border: Boolean,
|
|
42
|
+
size: useSizeProp,
|
|
43
|
+
tabindex: [String, Number],
|
|
44
|
+
validateEvent: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: true
|
|
117
47
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
48
|
+
};
|
|
49
|
+
const checkboxEmits = {
|
|
50
|
+
[UPDATE_MODEL_EVENT]: (val) => isString(val) || isNumber(val) || isBoolean(val),
|
|
51
|
+
change: (val) => isString(val) || isNumber(val) || isBoolean(val)
|
|
52
|
+
};
|
|
120
53
|
|
|
121
|
-
export {
|
|
54
|
+
export { checkboxEmits, checkboxProps };
|
|
122
55
|
//# sourceMappingURL=checkbox2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox2.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.
|
|
1
|
+
{"version":3,"file":"checkbox2.mjs","sources":["../../../../../../packages/components/checkbox/src/checkbox.ts"],"sourcesContent":["import { UPDATE_MODEL_EVENT } from '@element-plus/constants'\nimport { useSizeProp } from '@element-plus/hooks'\nimport { isBoolean, isNumber, isString } from '@element-plus/utils'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type Checkbox from './checkbox.vue'\n\nexport type CheckboxValueType = string | number | boolean\n\nexport const checkboxProps = {\n /**\n * @description binding value\n */\n modelValue: {\n type: [Number, String, Boolean],\n default: undefined,\n },\n /**\n * @description value of the Checkbox when used inside a `checkbox-group`\n */\n label: {\n type: [String, Boolean, Number, Object],\n default: undefined,\n },\n /**\n * @description Set indeterminate state, only responsible for style control\n */\n indeterminate: Boolean,\n /**\n * @description whether the Checkbox is disabled\n */\n disabled: Boolean,\n /**\n * @description if the Checkbox is checked\n */\n checked: Boolean,\n /**\n * @description native 'name' attribute\n */\n name: {\n type: String,\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's checked\n */\n trueLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description value of the Checkbox if it's not checked\n */\n falseLabel: {\n type: [String, Number],\n default: undefined,\n },\n /**\n * @description input id\n */\n id: {\n type: String,\n default: undefined,\n },\n /**\n * @description same as [aria-controls](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls), takes effect when `indeterminate` is `true`\n */\n controls: {\n type: String,\n default: undefined,\n },\n /**\n * @description whether to add a border around Checkbox\n */\n border: Boolean,\n /**\n * @description size of the Checkbox\n */\n size: useSizeProp,\n /**\n * @description input tabindex\n */\n tabindex: [String, Number],\n /**\n * @description whether to trigger form validation\n */\n validateEvent: {\n type: Boolean,\n default: true,\n },\n}\n\nexport const checkboxEmits = {\n [UPDATE_MODEL_EVENT]: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n change: (val: CheckboxValueType) =>\n isString(val) || isNumber(val) || isBoolean(val),\n}\n\nexport type CheckboxProps = ExtractPropTypes<typeof checkboxProps>\nexport type CheckboxEmits = typeof checkboxEmits\nexport type CheckboxInstance = InstanceType<typeof Checkbox>\n"],"names":[],"mappings":";;;;;;;;AAGY,MAAC,aAAa,GAAG;AAC7B,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;AACnC,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC;AAC3C,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,aAAa,EAAE,OAAO;AACxB,EAAE,QAAQ,EAAE,OAAO;AACnB,EAAE,OAAO,EAAE,OAAO;AAClB,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC1B,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,MAAM,EAAE,OAAO;AACjB,EAAE,IAAI,EAAE,WAAW;AACnB,EAAE,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;AAC5B,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE;AACU,MAAC,aAAa,GAAG;AAC7B,EAAE,CAAC,kBAAkB,GAAG,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACjF,EAAE,MAAM,EAAE,CAAC,GAAG,KAAK,QAAQ,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC;AACnE;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -98,7 +98,7 @@ export { CASCADER_PANEL_INJECTION_KEY } from './cascader-panel/src/types.mjs';
|
|
|
98
98
|
export { CommonProps, DefaultProps, useCascaderConfig } from './cascader-panel/src/config.mjs';
|
|
99
99
|
export { checkTagEmits, checkTagProps } from './check-tag/src/check-tag.mjs';
|
|
100
100
|
export { checkboxGroupEmits, checkboxGroupProps } from './checkbox/src/checkbox-group.mjs';
|
|
101
|
-
export { checkboxEmits, checkboxProps } from './checkbox/src/
|
|
101
|
+
export { checkboxEmits, checkboxProps } from './checkbox/src/checkbox2.mjs';
|
|
102
102
|
export { checkboxGroupContextKey } from './checkbox/src/constants.mjs';
|
|
103
103
|
export { colProps } from './col/src/col.mjs';
|
|
104
104
|
export { collapseEmits, collapseProps, emitChangeFn } from './collapse/src/collapse.mjs';
|
|
@@ -18,7 +18,7 @@ const getLastOffset = (id) => {
|
|
|
18
18
|
};
|
|
19
19
|
const getOffsetOrSpace = (id, offset) => {
|
|
20
20
|
const idx = instances.findIndex((instance) => instance.id === id);
|
|
21
|
-
return idx > 0 ?
|
|
21
|
+
return idx > 0 ? 16 : offset;
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
export { getInstance, getLastOffset, getOffsetOrSpace, instances };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instance.mjs","sources":["../../../../../../packages/components/message/src/instance.ts"],"sourcesContent":["import { shallowReactive } from 'vue'\nimport type { ComponentInternalInstance, VNode } from 'vue'\nimport type { Mutable } from '@element-plus/utils'\nimport type { MessageHandler, MessageProps } from './message'\n\nexport type MessageContext = {\n id: string\n vnode: VNode\n handler: MessageHandler\n vm: ComponentInternalInstance\n props: Mutable<MessageProps>\n}\n\nexport const instances: MessageContext[] = shallowReactive([])\n\nexport const getInstance = (id: string) => {\n const idx = instances.findIndex((instance) => instance.id === id)\n const current = instances[idx]\n let prev: MessageContext | undefined\n if (idx > 0) {\n prev = instances[idx - 1]\n }\n return { current, prev }\n}\n\nexport const getLastOffset = (id: string): number => {\n const { prev } = getInstance(id)\n if (!prev) return 0\n return prev.vm.exposed!.bottom.value\n}\n\nexport const getOffsetOrSpace = (id: string, offset: number) => {\n const idx = instances.findIndex((instance) => instance.id === id)\n return idx > 0 ?
|
|
1
|
+
{"version":3,"file":"instance.mjs","sources":["../../../../../../packages/components/message/src/instance.ts"],"sourcesContent":["import { shallowReactive } from 'vue'\nimport type { ComponentInternalInstance, VNode } from 'vue'\nimport type { Mutable } from '@element-plus/utils'\nimport type { MessageHandler, MessageProps } from './message'\n\nexport type MessageContext = {\n id: string\n vnode: VNode\n handler: MessageHandler\n vm: ComponentInternalInstance\n props: Mutable<MessageProps>\n}\n\nexport const instances: MessageContext[] = shallowReactive([])\n\nexport const getInstance = (id: string) => {\n const idx = instances.findIndex((instance) => instance.id === id)\n const current = instances[idx]\n let prev: MessageContext | undefined\n if (idx > 0) {\n prev = instances[idx - 1]\n }\n return { current, prev }\n}\n\nexport const getLastOffset = (id: string): number => {\n const { prev } = getInstance(id)\n if (!prev) return 0\n return prev.vm.exposed!.bottom.value\n}\n\nexport const getOffsetOrSpace = (id: string, offset: number) => {\n const idx = instances.findIndex((instance) => instance.id === id)\n return idx > 0 ? 16 : offset\n}\n"],"names":[],"mappings":";;AACY,MAAC,SAAS,GAAG,eAAe,CAAC,EAAE,EAAE;AACjC,MAAC,WAAW,GAAG,CAAC,EAAE,KAAK;AACnC,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,EAAE,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;AACjC,EAAE,IAAI,IAAI,CAAC;AACX,EAAE,IAAI,GAAG,GAAG,CAAC,EAAE;AACf,IAAI,IAAI,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;AAC9B,GAAG;AACH,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC3B,EAAE;AACU,MAAC,aAAa,GAAG,CAAC,EAAE,KAAK;AACrC,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,EAAE,CAAC,CAAC;AACnC,EAAE,IAAI,CAAC,IAAI;AACX,IAAI,OAAO,CAAC,CAAC;AACb,EAAE,OAAO,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC;AACtC,EAAE;AACU,MAAC,gBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,KAAK;AAChD,EAAE,MAAM,GAAG,GAAG,SAAS,CAAC,SAAS,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACpE,EAAE,OAAO,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC;AAC/B;;;;"}
|
|
@@ -1,26 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import '../../../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createVNode, withCtx, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import './composables/index.mjs';
|
|
5
|
+
import { sliderButtonProps, sliderButtonEmits } from './button2.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { useSliderButton } from './composables/use-slider-button.mjs';
|
|
7
9
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const _hoisted_1 = ["tabindex"];
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElSliderButton"
|
|
13
|
+
});
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: sliderButtonProps,
|
|
17
|
+
emits: sliderButtonEmits,
|
|
18
|
+
setup(__props, { expose, emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const ns = useNamespace("slider");
|
|
21
|
+
const initData = reactive({
|
|
22
|
+
hovering: false,
|
|
23
|
+
dragging: false,
|
|
24
|
+
isClick: false,
|
|
25
|
+
startX: 0,
|
|
26
|
+
currentX: 0,
|
|
27
|
+
startY: 0,
|
|
28
|
+
currentY: 0,
|
|
29
|
+
startPosition: 0,
|
|
30
|
+
newPosition: 0,
|
|
31
|
+
oldValue: props.modelValue
|
|
32
|
+
});
|
|
33
|
+
const {
|
|
34
|
+
disabled,
|
|
35
|
+
button,
|
|
36
|
+
tooltip,
|
|
37
|
+
showTooltip,
|
|
38
|
+
tooltipVisible,
|
|
39
|
+
wrapperStyle,
|
|
40
|
+
formatValue,
|
|
41
|
+
handleMouseEnter,
|
|
42
|
+
handleMouseLeave,
|
|
43
|
+
onButtonDown,
|
|
44
|
+
onKeyDown,
|
|
45
|
+
setPosition
|
|
46
|
+
} = useSliderButton(props, initData, emit);
|
|
47
|
+
const { hovering, dragging } = toRefs(initData);
|
|
48
|
+
expose({
|
|
49
|
+
onButtonDown,
|
|
50
|
+
onKeyDown,
|
|
51
|
+
setPosition,
|
|
52
|
+
hovering,
|
|
53
|
+
dragging
|
|
54
|
+
});
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createElementBlock("div", {
|
|
57
|
+
ref_key: "button",
|
|
58
|
+
ref: button,
|
|
59
|
+
class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
|
|
60
|
+
style: normalizeStyle(unref(wrapperStyle)),
|
|
61
|
+
tabindex: unref(disabled) ? -1 : 0,
|
|
62
|
+
onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
|
|
63
|
+
onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
|
|
64
|
+
onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
|
|
65
|
+
onTouchstart: _cache[3] || (_cache[3] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
|
|
66
|
+
onFocus: _cache[4] || (_cache[4] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
|
|
67
|
+
onBlur: _cache[5] || (_cache[5] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
|
|
68
|
+
onKeydown: _cache[6] || (_cache[6] = (...args) => unref(onKeyDown) && unref(onKeyDown)(...args))
|
|
69
|
+
}, [
|
|
70
|
+
createVNode(unref(ElTooltip), {
|
|
71
|
+
ref_key: "tooltip",
|
|
72
|
+
ref: tooltip,
|
|
73
|
+
visible: unref(tooltipVisible),
|
|
74
|
+
placement: _ctx.placement,
|
|
75
|
+
"fallback-placements": ["top", "bottom", "right", "left"],
|
|
76
|
+
"stop-popper-mouse-event": false,
|
|
77
|
+
"popper-class": _ctx.tooltipClass,
|
|
78
|
+
disabled: !unref(showTooltip),
|
|
79
|
+
persistent: ""
|
|
80
|
+
}, {
|
|
81
|
+
content: withCtx(() => [
|
|
82
|
+
createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)
|
|
83
|
+
]),
|
|
84
|
+
default: withCtx(() => [
|
|
85
|
+
createElementVNode("div", {
|
|
86
|
+
class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
|
|
87
|
+
}, null, 2)
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["visible", "placement", "popper-class", "disabled"])
|
|
91
|
+
], 46, _hoisted_1);
|
|
92
|
+
};
|
|
19
93
|
}
|
|
20
94
|
});
|
|
21
|
-
|
|
22
|
-
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
|
|
23
|
-
};
|
|
95
|
+
var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button.vue"]]);
|
|
24
96
|
|
|
25
|
-
export {
|
|
97
|
+
export { SliderButton as default };
|
|
26
98
|
//# sourceMappingURL=button.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/slider/src/button.
|
|
1
|
+
{"version":3,"file":"button.mjs","sources":["../../../../../../packages/components/slider/src/button.vue"],"sourcesContent":["<template>\n <div\n ref=\"button\"\n :class=\"[ns.e('button-wrapper'), { hover: hovering, dragging }]\"\n :style=\"wrapperStyle\"\n :tabindex=\"disabled ? -1 : 0\"\n @mouseenter=\"handleMouseEnter\"\n @mouseleave=\"handleMouseLeave\"\n @mousedown=\"onButtonDown\"\n @touchstart=\"onButtonDown\"\n @focus=\"handleMouseEnter\"\n @blur=\"handleMouseLeave\"\n @keydown=\"onKeyDown\"\n >\n <el-tooltip\n ref=\"tooltip\"\n :visible=\"tooltipVisible\"\n :placement=\"placement\"\n :fallback-placements=\"['top', 'bottom', 'right', 'left']\"\n :stop-popper-mouse-event=\"false\"\n :popper-class=\"tooltipClass\"\n :disabled=\"!showTooltip\"\n persistent\n >\n <template #content>\n <span>{{ formatValue }}</span>\n </template>\n <div :class=\"[ns.e('button'), { hover: hovering, dragging }]\" />\n </el-tooltip>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { reactive, toRefs } from 'vue'\nimport { ElTooltip } from '@element-plus/components/tooltip'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useSliderButton } from './composables'\nimport { sliderButtonEmits, sliderButtonProps } from './button'\nimport type { SliderButtonInitData } from './button'\n\ndefineOptions({\n name: 'ElSliderButton',\n})\n\nconst props = defineProps(sliderButtonProps)\nconst emit = defineEmits(sliderButtonEmits)\n\nconst ns = useNamespace('slider')\n\nconst initData = reactive<SliderButtonInitData>({\n hovering: false,\n dragging: false,\n isClick: false,\n startX: 0,\n currentX: 0,\n startY: 0,\n currentY: 0,\n startPosition: 0,\n newPosition: 0,\n oldValue: props.modelValue,\n})\n\nconst {\n disabled,\n button,\n tooltip,\n showTooltip,\n tooltipVisible,\n wrapperStyle,\n formatValue,\n handleMouseEnter,\n handleMouseLeave,\n onButtonDown,\n onKeyDown,\n setPosition,\n} = useSliderButton(props, initData, emit)\n\nconst { hovering, dragging } = toRefs(initData)\n\ndefineExpose({\n onButtonDown,\n onKeyDown,\n setPosition,\n hovering,\n dragging,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;mCAwCc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;;;AAKA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAEhC,IAAA,MAAM,WAAW,QAA+B,CAAA;AAAA,MAC9C,QAAU,EAAA,KAAA;AAAA,MACV,QAAU,EAAA,KAAA;AAAA,MACV,OAAS,EAAA,KAAA;AAAA,MACT,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,MAAQ,EAAA,CAAA;AAAA,MACR,QAAU,EAAA,CAAA;AAAA,MACV,aAAe,EAAA,CAAA;AAAA,MACf,WAAa,EAAA,CAAA;AAAA,MACb,UAAU,KAAM,CAAA,UAAA;AAAA,KACjB,CAAA,CAAA;AAED,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,MAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MACA,cAAA;AAAA,MACA,YAAA;AAAA,MACA,WAAA;AAAA,MACA,gBAAA;AAAA,MACA,gBAAA;AAAA,MACA,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,KACE,GAAA,eAAA,CAAgB,KAAO,EAAA,QAAA,EAAU,IAAI,CAAA,CAAA;AAEzC,IAAA,MAAM,EAAE,QAAA,EAAU,QAAa,EAAA,GAAA,MAAA,CAAO,QAAQ,CAAA,CAAA;AAE9C,IAAa,MAAA,CAAA;AAAA,MACX,YAAA;AAAA,MACA,SAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|