@malloydata/malloy-explorer 0.0.285-dev250611150446 → 0.0.295-dev250710213205
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/.gitmodules +3 -0
- package/@flowtypes/components/MalloyExplorerProvider.flow.js +2 -5
- package/README.md +7 -0
- package/dist/cjs/index.cjs +1985 -1317
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +1988 -1320
- package/dist/esm/index.js.map +1 -1
- package/dist/malloy-explorer.css +18 -1
- package/dist/types/components/MalloyExplorerProvider.d.ts +2 -4
- package/dist/types/components/QueryPanel/AddMenu/ValueList.d.ts +3 -1
- package/dist/types/components/QueryPanel/VizEditor/ArrayEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/BooleanEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/FieldEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/InfoHover.d.ts +4 -0
- package/dist/types/components/QueryPanel/VizEditor/NumberEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/ObjectEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/OneOfEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/StringEditor.d.ts +3 -0
- package/dist/types/components/QueryPanel/VizEditor/VizEditor.d.ts +11 -0
- package/dist/types/components/QueryPanel/VizEditor/VizEditorDialog.d.ts +12 -0
- package/dist/types/components/QueryPanel/VizEditor/VizEditorPopover.d.ts +10 -0
- package/dist/types/components/QueryPanel/VizEditor/styles.d.ts +72 -0
- package/dist/types/components/QueryPanel/VizEditor/types.d.ts +11 -0
- package/dist/types/components/QueryPanel/dialogStyles.d.ts +60 -0
- package/dist/types/components/ResultPanel/ResultDisplay.d.ts +0 -4
- package/dist/types/components/filters/DateTimeFilterCore.d.ts +1 -1
- package/dist/types/components/primitives/ScrollableArea.d.ts +3 -0
- package/dist/types/components/utils/renderer.d.ts +0 -24
- package/dist/types/contexts/QueryEditorContext.d.ts +2 -4
- package/package.json +10 -8
- package/vite.config.mts +5 -0
- package/dist/types/components/QueryPanel/RendererPopover.d.ts +0 -20
package/dist/esm/index.js
CHANGED
|
@@ -17,10 +17,10 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
17
17
|
import * as React from "react";
|
|
18
18
|
import React__default, { useLayoutEffect, useEffect, useMemo, useState, useRef, createElement, useContext, useCallback, createContext, memo, useReducer } from "react";
|
|
19
19
|
import * as QB from "@malloydata/malloy-query-builder";
|
|
20
|
-
import { ASTArrowQueryDefinition, ASTArrowViewDefinition, ASTSegmentViewDefinition, ASTNestViewOperation, ASTRefinementViewDefinition, ASTFilterWithLiteralEquality, ASTOrderByViewOperation, ASTGroupByViewOperation, ASTAggregateViewOperation, ASTLimitViewOperation, ASTTimeTruncationExpression, ASTFilterWithFilterString, ASTWhereViewOperation, ASTHavingViewOperation, ASTDrillViewOperation, ASTQuery } from "@malloydata/malloy-query-builder";
|
|
20
|
+
import { ASTArrowQueryDefinition, ASTArrowViewDefinition, ASTSegmentViewDefinition, ASTNestViewOperation, ASTRefinementViewDefinition, ASTFilterWithLiteralEquality, ASTAnnotation, ASTOrderByViewOperation, ASTGroupByViewOperation, ASTAggregateViewOperation, ASTLimitViewOperation, ASTTimeTruncationExpression, ASTFilterWithFilterString, ASTReferenceExpression, ASTWhereViewOperation, ASTHavingViewOperation, ASTDrillViewOperation, ASTQuery } from "@malloydata/malloy-query-builder";
|
|
21
21
|
import { Tag } from "@malloydata/malloy-tag";
|
|
22
|
+
import { MalloyRenderer, isCoreVizPluginInstance } from "@malloydata/render";
|
|
22
23
|
import { TemporalFilterExpression, BooleanFilterExpression, NumberFilterExpression, StringFilterExpression } from "@malloydata/malloy-filter";
|
|
23
|
-
import { MalloyRenderer } from "@malloydata/render";
|
|
24
24
|
import * as ReactDOM from "react-dom";
|
|
25
25
|
import ReactDOM__default, { unstable_batchedUpdates, createPortal } from "react-dom";
|
|
26
26
|
function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
@@ -3745,6 +3745,15 @@ const fontStyles = {
|
|
|
3745
3745
|
lineHeight: "mly1d3mw78",
|
|
3746
3746
|
letterSpacing: "mly1gu5id8",
|
|
3747
3747
|
$$css: true
|
|
3748
|
+
},
|
|
3749
|
+
tooltipText: {
|
|
3750
|
+
fontFamily: "mly1rj5sg5",
|
|
3751
|
+
color: "mly1rs82da",
|
|
3752
|
+
fontSize: "mlyif65rj",
|
|
3753
|
+
fontStyle: "mly1j61x8r",
|
|
3754
|
+
fontWeight: "mlyo1l8bm",
|
|
3755
|
+
lineHeight: "mly1fc57z9",
|
|
3756
|
+
$$css: true
|
|
3748
3757
|
}
|
|
3749
3758
|
};
|
|
3750
3759
|
const SvgChevronDown = (props2) => /* @__PURE__ */ React.createElement("svg", { width: 110, height: 110, viewBox: "15 15 80 80", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props2 }, /* @__PURE__ */ React.createElement("g", { id: "cahevron_down", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("path", { d: "M52.9466923,41.3127809 C54.0529774,40.2742275 55.7502198,40.2309545 56.9057514,41.1829617 L57.0533077,41.3127809 L81.5533077,64.3127809 C82.7612755,65.4467914 82.8212296,67.34534 81.6872191,68.5533077 C80.5968243,69.7148152 78.7995712,69.8149195 77.5890551,68.8127704 L77.4466923,68.6872191 L54.9999906,47.615 L32.5533077,68.6872191 C31.3918003,69.7776139 29.5918121,69.7641211 28.4469384,68.6875913 L28.3127809,68.5533077 C27.2223861,67.3918003 27.2358789,65.5918121 28.3124087,64.4469384 L28.4466923,64.3127809 L52.9466923,41.3127809 Z", id: "Path", fill: "currentColor", fillRule: "nonzero", transform: "translate(55.000000, 55.000005) rotate(-180.000000) translate(-55.000000, -55.000005) " })));
|
|
@@ -3895,11 +3904,11 @@ function Icon({
|
|
|
3895
3904
|
return null;
|
|
3896
3905
|
}
|
|
3897
3906
|
return /* @__PURE__ */ jsx(IconComponent, {
|
|
3898
|
-
..._stylex.props(styles$
|
|
3907
|
+
..._stylex.props(styles$Q.main, colorVariants$3[color], customStyle),
|
|
3899
3908
|
"data-testid": `icon-${color}-${name}`
|
|
3900
3909
|
});
|
|
3901
3910
|
}
|
|
3902
|
-
const styles$
|
|
3911
|
+
const styles$Q = {
|
|
3903
3912
|
main: {
|
|
3904
3913
|
display: "mly1rg5ohu",
|
|
3905
3914
|
width: "mly1kky2od",
|
|
@@ -3968,18 +3977,18 @@ function Badge({
|
|
|
3968
3977
|
customStyle
|
|
3969
3978
|
}) {
|
|
3970
3979
|
return /* @__PURE__ */ jsxs("div", {
|
|
3971
|
-
..._stylex.props(styles$
|
|
3980
|
+
..._stylex.props(styles$P.main, colorVariants$2[color], customStyle),
|
|
3972
3981
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
3973
3982
|
color,
|
|
3974
3983
|
name: icon
|
|
3975
3984
|
}), /* @__PURE__ */ jsx("div", {
|
|
3976
3985
|
"data-testid": "badge-label",
|
|
3977
|
-
..._stylex.props(fontStyles.badge, styles$
|
|
3986
|
+
..._stylex.props(fontStyles.badge, styles$P.label),
|
|
3978
3987
|
children: label
|
|
3979
3988
|
})]
|
|
3980
3989
|
});
|
|
3981
3990
|
}
|
|
3982
|
-
const styles$
|
|
3991
|
+
const styles$P = {
|
|
3983
3992
|
main: {
|
|
3984
3993
|
display: "mly3nfvp2",
|
|
3985
3994
|
height: "mly1qx5ct2",
|
|
@@ -4061,10 +4070,10 @@ function Divider({
|
|
|
4061
4070
|
customStyle
|
|
4062
4071
|
}) {
|
|
4063
4072
|
return /* @__PURE__ */ jsx("div", {
|
|
4064
|
-
..._stylex.props(styles$
|
|
4073
|
+
..._stylex.props(styles$O.main, orientationVariants[orientation], customStyle)
|
|
4065
4074
|
});
|
|
4066
4075
|
}
|
|
4067
|
-
const styles$
|
|
4076
|
+
const styles$O = {
|
|
4068
4077
|
main: {
|
|
4069
4078
|
background: "mly1xnbgy5",
|
|
4070
4079
|
backgroundAttachment: null,
|
|
@@ -4870,7 +4879,7 @@ function Button({
|
|
|
4870
4879
|
...props2
|
|
4871
4880
|
}) {
|
|
4872
4881
|
const button = /* @__PURE__ */ jsxs("button", {
|
|
4873
|
-
..._stylex.props(styles$
|
|
4882
|
+
..._stylex.props(styles$N.main, colorVariants$1[variant], sizeVariants$1[size2], customStyle),
|
|
4874
4883
|
type: "button",
|
|
4875
4884
|
disabled: isDisabled,
|
|
4876
4885
|
...props2,
|
|
@@ -4880,9 +4889,9 @@ function Button({
|
|
|
4880
4889
|
},
|
|
4881
4890
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
4882
4891
|
name: icon,
|
|
4883
|
-
customStyle: styles$
|
|
4892
|
+
customStyle: styles$N.icon
|
|
4884
4893
|
}), label && /* @__PURE__ */ jsx("div", {
|
|
4885
|
-
..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$
|
|
4894
|
+
..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$N.label),
|
|
4886
4895
|
children: label
|
|
4887
4896
|
})]
|
|
4888
4897
|
}), isDisabled && /* @__PURE__ */ jsx("div", {
|
|
@@ -4909,7 +4918,7 @@ function Button({
|
|
|
4909
4918
|
return button;
|
|
4910
4919
|
}
|
|
4911
4920
|
}
|
|
4912
|
-
const styles$
|
|
4921
|
+
const styles$N = {
|
|
4913
4922
|
main: {
|
|
4914
4923
|
display: "mly3nfvp2",
|
|
4915
4924
|
flexDirection: "mlydt5ytf",
|
|
@@ -5160,7 +5169,7 @@ function Token({
|
|
|
5160
5169
|
}) {
|
|
5161
5170
|
const isInteractive = onClick !== void 0 || asButtonTrigger;
|
|
5162
5171
|
const token2 = /* @__PURE__ */ jsxs("div", {
|
|
5163
|
-
..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$
|
|
5172
|
+
..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$M.nonInteractive, customStyle),
|
|
5164
5173
|
...dragProps == null ? void 0 : dragProps.attributes,
|
|
5165
5174
|
...dragProps == null ? void 0 : dragProps.listeners,
|
|
5166
5175
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
@@ -5191,13 +5200,13 @@ function Token({
|
|
|
5191
5200
|
}), /* @__PURE__ */ jsx(Portal$4, {
|
|
5192
5201
|
children: /* @__PURE__ */ jsx(Content2$4, {
|
|
5193
5202
|
...tooltipProps,
|
|
5194
|
-
..._stylex.props(typeof tooltip === "string" ? tooltipStyles.default : tooltipStyles.card),
|
|
5203
|
+
..._stylex.props(fontStyles.tooltipText, typeof tooltip === "string" ? tooltipStyles.default : tooltipStyles.card),
|
|
5195
5204
|
children: tooltip
|
|
5196
5205
|
})
|
|
5197
5206
|
})]
|
|
5198
5207
|
}) : token2;
|
|
5199
5208
|
}
|
|
5200
|
-
const styles$
|
|
5209
|
+
const styles$M = {
|
|
5201
5210
|
nonInteractive: {
|
|
5202
5211
|
cursor: "mlyt0e3qv",
|
|
5203
5212
|
background: "mly1np9qvj",
|
|
@@ -5221,7 +5230,7 @@ function TokenGroup({
|
|
|
5221
5230
|
}) {
|
|
5222
5231
|
const count2 = React.Children.count(children);
|
|
5223
5232
|
return /* @__PURE__ */ jsx("div", {
|
|
5224
|
-
..._stylex.props(styles$
|
|
5233
|
+
..._stylex.props(styles$L.main, customStyle),
|
|
5225
5234
|
children: React.Children.map(children, (child, index2) => /* @__PURE__ */ React.cloneElement(child, {
|
|
5226
5235
|
customStyle: {
|
|
5227
5236
|
...child.props.customStyle,
|
|
@@ -5232,16 +5241,16 @@ function TokenGroup({
|
|
|
5232
5241
|
});
|
|
5233
5242
|
}
|
|
5234
5243
|
const getChildStyle = (index2, count2) => {
|
|
5235
|
-
if (count2 === 1) return styles$
|
|
5236
|
-
if (index2 === 0) return styles$
|
|
5237
|
-
if (index2 === count2 - 1) return styles$
|
|
5238
|
-
return styles$
|
|
5244
|
+
if (count2 === 1) return styles$L.onlyChild;
|
|
5245
|
+
if (index2 === 0) return styles$L.firstChild;
|
|
5246
|
+
if (index2 === count2 - 1) return styles$L.lastChild;
|
|
5247
|
+
return styles$L.innerChild;
|
|
5239
5248
|
};
|
|
5240
5249
|
const getTokenColor = (child, groupColor) => {
|
|
5241
5250
|
const childColor = child.props.color;
|
|
5242
5251
|
return childColor === void 0 ? groupColor : childColor;
|
|
5243
5252
|
};
|
|
5244
|
-
const styles$
|
|
5253
|
+
const styles$L = {
|
|
5245
5254
|
main: {
|
|
5246
5255
|
display: "mlyrvj5dj",
|
|
5247
5256
|
gridAutoFlow: "mly1mt1orb",
|
|
@@ -5313,7 +5322,7 @@ function ErrorIcon({
|
|
|
5313
5322
|
},
|
|
5314
5323
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
5315
5324
|
name: "warning",
|
|
5316
|
-
customStyle: styles$
|
|
5325
|
+
customStyle: styles$K.errorIcon
|
|
5317
5326
|
})
|
|
5318
5327
|
})
|
|
5319
5328
|
}), /* @__PURE__ */ jsx(TooltipPortal, {
|
|
@@ -5326,7 +5335,7 @@ function ErrorIcon({
|
|
|
5326
5335
|
})]
|
|
5327
5336
|
});
|
|
5328
5337
|
}
|
|
5329
|
-
const styles$
|
|
5338
|
+
const styles$K = {
|
|
5330
5339
|
errorIcon: {
|
|
5331
5340
|
color: "mly1e2nbdu",
|
|
5332
5341
|
$$css: true
|
|
@@ -5371,22 +5380,22 @@ function EditableToken({
|
|
|
5371
5380
|
className: "mly78zum5 mly6s0dn4"
|
|
5372
5381
|
},
|
|
5373
5382
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
5374
|
-
..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$
|
|
5383
|
+
..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$J.focused, !!errorMessage && styles$J.hasError, customStyle),
|
|
5375
5384
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
5376
5385
|
name: icon,
|
|
5377
|
-
customStyle: styles$
|
|
5386
|
+
customStyle: styles$J.icon
|
|
5378
5387
|
}), /* @__PURE__ */ jsxs("span", {
|
|
5379
5388
|
...{
|
|
5380
5389
|
className: "mlywz0xwf"
|
|
5381
5390
|
},
|
|
5382
5391
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5383
|
-
..._stylex.props(fontStyles.body, styles$
|
|
5392
|
+
..._stylex.props(fontStyles.body, styles$J.placeholder),
|
|
5384
5393
|
style: {
|
|
5385
5394
|
whiteSpaceCollapse: "preserve"
|
|
5386
5395
|
},
|
|
5387
5396
|
children: value
|
|
5388
5397
|
}), /* @__PURE__ */ jsx("input", {
|
|
5389
|
-
..._stylex.props(styles$
|
|
5398
|
+
..._stylex.props(styles$J.input, fontStyles.body),
|
|
5390
5399
|
ref: inputRef,
|
|
5391
5400
|
pattern: type === "number" ? "^-?[0-9.]*$" : void 0,
|
|
5392
5401
|
value,
|
|
@@ -5411,7 +5420,7 @@ function EditableToken({
|
|
|
5411
5420
|
})]
|
|
5412
5421
|
});
|
|
5413
5422
|
}
|
|
5414
|
-
const styles$
|
|
5423
|
+
const styles$J = {
|
|
5415
5424
|
focused: {
|
|
5416
5425
|
background: "mlyotlr4g",
|
|
5417
5426
|
backgroundAttachment: null,
|
|
@@ -7753,12 +7762,12 @@ function TextInput({
|
|
|
7753
7762
|
}
|
|
7754
7763
|
};
|
|
7755
7764
|
return /* @__PURE__ */ jsxs("div", {
|
|
7756
|
-
..._stylex.props(styles$
|
|
7765
|
+
..._stylex.props(styles$I.main, isFocused && styles$I.focused, sizeVariants[size2], customStyle),
|
|
7757
7766
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
7758
7767
|
name: icon,
|
|
7759
7768
|
color: "secondary"
|
|
7760
7769
|
}), /* @__PURE__ */ jsx("input", {
|
|
7761
|
-
..._stylex.props(fontStyles.body, styles$
|
|
7770
|
+
..._stylex.props(fontStyles.body, styles$I.input),
|
|
7762
7771
|
value,
|
|
7763
7772
|
placeholder,
|
|
7764
7773
|
onChange: handleChange,
|
|
@@ -7766,7 +7775,7 @@ function TextInput({
|
|
|
7766
7775
|
onBlur: handleBlur,
|
|
7767
7776
|
onKeyDown
|
|
7768
7777
|
}), hasClear && /* @__PURE__ */ jsx("button", {
|
|
7769
|
-
..._stylex.props(fontStyles.supporting, styles$
|
|
7778
|
+
..._stylex.props(fontStyles.supporting, styles$I.actionButton, value === "" && styles$I.hidden),
|
|
7770
7779
|
ref: buttonRef,
|
|
7771
7780
|
onClick: () => onChange(""),
|
|
7772
7781
|
tabIndex: 0,
|
|
@@ -7774,7 +7783,7 @@ function TextInput({
|
|
|
7774
7783
|
})]
|
|
7775
7784
|
});
|
|
7776
7785
|
}
|
|
7777
|
-
const styles$
|
|
7786
|
+
const styles$I = {
|
|
7778
7787
|
main: {
|
|
7779
7788
|
display: "mly78zum5",
|
|
7780
7789
|
alignItems: "mly6s0dn4",
|
|
@@ -7983,16 +7992,14 @@ function SelectorToken({
|
|
|
7983
7992
|
onValueChange: handleValueChange,
|
|
7984
7993
|
required: true,
|
|
7985
7994
|
children: [/* @__PURE__ */ jsxs(Trigger$3, {
|
|
7986
|
-
..._stylex.props(tokenStyles.main, styles$
|
|
7995
|
+
..._stylex.props(tokenStyles.main, styles$H.selectTrigger, tokenColorVariants[color], tokenSizeVariants[size2], customStyle),
|
|
7987
7996
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
7988
7997
|
name: icon,
|
|
7989
7998
|
customStyle: tokenStyles.icon
|
|
7990
7999
|
}), /* @__PURE__ */ jsx(Value$1, {
|
|
7991
8000
|
asChild: true,
|
|
7992
8001
|
children: /* @__PURE__ */ jsx("div", {
|
|
7993
|
-
...
|
|
7994
|
-
className: "mlyb3r6kr mlylyipyv"
|
|
7995
|
-
},
|
|
8002
|
+
..._stylex.props(fontStyles.body, tokenStyles.label),
|
|
7996
8003
|
children: label
|
|
7997
8004
|
})
|
|
7998
8005
|
})]
|
|
@@ -8012,7 +8019,7 @@ function SelectorToken({
|
|
|
8012
8019
|
size: "compact",
|
|
8013
8020
|
icon: "search",
|
|
8014
8021
|
hasClear: true,
|
|
8015
|
-
customStyle: styles$
|
|
8022
|
+
customStyle: styles$H.searchInput,
|
|
8016
8023
|
onKeyDown: (event) => {
|
|
8017
8024
|
const excludedKeys = ["ArrowUp", "ArrowDown"];
|
|
8018
8025
|
if (!excludedKeys.includes(event.key)) {
|
|
@@ -8021,17 +8028,15 @@ function SelectorToken({
|
|
|
8021
8028
|
}, 10);
|
|
8022
8029
|
}
|
|
8023
8030
|
}
|
|
8024
|
-
}), /* @__PURE__ */ jsx(
|
|
8025
|
-
|
|
8026
|
-
|
|
8027
|
-
|
|
8028
|
-
|
|
8029
|
-
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8033
|
-
}, item.value))
|
|
8034
|
-
})
|
|
8031
|
+
}), /* @__PURE__ */ jsx(Group$1, {
|
|
8032
|
+
...{
|
|
8033
|
+
className: "mly78zum5 mlydt5ytf mlyuyqlj2 mlyfawy5m mly195vfkc mlyysyzu8"
|
|
8034
|
+
},
|
|
8035
|
+
children: filteredItems.map((item) => /* @__PURE__ */ jsx(SelectItem, {
|
|
8036
|
+
value: item.value,
|
|
8037
|
+
selectedValue: value,
|
|
8038
|
+
children: item.label
|
|
8039
|
+
}, item.value))
|
|
8035
8040
|
})]
|
|
8036
8041
|
})
|
|
8037
8042
|
})
|
|
@@ -8045,21 +8050,21 @@ function SelectItem({
|
|
|
8045
8050
|
...props2
|
|
8046
8051
|
}) {
|
|
8047
8052
|
return /* @__PURE__ */ jsxs(Item$1, {
|
|
8048
|
-
..._stylex.props(fontStyles.body, styles$
|
|
8053
|
+
..._stylex.props(fontStyles.body, styles$H.selectItem),
|
|
8049
8054
|
value,
|
|
8050
8055
|
...props2,
|
|
8051
8056
|
children: [value === selectedValue ? /* @__PURE__ */ jsx(Icon, {
|
|
8052
8057
|
name: "radioChecked",
|
|
8053
|
-
customStyle: styles$
|
|
8058
|
+
customStyle: styles$H.radioChecked
|
|
8054
8059
|
}) : /* @__PURE__ */ jsx(Icon, {
|
|
8055
8060
|
name: "radioUnchecked",
|
|
8056
|
-
customStyle: styles$
|
|
8061
|
+
customStyle: styles$H.radioUnchecked
|
|
8057
8062
|
}), /* @__PURE__ */ jsx(ItemText, {
|
|
8058
8063
|
children
|
|
8059
8064
|
})]
|
|
8060
8065
|
});
|
|
8061
8066
|
}
|
|
8062
|
-
const styles$
|
|
8067
|
+
const styles$H = {
|
|
8063
8068
|
selectTrigger: {
|
|
8064
8069
|
whiteSpace: "mlyuxw1ft",
|
|
8065
8070
|
overflow: "mlyb3r6kr",
|
|
@@ -8149,7 +8154,7 @@ function Card({
|
|
|
8149
8154
|
customStyle
|
|
8150
8155
|
}) {
|
|
8151
8156
|
return /* @__PURE__ */ jsxs("div", {
|
|
8152
|
-
..._stylex.props(styles$
|
|
8157
|
+
..._stylex.props(styles$G.container, customStyle),
|
|
8153
8158
|
children: [/* @__PURE__ */ jsx("div", {
|
|
8154
8159
|
...{
|
|
8155
8160
|
className: "mly1717udv"
|
|
@@ -8163,7 +8168,7 @@ function Card({
|
|
|
8163
8168
|
})]
|
|
8164
8169
|
});
|
|
8165
8170
|
}
|
|
8166
|
-
const styles$
|
|
8171
|
+
const styles$G = {
|
|
8167
8172
|
container: {
|
|
8168
8173
|
display: "mly78zum5",
|
|
8169
8174
|
flexDirection: "mlydt5ytf",
|
|
@@ -8256,7 +8261,7 @@ function CollapsiblePanel({
|
|
|
8256
8261
|
},
|
|
8257
8262
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
8258
8263
|
name: icon,
|
|
8259
|
-
customStyle: styles$
|
|
8264
|
+
customStyle: styles$F.icon
|
|
8260
8265
|
}), /* @__PURE__ */ jsx("div", {
|
|
8261
8266
|
...{
|
|
8262
8267
|
className: "mlyuxw1ft mlyb3r6kr mlylyipyv mlyehqz9p mly1ghz6dp mly117nqv4"
|
|
@@ -8298,7 +8303,7 @@ function CollapsiblePanel({
|
|
|
8298
8303
|
})]
|
|
8299
8304
|
});
|
|
8300
8305
|
}
|
|
8301
|
-
const styles$
|
|
8306
|
+
const styles$F = {
|
|
8302
8307
|
icon: {
|
|
8303
8308
|
$$css: true
|
|
8304
8309
|
}
|
|
@@ -8330,10 +8335,10 @@ function CollapsibleListItem({
|
|
|
8330
8335
|
className: "mly78zum5 mlydt5ytf mly1iyjqo2 mlyb3r6kr"
|
|
8331
8336
|
},
|
|
8332
8337
|
children: [/* @__PURE__ */ jsx("span", {
|
|
8333
|
-
..._stylex.props(fontStyles.body, styles$
|
|
8338
|
+
..._stylex.props(fontStyles.body, styles$E.label),
|
|
8334
8339
|
children: label
|
|
8335
8340
|
}), sublabel && /* @__PURE__ */ jsx("span", {
|
|
8336
|
-
..._stylex.props(fontStyles.supporting, styles$
|
|
8341
|
+
..._stylex.props(fontStyles.supporting, styles$E.sublabel),
|
|
8337
8342
|
children: sublabel
|
|
8338
8343
|
})]
|
|
8339
8344
|
})]
|
|
@@ -8345,7 +8350,7 @@ function CollapsibleListItem({
|
|
|
8345
8350
|
})]
|
|
8346
8351
|
});
|
|
8347
8352
|
}
|
|
8348
|
-
const styles$
|
|
8353
|
+
const styles$E = {
|
|
8349
8354
|
label: {
|
|
8350
8355
|
flexGrow: "mly1iyjqo2",
|
|
8351
8356
|
fontWeight: "mly1xlr1w8",
|
|
@@ -19159,7 +19164,7 @@ function Spinner({
|
|
|
19159
19164
|
} = SIZES[size2];
|
|
19160
19165
|
const frameSize = diameter + border * 2;
|
|
19161
19166
|
return /* @__PURE__ */ jsx("div", {
|
|
19162
|
-
..._stylex.props(styles$
|
|
19167
|
+
..._stylex.props(styles$D.root, customStyle),
|
|
19163
19168
|
children: /* @__PURE__ */ jsx("span", {
|
|
19164
19169
|
"aria-valuetext": "Loading",
|
|
19165
19170
|
...{
|
|
@@ -19179,7 +19184,7 @@ function Spinner({
|
|
|
19179
19184
|
})
|
|
19180
19185
|
});
|
|
19181
19186
|
}
|
|
19182
|
-
const styles$
|
|
19187
|
+
const styles$D = {
|
|
19183
19188
|
root: {
|
|
19184
19189
|
alignItems: "mly6s0dn4",
|
|
19185
19190
|
display: "mly3nfvp2",
|
|
@@ -23577,7 +23582,7 @@ const Popover = ({
|
|
|
23577
23582
|
})
|
|
23578
23583
|
});
|
|
23579
23584
|
};
|
|
23580
|
-
const styles$
|
|
23585
|
+
const styles$C = {
|
|
23581
23586
|
wrapper: {
|
|
23582
23587
|
position: "mly1n2onr6",
|
|
23583
23588
|
$$css: true
|
|
@@ -23629,7 +23634,7 @@ const SelectDropdown = ({
|
|
|
23629
23634
|
setOpen(false);
|
|
23630
23635
|
};
|
|
23631
23636
|
return /* @__PURE__ */ jsxs("div", {
|
|
23632
|
-
..._stylex.props(styles$
|
|
23637
|
+
..._stylex.props(styles$C.wrapper, customStyle),
|
|
23633
23638
|
children: [/* @__PURE__ */ jsxs("button", {
|
|
23634
23639
|
type: "button",
|
|
23635
23640
|
autoFocus,
|
|
@@ -23697,7 +23702,7 @@ function SelectList({
|
|
|
23697
23702
|
const [hoveredIndex, setHoveredIndex] = useState(null);
|
|
23698
23703
|
return /* @__PURE__ */ jsx(ScrollableArea, {
|
|
23699
23704
|
children: /* @__PURE__ */ jsx("div", {
|
|
23700
|
-
..._stylex.props(styles$
|
|
23705
|
+
..._stylex.props(styles$C.selectListDiv, customStyle),
|
|
23701
23706
|
children: options.reduce((result, option2, index2) => {
|
|
23702
23707
|
const isSelected = value !== void 0 && valueEqual(value, option2.value);
|
|
23703
23708
|
if (option2.divider) {
|
|
@@ -23729,8 +23734,8 @@ function SelectList({
|
|
|
23729
23734
|
}), /* @__PURE__ */ jsx(Icon, {
|
|
23730
23735
|
name: "checkmark",
|
|
23731
23736
|
customStyle: {
|
|
23732
|
-
...styles$
|
|
23733
|
-
...isSelected ? styles$
|
|
23737
|
+
...styles$C.checkIcon,
|
|
23738
|
+
...isSelected ? styles$C.checkIconSelected : void 0
|
|
23734
23739
|
}
|
|
23735
23740
|
}), /* @__PURE__ */ jsx("span", {
|
|
23736
23741
|
...{
|
|
@@ -23782,7 +23787,7 @@ const DateInput = ({
|
|
|
23782
23787
|
setTempValue(hooks.utc(value).format(format2));
|
|
23783
23788
|
}, [value, format2]);
|
|
23784
23789
|
return /* @__PURE__ */ jsx("input", {
|
|
23785
|
-
..._stylex.props(customStyle, isActive ? styles$
|
|
23790
|
+
..._stylex.props(customStyle, isActive ? styles$B.active : null),
|
|
23786
23791
|
type: "text",
|
|
23787
23792
|
placeholder: placeholder || format2,
|
|
23788
23793
|
value: tempValue,
|
|
@@ -23817,7 +23822,7 @@ function guessUnits(moment2, isDateTime) {
|
|
|
23817
23822
|
}
|
|
23818
23823
|
return isDateTime ? "second" : "day";
|
|
23819
23824
|
}
|
|
23820
|
-
const styles$
|
|
23825
|
+
const styles$B = {
|
|
23821
23826
|
active: {
|
|
23822
23827
|
backgroundColor: "mly1vzefiq",
|
|
23823
23828
|
$$css: true
|
|
@@ -23929,7 +23934,7 @@ function DatePicker({
|
|
|
23929
23934
|
});
|
|
23930
23935
|
};
|
|
23931
23936
|
return /* @__PURE__ */ jsxs("div", {
|
|
23932
|
-
..._stylex.props(styles$
|
|
23937
|
+
..._stylex.props(styles$A.outer, customStyle),
|
|
23933
23938
|
ref: forwardRef,
|
|
23934
23939
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
23935
23940
|
...{
|
|
@@ -24245,7 +24250,7 @@ function DatePicker({
|
|
|
24245
24250
|
})]
|
|
24246
24251
|
});
|
|
24247
24252
|
}
|
|
24248
|
-
const styles$
|
|
24253
|
+
const styles$A = {
|
|
24249
24254
|
outer: {
|
|
24250
24255
|
userSelect: "mly87ps6o",
|
|
24251
24256
|
fontSize: "mlymhiqyu",
|
|
@@ -24331,7 +24336,7 @@ function Banner({
|
|
|
24331
24336
|
className: "mly1q4ynmn mlyh8yej3 mly5yr21d mly78zum5 mlydt5ytf mly1kmqopl mly16zck5j"
|
|
24332
24337
|
},
|
|
24333
24338
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
24334
|
-
..._stylex.props(styles$
|
|
24339
|
+
..._stylex.props(styles$z.header, variantColors[variant], children ? styles$z.headerWithContent : null),
|
|
24335
24340
|
children: [/* @__PURE__ */ jsx("div", {
|
|
24336
24341
|
...{
|
|
24337
24342
|
className: "mly1qx5ct2 mly78zum5 mlyl56j7k mly6s0dn4"
|
|
@@ -24344,22 +24349,22 @@ function Banner({
|
|
|
24344
24349
|
className: "mly78zum5 mlydt5ytf mlyb3r6kr"
|
|
24345
24350
|
},
|
|
24346
24351
|
children: [/* @__PURE__ */ jsx("div", {
|
|
24347
|
-
..._stylex.props(styles$
|
|
24352
|
+
..._stylex.props(styles$z.title, fontStyles.emphasized),
|
|
24348
24353
|
children: title
|
|
24349
24354
|
}), /* @__PURE__ */ jsx("div", {
|
|
24350
|
-
..._stylex.props(styles$
|
|
24355
|
+
..._stylex.props(styles$z.description, fontStyles.supporting),
|
|
24351
24356
|
children: description
|
|
24352
24357
|
})]
|
|
24353
24358
|
})]
|
|
24354
24359
|
}), children && /* @__PURE__ */ jsx("div", {
|
|
24355
|
-
..._stylex.props(styles$
|
|
24360
|
+
..._stylex.props(styles$z.content, fontStyles.body),
|
|
24356
24361
|
children: /* @__PURE__ */ jsx(ScrollableArea, {
|
|
24357
24362
|
children
|
|
24358
24363
|
})
|
|
24359
24364
|
})]
|
|
24360
24365
|
});
|
|
24361
24366
|
}
|
|
24362
|
-
const styles$
|
|
24367
|
+
const styles$z = {
|
|
24363
24368
|
header: {
|
|
24364
24369
|
borderRadius: "mly1q4ynmn",
|
|
24365
24370
|
borderStartStartRadius: null,
|
|
@@ -24501,14 +24506,14 @@ function AccordionList({
|
|
|
24501
24506
|
onExpandedItemChange: handleExpandedItemChange
|
|
24502
24507
|
},
|
|
24503
24508
|
children: /* @__PURE__ */ jsx("div", {
|
|
24504
|
-
..._stylex.props(styles$
|
|
24509
|
+
..._stylex.props(styles$y.main, customStyle),
|
|
24505
24510
|
children: React.Children.map(children, (child) => /* @__PURE__ */ jsxs(Fragment, {
|
|
24506
24511
|
children: [child, /* @__PURE__ */ jsx(Divider, {})]
|
|
24507
24512
|
}))
|
|
24508
24513
|
})
|
|
24509
24514
|
});
|
|
24510
24515
|
}
|
|
24511
|
-
const styles$
|
|
24516
|
+
const styles$y = {
|
|
24512
24517
|
main: {
|
|
24513
24518
|
display: "mly78zum5",
|
|
24514
24519
|
flexDirection: "mlydt5ytf",
|
|
@@ -24545,10 +24550,10 @@ function AccordionListItem({
|
|
|
24545
24550
|
className: "mly78zum5 mlydt5ytf mlyb3r6kr mly1iyjqo2"
|
|
24546
24551
|
},
|
|
24547
24552
|
children: [/* @__PURE__ */ jsx("span", {
|
|
24548
|
-
..._stylex.props(fontStyles.body, styles$
|
|
24553
|
+
..._stylex.props(fontStyles.body, styles$x.label),
|
|
24549
24554
|
children: label
|
|
24550
24555
|
}), sublabel && /* @__PURE__ */ jsx("span", {
|
|
24551
|
-
..._stylex.props(fontStyles.supporting, styles$
|
|
24556
|
+
..._stylex.props(fontStyles.supporting, styles$x.sublabel),
|
|
24552
24557
|
children: sublabel
|
|
24553
24558
|
})]
|
|
24554
24559
|
}), badge && badge, endIcon && endIcon]
|
|
@@ -24560,7 +24565,7 @@ function AccordionListItem({
|
|
|
24560
24565
|
})]
|
|
24561
24566
|
});
|
|
24562
24567
|
}
|
|
24563
|
-
const styles$
|
|
24568
|
+
const styles$x = {
|
|
24564
24569
|
label: {
|
|
24565
24570
|
flexGrow: "mly1iyjqo2",
|
|
24566
24571
|
fontWeight: "mly1xlr1w8",
|
|
@@ -25845,7 +25850,7 @@ function DropdownMenu({
|
|
|
25845
25850
|
children: trigger
|
|
25846
25851
|
}), /* @__PURE__ */ jsx(Portal2, {
|
|
25847
25852
|
children: /* @__PURE__ */ jsx(Content2, {
|
|
25848
|
-
..._stylex.props(fontStyles.body, styles$
|
|
25853
|
+
..._stylex.props(fontStyles.body, styles$w.content),
|
|
25849
25854
|
side: "bottom",
|
|
25850
25855
|
align: "start",
|
|
25851
25856
|
sideOffset: 4,
|
|
@@ -25872,22 +25877,22 @@ function DropdownMenuItem({
|
|
|
25872
25877
|
disabled,
|
|
25873
25878
|
children: [icon && /* @__PURE__ */ jsx(Icon, {
|
|
25874
25879
|
name: icon,
|
|
25875
|
-
customStyle: styles$
|
|
25880
|
+
customStyle: styles$w.icon
|
|
25876
25881
|
}), /* @__PURE__ */ jsxs("div", {
|
|
25877
25882
|
...{
|
|
25878
25883
|
className: "mly78zum5 mlydt5ytf mly1iyjqo2"
|
|
25879
25884
|
},
|
|
25880
25885
|
children: [/* @__PURE__ */ jsx("span", {
|
|
25881
|
-
..._stylex.props(fontStyles.body, styles$
|
|
25886
|
+
..._stylex.props(fontStyles.body, styles$w.label),
|
|
25882
25887
|
children: label
|
|
25883
25888
|
}), sublabel && /* @__PURE__ */ jsx("span", {
|
|
25884
|
-
..._stylex.props(fontStyles.supporting, styles$
|
|
25889
|
+
..._stylex.props(fontStyles.supporting, styles$w.sublabel),
|
|
25885
25890
|
children: sublabel
|
|
25886
25891
|
})]
|
|
25887
25892
|
})]
|
|
25888
25893
|
});
|
|
25889
25894
|
}
|
|
25890
|
-
const styles$
|
|
25895
|
+
const styles$w = {
|
|
25891
25896
|
content: {
|
|
25892
25897
|
display: "mly78zum5",
|
|
25893
25898
|
flexDirection: "mlydt5ytf",
|
|
@@ -25971,7 +25976,7 @@ function QueryActionBar({
|
|
|
25971
25976
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
25972
25977
|
name: "filterSliders"
|
|
25973
25978
|
}), /* @__PURE__ */ jsx("div", {
|
|
25974
|
-
..._stylex.props(fontStyles.largeBody, styles$
|
|
25979
|
+
..._stylex.props(fontStyles.largeBody, styles$v.title),
|
|
25975
25980
|
children: "Query"
|
|
25976
25981
|
})]
|
|
25977
25982
|
}), /* @__PURE__ */ jsxs("div", {
|
|
@@ -26016,13 +26021,13 @@ function QueryActionBar({
|
|
|
26016
26021
|
})]
|
|
26017
26022
|
});
|
|
26018
26023
|
}
|
|
26019
|
-
const styles$
|
|
26024
|
+
const styles$v = {
|
|
26020
26025
|
title: {
|
|
26021
26026
|
fontWeight: "mly1xlr1w8",
|
|
26022
26027
|
$$css: true
|
|
26023
26028
|
}
|
|
26024
26029
|
};
|
|
26025
|
-
const styles$
|
|
26030
|
+
const styles$u = {
|
|
26026
26031
|
labelWithIcon: {
|
|
26027
26032
|
display: "mly78zum5",
|
|
26028
26033
|
alignItems: "mly6s0dn4",
|
|
@@ -26179,109 +26184,6 @@ function legacyToViz(name) {
|
|
|
26179
26184
|
return name;
|
|
26180
26185
|
}
|
|
26181
26186
|
}
|
|
26182
|
-
const VISUALIZATION_OPTIONS = {
|
|
26183
|
-
table: null,
|
|
26184
|
-
bar: [{
|
|
26185
|
-
name: "title",
|
|
26186
|
-
label: "Title",
|
|
26187
|
-
type: "string",
|
|
26188
|
-
default: ""
|
|
26189
|
-
}, {
|
|
26190
|
-
name: "sub_title",
|
|
26191
|
-
label: "Subtitle",
|
|
26192
|
-
type: "string",
|
|
26193
|
-
default: ""
|
|
26194
|
-
}, {
|
|
26195
|
-
name: "stack",
|
|
26196
|
-
label: "Stack",
|
|
26197
|
-
type: "boolean",
|
|
26198
|
-
default: false
|
|
26199
|
-
}, {
|
|
26200
|
-
name: "size",
|
|
26201
|
-
label: "Size",
|
|
26202
|
-
type: "select",
|
|
26203
|
-
default: "fill",
|
|
26204
|
-
options: [{
|
|
26205
|
-
label: "Fill",
|
|
26206
|
-
value: "fill"
|
|
26207
|
-
}, {
|
|
26208
|
-
label: "Sparkline",
|
|
26209
|
-
value: "spark"
|
|
26210
|
-
}, {
|
|
26211
|
-
label: "X-Small",
|
|
26212
|
-
value: "xs"
|
|
26213
|
-
}, {
|
|
26214
|
-
label: "Small",
|
|
26215
|
-
value: "sm"
|
|
26216
|
-
}, {
|
|
26217
|
-
label: "Medium",
|
|
26218
|
-
value: "md"
|
|
26219
|
-
}, {
|
|
26220
|
-
label: "Large",
|
|
26221
|
-
value: "lg"
|
|
26222
|
-
}, {
|
|
26223
|
-
label: "X-Large",
|
|
26224
|
-
value: "xl"
|
|
26225
|
-
}, {
|
|
26226
|
-
label: "XX-Large",
|
|
26227
|
-
value: "2xl"
|
|
26228
|
-
}]
|
|
26229
|
-
}],
|
|
26230
|
-
dashboard: null,
|
|
26231
|
-
json: null,
|
|
26232
|
-
line: [{
|
|
26233
|
-
name: "title",
|
|
26234
|
-
label: "Title",
|
|
26235
|
-
type: "string",
|
|
26236
|
-
default: ""
|
|
26237
|
-
}, {
|
|
26238
|
-
name: "sub_title",
|
|
26239
|
-
label: "Subtitle",
|
|
26240
|
-
type: "string",
|
|
26241
|
-
default: ""
|
|
26242
|
-
}, {
|
|
26243
|
-
name: "zero_baseline",
|
|
26244
|
-
label: "Zero Baseline",
|
|
26245
|
-
type: "boolean",
|
|
26246
|
-
default: false
|
|
26247
|
-
}, {
|
|
26248
|
-
name: "size",
|
|
26249
|
-
label: "Size",
|
|
26250
|
-
type: "select",
|
|
26251
|
-
default: "md",
|
|
26252
|
-
options: [{
|
|
26253
|
-
label: "Fill",
|
|
26254
|
-
value: "fill"
|
|
26255
|
-
}, {
|
|
26256
|
-
label: "Sparkline",
|
|
26257
|
-
value: "spark"
|
|
26258
|
-
}, {
|
|
26259
|
-
label: "X-Small",
|
|
26260
|
-
value: "xs"
|
|
26261
|
-
}, {
|
|
26262
|
-
label: "Small",
|
|
26263
|
-
value: "sm"
|
|
26264
|
-
}, {
|
|
26265
|
-
label: "Medium",
|
|
26266
|
-
value: "md"
|
|
26267
|
-
}, {
|
|
26268
|
-
label: "Large",
|
|
26269
|
-
value: "lg"
|
|
26270
|
-
}, {
|
|
26271
|
-
label: "X-Large",
|
|
26272
|
-
value: "xl"
|
|
26273
|
-
}, {
|
|
26274
|
-
label: "XX-Large",
|
|
26275
|
-
value: "2xl"
|
|
26276
|
-
}]
|
|
26277
|
-
}],
|
|
26278
|
-
list: null,
|
|
26279
|
-
list_detail: null,
|
|
26280
|
-
point_map: null,
|
|
26281
|
-
scatter_chart: null,
|
|
26282
|
-
segment_map: null,
|
|
26283
|
-
shape_map: null
|
|
26284
|
-
};
|
|
26285
26187
|
function atomicTypeToIcon(type) {
|
|
26286
26188
|
return atomicTypeMap[type];
|
|
26287
26189
|
}
|
|
@@ -26377,25 +26279,28 @@ function DrillOperations({
|
|
|
26377
26279
|
}
|
|
26378
26280
|
return /* @__PURE__ */ jsxs("div", {
|
|
26379
26281
|
children: [/* @__PURE__ */ jsx("div", {
|
|
26380
|
-
..._stylex.props(styles$
|
|
26282
|
+
..._stylex.props(styles$u.title),
|
|
26381
26283
|
children: "drills"
|
|
26382
26284
|
}), /* @__PURE__ */ jsx("div", {
|
|
26383
26285
|
...{
|
|
26384
26286
|
className: "mly78zum5 mlydt5ytf mly1jnr06f"
|
|
26385
26287
|
},
|
|
26386
|
-
children: drills.map((drill, key2) =>
|
|
26387
|
-
|
|
26388
|
-
|
|
26389
|
-
|
|
26390
|
-
|
|
26391
|
-
|
|
26392
|
-
|
|
26393
|
-
|
|
26394
|
-
|
|
26395
|
-
|
|
26396
|
-
|
|
26397
|
-
|
|
26398
|
-
|
|
26288
|
+
children: drills.map((drill, key2) => {
|
|
26289
|
+
const field = drill.filter.expression.getFieldInfo();
|
|
26290
|
+
return field ? /* @__PURE__ */ jsxs(TokenGroup, {
|
|
26291
|
+
color: "cyan",
|
|
26292
|
+
customStyle: localStyles.tokenGroup,
|
|
26293
|
+
children: [/* @__PURE__ */ jsx(FieldToken, {
|
|
26294
|
+
field
|
|
26295
|
+
}), /* @__PURE__ */ jsx(Token, {
|
|
26296
|
+
label: "="
|
|
26297
|
+
}), drill.filter instanceof ASTFilterWithLiteralEquality ? /* @__PURE__ */ jsx(LiteralValue, {
|
|
26298
|
+
value: drill.filter.value.node
|
|
26299
|
+
}) : /* @__PURE__ */ jsx(Token, {
|
|
26300
|
+
label: drill.filter.filterString
|
|
26301
|
+
})]
|
|
26302
|
+
}, key2) : null;
|
|
26303
|
+
})
|
|
26399
26304
|
})]
|
|
26400
26305
|
});
|
|
26401
26306
|
}
|
|
@@ -30349,288 +30254,1767 @@ function BadgeForField({
|
|
|
30349
30254
|
label: "view",
|
|
30350
30255
|
icon: "view_filled",
|
|
30351
30256
|
color: "purple",
|
|
30352
|
-
customStyle: styles$
|
|
30257
|
+
customStyle: styles$t.noBackground
|
|
30353
30258
|
});
|
|
30354
30259
|
} else if (field.kind === "dimension") {
|
|
30355
30260
|
return /* @__PURE__ */ jsx(Badge, {
|
|
30356
30261
|
label: "dimension",
|
|
30357
30262
|
icon: fieldToIcon(field),
|
|
30358
30263
|
color: "cyan",
|
|
30359
|
-
customStyle: styles$
|
|
30264
|
+
customStyle: styles$t.noBackground
|
|
30360
30265
|
});
|
|
30361
30266
|
} else if (field.kind === "measure") {
|
|
30362
30267
|
return /* @__PURE__ */ jsx(Badge, {
|
|
30363
30268
|
label: "measure",
|
|
30364
30269
|
icon: fieldToIcon(field),
|
|
30365
30270
|
color: "green",
|
|
30366
|
-
customStyle: styles$
|
|
30271
|
+
customStyle: styles$t.noBackground
|
|
30367
30272
|
});
|
|
30368
30273
|
} else if (field.kind === "join") {
|
|
30369
30274
|
return /* @__PURE__ */ jsx(Badge, {
|
|
30370
30275
|
label: "join",
|
|
30371
30276
|
icon: fieldToIcon(field),
|
|
30372
30277
|
color: "gray",
|
|
30373
|
-
customStyle: styles$
|
|
30278
|
+
customStyle: styles$t.noBackground
|
|
30374
30279
|
});
|
|
30375
30280
|
}
|
|
30376
30281
|
}
|
|
30377
|
-
const styles$
|
|
30282
|
+
const styles$t = {
|
|
30378
30283
|
noBackground: {
|
|
30379
30284
|
backgroundColor: "mlyjbqb8w",
|
|
30380
30285
|
$$css: true
|
|
30381
30286
|
}
|
|
30382
30287
|
};
|
|
30383
|
-
|
|
30384
|
-
|
|
30385
|
-
|
|
30386
|
-
|
|
30387
|
-
view,
|
|
30388
|
-
customStyle
|
|
30389
|
-
}) {
|
|
30390
|
-
const [open, setOpen] = useState(false);
|
|
30391
|
-
return /* @__PURE__ */ jsxs(Root2$2, {
|
|
30392
|
-
onOpenChange: (open2) => setOpen(open2),
|
|
30393
|
-
open,
|
|
30394
|
-
children: [/* @__PURE__ */ jsx(Trigger$2, {
|
|
30395
|
-
asChild: true,
|
|
30396
|
-
children: /* @__PURE__ */ jsx(Token, {
|
|
30397
|
-
icon: "gear",
|
|
30398
|
-
customStyle: {
|
|
30399
|
-
...customStyle,
|
|
30400
|
-
...dialogStyles$1.trigger
|
|
30401
|
-
}
|
|
30402
|
-
})
|
|
30403
|
-
}), /* @__PURE__ */ jsx(Portal$2, {
|
|
30404
|
-
children: /* @__PURE__ */ jsx(Content2$2, {
|
|
30405
|
-
align: "end",
|
|
30406
|
-
children: /* @__PURE__ */ jsx(RendererEditor, {
|
|
30407
|
-
rootQuery,
|
|
30408
|
-
view,
|
|
30409
|
-
viz,
|
|
30410
|
-
options,
|
|
30411
|
-
setOpen
|
|
30412
|
-
})
|
|
30413
|
-
})
|
|
30414
|
-
})]
|
|
30415
|
-
});
|
|
30416
|
-
}
|
|
30417
|
-
function RendererEditor({
|
|
30418
|
-
rootQuery,
|
|
30419
|
-
view,
|
|
30420
|
-
viz,
|
|
30421
|
-
options,
|
|
30422
|
-
setOpen
|
|
30423
|
-
}) {
|
|
30288
|
+
var DIALOG_NAME = "Dialog";
|
|
30289
|
+
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
30290
|
+
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
30291
|
+
var Dialog = (props2) => {
|
|
30424
30292
|
const {
|
|
30425
|
-
|
|
30426
|
-
|
|
30427
|
-
|
|
30428
|
-
|
|
30429
|
-
|
|
30430
|
-
|
|
30431
|
-
|
|
30432
|
-
|
|
30433
|
-
|
|
30434
|
-
|
|
30435
|
-
|
|
30436
|
-
|
|
30437
|
-
|
|
30293
|
+
__scopeDialog,
|
|
30294
|
+
children,
|
|
30295
|
+
open: openProp,
|
|
30296
|
+
defaultOpen,
|
|
30297
|
+
onOpenChange,
|
|
30298
|
+
modal = true
|
|
30299
|
+
} = props2;
|
|
30300
|
+
const triggerRef = React.useRef(null);
|
|
30301
|
+
const contentRef = React.useRef(null);
|
|
30302
|
+
const [open = false, setOpen] = useControllableState({
|
|
30303
|
+
prop: openProp,
|
|
30304
|
+
defaultProp: defaultOpen,
|
|
30305
|
+
onChange: onOpenChange
|
|
30306
|
+
});
|
|
30307
|
+
return /* @__PURE__ */ jsx(
|
|
30308
|
+
DialogProvider,
|
|
30309
|
+
{
|
|
30310
|
+
scope: __scopeDialog,
|
|
30311
|
+
triggerRef,
|
|
30312
|
+
contentRef,
|
|
30313
|
+
contentId: useId(),
|
|
30314
|
+
titleId: useId(),
|
|
30315
|
+
descriptionId: useId(),
|
|
30316
|
+
open,
|
|
30317
|
+
onOpenChange: setOpen,
|
|
30318
|
+
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
30319
|
+
modal,
|
|
30320
|
+
children
|
|
30321
|
+
}
|
|
30322
|
+
);
|
|
30323
|
+
};
|
|
30324
|
+
Dialog.displayName = DIALOG_NAME;
|
|
30325
|
+
var TRIGGER_NAME$1 = "DialogTrigger";
|
|
30326
|
+
var DialogTrigger = React.forwardRef(
|
|
30327
|
+
(props2, forwardedRef) => {
|
|
30328
|
+
const { __scopeDialog, ...triggerProps } = props2;
|
|
30329
|
+
const context = useDialogContext(TRIGGER_NAME$1, __scopeDialog);
|
|
30330
|
+
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
30331
|
+
return /* @__PURE__ */ jsx(
|
|
30332
|
+
Primitive.button,
|
|
30333
|
+
{
|
|
30334
|
+
type: "button",
|
|
30335
|
+
"aria-haspopup": "dialog",
|
|
30336
|
+
"aria-expanded": context.open,
|
|
30337
|
+
"aria-controls": context.contentId,
|
|
30338
|
+
"data-state": getState(context.open),
|
|
30339
|
+
...triggerProps,
|
|
30340
|
+
ref: composedTriggerRef,
|
|
30341
|
+
onClick: composeEventHandlers(props2.onClick, context.onOpenToggle)
|
|
30342
|
+
}
|
|
30343
|
+
);
|
|
30438
30344
|
}
|
|
30439
|
-
|
|
30440
|
-
|
|
30441
|
-
|
|
30442
|
-
|
|
30443
|
-
|
|
30444
|
-
|
|
30445
|
-
|
|
30446
|
-
|
|
30447
|
-
|
|
30448
|
-
|
|
30449
|
-
|
|
30450
|
-
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
|
|
30455
|
-
|
|
30456
|
-
|
|
30457
|
-
|
|
30458
|
-
|
|
30459
|
-
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
|
|
30463
|
-
|
|
30464
|
-
|
|
30465
|
-
|
|
30466
|
-
|
|
30467
|
-
|
|
30345
|
+
);
|
|
30346
|
+
DialogTrigger.displayName = TRIGGER_NAME$1;
|
|
30347
|
+
var PORTAL_NAME = "DialogPortal";
|
|
30348
|
+
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
|
30349
|
+
forceMount: void 0
|
|
30350
|
+
});
|
|
30351
|
+
var DialogPortal = (props2) => {
|
|
30352
|
+
const { __scopeDialog, forceMount, children, container } = props2;
|
|
30353
|
+
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
30354
|
+
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$5, { asChild: true, container, children: child }) })) });
|
|
30355
|
+
};
|
|
30356
|
+
DialogPortal.displayName = PORTAL_NAME;
|
|
30357
|
+
var OVERLAY_NAME = "DialogOverlay";
|
|
30358
|
+
var DialogOverlay = React.forwardRef(
|
|
30359
|
+
(props2, forwardedRef) => {
|
|
30360
|
+
const portalContext = usePortalContext(OVERLAY_NAME, props2.__scopeDialog);
|
|
30361
|
+
const { forceMount = portalContext.forceMount, ...overlayProps } = props2;
|
|
30362
|
+
const context = useDialogContext(OVERLAY_NAME, props2.__scopeDialog);
|
|
30363
|
+
return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
30364
|
+
}
|
|
30365
|
+
);
|
|
30366
|
+
DialogOverlay.displayName = OVERLAY_NAME;
|
|
30367
|
+
var DialogOverlayImpl = React.forwardRef(
|
|
30368
|
+
(props2, forwardedRef) => {
|
|
30369
|
+
const { __scopeDialog, ...overlayProps } = props2;
|
|
30370
|
+
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
30371
|
+
return (
|
|
30372
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
30373
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
30374
|
+
/* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
|
30375
|
+
Primitive.div,
|
|
30376
|
+
{
|
|
30377
|
+
"data-state": getState(context.open),
|
|
30378
|
+
...overlayProps,
|
|
30379
|
+
ref: forwardedRef,
|
|
30380
|
+
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
30381
|
+
}
|
|
30382
|
+
) })
|
|
30383
|
+
);
|
|
30384
|
+
}
|
|
30385
|
+
);
|
|
30386
|
+
var CONTENT_NAME$1 = "DialogContent";
|
|
30387
|
+
var DialogContent = React.forwardRef(
|
|
30388
|
+
(props2, forwardedRef) => {
|
|
30389
|
+
const portalContext = usePortalContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
30390
|
+
const { forceMount = portalContext.forceMount, ...contentProps } = props2;
|
|
30391
|
+
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
30392
|
+
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
30393
|
+
}
|
|
30394
|
+
);
|
|
30395
|
+
DialogContent.displayName = CONTENT_NAME$1;
|
|
30396
|
+
var DialogContentModal = React.forwardRef(
|
|
30397
|
+
(props2, forwardedRef) => {
|
|
30398
|
+
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
30399
|
+
const contentRef = React.useRef(null);
|
|
30400
|
+
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
30401
|
+
React.useEffect(() => {
|
|
30402
|
+
const content = contentRef.current;
|
|
30403
|
+
if (content) return hideOthers(content);
|
|
30404
|
+
}, []);
|
|
30405
|
+
return /* @__PURE__ */ jsx(
|
|
30406
|
+
DialogContentImpl,
|
|
30407
|
+
{
|
|
30408
|
+
...props2,
|
|
30409
|
+
ref: composedRefs,
|
|
30410
|
+
trapFocus: context.open,
|
|
30411
|
+
disableOutsidePointerEvents: true,
|
|
30412
|
+
onCloseAutoFocus: composeEventHandlers(props2.onCloseAutoFocus, (event) => {
|
|
30413
|
+
var _a2;
|
|
30414
|
+
event.preventDefault();
|
|
30415
|
+
(_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
|
|
30416
|
+
}),
|
|
30417
|
+
onPointerDownOutside: composeEventHandlers(props2.onPointerDownOutside, (event) => {
|
|
30418
|
+
const originalEvent = event.detail.originalEvent;
|
|
30419
|
+
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
30420
|
+
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
30421
|
+
if (isRightClick) event.preventDefault();
|
|
30422
|
+
}),
|
|
30423
|
+
onFocusOutside: composeEventHandlers(
|
|
30424
|
+
props2.onFocusOutside,
|
|
30425
|
+
(event) => event.preventDefault()
|
|
30426
|
+
)
|
|
30427
|
+
}
|
|
30428
|
+
);
|
|
30429
|
+
}
|
|
30430
|
+
);
|
|
30431
|
+
var DialogContentNonModal = React.forwardRef(
|
|
30432
|
+
(props2, forwardedRef) => {
|
|
30433
|
+
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
30434
|
+
const hasInteractedOutsideRef = React.useRef(false);
|
|
30435
|
+
const hasPointerDownOutsideRef = React.useRef(false);
|
|
30436
|
+
return /* @__PURE__ */ jsx(
|
|
30437
|
+
DialogContentImpl,
|
|
30438
|
+
{
|
|
30439
|
+
...props2,
|
|
30440
|
+
ref: forwardedRef,
|
|
30441
|
+
trapFocus: false,
|
|
30442
|
+
disableOutsidePointerEvents: false,
|
|
30443
|
+
onCloseAutoFocus: (event) => {
|
|
30444
|
+
var _a2, _b2;
|
|
30445
|
+
(_a2 = props2.onCloseAutoFocus) == null ? void 0 : _a2.call(props2, event);
|
|
30446
|
+
if (!event.defaultPrevented) {
|
|
30447
|
+
if (!hasInteractedOutsideRef.current) (_b2 = context.triggerRef.current) == null ? void 0 : _b2.focus();
|
|
30448
|
+
event.preventDefault();
|
|
30449
|
+
}
|
|
30450
|
+
hasInteractedOutsideRef.current = false;
|
|
30451
|
+
hasPointerDownOutsideRef.current = false;
|
|
30468
30452
|
},
|
|
30469
|
-
|
|
30470
|
-
|
|
30471
|
-
|
|
30472
|
-
|
|
30473
|
-
|
|
30474
|
-
|
|
30475
|
-
|
|
30476
|
-
variant: "primary",
|
|
30477
|
-
label: "Apply",
|
|
30478
|
-
onClick: () => {
|
|
30479
|
-
if (!view.getTag(RENDERER_PREFIX).has("viz", viz)) {
|
|
30480
|
-
view.setTagProperty(["viz"], viz, RENDERER_PREFIX);
|
|
30481
|
-
}
|
|
30482
|
-
for (const option2 of options) {
|
|
30483
|
-
if (current[option2.name] !== option2.default.toString()) {
|
|
30484
|
-
view.setTagProperty(["viz", option2.name], current[option2.name], RENDERER_PREFIX);
|
|
30485
|
-
} else {
|
|
30486
|
-
view.removeTagProperty(["viz", option2.name], RENDERER_PREFIX);
|
|
30487
|
-
}
|
|
30453
|
+
onInteractOutside: (event) => {
|
|
30454
|
+
var _a2, _b2;
|
|
30455
|
+
(_a2 = props2.onInteractOutside) == null ? void 0 : _a2.call(props2, event);
|
|
30456
|
+
if (!event.defaultPrevented) {
|
|
30457
|
+
hasInteractedOutsideRef.current = true;
|
|
30458
|
+
if (event.detail.originalEvent.type === "pointerdown") {
|
|
30459
|
+
hasPointerDownOutsideRef.current = true;
|
|
30488
30460
|
}
|
|
30489
|
-
|
|
30490
|
-
|
|
30491
|
-
|
|
30492
|
-
|
|
30493
|
-
|
|
30494
|
-
|
|
30495
|
-
|
|
30496
|
-
});
|
|
30497
|
-
}
|
|
30498
|
-
function BooleanEditor({
|
|
30499
|
-
current,
|
|
30500
|
-
option: option2,
|
|
30501
|
-
setCurrent
|
|
30502
|
-
}) {
|
|
30503
|
-
return /* @__PURE__ */ jsxs(Fragment, {
|
|
30504
|
-
children: [/* @__PURE__ */ createElement("div", {
|
|
30505
|
-
...{
|
|
30506
|
-
className: "mly78zum5 mly1lvf691 mly117nqv4"
|
|
30507
|
-
},
|
|
30508
|
-
key: option2.name
|
|
30509
|
-
}, /* @__PURE__ */ jsx("input", {
|
|
30510
|
-
type: "checkbox",
|
|
30511
|
-
checked: current[option2.name] === "true",
|
|
30512
|
-
onChange: ({
|
|
30513
|
-
target: {
|
|
30514
|
-
checked
|
|
30461
|
+
}
|
|
30462
|
+
const target = event.target;
|
|
30463
|
+
const targetIsTrigger = (_b2 = context.triggerRef.current) == null ? void 0 : _b2.contains(target);
|
|
30464
|
+
if (targetIsTrigger) event.preventDefault();
|
|
30465
|
+
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
30466
|
+
event.preventDefault();
|
|
30467
|
+
}
|
|
30515
30468
|
}
|
|
30516
|
-
}) => {
|
|
30517
|
-
setCurrent({
|
|
30518
|
-
...current,
|
|
30519
|
-
[option2.name]: checked.toString()
|
|
30520
|
-
});
|
|
30521
30469
|
}
|
|
30522
|
-
|
|
30523
|
-
|
|
30524
|
-
|
|
30525
|
-
|
|
30526
|
-
|
|
30527
|
-
}
|
|
30528
|
-
|
|
30529
|
-
|
|
30530
|
-
|
|
30531
|
-
|
|
30532
|
-
|
|
30533
|
-
|
|
30534
|
-
|
|
30535
|
-
|
|
30536
|
-
|
|
30537
|
-
|
|
30538
|
-
|
|
30539
|
-
|
|
30540
|
-
|
|
30541
|
-
|
|
30542
|
-
|
|
30543
|
-
|
|
30544
|
-
|
|
30545
|
-
|
|
30470
|
+
);
|
|
30471
|
+
}
|
|
30472
|
+
);
|
|
30473
|
+
var DialogContentImpl = React.forwardRef(
|
|
30474
|
+
(props2, forwardedRef) => {
|
|
30475
|
+
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props2;
|
|
30476
|
+
const context = useDialogContext(CONTENT_NAME$1, __scopeDialog);
|
|
30477
|
+
const contentRef = React.useRef(null);
|
|
30478
|
+
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
30479
|
+
useFocusGuards();
|
|
30480
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30481
|
+
/* @__PURE__ */ jsx(
|
|
30482
|
+
FocusScope,
|
|
30483
|
+
{
|
|
30484
|
+
asChild: true,
|
|
30485
|
+
loop: true,
|
|
30486
|
+
trapped: trapFocus,
|
|
30487
|
+
onMountAutoFocus: onOpenAutoFocus,
|
|
30488
|
+
onUnmountAutoFocus: onCloseAutoFocus,
|
|
30489
|
+
children: /* @__PURE__ */ jsx(
|
|
30490
|
+
DismissableLayer,
|
|
30491
|
+
{
|
|
30492
|
+
role: "dialog",
|
|
30493
|
+
id: context.contentId,
|
|
30494
|
+
"aria-describedby": context.descriptionId,
|
|
30495
|
+
"aria-labelledby": context.titleId,
|
|
30496
|
+
"data-state": getState(context.open),
|
|
30497
|
+
...contentProps,
|
|
30498
|
+
ref: composedRefs,
|
|
30499
|
+
onDismiss: () => context.onOpenChange(false)
|
|
30500
|
+
}
|
|
30501
|
+
)
|
|
30546
30502
|
}
|
|
30547
|
-
|
|
30548
|
-
|
|
30549
|
-
|
|
30550
|
-
|
|
30551
|
-
|
|
30552
|
-
|
|
30553
|
-
|
|
30554
|
-
|
|
30555
|
-
|
|
30556
|
-
|
|
30557
|
-
|
|
30558
|
-
|
|
30559
|
-
|
|
30560
|
-
})
|
|
30561
|
-
|
|
30562
|
-
|
|
30563
|
-
|
|
30564
|
-
|
|
30565
|
-
|
|
30566
|
-
|
|
30567
|
-
|
|
30568
|
-
|
|
30569
|
-
|
|
30570
|
-
|
|
30571
|
-
|
|
30572
|
-
|
|
30573
|
-
|
|
30574
|
-
|
|
30575
|
-
|
|
30576
|
-
|
|
30503
|
+
),
|
|
30504
|
+
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
30505
|
+
/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
|
|
30506
|
+
/* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
30507
|
+
] })
|
|
30508
|
+
] });
|
|
30509
|
+
}
|
|
30510
|
+
);
|
|
30511
|
+
var TITLE_NAME = "DialogTitle";
|
|
30512
|
+
var DialogTitle = React.forwardRef(
|
|
30513
|
+
(props2, forwardedRef) => {
|
|
30514
|
+
const { __scopeDialog, ...titleProps } = props2;
|
|
30515
|
+
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
30516
|
+
return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
30517
|
+
}
|
|
30518
|
+
);
|
|
30519
|
+
DialogTitle.displayName = TITLE_NAME;
|
|
30520
|
+
var DESCRIPTION_NAME = "DialogDescription";
|
|
30521
|
+
var DialogDescription = React.forwardRef(
|
|
30522
|
+
(props2, forwardedRef) => {
|
|
30523
|
+
const { __scopeDialog, ...descriptionProps } = props2;
|
|
30524
|
+
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
30525
|
+
return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
30526
|
+
}
|
|
30527
|
+
);
|
|
30528
|
+
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
30529
|
+
var CLOSE_NAME = "DialogClose";
|
|
30530
|
+
var DialogClose = React.forwardRef(
|
|
30531
|
+
(props2, forwardedRef) => {
|
|
30532
|
+
const { __scopeDialog, ...closeProps } = props2;
|
|
30533
|
+
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
30534
|
+
return /* @__PURE__ */ jsx(
|
|
30535
|
+
Primitive.button,
|
|
30536
|
+
{
|
|
30537
|
+
type: "button",
|
|
30538
|
+
...closeProps,
|
|
30539
|
+
ref: forwardedRef,
|
|
30540
|
+
onClick: composeEventHandlers(props2.onClick, () => context.onOpenChange(false))
|
|
30577
30541
|
}
|
|
30578
|
-
|
|
30579
|
-
}
|
|
30542
|
+
);
|
|
30543
|
+
}
|
|
30544
|
+
);
|
|
30545
|
+
DialogClose.displayName = CLOSE_NAME;
|
|
30546
|
+
function getState(open) {
|
|
30547
|
+
return open ? "open" : "closed";
|
|
30580
30548
|
}
|
|
30581
|
-
|
|
30582
|
-
|
|
30583
|
-
|
|
30549
|
+
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
30550
|
+
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
30551
|
+
contentName: CONTENT_NAME$1,
|
|
30552
|
+
titleName: TITLE_NAME,
|
|
30553
|
+
docsSlug: "dialog"
|
|
30554
|
+
});
|
|
30555
|
+
var TitleWarning = ({ titleId }) => {
|
|
30556
|
+
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
30557
|
+
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
30558
|
+
|
|
30559
|
+
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
30560
|
+
|
|
30561
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
30562
|
+
React.useEffect(() => {
|
|
30563
|
+
if (titleId) {
|
|
30564
|
+
const hasTitle = document.getElementById(titleId);
|
|
30565
|
+
if (!hasTitle) console.error(MESSAGE);
|
|
30566
|
+
}
|
|
30567
|
+
}, [MESSAGE, titleId]);
|
|
30568
|
+
return null;
|
|
30569
|
+
};
|
|
30570
|
+
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
30571
|
+
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
30572
|
+
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
30573
|
+
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
30574
|
+
React.useEffect(() => {
|
|
30575
|
+
var _a2;
|
|
30576
|
+
const describedById = (_a2 = contentRef.current) == null ? void 0 : _a2.getAttribute("aria-describedby");
|
|
30577
|
+
if (descriptionId && describedById) {
|
|
30578
|
+
const hasDescription = document.getElementById(descriptionId);
|
|
30579
|
+
if (!hasDescription) console.warn(MESSAGE);
|
|
30580
|
+
}
|
|
30581
|
+
}, [MESSAGE, contentRef, descriptionId]);
|
|
30582
|
+
return null;
|
|
30583
|
+
};
|
|
30584
|
+
var Root = Dialog;
|
|
30585
|
+
var Portal = DialogPortal;
|
|
30586
|
+
var Overlay = DialogOverlay;
|
|
30587
|
+
var Content$1 = DialogContent;
|
|
30588
|
+
var Title = DialogTitle;
|
|
30589
|
+
var Description = DialogDescription;
|
|
30590
|
+
var Close = DialogClose;
|
|
30591
|
+
const styles$s = {
|
|
30592
|
+
left: {
|
|
30593
|
+
display: "mly78zum5",
|
|
30594
|
+
justifyContent: "mly1lvf691",
|
|
30584
30595
|
$$css: true
|
|
30585
30596
|
},
|
|
30586
|
-
|
|
30597
|
+
right: {
|
|
30587
30598
|
display: "mly78zum5",
|
|
30588
|
-
|
|
30589
|
-
boxShadow: "mly5n1uv4",
|
|
30590
|
-
backgroundColor: "mly12peec7",
|
|
30591
|
-
borderRadius: "mlyur7f20",
|
|
30592
|
-
borderStartStartRadius: null,
|
|
30593
|
-
borderStartEndRadius: null,
|
|
30594
|
-
borderEndStartRadius: null,
|
|
30595
|
-
borderEndEndRadius: null,
|
|
30596
|
-
borderTopLeftRadius: null,
|
|
30597
|
-
borderTopRightRadius: null,
|
|
30598
|
-
borderBottomLeftRadius: null,
|
|
30599
|
-
borderBottomRightRadius: null,
|
|
30600
|
-
padding: "mlye8ttls",
|
|
30601
|
-
paddingInline: null,
|
|
30602
|
-
paddingStart: null,
|
|
30603
|
-
paddingLeft: null,
|
|
30604
|
-
paddingEnd: null,
|
|
30605
|
-
paddingRight: null,
|
|
30606
|
-
paddingBlock: null,
|
|
30607
|
-
paddingTop: null,
|
|
30608
|
-
paddingBottom: null,
|
|
30609
|
-
minWidth: "mlylm99nl",
|
|
30610
|
-
maxWidth: "mly1jkqq1h",
|
|
30611
|
-
gap: "mly167g77z",
|
|
30612
|
-
rowGap: null,
|
|
30613
|
-
columnGap: null,
|
|
30599
|
+
justifyContent: "mly1rfj78v",
|
|
30614
30600
|
$$css: true
|
|
30615
30601
|
},
|
|
30616
|
-
|
|
30617
|
-
|
|
30602
|
+
heading: {
|
|
30603
|
+
gridColumn: "mly623te4",
|
|
30604
|
+
gridColumnStart: null,
|
|
30605
|
+
gridColumnEnd: null,
|
|
30606
|
+
fontWeight: "mly117nqv4",
|
|
30618
30607
|
$$css: true
|
|
30619
|
-
}
|
|
30620
|
-
|
|
30621
|
-
|
|
30622
|
-
|
|
30623
|
-
|
|
30624
|
-
|
|
30625
|
-
|
|
30608
|
+
},
|
|
30609
|
+
label: {
|
|
30610
|
+
whiteSpace: "mlyuxw1ft",
|
|
30611
|
+
$$css: true
|
|
30612
|
+
},
|
|
30613
|
+
divider: {
|
|
30614
|
+
gridColumn: "mly1a80n4u",
|
|
30615
|
+
gridColumnStart: null,
|
|
30616
|
+
gridColumnEnd: null,
|
|
30617
|
+
borderTop: "mlye536se",
|
|
30618
|
+
borderTopWidth: null,
|
|
30619
|
+
borderTopStyle: null,
|
|
30620
|
+
borderTopColor: null,
|
|
30621
|
+
$$css: true
|
|
30622
|
+
},
|
|
30623
|
+
editor: {
|
|
30624
|
+
display: "mly78zum5",
|
|
30625
|
+
flexDirection: "mlydt5ytf",
|
|
30626
|
+
gap: "mly167g77z",
|
|
30627
|
+
rowGap: null,
|
|
30628
|
+
columnGap: null,
|
|
30629
|
+
overflow: "mlyb3r6kr",
|
|
30630
|
+
overflowX: null,
|
|
30631
|
+
overflowY: null,
|
|
30632
|
+
$$css: true
|
|
30633
|
+
},
|
|
30634
|
+
editorGrid: {
|
|
30635
|
+
display: "mlyrvj5dj",
|
|
30636
|
+
gridTemplateColumns: "mly16kridx",
|
|
30637
|
+
gridAutoRows: "mlysd5ean",
|
|
30638
|
+
gap: "mly167g77z",
|
|
30639
|
+
rowGap: null,
|
|
30640
|
+
columnGap: null,
|
|
30641
|
+
overflowY: "mly1odjw0f",
|
|
30642
|
+
$$css: true
|
|
30643
|
+
},
|
|
30644
|
+
editorRow: {
|
|
30645
|
+
display: "mly78zum5",
|
|
30646
|
+
gap: "mly167g77z",
|
|
30647
|
+
rowGap: null,
|
|
30648
|
+
columnGap: null,
|
|
30649
|
+
$$css: true
|
|
30650
|
+
},
|
|
30651
|
+
editorCell: {
|
|
30652
|
+
flexGrow: "mly1iyjqo2",
|
|
30653
|
+
$$css: true
|
|
30654
|
+
},
|
|
30655
|
+
input: {
|
|
30656
|
+
border: "mly27xtdb",
|
|
30657
|
+
borderWidth: null,
|
|
30658
|
+
borderInlineWidth: null,
|
|
30659
|
+
borderInlineStartWidth: null,
|
|
30660
|
+
borderLeftWidth: null,
|
|
30661
|
+
borderInlineEndWidth: null,
|
|
30662
|
+
borderRightWidth: null,
|
|
30663
|
+
borderBlockWidth: null,
|
|
30664
|
+
borderTopWidth: null,
|
|
30665
|
+
borderBottomWidth: null,
|
|
30666
|
+
borderStyle: null,
|
|
30667
|
+
borderInlineStyle: null,
|
|
30668
|
+
borderInlineStartStyle: null,
|
|
30669
|
+
borderLeftStyle: null,
|
|
30670
|
+
borderInlineEndStyle: null,
|
|
30671
|
+
borderRightStyle: null,
|
|
30672
|
+
borderBlockStyle: null,
|
|
30673
|
+
borderTopStyle: null,
|
|
30674
|
+
borderBottomStyle: null,
|
|
30675
|
+
borderColor: null,
|
|
30676
|
+
borderInlineColor: null,
|
|
30677
|
+
borderInlineStartColor: null,
|
|
30678
|
+
borderLeftColor: null,
|
|
30679
|
+
borderInlineEndColor: null,
|
|
30680
|
+
borderRightColor: null,
|
|
30681
|
+
borderBlockColor: null,
|
|
30682
|
+
borderTopColor: null,
|
|
30683
|
+
borderBottomColor: null,
|
|
30684
|
+
borderRadius: "mly12oqio5",
|
|
30685
|
+
borderStartStartRadius: null,
|
|
30686
|
+
borderStartEndRadius: null,
|
|
30687
|
+
borderEndStartRadius: null,
|
|
30688
|
+
borderEndEndRadius: null,
|
|
30689
|
+
borderTopLeftRadius: null,
|
|
30690
|
+
borderTopRightRadius: null,
|
|
30691
|
+
borderBottomLeftRadius: null,
|
|
30692
|
+
borderBottomRightRadius: null,
|
|
30693
|
+
color: "mlyizdh9v",
|
|
30694
|
+
padding: "mly34lxi1",
|
|
30695
|
+
paddingInline: null,
|
|
30696
|
+
paddingStart: null,
|
|
30697
|
+
paddingLeft: null,
|
|
30698
|
+
paddingEnd: null,
|
|
30699
|
+
paddingRight: null,
|
|
30700
|
+
paddingBlock: null,
|
|
30701
|
+
paddingTop: null,
|
|
30702
|
+
paddingBottom: null,
|
|
30703
|
+
$$css: true
|
|
30704
|
+
},
|
|
30705
|
+
card: {
|
|
30706
|
+
maxWidth: "mly1dc814f",
|
|
30707
|
+
$$css: true
|
|
30708
|
+
},
|
|
30709
|
+
infoTrigger: {
|
|
30710
|
+
display: "mly3nfvp2",
|
|
30711
|
+
alignItems: "mly1071x5a",
|
|
30712
|
+
justifyContent: "mlyl56j7k",
|
|
30713
|
+
paddingRight: "mlyy13l1i",
|
|
30714
|
+
paddingInlineStart: null,
|
|
30715
|
+
paddingInlineEnd: null,
|
|
30716
|
+
paddingTop: "mly1iorvi4",
|
|
30717
|
+
$$css: true
|
|
30718
|
+
}
|
|
30719
|
+
};
|
|
30720
|
+
function HoverCard({
|
|
30721
|
+
children,
|
|
30722
|
+
customStyle
|
|
30723
|
+
}) {
|
|
30724
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30725
|
+
..._stylex.props(styles$r.container, fontStyles.body, customStyle),
|
|
30726
|
+
children
|
|
30727
|
+
});
|
|
30728
|
+
}
|
|
30729
|
+
const styles$r = {
|
|
30730
|
+
container: {
|
|
30731
|
+
boxShadow: "mly5n1uv4",
|
|
30732
|
+
backgroundColor: "mly12peec7",
|
|
30733
|
+
borderRadius: "mly4pepcl",
|
|
30734
|
+
borderStartStartRadius: null,
|
|
30735
|
+
borderStartEndRadius: null,
|
|
30736
|
+
borderEndStartRadius: null,
|
|
30737
|
+
borderEndEndRadius: null,
|
|
30738
|
+
borderTopLeftRadius: null,
|
|
30739
|
+
borderTopRightRadius: null,
|
|
30740
|
+
borderBottomLeftRadius: null,
|
|
30741
|
+
borderBottomRightRadius: null,
|
|
30742
|
+
padding: "mlyc7ga6q",
|
|
30743
|
+
paddingInline: null,
|
|
30744
|
+
paddingStart: null,
|
|
30745
|
+
paddingLeft: null,
|
|
30746
|
+
paddingEnd: null,
|
|
30747
|
+
paddingRight: null,
|
|
30748
|
+
paddingBlock: null,
|
|
30749
|
+
paddingTop: null,
|
|
30750
|
+
paddingBottom: null,
|
|
30751
|
+
display: "mly78zum5",
|
|
30752
|
+
flexDirection: "mlydt5ytf",
|
|
30753
|
+
gap: "mly167g77z",
|
|
30754
|
+
rowGap: null,
|
|
30755
|
+
columnGap: null,
|
|
30756
|
+
$$css: true
|
|
30757
|
+
}
|
|
30758
|
+
};
|
|
30759
|
+
function InfoHover({
|
|
30760
|
+
info
|
|
30761
|
+
}) {
|
|
30762
|
+
return /* @__PURE__ */ jsxs(Root3$1, {
|
|
30763
|
+
children: [/* @__PURE__ */ jsx(Trigger$4, {
|
|
30764
|
+
asChild: true,
|
|
30765
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
30766
|
+
..._stylex.props(styles$s.infoTrigger, fontStyles.body),
|
|
30767
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
30768
|
+
name: "info",
|
|
30769
|
+
color: "disabled"
|
|
30770
|
+
})
|
|
30771
|
+
})
|
|
30772
|
+
}), /* @__PURE__ */ jsx(Portal$4, {
|
|
30773
|
+
children: /* @__PURE__ */ jsx(Content2$4, {
|
|
30774
|
+
side: "right",
|
|
30775
|
+
align: "start",
|
|
30776
|
+
children: /* @__PURE__ */ jsx(HoverCard, {
|
|
30777
|
+
customStyle: styles$s.card,
|
|
30778
|
+
children: info
|
|
30779
|
+
})
|
|
30780
|
+
})
|
|
30781
|
+
})]
|
|
30782
|
+
});
|
|
30783
|
+
}
|
|
30784
|
+
function useClickOutside(refOrRefs, handler) {
|
|
30785
|
+
useEffect(() => {
|
|
30786
|
+
const refs = Array.isArray(refOrRefs) ? refOrRefs : [refOrRefs];
|
|
30787
|
+
let down = false;
|
|
30788
|
+
const isInOneElement = (ref, event) => {
|
|
30789
|
+
return !ref.current || event.target instanceof Element && ref.current.contains(event.target);
|
|
30790
|
+
};
|
|
30791
|
+
const isInElement = (event) => {
|
|
30792
|
+
return refs.some((ref) => isInOneElement(ref, event));
|
|
30793
|
+
};
|
|
30794
|
+
const onMouseUp = (event) => {
|
|
30795
|
+
if (!down || isInElement(event)) return;
|
|
30796
|
+
handler(event);
|
|
30797
|
+
down = false;
|
|
30798
|
+
};
|
|
30799
|
+
const onMouseDown = (event) => {
|
|
30800
|
+
if (isInElement(event)) return;
|
|
30801
|
+
down = true;
|
|
30802
|
+
};
|
|
30803
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
30804
|
+
document.addEventListener("mousedown", onMouseDown);
|
|
30805
|
+
return () => {
|
|
30806
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
30807
|
+
document.removeEventListener("mousedown", onMouseDown);
|
|
30808
|
+
};
|
|
30809
|
+
}, [refOrRefs, handler]);
|
|
30810
|
+
}
|
|
30811
|
+
const PillInput = ({
|
|
30812
|
+
values,
|
|
30813
|
+
setValues,
|
|
30814
|
+
autoFocus,
|
|
30815
|
+
placeholder,
|
|
30816
|
+
type = "text",
|
|
30817
|
+
value: controlledValue,
|
|
30818
|
+
setValue: setControlledValue,
|
|
30819
|
+
focusElement,
|
|
30820
|
+
color = DEFAULT_TOKEN_COLOR,
|
|
30821
|
+
customStyle
|
|
30822
|
+
}) => {
|
|
30823
|
+
const [uncontrolledValue, setUncontrolledValue] = useState("");
|
|
30824
|
+
const [_focused, setFocused] = useState(false);
|
|
30825
|
+
const inp = useRef(null);
|
|
30826
|
+
const ref = useRef(null);
|
|
30827
|
+
const [selectedPill, setSelectedPill] = useState(void 0);
|
|
30828
|
+
const pillRefs = useRef([]);
|
|
30829
|
+
const value = controlledValue || uncontrolledValue;
|
|
30830
|
+
const setValue = setControlledValue || setUncontrolledValue;
|
|
30831
|
+
const deletePill = useCallback((idx) => {
|
|
30832
|
+
var _a2;
|
|
30833
|
+
const newValues = [...values];
|
|
30834
|
+
newValues.splice(idx, 1);
|
|
30835
|
+
setValues(newValues);
|
|
30836
|
+
if (selectedPill === 0) {
|
|
30837
|
+
if (values.length === 1) {
|
|
30838
|
+
setSelectedPill(void 0);
|
|
30839
|
+
(_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
30840
|
+
} else {
|
|
30841
|
+
setSelectedPill(0);
|
|
30842
|
+
}
|
|
30843
|
+
} else {
|
|
30844
|
+
setSelectedPill(idx - 1);
|
|
30845
|
+
}
|
|
30846
|
+
}, [selectedPill, setValues, values]);
|
|
30847
|
+
const pills = useMemo(() => {
|
|
30848
|
+
pillRefs.current = new Array(values.length);
|
|
30849
|
+
return values.map((value2, index2) => /* @__PURE__ */ jsx(Pill, {
|
|
30850
|
+
color,
|
|
30851
|
+
onClick: () => {
|
|
30852
|
+
setSelectedPill(index2);
|
|
30853
|
+
},
|
|
30854
|
+
onDelete: () => deletePill(index2),
|
|
30855
|
+
forwardRef: (ref2) => {
|
|
30856
|
+
pillRefs.current[index2] = ref2;
|
|
30857
|
+
},
|
|
30858
|
+
children: value2
|
|
30859
|
+
}, value2));
|
|
30860
|
+
}, [color, deletePill, values]);
|
|
30861
|
+
useEffect(() => {
|
|
30862
|
+
var _a2;
|
|
30863
|
+
if (selectedPill !== void 0) {
|
|
30864
|
+
(_a2 = pillRefs.current[selectedPill]) == null ? void 0 : _a2.focus();
|
|
30865
|
+
}
|
|
30866
|
+
}, [pills, selectedPill]);
|
|
30867
|
+
const onKeyUp = (event) => {
|
|
30868
|
+
var _a2, _b2;
|
|
30869
|
+
if (event.key === "Backspace") {
|
|
30870
|
+
if (selectedPill !== void 0) {
|
|
30871
|
+
deletePill(selectedPill);
|
|
30872
|
+
}
|
|
30873
|
+
} else if (event.key === "ArrowRight") {
|
|
30874
|
+
if (selectedPill === values.length - 1) {
|
|
30875
|
+
setSelectedPill(void 0);
|
|
30876
|
+
(_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
30877
|
+
} else if (selectedPill !== void 0) {
|
|
30878
|
+
setSelectedPill(selectedPill + 1);
|
|
30879
|
+
}
|
|
30880
|
+
} else if (event.key === "ArrowLeft") {
|
|
30881
|
+
if (selectedPill !== void 0 && selectedPill > 0) {
|
|
30882
|
+
setSelectedPill(selectedPill - 1);
|
|
30883
|
+
}
|
|
30884
|
+
} else {
|
|
30885
|
+
(_b2 = inp.current) == null ? void 0 : _b2.focus();
|
|
30886
|
+
}
|
|
30887
|
+
};
|
|
30888
|
+
const commitValue = () => {
|
|
30889
|
+
if (value.length > 0 && !values.includes(value)) {
|
|
30890
|
+
setValues([...values, value]);
|
|
30891
|
+
setValue("");
|
|
30892
|
+
}
|
|
30893
|
+
};
|
|
30894
|
+
useClickOutside(focusElement ? [ref, focusElement] : ref, () => {
|
|
30895
|
+
setFocused(false);
|
|
30896
|
+
commitValue();
|
|
30897
|
+
});
|
|
30898
|
+
return /* @__PURE__ */ jsx("div", {
|
|
30899
|
+
..._stylex.props(fontStyles.body, styles$q.main),
|
|
30900
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
30901
|
+
..._stylex.props(styles$q.content, customStyle),
|
|
30902
|
+
onKeyUp,
|
|
30903
|
+
onClick: () => {
|
|
30904
|
+
var _a2;
|
|
30905
|
+
return (_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
30906
|
+
},
|
|
30907
|
+
ref,
|
|
30908
|
+
children: [pills, /* @__PURE__ */ jsx("input", {
|
|
30909
|
+
...{
|
|
30910
|
+
className: "mly1gs6z28 mly1a2a7pz mly6icuqf mlyif65rj mlyayvuls mly83z2og mly1onzeue mly195ery5 mly1iyjqo2"
|
|
30911
|
+
},
|
|
30912
|
+
ref: inp,
|
|
30913
|
+
type,
|
|
30914
|
+
placeholder: values.length === 0 ? placeholder : "",
|
|
30915
|
+
value,
|
|
30916
|
+
size: 1,
|
|
30917
|
+
onChange: (event) => {
|
|
30918
|
+
setValue(event.target.value);
|
|
30919
|
+
},
|
|
30920
|
+
onKeyDown: (event) => {
|
|
30921
|
+
if (event.key === "Enter") {
|
|
30922
|
+
if (value !== "") {
|
|
30923
|
+
commitValue();
|
|
30924
|
+
event.stopPropagation();
|
|
30925
|
+
event.preventDefault();
|
|
30926
|
+
}
|
|
30927
|
+
}
|
|
30928
|
+
},
|
|
30929
|
+
onKeyUp: (event) => {
|
|
30930
|
+
var _a2, _b2, _c2, _d;
|
|
30931
|
+
if (event.key === "Backspace") {
|
|
30932
|
+
if (value === "" && values.length > 0) {
|
|
30933
|
+
commitValue();
|
|
30934
|
+
(_a2 = inp.current) == null ? void 0 : _a2.blur();
|
|
30935
|
+
setSelectedPill(values.length - 1);
|
|
30936
|
+
}
|
|
30937
|
+
} else if (event.key === "ArrowLeft") {
|
|
30938
|
+
if (((_b2 = inp.current) == null ? void 0 : _b2.selectionStart) === 0 || ((_c2 = inp.current) == null ? void 0 : _c2.selectionStart) === null) {
|
|
30939
|
+
commitValue();
|
|
30940
|
+
(_d = inp.current) == null ? void 0 : _d.blur();
|
|
30941
|
+
setSelectedPill(values.length - 1);
|
|
30942
|
+
event.preventDefault();
|
|
30943
|
+
event.stopPropagation();
|
|
30944
|
+
}
|
|
30945
|
+
}
|
|
30946
|
+
},
|
|
30947
|
+
onFocus: () => {
|
|
30948
|
+
setFocused(true);
|
|
30949
|
+
setSelectedPill(void 0);
|
|
30950
|
+
},
|
|
30951
|
+
autoFocus
|
|
30952
|
+
})]
|
|
30953
|
+
})
|
|
30954
|
+
});
|
|
30955
|
+
};
|
|
30956
|
+
const Pill = ({
|
|
30957
|
+
children,
|
|
30958
|
+
color = DEFAULT_TOKEN_COLOR,
|
|
30959
|
+
forwardRef,
|
|
30960
|
+
onClick,
|
|
30961
|
+
onDelete
|
|
30962
|
+
}) => {
|
|
30963
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
30964
|
+
onClick,
|
|
30965
|
+
tabIndex: 0,
|
|
30966
|
+
ref: forwardRef,
|
|
30967
|
+
..._stylex.props(styles$q.pill, colorVariants[color]),
|
|
30968
|
+
children: [children, /* @__PURE__ */ jsx("div", {
|
|
30969
|
+
title: "Remove",
|
|
30970
|
+
...{
|
|
30971
|
+
className: "mly3nfvp2"
|
|
30972
|
+
},
|
|
30973
|
+
children: /* @__PURE__ */ jsx(SvgClear, {
|
|
30974
|
+
onClick: () => onDelete(),
|
|
30975
|
+
...{
|
|
30976
|
+
className: "mly6jxa94 mly1v9usgg"
|
|
30977
|
+
}
|
|
30978
|
+
})
|
|
30979
|
+
})]
|
|
30980
|
+
});
|
|
30981
|
+
};
|
|
30982
|
+
const styles$q = {
|
|
30983
|
+
main: {
|
|
30984
|
+
borderRadius: "mly12oqio5",
|
|
30985
|
+
borderStartStartRadius: null,
|
|
30986
|
+
borderStartEndRadius: null,
|
|
30987
|
+
borderEndStartRadius: null,
|
|
30988
|
+
borderEndEndRadius: null,
|
|
30989
|
+
borderTopLeftRadius: null,
|
|
30990
|
+
borderTopRightRadius: null,
|
|
30991
|
+
borderBottomLeftRadius: null,
|
|
30992
|
+
borderBottomRightRadius: null,
|
|
30993
|
+
border: "mlyvckdp7",
|
|
30994
|
+
borderWidth: null,
|
|
30995
|
+
borderInlineWidth: null,
|
|
30996
|
+
borderInlineStartWidth: null,
|
|
30997
|
+
borderLeftWidth: null,
|
|
30998
|
+
borderInlineEndWidth: null,
|
|
30999
|
+
borderRightWidth: null,
|
|
31000
|
+
borderBlockWidth: null,
|
|
31001
|
+
borderTopWidth: null,
|
|
31002
|
+
borderBottomWidth: null,
|
|
31003
|
+
borderStyle: null,
|
|
31004
|
+
borderInlineStyle: null,
|
|
31005
|
+
borderInlineStartStyle: null,
|
|
31006
|
+
borderLeftStyle: null,
|
|
31007
|
+
borderInlineEndStyle: null,
|
|
31008
|
+
borderRightStyle: null,
|
|
31009
|
+
borderBlockStyle: null,
|
|
31010
|
+
borderTopStyle: null,
|
|
31011
|
+
borderBottomStyle: null,
|
|
31012
|
+
borderColor: null,
|
|
31013
|
+
borderInlineColor: null,
|
|
31014
|
+
borderInlineStartColor: null,
|
|
31015
|
+
borderLeftColor: null,
|
|
31016
|
+
borderInlineEndColor: null,
|
|
31017
|
+
borderRightColor: null,
|
|
31018
|
+
borderBlockColor: null,
|
|
31019
|
+
borderTopColor: null,
|
|
31020
|
+
borderBottomColor: null,
|
|
31021
|
+
padding: "mlybsehbd",
|
|
31022
|
+
paddingInline: null,
|
|
31023
|
+
paddingStart: null,
|
|
31024
|
+
paddingLeft: null,
|
|
31025
|
+
paddingEnd: null,
|
|
31026
|
+
paddingRight: null,
|
|
31027
|
+
paddingBlock: null,
|
|
31028
|
+
paddingTop: null,
|
|
31029
|
+
paddingBottom: null,
|
|
31030
|
+
display: "mlyrvj5dj",
|
|
31031
|
+
minHeight: "mly2lwn1j",
|
|
31032
|
+
overflow: "mlyysyzu8",
|
|
31033
|
+
overflowX: null,
|
|
31034
|
+
overflowY: null,
|
|
31035
|
+
$$css: true
|
|
31036
|
+
},
|
|
31037
|
+
content: {
|
|
31038
|
+
outline: "mly1a2a7pz",
|
|
31039
|
+
outlineColor: null,
|
|
31040
|
+
outlineOffset: null,
|
|
31041
|
+
outlineStyle: null,
|
|
31042
|
+
outlineWidth: null,
|
|
31043
|
+
display: "mly78zum5",
|
|
31044
|
+
flexWrap: "mly1a02dak",
|
|
31045
|
+
gap: "mly1ed6fcf",
|
|
31046
|
+
rowGap: null,
|
|
31047
|
+
columnGap: null,
|
|
31048
|
+
borderColor: "mly1akygb0 mlyetl2wx",
|
|
31049
|
+
borderInlineColor: null,
|
|
31050
|
+
borderInlineStartColor: null,
|
|
31051
|
+
borderLeftColor: null,
|
|
31052
|
+
borderInlineEndColor: null,
|
|
31053
|
+
borderRightColor: null,
|
|
31054
|
+
borderBlockColor: null,
|
|
31055
|
+
borderTopColor: null,
|
|
31056
|
+
borderBottomColor: null,
|
|
31057
|
+
$$css: true
|
|
31058
|
+
},
|
|
31059
|
+
pill: {
|
|
31060
|
+
backgroundColor: "mlyy9rfsq",
|
|
31061
|
+
borderRadius: "mly1sxf85j",
|
|
31062
|
+
borderStartStartRadius: null,
|
|
31063
|
+
borderStartEndRadius: null,
|
|
31064
|
+
borderEndStartRadius: null,
|
|
31065
|
+
borderEndEndRadius: null,
|
|
31066
|
+
borderTopLeftRadius: null,
|
|
31067
|
+
borderTopRightRadius: null,
|
|
31068
|
+
borderBottomLeftRadius: null,
|
|
31069
|
+
borderBottomRightRadius: null,
|
|
31070
|
+
color: "mly1xre2ib",
|
|
31071
|
+
display: "mly78zum5",
|
|
31072
|
+
alignItems: "mly6s0dn4",
|
|
31073
|
+
gap: "mly1nejdyq",
|
|
31074
|
+
rowGap: null,
|
|
31075
|
+
columnGap: null,
|
|
31076
|
+
padding: "mly1e41zw8",
|
|
31077
|
+
paddingInline: null,
|
|
31078
|
+
paddingStart: null,
|
|
31079
|
+
paddingLeft: null,
|
|
31080
|
+
paddingEnd: null,
|
|
31081
|
+
paddingRight: null,
|
|
31082
|
+
paddingBlock: null,
|
|
31083
|
+
paddingTop: null,
|
|
31084
|
+
paddingBottom: null,
|
|
31085
|
+
textTransform: "mly6mezaz",
|
|
31086
|
+
cursor: "mly1ypdohk",
|
|
31087
|
+
height: "mly1qx5ct2",
|
|
31088
|
+
whiteSpace: "mlyuxw1ft",
|
|
31089
|
+
$$css: true
|
|
31090
|
+
}
|
|
31091
|
+
};
|
|
31092
|
+
const colorVariants = {
|
|
31093
|
+
default: {
|
|
31094
|
+
"--mlyvygx4q": "mly1izbou4",
|
|
31095
|
+
"--mly13n7235": "mly8bgh0r",
|
|
31096
|
+
$$css: true
|
|
31097
|
+
},
|
|
31098
|
+
purple: {
|
|
31099
|
+
"--mlyvygx4q": "mly1f8soc4",
|
|
31100
|
+
"--mly13n7235": "mly1r5zvhd",
|
|
31101
|
+
$$css: true
|
|
31102
|
+
},
|
|
31103
|
+
green: {
|
|
31104
|
+
"--mlyvygx4q": "mlyf8wvcd",
|
|
31105
|
+
"--mly13n7235": "mly1u6t2w6",
|
|
31106
|
+
$$css: true
|
|
31107
|
+
},
|
|
31108
|
+
cyan: {
|
|
31109
|
+
"--mlyvygx4q": "mlyrtwgpv",
|
|
31110
|
+
"--mly13n7235": "mlys5r2en",
|
|
31111
|
+
$$css: true
|
|
31112
|
+
}
|
|
31113
|
+
};
|
|
31114
|
+
function OneOfEditor({
|
|
31115
|
+
view,
|
|
31116
|
+
name,
|
|
31117
|
+
path,
|
|
31118
|
+
current,
|
|
31119
|
+
option: option2,
|
|
31120
|
+
updateCurrent
|
|
31121
|
+
}) {
|
|
31122
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31123
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31124
|
+
..._stylex.props(styles$s.label, styles$s.left),
|
|
31125
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
31126
|
+
children: [option2.title ?? name, ":"]
|
|
31127
|
+
})
|
|
31128
|
+
}), /* @__PURE__ */ jsx("div", {}), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31129
|
+
info: option2.description
|
|
31130
|
+
}) : /* @__PURE__ */ jsx("div", {}), option2.oneOf.map((subOption, key2) => {
|
|
31131
|
+
switch (subOption.type) {
|
|
31132
|
+
case "string":
|
|
31133
|
+
return /* @__PURE__ */ jsx(OneOfStringEditor, {
|
|
31134
|
+
view,
|
|
31135
|
+
name,
|
|
31136
|
+
path,
|
|
31137
|
+
updateCurrent,
|
|
31138
|
+
current,
|
|
31139
|
+
option: subOption
|
|
31140
|
+
}, key2);
|
|
31141
|
+
case "number":
|
|
31142
|
+
return /* @__PURE__ */ jsx(OneOfNumberEditor, {
|
|
31143
|
+
view,
|
|
31144
|
+
name,
|
|
31145
|
+
path,
|
|
31146
|
+
updateCurrent,
|
|
31147
|
+
current,
|
|
31148
|
+
option: subOption
|
|
31149
|
+
}, key2);
|
|
31150
|
+
case "array":
|
|
31151
|
+
return /* @__PURE__ */ jsx(OneOfArrayEditor, {
|
|
31152
|
+
view,
|
|
31153
|
+
name,
|
|
31154
|
+
path,
|
|
31155
|
+
updateCurrent,
|
|
31156
|
+
current,
|
|
31157
|
+
option: subOption
|
|
31158
|
+
}, key2);
|
|
31159
|
+
}
|
|
31160
|
+
return null;
|
|
31161
|
+
})]
|
|
31162
|
+
});
|
|
31163
|
+
}
|
|
31164
|
+
function OneOfStringEditor({
|
|
31165
|
+
path,
|
|
31166
|
+
current,
|
|
31167
|
+
updateCurrent,
|
|
31168
|
+
option: option2
|
|
31169
|
+
}) {
|
|
31170
|
+
const isString2 = typeof current === "string";
|
|
31171
|
+
const [value, setValue] = useState(isString2 ? current : "");
|
|
31172
|
+
if (option2.enum) {
|
|
31173
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31174
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31175
|
+
..._stylex.props(styles$s.left),
|
|
31176
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
31177
|
+
type: "radio",
|
|
31178
|
+
checked: isString2 && option2.enum.includes(current),
|
|
31179
|
+
onChange: ({
|
|
31180
|
+
target: {
|
|
31181
|
+
checked
|
|
31182
|
+
}
|
|
31183
|
+
}) => {
|
|
31184
|
+
if (checked) {
|
|
31185
|
+
updateCurrent(path, value);
|
|
31186
|
+
}
|
|
31187
|
+
}
|
|
31188
|
+
})
|
|
31189
|
+
}), option2.enum.length > 1 ? /* @__PURE__ */ jsx(SelectDropdown, {
|
|
31190
|
+
value,
|
|
31191
|
+
options: option2.enum.map((value2) => ({
|
|
31192
|
+
label: value2,
|
|
31193
|
+
value: value2
|
|
31194
|
+
})),
|
|
31195
|
+
onChange: (value2) => {
|
|
31196
|
+
setValue(value2);
|
|
31197
|
+
updateCurrent(path, value2);
|
|
31198
|
+
}
|
|
31199
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
31200
|
+
children: option2.enum[0]
|
|
31201
|
+
}), /* @__PURE__ */ jsx("div", {})]
|
|
31202
|
+
});
|
|
31203
|
+
} else {
|
|
31204
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31205
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31206
|
+
..._stylex.props(styles$s.left),
|
|
31207
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
31208
|
+
type: "radio",
|
|
31209
|
+
checked: isString2,
|
|
31210
|
+
onChange: ({
|
|
31211
|
+
target: {
|
|
31212
|
+
checked
|
|
31213
|
+
}
|
|
31214
|
+
}) => {
|
|
31215
|
+
if (checked) {
|
|
31216
|
+
updateCurrent(path, value);
|
|
31217
|
+
}
|
|
31218
|
+
}
|
|
31219
|
+
})
|
|
31220
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
31221
|
+
value,
|
|
31222
|
+
onChange: ({
|
|
31223
|
+
target: {
|
|
31224
|
+
value: value2
|
|
31225
|
+
}
|
|
31226
|
+
}) => {
|
|
31227
|
+
setValue(value2);
|
|
31228
|
+
updateCurrent(path, value2);
|
|
31229
|
+
}
|
|
31230
|
+
}), /* @__PURE__ */ jsx("div", {})]
|
|
31231
|
+
});
|
|
31232
|
+
}
|
|
31233
|
+
}
|
|
31234
|
+
function OneOfNumberEditor({
|
|
31235
|
+
path,
|
|
31236
|
+
current,
|
|
31237
|
+
updateCurrent,
|
|
31238
|
+
option: option2
|
|
31239
|
+
}) {
|
|
31240
|
+
const isNumber2 = typeof current === "number";
|
|
31241
|
+
const [value, setValue] = useState(isNumber2 ? current : option2.minimum ?? 0);
|
|
31242
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31243
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31244
|
+
..._stylex.props(styles$s.left),
|
|
31245
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
31246
|
+
type: "radio",
|
|
31247
|
+
checked: isNumber2,
|
|
31248
|
+
onChange: ({
|
|
31249
|
+
target: {
|
|
31250
|
+
checked
|
|
31251
|
+
}
|
|
31252
|
+
}) => {
|
|
31253
|
+
if (checked) {
|
|
31254
|
+
updateCurrent(path, value);
|
|
31255
|
+
}
|
|
31256
|
+
}
|
|
31257
|
+
})
|
|
31258
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
31259
|
+
type: "number",
|
|
31260
|
+
min: option2.minimum,
|
|
31261
|
+
max: option2.maximum,
|
|
31262
|
+
value,
|
|
31263
|
+
onChange: ({
|
|
31264
|
+
target: {
|
|
31265
|
+
valueAsNumber
|
|
31266
|
+
}
|
|
31267
|
+
}) => {
|
|
31268
|
+
setValue(value);
|
|
31269
|
+
updateCurrent(path, valueAsNumber);
|
|
31270
|
+
},
|
|
31271
|
+
..._stylex.props(styles$s.input)
|
|
31272
|
+
}), /* @__PURE__ */ jsx("div", {})]
|
|
31273
|
+
});
|
|
31274
|
+
}
|
|
31275
|
+
function OneOfArrayEditor({
|
|
31276
|
+
path,
|
|
31277
|
+
current,
|
|
31278
|
+
updateCurrent
|
|
31279
|
+
}) {
|
|
31280
|
+
const isArray2 = Array.isArray(current);
|
|
31281
|
+
const [value, setValue] = useState(isArray2 ? current : []);
|
|
31282
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31283
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31284
|
+
..._stylex.props(styles$s.left),
|
|
31285
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
31286
|
+
type: "radio",
|
|
31287
|
+
checked: isArray2,
|
|
31288
|
+
onChange: ({
|
|
31289
|
+
target: {
|
|
31290
|
+
checked
|
|
31291
|
+
}
|
|
31292
|
+
}) => {
|
|
31293
|
+
if (checked) {
|
|
31294
|
+
updateCurrent(path, value);
|
|
31295
|
+
}
|
|
31296
|
+
}
|
|
31297
|
+
})
|
|
31298
|
+
}), /* @__PURE__ */ jsx(PillInput, {
|
|
31299
|
+
values: value,
|
|
31300
|
+
setValues: (values) => {
|
|
31301
|
+
setValue(values);
|
|
31302
|
+
updateCurrent(path, values);
|
|
31303
|
+
}
|
|
31304
|
+
}), /* @__PURE__ */ jsx("div", {})]
|
|
31305
|
+
});
|
|
31306
|
+
}
|
|
31307
|
+
function ArrayEditor({
|
|
31308
|
+
name,
|
|
31309
|
+
path,
|
|
31310
|
+
current,
|
|
31311
|
+
option: option2,
|
|
31312
|
+
updateCurrent
|
|
31313
|
+
}) {
|
|
31314
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31315
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31316
|
+
..._stylex.props(styles$s.left, styles$s.label),
|
|
31317
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
31318
|
+
children: [option2.title ?? name, ":"]
|
|
31319
|
+
})
|
|
31320
|
+
}), /* @__PURE__ */ jsx(PillInput, {
|
|
31321
|
+
values: current,
|
|
31322
|
+
setValues: (values) => {
|
|
31323
|
+
updateCurrent(path, values);
|
|
31324
|
+
}
|
|
31325
|
+
}), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31326
|
+
info: option2.description
|
|
31327
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31328
|
+
});
|
|
31329
|
+
}
|
|
31330
|
+
function NumberEditor$1({
|
|
31331
|
+
name,
|
|
31332
|
+
path,
|
|
31333
|
+
current,
|
|
31334
|
+
option: option2,
|
|
31335
|
+
updateCurrent
|
|
31336
|
+
}) {
|
|
31337
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31338
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31339
|
+
..._stylex.props(styles$s.left, styles$s.label),
|
|
31340
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
31341
|
+
children: [option2.title ?? name, ":"]
|
|
31342
|
+
})
|
|
31343
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
31344
|
+
value: current,
|
|
31345
|
+
type: "number",
|
|
31346
|
+
min: option2.minimum,
|
|
31347
|
+
max: option2.maximum,
|
|
31348
|
+
onChange: ({
|
|
31349
|
+
target: {
|
|
31350
|
+
valueAsNumber
|
|
31351
|
+
}
|
|
31352
|
+
}) => {
|
|
31353
|
+
updateCurrent(path, valueAsNumber);
|
|
31354
|
+
},
|
|
31355
|
+
..._stylex.props(styles$s.input)
|
|
31356
|
+
}, name), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31357
|
+
info: option2.description
|
|
31358
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31359
|
+
});
|
|
31360
|
+
}
|
|
31361
|
+
function StringEditor$1({
|
|
31362
|
+
name,
|
|
31363
|
+
path,
|
|
31364
|
+
current,
|
|
31365
|
+
option: option2,
|
|
31366
|
+
updateCurrent
|
|
31367
|
+
}) {
|
|
31368
|
+
if (option2.enum) {
|
|
31369
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31370
|
+
children: [/* @__PURE__ */ createElement("div", {
|
|
31371
|
+
..._stylex.props(styles$s.left, styles$s.label),
|
|
31372
|
+
key: `${name}-label`
|
|
31373
|
+
}, /* @__PURE__ */ jsxs("label", {
|
|
31374
|
+
children: [option2.title ?? name, ":"]
|
|
31375
|
+
})), /* @__PURE__ */ jsx(SelectDropdown, {
|
|
31376
|
+
value: current,
|
|
31377
|
+
options: option2.enum.map((value) => ({
|
|
31378
|
+
label: value,
|
|
31379
|
+
value
|
|
31380
|
+
})),
|
|
31381
|
+
onChange: (value) => {
|
|
31382
|
+
updateCurrent(path, value);
|
|
31383
|
+
}
|
|
31384
|
+
}, name), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31385
|
+
info: option2.description
|
|
31386
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31387
|
+
});
|
|
31388
|
+
} else {
|
|
31389
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31390
|
+
children: [/* @__PURE__ */ createElement("div", {
|
|
31391
|
+
..._stylex.props(styles$s.left, styles$s.label),
|
|
31392
|
+
key: `${name}-label`
|
|
31393
|
+
}, /* @__PURE__ */ jsxs("label", {
|
|
31394
|
+
children: [option2.title ?? name, ":"]
|
|
31395
|
+
})), /* @__PURE__ */ jsx("input", {
|
|
31396
|
+
value: current,
|
|
31397
|
+
onChange: ({
|
|
31398
|
+
target: {
|
|
31399
|
+
value
|
|
31400
|
+
}
|
|
31401
|
+
}) => {
|
|
31402
|
+
updateCurrent(path, value);
|
|
31403
|
+
}
|
|
31404
|
+
}, name), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31405
|
+
info: option2.description
|
|
31406
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31407
|
+
});
|
|
31408
|
+
}
|
|
31409
|
+
}
|
|
31410
|
+
function BooleanEditor({
|
|
31411
|
+
name,
|
|
31412
|
+
path,
|
|
31413
|
+
current,
|
|
31414
|
+
option: option2,
|
|
31415
|
+
updateCurrent
|
|
31416
|
+
}) {
|
|
31417
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31418
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31419
|
+
..._stylex.props(styles$s.left),
|
|
31420
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
31421
|
+
..._stylex.props(styles$s.label),
|
|
31422
|
+
htmlFor: `${name}-checkbox`,
|
|
31423
|
+
children: [option2.title ?? name, ":"]
|
|
31424
|
+
}, `${name}-label`)
|
|
31425
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
31426
|
+
..._stylex.props(styles$s.right),
|
|
31427
|
+
children: /* @__PURE__ */ jsx("input", {
|
|
31428
|
+
type: "checkbox",
|
|
31429
|
+
checked: current,
|
|
31430
|
+
onChange: ({
|
|
31431
|
+
target: {
|
|
31432
|
+
checked
|
|
31433
|
+
}
|
|
31434
|
+
}) => {
|
|
31435
|
+
updateCurrent(path, checked);
|
|
31436
|
+
},
|
|
31437
|
+
id: `${name}-checkbox`
|
|
31438
|
+
})
|
|
31439
|
+
}), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31440
|
+
info: option2.description
|
|
31441
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31442
|
+
});
|
|
31443
|
+
}
|
|
31444
|
+
function FieldEditor({
|
|
31445
|
+
view,
|
|
31446
|
+
name,
|
|
31447
|
+
path,
|
|
31448
|
+
current,
|
|
31449
|
+
option: option2,
|
|
31450
|
+
updateCurrent
|
|
31451
|
+
}) {
|
|
31452
|
+
const [searchValue, setSearchValue] = useState("");
|
|
31453
|
+
const valueListRef = useRef(null);
|
|
31454
|
+
const jsonFields = current ?? [];
|
|
31455
|
+
const fields = jsonFields.map((field) => {
|
|
31456
|
+
try {
|
|
31457
|
+
return JSON.parse(field)[0];
|
|
31458
|
+
} catch (e) {
|
|
31459
|
+
console.warn("Failed to parse field", field, e);
|
|
31460
|
+
return "";
|
|
31461
|
+
}
|
|
31462
|
+
});
|
|
31463
|
+
const updateFields = (path2, value) => {
|
|
31464
|
+
const jsonFields2 = value.map((field) => JSON.stringify([field]));
|
|
31465
|
+
updateCurrent(path2, jsonFields2);
|
|
31466
|
+
};
|
|
31467
|
+
const lcSearch = searchValue.toLocaleLowerCase();
|
|
31468
|
+
const dimensions = view.definition.getOutputSchema().fields;
|
|
31469
|
+
const filteredFields = dimensions.filter((field) => field.name.toLocaleLowerCase().includes(lcSearch)).filter((field) => !fields.includes(field.name)).filter((field) => {
|
|
31470
|
+
var _a2;
|
|
31471
|
+
return !("fieldTypes" in option2.items) || ((_a2 = option2.items.fieldTypes) == null ? void 0 : _a2.includes(field.type.kind));
|
|
31472
|
+
});
|
|
31473
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31474
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31475
|
+
..._stylex.props(styles$s.left, styles$s.label),
|
|
31476
|
+
children: /* @__PURE__ */ jsxs("label", {
|
|
31477
|
+
children: [option2.title ?? name, ":"]
|
|
31478
|
+
})
|
|
31479
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
31480
|
+
style: {
|
|
31481
|
+
minHeight: 0,
|
|
31482
|
+
display: "grid",
|
|
31483
|
+
gap: 4
|
|
31484
|
+
},
|
|
31485
|
+
children: [/* @__PURE__ */ jsx(PillInput, {
|
|
31486
|
+
values: fields,
|
|
31487
|
+
setValues: (values) => {
|
|
31488
|
+
updateFields(path, values);
|
|
31489
|
+
},
|
|
31490
|
+
value: searchValue,
|
|
31491
|
+
setValue: setSearchValue,
|
|
31492
|
+
focusElement: valueListRef
|
|
31493
|
+
}), /* @__PURE__ */ jsx(FieldList$1, {
|
|
31494
|
+
ref: valueListRef,
|
|
31495
|
+
fields: filteredFields,
|
|
31496
|
+
search: searchValue,
|
|
31497
|
+
onClick: (value) => {
|
|
31498
|
+
updateFields(path, [...fields, value]);
|
|
31499
|
+
}
|
|
31500
|
+
})]
|
|
31501
|
+
}), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31502
|
+
info: option2.description
|
|
31503
|
+
}) : /* @__PURE__ */ jsx("div", {})]
|
|
31504
|
+
});
|
|
31505
|
+
}
|
|
31506
|
+
function FieldList$1({
|
|
31507
|
+
ref,
|
|
31508
|
+
fields,
|
|
31509
|
+
search,
|
|
31510
|
+
onClick
|
|
31511
|
+
}) {
|
|
31512
|
+
if (fields.length) {
|
|
31513
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31514
|
+
ref,
|
|
31515
|
+
...{
|
|
31516
|
+
className: "mly78zum5 mly1a02dak mly1jnr06f"
|
|
31517
|
+
},
|
|
31518
|
+
children: fields.map((field) => /* @__PURE__ */ jsx(FieldToken, {
|
|
31519
|
+
field,
|
|
31520
|
+
onClick: () => onClick(field.name),
|
|
31521
|
+
tooltip: /* @__PURE__ */ jsx(FieldHoverCard, {
|
|
31522
|
+
field,
|
|
31523
|
+
path: []
|
|
31524
|
+
}),
|
|
31525
|
+
tooltipProps: {
|
|
31526
|
+
side: "right",
|
|
31527
|
+
align: "start",
|
|
31528
|
+
sideOffset: 4,
|
|
31529
|
+
alignOffset: 24
|
|
31530
|
+
}
|
|
31531
|
+
}, field.name))
|
|
31532
|
+
});
|
|
31533
|
+
} else {
|
|
31534
|
+
if (search) {
|
|
31535
|
+
return /* @__PURE__ */ jsx("div", {
|
|
31536
|
+
...{},
|
|
31537
|
+
"data-disabled": "true",
|
|
31538
|
+
children: "No matching fields"
|
|
31539
|
+
});
|
|
31540
|
+
}
|
|
31541
|
+
}
|
|
31542
|
+
}
|
|
31543
|
+
function ObjectEditor({
|
|
31544
|
+
view,
|
|
31545
|
+
name,
|
|
31546
|
+
path,
|
|
31547
|
+
current,
|
|
31548
|
+
option: option2,
|
|
31549
|
+
updateCurrent
|
|
31550
|
+
}) {
|
|
31551
|
+
const [isExpanded, setIsExpanded] = useState(path.length === 0);
|
|
31552
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
31553
|
+
children: [name ? /* @__PURE__ */ jsxs(Fragment, {
|
|
31554
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
31555
|
+
..._stylex.props(styles$s.label, styles$s.heading),
|
|
31556
|
+
children: [/* @__PURE__ */ jsx("label", {
|
|
31557
|
+
children: option2.title ?? name
|
|
31558
|
+
}), option2.description ? /* @__PURE__ */ jsx(InfoHover, {
|
|
31559
|
+
info: option2.description
|
|
31560
|
+
}) : null]
|
|
31561
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
31562
|
+
variant: "flat",
|
|
31563
|
+
size: "compact",
|
|
31564
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
31565
|
+
icon: isExpanded ? "chevronDown" : "chevronRight",
|
|
31566
|
+
tooltip: isExpanded ? "Collapse" : "Expand"
|
|
31567
|
+
})]
|
|
31568
|
+
}) : null, isExpanded ? Object.entries(option2.properties).map(([subName, subOption]) => {
|
|
31569
|
+
const key2 = [...path, name, subName].join(".");
|
|
31570
|
+
if (subOption.type === "boolean") {
|
|
31571
|
+
return /* @__PURE__ */ jsx(BooleanEditor, {
|
|
31572
|
+
view,
|
|
31573
|
+
name: subName,
|
|
31574
|
+
path: [...path, subName],
|
|
31575
|
+
option: subOption,
|
|
31576
|
+
current: current[subName],
|
|
31577
|
+
updateCurrent
|
|
31578
|
+
}, key2);
|
|
31579
|
+
} else if (subOption.type === "string") {
|
|
31580
|
+
return /* @__PURE__ */ jsx(StringEditor$1, {
|
|
31581
|
+
view,
|
|
31582
|
+
name: subName,
|
|
31583
|
+
path: [...path, subName],
|
|
31584
|
+
option: subOption,
|
|
31585
|
+
current: current[subName],
|
|
31586
|
+
updateCurrent
|
|
31587
|
+
}, key2);
|
|
31588
|
+
} else if (subOption.type === "number") {
|
|
31589
|
+
return /* @__PURE__ */ jsx(NumberEditor$1, {
|
|
31590
|
+
view,
|
|
31591
|
+
name: subName,
|
|
31592
|
+
path: [...path, subName],
|
|
31593
|
+
option: subOption,
|
|
31594
|
+
current: current[subName],
|
|
31595
|
+
updateCurrent
|
|
31596
|
+
}, key2);
|
|
31597
|
+
} else if (subOption.type === "object") {
|
|
31598
|
+
return /* @__PURE__ */ jsx(ObjectEditor, {
|
|
31599
|
+
view,
|
|
31600
|
+
name: subName,
|
|
31601
|
+
path: [...path, subName],
|
|
31602
|
+
option: subOption,
|
|
31603
|
+
current: current[subName] ?? {},
|
|
31604
|
+
updateCurrent
|
|
31605
|
+
}, key2);
|
|
31606
|
+
} else if (subOption.type === "array") {
|
|
31607
|
+
if (subOption.items.type === "string") {
|
|
31608
|
+
if ("subtype" in subOption.items && subOption.items.subtype === "field") {
|
|
31609
|
+
return /* @__PURE__ */ jsx(FieldEditor, {
|
|
31610
|
+
view,
|
|
31611
|
+
name: subName,
|
|
31612
|
+
path: [...path, subName],
|
|
31613
|
+
option: subOption,
|
|
31614
|
+
current: current[subName] ?? [],
|
|
31615
|
+
updateCurrent
|
|
31616
|
+
}, key2);
|
|
31617
|
+
} else {
|
|
31618
|
+
return /* @__PURE__ */ jsx(ArrayEditor, {
|
|
31619
|
+
view,
|
|
31620
|
+
name: subName,
|
|
31621
|
+
path: [...path, subName],
|
|
31622
|
+
option: subOption,
|
|
31623
|
+
current: current[subName] ?? [],
|
|
31624
|
+
updateCurrent
|
|
31625
|
+
}, key2);
|
|
31626
|
+
}
|
|
31627
|
+
} else {
|
|
31628
|
+
console.warn("Unsupported array type", subOption.items.type);
|
|
31629
|
+
}
|
|
31630
|
+
} else if (subOption.type === "oneOf") {
|
|
31631
|
+
return /* @__PURE__ */ jsx(OneOfEditor, {
|
|
31632
|
+
view,
|
|
31633
|
+
name: subName,
|
|
31634
|
+
path: [...path, subName],
|
|
31635
|
+
option: subOption,
|
|
31636
|
+
current: current[subName],
|
|
31637
|
+
updateCurrent
|
|
31638
|
+
}, key2);
|
|
31639
|
+
}
|
|
31640
|
+
return null;
|
|
31641
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
31642
|
+
..._stylex.props(styles$s.divider)
|
|
31643
|
+
})]
|
|
31644
|
+
});
|
|
31645
|
+
}
|
|
31646
|
+
function VizEditor({
|
|
31647
|
+
rootQuery,
|
|
31648
|
+
view,
|
|
31649
|
+
plugin,
|
|
31650
|
+
setOpen
|
|
31651
|
+
}) {
|
|
30626
31652
|
const {
|
|
30627
31653
|
setQuery
|
|
30628
31654
|
} = useContext(QueryEditorContext);
|
|
30629
|
-
const
|
|
30630
|
-
|
|
30631
|
-
const
|
|
30632
|
-
const
|
|
30633
|
-
|
|
31655
|
+
const [current, setCurrent] = useState(plugin.getSettings());
|
|
31656
|
+
console.info("RendererEditor current settings:", current);
|
|
31657
|
+
const schema = plugin.getSchema();
|
|
31658
|
+
const updateCurrent = (path, value) => {
|
|
31659
|
+
const newCurrent = {
|
|
31660
|
+
...current
|
|
31661
|
+
};
|
|
31662
|
+
let target = newCurrent;
|
|
31663
|
+
for (let i2 = 0; i2 < path.length - 1; i2++) {
|
|
31664
|
+
if (!(path[i2] in target)) {
|
|
31665
|
+
target[path[i2]] = {};
|
|
31666
|
+
}
|
|
31667
|
+
target = target[path[i2]];
|
|
31668
|
+
}
|
|
31669
|
+
target[path[path.length - 1]] = value;
|
|
31670
|
+
setCurrent(newCurrent);
|
|
31671
|
+
};
|
|
31672
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31673
|
+
..._stylex.props(styles$s.editor),
|
|
31674
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
31675
|
+
..._stylex.props(styles$s.editorGrid),
|
|
31676
|
+
children: /* @__PURE__ */ jsx(ObjectEditor, {
|
|
31677
|
+
view,
|
|
31678
|
+
name: "",
|
|
31679
|
+
path: [],
|
|
31680
|
+
option: schema,
|
|
31681
|
+
current,
|
|
31682
|
+
updateCurrent
|
|
31683
|
+
})
|
|
31684
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
31685
|
+
..._stylex.props(styles$s.editorRow),
|
|
31686
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
31687
|
+
label: "Cancel",
|
|
31688
|
+
onClick: () => {
|
|
31689
|
+
setOpen(false);
|
|
31690
|
+
},
|
|
31691
|
+
customStyle: styles$s.editorCell
|
|
31692
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
31693
|
+
variant: "primary",
|
|
31694
|
+
label: "Apply",
|
|
31695
|
+
onClick: () => {
|
|
31696
|
+
const tag = plugin.settingsToTag(current);
|
|
31697
|
+
const value = tag.toString();
|
|
31698
|
+
const annotations = view.getOrAddAnnotations();
|
|
31699
|
+
const old = annotations.items.find((annotation) => annotation.value.startsWith(RENDERER_PREFIX + "viz"));
|
|
31700
|
+
if (old) {
|
|
31701
|
+
annotations.remove(old);
|
|
31702
|
+
}
|
|
31703
|
+
view.getOrAddAnnotations().add(new ASTAnnotation({
|
|
31704
|
+
value
|
|
31705
|
+
}));
|
|
31706
|
+
setQuery == null ? void 0 : setQuery(rootQuery.build());
|
|
31707
|
+
setOpen(false);
|
|
31708
|
+
},
|
|
31709
|
+
customStyle: styles$s.editorCell
|
|
31710
|
+
})]
|
|
31711
|
+
})]
|
|
31712
|
+
});
|
|
31713
|
+
}
|
|
31714
|
+
const dialogStyles = {
|
|
31715
|
+
displayNone: {
|
|
31716
|
+
display: "mly1s85apg",
|
|
31717
|
+
$$css: true
|
|
31718
|
+
},
|
|
31719
|
+
overlay: {
|
|
31720
|
+
background: "mly5uxqc1",
|
|
31721
|
+
backgroundAttachment: null,
|
|
31722
|
+
backgroundClip: null,
|
|
31723
|
+
backgroundColor: null,
|
|
31724
|
+
backgroundImage: null,
|
|
31725
|
+
backgroundOrigin: null,
|
|
31726
|
+
backgroundPosition: null,
|
|
31727
|
+
backgroundPositionX: null,
|
|
31728
|
+
backgroundPositionY: null,
|
|
31729
|
+
backgroundRepeat: null,
|
|
31730
|
+
backgroundSize: null,
|
|
31731
|
+
position: "mlyixxii4",
|
|
31732
|
+
top: "mly13vifvy",
|
|
31733
|
+
left: "mlyu96u03",
|
|
31734
|
+
right: "mly3m8u43",
|
|
31735
|
+
insetInlineStart: null,
|
|
31736
|
+
insetInlineEnd: null,
|
|
31737
|
+
bottom: "mly1ey2m1c",
|
|
31738
|
+
display: "mlyrvj5dj",
|
|
31739
|
+
placeItems: "mly1ku5rj1",
|
|
31740
|
+
alignItems: null,
|
|
31741
|
+
justifyItems: null,
|
|
31742
|
+
zIndex: "mly11uqc5h",
|
|
31743
|
+
$$css: true
|
|
31744
|
+
},
|
|
31745
|
+
title: {
|
|
31746
|
+
fontSize: "mly1j61zf2",
|
|
31747
|
+
margin: "mly1ghz6dp",
|
|
31748
|
+
marginInline: null,
|
|
31749
|
+
marginInlineStart: null,
|
|
31750
|
+
marginLeft: null,
|
|
31751
|
+
marginInlineEnd: null,
|
|
31752
|
+
marginRight: null,
|
|
31753
|
+
marginBlock: null,
|
|
31754
|
+
marginTop: null,
|
|
31755
|
+
marginBottom: null,
|
|
31756
|
+
display: "mly78zum5",
|
|
31757
|
+
justifyContent: "mly1qughib",
|
|
31758
|
+
alignItems: "mly6s0dn4",
|
|
31759
|
+
borderBottom: "mlyllpv0l",
|
|
31760
|
+
borderBottomWidth: null,
|
|
31761
|
+
borderBottomStyle: null,
|
|
31762
|
+
borderBottomColor: null,
|
|
31763
|
+
lineHeight: "mly1rl49lg",
|
|
31764
|
+
$$css: true
|
|
31765
|
+
},
|
|
31766
|
+
close: {
|
|
31767
|
+
border: "mly1gs6z28",
|
|
31768
|
+
borderWidth: null,
|
|
31769
|
+
borderInlineWidth: null,
|
|
31770
|
+
borderInlineStartWidth: null,
|
|
31771
|
+
borderLeftWidth: null,
|
|
31772
|
+
borderInlineEndWidth: null,
|
|
31773
|
+
borderRightWidth: null,
|
|
31774
|
+
borderBlockWidth: null,
|
|
31775
|
+
borderTopWidth: null,
|
|
31776
|
+
borderBottomWidth: null,
|
|
31777
|
+
borderStyle: null,
|
|
31778
|
+
borderInlineStyle: null,
|
|
31779
|
+
borderInlineStartStyle: null,
|
|
31780
|
+
borderLeftStyle: null,
|
|
31781
|
+
borderInlineEndStyle: null,
|
|
31782
|
+
borderRightStyle: null,
|
|
31783
|
+
borderBlockStyle: null,
|
|
31784
|
+
borderTopStyle: null,
|
|
31785
|
+
borderBottomStyle: null,
|
|
31786
|
+
borderColor: null,
|
|
31787
|
+
borderInlineColor: null,
|
|
31788
|
+
borderInlineStartColor: null,
|
|
31789
|
+
borderLeftColor: null,
|
|
31790
|
+
borderInlineEndColor: null,
|
|
31791
|
+
borderRightColor: null,
|
|
31792
|
+
borderBlockColor: null,
|
|
31793
|
+
borderTopColor: null,
|
|
31794
|
+
borderBottomColor: null,
|
|
31795
|
+
background: "mly1md70p1 mly14hn1a8 mlywghvya",
|
|
31796
|
+
backgroundAttachment: null,
|
|
31797
|
+
backgroundClip: null,
|
|
31798
|
+
backgroundColor: null,
|
|
31799
|
+
backgroundImage: null,
|
|
31800
|
+
backgroundOrigin: null,
|
|
31801
|
+
backgroundPosition: null,
|
|
31802
|
+
backgroundPositionX: null,
|
|
31803
|
+
backgroundPositionY: null,
|
|
31804
|
+
backgroundRepeat: null,
|
|
31805
|
+
backgroundSize: null,
|
|
31806
|
+
borderRadius: "mly12oqio5",
|
|
31807
|
+
borderStartStartRadius: null,
|
|
31808
|
+
borderStartEndRadius: null,
|
|
31809
|
+
borderEndStartRadius: null,
|
|
31810
|
+
borderEndEndRadius: null,
|
|
31811
|
+
borderTopLeftRadius: null,
|
|
31812
|
+
borderTopRightRadius: null,
|
|
31813
|
+
borderBottomLeftRadius: null,
|
|
31814
|
+
borderBottomRightRadius: null,
|
|
31815
|
+
$$css: true
|
|
31816
|
+
},
|
|
31817
|
+
content: {
|
|
31818
|
+
display: "mly78zum5",
|
|
31819
|
+
flexDirection: "mlydt5ytf",
|
|
31820
|
+
boxShadow: "mly5n1uv4",
|
|
31821
|
+
backgroundColor: "mly12peec7",
|
|
31822
|
+
borderRadius: "mlyur7f20",
|
|
31823
|
+
borderStartStartRadius: null,
|
|
31824
|
+
borderStartEndRadius: null,
|
|
31825
|
+
borderEndStartRadius: null,
|
|
31826
|
+
borderEndEndRadius: null,
|
|
31827
|
+
borderTopLeftRadius: null,
|
|
31828
|
+
borderTopRightRadius: null,
|
|
31829
|
+
borderBottomLeftRadius: null,
|
|
31830
|
+
borderBottomRightRadius: null,
|
|
31831
|
+
padding: "mlye8ttls",
|
|
31832
|
+
paddingInline: null,
|
|
31833
|
+
paddingStart: null,
|
|
31834
|
+
paddingLeft: null,
|
|
31835
|
+
paddingEnd: null,
|
|
31836
|
+
paddingRight: null,
|
|
31837
|
+
paddingBlock: null,
|
|
31838
|
+
paddingTop: null,
|
|
31839
|
+
paddingBottom: null,
|
|
31840
|
+
minWidth: "mlylm99nl",
|
|
31841
|
+
maxWidth: "mly1jkqq1h",
|
|
31842
|
+
gap: "mly167g77z",
|
|
31843
|
+
rowGap: null,
|
|
31844
|
+
columnGap: null,
|
|
31845
|
+
$$css: true
|
|
31846
|
+
},
|
|
31847
|
+
editor: {
|
|
31848
|
+
width: "mlyqyf9gi",
|
|
31849
|
+
display: "mly78zum5",
|
|
31850
|
+
flexDirection: "mlydt5ytf",
|
|
31851
|
+
gap: "mly167g77z",
|
|
31852
|
+
rowGap: null,
|
|
31853
|
+
columnGap: null,
|
|
31854
|
+
$$css: true
|
|
31855
|
+
},
|
|
31856
|
+
editorRow: {
|
|
31857
|
+
display: "mly78zum5",
|
|
31858
|
+
gap: "mly167g77z",
|
|
31859
|
+
rowGap: null,
|
|
31860
|
+
columnGap: null,
|
|
31861
|
+
$$css: true
|
|
31862
|
+
},
|
|
31863
|
+
editorCell: {
|
|
31864
|
+
flexGrow: "mly1iyjqo2",
|
|
31865
|
+
$$css: true
|
|
31866
|
+
},
|
|
31867
|
+
input: {
|
|
31868
|
+
border: "mly2yh2zd",
|
|
31869
|
+
borderWidth: null,
|
|
31870
|
+
borderInlineWidth: null,
|
|
31871
|
+
borderInlineStartWidth: null,
|
|
31872
|
+
borderLeftWidth: null,
|
|
31873
|
+
borderInlineEndWidth: null,
|
|
31874
|
+
borderRightWidth: null,
|
|
31875
|
+
borderBlockWidth: null,
|
|
31876
|
+
borderTopWidth: null,
|
|
31877
|
+
borderBottomWidth: null,
|
|
31878
|
+
borderStyle: null,
|
|
31879
|
+
borderInlineStyle: null,
|
|
31880
|
+
borderInlineStartStyle: null,
|
|
31881
|
+
borderLeftStyle: null,
|
|
31882
|
+
borderInlineEndStyle: null,
|
|
31883
|
+
borderRightStyle: null,
|
|
31884
|
+
borderBlockStyle: null,
|
|
31885
|
+
borderTopStyle: null,
|
|
31886
|
+
borderBottomStyle: null,
|
|
31887
|
+
borderColor: null,
|
|
31888
|
+
borderInlineColor: null,
|
|
31889
|
+
borderInlineStartColor: null,
|
|
31890
|
+
borderLeftColor: null,
|
|
31891
|
+
borderInlineEndColor: null,
|
|
31892
|
+
borderRightColor: null,
|
|
31893
|
+
borderBlockColor: null,
|
|
31894
|
+
borderTopColor: null,
|
|
31895
|
+
borderBottomColor: null,
|
|
31896
|
+
color: "mlyizdh9v",
|
|
31897
|
+
padding: "mly9cpjcd",
|
|
31898
|
+
paddingInline: null,
|
|
31899
|
+
paddingStart: null,
|
|
31900
|
+
paddingLeft: null,
|
|
31901
|
+
paddingEnd: null,
|
|
31902
|
+
paddingRight: null,
|
|
31903
|
+
paddingBlock: null,
|
|
31904
|
+
paddingTop: null,
|
|
31905
|
+
paddingBottom: null,
|
|
31906
|
+
borderRadius: "mly1sxf85j",
|
|
31907
|
+
borderStartStartRadius: null,
|
|
31908
|
+
borderStartEndRadius: null,
|
|
31909
|
+
borderEndStartRadius: null,
|
|
31910
|
+
borderEndEndRadius: null,
|
|
31911
|
+
borderTopLeftRadius: null,
|
|
31912
|
+
borderTopRightRadius: null,
|
|
31913
|
+
borderBottomLeftRadius: null,
|
|
31914
|
+
borderBottomRightRadius: null,
|
|
31915
|
+
$$css: true
|
|
31916
|
+
}
|
|
31917
|
+
};
|
|
31918
|
+
function VizEditorDialog({
|
|
31919
|
+
rootQuery,
|
|
31920
|
+
plugin,
|
|
31921
|
+
view,
|
|
31922
|
+
customStyle,
|
|
31923
|
+
open,
|
|
31924
|
+
setOpen
|
|
31925
|
+
}) {
|
|
31926
|
+
if (!plugin || !open) {
|
|
31927
|
+
return null;
|
|
31928
|
+
}
|
|
31929
|
+
return /* @__PURE__ */ jsx(Root, {
|
|
31930
|
+
onOpenChange: (open2) => setOpen(open2),
|
|
31931
|
+
open,
|
|
31932
|
+
children: /* @__PURE__ */ jsx(Portal, {
|
|
31933
|
+
children: /* @__PURE__ */ jsx(Overlay, {
|
|
31934
|
+
..._stylex.props(dialogStyles.overlay),
|
|
31935
|
+
children: /* @__PURE__ */ jsxs(Content$1, {
|
|
31936
|
+
..._stylex.props(fontStyles.body, dialogStyles.content, styles$p.content, customStyle),
|
|
31937
|
+
children: [/* @__PURE__ */ jsxs(Title, {
|
|
31938
|
+
..._stylex.props(dialogStyles.title),
|
|
31939
|
+
children: ["Visualization Settings", /* @__PURE__ */ jsx(Close, {
|
|
31940
|
+
..._stylex.props(dialogStyles.close),
|
|
31941
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
31942
|
+
name: "clear"
|
|
31943
|
+
})
|
|
31944
|
+
})]
|
|
31945
|
+
}), /* @__PURE__ */ jsx(Description, {
|
|
31946
|
+
..._stylex.props(dialogStyles.displayNone),
|
|
31947
|
+
children: "Edit visualization parameters"
|
|
31948
|
+
}), /* @__PURE__ */ jsx(VizEditor, {
|
|
31949
|
+
rootQuery,
|
|
31950
|
+
view,
|
|
31951
|
+
plugin,
|
|
31952
|
+
setOpen
|
|
31953
|
+
})]
|
|
31954
|
+
})
|
|
31955
|
+
})
|
|
31956
|
+
})
|
|
31957
|
+
});
|
|
31958
|
+
}
|
|
31959
|
+
const styles$p = {
|
|
31960
|
+
content: {
|
|
31961
|
+
maxWidth: "mly14zcgw3",
|
|
31962
|
+
width: "mly14rvwrp",
|
|
31963
|
+
maxHeight: "mly1l4ul0t",
|
|
31964
|
+
$$css: true
|
|
31965
|
+
}
|
|
31966
|
+
};
|
|
31967
|
+
function Visualization$1({
|
|
31968
|
+
rootQuery,
|
|
31969
|
+
view
|
|
31970
|
+
}) {
|
|
31971
|
+
const {
|
|
31972
|
+
setQuery
|
|
31973
|
+
} = useContext(QueryEditorContext);
|
|
31974
|
+
const renderer = useMemo(() => new MalloyRenderer(), []);
|
|
31975
|
+
const [currentRenderer, setCurrentRenderer] = useState("table");
|
|
31976
|
+
const [plugin, setPlugin] = useState();
|
|
31977
|
+
const [error, setError] = useState("");
|
|
31978
|
+
const [open, setOpen] = useState(false);
|
|
31979
|
+
const tag = view.getTag().toString();
|
|
31980
|
+
useEffect(() => {
|
|
31981
|
+
var _a2;
|
|
31982
|
+
setError("");
|
|
31983
|
+
const viz = renderer.createViz({
|
|
31984
|
+
onError: (error2) => {
|
|
31985
|
+
console.error("Malloy render error", error2);
|
|
31986
|
+
setError(error2.message);
|
|
31987
|
+
}
|
|
31988
|
+
});
|
|
31989
|
+
viz.setResult({
|
|
31990
|
+
schema: view.definition.getOutputSchema(),
|
|
31991
|
+
annotations: tag.split("\n").map((value) => ({
|
|
31992
|
+
value
|
|
31993
|
+
})),
|
|
31994
|
+
connection_name: ""
|
|
31995
|
+
});
|
|
31996
|
+
const metadata = viz.getMetadata();
|
|
31997
|
+
if (metadata) {
|
|
31998
|
+
const plugin2 = viz.getActivePlugin(metadata.getRootField().key);
|
|
31999
|
+
if (plugin2) {
|
|
32000
|
+
if (isCoreVizPluginInstance(plugin2)) {
|
|
32001
|
+
setCurrentRenderer(plugin2.name);
|
|
32002
|
+
setPlugin(plugin2);
|
|
32003
|
+
return;
|
|
32004
|
+
}
|
|
32005
|
+
if (plugin2.name === "error") {
|
|
32006
|
+
setError(plugin2.getMetadata().message);
|
|
32007
|
+
}
|
|
32008
|
+
}
|
|
32009
|
+
}
|
|
32010
|
+
const currentTag = view.getTag();
|
|
32011
|
+
const rendererTag = view.getTag(RENDERER_PREFIX);
|
|
32012
|
+
const currentRenderer2 = ((_a2 = rendererTag.tag("viz")) == null ? void 0 : _a2.text()) ?? legacyToViz(tagToRenderer(currentTag) ?? "table");
|
|
32013
|
+
setCurrentRenderer(currentRenderer2);
|
|
32014
|
+
setPlugin(void 0);
|
|
32015
|
+
}, [renderer, view, tag]);
|
|
32016
|
+
const updateViz = (renderer2) => {
|
|
32017
|
+
view.setTagProperty(["viz"], renderer2, RENDERER_PREFIX);
|
|
30634
32018
|
setQuery == null ? void 0 : setQuery(rootQuery.build());
|
|
30635
32019
|
};
|
|
30636
32020
|
const items = VIZ_RENDERERS.map((viz) => ({
|
|
@@ -30639,30 +32023,48 @@ function Visualization$1({
|
|
|
30639
32023
|
}),
|
|
30640
32024
|
label: snakeToTitle(viz),
|
|
30641
32025
|
value: viz,
|
|
30642
|
-
onClick: () =>
|
|
32026
|
+
onClick: () => updateViz(viz)
|
|
30643
32027
|
}));
|
|
30644
32028
|
const tokens2 = [/* @__PURE__ */ jsx(SelectorToken, {
|
|
30645
|
-
customStyle: styles$
|
|
32029
|
+
customStyle: styles$o.first,
|
|
30646
32030
|
icon: `viz_${currentRenderer}`,
|
|
30647
32031
|
value: currentRenderer,
|
|
30648
32032
|
items,
|
|
30649
|
-
onChange: (viz) =>
|
|
32033
|
+
onChange: (viz) => updateViz(viz)
|
|
30650
32034
|
}, "first")];
|
|
30651
|
-
|
|
30652
|
-
|
|
30653
|
-
|
|
30654
|
-
|
|
30655
|
-
|
|
30656
|
-
|
|
30657
|
-
|
|
30658
|
-
|
|
32035
|
+
if (plugin) {
|
|
32036
|
+
tokens2.push(/* @__PURE__ */ jsx(Token, {
|
|
32037
|
+
icon: "gear",
|
|
32038
|
+
onClick: () => setOpen(true),
|
|
32039
|
+
customStyle: styles$o.trigger,
|
|
32040
|
+
tooltip: "Edit Settings..."
|
|
32041
|
+
}, "gear"));
|
|
32042
|
+
}
|
|
32043
|
+
if (error) {
|
|
32044
|
+
tokens2.push(/* @__PURE__ */ jsx(Token, {
|
|
32045
|
+
icon: "warning",
|
|
32046
|
+
tooltip: error,
|
|
32047
|
+
customStyle: styles$o.trigger
|
|
32048
|
+
}));
|
|
30659
32049
|
}
|
|
30660
|
-
return /* @__PURE__ */
|
|
30661
|
-
|
|
30662
|
-
|
|
32050
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
32051
|
+
children: [/* @__PURE__ */ jsx(TokenGroup, {
|
|
32052
|
+
customStyle: styles$o.group,
|
|
32053
|
+
children: tokens2
|
|
32054
|
+
}), /* @__PURE__ */ jsx(VizEditorDialog, {
|
|
32055
|
+
open,
|
|
32056
|
+
setOpen,
|
|
32057
|
+
rootQuery,
|
|
32058
|
+
plugin,
|
|
32059
|
+
view
|
|
32060
|
+
})]
|
|
30663
32061
|
});
|
|
30664
32062
|
}
|
|
30665
|
-
const styles$
|
|
32063
|
+
const styles$o = {
|
|
32064
|
+
trigger: {
|
|
32065
|
+
height: "mly1ktj5wk",
|
|
32066
|
+
$$css: true
|
|
32067
|
+
},
|
|
30666
32068
|
group: {
|
|
30667
32069
|
width: "mlyh8yej3",
|
|
30668
32070
|
gridTemplateColumns: "mly52fmzj",
|
|
@@ -30695,7 +32097,7 @@ function ViewAttributeTable({
|
|
|
30695
32097
|
}) {
|
|
30696
32098
|
const dimensions = viewInfo.schema.fields.filter((f2) => f2.kind === "dimension");
|
|
30697
32099
|
return /* @__PURE__ */ jsx("div", {
|
|
30698
|
-
..._stylex.props(styles$
|
|
32100
|
+
..._stylex.props(styles$n.attributeTableContainer, style),
|
|
30699
32101
|
children: /* @__PURE__ */ jsx("table", {
|
|
30700
32102
|
...{
|
|
30701
32103
|
className: "mly1mwwwfo mly9f619 mlyh8yej3 mly5yr21d"
|
|
@@ -30733,9 +32135,9 @@ function ViewAttributeTableRow({
|
|
|
30733
32135
|
className: "mlydpxx8g"
|
|
30734
32136
|
},
|
|
30735
32137
|
children: [/* @__PURE__ */ jsx("td", {
|
|
30736
|
-
..._stylex.props(styles$
|
|
32138
|
+
..._stylex.props(styles$n.attributeTableKeyCell, fontStyles.supporting),
|
|
30737
32139
|
children: /* @__PURE__ */ jsx("div", {
|
|
30738
|
-
..._stylex.props(styles$
|
|
32140
|
+
..._stylex.props(styles$n.attributeTableKeyCellContent, fontStyles.supporting),
|
|
30739
32141
|
children: attribute
|
|
30740
32142
|
})
|
|
30741
32143
|
}), /* @__PURE__ */ jsx("td", {
|
|
@@ -30746,7 +32148,7 @@ function ViewAttributeTableRow({
|
|
|
30746
32148
|
})]
|
|
30747
32149
|
});
|
|
30748
32150
|
}
|
|
30749
|
-
const styles$
|
|
32151
|
+
const styles$n = {
|
|
30750
32152
|
attributeTableContainer: {
|
|
30751
32153
|
padding: "mlye8ttls",
|
|
30752
32154
|
paddingInline: null,
|
|
@@ -30878,12 +32280,12 @@ function RichText({
|
|
|
30878
32280
|
});
|
|
30879
32281
|
return /* @__PURE__ */ jsx("div", {
|
|
30880
32282
|
ref,
|
|
30881
|
-
..._stylex.props(multiLine && styles$
|
|
32283
|
+
..._stylex.props(multiLine && styles$m.preWrap, multiLine && styles$m.breakWord, customStyle),
|
|
30882
32284
|
...props2,
|
|
30883
32285
|
children: formatted
|
|
30884
32286
|
});
|
|
30885
32287
|
}
|
|
30886
|
-
const styles$
|
|
32288
|
+
const styles$m = {
|
|
30887
32289
|
preWrap: {
|
|
30888
32290
|
whiteSpace: "mly126k92a",
|
|
30889
32291
|
$$css: true
|
|
@@ -30912,7 +32314,7 @@ function HoverText({
|
|
|
30912
32314
|
onMouseEnter: () => setIsTriggerHovered(true),
|
|
30913
32315
|
onMouseLeave: () => setIsTriggerHovered(false),
|
|
30914
32316
|
onPointerMove: (e) => e.preventDefault(),
|
|
30915
|
-
customStyle: [fontStyles.supporting, styles$
|
|
32317
|
+
customStyle: [fontStyles.supporting, styles$l.text],
|
|
30916
32318
|
children: text2
|
|
30917
32319
|
})
|
|
30918
32320
|
}), /* @__PURE__ */ jsx(Portal$4, {
|
|
@@ -30931,7 +32333,7 @@ function HoverText({
|
|
|
30931
32333
|
})]
|
|
30932
32334
|
});
|
|
30933
32335
|
}
|
|
30934
|
-
const styles$
|
|
32336
|
+
const styles$l = {
|
|
30935
32337
|
text: {
|
|
30936
32338
|
overflow: "mlyb3r6kr",
|
|
30937
32339
|
overflowX: null,
|
|
@@ -30942,45 +32344,6 @@ const styles$n = {
|
|
|
30942
32344
|
$$css: true
|
|
30943
32345
|
}
|
|
30944
32346
|
};
|
|
30945
|
-
function HoverCard({
|
|
30946
|
-
children,
|
|
30947
|
-
customStyle
|
|
30948
|
-
}) {
|
|
30949
|
-
return /* @__PURE__ */ jsx("div", {
|
|
30950
|
-
..._stylex.props(styles$m.container, fontStyles.body, customStyle),
|
|
30951
|
-
children
|
|
30952
|
-
});
|
|
30953
|
-
}
|
|
30954
|
-
const styles$m = {
|
|
30955
|
-
container: {
|
|
30956
|
-
boxShadow: "mly5n1uv4",
|
|
30957
|
-
backgroundColor: "mly12peec7",
|
|
30958
|
-
borderRadius: "mly4pepcl",
|
|
30959
|
-
borderStartStartRadius: null,
|
|
30960
|
-
borderStartEndRadius: null,
|
|
30961
|
-
borderEndStartRadius: null,
|
|
30962
|
-
borderEndEndRadius: null,
|
|
30963
|
-
borderTopLeftRadius: null,
|
|
30964
|
-
borderTopRightRadius: null,
|
|
30965
|
-
borderBottomLeftRadius: null,
|
|
30966
|
-
borderBottomRightRadius: null,
|
|
30967
|
-
padding: "mlyc7ga6q",
|
|
30968
|
-
paddingInline: null,
|
|
30969
|
-
paddingStart: null,
|
|
30970
|
-
paddingLeft: null,
|
|
30971
|
-
paddingEnd: null,
|
|
30972
|
-
paddingRight: null,
|
|
30973
|
-
paddingBlock: null,
|
|
30974
|
-
paddingTop: null,
|
|
30975
|
-
paddingBottom: null,
|
|
30976
|
-
display: "mly78zum5",
|
|
30977
|
-
flexDirection: "mlydt5ytf",
|
|
30978
|
-
gap: "mly167g77z",
|
|
30979
|
-
rowGap: null,
|
|
30980
|
-
columnGap: null,
|
|
30981
|
-
$$css: true
|
|
30982
|
-
}
|
|
30983
|
-
};
|
|
30984
32347
|
function FieldHoverCard({
|
|
30985
32348
|
field,
|
|
30986
32349
|
path
|
|
@@ -30997,7 +32360,7 @@ function FieldHoverCard({
|
|
|
30997
32360
|
details = /* @__PURE__ */ jsx(ViewAttributeTable, {
|
|
30998
32361
|
viewInfo: field,
|
|
30999
32362
|
isCompact: true,
|
|
31000
|
-
style: styles$
|
|
32363
|
+
style: styles$k.viewAttributeTable
|
|
31001
32364
|
});
|
|
31002
32365
|
} else if (field.kind === "dimension") {
|
|
31003
32366
|
details = /* @__PURE__ */ jsx(TopValuesTable, {
|
|
@@ -31006,7 +32369,7 @@ function FieldHoverCard({
|
|
|
31006
32369
|
});
|
|
31007
32370
|
}
|
|
31008
32371
|
return /* @__PURE__ */ jsxs(HoverCard, {
|
|
31009
|
-
customStyle: styles$
|
|
32372
|
+
customStyle: styles$k.container,
|
|
31010
32373
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
31011
32374
|
ref,
|
|
31012
32375
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -31017,10 +32380,10 @@ function FieldHoverCard({
|
|
|
31017
32380
|
field
|
|
31018
32381
|
})
|
|
31019
32382
|
}), /* @__PURE__ */ jsx("div", {
|
|
31020
|
-
..._stylex.props(fontStyles.supporting, styles$
|
|
32383
|
+
..._stylex.props(fontStyles.supporting, styles$k.path),
|
|
31021
32384
|
children: pathString
|
|
31022
32385
|
}), /* @__PURE__ */ jsx("div", {
|
|
31023
|
-
..._stylex.props(fontStyles.emphasized, styles$
|
|
32386
|
+
..._stylex.props(fontStyles.emphasized, styles$k.title),
|
|
31024
32387
|
children: field.name
|
|
31025
32388
|
}), description && /* @__PURE__ */ jsx(HoverText, {
|
|
31026
32389
|
text: description,
|
|
@@ -31031,7 +32394,7 @@ function FieldHoverCard({
|
|
|
31031
32394
|
})]
|
|
31032
32395
|
});
|
|
31033
32396
|
}
|
|
31034
|
-
const styles$
|
|
32397
|
+
const styles$k = {
|
|
31035
32398
|
container: {
|
|
31036
32399
|
width: "mlybl57os",
|
|
31037
32400
|
maxHeight: "mlyq3t0pi",
|
|
@@ -31208,335 +32571,6 @@ function BooleanFilterCore({
|
|
|
31208
32571
|
})
|
|
31209
32572
|
});
|
|
31210
32573
|
}
|
|
31211
|
-
function useClickOutside(refOrRefs, handler) {
|
|
31212
|
-
useEffect(() => {
|
|
31213
|
-
const refs = Array.isArray(refOrRefs) ? refOrRefs : [refOrRefs];
|
|
31214
|
-
let down = false;
|
|
31215
|
-
const isInOneElement = (ref, event) => {
|
|
31216
|
-
return !ref.current || event.target instanceof Element && ref.current.contains(event.target);
|
|
31217
|
-
};
|
|
31218
|
-
const isInElement = (event) => {
|
|
31219
|
-
return refs.some((ref) => isInOneElement(ref, event));
|
|
31220
|
-
};
|
|
31221
|
-
const onMouseUp = (event) => {
|
|
31222
|
-
if (!down || isInElement(event)) return;
|
|
31223
|
-
handler(event);
|
|
31224
|
-
down = false;
|
|
31225
|
-
};
|
|
31226
|
-
const onMouseDown = (event) => {
|
|
31227
|
-
if (isInElement(event)) return;
|
|
31228
|
-
down = true;
|
|
31229
|
-
};
|
|
31230
|
-
document.addEventListener("mouseup", onMouseUp);
|
|
31231
|
-
document.addEventListener("mousedown", onMouseDown);
|
|
31232
|
-
return () => {
|
|
31233
|
-
document.removeEventListener("mouseup", onMouseUp);
|
|
31234
|
-
document.removeEventListener("mousedown", onMouseDown);
|
|
31235
|
-
};
|
|
31236
|
-
}, [refOrRefs, handler]);
|
|
31237
|
-
}
|
|
31238
|
-
const PillInput = ({
|
|
31239
|
-
values,
|
|
31240
|
-
setValues,
|
|
31241
|
-
autoFocus,
|
|
31242
|
-
placeholder,
|
|
31243
|
-
type = "text",
|
|
31244
|
-
value: controlledValue,
|
|
31245
|
-
setValue: setControlledValue,
|
|
31246
|
-
focusElement,
|
|
31247
|
-
color = DEFAULT_TOKEN_COLOR,
|
|
31248
|
-
customStyle
|
|
31249
|
-
}) => {
|
|
31250
|
-
const [uncontrolledValue, setUncontrolledValue] = useState("");
|
|
31251
|
-
const [_focused, setFocused] = useState(false);
|
|
31252
|
-
const inp = useRef(null);
|
|
31253
|
-
const ref = useRef(null);
|
|
31254
|
-
const [selectedPill, setSelectedPill] = useState(void 0);
|
|
31255
|
-
const pillRefs = useRef([]);
|
|
31256
|
-
const value = controlledValue || uncontrolledValue;
|
|
31257
|
-
const setValue = setControlledValue || setUncontrolledValue;
|
|
31258
|
-
const deletePill = useCallback((idx) => {
|
|
31259
|
-
var _a2;
|
|
31260
|
-
const newValues = [...values];
|
|
31261
|
-
newValues.splice(idx, 1);
|
|
31262
|
-
setValues(newValues);
|
|
31263
|
-
if (selectedPill === 0) {
|
|
31264
|
-
if (values.length === 1) {
|
|
31265
|
-
setSelectedPill(void 0);
|
|
31266
|
-
(_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
31267
|
-
} else {
|
|
31268
|
-
setSelectedPill(0);
|
|
31269
|
-
}
|
|
31270
|
-
} else {
|
|
31271
|
-
setSelectedPill(idx - 1);
|
|
31272
|
-
}
|
|
31273
|
-
}, [selectedPill, setValues, values]);
|
|
31274
|
-
const pills = useMemo(() => {
|
|
31275
|
-
pillRefs.current = new Array(values.length);
|
|
31276
|
-
return values.map((value2, index2) => /* @__PURE__ */ jsx(Pill, {
|
|
31277
|
-
color,
|
|
31278
|
-
onClick: () => {
|
|
31279
|
-
setSelectedPill(index2);
|
|
31280
|
-
},
|
|
31281
|
-
onDelete: () => deletePill(index2),
|
|
31282
|
-
forwardRef: (ref2) => {
|
|
31283
|
-
pillRefs.current[index2] = ref2;
|
|
31284
|
-
},
|
|
31285
|
-
children: value2
|
|
31286
|
-
}, value2));
|
|
31287
|
-
}, [color, deletePill, values]);
|
|
31288
|
-
useEffect(() => {
|
|
31289
|
-
var _a2;
|
|
31290
|
-
if (selectedPill !== void 0) {
|
|
31291
|
-
(_a2 = pillRefs.current[selectedPill]) == null ? void 0 : _a2.focus();
|
|
31292
|
-
}
|
|
31293
|
-
}, [pills, selectedPill]);
|
|
31294
|
-
const onKeyUp = (event) => {
|
|
31295
|
-
var _a2, _b2;
|
|
31296
|
-
if (event.key === "Backspace") {
|
|
31297
|
-
if (selectedPill !== void 0) {
|
|
31298
|
-
deletePill(selectedPill);
|
|
31299
|
-
}
|
|
31300
|
-
} else if (event.key === "ArrowRight") {
|
|
31301
|
-
if (selectedPill === values.length - 1) {
|
|
31302
|
-
setSelectedPill(void 0);
|
|
31303
|
-
(_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
31304
|
-
} else if (selectedPill !== void 0) {
|
|
31305
|
-
setSelectedPill(selectedPill + 1);
|
|
31306
|
-
}
|
|
31307
|
-
} else if (event.key === "ArrowLeft") {
|
|
31308
|
-
if (selectedPill !== void 0 && selectedPill > 0) {
|
|
31309
|
-
setSelectedPill(selectedPill - 1);
|
|
31310
|
-
}
|
|
31311
|
-
} else {
|
|
31312
|
-
(_b2 = inp.current) == null ? void 0 : _b2.focus();
|
|
31313
|
-
}
|
|
31314
|
-
};
|
|
31315
|
-
const commitValue = () => {
|
|
31316
|
-
if (value.length > 0 && !values.includes(value)) {
|
|
31317
|
-
setValues([...values, value]);
|
|
31318
|
-
setValue("");
|
|
31319
|
-
}
|
|
31320
|
-
};
|
|
31321
|
-
useClickOutside(focusElement ? [ref, focusElement] : ref, () => {
|
|
31322
|
-
setFocused(false);
|
|
31323
|
-
commitValue();
|
|
31324
|
-
});
|
|
31325
|
-
return /* @__PURE__ */ jsx("div", {
|
|
31326
|
-
..._stylex.props(fontStyles.body, styles$k.main),
|
|
31327
|
-
children: /* @__PURE__ */ jsx(ScrollableArea, {
|
|
31328
|
-
children: /* @__PURE__ */ jsxs("div", {
|
|
31329
|
-
..._stylex.props(styles$k.content, customStyle),
|
|
31330
|
-
onKeyUp,
|
|
31331
|
-
onClick: () => {
|
|
31332
|
-
var _a2;
|
|
31333
|
-
return (_a2 = inp.current) == null ? void 0 : _a2.focus();
|
|
31334
|
-
},
|
|
31335
|
-
ref,
|
|
31336
|
-
children: [pills, /* @__PURE__ */ jsx("input", {
|
|
31337
|
-
...{
|
|
31338
|
-
className: "mly1gs6z28 mly1a2a7pz mly6icuqf mlyif65rj mlyayvuls mly83z2og mly1onzeue mly195ery5 mly1iyjqo2"
|
|
31339
|
-
},
|
|
31340
|
-
ref: inp,
|
|
31341
|
-
type,
|
|
31342
|
-
placeholder: values.length === 0 ? placeholder : "",
|
|
31343
|
-
value,
|
|
31344
|
-
size: 1,
|
|
31345
|
-
onChange: (event) => {
|
|
31346
|
-
setValue(event.target.value);
|
|
31347
|
-
},
|
|
31348
|
-
onKeyDown: (event) => {
|
|
31349
|
-
if (event.key === "Enter") {
|
|
31350
|
-
if (value !== "") {
|
|
31351
|
-
commitValue();
|
|
31352
|
-
event.stopPropagation();
|
|
31353
|
-
event.preventDefault();
|
|
31354
|
-
}
|
|
31355
|
-
}
|
|
31356
|
-
},
|
|
31357
|
-
onKeyUp: (event) => {
|
|
31358
|
-
var _a2, _b2, _c2, _d;
|
|
31359
|
-
if (event.key === "Backspace") {
|
|
31360
|
-
if (value === "" && values.length > 0) {
|
|
31361
|
-
commitValue();
|
|
31362
|
-
(_a2 = inp.current) == null ? void 0 : _a2.blur();
|
|
31363
|
-
setSelectedPill(values.length - 1);
|
|
31364
|
-
}
|
|
31365
|
-
} else if (event.key === "ArrowLeft") {
|
|
31366
|
-
if (((_b2 = inp.current) == null ? void 0 : _b2.selectionStart) === 0 || ((_c2 = inp.current) == null ? void 0 : _c2.selectionStart) === null) {
|
|
31367
|
-
commitValue();
|
|
31368
|
-
(_d = inp.current) == null ? void 0 : _d.blur();
|
|
31369
|
-
setSelectedPill(values.length - 1);
|
|
31370
|
-
event.preventDefault();
|
|
31371
|
-
event.stopPropagation();
|
|
31372
|
-
}
|
|
31373
|
-
}
|
|
31374
|
-
},
|
|
31375
|
-
onFocus: () => {
|
|
31376
|
-
setFocused(true);
|
|
31377
|
-
setSelectedPill(void 0);
|
|
31378
|
-
},
|
|
31379
|
-
autoFocus
|
|
31380
|
-
})]
|
|
31381
|
-
})
|
|
31382
|
-
})
|
|
31383
|
-
});
|
|
31384
|
-
};
|
|
31385
|
-
const Pill = ({
|
|
31386
|
-
children,
|
|
31387
|
-
color = DEFAULT_TOKEN_COLOR,
|
|
31388
|
-
forwardRef,
|
|
31389
|
-
onClick,
|
|
31390
|
-
onDelete
|
|
31391
|
-
}) => {
|
|
31392
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
31393
|
-
onClick,
|
|
31394
|
-
tabIndex: 0,
|
|
31395
|
-
ref: forwardRef,
|
|
31396
|
-
..._stylex.props(styles$k.pill, colorVariants[color]),
|
|
31397
|
-
children: [children, /* @__PURE__ */ jsx("div", {
|
|
31398
|
-
title: "Remove",
|
|
31399
|
-
...{
|
|
31400
|
-
className: "mly3nfvp2"
|
|
31401
|
-
},
|
|
31402
|
-
children: /* @__PURE__ */ jsx(SvgClear, {
|
|
31403
|
-
onClick: () => onDelete(),
|
|
31404
|
-
...{
|
|
31405
|
-
className: "mly6jxa94 mly1v9usgg"
|
|
31406
|
-
}
|
|
31407
|
-
})
|
|
31408
|
-
})]
|
|
31409
|
-
});
|
|
31410
|
-
};
|
|
31411
|
-
const styles$k = {
|
|
31412
|
-
main: {
|
|
31413
|
-
borderRadius: "mly12oqio5",
|
|
31414
|
-
borderStartStartRadius: null,
|
|
31415
|
-
borderStartEndRadius: null,
|
|
31416
|
-
borderEndStartRadius: null,
|
|
31417
|
-
borderEndEndRadius: null,
|
|
31418
|
-
borderTopLeftRadius: null,
|
|
31419
|
-
borderTopRightRadius: null,
|
|
31420
|
-
borderBottomLeftRadius: null,
|
|
31421
|
-
borderBottomRightRadius: null,
|
|
31422
|
-
border: "mlyvckdp7",
|
|
31423
|
-
borderWidth: null,
|
|
31424
|
-
borderInlineWidth: null,
|
|
31425
|
-
borderInlineStartWidth: null,
|
|
31426
|
-
borderLeftWidth: null,
|
|
31427
|
-
borderInlineEndWidth: null,
|
|
31428
|
-
borderRightWidth: null,
|
|
31429
|
-
borderBlockWidth: null,
|
|
31430
|
-
borderTopWidth: null,
|
|
31431
|
-
borderBottomWidth: null,
|
|
31432
|
-
borderStyle: null,
|
|
31433
|
-
borderInlineStyle: null,
|
|
31434
|
-
borderInlineStartStyle: null,
|
|
31435
|
-
borderLeftStyle: null,
|
|
31436
|
-
borderInlineEndStyle: null,
|
|
31437
|
-
borderRightStyle: null,
|
|
31438
|
-
borderBlockStyle: null,
|
|
31439
|
-
borderTopStyle: null,
|
|
31440
|
-
borderBottomStyle: null,
|
|
31441
|
-
borderColor: null,
|
|
31442
|
-
borderInlineColor: null,
|
|
31443
|
-
borderInlineStartColor: null,
|
|
31444
|
-
borderLeftColor: null,
|
|
31445
|
-
borderInlineEndColor: null,
|
|
31446
|
-
borderRightColor: null,
|
|
31447
|
-
borderBlockColor: null,
|
|
31448
|
-
borderTopColor: null,
|
|
31449
|
-
borderBottomColor: null,
|
|
31450
|
-
padding: "mlybsehbd",
|
|
31451
|
-
paddingInline: null,
|
|
31452
|
-
paddingStart: null,
|
|
31453
|
-
paddingLeft: null,
|
|
31454
|
-
paddingEnd: null,
|
|
31455
|
-
paddingRight: null,
|
|
31456
|
-
paddingBlock: null,
|
|
31457
|
-
paddingTop: null,
|
|
31458
|
-
paddingBottom: null,
|
|
31459
|
-
display: "mlyrvj5dj",
|
|
31460
|
-
minHeight: "mly2lwn1j",
|
|
31461
|
-
$$css: true
|
|
31462
|
-
},
|
|
31463
|
-
content: {
|
|
31464
|
-
outline: "mly1a2a7pz",
|
|
31465
|
-
outlineColor: null,
|
|
31466
|
-
outlineOffset: null,
|
|
31467
|
-
outlineStyle: null,
|
|
31468
|
-
outlineWidth: null,
|
|
31469
|
-
display: "mly78zum5",
|
|
31470
|
-
flexWrap: "mly1a02dak",
|
|
31471
|
-
gap: "mly1ed6fcf",
|
|
31472
|
-
rowGap: null,
|
|
31473
|
-
columnGap: null,
|
|
31474
|
-
borderColor: "mly1akygb0 mlyetl2wx",
|
|
31475
|
-
borderInlineColor: null,
|
|
31476
|
-
borderInlineStartColor: null,
|
|
31477
|
-
borderLeftColor: null,
|
|
31478
|
-
borderInlineEndColor: null,
|
|
31479
|
-
borderRightColor: null,
|
|
31480
|
-
borderBlockColor: null,
|
|
31481
|
-
borderTopColor: null,
|
|
31482
|
-
borderBottomColor: null,
|
|
31483
|
-
$$css: true
|
|
31484
|
-
},
|
|
31485
|
-
pill: {
|
|
31486
|
-
backgroundColor: "mlyy9rfsq",
|
|
31487
|
-
borderRadius: "mly1sxf85j",
|
|
31488
|
-
borderStartStartRadius: null,
|
|
31489
|
-
borderStartEndRadius: null,
|
|
31490
|
-
borderEndStartRadius: null,
|
|
31491
|
-
borderEndEndRadius: null,
|
|
31492
|
-
borderTopLeftRadius: null,
|
|
31493
|
-
borderTopRightRadius: null,
|
|
31494
|
-
borderBottomLeftRadius: null,
|
|
31495
|
-
borderBottomRightRadius: null,
|
|
31496
|
-
color: "mly1xre2ib",
|
|
31497
|
-
display: "mly78zum5",
|
|
31498
|
-
alignItems: "mly6s0dn4",
|
|
31499
|
-
gap: "mly1nejdyq",
|
|
31500
|
-
rowGap: null,
|
|
31501
|
-
columnGap: null,
|
|
31502
|
-
padding: "mly1e41zw8",
|
|
31503
|
-
paddingInline: null,
|
|
31504
|
-
paddingStart: null,
|
|
31505
|
-
paddingLeft: null,
|
|
31506
|
-
paddingEnd: null,
|
|
31507
|
-
paddingRight: null,
|
|
31508
|
-
paddingBlock: null,
|
|
31509
|
-
paddingTop: null,
|
|
31510
|
-
paddingBottom: null,
|
|
31511
|
-
textTransform: "mly6mezaz",
|
|
31512
|
-
cursor: "mly1ypdohk",
|
|
31513
|
-
height: "mly1qx5ct2",
|
|
31514
|
-
whiteSpace: "mlyuxw1ft",
|
|
31515
|
-
$$css: true
|
|
31516
|
-
}
|
|
31517
|
-
};
|
|
31518
|
-
const colorVariants = {
|
|
31519
|
-
default: {
|
|
31520
|
-
"--mlyvygx4q": "mly1izbou4",
|
|
31521
|
-
"--mly13n7235": "mly8bgh0r",
|
|
31522
|
-
$$css: true
|
|
31523
|
-
},
|
|
31524
|
-
purple: {
|
|
31525
|
-
"--mlyvygx4q": "mly1f8soc4",
|
|
31526
|
-
"--mly13n7235": "mly1r5zvhd",
|
|
31527
|
-
$$css: true
|
|
31528
|
-
},
|
|
31529
|
-
green: {
|
|
31530
|
-
"--mlyvygx4q": "mlyf8wvcd",
|
|
31531
|
-
"--mly13n7235": "mly1u6t2w6",
|
|
31532
|
-
$$css: true
|
|
31533
|
-
},
|
|
31534
|
-
cyan: {
|
|
31535
|
-
"--mlyvygx4q": "mlyrtwgpv",
|
|
31536
|
-
"--mly13n7235": "mlys5r2en",
|
|
31537
|
-
$$css: true
|
|
31538
|
-
}
|
|
31539
|
-
};
|
|
31540
32574
|
function useSearch(searchTerm, fieldPath) {
|
|
31541
32575
|
const {
|
|
31542
32576
|
topValues
|
|
@@ -31578,15 +32612,17 @@ function useSearch(searchTerm, fieldPath) {
|
|
|
31578
32612
|
function ValueList({
|
|
31579
32613
|
onClick,
|
|
31580
32614
|
search,
|
|
32615
|
+
filter,
|
|
31581
32616
|
fieldPath,
|
|
31582
32617
|
ref,
|
|
31583
32618
|
customStyle,
|
|
31584
|
-
showPath = true
|
|
32619
|
+
showPath = true,
|
|
32620
|
+
hideNoMatchMessage = false
|
|
31585
32621
|
}) {
|
|
31586
32622
|
const {
|
|
31587
32623
|
searchResults
|
|
31588
32624
|
} = useSearch(search, fieldPath);
|
|
31589
|
-
const stringSearchResults = useMemo(() => searchResults && searchResults.filter((r2) => r2.fieldType === "string" && r2.fieldValue !== null).sort((a, b2) => b2.weight - a.weight).slice(0, 100), [searchResults]);
|
|
32625
|
+
const stringSearchResults = useMemo(() => searchResults && searchResults.filter((r2) => r2.fieldType === "string" && r2.fieldValue !== null).filter((r2) => filter ? filter(r2.fieldValue ?? "") : true).sort((a, b2) => b2.weight - a.weight).slice(0, 100), [searchResults, filter]);
|
|
31590
32626
|
return /* @__PURE__ */ jsx("div", {
|
|
31591
32627
|
ref,
|
|
31592
32628
|
..._stylex.props(customStyle),
|
|
@@ -31603,7 +32639,7 @@ function ValueList({
|
|
|
31603
32639
|
},
|
|
31604
32640
|
children: value.fieldName
|
|
31605
32641
|
}) : null]
|
|
31606
|
-
}, value.fieldName + ":" + value.fieldValue)) : search ? /* @__PURE__ */ jsx("div", {
|
|
32642
|
+
}, value.fieldName + ":" + value.fieldValue)) : search && !hideNoMatchMessage ? /* @__PURE__ */ jsx("div", {
|
|
31607
32643
|
..._stylex.props(addMenuStyles.item),
|
|
31608
32644
|
"data-disabled": "true",
|
|
31609
32645
|
children: "No matching values"
|
|
@@ -31797,7 +32833,9 @@ const StringFilterCore = ({
|
|
|
31797
32833
|
}
|
|
31798
32834
|
},
|
|
31799
32835
|
customStyle: styles$i.valueList,
|
|
31800
|
-
showPath: false
|
|
32836
|
+
showPath: false,
|
|
32837
|
+
filter: (value) => !currentFilter.values.includes(value),
|
|
32838
|
+
hideNoMatchMessage: true
|
|
31801
32839
|
})
|
|
31802
32840
|
})]
|
|
31803
32841
|
}) : currentFilter.operator === "~" ? /* @__PURE__ */ jsx(StringEditor, {
|
|
@@ -32121,11 +33159,8 @@ function makeFilterWithNewType(filter, type) {
|
|
|
32121
33159
|
}
|
|
32122
33160
|
}
|
|
32123
33161
|
function typeFromFilter(filter) {
|
|
32124
|
-
if (filter.operator === "null" && filter.not) {
|
|
32125
|
-
return
|
|
32126
|
-
}
|
|
32127
|
-
if (filter.operator === "before" && filter.not) {
|
|
32128
|
-
return "not_before";
|
|
33162
|
+
if ((filter.operator === "null" || filter.operator === "after" || filter.operator === "before") && filter.not) {
|
|
33163
|
+
return `-${filter.operator}`;
|
|
32129
33164
|
}
|
|
32130
33165
|
return filter.operator;
|
|
32131
33166
|
}
|
|
@@ -32134,7 +33169,7 @@ function unitsFromFilter(filter, isDateTime) {
|
|
|
32134
33169
|
return filter.units;
|
|
32135
33170
|
} else if (filter.operator === "to") {
|
|
32136
33171
|
return guessUnits(filter.fromMoment, isDateTime);
|
|
32137
|
-
} else if (filter.operator === "before"
|
|
33172
|
+
} else if (filter.operator === "before") {
|
|
32138
33173
|
return guessUnits(filter.before, isDateTime);
|
|
32139
33174
|
} else if (filter.operator === "after") {
|
|
32140
33175
|
return guessUnits(filter.after, isDateTime);
|
|
@@ -32181,14 +33216,17 @@ const DateTimeFilterCore = ({
|
|
|
32181
33216
|
value: "next",
|
|
32182
33217
|
label: "next complete"
|
|
32183
33218
|
}, {
|
|
32184
|
-
value: "
|
|
32185
|
-
label: "
|
|
33219
|
+
value: "-before",
|
|
33220
|
+
label: "starting"
|
|
32186
33221
|
}, {
|
|
32187
33222
|
value: "after",
|
|
32188
33223
|
label: "after"
|
|
32189
33224
|
}, {
|
|
32190
33225
|
value: "before",
|
|
32191
33226
|
label: "before"
|
|
33227
|
+
}, {
|
|
33228
|
+
value: "-after",
|
|
33229
|
+
label: "through"
|
|
32192
33230
|
}, {
|
|
32193
33231
|
value: "in",
|
|
32194
33232
|
label: "is"
|
|
@@ -32505,6 +33543,11 @@ function dateTimeFilterChangeType(filter, type, units) {
|
|
|
32505
33543
|
let n = "7";
|
|
32506
33544
|
let fromMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
|
|
32507
33545
|
let toMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
|
|
33546
|
+
let not = false;
|
|
33547
|
+
if (type.startsWith("-")) {
|
|
33548
|
+
type = type.slice(1);
|
|
33549
|
+
not = true;
|
|
33550
|
+
}
|
|
32508
33551
|
switch (filter.operator) {
|
|
32509
33552
|
case "in_last":
|
|
32510
33553
|
case "last":
|
|
@@ -32537,18 +33580,14 @@ function dateTimeFilterChangeType(filter, type, units) {
|
|
|
32537
33580
|
case "after":
|
|
32538
33581
|
return {
|
|
32539
33582
|
operator: type,
|
|
32540
|
-
after: fromMoment
|
|
33583
|
+
after: fromMoment,
|
|
33584
|
+
not
|
|
32541
33585
|
};
|
|
32542
33586
|
case "before":
|
|
32543
33587
|
return {
|
|
32544
33588
|
operator: type,
|
|
32545
|
-
before: fromMoment
|
|
32546
|
-
};
|
|
32547
|
-
case "not_before":
|
|
32548
|
-
return {
|
|
32549
|
-
operator: "before",
|
|
32550
33589
|
before: fromMoment,
|
|
32551
|
-
not
|
|
33590
|
+
not
|
|
32552
33591
|
};
|
|
32553
33592
|
case "in":
|
|
32554
33593
|
return {
|
|
@@ -32563,12 +33602,8 @@ function dateTimeFilterChangeType(filter, type, units) {
|
|
|
32563
33602
|
};
|
|
32564
33603
|
case "null":
|
|
32565
33604
|
return {
|
|
32566
|
-
operator:
|
|
32567
|
-
|
|
32568
|
-
case "-null":
|
|
32569
|
-
return {
|
|
32570
|
-
operator: "null",
|
|
32571
|
-
not: true
|
|
33605
|
+
operator: type,
|
|
33606
|
+
not
|
|
32572
33607
|
};
|
|
32573
33608
|
}
|
|
32574
33609
|
return filter;
|
|
@@ -32820,7 +33855,7 @@ function FieldList({
|
|
|
32820
33855
|
..._stylex.props(customStyle),
|
|
32821
33856
|
children: groups.length ? groups.map((group) => /* @__PURE__ */ jsxs("div", {
|
|
32822
33857
|
children: [/* @__PURE__ */ jsx("div", {
|
|
32823
|
-
..._stylex.props(addMenuStyles.item, styles$h.fieldItem),
|
|
33858
|
+
..._stylex.props(addMenuStyles.item, styles$h.fieldItem, styles$h.sticky),
|
|
32824
33859
|
"data-disabled": "true",
|
|
32825
33860
|
children: group.name
|
|
32826
33861
|
}), group.fields.map((field) => isFilterOperation && (field.kind === "dimension" || field.kind === "measure") ? /* @__PURE__ */ jsx(FilterPopover, {
|
|
@@ -32886,6 +33921,17 @@ const styles$h = {
|
|
|
32886
33921
|
paddingTop: "mly1y1aw1k",
|
|
32887
33922
|
paddingBottom: "mlywib8y2",
|
|
32888
33923
|
$$css: true
|
|
33924
|
+
},
|
|
33925
|
+
sticky: {
|
|
33926
|
+
position: "mly7wzq59",
|
|
33927
|
+
top: "mly13vifvy",
|
|
33928
|
+
zIndex: "mly1vjfegm",
|
|
33929
|
+
backgroundColor: "mly9nb4jr",
|
|
33930
|
+
borderBottom: "mlyv3yj8d",
|
|
33931
|
+
borderBottomWidth: null,
|
|
33932
|
+
borderBottomStyle: null,
|
|
33933
|
+
borderBottomColor: null,
|
|
33934
|
+
$$css: true
|
|
32889
33935
|
}
|
|
32890
33936
|
};
|
|
32891
33937
|
function FieldMenu({
|
|
@@ -33085,7 +34131,7 @@ function OperationActionTitle({
|
|
|
33085
34131
|
return !(segment == null ? void 0 : segment.hasField(field.name, path)) && isNotAnnotatedFilteredField(field);
|
|
33086
34132
|
};
|
|
33087
34133
|
return /* @__PURE__ */ jsxs("div", {
|
|
33088
|
-
..._stylex.props(styles$
|
|
34134
|
+
..._stylex.props(styles$u.title, hoverStyles.main),
|
|
33089
34135
|
children: [/* @__PURE__ */ jsx("div", {
|
|
33090
34136
|
children: title
|
|
33091
34137
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -33118,308 +34164,6 @@ function OperationActionTitle({
|
|
|
33118
34164
|
})]
|
|
33119
34165
|
});
|
|
33120
34166
|
}
|
|
33121
|
-
var DIALOG_NAME = "Dialog";
|
|
33122
|
-
var [createDialogContext, createDialogScope] = createContextScope(DIALOG_NAME);
|
|
33123
|
-
var [DialogProvider, useDialogContext] = createDialogContext(DIALOG_NAME);
|
|
33124
|
-
var Dialog = (props2) => {
|
|
33125
|
-
const {
|
|
33126
|
-
__scopeDialog,
|
|
33127
|
-
children,
|
|
33128
|
-
open: openProp,
|
|
33129
|
-
defaultOpen,
|
|
33130
|
-
onOpenChange,
|
|
33131
|
-
modal = true
|
|
33132
|
-
} = props2;
|
|
33133
|
-
const triggerRef = React.useRef(null);
|
|
33134
|
-
const contentRef = React.useRef(null);
|
|
33135
|
-
const [open = false, setOpen] = useControllableState({
|
|
33136
|
-
prop: openProp,
|
|
33137
|
-
defaultProp: defaultOpen,
|
|
33138
|
-
onChange: onOpenChange
|
|
33139
|
-
});
|
|
33140
|
-
return /* @__PURE__ */ jsx(
|
|
33141
|
-
DialogProvider,
|
|
33142
|
-
{
|
|
33143
|
-
scope: __scopeDialog,
|
|
33144
|
-
triggerRef,
|
|
33145
|
-
contentRef,
|
|
33146
|
-
contentId: useId(),
|
|
33147
|
-
titleId: useId(),
|
|
33148
|
-
descriptionId: useId(),
|
|
33149
|
-
open,
|
|
33150
|
-
onOpenChange: setOpen,
|
|
33151
|
-
onOpenToggle: React.useCallback(() => setOpen((prevOpen) => !prevOpen), [setOpen]),
|
|
33152
|
-
modal,
|
|
33153
|
-
children
|
|
33154
|
-
}
|
|
33155
|
-
);
|
|
33156
|
-
};
|
|
33157
|
-
Dialog.displayName = DIALOG_NAME;
|
|
33158
|
-
var TRIGGER_NAME$1 = "DialogTrigger";
|
|
33159
|
-
var DialogTrigger = React.forwardRef(
|
|
33160
|
-
(props2, forwardedRef) => {
|
|
33161
|
-
const { __scopeDialog, ...triggerProps } = props2;
|
|
33162
|
-
const context = useDialogContext(TRIGGER_NAME$1, __scopeDialog);
|
|
33163
|
-
const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
|
|
33164
|
-
return /* @__PURE__ */ jsx(
|
|
33165
|
-
Primitive.button,
|
|
33166
|
-
{
|
|
33167
|
-
type: "button",
|
|
33168
|
-
"aria-haspopup": "dialog",
|
|
33169
|
-
"aria-expanded": context.open,
|
|
33170
|
-
"aria-controls": context.contentId,
|
|
33171
|
-
"data-state": getState(context.open),
|
|
33172
|
-
...triggerProps,
|
|
33173
|
-
ref: composedTriggerRef,
|
|
33174
|
-
onClick: composeEventHandlers(props2.onClick, context.onOpenToggle)
|
|
33175
|
-
}
|
|
33176
|
-
);
|
|
33177
|
-
}
|
|
33178
|
-
);
|
|
33179
|
-
DialogTrigger.displayName = TRIGGER_NAME$1;
|
|
33180
|
-
var PORTAL_NAME = "DialogPortal";
|
|
33181
|
-
var [PortalProvider, usePortalContext] = createDialogContext(PORTAL_NAME, {
|
|
33182
|
-
forceMount: void 0
|
|
33183
|
-
});
|
|
33184
|
-
var DialogPortal = (props2) => {
|
|
33185
|
-
const { __scopeDialog, forceMount, children, container } = props2;
|
|
33186
|
-
const context = useDialogContext(PORTAL_NAME, __scopeDialog);
|
|
33187
|
-
return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeDialog, forceMount, children: React.Children.map(children, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$5, { asChild: true, container, children: child }) })) });
|
|
33188
|
-
};
|
|
33189
|
-
DialogPortal.displayName = PORTAL_NAME;
|
|
33190
|
-
var OVERLAY_NAME = "DialogOverlay";
|
|
33191
|
-
var DialogOverlay = React.forwardRef(
|
|
33192
|
-
(props2, forwardedRef) => {
|
|
33193
|
-
const portalContext = usePortalContext(OVERLAY_NAME, props2.__scopeDialog);
|
|
33194
|
-
const { forceMount = portalContext.forceMount, ...overlayProps } = props2;
|
|
33195
|
-
const context = useDialogContext(OVERLAY_NAME, props2.__scopeDialog);
|
|
33196
|
-
return context.modal ? /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(DialogOverlayImpl, { ...overlayProps, ref: forwardedRef }) }) : null;
|
|
33197
|
-
}
|
|
33198
|
-
);
|
|
33199
|
-
DialogOverlay.displayName = OVERLAY_NAME;
|
|
33200
|
-
var DialogOverlayImpl = React.forwardRef(
|
|
33201
|
-
(props2, forwardedRef) => {
|
|
33202
|
-
const { __scopeDialog, ...overlayProps } = props2;
|
|
33203
|
-
const context = useDialogContext(OVERLAY_NAME, __scopeDialog);
|
|
33204
|
-
return (
|
|
33205
|
-
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
33206
|
-
// ie. when `Overlay` and `Content` are siblings
|
|
33207
|
-
/* @__PURE__ */ jsx(ReactRemoveScroll, { as: Slot, allowPinchZoom: true, shards: [context.contentRef], children: /* @__PURE__ */ jsx(
|
|
33208
|
-
Primitive.div,
|
|
33209
|
-
{
|
|
33210
|
-
"data-state": getState(context.open),
|
|
33211
|
-
...overlayProps,
|
|
33212
|
-
ref: forwardedRef,
|
|
33213
|
-
style: { pointerEvents: "auto", ...overlayProps.style }
|
|
33214
|
-
}
|
|
33215
|
-
) })
|
|
33216
|
-
);
|
|
33217
|
-
}
|
|
33218
|
-
);
|
|
33219
|
-
var CONTENT_NAME$1 = "DialogContent";
|
|
33220
|
-
var DialogContent = React.forwardRef(
|
|
33221
|
-
(props2, forwardedRef) => {
|
|
33222
|
-
const portalContext = usePortalContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
33223
|
-
const { forceMount = portalContext.forceMount, ...contentProps } = props2;
|
|
33224
|
-
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
33225
|
-
return /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: context.modal ? /* @__PURE__ */ jsx(DialogContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(DialogContentNonModal, { ...contentProps, ref: forwardedRef }) });
|
|
33226
|
-
}
|
|
33227
|
-
);
|
|
33228
|
-
DialogContent.displayName = CONTENT_NAME$1;
|
|
33229
|
-
var DialogContentModal = React.forwardRef(
|
|
33230
|
-
(props2, forwardedRef) => {
|
|
33231
|
-
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
33232
|
-
const contentRef = React.useRef(null);
|
|
33233
|
-
const composedRefs = useComposedRefs(forwardedRef, context.contentRef, contentRef);
|
|
33234
|
-
React.useEffect(() => {
|
|
33235
|
-
const content = contentRef.current;
|
|
33236
|
-
if (content) return hideOthers(content);
|
|
33237
|
-
}, []);
|
|
33238
|
-
return /* @__PURE__ */ jsx(
|
|
33239
|
-
DialogContentImpl,
|
|
33240
|
-
{
|
|
33241
|
-
...props2,
|
|
33242
|
-
ref: composedRefs,
|
|
33243
|
-
trapFocus: context.open,
|
|
33244
|
-
disableOutsidePointerEvents: true,
|
|
33245
|
-
onCloseAutoFocus: composeEventHandlers(props2.onCloseAutoFocus, (event) => {
|
|
33246
|
-
var _a2;
|
|
33247
|
-
event.preventDefault();
|
|
33248
|
-
(_a2 = context.triggerRef.current) == null ? void 0 : _a2.focus();
|
|
33249
|
-
}),
|
|
33250
|
-
onPointerDownOutside: composeEventHandlers(props2.onPointerDownOutside, (event) => {
|
|
33251
|
-
const originalEvent = event.detail.originalEvent;
|
|
33252
|
-
const ctrlLeftClick = originalEvent.button === 0 && originalEvent.ctrlKey === true;
|
|
33253
|
-
const isRightClick = originalEvent.button === 2 || ctrlLeftClick;
|
|
33254
|
-
if (isRightClick) event.preventDefault();
|
|
33255
|
-
}),
|
|
33256
|
-
onFocusOutside: composeEventHandlers(
|
|
33257
|
-
props2.onFocusOutside,
|
|
33258
|
-
(event) => event.preventDefault()
|
|
33259
|
-
)
|
|
33260
|
-
}
|
|
33261
|
-
);
|
|
33262
|
-
}
|
|
33263
|
-
);
|
|
33264
|
-
var DialogContentNonModal = React.forwardRef(
|
|
33265
|
-
(props2, forwardedRef) => {
|
|
33266
|
-
const context = useDialogContext(CONTENT_NAME$1, props2.__scopeDialog);
|
|
33267
|
-
const hasInteractedOutsideRef = React.useRef(false);
|
|
33268
|
-
const hasPointerDownOutsideRef = React.useRef(false);
|
|
33269
|
-
return /* @__PURE__ */ jsx(
|
|
33270
|
-
DialogContentImpl,
|
|
33271
|
-
{
|
|
33272
|
-
...props2,
|
|
33273
|
-
ref: forwardedRef,
|
|
33274
|
-
trapFocus: false,
|
|
33275
|
-
disableOutsidePointerEvents: false,
|
|
33276
|
-
onCloseAutoFocus: (event) => {
|
|
33277
|
-
var _a2, _b2;
|
|
33278
|
-
(_a2 = props2.onCloseAutoFocus) == null ? void 0 : _a2.call(props2, event);
|
|
33279
|
-
if (!event.defaultPrevented) {
|
|
33280
|
-
if (!hasInteractedOutsideRef.current) (_b2 = context.triggerRef.current) == null ? void 0 : _b2.focus();
|
|
33281
|
-
event.preventDefault();
|
|
33282
|
-
}
|
|
33283
|
-
hasInteractedOutsideRef.current = false;
|
|
33284
|
-
hasPointerDownOutsideRef.current = false;
|
|
33285
|
-
},
|
|
33286
|
-
onInteractOutside: (event) => {
|
|
33287
|
-
var _a2, _b2;
|
|
33288
|
-
(_a2 = props2.onInteractOutside) == null ? void 0 : _a2.call(props2, event);
|
|
33289
|
-
if (!event.defaultPrevented) {
|
|
33290
|
-
hasInteractedOutsideRef.current = true;
|
|
33291
|
-
if (event.detail.originalEvent.type === "pointerdown") {
|
|
33292
|
-
hasPointerDownOutsideRef.current = true;
|
|
33293
|
-
}
|
|
33294
|
-
}
|
|
33295
|
-
const target = event.target;
|
|
33296
|
-
const targetIsTrigger = (_b2 = context.triggerRef.current) == null ? void 0 : _b2.contains(target);
|
|
33297
|
-
if (targetIsTrigger) event.preventDefault();
|
|
33298
|
-
if (event.detail.originalEvent.type === "focusin" && hasPointerDownOutsideRef.current) {
|
|
33299
|
-
event.preventDefault();
|
|
33300
|
-
}
|
|
33301
|
-
}
|
|
33302
|
-
}
|
|
33303
|
-
);
|
|
33304
|
-
}
|
|
33305
|
-
);
|
|
33306
|
-
var DialogContentImpl = React.forwardRef(
|
|
33307
|
-
(props2, forwardedRef) => {
|
|
33308
|
-
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props2;
|
|
33309
|
-
const context = useDialogContext(CONTENT_NAME$1, __scopeDialog);
|
|
33310
|
-
const contentRef = React.useRef(null);
|
|
33311
|
-
const composedRefs = useComposedRefs(forwardedRef, contentRef);
|
|
33312
|
-
useFocusGuards();
|
|
33313
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33314
|
-
/* @__PURE__ */ jsx(
|
|
33315
|
-
FocusScope,
|
|
33316
|
-
{
|
|
33317
|
-
asChild: true,
|
|
33318
|
-
loop: true,
|
|
33319
|
-
trapped: trapFocus,
|
|
33320
|
-
onMountAutoFocus: onOpenAutoFocus,
|
|
33321
|
-
onUnmountAutoFocus: onCloseAutoFocus,
|
|
33322
|
-
children: /* @__PURE__ */ jsx(
|
|
33323
|
-
DismissableLayer,
|
|
33324
|
-
{
|
|
33325
|
-
role: "dialog",
|
|
33326
|
-
id: context.contentId,
|
|
33327
|
-
"aria-describedby": context.descriptionId,
|
|
33328
|
-
"aria-labelledby": context.titleId,
|
|
33329
|
-
"data-state": getState(context.open),
|
|
33330
|
-
...contentProps,
|
|
33331
|
-
ref: composedRefs,
|
|
33332
|
-
onDismiss: () => context.onOpenChange(false)
|
|
33333
|
-
}
|
|
33334
|
-
)
|
|
33335
|
-
}
|
|
33336
|
-
),
|
|
33337
|
-
/* @__PURE__ */ jsxs(Fragment, { children: [
|
|
33338
|
-
/* @__PURE__ */ jsx(TitleWarning, { titleId: context.titleId }),
|
|
33339
|
-
/* @__PURE__ */ jsx(DescriptionWarning, { contentRef, descriptionId: context.descriptionId })
|
|
33340
|
-
] })
|
|
33341
|
-
] });
|
|
33342
|
-
}
|
|
33343
|
-
);
|
|
33344
|
-
var TITLE_NAME = "DialogTitle";
|
|
33345
|
-
var DialogTitle = React.forwardRef(
|
|
33346
|
-
(props2, forwardedRef) => {
|
|
33347
|
-
const { __scopeDialog, ...titleProps } = props2;
|
|
33348
|
-
const context = useDialogContext(TITLE_NAME, __scopeDialog);
|
|
33349
|
-
return /* @__PURE__ */ jsx(Primitive.h2, { id: context.titleId, ...titleProps, ref: forwardedRef });
|
|
33350
|
-
}
|
|
33351
|
-
);
|
|
33352
|
-
DialogTitle.displayName = TITLE_NAME;
|
|
33353
|
-
var DESCRIPTION_NAME = "DialogDescription";
|
|
33354
|
-
var DialogDescription = React.forwardRef(
|
|
33355
|
-
(props2, forwardedRef) => {
|
|
33356
|
-
const { __scopeDialog, ...descriptionProps } = props2;
|
|
33357
|
-
const context = useDialogContext(DESCRIPTION_NAME, __scopeDialog);
|
|
33358
|
-
return /* @__PURE__ */ jsx(Primitive.p, { id: context.descriptionId, ...descriptionProps, ref: forwardedRef });
|
|
33359
|
-
}
|
|
33360
|
-
);
|
|
33361
|
-
DialogDescription.displayName = DESCRIPTION_NAME;
|
|
33362
|
-
var CLOSE_NAME = "DialogClose";
|
|
33363
|
-
var DialogClose = React.forwardRef(
|
|
33364
|
-
(props2, forwardedRef) => {
|
|
33365
|
-
const { __scopeDialog, ...closeProps } = props2;
|
|
33366
|
-
const context = useDialogContext(CLOSE_NAME, __scopeDialog);
|
|
33367
|
-
return /* @__PURE__ */ jsx(
|
|
33368
|
-
Primitive.button,
|
|
33369
|
-
{
|
|
33370
|
-
type: "button",
|
|
33371
|
-
...closeProps,
|
|
33372
|
-
ref: forwardedRef,
|
|
33373
|
-
onClick: composeEventHandlers(props2.onClick, () => context.onOpenChange(false))
|
|
33374
|
-
}
|
|
33375
|
-
);
|
|
33376
|
-
}
|
|
33377
|
-
);
|
|
33378
|
-
DialogClose.displayName = CLOSE_NAME;
|
|
33379
|
-
function getState(open) {
|
|
33380
|
-
return open ? "open" : "closed";
|
|
33381
|
-
}
|
|
33382
|
-
var TITLE_WARNING_NAME = "DialogTitleWarning";
|
|
33383
|
-
var [WarningProvider, useWarningContext] = createContext2(TITLE_WARNING_NAME, {
|
|
33384
|
-
contentName: CONTENT_NAME$1,
|
|
33385
|
-
titleName: TITLE_NAME,
|
|
33386
|
-
docsSlug: "dialog"
|
|
33387
|
-
});
|
|
33388
|
-
var TitleWarning = ({ titleId }) => {
|
|
33389
|
-
const titleWarningContext = useWarningContext(TITLE_WARNING_NAME);
|
|
33390
|
-
const MESSAGE = `\`${titleWarningContext.contentName}\` requires a \`${titleWarningContext.titleName}\` for the component to be accessible for screen reader users.
|
|
33391
|
-
|
|
33392
|
-
If you want to hide the \`${titleWarningContext.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
33393
|
-
|
|
33394
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${titleWarningContext.docsSlug}`;
|
|
33395
|
-
React.useEffect(() => {
|
|
33396
|
-
if (titleId) {
|
|
33397
|
-
const hasTitle = document.getElementById(titleId);
|
|
33398
|
-
if (!hasTitle) console.error(MESSAGE);
|
|
33399
|
-
}
|
|
33400
|
-
}, [MESSAGE, titleId]);
|
|
33401
|
-
return null;
|
|
33402
|
-
};
|
|
33403
|
-
var DESCRIPTION_WARNING_NAME = "DialogDescriptionWarning";
|
|
33404
|
-
var DescriptionWarning = ({ contentRef, descriptionId }) => {
|
|
33405
|
-
const descriptionWarningContext = useWarningContext(DESCRIPTION_WARNING_NAME);
|
|
33406
|
-
const MESSAGE = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${descriptionWarningContext.contentName}}.`;
|
|
33407
|
-
React.useEffect(() => {
|
|
33408
|
-
var _a2;
|
|
33409
|
-
const describedById = (_a2 = contentRef.current) == null ? void 0 : _a2.getAttribute("aria-describedby");
|
|
33410
|
-
if (descriptionId && describedById) {
|
|
33411
|
-
const hasDescription = document.getElementById(descriptionId);
|
|
33412
|
-
if (!hasDescription) console.warn(MESSAGE);
|
|
33413
|
-
}
|
|
33414
|
-
}, [MESSAGE, contentRef, descriptionId]);
|
|
33415
|
-
return null;
|
|
33416
|
-
};
|
|
33417
|
-
var Root = Dialog;
|
|
33418
|
-
var Portal = DialogPortal;
|
|
33419
|
-
var Overlay = DialogOverlay;
|
|
33420
|
-
var Content$1 = DialogContent;
|
|
33421
|
-
var Title = DialogTitle;
|
|
33422
|
-
var Description = DialogDescription;
|
|
33423
34167
|
function RenameDialog({
|
|
33424
34168
|
rootQuery,
|
|
33425
34169
|
view,
|
|
@@ -33453,29 +34197,19 @@ function RenameDialog({
|
|
|
33453
34197
|
onOpenChange: setOpen,
|
|
33454
34198
|
children: /* @__PURE__ */ jsx(Portal, {
|
|
33455
34199
|
children: /* @__PURE__ */ jsx(Overlay, {
|
|
33456
|
-
...
|
|
33457
|
-
className: "mly5uxqc1 mlyixxii4 mly13vifvy mlyu96u03 mly3m8u43 mly1ey2m1c mlyrvj5dj mly1ku5rj1 mly11uqc5h"
|
|
33458
|
-
},
|
|
34200
|
+
..._stylex.props(dialogStyles.overlay),
|
|
33459
34201
|
children: /* @__PURE__ */ jsxs(Content$1, {
|
|
33460
34202
|
..._stylex.props(dialogStyles.content, fontStyles.body),
|
|
33461
34203
|
children: [/* @__PURE__ */ jsxs(Description, {
|
|
33462
|
-
...
|
|
33463
|
-
className: "mly1s85apg"
|
|
33464
|
-
},
|
|
34204
|
+
..._stylex.props(dialogStyles.displayNone),
|
|
33465
34205
|
children: ["Rename ", target.name]
|
|
33466
34206
|
}), /* @__PURE__ */ jsxs(Title, {
|
|
33467
|
-
...
|
|
33468
|
-
className: "mly1j61zf2 mly1ghz6dp"
|
|
33469
|
-
},
|
|
34207
|
+
..._stylex.props(dialogStyles.title),
|
|
33470
34208
|
children: ["Rename ", target.name]
|
|
33471
34209
|
}), /* @__PURE__ */ jsxs("div", {
|
|
33472
|
-
...
|
|
33473
|
-
className: "mlyqyf9gi mly78zum5 mlydt5ytf mly167g77z"
|
|
33474
|
-
},
|
|
34210
|
+
..._stylex.props(dialogStyles.editor),
|
|
33475
34211
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
33476
|
-
...
|
|
33477
|
-
className: "mly78zum5 mly167g77z"
|
|
33478
|
-
},
|
|
34212
|
+
..._stylex.props(dialogStyles.editorRow),
|
|
33479
34213
|
children: [/* @__PURE__ */ jsx("input", {
|
|
33480
34214
|
value: name,
|
|
33481
34215
|
onChange: (event) => setName(event.target.value),
|
|
@@ -33494,9 +34228,7 @@ function RenameDialog({
|
|
|
33494
34228
|
errorMessage: "Name already in use"
|
|
33495
34229
|
})]
|
|
33496
34230
|
}), /* @__PURE__ */ jsxs("div", {
|
|
33497
|
-
...
|
|
33498
|
-
className: "mly78zum5 mly167g77z"
|
|
33499
|
-
},
|
|
34231
|
+
..._stylex.props(dialogStyles.editorRow),
|
|
33500
34232
|
children: [/* @__PURE__ */ jsx(Button, {
|
|
33501
34233
|
label: "Cancel",
|
|
33502
34234
|
onClick: () => setOpen(false),
|
|
@@ -33515,92 +34247,6 @@ function RenameDialog({
|
|
|
33515
34247
|
})
|
|
33516
34248
|
});
|
|
33517
34249
|
}
|
|
33518
|
-
const dialogStyles = {
|
|
33519
|
-
content: {
|
|
33520
|
-
display: "mly78zum5",
|
|
33521
|
-
flexDirection: "mlydt5ytf",
|
|
33522
|
-
boxShadow: "mly5n1uv4",
|
|
33523
|
-
backgroundColor: "mly12peec7",
|
|
33524
|
-
borderRadius: "mlyur7f20",
|
|
33525
|
-
borderStartStartRadius: null,
|
|
33526
|
-
borderStartEndRadius: null,
|
|
33527
|
-
borderEndStartRadius: null,
|
|
33528
|
-
borderEndEndRadius: null,
|
|
33529
|
-
borderTopLeftRadius: null,
|
|
33530
|
-
borderTopRightRadius: null,
|
|
33531
|
-
borderBottomLeftRadius: null,
|
|
33532
|
-
borderBottomRightRadius: null,
|
|
33533
|
-
padding: "mlye8ttls",
|
|
33534
|
-
paddingInline: null,
|
|
33535
|
-
paddingStart: null,
|
|
33536
|
-
paddingLeft: null,
|
|
33537
|
-
paddingEnd: null,
|
|
33538
|
-
paddingRight: null,
|
|
33539
|
-
paddingBlock: null,
|
|
33540
|
-
paddingTop: null,
|
|
33541
|
-
paddingBottom: null,
|
|
33542
|
-
minWidth: "mlylm99nl",
|
|
33543
|
-
maxWidth: "mly1jkqq1h",
|
|
33544
|
-
gap: "mly167g77z",
|
|
33545
|
-
rowGap: null,
|
|
33546
|
-
columnGap: null,
|
|
33547
|
-
$$css: true
|
|
33548
|
-
},
|
|
33549
|
-
editorCell: {
|
|
33550
|
-
flexGrow: "mly1iyjqo2",
|
|
33551
|
-
$$css: true
|
|
33552
|
-
},
|
|
33553
|
-
input: {
|
|
33554
|
-
border: "mly2yh2zd",
|
|
33555
|
-
borderWidth: null,
|
|
33556
|
-
borderInlineWidth: null,
|
|
33557
|
-
borderInlineStartWidth: null,
|
|
33558
|
-
borderLeftWidth: null,
|
|
33559
|
-
borderInlineEndWidth: null,
|
|
33560
|
-
borderRightWidth: null,
|
|
33561
|
-
borderBlockWidth: null,
|
|
33562
|
-
borderTopWidth: null,
|
|
33563
|
-
borderBottomWidth: null,
|
|
33564
|
-
borderStyle: null,
|
|
33565
|
-
borderInlineStyle: null,
|
|
33566
|
-
borderInlineStartStyle: null,
|
|
33567
|
-
borderLeftStyle: null,
|
|
33568
|
-
borderInlineEndStyle: null,
|
|
33569
|
-
borderRightStyle: null,
|
|
33570
|
-
borderBlockStyle: null,
|
|
33571
|
-
borderTopStyle: null,
|
|
33572
|
-
borderBottomStyle: null,
|
|
33573
|
-
borderColor: null,
|
|
33574
|
-
borderInlineColor: null,
|
|
33575
|
-
borderInlineStartColor: null,
|
|
33576
|
-
borderLeftColor: null,
|
|
33577
|
-
borderInlineEndColor: null,
|
|
33578
|
-
borderRightColor: null,
|
|
33579
|
-
borderBlockColor: null,
|
|
33580
|
-
borderTopColor: null,
|
|
33581
|
-
borderBottomColor: null,
|
|
33582
|
-
color: "mlyizdh9v",
|
|
33583
|
-
padding: "mly9cpjcd",
|
|
33584
|
-
paddingInline: null,
|
|
33585
|
-
paddingStart: null,
|
|
33586
|
-
paddingLeft: null,
|
|
33587
|
-
paddingEnd: null,
|
|
33588
|
-
paddingRight: null,
|
|
33589
|
-
paddingBlock: null,
|
|
33590
|
-
paddingTop: null,
|
|
33591
|
-
paddingBottom: null,
|
|
33592
|
-
borderRadius: "mly1sxf85j",
|
|
33593
|
-
borderStartStartRadius: null,
|
|
33594
|
-
borderStartEndRadius: null,
|
|
33595
|
-
borderEndStartRadius: null,
|
|
33596
|
-
borderEndEndRadius: null,
|
|
33597
|
-
borderTopLeftRadius: null,
|
|
33598
|
-
borderTopRightRadius: null,
|
|
33599
|
-
borderBottomLeftRadius: null,
|
|
33600
|
-
borderBottomRightRadius: null,
|
|
33601
|
-
$$css: true
|
|
33602
|
-
}
|
|
33603
|
-
};
|
|
33604
34250
|
function SortableOperations({
|
|
33605
34251
|
rootQuery,
|
|
33606
34252
|
segment,
|
|
@@ -33662,7 +34308,7 @@ function SortableOperations({
|
|
|
33662
34308
|
fields,
|
|
33663
34309
|
...props2
|
|
33664
34310
|
}), /* @__PURE__ */ jsx("div", {
|
|
33665
|
-
..._stylex.props(styles$
|
|
34311
|
+
..._stylex.props(styles$u.tokenContainer),
|
|
33666
34312
|
children: /* @__PURE__ */ jsx(DndContext, {
|
|
33667
34313
|
sensors,
|
|
33668
34314
|
collisionDetection: closestCenter,
|
|
@@ -33748,24 +34394,39 @@ function SortableOperation({
|
|
|
33748
34394
|
id,
|
|
33749
34395
|
ref: setNodeRef,
|
|
33750
34396
|
style,
|
|
33751
|
-
children: [granular ? /* @__PURE__ */ jsxs(
|
|
33752
|
-
|
|
33753
|
-
|
|
33754
|
-
|
|
33755
|
-
|
|
33756
|
-
|
|
33757
|
-
|
|
33758
|
-
attributes,
|
|
33759
|
-
listeners
|
|
34397
|
+
children: [granular ? /* @__PURE__ */ jsxs("div", {
|
|
34398
|
+
...{
|
|
34399
|
+
0: {
|
|
34400
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly11ogjb6 mly1g9of4s"
|
|
34401
|
+
},
|
|
34402
|
+
1: {
|
|
34403
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly1ae5hkt"
|
|
33760
34404
|
}
|
|
33761
|
-
}
|
|
33762
|
-
|
|
33763
|
-
|
|
33764
|
-
|
|
33765
|
-
|
|
33766
|
-
|
|
34405
|
+
}[!!hoverActionsVisible << 0],
|
|
34406
|
+
children: [/* @__PURE__ */ jsxs(TokenGroup, {
|
|
34407
|
+
customStyle: customStyles.tokenGroup,
|
|
34408
|
+
children: [/* @__PURE__ */ jsx(Token, {
|
|
34409
|
+
color,
|
|
34410
|
+
icon,
|
|
34411
|
+
label: fieldInfo.name,
|
|
34412
|
+
dragProps: {
|
|
34413
|
+
attributes,
|
|
34414
|
+
listeners
|
|
34415
|
+
}
|
|
34416
|
+
}), /* @__PURE__ */ jsx(SelectorToken, {
|
|
34417
|
+
color,
|
|
34418
|
+
value: granular.value,
|
|
34419
|
+
onChange: (granulation) => {
|
|
34420
|
+
if (operation.field.expression instanceof ASTTimeTruncationExpression) operation.field.expression.truncation = granulation;
|
|
34421
|
+
setQuery == null ? void 0 : setQuery(rootQuery.build());
|
|
34422
|
+
},
|
|
34423
|
+
items: granular.options
|
|
34424
|
+
})]
|
|
34425
|
+
}), hoverActions && /* @__PURE__ */ jsx("div", {
|
|
34426
|
+
...{
|
|
34427
|
+
className: "mly2b4tyj mly2lah0s"
|
|
33767
34428
|
},
|
|
33768
|
-
|
|
34429
|
+
children: hoverActions
|
|
33769
34430
|
})]
|
|
33770
34431
|
}) : /* @__PURE__ */ jsx(FieldToken, {
|
|
33771
34432
|
field: fieldInfo,
|
|
@@ -33994,7 +34655,7 @@ const parsedToLabels = (parsed, filterString) => {
|
|
|
33994
34655
|
const {
|
|
33995
34656
|
not
|
|
33996
34657
|
} = temporalClause;
|
|
33997
|
-
op =
|
|
34658
|
+
op = not ? "through" : "is after";
|
|
33998
34659
|
value = displayTimeFromMoment(temporalClause.after);
|
|
33999
34660
|
}
|
|
34000
34661
|
break;
|
|
@@ -34003,7 +34664,7 @@ const parsedToLabels = (parsed, filterString) => {
|
|
|
34003
34664
|
const {
|
|
34004
34665
|
not
|
|
34005
34666
|
} = temporalClause;
|
|
34006
|
-
op = not ? "
|
|
34667
|
+
op = not ? "starting" : "is before";
|
|
34007
34668
|
value = displayTimeFromMoment(temporalClause.before);
|
|
34008
34669
|
}
|
|
34009
34670
|
break;
|
|
@@ -34087,10 +34748,10 @@ function FilterOperations({
|
|
|
34087
34748
|
}
|
|
34088
34749
|
return /* @__PURE__ */ jsxs("div", {
|
|
34089
34750
|
children: [/* @__PURE__ */ jsx("div", {
|
|
34090
|
-
..._stylex.props(styles$
|
|
34751
|
+
..._stylex.props(styles$u.title),
|
|
34091
34752
|
children: "filter by"
|
|
34092
34753
|
}), /* @__PURE__ */ jsx("div", {
|
|
34093
|
-
..._stylex.props(styles$
|
|
34754
|
+
..._stylex.props(styles$u.tokenContainer),
|
|
34094
34755
|
children: filters.map((filterOperation, key2) => {
|
|
34095
34756
|
return /* @__PURE__ */ jsx(ErrorElement, {
|
|
34096
34757
|
fallback: /* @__PURE__ */ jsxs("div", {
|
|
@@ -34123,29 +34784,33 @@ function SingleFilterOperation({
|
|
|
34123
34784
|
}
|
|
34124
34785
|
setQuery == null ? void 0 : setQuery(rootQuery.build());
|
|
34125
34786
|
}, [filterOperation.filter, rootQuery, setQuery]);
|
|
34126
|
-
|
|
34787
|
+
const {
|
|
34788
|
+
filter
|
|
34789
|
+
} = filterOperation;
|
|
34790
|
+
if (!(filter instanceof ASTFilterWithFilterString)) {
|
|
34127
34791
|
return null;
|
|
34128
34792
|
}
|
|
34129
34793
|
const {
|
|
34130
|
-
|
|
34794
|
+
expression,
|
|
34131
34795
|
filterString
|
|
34132
|
-
} =
|
|
34133
|
-
|
|
34134
|
-
|
|
34135
|
-
if (fieldInfo.kind !== "dimension" && fieldInfo.kind !== "measure") {
|
|
34136
|
-
throw new Error(`Invalid filter field kind: ${fieldInfo.kind}`);
|
|
34796
|
+
} = filter;
|
|
34797
|
+
if (!(expression instanceof ASTReferenceExpression)) {
|
|
34798
|
+
return null;
|
|
34137
34799
|
}
|
|
34800
|
+
const fieldInfo = filter.getFieldInfo();
|
|
34801
|
+
const parsedFilter = filter.getFilter();
|
|
34802
|
+
const path = expression.path ?? [];
|
|
34138
34803
|
const {
|
|
34139
34804
|
op,
|
|
34140
34805
|
value
|
|
34141
|
-
} = parsedToLabels(
|
|
34806
|
+
} = parsedToLabels(parsedFilter, filterString);
|
|
34142
34807
|
const label = `${fieldInfo.name} ${op} ${value}`;
|
|
34143
34808
|
return /* @__PURE__ */ jsxs("div", {
|
|
34144
34809
|
..._stylex.props(hoverStyles.main),
|
|
34145
34810
|
children: [/* @__PURE__ */ jsx(FilterPopover, {
|
|
34146
34811
|
fieldInfo,
|
|
34147
|
-
path
|
|
34148
|
-
filter,
|
|
34812
|
+
path,
|
|
34813
|
+
filter: parsedFilter,
|
|
34149
34814
|
setFilter,
|
|
34150
34815
|
trigger: /* @__PURE__ */ jsx(Token, {
|
|
34151
34816
|
icon: "filter",
|
|
@@ -34180,7 +34845,7 @@ function LimitOperation({
|
|
|
34180
34845
|
}
|
|
34181
34846
|
return /* @__PURE__ */ jsxs("div", {
|
|
34182
34847
|
children: [/* @__PURE__ */ jsx("div", {
|
|
34183
|
-
..._stylex.props(styles$
|
|
34848
|
+
..._stylex.props(styles$u.title),
|
|
34184
34849
|
children: "limit"
|
|
34185
34850
|
}), /* @__PURE__ */ jsxs("div", {
|
|
34186
34851
|
..._stylex.props(hoverStyles.main),
|
|
@@ -34230,10 +34895,10 @@ function OrderByOperations({
|
|
|
34230
34895
|
}
|
|
34231
34896
|
return /* @__PURE__ */ jsxs("div", {
|
|
34232
34897
|
children: [/* @__PURE__ */ jsx("div", {
|
|
34233
|
-
..._stylex.props(styles$
|
|
34898
|
+
..._stylex.props(styles$u.title),
|
|
34234
34899
|
children: "order by"
|
|
34235
34900
|
}), /* @__PURE__ */ jsx("div", {
|
|
34236
|
-
..._stylex.props(styles$
|
|
34901
|
+
..._stylex.props(styles$u.tokenContainer),
|
|
34237
34902
|
children: orderBys.map((orderBy) => {
|
|
34238
34903
|
const {
|
|
34239
34904
|
fieldReference
|
|
@@ -34783,7 +35448,7 @@ function NestOperations({
|
|
|
34783
35448
|
return null;
|
|
34784
35449
|
}
|
|
34785
35450
|
return /* @__PURE__ */ jsx("div", {
|
|
34786
|
-
..._stylex.props(styles$
|
|
35451
|
+
..._stylex.props(styles$u.tokenContainer),
|
|
34787
35452
|
children: nests.map((nest) => /* @__PURE__ */ jsx(NestOperation, {
|
|
34788
35453
|
rootQuery,
|
|
34789
35454
|
view,
|
|
@@ -35116,9 +35781,9 @@ function Source({
|
|
|
35116
35781
|
}) {
|
|
35117
35782
|
if (rootQuery.definition instanceof ASTArrowQueryDefinition) {
|
|
35118
35783
|
return /* @__PURE__ */ jsx("div", {
|
|
35119
|
-
..._stylex.props(styles$
|
|
35784
|
+
..._stylex.props(styles$u.queryCard, styles$b.content),
|
|
35120
35785
|
children: /* @__PURE__ */ jsxs("div", {
|
|
35121
|
-
..._stylex.props(styles$
|
|
35786
|
+
..._stylex.props(styles$u.labelWithIcon),
|
|
35122
35787
|
children: [/* @__PURE__ */ jsx(Icon, {
|
|
35123
35788
|
name: "database"
|
|
35124
35789
|
}), /* @__PURE__ */ jsx("div", {
|
|
@@ -36056,17 +36721,14 @@ function RenderedResult({
|
|
|
36056
36721
|
const viz = useMemo(() => {
|
|
36057
36722
|
const renderer = new MalloyRenderer();
|
|
36058
36723
|
const viz2 = renderer.createViz({
|
|
36059
|
-
onDrill: ({
|
|
36060
|
-
stableQuery,
|
|
36061
|
-
stableDrillClauses
|
|
36062
|
-
}) => {
|
|
36724
|
+
onDrill: (drillData) => {
|
|
36063
36725
|
if (onDrill) {
|
|
36064
|
-
onDrill(
|
|
36065
|
-
stableQuery,
|
|
36066
|
-
stableDrillClauses
|
|
36067
|
-
});
|
|
36726
|
+
onDrill(drillData);
|
|
36068
36727
|
return;
|
|
36069
36728
|
}
|
|
36729
|
+
const {
|
|
36730
|
+
stableQuery
|
|
36731
|
+
} = drillData;
|
|
36070
36732
|
const rootQuery = new ASTQuery({
|
|
36071
36733
|
query: stableQuery,
|
|
36072
36734
|
source
|
|
@@ -36743,7 +37405,10 @@ function FieldTokenWithActions({
|
|
|
36743
37405
|
disabled: !!filterDisabledReason,
|
|
36744
37406
|
onTooltipOpenChange: setIsTooltipOpen
|
|
36745
37407
|
}),
|
|
36746
|
-
onOpenChange: setIsFilterPopoverOpen
|
|
37408
|
+
onOpenChange: setIsFilterPopoverOpen,
|
|
37409
|
+
layoutProps: {
|
|
37410
|
+
align: "start"
|
|
37411
|
+
}
|
|
36747
37412
|
}), /* @__PURE__ */ jsx(ActionButton, {
|
|
36748
37413
|
icon: "orderBy",
|
|
36749
37414
|
tooltip: orderByDisabledReason || "Add as order by",
|
|
@@ -36768,7 +37433,10 @@ function FieldTokenWithActions({
|
|
|
36768
37433
|
disabled: !!filterDisabledReason,
|
|
36769
37434
|
onTooltipOpenChange: setIsTooltipOpen
|
|
36770
37435
|
}),
|
|
36771
|
-
onOpenChange: setIsFilterPopoverOpen
|
|
37436
|
+
onOpenChange: setIsFilterPopoverOpen,
|
|
37437
|
+
layoutProps: {
|
|
37438
|
+
align: "start"
|
|
37439
|
+
}
|
|
36772
37440
|
}), /* @__PURE__ */ jsx(ActionButton, {
|
|
36773
37441
|
icon: "orderBy",
|
|
36774
37442
|
tooltip: orderByDisabledReason || "Add as order by",
|