@para-ui/core 5.0.3-beta.8 → 5.0.3-beta.9
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:transparent!important;caret-color:#1d2126!important}.paraui-v4-expression-input-overlay{position:absolute;inset:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid rgb(212,218,227);border-radius:4px;box-shadow:0 2px 8px #d4dae366}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid rgb(234,236,241)}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
1
|
+
@charset "UTF-8";.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input,.paraui-v4-expression-input textarea{position:relative;z-index:1;color:transparent!important;caret-color:#1d2126!important}.paraui-v4-expression-input-overlay{position:absolute;inset:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid rgb(212,218,227);border-radius:4px;box-shadow:0 2px 8px #d4dae366}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid rgb(234,236,241)}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
@@ -1,65 +1,65 @@
|
|
|
1
|
-
import { j as
|
|
1
|
+
import { j as a } from "../_virtual/jsx-runtime.js";
|
|
2
2
|
import './index.css';/* empty css */
|
|
3
3
|
import * as r from "react";
|
|
4
|
-
import * as
|
|
4
|
+
import * as T from "react-dom";
|
|
5
5
|
import { UUID as Z } from "@snack-kit/lib";
|
|
6
6
|
import { TextField as Q } from "../TextField/index.js";
|
|
7
7
|
import { Tooltip as Y } from "../Tooltip/index.js";
|
|
8
8
|
import ee from "../GlobalContext/usePopupContainer.js";
|
|
9
9
|
import te from "../GlobalContext/useFormatMessage.js";
|
|
10
|
-
import { $prefixCls as
|
|
10
|
+
import { $prefixCls as z } from "../GlobalContext/constant.js";
|
|
11
11
|
import { useExpressionInput as re } from "./useExpressionInput.js";
|
|
12
12
|
import { Popup as ne } from "./Popup.js";
|
|
13
13
|
import { isExpressionValue as oe } from "./isExpressionValue.js";
|
|
14
14
|
import { highlightSegments as se } from "./highlightSegments.js";
|
|
15
15
|
import ie from "./HighlightOverlay.js";
|
|
16
16
|
import le from "./lang/index.js";
|
|
17
|
-
const
|
|
17
|
+
const ce = 50, ae = "$", Le = (F) => {
|
|
18
18
|
const {
|
|
19
19
|
value: d,
|
|
20
20
|
onChange: O,
|
|
21
21
|
resolveCandidates: j,
|
|
22
22
|
triggerMode: E = "braces",
|
|
23
|
-
triggerPrefix: p =
|
|
24
|
-
virtualizeThreshold: D =
|
|
25
|
-
renderPopupHeader:
|
|
23
|
+
triggerPrefix: p = ae,
|
|
24
|
+
virtualizeThreshold: D = ce,
|
|
25
|
+
renderPopupHeader: S,
|
|
26
26
|
expressionTooltip: f,
|
|
27
|
-
disabled:
|
|
27
|
+
disabled: w,
|
|
28
28
|
readOnly: I,
|
|
29
|
-
className:
|
|
29
|
+
className: x,
|
|
30
30
|
...g
|
|
31
|
-
} = F, H = te("ExpressionInput", le), [m] = r.useState(() => `${
|
|
32
|
-
open:
|
|
31
|
+
} = F, H = te("ExpressionInput", le), [m] = r.useState(() => `${z}-expression-input-${Z()}`), n = r.useRef(null), y = r.useRef(null), P = r.useRef({ getRootDomNode: () => n.current }), $ = ee(P), [M, q] = r.useState({ top: 0, left: 0, width: 0 }), o = r.useRef(null), [R, B] = r.useState(null), [U, k] = r.useState({}), c = String(d ?? ""), V = r.useMemo(() => se(c), [c]), {
|
|
32
|
+
open: s,
|
|
33
33
|
ctx: u,
|
|
34
34
|
candidates: h,
|
|
35
|
-
highlight:
|
|
36
|
-
setHighlight:
|
|
37
|
-
handleValueChange:
|
|
38
|
-
handleKeyDown:
|
|
39
|
-
handleSelect:
|
|
35
|
+
highlight: W,
|
|
36
|
+
setHighlight: _,
|
|
37
|
+
handleValueChange: A,
|
|
38
|
+
handleKeyDown: K,
|
|
39
|
+
handleSelect: N,
|
|
40
40
|
close: L,
|
|
41
41
|
pendingCursorRef: v
|
|
42
42
|
} = re({
|
|
43
|
-
value:
|
|
43
|
+
value: c,
|
|
44
44
|
onChange: O,
|
|
45
45
|
resolveCandidates: j,
|
|
46
46
|
triggerMode: E,
|
|
47
47
|
triggerPrefix: p,
|
|
48
|
-
disabled:
|
|
48
|
+
disabled: w,
|
|
49
49
|
readOnly: I
|
|
50
|
-
}),
|
|
50
|
+
}), i = r.useCallback(() => {
|
|
51
51
|
const e = n.current?.querySelector("input, textarea");
|
|
52
52
|
if (!e)
|
|
53
53
|
return;
|
|
54
54
|
const t = e.getBoundingClientRect();
|
|
55
55
|
q({ top: t.bottom + 4, left: t.left, width: Math.max(t.width, 280) });
|
|
56
|
-
}, []),
|
|
56
|
+
}, []), l = r.useCallback(() => {
|
|
57
57
|
const e = n.current?.querySelector("input, textarea");
|
|
58
58
|
if (!e)
|
|
59
59
|
return;
|
|
60
|
-
|
|
60
|
+
B(e.parentElement);
|
|
61
61
|
const t = window.getComputedStyle(e);
|
|
62
|
-
|
|
62
|
+
k({
|
|
63
63
|
paddingTop: t.paddingTop,
|
|
64
64
|
paddingRight: t.paddingRight,
|
|
65
65
|
paddingBottom: t.paddingBottom,
|
|
@@ -72,27 +72,29 @@ const ae = 50, ce = "$", Le = (F) => {
|
|
|
72
72
|
boxSizing: t.boxSizing,
|
|
73
73
|
borderWidth: t.borderWidth,
|
|
74
74
|
borderStyle: t.borderStyle,
|
|
75
|
-
borderColor: "transparent"
|
|
75
|
+
borderColor: "transparent",
|
|
76
|
+
whiteSpace: t.whiteSpace,
|
|
77
|
+
wordBreak: t.wordBreak
|
|
76
78
|
});
|
|
77
79
|
}, []);
|
|
78
80
|
r.useLayoutEffect(() => {
|
|
79
|
-
|
|
81
|
+
l(), window.addEventListener("resize", l);
|
|
80
82
|
const e = n.current;
|
|
81
83
|
let t;
|
|
82
|
-
return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(
|
|
83
|
-
window.removeEventListener("resize",
|
|
84
|
+
return e && typeof ResizeObserver < "u" && (t = new ResizeObserver(l), t.observe(e)), () => {
|
|
85
|
+
window.removeEventListener("resize", l), t?.disconnect();
|
|
84
86
|
};
|
|
85
|
-
}, [
|
|
87
|
+
}, [l]), r.useEffect(() => {
|
|
86
88
|
const e = n.current?.querySelector("input, textarea");
|
|
87
89
|
if (!e)
|
|
88
90
|
return;
|
|
89
91
|
const t = () => {
|
|
90
|
-
|
|
92
|
+
o.current && (o.current.scrollLeft = e.scrollLeft, o.current.scrollTop = e.scrollTop);
|
|
91
93
|
};
|
|
92
94
|
return e.addEventListener("scroll", t), () => e.removeEventListener("scroll", t);
|
|
93
95
|
}, []), r.useEffect(() => {
|
|
94
96
|
const e = n.current?.querySelector("input, textarea");
|
|
95
|
-
e &&
|
|
97
|
+
e && o.current && (o.current.scrollLeft = e.scrollLeft, o.current.scrollTop = e.scrollTop);
|
|
96
98
|
}, [d]), r.useEffect(() => {
|
|
97
99
|
const e = v.current;
|
|
98
100
|
if (e === null)
|
|
@@ -100,47 +102,47 @@ const ae = 50, ce = "$", Le = (F) => {
|
|
|
100
102
|
const t = n.current?.querySelector("input, textarea");
|
|
101
103
|
t && (t.focus(), t.setSelectionRange(e, e)), v.current = null;
|
|
102
104
|
}, [d, v]), r.useEffect(() => {
|
|
103
|
-
if (
|
|
104
|
-
return
|
|
105
|
-
window.removeEventListener("scroll",
|
|
105
|
+
if (s)
|
|
106
|
+
return i(), window.addEventListener("scroll", i, !0), window.addEventListener("resize", i), () => {
|
|
107
|
+
window.removeEventListener("scroll", i, !0), window.removeEventListener("resize", i);
|
|
106
108
|
};
|
|
107
|
-
}, [
|
|
108
|
-
if (!
|
|
109
|
+
}, [s, i]), r.useEffect(() => {
|
|
110
|
+
if (!s)
|
|
109
111
|
return;
|
|
110
112
|
const e = (t) => {
|
|
111
113
|
const C = t.target;
|
|
112
|
-
n.current?.contains(C) ||
|
|
114
|
+
n.current?.contains(C) || y.current?.contains(C) || L();
|
|
113
115
|
};
|
|
114
116
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
115
|
-
}, [
|
|
117
|
+
}, [s, L, m]);
|
|
116
118
|
const G = (e) => {
|
|
117
119
|
const t = e.target.selectionStart ?? e.target.value.length;
|
|
118
|
-
|
|
119
|
-
}, J = u ?
|
|
120
|
+
A(e.target.value, t);
|
|
121
|
+
}, J = u ? S ? S(u, h.length) : H(
|
|
120
122
|
{ id: "header" },
|
|
121
123
|
{ path: u.parts.length ? u.parts.join(".") : p, count: h.length }
|
|
122
|
-
) : null, X = !!f && oe(
|
|
124
|
+
) : null, X = !!f && oe(c, p, E), b = /* @__PURE__ */ a.jsx(
|
|
123
125
|
Q,
|
|
124
126
|
{
|
|
125
127
|
...g,
|
|
126
|
-
value:
|
|
127
|
-
disabled:
|
|
128
|
+
value: c,
|
|
129
|
+
disabled: w,
|
|
128
130
|
onChange: G,
|
|
129
131
|
onFocus: (e) => {
|
|
130
|
-
|
|
132
|
+
l(), g.onFocus?.(e);
|
|
131
133
|
},
|
|
132
134
|
onKeydown: (e) => {
|
|
133
|
-
|
|
135
|
+
K(e), g.onKeydown?.(e);
|
|
134
136
|
}
|
|
135
137
|
}
|
|
136
138
|
);
|
|
137
|
-
return /* @__PURE__ */
|
|
139
|
+
return /* @__PURE__ */ a.jsxs(
|
|
138
140
|
"div",
|
|
139
141
|
{
|
|
140
142
|
ref: n,
|
|
141
|
-
className: `${
|
|
143
|
+
className: `${z}-expression-input ${m}${x ? ` ${x}` : ""}`,
|
|
142
144
|
children: [
|
|
143
|
-
f ? /* @__PURE__ */
|
|
145
|
+
f ? /* @__PURE__ */ a.jsx(
|
|
144
146
|
Y,
|
|
145
147
|
{
|
|
146
148
|
title: f,
|
|
@@ -149,31 +151,31 @@ const ae = 50, ce = "$", Le = (F) => {
|
|
|
149
151
|
children: b
|
|
150
152
|
}
|
|
151
153
|
) : b,
|
|
152
|
-
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
R && T.createPortal(
|
|
155
|
+
/* @__PURE__ */ a.jsx(
|
|
154
156
|
ie,
|
|
155
157
|
{
|
|
156
|
-
ref:
|
|
157
|
-
segments:
|
|
158
|
-
style:
|
|
158
|
+
ref: o,
|
|
159
|
+
segments: V,
|
|
160
|
+
style: U
|
|
159
161
|
}
|
|
160
162
|
),
|
|
161
|
-
|
|
163
|
+
R
|
|
162
164
|
),
|
|
163
|
-
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
+
s && n.current && T.createPortal(
|
|
166
|
+
/* @__PURE__ */ a.jsx(
|
|
165
167
|
ne,
|
|
166
168
|
{
|
|
167
|
-
ref:
|
|
169
|
+
ref: y,
|
|
168
170
|
instanceClass: m,
|
|
169
|
-
visible:
|
|
171
|
+
visible: s,
|
|
170
172
|
rect: M,
|
|
171
173
|
header: J,
|
|
172
174
|
candidates: h,
|
|
173
|
-
highlight:
|
|
175
|
+
highlight: W,
|
|
174
176
|
virtualizeThreshold: D,
|
|
175
|
-
onSelect:
|
|
176
|
-
onHighlightChange:
|
|
177
|
+
onSelect: N,
|
|
178
|
+
onHighlightChange: _
|
|
177
179
|
}
|
|
178
180
|
),
|
|
179
181
|
$(n.current)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:rgba(0,0,0,0) !important;caret-color:#1d2126 !important}.paraui-v4-expression-input-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid #d4dae3;border-radius:4px;box-shadow:0px 2px 8px 0px rgba(212,218,227,.4)}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid #eaecf1}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
1
|
+
.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input,.paraui-v4-expression-input textarea{position:relative;z-index:1;color:rgba(0,0,0,0) !important;caret-color:#1d2126 !important}.paraui-v4-expression-input-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid #d4dae3;border-radius:4px;box-shadow:0px 2px 8px 0px rgba(212,218,227,.4)}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid #eaecf1}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:transparent!important;caret-color:#1d2126!important}.paraui-v4-expression-input-overlay{position:absolute;inset:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid rgb(212,218,227);border-radius:4px;box-shadow:0 2px 8px #d4dae366}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid rgb(234,236,241)}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
1
|
+
@charset "UTF-8";.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input,.paraui-v4-expression-input textarea{position:relative;z-index:1;color:transparent!important;caret-color:#1d2126!important}.paraui-v4-expression-input-overlay{position:absolute;inset:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid rgb(212,218,227);border-radius:4px;box-shadow:0 2px 8px #d4dae366}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid rgb(234,236,241)}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const p=require("../_virtual/jsx-runtime.js");;/* empty css */const Q=require("react"),Y=require("react-dom"),ee=require("@snack-kit/lib"),te=require("../TextField/index.js"),ne=require("../Tooltip/index.js"),re=require("../GlobalContext/usePopupContainer.js"),oe=require("../GlobalContext/useFormatMessage.js"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index.css');const p=require("../_virtual/jsx-runtime.js");;/* empty css */const Q=require("react"),Y=require("react-dom"),ee=require("@snack-kit/lib"),te=require("../TextField/index.js"),ne=require("../Tooltip/index.js"),re=require("../GlobalContext/usePopupContainer.js"),oe=require("../GlobalContext/useFormatMessage.js"),O=require("../GlobalContext/constant.js"),se=require("./useExpressionInput.js"),ie=require("./Popup.js"),ue=require("./isExpressionValue.js"),ce=require("./highlightSegments.js"),le=require("./HighlightOverlay.js"),ae=require("./lang/index.js");function _(o){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const u in o)if(u!=="default"){const f=Object.getOwnPropertyDescriptor(o,u);Object.defineProperty(s,u,f.get?f:{enumerable:!0,get:()=>o[u]})}}return s.default=o,Object.freeze(s)}const n=_(Q),z=_(Y),de=50,pe="$",fe=o=>{const{value:s,onChange:u,resolveCandidates:f,triggerMode:R="braces",triggerPrefix:h=pe,virtualizeThreshold:D=de,renderPopupHeader:y,expressionTooltip:x,disabled:w,readOnly:F,className:b,...v}=o,P=oe.default("ExpressionInput",ae.default),[E]=n.useState(()=>`${O.$prefixCls}-expression-input-${ee.UUID()}`),r=n.useRef(null),q=n.useRef(null),I=n.useRef({getRootDomNode:()=>r.current}),M=re.default(I),[$,H]=n.useState({top:0,left:0,width:0}),i=n.useRef(null),[L,k]=n.useState(null),[B,U]=n.useState({}),d=String(s??""),V=n.useMemo(()=>ce.highlightSegments(d),[d]),{open:c,ctx:g,candidates:m,highlight:N,setHighlight:W,handleValueChange:A,handleKeyDown:K,handleSelect:G,close:T,pendingCursorRef:S}=se.useExpressionInput({value:d,onChange:u,resolveCandidates:f,triggerMode:R,triggerPrefix:h,disabled:w,readOnly:F}),l=n.useCallback(()=>{const e=r.current?.querySelector("input, textarea");if(!e)return;const t=e.getBoundingClientRect();H({top:t.bottom+4,left:t.left,width:Math.max(t.width,280)})},[]),a=n.useCallback(()=>{const e=r.current?.querySelector("input, textarea");if(!e)return;k(e.parentElement);const t=window.getComputedStyle(e);U({paddingTop:t.paddingTop,paddingRight:t.paddingRight,paddingBottom:t.paddingBottom,paddingLeft:t.paddingLeft,fontFamily:t.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,boxSizing:t.boxSizing,borderWidth:t.borderWidth,borderStyle:t.borderStyle,borderColor:"transparent",whiteSpace:t.whiteSpace,wordBreak:t.wordBreak})},[]);n.useLayoutEffect(()=>{a(),window.addEventListener("resize",a);const e=r.current;let t;return e&&typeof ResizeObserver<"u"&&(t=new ResizeObserver(a),t.observe(e)),()=>{window.removeEventListener("resize",a),t?.disconnect()}},[a]),n.useEffect(()=>{const e=r.current?.querySelector("input, textarea");if(!e)return;const t=()=>{i.current&&(i.current.scrollLeft=e.scrollLeft,i.current.scrollTop=e.scrollTop)};return e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)},[]),n.useEffect(()=>{const e=r.current?.querySelector("input, textarea");e&&i.current&&(i.current.scrollLeft=e.scrollLeft,i.current.scrollTop=e.scrollTop)},[s]),n.useEffect(()=>{const e=S.current;if(e===null)return;const t=r.current?.querySelector("input, textarea");t&&(t.focus(),t.setSelectionRange(e,e)),S.current=null},[s,S]),n.useEffect(()=>{if(c)return l(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[c,l]),n.useEffect(()=>{if(!c)return;const e=t=>{const j=t.target;r.current?.contains(j)||q.current?.contains(j)||T()};return document.addEventListener("mousedown",e,!0),()=>document.removeEventListener("mousedown",e,!0)},[c,T,E]);const X=e=>{const t=e.target.selectionStart??e.target.value.length;A(e.target.value,t)},Z=g?y?y(g,m.length):P({id:"header"},{path:g.parts.length?g.parts.join("."):h,count:m.length}):null,J=!!x&&ue.isExpressionValue(d,h,R),C=p.jsxRuntimeExports.jsx(te.TextField,{...v,value:d,disabled:w,onChange:X,onFocus:e=>{a(),v.onFocus?.(e)},onKeydown:e=>{K(e),v.onKeydown?.(e)}});return p.jsxRuntimeExports.jsxs("div",{ref:r,className:`${O.$prefixCls}-expression-input ${E}${b?` ${b}`:""}`,children:[x?p.jsxRuntimeExports.jsx(ne.Tooltip,{title:x,trigger:["hover","focus"],...J?{}:{visible:!1},children:C}):C,L&&z.createPortal(p.jsxRuntimeExports.jsx(le.default,{ref:i,segments:V,style:B}),L),c&&r.current&&z.createPortal(p.jsxRuntimeExports.jsx(ie.Popup,{ref:q,instanceClass:E,visible:c,rect:$,header:Z,candidates:m,highlight:N,virtualizeThreshold:D,onSelect:G,onHighlightChange:W}),M(r.current))]})};exports.default=fe;
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input{position:relative;z-index:1;color:rgba(0,0,0,0) !important;caret-color:#1d2126 !important}.paraui-v4-expression-input-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid #d4dae3;border-radius:4px;box-shadow:0px 2px 8px 0px rgba(212,218,227,.4)}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid #eaecf1}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|
|
1
|
+
.paraui-v4-expression-input{display:inline-block;width:100%}.paraui-v4-expression-input input,.paraui-v4-expression-input textarea{position:relative;z-index:1;color:rgba(0,0,0,0) !important;caret-color:#1d2126 !important}.paraui-v4-expression-input-overlay{position:absolute;top:0;right:0;bottom:0;left:0;z-index:0;overflow:hidden;color:#1d2126;white-space:pre;pointer-events:none}.paraui-v4-expression-input-overlay-highlight{color:#2e65e6}.paraui-v4-expression-input-popup{z-index:1500;min-width:280px;overflow:hidden;background:#fff;border:1px solid #d4dae3;border-radius:4px;box-shadow:0px 2px 8px 0px rgba(212,218,227,.4)}.paraui-v4-expression-input-popup-header{padding:6px 12px;font-size:12px;color:#a1a8b3;border-bottom:1px solid #eaecf1}.paraui-v4-expression-input-popup-list{padding:4px 0}.paraui-v4-expression-input-popup-item{display:flex;align-items:center;padding:0 12px;font-size:14px;color:#1d2126;white-space:nowrap;cursor:pointer}.paraui-v4-expression-input-popup-item-active{color:#2e65e6;background:#f0f5ff}.paraui-v4-expression-input-popup-item-value{flex:0 0 auto;margin-right:8px}.paraui-v4-expression-input-popup-item-desc{flex:1 1 auto;overflow:hidden;font-size:12px;color:#a1a8b3;text-overflow:ellipsis}.paraui-v4-expression-input-popup-item-lock{flex:0 0 auto;margin-left:8px;font-size:16px;color:#a1a8b3}
|