@element-plus/nightly 0.0.20231209 → 0.0.20231211
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.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/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +81 -361
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +361 -81
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +8 -37
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +37 -8
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +1 -1
- package/es/index.mjs +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +81 -360
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +360 -81
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +9 -37
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +37 -9
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/components/tooltip/src/tooltip2.js +1 -1
- package/lib/index.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/web-types.json +1 -1
|
@@ -1,13 +1,42 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, inject, watch, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { POPPER_CONTENT_INJECTION_KEY } from './constants.mjs';
|
|
4
|
+
import { popperArrowProps } from './arrow.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
7
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
const __default__ = defineComponent({
|
|
9
|
+
name: "ElPopperArrow",
|
|
10
|
+
inheritAttrs: false
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: popperArrowProps,
|
|
15
|
+
setup(__props, { expose }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const ns = useNamespace("popper");
|
|
18
|
+
const { arrowOffset, arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
|
|
19
|
+
watch(() => props.arrowOffset, (val) => {
|
|
20
|
+
arrowOffset.value = val;
|
|
21
|
+
});
|
|
22
|
+
onBeforeUnmount(() => {
|
|
23
|
+
arrowRef.value = void 0;
|
|
24
|
+
});
|
|
25
|
+
expose({
|
|
26
|
+
arrowRef
|
|
27
|
+
});
|
|
28
|
+
return (_ctx, _cache) => {
|
|
29
|
+
return openBlock(), createElementBlock("span", {
|
|
30
|
+
ref_key: "arrowRef",
|
|
31
|
+
ref: arrowRef,
|
|
32
|
+
class: normalizeClass(unref(ns).e("arrow")),
|
|
33
|
+
style: normalizeStyle(unref(arrowStyle)),
|
|
34
|
+
"data-popper-arrow": ""
|
|
35
|
+
}, null, 6);
|
|
36
|
+
};
|
|
8
37
|
}
|
|
9
38
|
});
|
|
10
|
-
|
|
39
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/home/runner/work/element-plus/element-plus/packages/components/popper/src/arrow.vue"]]);
|
|
11
40
|
|
|
12
|
-
export {
|
|
41
|
+
export { ElPopperArrow as default };
|
|
13
42
|
//# sourceMappingURL=arrow2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"arrow2.mjs","sources":["../../../../../../packages/components/popper/src/arrow.
|
|
1
|
+
{"version":3,"file":"arrow2.mjs","sources":["../../../../../../packages/components/popper/src/arrow.vue"],"sourcesContent":["<template>\n <span\n ref=\"arrowRef\"\n :class=\"ns.e('arrow')\"\n :style=\"arrowStyle\"\n data-popper-arrow\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { inject, onBeforeUnmount, watch } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { POPPER_CONTENT_INJECTION_KEY } from './constants'\nimport { popperArrowProps } from './arrow'\n\ndefineOptions({\n name: 'ElPopperArrow',\n inheritAttrs: false,\n})\n\nconst props = defineProps(popperArrowProps)\n\nconst ns = useNamespace('popper')\nconst { arrowOffset, arrowRef, arrowStyle } = inject(\n POPPER_CONTENT_INJECTION_KEY,\n undefined\n)!\n\nwatch(\n () => props.arrowOffset,\n (val) => {\n arrowOffset.value = val\n }\n)\nonBeforeUnmount(() => {\n arrowRef.value = undefined\n})\n\ndefineExpose({\n /**\n * @description Arrow element\n */\n arrowRef,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;mCAec,CAAA;AAAA,EACZ,IAAM,EAAA,eAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAChB,CAAA,CAAA,CAAA;;;;;;AAIA,IAAM,MAAA,EAAA,GAAK,aAAa,QAAQ,CAAA,CAAA;AAChC,IAAA,MAAM,EAAE,WAAa,EAAA,QAAA,EAAU,UAAe,EAAA,GAAA,MAAA,CAC5C,8BACA,KACF,CAAA,CAAA,CAAA;AAEA,IAAA,KAAA,CACE,MAAM,KAAA,CAAM,WACZ,EAAA,CAAC,GAAQ,KAAA;AACP,MAAA,WAAA,CAAY,KAAQ,GAAA,GAAA,CAAA;AAAA,KAExB,CAAA,CAAA;AACA,IAAA,eAAA,CAAgB,MAAM;AACpB,MAAA,QAAA,CAAS,KAAQ,GAAA,KAAA,CAAA,CAAA;AAAA,KAClB,CAAA,CAAA;AAED,IAAa,MAAA,CAAA;AAAA,MAIX,QAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;"}
|
|
@@ -6,7 +6,7 @@ import { useTooltipTriggerProps } from './trigger.mjs';
|
|
|
6
6
|
import { createModelToggleComposable } from '../../../hooks/use-model-toggle/index.mjs';
|
|
7
7
|
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
8
8
|
import { popperProps } from '../../popper/src/popper.mjs';
|
|
9
|
-
import { popperArrowProps } from '../../popper/src/
|
|
9
|
+
import { popperArrowProps } from '../../popper/src/arrow.mjs';
|
|
10
10
|
|
|
11
11
|
const {
|
|
12
12
|
useModelToggleProps: useTooltipModelToggleProps,
|
|
@@ -11,7 +11,7 @@ import { usePopperContainer } from '../../../hooks/use-popper-container/index.mj
|
|
|
11
11
|
import { useId } from '../../../hooks/use-id/index.mjs';
|
|
12
12
|
import { useDelayedToggle } from '../../../hooks/use-delayed-toggle/index.mjs';
|
|
13
13
|
import { isBoolean } from '../../../utils/types.mjs';
|
|
14
|
-
import ElPopperArrow from '../../popper/src/
|
|
14
|
+
import ElPopperArrow from '../../popper/src/arrow2.mjs';
|
|
15
15
|
|
|
16
16
|
const _hoisted_1 = ["innerHTML"];
|
|
17
17
|
const _hoisted_2 = { key: 1 };
|
package/es/index.mjs
CHANGED
|
@@ -10,7 +10,7 @@ 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';
|
|
13
|
-
export { autocompleteEmits, autocompleteProps } from './components/autocomplete/src/
|
|
13
|
+
export { autocompleteEmits, autocompleteProps } from './components/autocomplete/src/autocomplete.mjs';
|
|
14
14
|
export { ElAutocomplete } from './components/autocomplete/index.mjs';
|
|
15
15
|
export { avatarEmits, avatarProps } from './components/avatar/src/avatar.mjs';
|
|
16
16
|
export { ElAvatar } from './components/avatar/index.mjs';
|
|
@@ -114,9 +114,9 @@ export { ElPopconfirm } from './components/popconfirm/index.mjs';
|
|
|
114
114
|
export { Effect, popperProps, roleTypes, usePopperProps } from './components/popper/src/popper.mjs';
|
|
115
115
|
export { popperTriggerProps, usePopperTriggerProps } from './components/popper/src/trigger.mjs';
|
|
116
116
|
export { popperContentEmits, popperContentProps, popperCoreConfigProps, usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './components/popper/src/content.mjs';
|
|
117
|
-
export { popperArrowProps, usePopperArrowProps } from './components/popper/src/
|
|
117
|
+
export { popperArrowProps, usePopperArrowProps } from './components/popper/src/arrow.mjs';
|
|
118
118
|
export { POPPER_CONTENT_INJECTION_KEY, POPPER_INJECTION_KEY } from './components/popper/src/constants.mjs';
|
|
119
|
-
export { default as ElPopperArrow } from './components/popper/src/
|
|
119
|
+
export { default as ElPopperArrow } from './components/popper/src/arrow2.mjs';
|
|
120
120
|
export { default as ElPopperTrigger } from './components/popper/src/trigger2.mjs';
|
|
121
121
|
export { default as ElPopperContent } from './components/popper/src/content2.mjs';
|
|
122
122
|
export { ElPopper } from './components/popper/index.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20231211";
|
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.20231211'\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 autocomplete$1 = require('./src/
|
|
7
|
-
var autocomplete = require('./src/
|
|
6
|
+
var autocomplete$1 = require('./src/autocomplete2.js');
|
|
7
|
+
var autocomplete = require('./src/autocomplete.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAutocomplete = install.withInstall(autocomplete$1["default"]);
|
|
@@ -2,370 +2,91 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var lodashUnified = require('lodash-unified');
|
|
7
|
-
var core = require('@vueuse/core');
|
|
8
|
-
var iconsVue = require('@element-plus/icons-vue');
|
|
9
|
-
require('../../../hooks/index.js');
|
|
5
|
+
var shared = require('@vue/shared');
|
|
10
6
|
require('../../../utils/index.js');
|
|
7
|
+
require('../../tooltip/index.js');
|
|
11
8
|
require('../../../constants/index.js');
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var index$2 = require('../../tooltip/index.js');
|
|
15
|
-
var index$4 = require('../../icon/index.js');
|
|
16
|
-
require('../../form/index.js');
|
|
17
|
-
var autocomplete = require('./autocomplete2.js');
|
|
18
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
19
|
-
var index = require('../../../hooks/use-attrs/index.js');
|
|
20
|
-
var useFormCommonProps = require('../../form/src/hooks/use-form-common-props.js');
|
|
21
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
22
|
-
var rand = require('../../../utils/rand.js');
|
|
23
|
-
var shared = require('@vue/shared');
|
|
24
|
-
var error = require('../../../utils/error.js');
|
|
9
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
10
|
+
var content = require('../../tooltip/src/content.js');
|
|
25
11
|
var event = require('../../../constants/event.js');
|
|
26
12
|
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if (shared.isArray(props.fetchSuggestions)) {
|
|
94
|
-
cb(props.fetchSuggestions);
|
|
95
|
-
} else {
|
|
96
|
-
const result = await props.fetchSuggestions(queryString, cb);
|
|
97
|
-
if (shared.isArray(result))
|
|
98
|
-
cb(result);
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
const debouncedGetData = lodashUnified.debounce(getData, props.debounce);
|
|
102
|
-
const handleInput = (value) => {
|
|
103
|
-
const valuePresented = !!value;
|
|
104
|
-
emit(event.INPUT_EVENT, value);
|
|
105
|
-
emit(event.UPDATE_MODEL_EVENT, value);
|
|
106
|
-
suggestionDisabled.value = false;
|
|
107
|
-
activated.value || (activated.value = valuePresented);
|
|
108
|
-
if (!props.triggerOnFocus && !value) {
|
|
109
|
-
suggestionDisabled.value = true;
|
|
110
|
-
suggestions.value = [];
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
debouncedGetData(value);
|
|
114
|
-
};
|
|
115
|
-
const handleMouseDown = (event) => {
|
|
116
|
-
var _a;
|
|
117
|
-
if (disabled.value)
|
|
118
|
-
return;
|
|
119
|
-
if (((_a = event.target) == null ? void 0 : _a.tagName) !== "INPUT" || refInput.value.includes(document.activeElement)) {
|
|
120
|
-
activated.value = true;
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const handleChange = (value) => {
|
|
124
|
-
emit(event.CHANGE_EVENT, value);
|
|
125
|
-
};
|
|
126
|
-
const handleFocus = (evt) => {
|
|
127
|
-
if (!ignoreFocusEvent) {
|
|
128
|
-
activated.value = true;
|
|
129
|
-
emit("focus", evt);
|
|
130
|
-
if (props.triggerOnFocus && !readonly) {
|
|
131
|
-
debouncedGetData(String(props.modelValue));
|
|
132
|
-
}
|
|
133
|
-
} else {
|
|
134
|
-
ignoreFocusEvent = false;
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const handleBlur = (evt) => {
|
|
138
|
-
setTimeout(() => {
|
|
139
|
-
var _a;
|
|
140
|
-
if ((_a = popperRef.value) == null ? void 0 : _a.isFocusInsideContent()) {
|
|
141
|
-
ignoreFocusEvent = true;
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
activated.value && close();
|
|
145
|
-
emit("blur", evt);
|
|
146
|
-
});
|
|
147
|
-
};
|
|
148
|
-
const handleClear = () => {
|
|
149
|
-
activated.value = false;
|
|
150
|
-
emit(event.UPDATE_MODEL_EVENT, "");
|
|
151
|
-
emit("clear");
|
|
152
|
-
};
|
|
153
|
-
const handleKeyEnter = async () => {
|
|
154
|
-
if (suggestionVisible.value && highlightedIndex.value >= 0 && highlightedIndex.value < suggestions.value.length) {
|
|
155
|
-
handleSelect(suggestions.value[highlightedIndex.value]);
|
|
156
|
-
} else if (props.selectWhenUnmatched) {
|
|
157
|
-
emit("select", { value: props.modelValue });
|
|
158
|
-
suggestions.value = [];
|
|
159
|
-
highlightedIndex.value = -1;
|
|
160
|
-
}
|
|
161
|
-
};
|
|
162
|
-
const handleKeyEscape = (evt) => {
|
|
163
|
-
if (suggestionVisible.value) {
|
|
164
|
-
evt.preventDefault();
|
|
165
|
-
evt.stopPropagation();
|
|
166
|
-
close();
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
const close = () => {
|
|
170
|
-
activated.value = false;
|
|
171
|
-
};
|
|
172
|
-
const focus = () => {
|
|
173
|
-
var _a;
|
|
174
|
-
(_a = inputRef.value) == null ? void 0 : _a.focus();
|
|
175
|
-
};
|
|
176
|
-
const blur = () => {
|
|
177
|
-
var _a;
|
|
178
|
-
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
179
|
-
};
|
|
180
|
-
const handleSelect = async (item) => {
|
|
181
|
-
emit(event.INPUT_EVENT, item[props.valueKey]);
|
|
182
|
-
emit(event.UPDATE_MODEL_EVENT, item[props.valueKey]);
|
|
183
|
-
emit("select", item);
|
|
184
|
-
suggestions.value = [];
|
|
185
|
-
highlightedIndex.value = -1;
|
|
186
|
-
};
|
|
187
|
-
const highlight = (index) => {
|
|
188
|
-
if (!suggestionVisible.value || loading.value)
|
|
189
|
-
return;
|
|
190
|
-
if (index < 0) {
|
|
191
|
-
highlightedIndex.value = -1;
|
|
192
|
-
return;
|
|
193
|
-
}
|
|
194
|
-
if (index >= suggestions.value.length) {
|
|
195
|
-
index = suggestions.value.length - 1;
|
|
196
|
-
}
|
|
197
|
-
const suggestion = regionRef.value.querySelector(`.${ns.be("suggestion", "wrap")}`);
|
|
198
|
-
const suggestionList = suggestion.querySelectorAll(`.${ns.be("suggestion", "list")} li`);
|
|
199
|
-
const highlightItem = suggestionList[index];
|
|
200
|
-
const scrollTop = suggestion.scrollTop;
|
|
201
|
-
const { offsetTop, scrollHeight } = highlightItem;
|
|
202
|
-
if (offsetTop + scrollHeight > scrollTop + suggestion.clientHeight) {
|
|
203
|
-
suggestion.scrollTop += scrollHeight;
|
|
204
|
-
}
|
|
205
|
-
if (offsetTop < scrollTop) {
|
|
206
|
-
suggestion.scrollTop -= scrollHeight;
|
|
207
|
-
}
|
|
208
|
-
highlightedIndex.value = index;
|
|
209
|
-
inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
|
|
210
|
-
};
|
|
211
|
-
core.onClickOutside(listboxRef, () => {
|
|
212
|
-
suggestionVisible.value && close();
|
|
213
|
-
});
|
|
214
|
-
vue.onMounted(() => {
|
|
215
|
-
;
|
|
216
|
-
inputRef.value.ref.setAttribute("role", "textbox");
|
|
217
|
-
inputRef.value.ref.setAttribute("aria-autocomplete", "list");
|
|
218
|
-
inputRef.value.ref.setAttribute("aria-controls", "id");
|
|
219
|
-
inputRef.value.ref.setAttribute("aria-activedescendant", `${listboxId.value}-item-${highlightedIndex.value}`);
|
|
220
|
-
readonly = inputRef.value.ref.hasAttribute("readonly");
|
|
221
|
-
});
|
|
222
|
-
expose({
|
|
223
|
-
highlightedIndex,
|
|
224
|
-
activated,
|
|
225
|
-
loading,
|
|
226
|
-
inputRef,
|
|
227
|
-
popperRef,
|
|
228
|
-
suggestions,
|
|
229
|
-
handleSelect,
|
|
230
|
-
handleKeyEnter,
|
|
231
|
-
focus,
|
|
232
|
-
blur,
|
|
233
|
-
close,
|
|
234
|
-
highlight
|
|
235
|
-
});
|
|
236
|
-
return (_ctx, _cache) => {
|
|
237
|
-
return vue.openBlock(), vue.createBlock(vue.unref(index$2.ElTooltip), {
|
|
238
|
-
ref_key: "popperRef",
|
|
239
|
-
ref: popperRef,
|
|
240
|
-
visible: vue.unref(suggestionVisible),
|
|
241
|
-
placement: _ctx.placement,
|
|
242
|
-
"fallback-placements": ["bottom-start", "top-start"],
|
|
243
|
-
"popper-class": [vue.unref(ns).e("popper"), _ctx.popperClass],
|
|
244
|
-
teleported: _ctx.teleported,
|
|
245
|
-
"gpu-acceleration": false,
|
|
246
|
-
pure: "",
|
|
247
|
-
"manual-mode": "",
|
|
248
|
-
effect: "light",
|
|
249
|
-
trigger: "click",
|
|
250
|
-
transition: `${vue.unref(ns).namespace.value}-zoom-in-top`,
|
|
251
|
-
persistent: "",
|
|
252
|
-
role: "listbox",
|
|
253
|
-
onBeforeShow: onSuggestionShow,
|
|
254
|
-
onHide
|
|
255
|
-
}, {
|
|
256
|
-
content: vue.withCtx(() => [
|
|
257
|
-
vue.createElementVNode("div", {
|
|
258
|
-
ref_key: "regionRef",
|
|
259
|
-
ref: regionRef,
|
|
260
|
-
class: vue.normalizeClass([vue.unref(ns).b("suggestion"), vue.unref(ns).is("loading", vue.unref(suggestionLoading))]),
|
|
261
|
-
style: vue.normalizeStyle({
|
|
262
|
-
[_ctx.fitInputWidth ? "width" : "minWidth"]: dropdownWidth.value,
|
|
263
|
-
outline: "none"
|
|
264
|
-
}),
|
|
265
|
-
role: "region"
|
|
266
|
-
}, [
|
|
267
|
-
vue.createVNode(vue.unref(index$3.ElScrollbar), {
|
|
268
|
-
id: vue.unref(listboxId),
|
|
269
|
-
tag: "ul",
|
|
270
|
-
"wrap-class": vue.unref(ns).be("suggestion", "wrap"),
|
|
271
|
-
"view-class": vue.unref(ns).be("suggestion", "list"),
|
|
272
|
-
role: "listbox"
|
|
273
|
-
}, {
|
|
274
|
-
default: vue.withCtx(() => [
|
|
275
|
-
vue.unref(suggestionLoading) ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_2, [
|
|
276
|
-
vue.createVNode(vue.unref(index$4.ElIcon), {
|
|
277
|
-
class: vue.normalizeClass(vue.unref(ns).is("loading"))
|
|
278
|
-
}, {
|
|
279
|
-
default: vue.withCtx(() => [
|
|
280
|
-
vue.createVNode(vue.unref(iconsVue.Loading))
|
|
281
|
-
]),
|
|
282
|
-
_: 1
|
|
283
|
-
}, 8, ["class"])
|
|
284
|
-
])) : (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 1 }, vue.renderList(suggestions.value, (item, index) => {
|
|
285
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
286
|
-
id: `${vue.unref(listboxId)}-item-${index}`,
|
|
287
|
-
key: index,
|
|
288
|
-
class: vue.normalizeClass({ highlighted: highlightedIndex.value === index }),
|
|
289
|
-
role: "option",
|
|
290
|
-
"aria-selected": highlightedIndex.value === index,
|
|
291
|
-
onClick: ($event) => handleSelect(item)
|
|
292
|
-
}, [
|
|
293
|
-
vue.renderSlot(_ctx.$slots, "default", { item }, () => [
|
|
294
|
-
vue.createTextVNode(vue.toDisplayString(item[_ctx.valueKey]), 1)
|
|
295
|
-
])
|
|
296
|
-
], 10, _hoisted_3);
|
|
297
|
-
}), 128))
|
|
298
|
-
]),
|
|
299
|
-
_: 3
|
|
300
|
-
}, 8, ["id", "wrap-class", "view-class"])
|
|
301
|
-
], 6)
|
|
302
|
-
]),
|
|
303
|
-
default: vue.withCtx(() => [
|
|
304
|
-
vue.createElementVNode("div", {
|
|
305
|
-
ref_key: "listboxRef",
|
|
306
|
-
ref: listboxRef,
|
|
307
|
-
class: vue.normalizeClass([vue.unref(ns).b(), _ctx.$attrs.class]),
|
|
308
|
-
style: vue.normalizeStyle(vue.unref(styles)),
|
|
309
|
-
role: "combobox",
|
|
310
|
-
"aria-haspopup": "listbox",
|
|
311
|
-
"aria-expanded": vue.unref(suggestionVisible),
|
|
312
|
-
"aria-owns": vue.unref(listboxId)
|
|
313
|
-
}, [
|
|
314
|
-
vue.createVNode(vue.unref(index$5.ElInput), vue.mergeProps({
|
|
315
|
-
ref_key: "inputRef",
|
|
316
|
-
ref: inputRef
|
|
317
|
-
}, vue.unref(attrs), {
|
|
318
|
-
clearable: _ctx.clearable,
|
|
319
|
-
disabled: vue.unref(disabled),
|
|
320
|
-
name: _ctx.name,
|
|
321
|
-
"model-value": _ctx.modelValue,
|
|
322
|
-
onInput: handleInput,
|
|
323
|
-
onChange: handleChange,
|
|
324
|
-
onFocus: handleFocus,
|
|
325
|
-
onBlur: handleBlur,
|
|
326
|
-
onClear: handleClear,
|
|
327
|
-
onKeydown: [
|
|
328
|
-
_cache[0] || (_cache[0] = vue.withKeys(vue.withModifiers(($event) => highlight(highlightedIndex.value - 1), ["prevent"]), ["up"])),
|
|
329
|
-
_cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers(($event) => highlight(highlightedIndex.value + 1), ["prevent"]), ["down"])),
|
|
330
|
-
vue.withKeys(handleKeyEnter, ["enter"]),
|
|
331
|
-
vue.withKeys(close, ["tab"]),
|
|
332
|
-
vue.withKeys(handleKeyEscape, ["esc"])
|
|
333
|
-
],
|
|
334
|
-
onMousedown: handleMouseDown
|
|
335
|
-
}), vue.createSlots({ _: 2 }, [
|
|
336
|
-
_ctx.$slots.prepend ? {
|
|
337
|
-
name: "prepend",
|
|
338
|
-
fn: vue.withCtx(() => [
|
|
339
|
-
vue.renderSlot(_ctx.$slots, "prepend")
|
|
340
|
-
])
|
|
341
|
-
} : void 0,
|
|
342
|
-
_ctx.$slots.append ? {
|
|
343
|
-
name: "append",
|
|
344
|
-
fn: vue.withCtx(() => [
|
|
345
|
-
vue.renderSlot(_ctx.$slots, "append")
|
|
346
|
-
])
|
|
347
|
-
} : void 0,
|
|
348
|
-
_ctx.$slots.prefix ? {
|
|
349
|
-
name: "prefix",
|
|
350
|
-
fn: vue.withCtx(() => [
|
|
351
|
-
vue.renderSlot(_ctx.$slots, "prefix")
|
|
352
|
-
])
|
|
353
|
-
} : void 0,
|
|
354
|
-
_ctx.$slots.suffix ? {
|
|
355
|
-
name: "suffix",
|
|
356
|
-
fn: vue.withCtx(() => [
|
|
357
|
-
vue.renderSlot(_ctx.$slots, "suffix")
|
|
358
|
-
])
|
|
359
|
-
} : void 0
|
|
360
|
-
]), 1040, ["clearable", "disabled", "name", "model-value", "onKeydown"])
|
|
361
|
-
], 14, _hoisted_1)
|
|
362
|
-
]),
|
|
363
|
-
_: 3
|
|
364
|
-
}, 8, ["visible", "placement", "popper-class", "teleported", "transition"]);
|
|
365
|
-
};
|
|
366
|
-
}
|
|
13
|
+
const autocompleteProps = runtime.buildProps({
|
|
14
|
+
valueKey: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: "value"
|
|
17
|
+
},
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: [String, Number],
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
debounce: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 300
|
|
25
|
+
},
|
|
26
|
+
placement: {
|
|
27
|
+
type: runtime.definePropType(String),
|
|
28
|
+
values: [
|
|
29
|
+
"top",
|
|
30
|
+
"top-start",
|
|
31
|
+
"top-end",
|
|
32
|
+
"bottom",
|
|
33
|
+
"bottom-start",
|
|
34
|
+
"bottom-end"
|
|
35
|
+
],
|
|
36
|
+
default: "bottom-start"
|
|
37
|
+
},
|
|
38
|
+
fetchSuggestions: {
|
|
39
|
+
type: runtime.definePropType([Function, Array]),
|
|
40
|
+
default: shared.NOOP
|
|
41
|
+
},
|
|
42
|
+
popperClass: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: ""
|
|
45
|
+
},
|
|
46
|
+
triggerOnFocus: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: true
|
|
49
|
+
},
|
|
50
|
+
selectWhenUnmatched: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
hideLoading: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
label: {
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
teleported: content.useTooltipContentProps.teleported,
|
|
62
|
+
highlightFirstItem: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
fitInputWidth: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
},
|
|
70
|
+
clearable: {
|
|
71
|
+
type: Boolean,
|
|
72
|
+
default: false
|
|
73
|
+
},
|
|
74
|
+
disabled: {
|
|
75
|
+
type: Boolean,
|
|
76
|
+
default: false
|
|
77
|
+
},
|
|
78
|
+
name: String
|
|
367
79
|
});
|
|
368
|
-
|
|
80
|
+
const autocompleteEmits = {
|
|
81
|
+
[event.UPDATE_MODEL_EVENT]: (value) => shared.isString(value),
|
|
82
|
+
[event.INPUT_EVENT]: (value) => shared.isString(value),
|
|
83
|
+
[event.CHANGE_EVENT]: (value) => shared.isString(value),
|
|
84
|
+
focus: (evt) => evt instanceof FocusEvent,
|
|
85
|
+
blur: (evt) => evt instanceof FocusEvent,
|
|
86
|
+
clear: () => true,
|
|
87
|
+
select: (item) => shared.isObject(item)
|
|
88
|
+
};
|
|
369
89
|
|
|
370
|
-
exports
|
|
90
|
+
exports.autocompleteEmits = autocompleteEmits;
|
|
91
|
+
exports.autocompleteProps = autocompleteProps;
|
|
371
92
|
//# sourceMappingURL=autocomplete.js.map
|