@element-plus/nightly 0.0.20230322 → 0.0.20230324
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/attributes.json +1 -1
- package/dist/index.css +1 -1
- package/dist/index.full.js +31 -6
- package/dist/index.full.min.js +10 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +31 -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.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/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +26 -117
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +117 -26
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/autocomplete/index.d.ts +6 -0
- package/es/components/autocomplete/src/autocomplete.vue.d.ts +6 -0
- package/es/components/cascader/index.d.ts +12 -0
- package/es/components/cascader/src/cascader.vue.d.ts +6 -0
- package/es/components/color-picker/index.d.ts +2 -0
- package/es/components/color-picker/src/color-picker.vue.d.ts +2 -0
- package/es/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
- package/es/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -0
- package/es/components/date-picker/src/panel-utils.d.ts +4 -0
- package/es/components/form/index.d.ts +18 -0
- package/es/components/form/src/form.d.ts +6 -0
- package/es/components/form/src/form.mjs +4 -1
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/form.vue.d.ts +18 -0
- package/es/components/form/src/form2.mjs +1 -1
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +2 -2
- package/es/components/input/index.d.ts +2 -0
- package/es/components/input/src/input.vue.d.ts +2 -0
- package/es/components/input/src/input2.mjs +15 -0
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/index.d.ts +6 -0
- package/es/components/input-number/src/input-number.vue.d.ts +6 -0
- package/es/components/pagination/src/components/jumper.vue.d.ts +2 -0
- package/es/components/select/src/select.mjs +9 -2
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/slider/index.d.ts +6 -0
- package/es/components/slider/src/slider.vue.d.ts +6 -0
- package/es/components/statistic/index.mjs +2 -2
- package/es/components/statistic/src/statistic.mjs +25 -70
- package/es/components/statistic/src/statistic.mjs.map +1 -1
- package/es/components/statistic/src/statistic2.mjs +70 -25
- package/es/components/statistic/src/statistic2.mjs.map +1 -1
- package/es/components/time-picker/src/common/picker.vue.d.ts +2 -0
- package/es/components/transfer/index.d.ts +10 -0
- package/es/components/transfer/src/transfer-panel.vue.d.ts +2 -0
- package/es/components/transfer/src/transfer.vue.d.ts +10 -0
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +27 -117
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +117 -27
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/autocomplete/index.d.ts +6 -0
- package/lib/components/autocomplete/src/autocomplete.vue.d.ts +6 -0
- package/lib/components/cascader/index.d.ts +12 -0
- package/lib/components/cascader/src/cascader.vue.d.ts +6 -0
- package/lib/components/color-picker/index.d.ts +2 -0
- package/lib/components/color-picker/src/color-picker.vue.d.ts +2 -0
- package/lib/components/date-picker/src/date-picker-com/panel-date-pick.vue.d.ts +2 -0
- package/lib/components/date-picker/src/date-picker-com/panel-date-range.vue.d.ts +2 -0
- package/lib/components/date-picker/src/panel-utils.d.ts +4 -0
- package/lib/components/form/index.d.ts +18 -0
- package/lib/components/form/src/form.d.ts +6 -0
- package/lib/components/form/src/form.js +4 -1
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/form.vue.d.ts +18 -0
- package/lib/components/form/src/form2.js +1 -1
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/input/index.d.ts +2 -0
- package/lib/components/input/src/input.vue.d.ts +2 -0
- package/lib/components/input/src/input2.js +15 -0
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/index.d.ts +6 -0
- package/lib/components/input-number/src/input-number.vue.d.ts +6 -0
- package/lib/components/pagination/src/components/jumper.vue.d.ts +2 -0
- package/lib/components/select/src/select.js +9 -2
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/slider/index.d.ts +6 -0
- package/lib/components/slider/src/slider.vue.d.ts +6 -0
- package/lib/components/statistic/index.js +2 -2
- package/lib/components/statistic/src/statistic.js +25 -70
- package/lib/components/statistic/src/statistic.js.map +1 -1
- package/lib/components/statistic/src/statistic2.js +70 -25
- package/lib/components/statistic/src/statistic2.js.map +1 -1
- package/lib/components/time-picker/src/common/picker.vue.d.ts +2 -0
- package/lib/components/transfer/index.d.ts +10 -0
- package/lib/components/transfer/src/transfer-panel.vue.d.ts +2 -0
- package/lib/components/transfer/src/transfer.vue.d.ts +10 -0
- package/lib/index.js +2 -2
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/tags.json +1 -1
- package/theme-chalk/el-select.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/select.scss +7 -0
- package/web-types.json +1 -1
|
@@ -1,76 +1,31 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle } from 'vue';
|
|
2
|
-
import '../../../hooks/index.mjs';
|
|
3
1
|
import '../../../utils/index.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
-
import { isFunction } from '@vue/shared';
|
|
8
|
-
import { isNumber } from '@vueuse/core';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
9
3
|
|
|
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
|
-
return (_ctx, _cache) => {
|
|
34
|
-
return openBlock(), createElementBlock("div", {
|
|
35
|
-
class: normalizeClass(unref(ns).b())
|
|
36
|
-
}, [
|
|
37
|
-
_ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("div", {
|
|
38
|
-
key: 0,
|
|
39
|
-
class: normalizeClass(unref(ns).e("head"))
|
|
40
|
-
}, [
|
|
41
|
-
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
42
|
-
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
43
|
-
])
|
|
44
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
45
|
-
createElementVNode("div", {
|
|
46
|
-
class: normalizeClass(unref(ns).e("content"))
|
|
47
|
-
}, [
|
|
48
|
-
_ctx.$slots.prefix || _ctx.prefix ? (openBlock(), createElementBlock("div", {
|
|
49
|
-
key: 0,
|
|
50
|
-
class: normalizeClass(unref(ns).e("prefix"))
|
|
51
|
-
}, [
|
|
52
|
-
renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
53
|
-
createElementVNode("span", null, toDisplayString(_ctx.prefix), 1)
|
|
54
|
-
])
|
|
55
|
-
], 2)) : createCommentVNode("v-if", true),
|
|
56
|
-
createElementVNode("span", {
|
|
57
|
-
class: normalizeClass(unref(ns).e("number")),
|
|
58
|
-
style: normalizeStyle(_ctx.valueStyle)
|
|
59
|
-
}, toDisplayString(unref(displayValue)), 7),
|
|
60
|
-
_ctx.$slots.suffix || _ctx.suffix ? (openBlock(), createElementBlock("div", {
|
|
61
|
-
key: 1,
|
|
62
|
-
class: normalizeClass(unref(ns).e("suffix"))
|
|
63
|
-
}, [
|
|
64
|
-
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
65
|
-
createElementVNode("span", null, toDisplayString(_ctx.suffix), 1)
|
|
66
|
-
])
|
|
67
|
-
], 2)) : createCommentVNode("v-if", true)
|
|
68
|
-
], 2)
|
|
69
|
-
], 2);
|
|
70
|
-
};
|
|
4
|
+
const statisticProps = buildProps({
|
|
5
|
+
decimalSeparator: {
|
|
6
|
+
type: String,
|
|
7
|
+
default: "."
|
|
8
|
+
},
|
|
9
|
+
groupSeparator: {
|
|
10
|
+
type: String,
|
|
11
|
+
default: ","
|
|
12
|
+
},
|
|
13
|
+
precision: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
formatter: Function,
|
|
18
|
+
value: {
|
|
19
|
+
type: definePropType([Number, Object]),
|
|
20
|
+
default: 0
|
|
21
|
+
},
|
|
22
|
+
prefix: String,
|
|
23
|
+
suffix: String,
|
|
24
|
+
title: String,
|
|
25
|
+
valueStyle: {
|
|
26
|
+
type: definePropType([String, Object, Array])
|
|
71
27
|
}
|
|
72
28
|
});
|
|
73
|
-
var Statistic = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/statistic/src/statistic.vue"]]);
|
|
74
29
|
|
|
75
|
-
export {
|
|
30
|
+
export { statisticProps };
|
|
76
31
|
//# sourceMappingURL=statistic.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistic.mjs","sources":["../../../../../../packages/components/statistic/src/statistic.
|
|
1
|
+
{"version":3,"file":"statistic.mjs","sources":["../../../../../../packages/components/statistic/src/statistic.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type { Dayjs } from 'dayjs'\nimport type Statistic from './statistic.vue'\n\nexport const statisticProps = buildProps({\n /**\n * @description Setting the decimal point\n */\n decimalSeparator: {\n type: String,\n default: '.',\n },\n /**\n * @description Sets the thousandth identifier\n */\n groupSeparator: {\n type: String,\n default: ',',\n },\n /**\n * @description numerical precision\n */\n precision: {\n type: Number,\n default: 0,\n },\n /**\n * @description Custom numerical presentation\n */\n formatter: Function,\n /**\n * @description Numerical content\n */\n value: {\n type: definePropType<number | Dayjs>([Number, Object]),\n default: 0,\n },\n /**\n * @description Sets the prefix of a number\n */\n prefix: String,\n\n /**\n * @description Sets the suffix of a number\n */\n suffix: String,\n /**\n * @description Numeric titles\n */\n title: String,\n /**\n * @description Styles numeric values\n */\n valueStyle: {\n type: definePropType<StyleValue>([String, Object, Array]),\n },\n} as const)\nexport type StatisticProps = ExtractPropTypes<typeof statisticProps>\n\nexport type StatisticInstance = InstanceType<typeof Statistic>\n"],"names":[],"mappings":";;;AACY,MAAC,cAAc,GAAG,UAAU,CAAC;AACzC,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,cAAc,EAAE;AAClB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,SAAS,EAAE,QAAQ;AACrB,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,MAAM,EAAE,MAAM;AAChB,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,UAAU,EAAE;AACd,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;AACjD,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,31 +1,76 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, createCommentVNode, createElementVNode, normalizeStyle } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
1
3
|
import '../../../utils/index.mjs';
|
|
2
|
-
import {
|
|
4
|
+
import { statisticProps } from './statistic.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
+
import { isFunction } from '@vue/shared';
|
|
8
|
+
import { isNumber } from '@vueuse/core';
|
|
3
9
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
const __default__ = defineComponent({
|
|
11
|
+
name: "ElStatistic"
|
|
12
|
+
});
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
...__default__,
|
|
15
|
+
props: statisticProps,
|
|
16
|
+
setup(__props, { expose }) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const ns = useNamespace("statistic");
|
|
19
|
+
const displayValue = computed(() => {
|
|
20
|
+
const { value, formatter, precision, decimalSeparator, groupSeparator } = props;
|
|
21
|
+
if (isFunction(formatter))
|
|
22
|
+
return formatter(value);
|
|
23
|
+
if (!isNumber(value))
|
|
24
|
+
return value;
|
|
25
|
+
let [integer, decimal = ""] = String(value).split(".");
|
|
26
|
+
decimal = decimal.padEnd(precision, "0").slice(0, precision > 0 ? precision : 0);
|
|
27
|
+
integer = integer.replace(/\B(?=(\d{3})+(?!\d))/g, groupSeparator);
|
|
28
|
+
return [integer, decimal].join(decimal ? decimalSeparator : "");
|
|
29
|
+
});
|
|
30
|
+
expose({
|
|
31
|
+
displayValue
|
|
32
|
+
});
|
|
33
|
+
return (_ctx, _cache) => {
|
|
34
|
+
return openBlock(), createElementBlock("div", {
|
|
35
|
+
class: normalizeClass(unref(ns).b())
|
|
36
|
+
}, [
|
|
37
|
+
_ctx.$slots.title || _ctx.title ? (openBlock(), createElementBlock("div", {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: normalizeClass(unref(ns).e("head"))
|
|
40
|
+
}, [
|
|
41
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
42
|
+
createTextVNode(toDisplayString(_ctx.title), 1)
|
|
43
|
+
])
|
|
44
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
45
|
+
createElementVNode("div", {
|
|
46
|
+
class: normalizeClass(unref(ns).e("content"))
|
|
47
|
+
}, [
|
|
48
|
+
_ctx.$slots.prefix || _ctx.prefix ? (openBlock(), createElementBlock("div", {
|
|
49
|
+
key: 0,
|
|
50
|
+
class: normalizeClass(unref(ns).e("prefix"))
|
|
51
|
+
}, [
|
|
52
|
+
renderSlot(_ctx.$slots, "prefix", {}, () => [
|
|
53
|
+
createElementVNode("span", null, toDisplayString(_ctx.prefix), 1)
|
|
54
|
+
])
|
|
55
|
+
], 2)) : createCommentVNode("v-if", true),
|
|
56
|
+
createElementVNode("span", {
|
|
57
|
+
class: normalizeClass(unref(ns).e("number")),
|
|
58
|
+
style: normalizeStyle(_ctx.valueStyle)
|
|
59
|
+
}, toDisplayString(unref(displayValue)), 7),
|
|
60
|
+
_ctx.$slots.suffix || _ctx.suffix ? (openBlock(), createElementBlock("div", {
|
|
61
|
+
key: 1,
|
|
62
|
+
class: normalizeClass(unref(ns).e("suffix"))
|
|
63
|
+
}, [
|
|
64
|
+
renderSlot(_ctx.$slots, "suffix", {}, () => [
|
|
65
|
+
createElementVNode("span", null, toDisplayString(_ctx.suffix), 1)
|
|
66
|
+
])
|
|
67
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
68
|
+
], 2)
|
|
69
|
+
], 2);
|
|
70
|
+
};
|
|
27
71
|
}
|
|
28
72
|
});
|
|
73
|
+
var Statistic = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/statistic/src/statistic.vue"]]);
|
|
29
74
|
|
|
30
|
-
export {
|
|
75
|
+
export { Statistic as default };
|
|
31
76
|
//# sourceMappingURL=statistic2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"statistic2.mjs","sources":["../../../../../../packages/components/statistic/src/statistic.
|
|
1
|
+
{"version":3,"file":"statistic2.mjs","sources":["../../../../../../packages/components/statistic/src/statistic.vue"],"sourcesContent":["<template>\n <div :class=\"ns.b()\">\n <div v-if=\"$slots.title || title\" :class=\"ns.e('head')\">\n <slot name=\"title\">\n {{ title }}\n </slot>\n </div>\n <div :class=\"ns.e('content')\">\n <div v-if=\"$slots.prefix || prefix\" :class=\"ns.e('prefix')\">\n <slot name=\"prefix\">\n <span>{{ prefix }}</span>\n </slot>\n </div>\n <span :class=\"ns.e('number')\" :style=\"valueStyle\">\n {{ displayValue }}\n </span>\n <div v-if=\"$slots.suffix || suffix\" :class=\"ns.e('suffix')\">\n <slot name=\"suffix\">\n <span>{{ suffix }}</span>\n </slot>\n </div>\n </div>\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { isFunction, isNumber } from '@element-plus/utils'\nimport { statisticProps } from './statistic'\n\ndefineOptions({\n name: 'ElStatistic',\n})\n\nconst props = defineProps(statisticProps)\nconst ns = useNamespace('statistic')\n\nconst displayValue = computed(() => {\n const { value, formatter, precision, decimalSeparator, groupSeparator } =\n props\n\n if (isFunction(formatter)) return formatter(value)\n\n if (!isNumber(value)) return value\n\n let [integer, decimal = ''] = String(value).split('.')\n decimal = decimal\n .padEnd(precision, '0')\n .slice(0, precision > 0 ? precision : 0)\n integer = integer.replace(/\\B(?=(\\d{3})+(?!\\d))/g, groupSeparator)\n return [integer, decimal].join(decimal ? decimalSeparator : '')\n})\n\ndefineExpose({\n /**\n * @description current display value\n */\n displayValue,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;mCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,aAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAK,aAAa,WAAW,CAAA,CAAA;AAEnC,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM;AAClC,MAAA,MAAM,EAAE,KAAA,EAAO,SAAW,EAAA,SAAA,EAAW,kBAAkB,cACrD,EAAA,GAAA,KAAA,CAAA;AAEF,MAAA,IAAI,WAAW,SAAS,CAAA;AAAG,QAAA,OAAO,UAAU,KAAK,CAAA,CAAA;AAEjD,MAAI,IAAA,CAAC,SAAS,KAAK,CAAA;AAAG,QAAO,OAAA,KAAA,CAAA;AAE7B,MAAI,IAAA,CAAC,SAAS,OAAU,GAAA,EAAA,CAAA,GAAM,OAAO,KAAK,CAAA,CAAE,MAAM,GAAG,CAAA,CAAA;AACrD,MAAU,OAAA,GAAA,OAAA,CACP,MAAO,CAAA,SAAA,EAAW,GAAG,CAAA,CACrB,MAAM,CAAG,EAAA,SAAA,GAAY,CAAI,GAAA,SAAA,GAAY,CAAC,CAAA,CAAA;AACzC,MAAU,OAAA,GAAA,OAAA,CAAQ,OAAQ,CAAA,uBAAA,EAAyB,cAAc,CAAA,CAAA;AACjE,MAAA,OAAO,CAAC,OAAS,EAAA,OAAO,EAAE,IAAK,CAAA,OAAA,GAAU,mBAAmB,EAAE,CAAA,CAAA;AAAA,KAC/D,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MAIX,YAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -6922,6 +6922,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6922
6922
|
recordCursor: () => void;
|
|
6923
6923
|
setCursor: () => void;
|
|
6924
6924
|
resizeTextarea: () => void;
|
|
6925
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
6926
|
+
onceInitSizeTextarea: () => void;
|
|
6925
6927
|
setNativeInputValue: () => void;
|
|
6926
6928
|
handleInput: (event: Event) => Promise<void>;
|
|
6927
6929
|
handleChange: (event: Event) => void;
|
|
@@ -1043,6 +1043,8 @@ export declare const ElTransfer: import("element-plus/es/utils").SFCWithInstall<
|
|
|
1043
1043
|
recordCursor: () => void;
|
|
1044
1044
|
setCursor: () => void;
|
|
1045
1045
|
resizeTextarea: () => void;
|
|
1046
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
1047
|
+
onceInitSizeTextarea: () => void;
|
|
1046
1048
|
setNativeInputValue: () => void;
|
|
1047
1049
|
handleInput: (event: Event) => Promise<void>;
|
|
1048
1050
|
handleChange: (event: Event) => void;
|
|
@@ -2148,6 +2150,8 @@ export declare const ElTransfer: import("element-plus/es/utils").SFCWithInstall<
|
|
|
2148
2150
|
recordCursor: () => void;
|
|
2149
2151
|
setCursor: () => void;
|
|
2150
2152
|
resizeTextarea: () => void;
|
|
2153
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
2154
|
+
onceInitSizeTextarea: () => void;
|
|
2151
2155
|
setNativeInputValue: () => void;
|
|
2152
2156
|
handleInput: (event: Event) => Promise<void>;
|
|
2153
2157
|
handleChange: (event: Event) => void;
|
|
@@ -3279,6 +3283,8 @@ export declare const ElTransfer: import("element-plus/es/utils").SFCWithInstall<
|
|
|
3279
3283
|
recordCursor: () => void;
|
|
3280
3284
|
setCursor: () => void;
|
|
3281
3285
|
resizeTextarea: () => void;
|
|
3286
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
3287
|
+
onceInitSizeTextarea: () => void;
|
|
3282
3288
|
setNativeInputValue: () => void;
|
|
3283
3289
|
handleInput: (event: Event) => Promise<void>;
|
|
3284
3290
|
handleChange: (event: Event) => void;
|
|
@@ -4384,6 +4390,8 @@ export declare const ElTransfer: import("element-plus/es/utils").SFCWithInstall<
|
|
|
4384
4390
|
recordCursor: () => void;
|
|
4385
4391
|
setCursor: () => void;
|
|
4386
4392
|
resizeTextarea: () => void;
|
|
4393
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
4394
|
+
onceInitSizeTextarea: () => void;
|
|
4387
4395
|
setNativeInputValue: () => void;
|
|
4388
4396
|
handleInput: (event: Event) => Promise<void>;
|
|
4389
4397
|
handleChange: (event: Event) => void;
|
|
@@ -5784,6 +5792,8 @@ export declare const ElTransfer: import("element-plus/es/utils").SFCWithInstall<
|
|
|
5784
5792
|
recordCursor: () => void;
|
|
5785
5793
|
setCursor: () => void;
|
|
5786
5794
|
resizeTextarea: () => void;
|
|
5795
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
5796
|
+
onceInitSizeTextarea: () => void;
|
|
5787
5797
|
setNativeInputValue: () => void;
|
|
5788
5798
|
handleInput: (event: Event) => Promise<void>;
|
|
5789
5799
|
handleChange: (event: Event) => void;
|
|
@@ -881,6 +881,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
881
881
|
recordCursor: () => void;
|
|
882
882
|
setCursor: () => void;
|
|
883
883
|
resizeTextarea: () => void;
|
|
884
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
885
|
+
onceInitSizeTextarea: () => void;
|
|
884
886
|
setNativeInputValue: () => void;
|
|
885
887
|
handleInput: (event: Event) => Promise<void>;
|
|
886
888
|
handleChange: (event: Event) => void;
|
|
@@ -1044,6 +1044,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1044
1044
|
recordCursor: () => void;
|
|
1045
1045
|
setCursor: () => void;
|
|
1046
1046
|
resizeTextarea: () => void;
|
|
1047
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
1048
|
+
onceInitSizeTextarea: () => void;
|
|
1047
1049
|
setNativeInputValue: () => void;
|
|
1048
1050
|
handleInput: (event: Event) => Promise<void>;
|
|
1049
1051
|
handleChange: (event: Event) => void;
|
|
@@ -2149,6 +2151,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2149
2151
|
recordCursor: () => void;
|
|
2150
2152
|
setCursor: () => void;
|
|
2151
2153
|
resizeTextarea: () => void;
|
|
2154
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
2155
|
+
onceInitSizeTextarea: () => void;
|
|
2152
2156
|
setNativeInputValue: () => void;
|
|
2153
2157
|
handleInput: (event: Event) => Promise<void>;
|
|
2154
2158
|
handleChange: (event: Event) => void;
|
|
@@ -3280,6 +3284,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3280
3284
|
recordCursor: () => void;
|
|
3281
3285
|
setCursor: () => void;
|
|
3282
3286
|
resizeTextarea: () => void;
|
|
3287
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
3288
|
+
onceInitSizeTextarea: () => void;
|
|
3283
3289
|
setNativeInputValue: () => void;
|
|
3284
3290
|
handleInput: (event: Event) => Promise<void>;
|
|
3285
3291
|
handleChange: (event: Event) => void;
|
|
@@ -4385,6 +4391,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
4385
4391
|
recordCursor: () => void;
|
|
4386
4392
|
setCursor: () => void;
|
|
4387
4393
|
resizeTextarea: () => void;
|
|
4394
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
4395
|
+
onceInitSizeTextarea: () => void;
|
|
4388
4396
|
setNativeInputValue: () => void;
|
|
4389
4397
|
handleInput: (event: Event) => Promise<void>;
|
|
4390
4398
|
handleChange: (event: Event) => void;
|
|
@@ -5785,6 +5793,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5785
5793
|
recordCursor: () => void;
|
|
5786
5794
|
setCursor: () => void;
|
|
5787
5795
|
resizeTextarea: () => void;
|
|
5796
|
+
createOnceInitResize: (resizeTextarea: () => void) => () => void;
|
|
5797
|
+
onceInitSizeTextarea: () => void;
|
|
5788
5798
|
setNativeInputValue: () => void;
|
|
5789
5799
|
handleInput: (event: Event) => Promise<void>;
|
|
5790
5800
|
handleChange: (event: Event) => void;
|
package/es/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import './directives/index.mjs';
|
|
|
6
6
|
import './hooks/index.mjs';
|
|
7
7
|
export { makeInstaller } from './make-installer.mjs';
|
|
8
8
|
export { default as dayjs } from 'dayjs';
|
|
9
|
-
export { affixEmits, affixProps } from './components/affix/src/
|
|
9
|
+
export { affixEmits, affixProps } from './components/affix/src/affix.mjs';
|
|
10
10
|
export { ElAffix } from './components/affix/index.mjs';
|
|
11
11
|
export { alertEffects, alertEmits, alertProps } from './components/alert/src/alert.mjs';
|
|
12
12
|
export { ElAlert } from './components/alert/index.mjs';
|
|
@@ -151,7 +151,7 @@ export { ElSlider } from './components/slider/index.mjs';
|
|
|
151
151
|
export { spaceProps } from './components/space/src/space.mjs';
|
|
152
152
|
export { useSpace } from './components/space/src/use-space.mjs';
|
|
153
153
|
export { ElSpace } from './components/space/index.mjs';
|
|
154
|
-
export { statisticProps } from './components/statistic/src/
|
|
154
|
+
export { statisticProps } from './components/statistic/src/statistic.mjs';
|
|
155
155
|
export { ElStatistic } from './components/statistic/index.mjs';
|
|
156
156
|
export { stepProps } from './components/steps/src/item.mjs';
|
|
157
157
|
export { stepsEmits, stepsProps } from './components/steps/src/steps.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20230324";
|
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.20230324'\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 affix$1 = require('./src/
|
|
7
|
-
var affix = require('./src/
|
|
6
|
+
var affix$1 = require('./src/affix2.js');
|
|
7
|
+
var affix = require('./src/affix.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAffix = install.withInstall(affix$1["default"]);
|
|
@@ -2,126 +2,36 @@
|
|
|
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
|
|
11
|
-
var
|
|
12
|
-
var style = require('../../../utils/dom/style.js');
|
|
13
|
-
var error = require('../../../utils/error.js');
|
|
14
|
-
var scroll = require('../../../utils/dom/scroll.js');
|
|
6
|
+
require('../../../constants/index.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
|
+
var core = require('@vueuse/core');
|
|
9
|
+
var event = require('../../../constants/event.js');
|
|
15
10
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
width: rootWidth,
|
|
34
|
-
top: rootTop,
|
|
35
|
-
bottom: rootBottom,
|
|
36
|
-
update: updateRoot
|
|
37
|
-
} = core.useElementBounding(root, { windowScroll: false });
|
|
38
|
-
const targetRect = core.useElementBounding(target);
|
|
39
|
-
const fixed = vue.ref(false);
|
|
40
|
-
const scrollTop = vue.ref(0);
|
|
41
|
-
const transform = vue.ref(0);
|
|
42
|
-
const rootStyle = vue.computed(() => {
|
|
43
|
-
return {
|
|
44
|
-
height: fixed.value ? `${rootHeight.value}px` : "",
|
|
45
|
-
width: fixed.value ? `${rootWidth.value}px` : ""
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
const affixStyle = vue.computed(() => {
|
|
49
|
-
if (!fixed.value)
|
|
50
|
-
return {};
|
|
51
|
-
const offset = props.offset ? style.addUnit(props.offset) : 0;
|
|
52
|
-
return {
|
|
53
|
-
height: `${rootHeight.value}px`,
|
|
54
|
-
width: `${rootWidth.value}px`,
|
|
55
|
-
top: props.position === "top" ? offset : "",
|
|
56
|
-
bottom: props.position === "bottom" ? offset : "",
|
|
57
|
-
transform: transform.value ? `translateY(${transform.value}px)` : "",
|
|
58
|
-
zIndex: props.zIndex
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
const update = () => {
|
|
62
|
-
if (!scrollContainer.value)
|
|
63
|
-
return;
|
|
64
|
-
scrollTop.value = scrollContainer.value instanceof Window ? document.documentElement.scrollTop : scrollContainer.value.scrollTop || 0;
|
|
65
|
-
if (props.position === "top") {
|
|
66
|
-
if (props.target) {
|
|
67
|
-
const difference = targetRect.bottom.value - props.offset - rootHeight.value;
|
|
68
|
-
fixed.value = props.offset > rootTop.value && targetRect.bottom.value > 0;
|
|
69
|
-
transform.value = difference < 0 ? difference : 0;
|
|
70
|
-
} else {
|
|
71
|
-
fixed.value = props.offset > rootTop.value;
|
|
72
|
-
}
|
|
73
|
-
} else if (props.target) {
|
|
74
|
-
const difference = windowHeight.value - targetRect.top.value - props.offset - rootHeight.value;
|
|
75
|
-
fixed.value = windowHeight.value - props.offset < rootBottom.value && windowHeight.value > targetRect.top.value;
|
|
76
|
-
transform.value = difference < 0 ? -difference : 0;
|
|
77
|
-
} else {
|
|
78
|
-
fixed.value = windowHeight.value - props.offset < rootBottom.value;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
const handleScroll = () => {
|
|
82
|
-
updateRoot();
|
|
83
|
-
emit("scroll", {
|
|
84
|
-
scrollTop: scrollTop.value,
|
|
85
|
-
fixed: fixed.value
|
|
86
|
-
});
|
|
87
|
-
};
|
|
88
|
-
vue.watch(fixed, (val) => emit("change", val));
|
|
89
|
-
vue.onMounted(() => {
|
|
90
|
-
var _a;
|
|
91
|
-
if (props.target) {
|
|
92
|
-
target.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
93
|
-
if (!target.value)
|
|
94
|
-
error.throwError(COMPONENT_NAME, `Target is not existed: ${props.target}`);
|
|
95
|
-
} else {
|
|
96
|
-
target.value = document.documentElement;
|
|
97
|
-
}
|
|
98
|
-
scrollContainer.value = scroll.getScrollContainer(root.value, true);
|
|
99
|
-
updateRoot();
|
|
100
|
-
});
|
|
101
|
-
core.useEventListener(scrollContainer, "scroll", handleScroll);
|
|
102
|
-
vue.watchEffect(update);
|
|
103
|
-
expose({
|
|
104
|
-
update,
|
|
105
|
-
updateRoot
|
|
106
|
-
});
|
|
107
|
-
return (_ctx, _cache) => {
|
|
108
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
109
|
-
ref_key: "root",
|
|
110
|
-
ref: root,
|
|
111
|
-
class: vue.normalizeClass(vue.unref(ns).b()),
|
|
112
|
-
style: vue.normalizeStyle(vue.unref(rootStyle))
|
|
113
|
-
}, [
|
|
114
|
-
vue.createElementVNode("div", {
|
|
115
|
-
class: vue.normalizeClass({ [vue.unref(ns).m("fixed")]: fixed.value }),
|
|
116
|
-
style: vue.normalizeStyle(vue.unref(affixStyle))
|
|
117
|
-
}, [
|
|
118
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
119
|
-
], 6)
|
|
120
|
-
], 6);
|
|
121
|
-
};
|
|
11
|
+
const affixProps = runtime.buildProps({
|
|
12
|
+
zIndex: {
|
|
13
|
+
type: runtime.definePropType([Number, String]),
|
|
14
|
+
default: 100
|
|
15
|
+
},
|
|
16
|
+
target: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
offset: {
|
|
21
|
+
type: Number,
|
|
22
|
+
default: 0
|
|
23
|
+
},
|
|
24
|
+
position: {
|
|
25
|
+
type: String,
|
|
26
|
+
values: ["top", "bottom"],
|
|
27
|
+
default: "top"
|
|
122
28
|
}
|
|
123
29
|
});
|
|
124
|
-
|
|
30
|
+
const affixEmits = {
|
|
31
|
+
scroll: ({ scrollTop, fixed }) => core.isNumber(scrollTop) && core.isBoolean(fixed),
|
|
32
|
+
[event.CHANGE_EVENT]: (fixed) => core.isBoolean(fixed)
|
|
33
|
+
};
|
|
125
34
|
|
|
126
|
-
exports
|
|
35
|
+
exports.affixEmits = affixEmits;
|
|
36
|
+
exports.affixProps = affixProps;
|
|
127
37
|
//# sourceMappingURL=affix.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.
|
|
1
|
+
{"version":3,"file":"affix.js","sources":["../../../../../../packages/components/affix/src/affix.ts"],"sourcesContent":["import {\n buildProps,\n definePropType,\n isBoolean,\n isNumber,\n} from '@element-plus/utils'\nimport { CHANGE_EVENT } from '@element-plus/constants'\nimport type { ExtractPropTypes } from 'vue'\nimport type { ZIndexProperty } from 'csstype'\nimport type Affix from './affix.vue'\n\nexport const affixProps = buildProps({\n /**\n * @description affix element zIndex value\n * */\n zIndex: {\n type: definePropType<ZIndexProperty>([Number, String]),\n default: 100,\n },\n /**\n * @description target container. (CSS selector)\n */\n target: {\n type: String,\n default: '',\n },\n /**\n * @description offset distance\n * */\n offset: {\n type: Number,\n default: 0,\n },\n /**\n * @description position of affix\n * */\n position: {\n type: String,\n values: ['top', 'bottom'],\n default: 'top',\n },\n} as const)\nexport type AffixProps = ExtractPropTypes<typeof affixProps>\n\nexport const affixEmits = {\n scroll: ({ scrollTop, fixed }: { scrollTop: number; fixed: boolean }) =>\n isNumber(scrollTop) && isBoolean(fixed),\n [CHANGE_EVENT]: (fixed: boolean) => isBoolean(fixed),\n}\nexport type AffixEmits = typeof affixEmits\n\nexport type AffixInstance = InstanceType<typeof Affix>\n"],"names":["buildProps","definePropType","isNumber","isBoolean","CHANGE_EVENT"],"mappings":";;;;;;;;;;AAOY,MAAC,UAAU,GAAGA,kBAAU,CAAC;AACrC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAEC,sBAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC7B,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC,EAAE;AACS,MAAC,UAAU,GAAG;AAC1B,EAAE,MAAM,EAAE,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,KAAKC,aAAQ,CAAC,SAAS,CAAC,IAAIC,cAAS,CAAC,KAAK,CAAC;AAC3E,EAAE,CAACC,kBAAY,GAAG,CAAC,KAAK,KAAKD,cAAS,CAAC,KAAK,CAAC;AAC7C;;;;;"}
|