@pixelium/web-vue 0.0.2-fix → 0.0.3-alpha
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/README.md +42 -0
- package/README.zh.md +6 -3
- package/dist/font.css +1 -1
- package/dist/index.d.ts +1602 -248
- package/dist/normalize.css +2 -0
- package/dist/pixelium-vue-icon-hn.cjs +1 -1
- package/dist/pixelium-vue-icon-hn.css +2 -1
- package/dist/pixelium-vue-icon-hn.js +8533 -8154
- package/dist/pixelium-vue-icon-hn.umd.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.cjs +1 -1
- package/dist/pixelium-vue-icon-pa.css +2 -1
- package/dist/pixelium-vue-icon-pa.js +10625 -10143
- package/dist/pixelium-vue-icon-pa.umd.cjs +1 -1
- package/dist/pixelium-vue.cjs +2 -2
- package/dist/pixelium-vue.css +2 -1
- package/dist/pixelium-vue.js +7407 -5854
- package/dist/pixelium-vue.umd.cjs +2 -2
- package/es/aside/index.css +1 -0
- package/es/aside/index.js +46 -151
- package/es/auto-complete/draw.d.ts +1 -1
- package/es/auto-complete/draw.js +26 -51
- package/es/auto-complete/index.css +92 -32
- package/es/auto-complete/index.d.ts +12 -15
- package/es/auto-complete/index.js +338 -400
- package/es/auto-complete/type.d.ts +25 -13
- package/es/avatar/css.js +2 -0
- package/es/avatar/draw.d.ts +2 -0
- package/es/avatar/draw.js +11 -0
- package/es/avatar/index.css +49 -0
- package/es/avatar/index.d.ts +15 -0
- package/es/avatar/index.js +110 -0
- package/es/avatar/type.d.ts +34 -0
- package/es/button/draw.d.ts +4 -4
- package/es/button/draw.js +213 -297
- package/es/button/index.css +40 -30
- package/es/button/index.d.ts +0 -4
- package/es/button/index.js +230 -256
- package/es/button/type.d.ts +3 -3
- package/es/button-group/index.css +0 -3
- package/es/button-group/index.d.ts +1 -2
- package/es/button-group/index.js +59 -31
- package/es/button-group/type.d.ts +21 -4
- package/es/checkbox/css.js +2 -0
- package/es/checkbox/draw.d.ts +4 -0
- package/es/checkbox/draw.js +46 -0
- package/es/checkbox/index.css +85 -0
- package/es/checkbox/index.d.ts +31 -0
- package/es/checkbox/index.js +206 -0
- package/es/checkbox/type.d.ts +88 -0
- package/es/checkbox-group/css.js +2 -0
- package/es/checkbox-group/index.css +20 -0
- package/es/checkbox-group/index.d.ts +23 -0
- package/es/checkbox-group/index.js +84 -0
- package/es/checkbox-group/type.d.ts +78 -0
- package/es/col/index.d.ts +2 -2
- package/es/col/index.js +43 -58
- package/es/container/index.css +1 -0
- package/es/container/index.js +18 -31
- package/es/divider/index.js +39 -53
- package/es/empty/index.css +4 -4
- package/es/empty/index.js +16 -71
- package/es/entry.js +102 -0
- package/es/footer/index.css +1 -0
- package/es/footer/index.js +31 -40
- package/es/form/css.js +1 -0
- package/es/form/index.d.ts +27 -0
- package/es/form/index.js +125 -0
- package/es/form/type.d.ts +238 -0
- package/es/form/use-form.d.ts +4 -0
- package/es/form/use-form.js +48 -0
- package/es/form-item/css.js +2 -0
- package/es/form-item/index.css +77 -0
- package/es/form-item/index.d.ts +37 -0
- package/es/form-item/index.js +318 -0
- package/es/form-item/type.d.ts +96 -0
- package/es/grid/index.js +56 -75
- package/es/grid-item/css.js +0 -1
- package/es/grid-item/index.d.ts +1 -1
- package/es/grid-item/index.js +85 -121
- package/es/header/index.css +1 -0
- package/es/header/index.js +31 -40
- package/es/icon/index.js +44 -55
- package/es/icons/css-hn.js +0 -1
- package/es/icons/css-pa.js +0 -1
- package/es/icons/icon-hn.js +10337 -15986
- package/es/icons/icon-pa.js +12573 -17447
- package/es/image/css.js +2 -0
- package/es/image/index.css +69 -0
- package/es/image/index.d.ts +35 -0
- package/es/image/index.js +199 -0
- package/es/image/type.d.ts +126 -0
- package/es/index.css +1 -515
- package/es/index.d.ts +22 -2
- package/es/index.js +144 -123
- package/es/input/draw.d.ts +1 -1
- package/es/input/draw.js +26 -51
- package/es/input/index.css +85 -33
- package/es/input/index.d.ts +9 -16
- package/es/input/index.js +319 -423
- package/es/input/type.d.ts +3 -3
- package/es/input-group/index.css +0 -1
- package/es/input-group/index.d.ts +2 -2
- package/es/input-group/index.js +66 -37
- package/es/input-group/type.d.ts +16 -4
- package/es/input-group-label/draw.d.ts +1 -1
- package/es/input-group-label/draw.js +26 -51
- package/es/input-group-label/index.css +33 -22
- package/es/input-group-label/index.d.ts +1 -4
- package/es/input-group-label/index.js +104 -127
- package/es/input-group-label/type.d.ts +3 -3
- package/es/input-number/draw.d.ts +1 -1
- package/es/input-number/draw.js +26 -51
- package/es/input-number/index.css +90 -35
- package/es/input-number/index.d.ts +9 -16
- package/es/input-number/index.js +428 -536
- package/es/input-number/type.d.ts +3 -3
- package/es/input-tag/draw.d.ts +1 -1
- package/es/input-tag/draw.js +26 -48
- package/es/input-tag/index.css +100 -33
- package/es/input-tag/index.d.ts +7 -13
- package/es/input-tag/index.js +442 -467
- package/es/input-tag/type.d.ts +24 -13
- package/es/link/index.js +75 -106
- package/es/main/index.css +4 -0
- package/es/main/index.d.ts +4 -1
- package/es/main/index.js +15 -15
- package/es/main/type.d.ts +7 -0
- package/es/mask/index.js +94 -115
- package/es/message/index.css +1 -1
- package/es/message/index.js +168 -346
- package/es/message-box/css.js +1 -1
- package/es/message-box/index.js +98 -114
- package/es/message-box/message-box-wrapped.js +33 -46
- package/es/message-box/message-box.js +79 -111
- package/es/option-list/index.css +13 -13
- package/es/option-list/index.d.ts +4 -31
- package/es/option-list/index.js +99 -167
- package/es/option-list/type.d.ts +5 -1
- package/es/pixelate/pixel.d.ts +5 -0
- package/es/pixelate/pixel.js +70 -0
- package/es/pixelate/pixelate.worker.d.ts +1 -0
- package/es/popover/index.d.ts +13 -99
- package/es/popover/index.js +75 -238
- package/es/popover/type.d.ts +7 -2
- package/es/popup/css.js +1 -0
- package/es/popup/index.d.ts +210 -0
- package/es/popup/index.js +203 -0
- package/es/popup/type.d.ts +105 -0
- package/es/popup-content/draw.d.ts +2 -2
- package/es/popup-content/draw.js +98 -143
- package/es/popup-content/index.css +11 -11
- package/es/popup-content/index.d.ts +1 -0
- package/es/popup-content/index.js +253 -1576
- package/es/popup-content/type.d.ts +1 -0
- package/es/popup-trigger/index.d.ts +8 -2
- package/es/popup-trigger/index.js +122 -95
- package/es/popup-trigger/type.d.ts +4 -1
- package/es/popup-wrapper/css.js +2 -0
- package/es/popup-wrapper/index.css +14 -0
- package/es/popup-wrapper/index.d.ts +18 -0
- package/es/popup-wrapper/index.js +67 -0
- package/es/popup-wrapper/type.d.ts +9 -0
- package/es/radio/css.js +1 -0
- package/es/radio/draw.d.ts +4 -0
- package/es/radio/draw.js +47 -0
- package/es/radio/index.d.ts +30 -0
- package/es/radio/index.js +190 -0
- package/es/radio/style.css +73 -0
- package/es/radio/type.d.ts +76 -0
- package/es/radio-group/css.js +2 -0
- package/es/radio-group/index.css +20 -0
- package/es/radio-group/index.d.ts +23 -0
- package/es/radio-group/index.js +77 -0
- package/es/radio-group/type.d.ts +77 -0
- package/es/row/index.js +56 -70
- package/es/select/draw.d.ts +1 -1
- package/es/select/draw.js +26 -51
- package/es/select/index.css +118 -36
- package/es/select/index.d.ts +14 -16
- package/es/select/index.js +625 -675
- package/es/select/type.d.ts +60 -25
- package/es/share/const/event-bus-key.js +1 -6
- package/es/share/const/index.d.ts +4 -0
- package/es/share/const/index.js +22 -24
- package/es/share/const/provide-key.d.ts +5 -0
- package/es/share/const/provide-key.js +6 -5
- package/es/share/const/style.d.ts +6 -0
- package/es/share/const/style.js +7 -0
- package/es/share/hook/use-cancelable-delay.d.ts +1 -0
- package/es/share/hook/use-cancelable-delay.js +42 -0
- package/es/share/hook/use-click-outside-listener.d.ts +1 -1
- package/es/share/hook/use-click-outside-listener.js +28 -41
- package/es/share/hook/use-composition.js +17 -15
- package/es/share/hook/use-controlled-mode.d.ts +3 -3
- package/es/share/hook/use-controlled-mode.js +20 -23
- package/es/share/hook/use-dark-mode.js +51 -65
- package/es/share/hook/use-index-of-children.d.ts +2 -1
- package/es/share/hook/use-index-of-children.js +47 -45
- package/es/share/hook/use-lazy-load.d.ts +10 -0
- package/es/share/hook/use-lazy-load.js +133 -0
- package/es/share/hook/use-props-detect.d.ts +2 -0
- package/es/share/hook/use-resize-observer.d.ts +1 -2
- package/es/share/hook/use-resize-observer.js +28 -20
- package/es/share/hook/use-screen-width.js +27 -36
- package/es/share/hook/use-smooth-transition.d.ts +2 -0
- package/es/share/hook/use-smooth-transition.js +65 -0
- package/es/share/hook/use-textarea-height.js +86 -92
- package/es/share/hook/use-theme-mode.js +41 -42
- package/es/share/hook/use-transition-end.d.ts +2 -0
- package/es/share/hook/use-transition-end.js +12 -0
- package/es/share/hook/use-watch-global-css-var.js +12 -16
- package/es/share/hook/use-window-resize-listener.d.ts +1 -0
- package/es/share/hook/use-window-resize-listener.js +15 -0
- package/es/share/hook/use-z-index.js +30 -27
- package/es/share/style/index.css +5 -0
- package/es/share/type/index.d.ts +18 -3
- package/es/share/util/color.d.ts +5 -3
- package/es/share/util/color.js +156 -149
- package/es/share/util/common.d.ts +7 -2
- package/es/share/util/common.js +127 -65
- package/es/share/util/console.d.ts +3 -3
- package/es/share/util/console.js +10 -7
- package/es/share/util/dom.d.ts +19 -0
- package/es/share/util/dom.js +88 -0
- package/es/share/util/env.d.ts +1 -0
- package/es/share/util/env.js +5 -4
- package/es/share/util/event-bus.js +3 -20
- package/es/share/util/lru-cache.js +29 -33
- package/es/share/util/pixel.d.ts +4 -0
- package/es/share/util/plot.d.ts +8 -3
- package/es/share/util/plot.js +457 -229
- package/es/share/util/reactivity.d.ts +8 -0
- package/es/share/util/reactivity.js +23 -0
- package/es/share/util/render.js +31 -41
- package/es/share/util/theme.d.ts +3 -0
- package/es/share/util/theme.js +77 -57
- package/es/slider/css.js +2 -0
- package/es/slider/draw.d.ts +25 -0
- package/es/slider/draw.js +113 -0
- package/es/slider/index.css +119 -0
- package/es/slider/index.d.ts +66 -0
- package/es/slider/index.js +503 -0
- package/es/slider/type.d.ts +162 -0
- package/es/slider/util.d.ts +37 -0
- package/es/slider/util.js +130 -0
- package/es/space/index.css +24 -29
- package/es/space/index.js +73 -97
- package/es/spin/index.css +18 -17
- package/es/spin/index.js +72 -102
- package/es/spin/type.d.ts +11 -5
- package/es/switch/css.js +2 -0
- package/es/switch/draw.d.ts +2 -0
- package/es/switch/draw.js +18 -0
- package/es/switch/index.css +121 -0
- package/es/switch/index.d.ts +42 -0
- package/es/switch/index.js +259 -0
- package/es/switch/type.d.ts +133 -0
- package/es/tag/draw.d.ts +2 -2
- package/es/tag/draw.js +80 -127
- package/es/tag/index.css +38 -22
- package/es/tag/index.d.ts +2 -2
- package/es/tag/index.js +121 -190
- package/es/tag/type.d.ts +3 -3
- package/es/text-outline/css.js +2 -0
- package/es/text-outline/index.css +4 -0
- package/es/text-outline/index.d.ts +17 -0
- package/es/text-outline/index.js +33 -0
- package/es/text-outline/type.d.ts +23 -0
- package/es/textarea/draw.js +9 -11
- package/es/textarea/index.css +37 -23
- package/es/textarea/index.d.ts +8 -14
- package/es/textarea/index.js +274 -262
- package/es/tooltip/index.d.ts +100 -4
- package/es/tooltip/index.js +70 -226
- package/es/tooltip/type.d.ts +7 -2
- package/es/vendor.js +504 -0
- package/es/virtual-list/css.js +2 -0
- package/es/virtual-list/index.css +25 -0
- package/es/virtual-list/index.d.ts +11 -0
- package/es/virtual-list/index.js +313 -0
- package/es/virtual-list/type.d.ts +26 -0
- package/package.json +10 -16
- package/es/grid-item/index.css +0 -0
- /package/es/message-box/{message-box.css → index.css} +0 -0
|
@@ -1,402 +1,340 @@
|
|
|
1
1
|
import './css.js'
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
2
|
+
import { B as y, V as spinner_third_solid_default, l as times_circle_solid_default } from "../vendor.js";
|
|
3
|
+
import { r as GET_ELEMENT_RENDERED, t as BORDER_CORNER_RAD_RANGE } from "../share/const/index.js";
|
|
4
|
+
import { t as defaultFilter } from "../share/util/common.js";
|
|
5
|
+
import { i as canvasPreprocess, l as getBorderRadius, n as calcPixelSize, s as floodFill, t as calcBorderCornerCenter } from "../share/util/plot.js";
|
|
6
|
+
import { n as getGlobalThemeColor } from "../share/util/color.js";
|
|
7
|
+
import { t as useDarkMode } from "../share/hook/use-dark-mode.js";
|
|
8
|
+
import { t as useResizeObserver } from "../share/hook/use-resize-observer.js";
|
|
9
|
+
import { i as INPUT_GROUP_UPDATE } from "../share/const/event-bus-key.js";
|
|
10
|
+
import { t as useWatchGlobalCssVal } from "../share/hook/use-watch-global-css-var.js";
|
|
11
|
+
import { n as useIndexOfChildren } from "../share/hook/use-index-of-children.js";
|
|
12
|
+
import { i as FORM_ITEM_PROVIDE, s as INPUT_GROUP_PROVIDE } from "../share/const/provide-key.js";
|
|
13
|
+
import { t as createProvideComputed } from "../share/util/reactivity.js";
|
|
14
|
+
import { t as useTransitionEnd } from "../share/hook/use-transition-end.js";
|
|
15
|
+
import { t as useComposition } from "../share/hook/use-composition.js";
|
|
16
|
+
import { t as useControlledMode } from "../share/hook/use-controlled-mode.js";
|
|
17
|
+
import { t as popover_default } from "../popover/index.js";
|
|
18
|
+
import { t as empty_default } from "../empty/index.js";
|
|
19
|
+
import { t as drawBorder } from "./draw.js";
|
|
20
|
+
import { t as option_list_default } from "../option-list/index.js";
|
|
21
|
+
import { Fragment, computed, createVNode, defineComponent, getCurrentInstance, h, inject, nextTick, onMounted, ref, shallowRef, useAttrs, useSlots, watch } from "vue";
|
|
22
|
+
var auto_complete_default = /* @__PURE__ */ defineComponent({
|
|
23
|
+
name: "AutoComplete",
|
|
24
|
+
__name: "index",
|
|
25
|
+
props: {
|
|
26
|
+
modelValue: null,
|
|
27
|
+
defaultValue: null,
|
|
28
|
+
options: { default: () => [] },
|
|
29
|
+
placeholder: null,
|
|
30
|
+
disabled: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false
|
|
33
|
+
},
|
|
34
|
+
readonly: {
|
|
35
|
+
type: Boolean,
|
|
36
|
+
default: false
|
|
37
|
+
},
|
|
38
|
+
clearable: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: false
|
|
41
|
+
},
|
|
42
|
+
loading: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false
|
|
45
|
+
},
|
|
46
|
+
size: null,
|
|
47
|
+
shape: null,
|
|
48
|
+
showPopoverEmpty: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: false
|
|
51
|
+
},
|
|
52
|
+
shouldShowPopover: { type: Function },
|
|
53
|
+
filter: { type: Function },
|
|
54
|
+
append: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
virtualScroll: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
virtualListProps: null,
|
|
63
|
+
borderRadius: null,
|
|
64
|
+
status: { default: "normal" },
|
|
65
|
+
autofocus: { type: Boolean },
|
|
66
|
+
optionsDestroyOnHide: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: false
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
emits: [
|
|
72
|
+
"input",
|
|
73
|
+
"update:modelValue",
|
|
74
|
+
"change",
|
|
75
|
+
"clear",
|
|
76
|
+
"blur",
|
|
77
|
+
"focus",
|
|
78
|
+
"select"
|
|
79
|
+
],
|
|
80
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
81
|
+
var _instance$parent;
|
|
82
|
+
const attrs = useAttrs();
|
|
83
|
+
const props = __props;
|
|
84
|
+
const emits = __emit;
|
|
85
|
+
const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({ afterComposition: (e) => {
|
|
86
|
+
nextTick(() => {
|
|
87
|
+
inputHandler(e);
|
|
88
|
+
});
|
|
89
|
+
} });
|
|
90
|
+
const instance = getCurrentInstance();
|
|
91
|
+
const innerInputGroup = ref((instance === null || instance === void 0 || (_instance$parent = instance.parent) === null || _instance$parent === void 0 ? void 0 : _instance$parent.type.name) === "InputGroup");
|
|
92
|
+
const [index, first, last] = innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE, (instance$1) => {
|
|
93
|
+
var _instance$vnode$el;
|
|
94
|
+
return instance$1 === null || instance$1 === void 0 || (_instance$vnode$el = instance$1.vnode.el) === null || _instance$vnode$el === void 0 ? void 0 : _instance$vnode$el.nextElementSibling;
|
|
95
|
+
}) : [
|
|
96
|
+
ref(0),
|
|
97
|
+
ref(false),
|
|
98
|
+
ref(false)
|
|
99
|
+
];
|
|
100
|
+
const inputGroupProvide = inject(INPUT_GROUP_PROVIDE, void 0);
|
|
101
|
+
const formItemProvide = inject(FORM_ITEM_PROVIDE, void 0);
|
|
102
|
+
const borderRadiusComputed = createProvideComputed("borderRadius", [innerInputGroup.value && inputGroupProvide, props]);
|
|
103
|
+
const sizeComputed = createProvideComputed("size", () => [
|
|
104
|
+
innerInputGroup.value && inputGroupProvide,
|
|
105
|
+
props.size && props,
|
|
106
|
+
formItemProvide,
|
|
107
|
+
props
|
|
108
|
+
], "nullish", (val) => val || "medium");
|
|
109
|
+
const shapeComputed = createProvideComputed("shape", [innerInputGroup.value && inputGroupProvide, props], "nullish", (val) => val || "rect");
|
|
110
|
+
const disabledComputed = createProvideComputed("disabled", [
|
|
111
|
+
formItemProvide,
|
|
112
|
+
innerInputGroup.value && inputGroupProvide,
|
|
113
|
+
props
|
|
114
|
+
], "or");
|
|
115
|
+
const readonlyComputed = createProvideComputed("readonly", [
|
|
116
|
+
formItemProvide,
|
|
117
|
+
innerInputGroup.value && inputGroupProvide,
|
|
118
|
+
props
|
|
119
|
+
], "or");
|
|
120
|
+
const statusComputed = createProvideComputed("status", [formItemProvide, props]);
|
|
121
|
+
const nextIsTextButton = computed(() => {
|
|
122
|
+
if (index.value >= 0) {
|
|
123
|
+
var _inputGroupProvide$ch;
|
|
124
|
+
return innerInputGroup.value ? !!((inputGroupProvide === null || inputGroupProvide === void 0 || (_inputGroupProvide$ch = inputGroupProvide.childrenInfo.value.find((e) => e.index === index.value + 1)) === null || _inputGroupProvide$ch === void 0 ? void 0 : _inputGroupProvide$ch.variant) === "text") : false;
|
|
125
|
+
} else return false;
|
|
126
|
+
});
|
|
127
|
+
const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
|
|
128
|
+
defaultField: "defaultValue",
|
|
129
|
+
transform: (e) => {
|
|
130
|
+
return e || "";
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
const wrapperRef = shallowRef(null);
|
|
134
|
+
const canvasRef = shallowRef(null);
|
|
135
|
+
const inputRef = shallowRef(null);
|
|
136
|
+
const triggerPopover = async () => {
|
|
137
|
+
await nextTick();
|
|
138
|
+
if (props.shouldShowPopover) {
|
|
139
|
+
popoverVisible.value = !!props.shouldShowPopover(modelValue.value || "", optionsFiltered.value);
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (modelValue.value && (!props.showPopoverEmpty && optionsFiltered.value.length || props.showPopoverEmpty)) popoverVisible.value = true;
|
|
143
|
+
else popoverVisible.value = false;
|
|
144
|
+
};
|
|
145
|
+
const inputHandler = async (e) => {
|
|
146
|
+
e.stopPropagation();
|
|
147
|
+
const newValue = e.target.value;
|
|
148
|
+
modelValue.value = newValue;
|
|
149
|
+
if (isComposing.value) return;
|
|
150
|
+
emits("input", newValue, e);
|
|
151
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.inputHandler();
|
|
152
|
+
await updateModelValue(newValue);
|
|
153
|
+
triggerPopover();
|
|
154
|
+
};
|
|
155
|
+
const clearHandler = async () => {
|
|
156
|
+
await updateModelValue("");
|
|
157
|
+
emits("change", "");
|
|
158
|
+
emits("clear", "");
|
|
159
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
|
|
160
|
+
};
|
|
161
|
+
const changeHandler = (e) => {
|
|
162
|
+
e.stopPropagation();
|
|
163
|
+
const target = e.target;
|
|
164
|
+
emits("change", target.value, e);
|
|
165
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
|
|
166
|
+
};
|
|
167
|
+
const focusMode = ref(false);
|
|
168
|
+
const blurHandler = (e) => {
|
|
169
|
+
e.stopPropagation();
|
|
170
|
+
emits("blur", e);
|
|
171
|
+
focusMode.value = false;
|
|
172
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.blurHandler();
|
|
173
|
+
};
|
|
174
|
+
const focusHandler = (e) => {
|
|
175
|
+
e.stopPropagation();
|
|
176
|
+
emits("focus", e);
|
|
177
|
+
focusMode.value = true;
|
|
178
|
+
};
|
|
179
|
+
const focusInputHandler = () => {
|
|
180
|
+
var _inputRef$value;
|
|
181
|
+
(_inputRef$value = inputRef.value) === null || _inputRef$value === void 0 || _inputRef$value.focus();
|
|
182
|
+
};
|
|
183
|
+
const hoverFlag = ref(false);
|
|
184
|
+
const mouseenterHandler = () => {
|
|
185
|
+
hoverFlag.value = true;
|
|
186
|
+
};
|
|
187
|
+
const mouseleaveHandler = () => {
|
|
188
|
+
hoverFlag.value = false;
|
|
189
|
+
};
|
|
190
|
+
const showClose = computed(() => {
|
|
191
|
+
return props.clearable && !disabledComputed.value && !readonlyComputed.value;
|
|
192
|
+
});
|
|
193
|
+
const selectHandler = async (value, option, e) => {
|
|
194
|
+
const nextValue = props.append ? modelValue.value + value : value;
|
|
195
|
+
await updateModelValue(nextValue);
|
|
196
|
+
popoverVisible.value = false;
|
|
197
|
+
emits("select", nextValue, option, e);
|
|
198
|
+
emits("change", nextValue, e);
|
|
199
|
+
formItemProvide === null || formItemProvide === void 0 || formItemProvide.changeHandler();
|
|
200
|
+
};
|
|
201
|
+
const slots = useSlots();
|
|
202
|
+
const optionsFiltered = computed(() => {
|
|
203
|
+
if (props.filter) return props.filter(modelValue.value || "", props.options || []);
|
|
204
|
+
if (!modelValue.value || !modelValue.value.trim()) return [];
|
|
205
|
+
return defaultFilter(modelValue.value, props.options || []);
|
|
206
|
+
});
|
|
207
|
+
__expose({
|
|
208
|
+
focus: () => {
|
|
209
|
+
var _inputRef$value2;
|
|
210
|
+
(_inputRef$value2 = inputRef.value) === null || _inputRef$value2 === void 0 || _inputRef$value2.focus();
|
|
211
|
+
},
|
|
212
|
+
blur: () => {
|
|
213
|
+
var _inputRef$value3;
|
|
214
|
+
(_inputRef$value3 = inputRef.value) === null || _inputRef$value3 === void 0 || _inputRef$value3.blur();
|
|
215
|
+
},
|
|
216
|
+
clear: () => clearHandler(),
|
|
217
|
+
select: () => {
|
|
218
|
+
var _inputRef$value4;
|
|
219
|
+
(_inputRef$value4 = inputRef.value) === null || _inputRef$value4 === void 0 || _inputRef$value4.select();
|
|
220
|
+
},
|
|
221
|
+
[GET_ELEMENT_RENDERED]: () => wrapperRef.value
|
|
222
|
+
});
|
|
223
|
+
const popoverVisible = ref(false);
|
|
224
|
+
const popoverVisibleUpdateHandler = (value) => {
|
|
225
|
+
if (!value) popoverVisible.value = value;
|
|
226
|
+
};
|
|
227
|
+
watch([
|
|
228
|
+
first,
|
|
229
|
+
last,
|
|
230
|
+
borderRadiusComputed,
|
|
231
|
+
shapeComputed,
|
|
232
|
+
sizeComputed,
|
|
233
|
+
disabledComputed,
|
|
234
|
+
() => slots,
|
|
235
|
+
useDarkMode(),
|
|
236
|
+
focusMode,
|
|
237
|
+
hoverFlag,
|
|
238
|
+
readonlyComputed,
|
|
239
|
+
statusComputed,
|
|
240
|
+
nextIsTextButton
|
|
241
|
+
], () => {
|
|
242
|
+
setTimeout(() => {
|
|
243
|
+
drawPixel();
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
const drawPixel = () => {
|
|
247
|
+
const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
|
|
248
|
+
if (!preprocessData) return;
|
|
249
|
+
const { ctx, width, height, canvas } = preprocessData;
|
|
250
|
+
const pixelSize = calcPixelSize();
|
|
251
|
+
const borderRadius = getBorderRadius(canvas, pixelSize, borderRadiusComputed.value, shapeComputed.value || "rect", sizeComputed.value || "medium", innerInputGroup.value, first.value, last.value);
|
|
252
|
+
const borderColor = statusComputed.value !== "normal" ? getGlobalThemeColor(statusComputed.value === "error" ? "danger" : statusComputed.value, 6) : (hoverFlag.value || focusMode.value) && !disabledComputed.value && !readonlyComputed.value ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
|
|
253
|
+
const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize);
|
|
254
|
+
const rad = BORDER_CORNER_RAD_RANGE;
|
|
255
|
+
if (borderColor) drawBorder(ctx, width, height, center, borderRadius, rad, borderColor, pixelSize, innerInputGroup.value, first.value, last.value, nextIsTextButton.value);
|
|
256
|
+
const backgroundColor = disabledComputed.value ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
|
|
257
|
+
if (backgroundColor) floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
|
|
258
|
+
};
|
|
259
|
+
onMounted(() => {
|
|
260
|
+
nextTick(() => {
|
|
261
|
+
drawPixel();
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
useResizeObserver(wrapperRef, drawPixel);
|
|
265
|
+
useWatchGlobalCssVal(drawPixel);
|
|
266
|
+
useTransitionEnd(wrapperRef, drawPixel);
|
|
267
|
+
return () => {
|
|
268
|
+
const Inner = createVNode(Fragment, null, [
|
|
269
|
+
slots.prefix && createVNode("div", { "class": "px-auto-complete-prefix-wrapper" }, [slots.prefix()]),
|
|
270
|
+
createVNode("input", {
|
|
271
|
+
"ref": inputRef,
|
|
272
|
+
"class": "px-auto-complete-inner",
|
|
273
|
+
"value": modelValue.value,
|
|
274
|
+
"placeholder": props.placeholder,
|
|
275
|
+
"disabled": disabledComputed.value || readonlyComputed.value,
|
|
276
|
+
"autofocus": props.autofocus,
|
|
277
|
+
"onInput": inputHandler,
|
|
278
|
+
"onChange": changeHandler,
|
|
279
|
+
"onCompositionstart": compositionStartHandler,
|
|
280
|
+
"onCompositionend": compositionUpdateHandler
|
|
281
|
+
}, null),
|
|
282
|
+
showClose.value && createVNode("div", { "class": "px-auto-complete-close-wrapper" }, [hoverFlag.value && modelValue.value ? createVNode(times_circle_solid_default, {
|
|
283
|
+
"class": "px-auto-complete-icon",
|
|
284
|
+
"onClick": clearHandler
|
|
285
|
+
}, null) : createVNode("div", { "class": "px-auto-complete-icon-placeholder" }, null)]),
|
|
286
|
+
props.loading && createVNode("div", { "class": "px-auto-complete-loading-wrapper" }, [createVNode(spinner_third_solid_default, { "class": "px-auto-complete-icon px-animation__loading" }, null)]),
|
|
287
|
+
slots.suffix && createVNode("div", { "class": "px-auto-complete-suffix-wrapper" }, [slots.suffix()]),
|
|
288
|
+
createVNode("canvas", {
|
|
289
|
+
"ref": canvasRef,
|
|
290
|
+
"class": "px-auto-complete-canvas"
|
|
291
|
+
}, null)
|
|
292
|
+
]);
|
|
293
|
+
const scopeObj = {};
|
|
294
|
+
const scopeId = instance === null || instance === void 0 ? void 0 : instance.vnode.scopeId;
|
|
295
|
+
const parentScopeId = instance === null || instance === void 0 ? void 0 : instance.vnode.scopeId;
|
|
296
|
+
if (scopeId) scopeObj[scopeId] = "";
|
|
297
|
+
if (parentScopeId) scopeObj[parentScopeId] = "";
|
|
298
|
+
const pixelSize = calcPixelSize();
|
|
299
|
+
return createVNode(popover_default, {
|
|
300
|
+
"placement": "bottom",
|
|
301
|
+
"offset": 0,
|
|
302
|
+
"width-equal": true,
|
|
303
|
+
"arrow": false,
|
|
304
|
+
"visible": popoverVisible.value,
|
|
305
|
+
"onUpdate:visible": popoverVisibleUpdateHandler,
|
|
306
|
+
"trigger": "click",
|
|
307
|
+
"contentStyle": { padding: `${pixelSize}px` },
|
|
308
|
+
"destroyOnHide": props.optionsDestroyOnHide
|
|
309
|
+
}, {
|
|
310
|
+
default: () => h("div", {
|
|
311
|
+
ref: wrapperRef,
|
|
312
|
+
class: [
|
|
313
|
+
"pixelium px-auto-complete",
|
|
314
|
+
sizeComputed.value && `px-auto-complete__${sizeComputed.value}`,
|
|
315
|
+
shapeComputed.value && `px-auto-complete__${shapeComputed.value}`,
|
|
316
|
+
{ "px-auto-complete__inner": innerInputGroup.value },
|
|
317
|
+
{ "px-auto-complete__disabled": disabledComputed.value }
|
|
318
|
+
],
|
|
319
|
+
onClick: focusInputHandler,
|
|
320
|
+
onMouseenter: mouseenterHandler,
|
|
321
|
+
onMouseleave: mouseleaveHandler,
|
|
322
|
+
onFocusout: blurHandler,
|
|
323
|
+
onFocusin: focusHandler,
|
|
324
|
+
...scopeObj,
|
|
325
|
+
...attrs
|
|
326
|
+
}, [Inner]),
|
|
327
|
+
content: () => optionsFiltered.value.length ? createVNode(option_list_default, {
|
|
328
|
+
"options": optionsFiltered.value,
|
|
329
|
+
"onSelect": selectHandler,
|
|
330
|
+
"virtualScroll": props.virtualScroll,
|
|
331
|
+
"virtualListProps": props.virtualListProps
|
|
332
|
+
}, {
|
|
333
|
+
"group-label": ({ option }) => slots["group-label"] ? slots["group-label"]({ option }) : option.label,
|
|
334
|
+
option: ({ option }) => slots.option ? slots.option({ option }) : y(option) ? option : option.label
|
|
335
|
+
}) : createVNode("div", { "class": "px-auto-complete-empty" }, [createVNode(empty_default, null, null)])
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
}
|
|
51
339
|
});
|
|
52
|
-
|
|
53
|
-
props: {
|
|
54
|
-
size: {},
|
|
55
|
-
color: {}
|
|
56
|
-
},
|
|
57
|
-
setup(__props) {
|
|
58
|
-
const props = __props;
|
|
59
|
-
return (_ctx, _cache) => {
|
|
60
|
-
return openBlock(), createElementBlock(
|
|
61
|
-
"svg",
|
|
62
|
-
{
|
|
63
|
-
class: "px-icon-hn",
|
|
64
|
-
style: normalizeStyle({ color: props.color, fontSize: props.size + "px" }),
|
|
65
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
66
|
-
viewBox: "0 0 24 24"
|
|
67
|
-
},
|
|
68
|
-
[..._cache[0] || (_cache[0] = [
|
|
69
|
-
createElementVNode(
|
|
70
|
-
"path",
|
|
71
|
-
{ d: "M22 9V7h-1V5h-1V4h-1V3h-2V2h-2V1H9v1H7v1H5v1H4v1H3v2H2v2H1v6h1v2h1v2h1v1h1v1h2v1h2v1h6v-1h2v-1h2v-1h1v-1h1v-2h1v-2h1V9zm-8 7v-1h-1v-1h-2v1h-1v1H9v1H8v-1H7v-1h1v-1h1v-1h1v-2H9v-1H8V9H7V8h1V7h1v1h1v1h1v1h2V9h1V8h1V7h1v1h1v1h-1v1h-1v1h-1v2h1v1h1v1h1v1h-1v1h-1v-1z" },
|
|
72
|
-
null,
|
|
73
|
-
-1
|
|
74
|
-
/* CACHED */
|
|
75
|
-
)
|
|
76
|
-
])],
|
|
77
|
-
4
|
|
78
|
-
/* STYLE */
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
84
|
-
...{
|
|
85
|
-
name: "AutoComplete"
|
|
86
|
-
},
|
|
87
|
-
__name: "index",
|
|
88
|
-
props: {
|
|
89
|
-
modelValue: null,
|
|
90
|
-
defaultValue: null,
|
|
91
|
-
options: {
|
|
92
|
-
default: () => []
|
|
93
|
-
},
|
|
94
|
-
placeholder: null,
|
|
95
|
-
disabled: {
|
|
96
|
-
type: Boolean,
|
|
97
|
-
default: false
|
|
98
|
-
},
|
|
99
|
-
readonly: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: false
|
|
102
|
-
},
|
|
103
|
-
clearable: {
|
|
104
|
-
type: Boolean,
|
|
105
|
-
default: false
|
|
106
|
-
},
|
|
107
|
-
loading: {
|
|
108
|
-
type: Boolean,
|
|
109
|
-
default: false
|
|
110
|
-
},
|
|
111
|
-
showPopoverEmpty: {
|
|
112
|
-
type: Boolean,
|
|
113
|
-
default: false
|
|
114
|
-
},
|
|
115
|
-
shouldShowPopover: {
|
|
116
|
-
type: Function
|
|
117
|
-
},
|
|
118
|
-
filter: {
|
|
119
|
-
type: Function
|
|
120
|
-
},
|
|
121
|
-
append: {
|
|
122
|
-
type: Boolean,
|
|
123
|
-
default: false
|
|
124
|
-
},
|
|
125
|
-
size: {
|
|
126
|
-
default: "medium"
|
|
127
|
-
},
|
|
128
|
-
shape: {
|
|
129
|
-
default: "default"
|
|
130
|
-
},
|
|
131
|
-
borderRadius: null,
|
|
132
|
-
status: {
|
|
133
|
-
default: "normal"
|
|
134
|
-
},
|
|
135
|
-
autofocus: {
|
|
136
|
-
type: Boolean
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
emits: ["input", "update:modelValue", "change", "clear", "blur", "focus", "select"],
|
|
140
|
-
setup(__props, {
|
|
141
|
-
expose: __expose,
|
|
142
|
-
emit: __emit
|
|
143
|
-
}) {
|
|
144
|
-
var _a;
|
|
145
|
-
const attrs = useAttrs();
|
|
146
|
-
const pixelSize = calcPixelSize();
|
|
147
|
-
const props = __props;
|
|
148
|
-
const emits = __emit;
|
|
149
|
-
const [isComposing, compositionStartHandler, compositionUpdateHandler] = useComposition({
|
|
150
|
-
afterComposition: (e) => {
|
|
151
|
-
nextTick(() => {
|
|
152
|
-
inputHandler(e);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
const instance = getCurrentInstance();
|
|
157
|
-
const innerInputGroup = ref(((_a = instance == null ? void 0 : instance.parent) == null ? void 0 : _a.type) === _sfc_main$1);
|
|
158
|
-
const [_, first, last] = innerInputGroup.value ? useIndexOfChildren(INPUT_GROUP_UPDATE) : [ref(0), ref(false), ref(false)];
|
|
159
|
-
const inputGroupProps = inject(INPUT_GROUP_PROVIDE);
|
|
160
|
-
const borderRadiusComputed = computed(() => {
|
|
161
|
-
return innerInputGroup.value && inputGroupProps ? inputGroupProps.borderRadius : props.borderRadius;
|
|
162
|
-
});
|
|
163
|
-
const sizeComputed = computed(() => {
|
|
164
|
-
return innerInputGroup.value && inputGroupProps ? inputGroupProps.size : props.size;
|
|
165
|
-
});
|
|
166
|
-
const shapeComputed = computed(() => {
|
|
167
|
-
return innerInputGroup.value && inputGroupProps ? inputGroupProps.shape : props.shape;
|
|
168
|
-
});
|
|
169
|
-
const disabledComputed = computed(() => {
|
|
170
|
-
return innerInputGroup.value && inputGroupProps ? inputGroupProps.disabled || props.disabled : props.disabled;
|
|
171
|
-
});
|
|
172
|
-
const [modelValue, updateModelValue] = useControlledMode("modelValue", props, emits, {
|
|
173
|
-
defaultField: "defaultValue",
|
|
174
|
-
transform: (e) => {
|
|
175
|
-
return e || "";
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
const wrapperRef = shallowRef(null);
|
|
179
|
-
const canvasRef = shallowRef(null);
|
|
180
|
-
const inputRef = shallowRef(null);
|
|
181
|
-
const triggerPopover = async () => {
|
|
182
|
-
await nextTick();
|
|
183
|
-
if (props.shouldShowPopover) {
|
|
184
|
-
popoverVisible.value = !!props.shouldShowPopover(modelValue.value || "", optionsFiltered.value);
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
if (modelValue.value && (!props.showPopoverEmpty && optionsFiltered.value.length || props.showPopoverEmpty)) {
|
|
188
|
-
popoverVisible.value = true;
|
|
189
|
-
} else {
|
|
190
|
-
popoverVisible.value = false;
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
const closePopover = async () => {
|
|
194
|
-
popoverVisible.value = false;
|
|
195
|
-
};
|
|
196
|
-
const inputHandler = async (e) => {
|
|
197
|
-
e.stopPropagation();
|
|
198
|
-
const target = e.target;
|
|
199
|
-
const newValue = target.value;
|
|
200
|
-
modelValue.value = newValue;
|
|
201
|
-
if (isComposing.value) {
|
|
202
|
-
return;
|
|
203
|
-
}
|
|
204
|
-
emits("input", newValue, e);
|
|
205
|
-
await updateModelValue(newValue);
|
|
206
|
-
triggerPopover();
|
|
207
|
-
};
|
|
208
|
-
const clearHandler = async () => {
|
|
209
|
-
await updateModelValue("");
|
|
210
|
-
emits("change", "");
|
|
211
|
-
emits("clear", "");
|
|
212
|
-
};
|
|
213
|
-
const changeHandler = (e) => {
|
|
214
|
-
e.stopPropagation();
|
|
215
|
-
const target = e.target;
|
|
216
|
-
emits("change", target.value, e);
|
|
217
|
-
};
|
|
218
|
-
const focusMode = ref(false);
|
|
219
|
-
const blurHandler = () => {
|
|
220
|
-
focusMode.value = false;
|
|
221
|
-
};
|
|
222
|
-
const focusHandler = () => {
|
|
223
|
-
focusMode.value = true;
|
|
224
|
-
};
|
|
225
|
-
const focusInputHandler = () => {
|
|
226
|
-
var _a2;
|
|
227
|
-
(_a2 = inputRef.value) == null ? void 0 : _a2.focus();
|
|
228
|
-
};
|
|
229
|
-
const hoverFlag = ref(false);
|
|
230
|
-
const mouseenterHandler = () => {
|
|
231
|
-
hoverFlag.value = true;
|
|
232
|
-
};
|
|
233
|
-
const mouseleaveHandler = () => {
|
|
234
|
-
hoverFlag.value = false;
|
|
235
|
-
};
|
|
236
|
-
const showClose = computed(() => {
|
|
237
|
-
return props.clearable && !disabledComputed.value && !props.readonly;
|
|
238
|
-
});
|
|
239
|
-
const selectHandler = async (value, option, e) => {
|
|
240
|
-
const nextValue = props.append ? modelValue.value + value : value;
|
|
241
|
-
await updateModelValue(nextValue);
|
|
242
|
-
closePopover();
|
|
243
|
-
emits("select", nextValue, option, e);
|
|
244
|
-
};
|
|
245
|
-
const slots = useSlots();
|
|
246
|
-
const optionsFiltered = computed(() => {
|
|
247
|
-
if (props.filter) {
|
|
248
|
-
return props.filter(modelValue.value || "", props.options || []);
|
|
249
|
-
}
|
|
250
|
-
if (!modelValue.value || !modelValue.value.trim()) {
|
|
251
|
-
return [];
|
|
252
|
-
}
|
|
253
|
-
return defaultFilter(modelValue.value, props.options || []);
|
|
254
|
-
});
|
|
255
|
-
__expose({
|
|
256
|
-
focus: () => {
|
|
257
|
-
var _a2;
|
|
258
|
-
(_a2 = inputRef.value) == null ? void 0 : _a2.focus();
|
|
259
|
-
},
|
|
260
|
-
blur: () => {
|
|
261
|
-
var _a2;
|
|
262
|
-
(_a2 = inputRef.value) == null ? void 0 : _a2.blur();
|
|
263
|
-
},
|
|
264
|
-
clear: () => clearHandler(),
|
|
265
|
-
select: () => {
|
|
266
|
-
var _a2;
|
|
267
|
-
(_a2 = inputRef.value) == null ? void 0 : _a2.select();
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
const popoverVisible = ref(false);
|
|
271
|
-
const popoverVisibleUpdateHandler = (value) => {
|
|
272
|
-
if (!value) {
|
|
273
|
-
popoverVisible.value = value;
|
|
274
|
-
}
|
|
275
|
-
};
|
|
276
|
-
const darkMode = useDarkMode();
|
|
277
|
-
watch([first, last, borderRadiusComputed, shapeComputed, sizeComputed, disabledComputed, () => slots, darkMode, focusMode, hoverFlag], () => {
|
|
278
|
-
setTimeout(() => {
|
|
279
|
-
drawPixel();
|
|
280
|
-
});
|
|
281
|
-
});
|
|
282
|
-
const drawPixel = () => {
|
|
283
|
-
const preprocessData = canvasPreprocess(wrapperRef, canvasRef);
|
|
284
|
-
if (!preprocessData) {
|
|
285
|
-
return;
|
|
286
|
-
}
|
|
287
|
-
const {
|
|
288
|
-
ctx,
|
|
289
|
-
width,
|
|
290
|
-
height,
|
|
291
|
-
canvas
|
|
292
|
-
} = preprocessData;
|
|
293
|
-
const pixelSize2 = calcPixelSize();
|
|
294
|
-
const borderRadius = getBorderRadius(canvas, pixelSize2, borderRadiusComputed.value, shapeComputed.value, sizeComputed.value || "medium", innerInputGroup.value, first.value, last.value);
|
|
295
|
-
const borderColor = props.status !== "normal" ? getGlobalThemeColor(props.status === "error" ? "danger" : props.status, 6) : (hoverFlag.value || focusMode.value) && !disabledComputed.value && !props.readonly ? getGlobalThemeColor("primary", 6) : getGlobalThemeColor("neutral", 10);
|
|
296
|
-
const center = calcBorderCornerCenter(borderRadius, width, height, pixelSize2);
|
|
297
|
-
const rad = BORDER_CORNER_RAD_RANGE;
|
|
298
|
-
drawBorder(ctx, width, height, center, borderRadius, rad, borderColor, pixelSize2, innerInputGroup.value, first.value, last.value);
|
|
299
|
-
const backgroundColor = disabledComputed.value ? getGlobalThemeColor("neutral", 6) : getGlobalThemeColor("neutral", 1);
|
|
300
|
-
floodFill(ctx, Math.round(width / 2), Math.round(height / 2), backgroundColor);
|
|
301
|
-
};
|
|
302
|
-
onMounted(() => {
|
|
303
|
-
nextTick(() => {
|
|
304
|
-
drawPixel();
|
|
305
|
-
});
|
|
306
|
-
});
|
|
307
|
-
useResizeObserver(wrapperRef, drawPixel);
|
|
308
|
-
useWatchGlobalCssVal(drawPixel);
|
|
309
|
-
return () => {
|
|
310
|
-
const Inner = createVNode(Fragment, null, [slots.prefix && createVNode("div", {
|
|
311
|
-
"class": "px-auto-complete-prefix-wrapper"
|
|
312
|
-
}, [slots.prefix()]), createVNode("input", {
|
|
313
|
-
"ref": inputRef,
|
|
314
|
-
"class": "px-auto-complete-inner",
|
|
315
|
-
"value": modelValue.value,
|
|
316
|
-
"placeholder": props.placeholder,
|
|
317
|
-
"disabled": disabledComputed.value || props.readonly,
|
|
318
|
-
"autofocus": props.autofocus,
|
|
319
|
-
"onInput": inputHandler,
|
|
320
|
-
"onChange": changeHandler,
|
|
321
|
-
"onBlur": blurHandler,
|
|
322
|
-
"onFocus": focusHandler,
|
|
323
|
-
"onCompositionstart": compositionStartHandler,
|
|
324
|
-
"onCompositionend": compositionUpdateHandler
|
|
325
|
-
}, null), showClose.value && createVNode("div", {
|
|
326
|
-
"class": "px-auto-complete-close-wrapper"
|
|
327
|
-
}, [hoverFlag.value && modelValue.value ? createVNode(TimesCircleSolid, {
|
|
328
|
-
"class": "px-auto-complete-icon",
|
|
329
|
-
"onClick": clearHandler
|
|
330
|
-
}, null) : createVNode("div", {
|
|
331
|
-
"class": "px-auto-complete-icon-placeholder"
|
|
332
|
-
}, null)]), props.loading && createVNode("div", {
|
|
333
|
-
"class": "px-auto-complete-loading-wrapper"
|
|
334
|
-
}, [createVNode(SpinnerThirdSolid, {
|
|
335
|
-
"class": "px-auto-complete-icon px-animation__loading"
|
|
336
|
-
}, null)]), slots.suffix && createVNode("div", {
|
|
337
|
-
"class": "px-auto-complete-suffix-wrapper"
|
|
338
|
-
}, [slots.suffix()]), createVNode("canvas", {
|
|
339
|
-
"ref": canvasRef,
|
|
340
|
-
"class": "px-auto-complete-canvas"
|
|
341
|
-
}, null)]);
|
|
342
|
-
const scopeObj = {};
|
|
343
|
-
const scopeId = instance == null ? void 0 : instance.vnode.scopeId;
|
|
344
|
-
const parentScopeId = instance == null ? void 0 : instance.vnode.scopeId;
|
|
345
|
-
if (scopeId) {
|
|
346
|
-
scopeObj[scopeId] = "";
|
|
347
|
-
}
|
|
348
|
-
if (parentScopeId) {
|
|
349
|
-
scopeObj[parentScopeId] = "";
|
|
350
|
-
}
|
|
351
|
-
const Render = createVNode(_sfc_main$2, {
|
|
352
|
-
"placement": "bottom",
|
|
353
|
-
"offset": 0,
|
|
354
|
-
"width-equal": true,
|
|
355
|
-
"arrow": false,
|
|
356
|
-
"visible": popoverVisible.value,
|
|
357
|
-
"onUpdate:visible": popoverVisibleUpdateHandler,
|
|
358
|
-
"trigger": "click",
|
|
359
|
-
"contentStyle": {
|
|
360
|
-
padding: `${pixelSize}px`
|
|
361
|
-
}
|
|
362
|
-
}, {
|
|
363
|
-
default: () => h("div", {
|
|
364
|
-
ref: wrapperRef,
|
|
365
|
-
class: ["pixelium px-auto-complete", sizeComputed.value && `px-auto-complete__${sizeComputed.value}`, shapeComputed.value && `px-auto-complete__${shapeComputed.value}`, {
|
|
366
|
-
"px-auto-complete__inner": innerInputGroup.value
|
|
367
|
-
}, {
|
|
368
|
-
"px-auto-complete__disabled": disabledComputed.value
|
|
369
|
-
}],
|
|
370
|
-
onClick: focusInputHandler,
|
|
371
|
-
onMouseenter: mouseenterHandler,
|
|
372
|
-
onMouseleave: mouseleaveHandler,
|
|
373
|
-
...scopeObj,
|
|
374
|
-
...attrs
|
|
375
|
-
}, [Inner]),
|
|
376
|
-
content: () => optionsFiltered.value.length ? createVNode(_sfc_main$3, {
|
|
377
|
-
"options": optionsFiltered.value,
|
|
378
|
-
"onSelect": selectHandler
|
|
379
|
-
}, {
|
|
380
|
-
"group-label": ({
|
|
381
|
-
option
|
|
382
|
-
}) => slots["group-label"] ? slots["group-label"]({
|
|
383
|
-
option
|
|
384
|
-
}) : option.label,
|
|
385
|
-
option: ({
|
|
386
|
-
option
|
|
387
|
-
}) => slots.option ? slots.option({
|
|
388
|
-
option
|
|
389
|
-
}) : p(option) ? option : option.label
|
|
390
|
-
}) : createVNode("div", {
|
|
391
|
-
"class": "px-auto-complete-empty"
|
|
392
|
-
}, [createVNode(_sfc_main$4, null, null)])
|
|
393
|
-
});
|
|
394
|
-
return Render;
|
|
395
|
-
};
|
|
396
|
-
}
|
|
397
|
-
});
|
|
398
|
-
export {
|
|
399
|
-
SpinnerThirdSolid as S,
|
|
400
|
-
TimesCircleSolid as T,
|
|
401
|
-
_sfc_main as _
|
|
402
|
-
};
|
|
340
|
+
export { auto_complete_default as t };
|