@malloydata/malloy-explorer 0.0.264-dev250417011542 → 0.0.266-dev250421232431

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -17,7 +17,7 @@ import * as React from "react";
17
17
  import React__default, { useLayoutEffect, useEffect, useMemo, useState, useRef, createElement, useCallback, useContext } from "react";
18
18
  import { jsx, Fragment, jsxs } from "react/jsx-runtime";
19
19
  import * as QB from "@malloydata/malloy-query-builder";
20
- import { ASTArrowQueryDefinition, ASTSegmentViewDefinition, ASTLimitViewOperation, ASTNestViewOperation, ASTRefinementViewDefinition, ASTOrderByViewOperation, ASTGroupByViewOperation, ASTAggregateViewOperation, ASTWhereViewOperation, ASTHavingViewOperation, ASTArrowViewDefinition } from "@malloydata/malloy-query-builder";
20
+ import { ASTArrowQueryDefinition, ASTSegmentViewDefinition, ASTNestViewOperation, ASTRefinementViewDefinition, ASTLimitViewOperation, ASTOrderByViewOperation, ASTGroupByViewOperation, ASTAggregateViewOperation, ASTWhereViewOperation, ASTHavingViewOperation, ASTArrowViewDefinition } from "@malloydata/malloy-query-builder";
21
21
  import { Tag } from "@malloydata/malloy-tag";
22
22
  import * as render from "@malloydata/render";
23
23
  import "@malloydata/render/webcomponent";
@@ -4991,6 +4991,8 @@ const SvgWarning = (props2) => /* @__PURE__ */ React.createElement("svg", { xmln
4991
4991
  const SvgCheckCircle = (props2) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "currentColor", ...props2 }, /* @__PURE__ */ React.createElement("path", { d: "m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" }));
4992
4992
  const SvgInfo = (props2) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "currentColor", ...props2 }, /* @__PURE__ */ React.createElement("path", { d: "M440-280h80v-240h-80v240Zm40-320q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm0 520q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-80q134 0 227-93t93-227q0-134-93-227t-227-93q-134 0-227 93t-93 227q0 134 93 227t227 93Zm0-320Z" }));
4993
4993
  const SvgError = (props2) => /* @__PURE__ */ React.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", height: "24px", viewBox: "0 -960 960 960", width: "24px", fill: "currentColor", ...props2 }, /* @__PURE__ */ React.createElement("path", { d: "M480-280q17 0 28.5-11.5T520-320q0-17-11.5-28.5T480-360q-17 0-28.5 11.5T440-320q0 17 11.5 28.5T480-280Zm-40-160h80v-240h-80v240ZM330-120 120-330v-300l210-210h300l210 210v300L630-120H330Zm34-80h232l164-164v-232L596-760H364L200-596v232l164 164Zm116-280Z" }));
4994
+ const SvgRefresh = (props2) => /* @__PURE__ */ React.createElement("svg", { height: 20, viewBox: "0 0 20 20", width: 20, xmlns: "http://www.w3.org/2000/svg", ...props2 }, /* @__PURE__ */ React.createElement("g", { fill: "none", stroke: "currentColor" }, /* @__PURE__ */ React.createElement("path", { d: "m17.08 11.15c.01.16.02.32.02.49 0 3.89-3.16 7.05-7.05 7.05-3.89-.01-7.05-3.16-7.05-7.06 0-3.89 3.16-7.05 7.05-7.05.85 0 1.66.15 2.41.42", strokeWidth: 1.1 }), /* @__PURE__ */ React.createElement("path", { d: "m9.9 2 2.89 2.89-3 3.01" })));
4995
+ const SvgSidebarCollapse = (props2) => /* @__PURE__ */ React.createElement("svg", { height: 24, viewBox: "0 0 24 24", width: 24, xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", stroke: "none", ...props2 }, /* @__PURE__ */ React.createElement("path", { fill: "currentColor", stroke: "none", d: "m20 24h-16c-2.2 0-4-1.8-4-4v-16c0-2.2 1.8-4 4-4h16c2.2 0 4 1.8 4 4v16c0 2.2-1.8 4-4 4zm-16-22c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2v-16c0-1.1-.9-2-2-2z" }), /* @__PURE__ */ React.createElement("path", { fill: "currentColor", d: "m8 24c-.6 0-1-.4-1-1v-22c0-.6.4-1 1-1s1 .4 1 1v22c0 .6-.4 1-1 1z" }), /* @__PURE__ */ React.createElement("path", { fill: "currentColor", d: "m14 13c-.3 0-.5-.1-.7-.3-.4-.4-.4-1 0-1.4l3-3c.4-.4 1-.4 1.4 0s.4 1 0 1.4l-3 3c-.2.2-.4.3-.7.3z" }), /* @__PURE__ */ React.createElement("path", { fill: "currentColor", d: "m17 16c-.3 0-.5-.1-.7-.3l-3-3c-.4-.4-.4-1 0-1.4s1-.4 1.4 0l3 3c.4.4.4 1 0 1.4-.2.2-.4.3-.7.3z" }));
4994
4996
  const SvgVizBarChart = (props2) => /* @__PURE__ */ React.createElement("svg", { width: "110px", height: "110px", viewBox: "0 0 110 110", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props2 }, /* @__PURE__ */ React.createElement("g", { id: "viz_bar_chart", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("g", { id: "Group-3", transform: "translate(20.000000, 24.000000)", fill: "currentColor" }, /* @__PURE__ */ React.createElement("g", { id: "Group-2", transform: "translate(34.500000, 31.000000) rotate(-270.000000) translate(-34.500000, -31.000000) translate(3.500000, -3.500000)" }, /* @__PURE__ */ React.createElement("path", { d: "M-26.056314,30.056314 L34.943686,30.056314 C37.152825,30.056314 38.943686,31.847175 38.943686,34.056314 L38.943686,34.943686 C38.943686,37.152825 37.152825,38.943686 34.943686,38.943686 L-26.056314,38.943686 C-28.265453,38.943686 -30.056314,37.152825 -30.056314,34.943686 L-30.056314,34.056314 C-30.056314,31.847175 -28.265453,30.056314 -26.056314,30.056314 Z", id: "Rectangle-Copy-59", transform: "translate(4.443686, 34.500000) rotate(-90.000000) translate(-4.443686, -34.500000) " }), /* @__PURE__ */ React.createElement("path", { d: "M-0.491247385,37.8466366 L44.9281075,37.8466366 C47.1372465,37.8466366 48.9281075,39.6374976 48.9281075,41.8466366 L48.9281075,42.7340086 C48.9281075,44.9431476 47.1372465,46.7340086 44.9281075,46.7340086 L-0.491247385,46.7340086 C-2.70038638,46.7340086 -4.49124739,44.9431476 -4.49124739,42.7340086 L-4.49124739,41.8466366 C-4.49124739,39.6374976 -2.70038638,37.8466366 -0.491247385,37.8466366 Z", id: "Rectangle-Copy-62", transform: "translate(22.218430, 42.290323) rotate(-90.000000) translate(-22.218430, -42.290323) " }), /* @__PURE__ */ React.createElement("path", { d: "M23.3837854,43.9469253 L56.6025627,43.9469253 C58.8117017,43.9469253 60.6025627,45.7377863 60.6025627,47.9469253 L60.6025627,48.8342973 C60.6025627,51.0434363 58.8117017,52.8342973 56.6025627,52.8342973 L23.3837854,52.8342973 C21.1746464,52.8342973 19.3837854,51.0434363 19.3837854,48.8342973 L19.3837854,47.9469253 C19.3837854,45.7377863 21.1746464,43.9469253 23.3837854,43.9469253 Z", id: "Rectangle-Copy-66", transform: "translate(39.993174, 48.390611) rotate(-90.000000) translate(-39.993174, -48.390611) " }), /* @__PURE__ */ React.createElement("path", { d: "M46.7286345,49.7286345 L68.8072017,49.7286345 C71.0163407,49.7286345 72.8072017,51.5194955 72.8072017,53.7286345 L72.8072017,54.1927983 C72.8072017,56.4019373 71.0163407,58.1927983 68.8072017,58.1927983 L46.7286345,58.1927983 C44.5194955,58.1927983 42.7286345,56.4019373 42.7286345,54.1927983 L42.7286345,53.7286345 C42.7286345,51.5194955 44.5194955,49.7286345 46.7286345,49.7286345 Z", id: "Rectangle-Copy-67", transform: "translate(57.767918, 53.960716) rotate(-90.000000) translate(-57.767918, -53.960716) " })))));
4995
4997
  const SvgVizBoolean = (props2) => /* @__PURE__ */ React.createElement("svg", { width: "110px", height: "110px", viewBox: "0 0 110 110", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props2 }, /* @__PURE__ */ React.createElement("g", { id: "viz_boolean", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("g", { id: "noun_switch_3350414-2", transform: "translate(20.000000, 22.000000)", fill: "currentColor", fillRule: "nonzero" }, /* @__PURE__ */ React.createElement("g", { id: "noun_switch_3350414" }, /* @__PURE__ */ React.createElement("path", { d: "M15.2972028,30.8 L54.7027972,30.8 C63.151209,30.8 70,23.9051851 70,15.4 C70,6.89481485 63.151209,0 54.7027972,0 L15.2972028,0 C6.84879098,0 0,6.89481485 0,15.4 C0,23.9051851 6.84879098,30.8 15.2972028,30.8 Z M15.2972028,6.16 L54.7027972,6.16 C59.7718443,6.16 63.8811189,10.2968889 63.8811189,15.4 C63.8811189,20.5031111 59.7718443,24.64 54.7027972,24.64 L15.2972028,24.64 C10.2281557,24.64 6.11888112,20.5031111 6.11888112,15.4 C6.11888112,10.2968889 10.2281557,6.16 15.2972028,6.16 Z", id: "Shape" }), /* @__PURE__ */ React.createElement("path", { d: "M19.6340542,21.9997804 C22.2930484,22.0215224 24.7022661,20.4273668 25.7348338,17.9629544 C26.7674016,15.4985421 26.2191958,12.6510518 24.3466309,10.7523518 C22.474066,8.85365189 19.6473211,8.27908795 17.1885612,9.29740315 C14.7298014,10.3157183 13.125,12.7256064 13.125,15.3998806 C13.125,19.0240523 16.0305897,21.9703156 19.6340542,21.9997804 L19.6340542,21.9997804 Z", id: "Path" }), /* @__PURE__ */ React.createElement("path", { d: "M54.7027971,35.2 L15.2972025,35.2 C6.84879081,35.2 0,42.094815 0,50.6 C0,59.105185 6.84879081,66 15.2972025,66 L54.7027971,66 C63.151209,66 70,59.1051851 70,50.6 C70,42.0948149 63.151209,35.2 54.7027971,35.2 L54.7027971,35.2 Z M54.7027971,59.84 L15.2972025,59.84 C10.2281554,59.84 6.11888082,55.7031111 6.11888082,50.6 C6.11888082,45.4968889 10.2281554,41.36 15.2972025,41.36 L54.7027971,41.36 C59.7718442,41.36 63.8811189,45.4968889 63.8811189,50.6 C63.8811189,55.7031111 59.7718442,59.84 54.7027971,59.84 L54.7027971,59.84 Z", id: "Shape" }), /* @__PURE__ */ React.createElement("path", { d: "M50.3659458,44.0002196 C47.7069516,43.9784776 45.2977339,45.5726332 44.2651662,48.0370456 C43.2325984,50.5014579 43.7808042,53.3489482 45.6533691,55.2476482 C47.525934,57.1463481 50.3526789,57.720912 52.8114388,56.7025969 C55.2701986,55.6842817 56.875,53.2743936 56.875,50.6001194 C56.875,46.9759477 53.9694103,44.0296844 50.3659458,44.0002196 Z", id: "Path" })))));
4996
4998
  const SvgVizColumnChart = (props2) => /* @__PURE__ */ React.createElement("svg", { width: "110px", height: "110px", viewBox: "0 0 110 110", xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", ...props2 }, /* @__PURE__ */ React.createElement("g", { id: "viz_column_chart", stroke: "none", strokeWidth: 1, fill: "none", fillRule: "evenodd" }, /* @__PURE__ */ React.createElement("g", { id: "Group", transform: "translate(23.500000, 19.500000)", fill: "currentColor" }, /* @__PURE__ */ React.createElement("path", { d: "M-26.5,30.5 L35.5,30.5 C37.709139,30.5 39.5,32.290861 39.5,34.5 L39.5,35.5 C39.5,37.709139 37.709139,39.5 35.5,39.5 L-26.5,39.5 C-28.709139,39.5 -30.5,37.709139 -30.5,35.5 L-30.5,34.5 C-30.5,32.290861 -28.709139,30.5 -26.5,30.5 Z", id: "Rectangle-Copy-59", transform: "translate(4.500000, 35.000000) rotate(-90.000000) translate(-4.500000, -35.000000) " }), /* @__PURE__ */ React.createElement("path", { d: "M-0.5,38.5 L45.5,38.5 C47.709139,38.5 49.5,40.290861 49.5,42.5 L49.5,43.5 C49.5,45.709139 47.709139,47.5 45.5,47.5 L-0.5,47.5 C-2.709139,47.5 -4.5,45.709139 -4.5,43.5 L-4.5,42.5 C-4.5,40.290861 -2.709139,38.5 -0.5,38.5 Z", id: "Rectangle-Copy-62", transform: "translate(22.500000, 43.000000) rotate(-90.000000) translate(-22.500000, -43.000000) " }), /* @__PURE__ */ React.createElement("path", { d: "M23.5,45.5 L57.5,45.5 C59.709139,45.5 61.5,47.290861 61.5,49.5 L61.5,50.5 C61.5,52.709139 59.709139,54.5 57.5,54.5 L23.5,54.5 C21.290861,54.5 19.5,52.709139 19.5,50.5 L19.5,49.5 C19.5,47.290861 21.290861,45.5 23.5,45.5 Z", id: "Rectangle-Copy-66", transform: "translate(40.500000, 50.000000) rotate(-90.000000) translate(-40.500000, -50.000000) " }), /* @__PURE__ */ React.createElement("path", { d: "M47.5,50.5 L70.5,50.5 C72.709139,50.5 74.5,52.290861 74.5,54.5 L74.5,55.5 C74.5,57.709139 72.709139,59.5 70.5,59.5 L47.5,59.5 C45.290861,59.5 43.5,57.709139 43.5,55.5 L43.5,54.5 C43.5,52.290861 45.290861,50.5 47.5,50.5 Z", id: "Rectangle-Copy-67", transform: "translate(59.000000, 55.000000) rotate(-90.000000) translate(-59.000000, -55.000000) " }))));
@@ -5028,6 +5030,8 @@ const ICON_MAP = {
5028
5030
  check_circle: SvgCheckCircle,
5029
5031
  info: SvgInfo,
5030
5032
  error: SvgError,
5033
+ refresh: SvgRefresh,
5034
+ sidebarCollapse: SvgSidebarCollapse,
5031
5035
  // Operations
5032
5036
  aggregate: SvgInsertMeasure,
5033
5037
  dimension: SvgTypeIconString,
@@ -5094,10 +5098,10 @@ function Icon({
5094
5098
  return null;
5095
5099
  }
5096
5100
  return /* @__PURE__ */ jsx(IconComponent, {
5097
- ..._stylex.props(styles$A.main, colorVariants$3[color], SMALL_ICONS.includes(name) && styles$A.scaleUp, customStyle)
5101
+ ..._stylex.props(styles$G.main, colorVariants$3[color], SMALL_ICONS.includes(name) && styles$G.scaleUp, customStyle)
5098
5102
  });
5099
5103
  }
5100
- const styles$A = {
5104
+ const styles$G = {
5101
5105
  main: {
5102
5106
  display: "mly1rg5ohu",
5103
5107
  width: "mly1kky2od",
@@ -5170,17 +5174,17 @@ function Badge({
5170
5174
  customStyle
5171
5175
  }) {
5172
5176
  return /* @__PURE__ */ jsxs("div", {
5173
- ..._stylex.props(styles$z.main, colorVariants$2[color], customStyle),
5177
+ ..._stylex.props(styles$F.main, colorVariants$2[color], customStyle),
5174
5178
  children: [icon && /* @__PURE__ */ jsx(Icon, {
5175
5179
  color,
5176
5180
  name: icon
5177
5181
  }), /* @__PURE__ */ jsx("div", {
5178
- ..._stylex.props(fontStyles.badge, styles$z.label),
5182
+ ..._stylex.props(fontStyles.badge, styles$F.label),
5179
5183
  children: label
5180
5184
  })]
5181
5185
  });
5182
5186
  }
5183
- const styles$z = {
5187
+ const styles$F = {
5184
5188
  main: {
5185
5189
  display: "mly3nfvp2",
5186
5190
  height: "mly1qx5ct2",
@@ -5262,10 +5266,10 @@ function Divider({
5262
5266
  customStyle
5263
5267
  }) {
5264
5268
  return /* @__PURE__ */ jsx("div", {
5265
- ..._stylex.props(styles$y.main, orientationVariants[orientation], customStyle)
5269
+ ..._stylex.props(styles$E.main, orientationVariants[orientation], customStyle)
5266
5270
  });
5267
5271
  }
5268
- const styles$y = {
5272
+ const styles$E = {
5269
5273
  main: {
5270
5274
  background: "mly1xnbgy5",
5271
5275
  backgroundAttachment: null,
@@ -5318,7 +5322,7 @@ function ListItem({
5318
5322
  children: [startIcon && /* @__PURE__ */ jsx(Fragment, {
5319
5323
  children: startIcon
5320
5324
  }), /* @__PURE__ */ jsx("span", {
5321
- ..._stylex.props(fontStyles.body, styles$x.label),
5325
+ ..._stylex.props(fontStyles.body, styles$D.label),
5322
5326
  children: label
5323
5327
  }), badge && /* @__PURE__ */ jsx(Fragment, {
5324
5328
  children: badge
@@ -5327,7 +5331,7 @@ function ListItem({
5327
5331
  })]
5328
5332
  });
5329
5333
  }
5330
- const styles$x = {
5334
+ const styles$D = {
5331
5335
  label: {
5332
5336
  flexGrow: "mly1iyjqo2",
5333
5337
  $$css: true
@@ -6102,7 +6106,7 @@ function Button({
6102
6106
  ...props2
6103
6107
  }) {
6104
6108
  const button = /* @__PURE__ */ jsxs("button", {
6105
- ..._stylex.props(styles$w.main, colorVariants$1[variant], sizeVariants$1[size2], customStyle),
6109
+ ..._stylex.props(styles$C.main, colorVariants$1[variant], sizeVariants$1[size2], customStyle),
6106
6110
  ...onClick && {
6107
6111
  onClick: (e) => {
6108
6112
  e.preventDefault();
@@ -6118,9 +6122,9 @@ function Button({
6118
6122
  },
6119
6123
  children: [icon && /* @__PURE__ */ jsx(Icon, {
6120
6124
  name: icon,
6121
- customStyle: styles$w.icon
6125
+ customStyle: styles$C.icon
6122
6126
  }), label && /* @__PURE__ */ jsx("div", {
6123
- ..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$w.label),
6127
+ ..._stylex.props(variant === "primary" ? fontStyles.emphasized : fontStyles.body, styles$C.label),
6124
6128
  children: label
6125
6129
  })]
6126
6130
  }), isDisabled && /* @__PURE__ */ jsx("div", {
@@ -6147,7 +6151,7 @@ function Button({
6147
6151
  return button;
6148
6152
  }
6149
6153
  }
6150
- const styles$w = {
6154
+ const styles$C = {
6151
6155
  main: {
6152
6156
  display: "mly3nfvp2",
6153
6157
  flexDirection: "mlydt5ytf",
@@ -6269,7 +6273,8 @@ const sizeVariants$1 = {
6269
6273
  };
6270
6274
  const tokenStyles = {
6271
6275
  main: {
6272
- display: "mly78zum5",
6276
+ display: "mlywz0xwf",
6277
+ gridAutoFlow: "mly1mt1orb",
6273
6278
  alignItems: "mly6s0dn4",
6274
6279
  justifyContent: "mlyl56j7k",
6275
6280
  gap: "mly167g77z",
@@ -6326,6 +6331,7 @@ const tokenStyles = {
6326
6331
  overflow: "mlyb3r6kr",
6327
6332
  overflowX: null,
6328
6333
  overflowY: null,
6334
+ whiteSpace: "mlyuxw1ft",
6329
6335
  $$css: true
6330
6336
  }
6331
6337
  };
@@ -6394,7 +6400,7 @@ function Token({
6394
6400
  }) {
6395
6401
  const isInteractive = onClick !== void 0 || asButtonTrigger;
6396
6402
  const token2 = /* @__PURE__ */ jsxs("div", {
6397
- ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$v.nonInteractive, customStyle),
6403
+ ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], !isInteractive && styles$B.nonInteractive, customStyle),
6398
6404
  children: [icon && /* @__PURE__ */ jsx(Icon, {
6399
6405
  name: icon,
6400
6406
  customStyle: tokenStyles.icon
@@ -6429,7 +6435,7 @@ function Token({
6429
6435
  })]
6430
6436
  }) : token2;
6431
6437
  }
6432
- const styles$v = {
6438
+ const styles$B = {
6433
6439
  nonInteractive: {
6434
6440
  cursor: "mlyt0e3qv",
6435
6441
  background: "mly1np9qvj",
@@ -6453,7 +6459,7 @@ function TokenGroup({
6453
6459
  }) {
6454
6460
  const count2 = React.Children.count(children);
6455
6461
  return /* @__PURE__ */ jsx("div", {
6456
- ..._stylex.props(styles$u.main, customStyle),
6462
+ ..._stylex.props(styles$A.main, customStyle),
6457
6463
  children: React.Children.map(children, (child, index2) => /* @__PURE__ */ React.cloneElement(child, {
6458
6464
  customStyle: {
6459
6465
  ...child.props.customStyle,
@@ -6464,16 +6470,16 @@ function TokenGroup({
6464
6470
  });
6465
6471
  }
6466
6472
  const getChildStyle = (index2, count2) => {
6467
- if (count2 === 1) return styles$u.onlyChild;
6468
- if (index2 === 0) return styles$u.firstChild;
6469
- if (index2 === count2 - 1) return styles$u.lastChild;
6470
- return styles$u.innerChild;
6473
+ if (count2 === 1) return styles$A.onlyChild;
6474
+ if (index2 === 0) return styles$A.firstChild;
6475
+ if (index2 === count2 - 1) return styles$A.lastChild;
6476
+ return styles$A.innerChild;
6471
6477
  };
6472
6478
  const getTokenColor = (child, groupColor) => {
6473
6479
  const childColor = child.props.color;
6474
6480
  return childColor === void 0 ? groupColor : childColor;
6475
6481
  };
6476
- const styles$u = {
6482
+ const styles$A = {
6477
6483
  main: {
6478
6484
  display: "mlyrvj5dj",
6479
6485
  gridAutoFlow: "mly1mt1orb",
@@ -6545,7 +6551,7 @@ function ErrorIcon({
6545
6551
  },
6546
6552
  children: /* @__PURE__ */ jsx(Icon, {
6547
6553
  name: "warning",
6548
- customStyle: styles$t.errorIcon
6554
+ customStyle: styles$z.errorIcon
6549
6555
  })
6550
6556
  })
6551
6557
  }), /* @__PURE__ */ jsx(TooltipPortal, {
@@ -6558,7 +6564,7 @@ function ErrorIcon({
6558
6564
  })]
6559
6565
  });
6560
6566
  }
6561
- const styles$t = {
6567
+ const styles$z = {
6562
6568
  errorIcon: {
6563
6569
  color: "mly1e2nbdu",
6564
6570
  $$css: true
@@ -6603,28 +6609,29 @@ function EditableToken({
6603
6609
  className: "mly78zum5 mly6s0dn4"
6604
6610
  },
6605
6611
  children: [/* @__PURE__ */ jsxs("div", {
6606
- ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$s.focused, !!errorMessage && styles$s.hasError, customStyle),
6612
+ ..._stylex.props(tokenStyles.main, tokenColorVariants[color], tokenSizeVariants[size2], isFocused && styles$y.focused, !!errorMessage && styles$y.hasError, customStyle),
6607
6613
  children: [icon && /* @__PURE__ */ jsx(Icon, {
6608
6614
  name: icon,
6609
- customStyle: styles$s.icon
6615
+ customStyle: styles$y.icon
6610
6616
  }), /* @__PURE__ */ jsxs("span", {
6611
6617
  ...{
6612
- className: "mlywz0xwf mlynq0rdo"
6618
+ className: "mlywz0xwf"
6613
6619
  },
6614
6620
  children: [/* @__PURE__ */ jsx("span", {
6615
- ..._stylex.props(fontStyles.body, styles$s.placeholder),
6621
+ ..._stylex.props(fontStyles.body, styles$y.placeholder),
6616
6622
  style: {
6617
6623
  whiteSpaceCollapse: "preserve"
6618
6624
  },
6619
6625
  children: value
6620
6626
  }), /* @__PURE__ */ jsx("input", {
6621
- ..._stylex.props(styles$s.input, fontStyles.body),
6627
+ ..._stylex.props(styles$y.input, fontStyles.body),
6622
6628
  ref: inputRef,
6623
6629
  pattern: type === "number" ? "^-?[0-9.]*$" : void 0,
6624
6630
  value,
6625
6631
  onChange: handleChange,
6626
6632
  onFocus: handleFocus,
6627
- onBlur: handleBlur
6633
+ onBlur: handleBlur,
6634
+ size: 1
6628
6635
  })]
6629
6636
  }), onRemove && isFocused && /* @__PURE__ */ jsx("button", {
6630
6637
  ...{
@@ -6642,7 +6649,7 @@ function EditableToken({
6642
6649
  })]
6643
6650
  });
6644
6651
  }
6645
- const styles$s = {
6652
+ const styles$y = {
6646
6653
  focused: {
6647
6654
  background: "mlyotlr4g",
6648
6655
  backgroundAttachment: null,
@@ -6714,6 +6721,7 @@ const styles$s = {
6714
6721
  gridColumnStart: null,
6715
6722
  gridColumnEnd: null,
6716
6723
  whiteSpace: "mlyuxw1ft",
6724
+ minWidth: "mlygc0pbm",
6717
6725
  $$css: true
6718
6726
  },
6719
6727
  input: {
@@ -6725,7 +6733,6 @@ const styles$s = {
6725
6733
  gridColumn: null,
6726
6734
  gridColumnStart: null,
6727
6735
  gridColumnEnd: null,
6728
- minWidth: "mly1mnxie6",
6729
6736
  padding: "mly1717udv",
6730
6737
  paddingInline: null,
6731
6738
  paddingStart: null,
@@ -6761,6 +6768,7 @@ const styles$s = {
6761
6768
  outlineStyle: null,
6762
6769
  outlineWidth: null,
6763
6770
  whiteSpace: "mlyuxw1ft",
6771
+ minWidth: "mlygc0pbm",
6764
6772
  $$css: true
6765
6773
  }
6766
6774
  };
@@ -7985,12 +7993,12 @@ function TextInput({
7985
7993
  }
7986
7994
  };
7987
7995
  return /* @__PURE__ */ jsxs("div", {
7988
- ..._stylex.props(styles$r.main, isFocused && styles$r.focused, sizeVariants[size2], customStyle),
7996
+ ..._stylex.props(styles$x.main, isFocused && styles$x.focused, sizeVariants[size2], customStyle),
7989
7997
  children: [icon && /* @__PURE__ */ jsx(Icon, {
7990
7998
  name: icon,
7991
7999
  color: "secondary"
7992
8000
  }), /* @__PURE__ */ jsx("input", {
7993
- ..._stylex.props(fontStyles.body, styles$r.input),
8001
+ ..._stylex.props(fontStyles.body, styles$x.input),
7994
8002
  value,
7995
8003
  placeholder,
7996
8004
  onChange: handleChange,
@@ -7998,7 +8006,7 @@ function TextInput({
7998
8006
  onBlur: handleBlur,
7999
8007
  onKeyDown
8000
8008
  }), hasClear && /* @__PURE__ */ jsx("button", {
8001
- ..._stylex.props(fontStyles.supporting, styles$r.actionButton, value === "" && styles$r.hidden),
8009
+ ..._stylex.props(fontStyles.supporting, styles$x.actionButton, value === "" && styles$x.hidden),
8002
8010
  ref: buttonRef,
8003
8011
  onClick: () => onChange(""),
8004
8012
  tabIndex: 0,
@@ -8006,7 +8014,7 @@ function TextInput({
8006
8014
  })]
8007
8015
  });
8008
8016
  }
8009
- const styles$r = {
8017
+ const styles$x = {
8010
8018
  main: {
8011
8019
  display: "mly78zum5",
8012
8020
  alignItems: "mly6s0dn4",
@@ -8081,6 +8089,7 @@ const styles$r = {
8081
8089
  input: {
8082
8090
  flexGrow: "mly1iyjqo2",
8083
8091
  height: "mly1qx5ct2",
8092
+ minWidth: "mlygc0pbm",
8084
8093
  padding: "mly1717udv",
8085
8094
  paddingInline: null,
8086
8095
  paddingStart: null,
@@ -8214,7 +8223,7 @@ function SelectorToken({
8214
8223
  onValueChange: handleValueChange,
8215
8224
  required: true,
8216
8225
  children: [/* @__PURE__ */ jsxs(Trigger$3, {
8217
- ..._stylex.props(tokenStyles.main, styles$q.selectTrigger, tokenColorVariants[color], tokenSizeVariants[size2], fontStyles.body, tokenStyles.label, customStyle),
8226
+ ..._stylex.props(tokenStyles.main, styles$w.selectTrigger, tokenColorVariants[color], tokenSizeVariants[size2], fontStyles.body, tokenStyles.label, customStyle),
8218
8227
  children: [icon && /* @__PURE__ */ jsx(Icon, {
8219
8228
  name: icon,
8220
8229
  customStyle: tokenStyles.icon
@@ -8243,7 +8252,7 @@ function SelectorToken({
8243
8252
  size: "compact",
8244
8253
  icon: "search",
8245
8254
  hasClear: true,
8246
- customStyle: styles$q.searchInput,
8255
+ customStyle: styles$w.searchInput,
8247
8256
  onKeyDown: (event) => {
8248
8257
  const excludedKeys = ["ArrowUp", "ArrowDown"];
8249
8258
  if (!excludedKeys.includes(event.key)) {
@@ -8276,21 +8285,21 @@ function SelectItem({
8276
8285
  ...props2
8277
8286
  }) {
8278
8287
  return /* @__PURE__ */ jsxs(Item$1, {
8279
- ..._stylex.props(fontStyles.body, styles$q.selectItem),
8288
+ ..._stylex.props(fontStyles.body, styles$w.selectItem),
8280
8289
  value,
8281
8290
  ...props2,
8282
8291
  children: [value === selectedValue ? /* @__PURE__ */ jsx(Icon, {
8283
8292
  name: "radioChecked",
8284
- customStyle: styles$q.radioChecked
8293
+ customStyle: styles$w.radioChecked
8285
8294
  }) : /* @__PURE__ */ jsx(Icon, {
8286
8295
  name: "radioUnchecked",
8287
- customStyle: styles$q.radioUnchecked
8296
+ customStyle: styles$w.radioUnchecked
8288
8297
  }), /* @__PURE__ */ jsx(ItemText, {
8289
8298
  children
8290
8299
  })]
8291
8300
  });
8292
8301
  }
8293
- const styles$q = {
8302
+ const styles$w = {
8294
8303
  selectTrigger: {
8295
8304
  whiteSpace: "mlyuxw1ft",
8296
8305
  overflow: "mlyb3r6kr",
@@ -8380,7 +8389,7 @@ function Card({
8380
8389
  customStyle
8381
8390
  }) {
8382
8391
  return /* @__PURE__ */ jsxs("div", {
8383
- ..._stylex.props(styles$p.container, customStyle),
8392
+ ..._stylex.props(styles$v.container, customStyle),
8384
8393
  children: [/* @__PURE__ */ jsx("div", {
8385
8394
  ...{
8386
8395
  className: "mly1717udv"
@@ -8394,7 +8403,7 @@ function Card({
8394
8403
  })]
8395
8404
  });
8396
8405
  }
8397
- const styles$p = {
8406
+ const styles$v = {
8398
8407
  container: {
8399
8408
  display: "mly78zum5",
8400
8409
  flexDirection: "mlydt5ytf",
@@ -8485,10 +8494,10 @@ function CollapsibleListItem({
8485
8494
  className: "mly78zum5 mlydt5ytf mly1iyjqo2 mlyb3r6kr"
8486
8495
  },
8487
8496
  children: [/* @__PURE__ */ jsx("span", {
8488
- ..._stylex.props(fontStyles.body, styles$o.label),
8497
+ ..._stylex.props(fontStyles.body, styles$u.label),
8489
8498
  children: label
8490
8499
  }), sublabel && /* @__PURE__ */ jsx("span", {
8491
- ..._stylex.props(fontStyles.supporting, styles$o.sublabel),
8500
+ ..._stylex.props(fontStyles.supporting, styles$u.sublabel),
8492
8501
  children: sublabel
8493
8502
  })]
8494
8503
  })]
@@ -8500,7 +8509,7 @@ function CollapsibleListItem({
8500
8509
  })]
8501
8510
  });
8502
8511
  }
8503
- const styles$o = {
8512
+ const styles$u = {
8504
8513
  label: {
8505
8514
  flexGrow: "mly1iyjqo2",
8506
8515
  fontWeight: "mly1xlr1w8",
@@ -19310,7 +19319,7 @@ function Spinner({
19310
19319
  } = SIZES[size2];
19311
19320
  const frameSize = diameter + border * 2;
19312
19321
  return /* @__PURE__ */ jsx("div", {
19313
- ..._stylex.props(styles$n.root, customStyle),
19322
+ ..._stylex.props(styles$t.root, customStyle),
19314
19323
  children: /* @__PURE__ */ jsx("span", {
19315
19324
  "aria-valuetext": "Loading",
19316
19325
  ...{
@@ -19330,7 +19339,7 @@ function Spinner({
19330
19339
  })
19331
19340
  });
19332
19341
  }
19333
- const styles$n = {
19342
+ const styles$t = {
19334
19343
  root: {
19335
19344
  alignItems: "mly6s0dn4",
19336
19345
  display: "mly3nfvp2",
@@ -22015,20 +22024,20 @@ function getCalendarFormat(myMoment, now2) {
22015
22024
  var diff2 = myMoment.diff(now2, "days", true);
22016
22025
  return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
22017
22026
  }
22018
- function calendar$1(time, formats) {
22027
+ function calendar$1(time, formats2) {
22019
22028
  if (arguments.length === 1) {
22020
22029
  if (!arguments[0]) {
22021
22030
  time = void 0;
22022
- formats = void 0;
22031
+ formats2 = void 0;
22023
22032
  } else if (isMomentInput(arguments[0])) {
22024
22033
  time = arguments[0];
22025
- formats = void 0;
22034
+ formats2 = void 0;
22026
22035
  } else if (isCalendarSpec(arguments[0])) {
22027
- formats = arguments[0];
22036
+ formats2 = arguments[0];
22028
22037
  time = void 0;
22029
22038
  }
22030
22039
  }
22031
- var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats && (isFunction(formats[format2]) ? formats[format2].call(this, now2) : formats[format2]);
22040
+ var now2 = time || createLocal(), sod = cloneWithOffset(now2, this).startOf("day"), format2 = hooks.calendarFormat(this, sod) || "sameElse", output = formats2 && (isFunction(formats2[format2]) ? formats2[format2].call(this, now2) : formats2[format2]);
22032
22041
  return this.format(
22033
22042
  output || this.localeData().calendar(format2, this, createLocal(now2))
22034
22043
  );
@@ -22384,7 +22393,7 @@ function valueOf() {
22384
22393
  function unix() {
22385
22394
  return Math.floor(this.valueOf() / 1e3);
22386
22395
  }
22387
- function toDate$1() {
22396
+ function toDate() {
22388
22397
  return new Date(this.valueOf());
22389
22398
  }
22390
22399
  function toArray() {
@@ -22838,7 +22847,7 @@ proto.startOf = startOf;
22838
22847
  proto.subtract = subtract;
22839
22848
  proto.toArray = toArray;
22840
22849
  proto.toObject = toObject;
22841
- proto.toDate = toDate$1;
22850
+ proto.toDate = toDate;
22842
22851
  proto.toISOString = toISOString;
22843
22852
  proto.inspect = inspect;
22844
22853
  if (typeof Symbol !== "undefined" && Symbol.for != null) {
@@ -23729,7 +23738,7 @@ const Popover = ({
23729
23738
  })
23730
23739
  });
23731
23740
  };
23732
- const styles$m = {
23741
+ const styles$s = {
23733
23742
  wrapper: {
23734
23743
  position: "mly1n2onr6",
23735
23744
  $$css: true
@@ -23780,7 +23789,7 @@ const SelectDropdown = ({
23780
23789
  setOpen(false);
23781
23790
  };
23782
23791
  return /* @__PURE__ */ jsxs("div", {
23783
- ..._stylex.props(styles$m.wrapper, customStyle),
23792
+ ..._stylex.props(styles$s.wrapper, customStyle),
23784
23793
  children: [/* @__PURE__ */ jsxs("button", {
23785
23794
  type: "button",
23786
23795
  autoFocus,
@@ -23847,7 +23856,7 @@ function SelectList({
23847
23856
  }) {
23848
23857
  const [hoveredIndex, setHoveredIndex] = useState(null);
23849
23858
  return /* @__PURE__ */ jsx("div", {
23850
- ..._stylex.props(styles$m.selectListDiv, customStyle),
23859
+ ..._stylex.props(styles$s.selectListDiv, customStyle),
23851
23860
  children: options.reduce((result, option2, index2) => {
23852
23861
  const isSelected = value !== void 0 && valueEqual(value, option2.value);
23853
23862
  if (option2.divider) {
@@ -23879,8 +23888,8 @@ function SelectList({
23879
23888
  }), /* @__PURE__ */ jsx(Icon, {
23880
23889
  name: "checkmark",
23881
23890
  customStyle: {
23882
- ...styles$m.checkIcon,
23883
- ...isSelected ? styles$m.checkIconSelected : void 0
23891
+ ...styles$s.checkIcon,
23892
+ ...isSelected ? styles$s.checkIconSelected : void 0
23884
23893
  }
23885
23894
  }), /* @__PURE__ */ jsx("span", {
23886
23895
  ...{
@@ -23893,31 +23902,20 @@ function SelectList({
23893
23902
  }, [])
23894
23903
  });
23895
23904
  }
23896
- function granularityIndex(granularity) {
23897
- return ["year", "quarter", "month", "week", "day", "hour", "minute", "second"].indexOf(granularity);
23898
- }
23899
23905
  function monthName(month) {
23900
23906
  return ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][month];
23901
23907
  }
23902
23908
  function DatePicker({
23903
23909
  value,
23904
23910
  setValue,
23911
+ units,
23905
23912
  maxLevel,
23906
- style
23913
+ customStyle
23907
23914
  }) {
23908
23915
  const [date, setDate] = useState(value);
23909
23916
  const calendar2 = getCalendar(date);
23910
- const [pickLevel, setPickLevel] = useState(maxLevel);
23917
+ const [pickLevel, setPickLevel] = useState(units);
23911
23918
  const yearBucket = Math.floor(hooks(date).year() / 10) * 10;
23912
- useEffect(() => {
23913
- if (granularityIndex(maxLevel) < granularityIndex(pickLevel)) {
23914
- setPickLevel(maxLevel);
23915
- } else if (pickLevel === "quarter" && maxLevel !== "quarter") {
23916
- setPickLevel(maxLevel);
23917
- } else if (pickLevel === "week" && maxLevel !== "week") {
23918
- setPickLevel(maxLevel);
23919
- }
23920
- }, [maxLevel, pickLevel]);
23921
23919
  useEffect(() => {
23922
23920
  setDate(value);
23923
23921
  }, [value]);
@@ -23925,13 +23923,6 @@ function DatePicker({
23925
23923
  const newDate = hooks(date).year(year).toDate();
23926
23924
  setDate(newDate);
23927
23925
  setValue(newDate);
23928
- if (maxLevel !== "year") {
23929
- if (maxLevel === "quarter") {
23930
- setPickLevel("quarter");
23931
- } else {
23932
- setPickLevel("month");
23933
- }
23934
- }
23935
23926
  };
23936
23927
  const yearButton = (offset2) => {
23937
23928
  const click = () => setYear(yearBucket + offset2);
@@ -23961,27 +23952,14 @@ function DatePicker({
23961
23952
  const newDate = hooks(date).month(month).toDate();
23962
23953
  setDate(newDate);
23963
23954
  setValue(newDate);
23964
- if (maxLevel !== "month") {
23965
- if (maxLevel === "week") {
23966
- setPickLevel("week");
23967
- } else {
23968
- setPickLevel("day");
23969
- }
23970
- }
23971
23955
  };
23972
23956
  const setDay = (day) => {
23973
23957
  setDate(day);
23974
23958
  setValue(day);
23975
- if (maxLevel !== "day") {
23976
- setPickLevel(maxLevel);
23977
- }
23978
23959
  };
23979
23960
  const setWeekByDay = (dateOfFirstDayOfWeek) => {
23980
23961
  setDate(dateOfFirstDayOfWeek);
23981
23962
  setValue(dateOfFirstDayOfWeek);
23982
- if (maxLevel !== "week") {
23983
- setPickLevel("day");
23984
- }
23985
23963
  };
23986
23964
  const setQuarter = (quarter) => {
23987
23965
  const newDate = hooks(date).quarter(quarter + 1).toDate();
@@ -24021,7 +23999,7 @@ function DatePicker({
24021
23999
  });
24022
24000
  };
24023
24001
  return /* @__PURE__ */ jsxs("div", {
24024
- ..._stylex.props(styles$l.outer, style),
24002
+ ..._stylex.props(styles$r.outer, customStyle),
24025
24003
  children: [/* @__PURE__ */ jsxs("div", {
24026
24004
  ...{
24027
24005
  className: "mly78zum5 mly1q0g3np mly1qughib mly1nejdyq mlyu06os2"
@@ -24057,6 +24035,8 @@ function DatePicker({
24057
24035
  setPickLevel("year");
24058
24036
  } else if (pickLevel === "hour" || pickLevel === "minute" || pickLevel === "second") {
24059
24037
  setPickLevel("day");
24038
+ } else {
24039
+ setPickLevel(maxLevel);
24060
24040
  }
24061
24041
  },
24062
24042
  children: [(pickLevel === "day" || pickLevel === "week") && hooks(date).format("MMMM YYYY"), (pickLevel === "month" || pickLevel === "quarter") && hooks(date).format("YYYY"), pickLevel === "year" && /* @__PURE__ */ jsxs(Fragment, {
@@ -24294,14 +24274,14 @@ function DatePicker({
24294
24274
  setValue(hooks(date).hour(newHour24).toDate());
24295
24275
  },
24296
24276
  width: "40px"
24297
- }), (maxLevel === "minute" || maxLevel === "second") && /* @__PURE__ */ jsx(NumberInput, {
24277
+ }), (units === "minute" || units === "second") && /* @__PURE__ */ jsx(NumberInput, {
24298
24278
  label: "Minutes",
24299
24279
  value: hooks(date).minutes(),
24300
24280
  setValue: (minute) => {
24301
24281
  setValue(hooks(date).minute(minute).toDate());
24302
24282
  },
24303
24283
  width: "40px"
24304
- }), maxLevel === "second" && /* @__PURE__ */ jsx(NumberInput, {
24284
+ }), units === "second" && /* @__PURE__ */ jsx(NumberInput, {
24305
24285
  label: "Seconds",
24306
24286
  value: hooks(date).seconds(),
24307
24287
  setValue: (second) => {
@@ -24334,7 +24314,7 @@ function DatePicker({
24334
24314
  })]
24335
24315
  });
24336
24316
  }
24337
- const styles$l = {
24317
+ const styles$r = {
24338
24318
  outer: {
24339
24319
  userSelect: "mly87ps6o",
24340
24320
  fontSize: "mlymhiqyu",
@@ -24420,7 +24400,7 @@ function Banner({
24420
24400
  className: "mly1q4ynmn mlyh8yej3 mly5yr21d mly78zum5 mlydt5ytf mly1kmqopl mly16zck5j"
24421
24401
  },
24422
24402
  children: [/* @__PURE__ */ jsxs("div", {
24423
- ..._stylex.props(styles$k.header, variantColors[variant], children ? styles$k.headerWithContent : null),
24403
+ ..._stylex.props(styles$q.header, variantColors[variant], children ? styles$q.headerWithContent : null),
24424
24404
  children: [/* @__PURE__ */ jsx("div", {
24425
24405
  ...{
24426
24406
  className: "mly1qx5ct2 mly78zum5 mlyl56j7k mly6s0dn4"
@@ -24433,22 +24413,22 @@ function Banner({
24433
24413
  className: "mly78zum5 mlydt5ytf mlyb3r6kr"
24434
24414
  },
24435
24415
  children: [/* @__PURE__ */ jsx("div", {
24436
- ..._stylex.props(styles$k.title, fontStyles.emphasized),
24416
+ ..._stylex.props(styles$q.title, fontStyles.emphasized),
24437
24417
  children: title
24438
24418
  }), /* @__PURE__ */ jsx("div", {
24439
- ..._stylex.props(styles$k.description, fontStyles.supporting),
24419
+ ..._stylex.props(styles$q.description, fontStyles.supporting),
24440
24420
  children: description
24441
24421
  })]
24442
24422
  })]
24443
24423
  }), children && /* @__PURE__ */ jsx("div", {
24444
- ..._stylex.props(styles$k.content, fontStyles.body),
24424
+ ..._stylex.props(styles$q.content, fontStyles.body),
24445
24425
  children: /* @__PURE__ */ jsx(ScrollableArea, {
24446
24426
  children
24447
24427
  })
24448
24428
  })]
24449
24429
  });
24450
24430
  }
24451
- const styles$k = {
24431
+ const styles$q = {
24452
24432
  header: {
24453
24433
  borderRadius: "mly1q4ynmn",
24454
24434
  borderStartStartRadius: null,
@@ -25883,7 +25863,7 @@ function DropdownMenu({
25883
25863
  children: trigger
25884
25864
  }), /* @__PURE__ */ jsx(Portal2, {
25885
25865
  children: /* @__PURE__ */ jsx(Content2, {
25886
- ..._stylex.props(fontStyles.body, styles$j.content),
25866
+ ..._stylex.props(fontStyles.body, styles$p.content),
25887
25867
  side: "bottom",
25888
25868
  align: "start",
25889
25869
  sideOffset: 4,
@@ -25910,16 +25890,16 @@ function DropdownMenuItem({
25910
25890
  disabled,
25911
25891
  children: [icon && /* @__PURE__ */ jsx(Icon, {
25912
25892
  name: icon,
25913
- customStyle: styles$j.icon
25893
+ customStyle: styles$p.icon
25914
25894
  }), /* @__PURE__ */ jsxs("div", {
25915
25895
  ...{
25916
25896
  className: "mly78zum5 mlydt5ytf mly1iyjqo2"
25917
25897
  },
25918
25898
  children: [/* @__PURE__ */ jsx("span", {
25919
- ..._stylex.props(fontStyles.body, styles$j.label),
25899
+ ..._stylex.props(fontStyles.body, styles$p.label),
25920
25900
  children: label
25921
25901
  }), sublabel && /* @__PURE__ */ jsx("span", {
25922
- ..._stylex.props(fontStyles.supporting, styles$j.sublabel),
25902
+ ..._stylex.props(fontStyles.supporting, styles$p.sublabel),
25923
25903
  children: sublabel
25924
25904
  })]
25925
25905
  })]
@@ -25940,21 +25920,21 @@ function DropdownSubMenuItem({
25940
25920
  disabled,
25941
25921
  children: [icon && /* @__PURE__ */ jsx(Icon, {
25942
25922
  name: icon,
25943
- customStyle: styles$j.icon
25923
+ customStyle: styles$p.icon
25944
25924
  }), /* @__PURE__ */ jsxs("div", {
25945
25925
  ...{
25946
25926
  className: "mly78zum5 mlydt5ytf mly1iyjqo2"
25947
25927
  },
25948
25928
  children: [/* @__PURE__ */ jsx("span", {
25949
- ..._stylex.props(fontStyles.body, styles$j.label),
25929
+ ..._stylex.props(fontStyles.body, styles$p.label),
25950
25930
  children: label
25951
25931
  }), sublabel && /* @__PURE__ */ jsx("span", {
25952
- ..._stylex.props(fontStyles.supporting, styles$j.sublabel),
25932
+ ..._stylex.props(fontStyles.supporting, styles$p.sublabel),
25953
25933
  children: sublabel
25954
25934
  })]
25955
25935
  }), /* @__PURE__ */ jsx(Icon, {
25956
25936
  name: "chevronRight",
25957
- customStyle: styles$j.icon
25937
+ customStyle: styles$p.icon
25958
25938
  })]
25959
25939
  }), /* @__PURE__ */ jsx(SubContent2, {
25960
25940
  ...{
@@ -25969,11 +25949,11 @@ function DropdownMenuLabel({
25969
25949
  label
25970
25950
  }) {
25971
25951
  return /* @__PURE__ */ jsx(Label2, {
25972
- ..._stylex.props(fontStyles.supporting, styles$j.menuLabel),
25952
+ ..._stylex.props(fontStyles.supporting, styles$p.menuLabel),
25973
25953
  children: label
25974
25954
  });
25975
25955
  }
25976
- const styles$j = {
25956
+ const styles$p = {
25977
25957
  content: {
25978
25958
  display: "mly78zum5",
25979
25959
  flexDirection: "mlydt5ytf",
@@ -26062,6 +26042,7 @@ const filterStyles = {
26062
26042
  paddingTop: null,
26063
26043
  paddingBottom: null,
26064
26044
  minWidth: "mly1jzhcrs",
26045
+ maxWidth: "mly1j9u4d2",
26065
26046
  gap: "mly167g77z",
26066
26047
  rowGap: null,
26067
26048
  columnGap: null,
@@ -26081,37 +26062,83 @@ const filterStyles = {
26081
26062
  rowGap: null,
26082
26063
  columnGap: null,
26083
26064
  $$css: true
26084
- }
26085
- };
26086
- const BooleanFilterFragments = {
26087
- is_true: {
26088
- operator: "true"
26089
26065
  },
26090
- is_false: {
26091
- operator: "false"
26066
+ editor: {
26067
+ width: "mlyxsgkw5",
26068
+ display: "mly78zum5",
26069
+ flexDirection: "mlydt5ytf",
26070
+ gap: "mly167g77z",
26071
+ rowGap: null,
26072
+ columnGap: null,
26073
+ $$css: true
26092
26074
  },
26093
- is_null: {
26094
- operator: "null"
26075
+ editorRow: {
26076
+ display: "mly78zum5",
26077
+ gap: "mly167g77z",
26078
+ rowGap: null,
26079
+ columnGap: null,
26080
+ $$css: true
26095
26081
  },
26096
- is_not_null: {
26097
- operator: "null",
26098
- not: true
26082
+ editorCell: {
26083
+ flexGrow: "mly1iyjqo2",
26084
+ $$css: true
26099
26085
  },
26100
- is_false_or_null: {
26101
- operator: "false_or_null"
26086
+ input: {
26087
+ border: "mly2yh2zd",
26088
+ borderWidth: null,
26089
+ borderInlineWidth: null,
26090
+ borderInlineStartWidth: null,
26091
+ borderLeftWidth: null,
26092
+ borderInlineEndWidth: null,
26093
+ borderRightWidth: null,
26094
+ borderBlockWidth: null,
26095
+ borderTopWidth: null,
26096
+ borderBottomWidth: null,
26097
+ borderStyle: null,
26098
+ borderInlineStyle: null,
26099
+ borderInlineStartStyle: null,
26100
+ borderLeftStyle: null,
26101
+ borderInlineEndStyle: null,
26102
+ borderRightStyle: null,
26103
+ borderBlockStyle: null,
26104
+ borderTopStyle: null,
26105
+ borderBottomStyle: null,
26106
+ borderColor: null,
26107
+ borderInlineColor: null,
26108
+ borderInlineStartColor: null,
26109
+ borderLeftColor: null,
26110
+ borderInlineEndColor: null,
26111
+ borderRightColor: null,
26112
+ borderBlockColor: null,
26113
+ borderTopColor: null,
26114
+ borderBottomColor: null,
26115
+ color: "mlyizdh9v",
26116
+ padding: "mly9cpjcd",
26117
+ paddingInline: null,
26118
+ paddingStart: null,
26119
+ paddingLeft: null,
26120
+ paddingEnd: null,
26121
+ paddingRight: null,
26122
+ paddingBlock: null,
26123
+ paddingTop: null,
26124
+ paddingBottom: null,
26125
+ borderRadius: "mly1sxf85j",
26126
+ borderStartStartRadius: null,
26127
+ borderStartEndRadius: null,
26128
+ borderEndStartRadius: null,
26129
+ borderEndEndRadius: null,
26130
+ borderTopLeftRadius: null,
26131
+ borderTopRightRadius: null,
26132
+ borderBottomLeftRadius: null,
26133
+ borderBottomRightRadius: null,
26134
+ $$css: true
26102
26135
  }
26103
26136
  };
26104
26137
  function typeFromFilter$3(filter) {
26105
- for (const key2 in BooleanFilterFragments) {
26106
- const type = key2;
26107
- const value = BooleanFilterFragments[type];
26108
- const filterNot = filter.not ?? false;
26109
- const valueNot = value.not ?? false;
26110
- if (value.operator === filter.operator && valueNot === filterNot) {
26111
- return type;
26112
- }
26138
+ if (filter.operator === "null" && filter.not) {
26139
+ return "-null";
26113
26140
  }
26114
- throw new Error(`Unhandled boolean filter type ${filter.operator}`);
26141
+ return filter.operator;
26115
26142
  }
26116
26143
  function BooleanFilterCore({
26117
26144
  filter,
@@ -26119,26 +26146,33 @@ function BooleanFilterCore({
26119
26146
  }) {
26120
26147
  const type = typeFromFilter$3(filter);
26121
26148
  const onChangeType = (type2) => {
26122
- setFilter(BooleanFilterFragments[type2]);
26149
+ const filter2 = type2 === "-null" ? {
26150
+ operator: "null",
26151
+ not: true
26152
+ } : {
26153
+ operator: type2
26154
+ };
26155
+ setFilter(filter2);
26123
26156
  };
26124
- return /* @__PURE__ */ jsx(Fragment, {
26157
+ return /* @__PURE__ */ jsx("div", {
26158
+ ..._stylex.props(filterStyles.editor),
26125
26159
  children: /* @__PURE__ */ jsx(SelectDropdown, {
26126
26160
  value: type,
26127
26161
  onChange: onChangeType,
26128
26162
  options: [{
26129
- value: "is_true",
26163
+ value: "true",
26130
26164
  label: "is true"
26131
26165
  }, {
26132
- value: "is_false",
26166
+ value: "false",
26133
26167
  label: "is false"
26134
26168
  }, {
26135
- value: "is_null",
26169
+ value: "null",
26136
26170
  label: "is null"
26137
26171
  }, {
26138
- value: "is_not_null",
26172
+ value: "-null",
26139
26173
  label: "is not null"
26140
26174
  }, {
26141
- value: "is_false_or_null",
26175
+ value: "false_or_null",
26142
26176
  label: "is false or null"
26143
26177
  }],
26144
26178
  customStyle: filterStyles.filterTypeDropdown
@@ -26250,7 +26284,7 @@ const PillInput = ({
26250
26284
  }
26251
26285
  };
26252
26286
  const commitValue = () => {
26253
- if (value.length > 0) {
26287
+ if (value.length > 0 && !values.includes(value)) {
26254
26288
  setValues([...values, value]);
26255
26289
  setValue("");
26256
26290
  }
@@ -26260,7 +26294,7 @@ const PillInput = ({
26260
26294
  commitValue();
26261
26295
  });
26262
26296
  return /* @__PURE__ */ jsxs("div", {
26263
- ..._stylex.props(styles$i.outer, customStyle),
26297
+ ..._stylex.props(styles$o.outer, customStyle),
26264
26298
  onKeyUp,
26265
26299
  onClick: () => {
26266
26300
  var _a2;
@@ -26325,7 +26359,7 @@ const Pill = ({
26325
26359
  onClick,
26326
26360
  tabIndex: 0,
26327
26361
  ref: forwardRef,
26328
- ..._stylex.props(styles$i.pill, colorVariants[color]),
26362
+ ..._stylex.props(styles$o.pill, colorVariants[color]),
26329
26363
  children: [children, /* @__PURE__ */ jsx("div", {
26330
26364
  title: "Remove",
26331
26365
  ...{
@@ -26340,7 +26374,7 @@ const Pill = ({
26340
26374
  })]
26341
26375
  });
26342
26376
  };
26343
- const styles$i = {
26377
+ const styles$o = {
26344
26378
  outer: {
26345
26379
  fontFamily: "mly6icuqf",
26346
26380
  fontSize: "mlyif65rj",
@@ -26394,7 +26428,7 @@ const styles$i = {
26394
26428
  gap: "mly1ed6fcf",
26395
26429
  rowGap: null,
26396
26430
  columnGap: null,
26397
- flexWrap: "mlyozqiw3",
26431
+ flexWrap: "mly1a02dak",
26398
26432
  borderColor: "mly1akygb0 mlyetl2wx",
26399
26433
  borderInlineColor: null,
26400
26434
  borderInlineStartColor: null,
@@ -26435,6 +26469,7 @@ const styles$i = {
26435
26469
  textTransform: "mly6mezaz",
26436
26470
  cursor: "mly1ypdohk",
26437
26471
  height: "mly1qx5ct2",
26472
+ whiteSpace: "mlyuxw1ft",
26438
26473
  $$css: true
26439
26474
  }
26440
26475
  };
@@ -26592,7 +26627,8 @@ function ValueList({
26592
26627
  onClick,
26593
26628
  search,
26594
26629
  fieldPath,
26595
- ref
26630
+ ref,
26631
+ customStyle
26596
26632
  }) {
26597
26633
  const {
26598
26634
  searchResults
@@ -26600,10 +26636,11 @@ function ValueList({
26600
26636
  const stringSearchResults = useMemo(() => searchResults && searchResults.filter((r2) => r2.fieldType === "string" && r2.fieldValue !== null).sort((a, b2) => b2.weight - a.weight).slice(0, 100), [searchResults]);
26601
26637
  return /* @__PURE__ */ jsx("div", {
26602
26638
  ref,
26639
+ ..._stylex.props(customStyle),
26603
26640
  children: (stringSearchResults == null ? void 0 : stringSearchResults.length) ? stringSearchResults.map((value) => /* @__PURE__ */ jsxs("div", {
26604
26641
  role: "menuitem",
26605
26642
  tabIndex: -1,
26606
- ..._stylex.props(addMenuStyles.item, styles$h.valueItem),
26643
+ ..._stylex.props(addMenuStyles.item, styles$n.valueItem),
26607
26644
  onClick: () => onClick(value),
26608
26645
  children: [/* @__PURE__ */ jsx(Value, {
26609
26646
  value
@@ -26626,16 +26663,22 @@ function Value({
26626
26663
  return /* @__PURE__ */ jsx(Token, {
26627
26664
  label: value.fieldValue ?? "∅",
26628
26665
  icon: "filter",
26629
- color: "purple"
26666
+ color: "purple",
26667
+ customStyle: styles$n.token
26630
26668
  });
26631
26669
  }
26632
- const styles$h = {
26670
+ const styles$n = {
26633
26671
  valueItem: {
26634
26672
  height: "mly1qx5ct2",
26635
26673
  paddingTop: "mly1y1aw1k",
26636
26674
  paddingBottom: "mlywib8y2",
26637
26675
  display: "mly78zum5",
26638
26676
  justifyContent: "mly1qughib",
26677
+ cursor: "mly1ypdohk",
26678
+ $$css: true
26679
+ },
26680
+ token: {
26681
+ cursor: "mly1ypdohk",
26639
26682
  $$css: true
26640
26683
  }
26641
26684
  };
@@ -26723,7 +26766,8 @@ const StringFilterCore = ({
26723
26766
  setCurrentFilter(newFilter);
26724
26767
  setFilter(newFilter);
26725
26768
  };
26726
- return /* @__PURE__ */ jsxs(Fragment, {
26769
+ return /* @__PURE__ */ jsxs("div", {
26770
+ ..._stylex.props(filterStyles.editor),
26727
26771
  children: [/* @__PURE__ */ jsx(SelectDropdown, {
26728
26772
  value: type,
26729
26773
  onChange: changeType,
@@ -26793,7 +26837,8 @@ const StringFilterCore = ({
26793
26837
  });
26794
26838
  setSearchValue("");
26795
26839
  }
26796
- }
26840
+ },
26841
+ customStyle: styles$m.valueList
26797
26842
  })]
26798
26843
  }) : currentFilter.operator === "~" ? /* @__PURE__ */ jsx(StringEditor, {
26799
26844
  values: currentFilter.escaped_values,
@@ -26860,6 +26905,18 @@ function stringFilterChangeType(filter, type) {
26860
26905
  };
26861
26906
  }
26862
26907
  }
26908
+ const styles$m = {
26909
+ valueList: {
26910
+ maxHeight: "mly1hkcv85",
26911
+ overflow: "mlyysyzu8",
26912
+ overflowX: null,
26913
+ overflowY: null,
26914
+ $$css: true
26915
+ }
26916
+ };
26917
+ const isRangeOperator = (operator) => {
26918
+ return operator === "range";
26919
+ };
26863
26920
  const NumberFilterFragments = {
26864
26921
  is_equal_to: {
26865
26922
  operator: "="
@@ -26880,7 +26937,11 @@ const NumberFilterFragments = {
26880
26937
  is_less_than_or_equal_to: {
26881
26938
  operator: "<="
26882
26939
  },
26883
- // is_between: {operator: 'to'},
26940
+ is_between: {
26941
+ operator: "range",
26942
+ startOperator: ">=",
26943
+ endOperator: "<="
26944
+ },
26884
26945
  is_null: {
26885
26946
  operator: "null"
26886
26947
  },
@@ -26909,7 +26970,7 @@ const NumberFilterCore = ({
26909
26970
  operator: "=",
26910
26971
  values: []
26911
26972
  });
26912
- const [innerValues, setInnerValues] = useState(["0"]);
26973
+ const [innerValues, setInnerValues] = useState(isRangeOperator(filter.operator) ? ["0", "0"] : ["0"]);
26913
26974
  const [errorMessage, setErrorMessage] = useState("");
26914
26975
  const changeType = (type2) => {
26915
26976
  const maybeNumberCondition = filter;
@@ -26923,19 +26984,23 @@ const NumberFilterCore = ({
26923
26984
  const type = typeFromFilter$1(filter);
26924
26985
  useEffect(() => {
26925
26986
  setErrorMessage("");
26926
- const maybeNumberCondition = filter;
26927
- if (maybeNumberCondition.values) {
26928
- let values = maybeNumberCondition.values;
26929
- if (!values || values.length === 0) {
26930
- values = ["0"];
26931
- }
26932
- setInnerValues(values);
26987
+ if (isRangeOperator(filter.operator)) {
26988
+ const numberRange = filter;
26989
+ setInnerValues([numberRange.startValue, numberRange.endValue]);
26933
26990
  } else {
26934
- setInnerValues(["0"]);
26991
+ const maybeNumberCondition = filter;
26992
+ if (maybeNumberCondition.values) {
26993
+ let values = maybeNumberCondition.values;
26994
+ if (!values || values.length === 0) {
26995
+ values = ["0"];
26996
+ }
26997
+ setInnerValues(values);
26998
+ } else {
26999
+ setInnerValues(["0"]);
27000
+ }
26935
27001
  }
26936
27002
  }, [filter]);
26937
27003
  const validateAndUpdateValues = (values) => {
26938
- const numberCondition = filter;
26939
27004
  setInnerValues(values);
26940
27005
  const hasInvalidValues = values.some((v2) => {
26941
27006
  return isNaN(parseFloat(v2));
@@ -26946,10 +27011,22 @@ const NumberFilterCore = ({
26946
27011
  setErrorMessage("Requires at least one numeric value.");
26947
27012
  } else {
26948
27013
  setErrorMessage("");
26949
- setFilter({
26950
- ...numberCondition,
26951
- values
26952
- });
27014
+ if (filter.operator === "range") {
27015
+ const numberCondition = filter;
27016
+ setFilter({
27017
+ ...numberCondition,
27018
+ startOperator: ">=",
27019
+ startValue: values[0],
27020
+ endOperator: "<=",
27021
+ endValue: values[1]
27022
+ });
27023
+ } else {
27024
+ const numberCondition = filter;
27025
+ setFilter({
27026
+ ...numberCondition,
27027
+ values
27028
+ });
27029
+ }
26953
27030
  }
26954
27031
  };
26955
27032
  return /* @__PURE__ */ jsxs(Fragment, {
@@ -26974,6 +27051,9 @@ const NumberFilterCore = ({
26974
27051
  }, {
26975
27052
  value: "is_less_than_or_equal_to",
26976
27053
  label: "is less than or equal to"
27054
+ }, {
27055
+ value: "is_between",
27056
+ label: "between"
26977
27057
  }, {
26978
27058
  value: "is_null",
26979
27059
  label: "is null"
@@ -26983,10 +27063,10 @@ const NumberFilterCore = ({
26983
27063
  }]
26984
27064
  }), errorMessage ? /* @__PURE__ */ jsx(ErrorIcon, {
26985
27065
  errorMessage
26986
- }) : null, getEditor$1(filter, innerValues, validateAndUpdateValues)]
27066
+ }) : null, getEditor(filter, innerValues, validateAndUpdateValues)]
26987
27067
  });
26988
27068
  };
26989
- function getEditor$1(filter, innerValues, validateAndUpdateValues) {
27069
+ function getEditor(filter, innerValues, validateAndUpdateValues) {
26990
27070
  switch (filter.operator) {
26991
27071
  case "!=":
26992
27072
  case "=":
@@ -27004,6 +27084,23 @@ function getEditor$1(filter, innerValues, validateAndUpdateValues) {
27004
27084
  setValue: (value) => validateAndUpdateValues([value]),
27005
27085
  type: "number"
27006
27086
  });
27087
+ case "range":
27088
+ return /* @__PURE__ */ jsxs("div", {
27089
+ ...{
27090
+ className: "mlyrvj5dj mly15396mt mly167g77z mlypqajaz"
27091
+ },
27092
+ children: [/* @__PURE__ */ jsx(SingleNumberEditor, {
27093
+ value: innerValues[0],
27094
+ setValue: (value) => validateAndUpdateValues([value, innerValues[1]]),
27095
+ type: "number"
27096
+ }), /* @__PURE__ */ jsx("span", {
27097
+ children: "to"
27098
+ }), /* @__PURE__ */ jsx(SingleNumberEditor, {
27099
+ value: innerValues[1],
27100
+ setValue: (value) => validateAndUpdateValues([innerValues[0], value]),
27101
+ type: "number"
27102
+ })]
27103
+ });
27007
27104
  }
27008
27105
  return null;
27009
27106
  }
@@ -27054,43 +27151,110 @@ function makeFilterWithNewType(filter, type) {
27054
27151
  return {
27055
27152
  ...NumberFilterFragments[type]
27056
27153
  };
27154
+ case "is_between":
27155
+ return {
27156
+ ...NumberFilterFragments[type],
27157
+ startValue: values.length > 0 ? values[0] : "0",
27158
+ endValue: values.length > 1 ? values[1] : "0"
27159
+ };
27057
27160
  }
27058
27161
  }
27059
- function typeFromFilter(filter) {
27060
- if (filter.operator === "null") {
27061
- return filter.not ? "is_not_null" : "is_null";
27062
- } else if (filter.operator === "in") {
27063
- return "is_equal_to";
27064
- } else if (filter.operator === "before") {
27065
- return "is_before";
27066
- } else if (filter.operator === "after") {
27067
- return "is_after";
27068
- } else if (filter.operator === "to") {
27069
- return "is_between";
27162
+ const formats = {
27163
+ second: "YYYY-MM-DD HH:mm:ss",
27164
+ minute: "YYYY-MM-DD HH:mm",
27165
+ hour: "YYYY-MM-DD HH:00",
27166
+ day: "YYYY-MM-DD",
27167
+ week: "[WK]YYYY-WW",
27168
+ month: "YYYY-MM",
27169
+ quarter: "YYYY-[Q]Q",
27170
+ year: "YYYY"
27171
+ };
27172
+ const regexps = {
27173
+ second: /\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d/,
27174
+ minute: /\d\d\d\d-\d\d-\d\d \d\d:\d\d/,
27175
+ hour: /\d\d\d\d-\d\d-\d\d \d\d:00/,
27176
+ day: /\d\d\d\d-\d\d-\d\d/,
27177
+ week: /WK\d\d\d\d-\d\d-\d\d/,
27178
+ month: /\d\d\d\d-\d\d/,
27179
+ quarter: /\d\d\d\d-Q\d/,
27180
+ year: /\d\d\d\d/
27181
+ };
27182
+ const DateInput = ({
27183
+ value,
27184
+ setValue,
27185
+ placeholder,
27186
+ autoFocus,
27187
+ units,
27188
+ onFocus,
27189
+ onBlur,
27190
+ isActive,
27191
+ customStyle
27192
+ }) => {
27193
+ const format2 = formats[units];
27194
+ const [tempValue, setTempValue] = useState(hooks(value).format(format2));
27195
+ useEffect(() => {
27196
+ setTempValue(hooks(value).format(format2));
27197
+ }, [value, format2]);
27198
+ return /* @__PURE__ */ jsx("input", {
27199
+ ..._stylex.props(customStyle, isActive ? styles$l.active : null),
27200
+ type: "text",
27201
+ placeholder: placeholder || format2,
27202
+ value: tempValue,
27203
+ onFocus,
27204
+ onBlur,
27205
+ onChange: (event) => {
27206
+ const raw2 = event.target.value;
27207
+ setTempValue(raw2);
27208
+ const regex = regexps[units];
27209
+ if (raw2.match(regex)) {
27210
+ const m = hooks(raw2, format2);
27211
+ if (m.isValid()) {
27212
+ setValue(m.toDate());
27213
+ }
27214
+ }
27215
+ },
27216
+ autoFocus
27217
+ });
27218
+ };
27219
+ function guessUnits(moment2, isDateTime) {
27220
+ if (moment2.moment === "literal") {
27221
+ const {
27222
+ literal
27223
+ } = moment2;
27224
+ for (const unit in regexps) {
27225
+ const temporalUnit = unit;
27226
+ if (literal.match(regexps[temporalUnit])) {
27227
+ return temporalUnit;
27228
+ }
27229
+ }
27070
27230
  }
27071
- return "is_equal_to";
27072
- }
27073
- function createTemporalLiteral(date) {
27074
- return {
27075
- moment: "literal",
27076
- literal: hooks(date).format("YYYY-MM-DD HH:mm:ss.0")
27077
- };
27078
- }
27079
- function createNowMoment() {
27080
- return {
27081
- moment: "now"
27082
- };
27231
+ return isDateTime ? "second" : "day";
27083
27232
  }
27084
- function extractDateFromMoment(momentObj) {
27085
- if (!momentObj) {
27086
- return /* @__PURE__ */ new Date();
27233
+ const styles$l = {
27234
+ active: {
27235
+ backgroundColor: "mly1vzefiq",
27236
+ $$css: true
27087
27237
  }
27088
- if (momentObj.moment === "literal") {
27089
- return new Date(momentObj.literal);
27090
- } else if (momentObj.moment === "now") {
27091
- return /* @__PURE__ */ new Date();
27238
+ };
27239
+ function typeFromFilter(filter) {
27240
+ if (filter.operator === "null" && filter.not) {
27241
+ return "-null";
27092
27242
  }
27093
- return /* @__PURE__ */ new Date();
27243
+ return filter.operator;
27244
+ }
27245
+ function unitsFromFilter(filter, isDateTime) {
27246
+ if (filter.operator === "last" || filter.operator === "next") {
27247
+ return filter.units;
27248
+ } else if (filter.operator === "to") {
27249
+ return guessUnits(filter.fromMoment, isDateTime);
27250
+ } else if (filter.operator === "before" && filter.before.moment === "literal") {
27251
+ return guessUnits(filter.before, isDateTime);
27252
+ } else if (filter.operator === "after") {
27253
+ return guessUnits(filter.after, isDateTime);
27254
+ } else if (filter.operator === "in") {
27255
+ return guessUnits(filter.in, isDateTime);
27256
+ }
27257
+ return isDateTime ? "second" : "day";
27094
27258
  }
27095
27259
  const DateTimeFilterCore = ({
27096
27260
  filter,
@@ -27098,298 +27262,372 @@ const DateTimeFilterCore = ({
27098
27262
  isDateTime
27099
27263
  }) => {
27100
27264
  filter ?? (filter = {
27101
- operator: "in",
27102
- in: createNowMoment()
27265
+ operator: "last",
27266
+ n: "7",
27267
+ units: "day"
27103
27268
  });
27269
+ const [units, setUnits] = useState(unitsFromFilter(filter, isDateTime));
27104
27270
  const [currentFilter, setCurrentFilter] = useState(filter);
27105
27271
  const changeType = (type2) => {
27106
- updateFilter(dateTimeFilterChangeType(currentFilter, type2));
27272
+ updateFilter(dateTimeFilterChangeType(currentFilter, type2, units));
27107
27273
  };
27108
27274
  const updateFilter = (newFilter) => {
27109
27275
  setCurrentFilter(newFilter);
27110
27276
  setFilter(newFilter);
27111
27277
  };
27112
- const type = typeFromFilter(currentFilter);
27113
27278
  const maxLevel = isDateTime ? "second" : "day";
27114
- return /* @__PURE__ */ jsxs(Fragment, {
27115
- children: [/* @__PURE__ */ jsx(SelectDropdown, {
27116
- value: type,
27117
- onChange: changeType,
27118
- options: [{
27119
- value: "is_equal_to",
27120
- label: "is"
27121
- }, {
27122
- value: "is_before",
27123
- label: "is before"
27124
- }, {
27125
- value: "is_after",
27126
- label: "is after"
27127
- }, {
27128
- value: "is_between",
27129
- label: "is between"
27130
- }, {
27131
- value: "is_null",
27132
- label: "is null"
27133
- }, {
27134
- value: "is_not_null",
27135
- label: "is not null"
27136
- }]
27137
- }), getEditor(currentFilter, updateFilter, maxLevel)]
27279
+ const type = typeFromFilter(currentFilter);
27280
+ return /* @__PURE__ */ jsxs("div", {
27281
+ ..._stylex.props(filterStyles.editor),
27282
+ children: [/* @__PURE__ */ jsxs("div", {
27283
+ ..._stylex.props(filterStyles.editorRow),
27284
+ children: [/* @__PURE__ */ jsx(SelectDropdown, {
27285
+ value: type,
27286
+ onChange: changeType,
27287
+ options: [{
27288
+ value: "last",
27289
+ label: "last"
27290
+ }, {
27291
+ value: "next",
27292
+ label: "next"
27293
+ }, {
27294
+ value: "after",
27295
+ label: "after"
27296
+ }, {
27297
+ value: "before",
27298
+ label: "before"
27299
+ }, {
27300
+ value: "in",
27301
+ label: "is"
27302
+ }, {
27303
+ value: "to",
27304
+ label: "between"
27305
+ }, {
27306
+ value: "null",
27307
+ label: "null"
27308
+ }, {
27309
+ value: "-null",
27310
+ label: "not null"
27311
+ }],
27312
+ customStyle: filterStyles.editorCell
27313
+ }), getTopEditorRow(currentFilter, updateFilter, units, setUnits, maxLevel)]
27314
+ }), getBottomEditorRow(currentFilter, updateFilter, units, setUnits, maxLevel)]
27138
27315
  });
27139
27316
  };
27140
- let inDate;
27141
- let beforeDate;
27142
- let afterDate;
27143
- let fromDate;
27144
- let toDate;
27145
- function getEditor(currentFilter, updateFilter, maxLevel) {
27317
+ function getTopEditorRow(currentFilter, updateFilter, units, setUnits, maxLevel) {
27146
27318
  switch (currentFilter.operator) {
27147
- case "in": {
27148
- const inMoment = currentFilter;
27149
- inDate = extractDateFromMoment(inMoment.in);
27150
- return /* @__PURE__ */ jsx(DateTimeEditor, {
27151
- value: inDate,
27152
- setValue: (newDate) => {
27153
- updateFilter({
27154
- ...currentFilter,
27155
- in: createTemporalLiteral(newDate)
27156
- });
27157
- },
27158
- maxLevel
27319
+ case "last":
27320
+ case "next":
27321
+ return /* @__PURE__ */ jsx(NUnitFilter, {
27322
+ currentFilter,
27323
+ maxLevel,
27324
+ updateFilter,
27325
+ units,
27326
+ setUnits
27159
27327
  });
27160
- }
27161
- case "before": {
27162
- const beforeMoment = currentFilter;
27163
- beforeDate = extractDateFromMoment(beforeMoment.before);
27164
- return /* @__PURE__ */ jsx(DateTimeEditor, {
27165
- value: beforeDate,
27166
- setValue: (newDate) => {
27167
- updateFilter({
27168
- ...currentFilter,
27169
- before: createTemporalLiteral(newDate)
27170
- });
27171
- },
27172
- maxLevel
27328
+ case "after":
27329
+ case "before":
27330
+ case "to":
27331
+ case "in":
27332
+ return /* @__PURE__ */ jsx(UnitFilter, {
27333
+ currentFilter,
27334
+ maxLevel,
27335
+ updateFilter,
27336
+ units,
27337
+ setUnits
27173
27338
  });
27174
- }
27175
- case "after": {
27176
- const afterMoment = currentFilter;
27177
- afterDate = extractDateFromMoment(afterMoment.after);
27178
- return /* @__PURE__ */ jsx(DateTimeEditor, {
27179
- value: afterDate,
27180
- setValue: (newDate) => {
27181
- updateFilter({
27182
- ...currentFilter,
27183
- after: createTemporalLiteral(newDate)
27184
- });
27185
- },
27186
- maxLevel
27339
+ }
27340
+ return null;
27341
+ }
27342
+ function getBottomEditorRow(currentFilter, updateFilter, units, setUnits, maxLevel) {
27343
+ switch (currentFilter.operator) {
27344
+ case "after":
27345
+ case "before":
27346
+ case "in":
27347
+ return /* @__PURE__ */ jsx(SingleDateFilter, {
27348
+ currentFilter,
27349
+ maxLevel,
27350
+ updateFilter,
27351
+ units,
27352
+ setUnits
27187
27353
  });
27188
- }
27189
- case "to": {
27190
- const toMoment = currentFilter;
27191
- fromDate = extractDateFromMoment(toMoment.fromMoment);
27192
- toDate = extractDateFromMoment(toMoment.toMoment);
27193
- return /* @__PURE__ */ jsx(DateTimeRangeEditor, {
27194
- fromValue: fromDate,
27195
- toValue: toDate,
27196
- setFromValue: (newFromDate) => {
27197
- updateFilter({
27198
- ...currentFilter,
27199
- fromMoment: createTemporalLiteral(newFromDate)
27200
- });
27201
- },
27202
- setToValue: (newToDate) => {
27203
- updateFilter({
27204
- ...currentFilter,
27205
- toMoment: createTemporalLiteral(newToDate)
27206
- });
27207
- },
27208
- maxLevel
27354
+ case "to":
27355
+ return /* @__PURE__ */ jsx(DoubleDateFilter, {
27356
+ currentFilter,
27357
+ maxLevel,
27358
+ updateFilter,
27359
+ units,
27360
+ setUnits
27209
27361
  });
27210
- }
27211
27362
  }
27212
27363
  return null;
27213
27364
  }
27214
- const formatDate = (date, maxLevel) => {
27215
- if (maxLevel === "day") {
27216
- return hooks(date).format("YYYY-MM-DD");
27217
- } else {
27218
- return hooks(date).format("YYYY-MM-DD hh:mm:ss");
27219
- }
27220
- };
27221
- function ClickableDateToken({
27222
- value,
27223
- setValue,
27224
- maxLevel,
27225
- label
27365
+ const DateUnits = [{
27366
+ value: "year",
27367
+ label: "years"
27368
+ }, {
27369
+ value: "quarter",
27370
+ label: "quarters"
27371
+ }, {
27372
+ value: "month",
27373
+ label: "months"
27374
+ }, {
27375
+ value: "week",
27376
+ label: "weeks"
27377
+ }, {
27378
+ value: "day",
27379
+ label: "days"
27380
+ }];
27381
+ const TimeUnits = [{
27382
+ value: "hour",
27383
+ label: "hours"
27384
+ }, {
27385
+ value: "minute",
27386
+ label: "minutes"
27387
+ }, {
27388
+ value: "second",
27389
+ label: "seconds"
27390
+ }];
27391
+ function NUnitFilter({
27392
+ currentFilter,
27393
+ updateFilter,
27394
+ setUnits,
27395
+ maxLevel
27226
27396
  }) {
27227
- const [innerValue, setInnerValue] = useState(formatDate(value, maxLevel));
27228
- const [errorMessage, setErrorMessage] = useState("");
27229
- React.useEffect(() => {
27230
- setInnerValue(formatDate(value, maxLevel));
27231
- }, [maxLevel, value]);
27232
- const [isPickerOpen, setIsPickerOpen] = useState(false);
27233
- const ref = React.useRef(null);
27234
- const checkForErrorsOrCommit = (date) => {
27235
- if (date && !isNaN(date.getTime()) && date.getFullYear() < 1e4) {
27236
- setErrorMessage("");
27237
- setValue(date);
27397
+ const {
27398
+ n,
27399
+ units
27400
+ } = currentFilter;
27401
+ const options = maxLevel === "day" ? DateUnits : [...DateUnits, ...TimeUnits];
27402
+ const updateN = (event) => {
27403
+ const n2 = event.target.value;
27404
+ updateFilter({
27405
+ ...currentFilter,
27406
+ n: n2
27407
+ });
27408
+ };
27409
+ const updateUnits = (units2) => {
27410
+ setUnits(units2);
27411
+ updateFilter({
27412
+ ...currentFilter,
27413
+ units: units2
27414
+ });
27415
+ };
27416
+ return /* @__PURE__ */ jsxs(Fragment, {
27417
+ children: [/* @__PURE__ */ jsx("input", {
27418
+ type: "number",
27419
+ value: n,
27420
+ ..._stylex.props(filterStyles.input, filterStyles.editorCell),
27421
+ onChange: updateN
27422
+ }), /* @__PURE__ */ jsx(SelectDropdown, {
27423
+ options,
27424
+ value: units,
27425
+ onChange: updateUnits,
27426
+ customStyle: filterStyles.editorCell
27427
+ })]
27428
+ });
27429
+ }
27430
+ function UnitFilter({
27431
+ units,
27432
+ setUnits,
27433
+ maxLevel
27434
+ }) {
27435
+ const options = maxLevel === "day" ? DateUnits : [...DateUnits, ...TimeUnits];
27436
+ return /* @__PURE__ */ jsx(SelectDropdown, {
27437
+ options,
27438
+ value: units,
27439
+ onChange: setUnits,
27440
+ customStyle: filterStyles.editorCell
27441
+ });
27442
+ }
27443
+ function SingleDateFilter({
27444
+ currentFilter,
27445
+ updateFilter,
27446
+ units,
27447
+ maxLevel
27448
+ }) {
27449
+ const moment2 = currentFilter.operator === "after" ? currentFilter.after : currentFilter.operator === "before" ? currentFilter.before : currentFilter.in;
27450
+ const date = extractDateFromMoment(moment2);
27451
+ const updateDate = (date2) => {
27452
+ updateFilter({
27453
+ ...currentFilter,
27454
+ [currentFilter.operator]: createTemporalLiteral(date2, units)
27455
+ });
27456
+ };
27457
+ return /* @__PURE__ */ jsxs(Fragment, {
27458
+ children: [/* @__PURE__ */ jsx("div", {
27459
+ ..._stylex.props(filterStyles.editorRow),
27460
+ children: /* @__PURE__ */ jsx(DateInput, {
27461
+ value: date,
27462
+ setValue: updateDate,
27463
+ units,
27464
+ customStyle: {
27465
+ ...filterStyles.input,
27466
+ ...filterStyles.editorCell
27467
+ }
27468
+ })
27469
+ }), /* @__PURE__ */ jsx("div", {
27470
+ ..._stylex.props(filterStyles.editorRow),
27471
+ children: /* @__PURE__ */ jsx(DatePicker, {
27472
+ value: date,
27473
+ setValue: updateDate,
27474
+ units,
27475
+ maxLevel,
27476
+ customStyle: filterStyles.editorCell
27477
+ })
27478
+ })]
27479
+ });
27480
+ }
27481
+ function DoubleDateFilter({
27482
+ currentFilter,
27483
+ updateFilter,
27484
+ units,
27485
+ maxLevel
27486
+ }) {
27487
+ const {
27488
+ fromMoment,
27489
+ toMoment
27490
+ } = currentFilter;
27491
+ const fromDate = extractDateFromMoment(fromMoment);
27492
+ const toDate2 = extractDateFromMoment(toMoment);
27493
+ const [date, setDate] = useState(fromDate);
27494
+ const [focusedDate, setFocusedDate] = useState("from");
27495
+ const updateFromDate = (date2) => {
27496
+ updateFilter({
27497
+ ...currentFilter,
27498
+ fromMoment: createTemporalLiteral(date2, units)
27499
+ });
27500
+ };
27501
+ const updateToDate = (date2) => {
27502
+ updateFilter({
27503
+ ...currentFilter,
27504
+ toMoment: createTemporalLiteral(date2, units)
27505
+ });
27506
+ };
27507
+ const updateDate = (date2) => {
27508
+ if (focusedDate === "from") {
27509
+ updateFromDate(date2);
27238
27510
  } else {
27239
- setErrorMessage(`Date must be in YYYY-MM-DD${maxLevel !== "day" && " hh:mm:ss"} format.`);
27511
+ updateToDate(date2);
27240
27512
  }
27513
+ setDate(date2);
27241
27514
  };
27242
- useClickOutside(ref, () => {
27243
- if (isPickerOpen) {
27244
- setIsPickerOpen(false);
27245
- checkForErrorsOrCommit(new Date(innerValue));
27246
- }
27247
- });
27248
- const getDateForDatePicker = () => {
27249
- try {
27250
- const parsedDate = new Date(innerValue);
27251
- if (!isNaN(parsedDate.getTime())) {
27252
- return parsedDate;
27253
- }
27254
- } catch (ex) {
27515
+ const updateFocusedDate = (focusedDate2) => {
27516
+ setFocusedDate(focusedDate2);
27517
+ if (focusedDate2 === "from") {
27518
+ const fromDate2 = extractDateFromMoment(fromMoment);
27519
+ setDate(fromDate2);
27520
+ } else {
27521
+ const toDate22 = extractDateFromMoment(toMoment);
27522
+ setDate(toDate22);
27255
27523
  }
27256
- return value;
27257
27524
  };
27258
- return /* @__PURE__ */ jsxs("div", {
27259
- ref,
27260
- style: {
27261
- position: "relative",
27262
- color: "rgb(95, 99, 104)"
27263
- },
27264
- onFocus: () => setIsPickerOpen(true),
27265
- onBlur: (e) => {
27266
- if (e.relatedTarget && ref.current && !ref.current.contains(e.relatedTarget)) {
27267
- setIsPickerOpen(false);
27268
- checkForErrorsOrCommit(new Date(innerValue));
27269
- }
27270
- },
27525
+ return /* @__PURE__ */ jsxs(Fragment, {
27271
27526
  children: [/* @__PURE__ */ jsxs("div", {
27272
- style: {
27273
- display: "flex"
27274
- },
27275
- children: [/* @__PURE__ */ jsx("input", {
27276
- value: label ? `${label}: ${innerValue}` : innerValue,
27277
- onChange: (event) => {
27278
- setInnerValue(event.target.value);
27527
+ ..._stylex.props(filterStyles.editorRow),
27528
+ children: [/* @__PURE__ */ jsx(DateInput, {
27529
+ value: fromDate,
27530
+ setValue: updateFromDate,
27531
+ units,
27532
+ customStyle: {
27533
+ ...filterStyles.input,
27534
+ ...filterStyles.editorCell
27279
27535
  },
27280
- style: {
27281
- border: "1px solid #e0e0e0",
27282
- color: "rgb(95, 99, 104)",
27283
- padding: "4px 8px 4px 8px",
27284
- borderRadius: 5
27285
- }
27286
- }), errorMessage && /* @__PURE__ */ jsx(ErrorIcon, {
27287
- errorMessage
27536
+ onFocus: () => updateFocusedDate("from"),
27537
+ isActive: focusedDate === "from"
27538
+ }), /* @__PURE__ */ jsx(DateInput, {
27539
+ value: toDate2,
27540
+ setValue: updateToDate,
27541
+ units,
27542
+ customStyle: {
27543
+ ...filterStyles.input,
27544
+ ...filterStyles.editorCell
27545
+ },
27546
+ onFocus: () => updateFocusedDate("to"),
27547
+ isActive: focusedDate === "to"
27288
27548
  })]
27289
- }), isPickerOpen && /* @__PURE__ */ jsx("div", {
27290
- style: {
27291
- position: "absolute",
27292
- top: "100%",
27293
- left: 0,
27294
- zIndex: 1e3,
27295
- marginTop: "5px",
27296
- padding: "10px",
27297
- backgroundColor: "white",
27298
- borderRadius: "5px",
27299
- boxShadow: "0 2px 10px rgba(0, 0, 0, 0.1)",
27300
- border: "1px solid #e0e0e0"
27301
- },
27549
+ }), /* @__PURE__ */ jsx("div", {
27550
+ ..._stylex.props(filterStyles.editorRow),
27302
27551
  children: /* @__PURE__ */ jsx(DatePicker, {
27303
- value: getDateForDatePicker(),
27304
- setValue: (newValue) => {
27305
- checkForErrorsOrCommit(newValue);
27306
- },
27307
- maxLevel
27552
+ value: date,
27553
+ setValue: updateDate,
27554
+ units,
27555
+ maxLevel,
27556
+ customStyle: filterStyles.editorCell
27308
27557
  })
27309
27558
  })]
27310
27559
  });
27311
27560
  }
27312
- function DateTimeEditor({
27313
- value,
27314
- setValue,
27315
- maxLevel
27316
- }) {
27317
- return /* @__PURE__ */ jsx(ClickableDateToken, {
27318
- value,
27319
- setValue,
27320
- maxLevel
27321
- });
27561
+ function createTemporalLiteral(date, units) {
27562
+ return {
27563
+ moment: "literal",
27564
+ literal: hooks(date).format(formats[units])
27565
+ };
27322
27566
  }
27323
- function DateTimeRangeEditor({
27324
- fromValue,
27325
- toValue,
27326
- setFromValue,
27327
- setToValue,
27328
- maxLevel
27329
- }) {
27330
- return /* @__PURE__ */ jsxs("div", {
27331
- style: {
27332
- display: "flex",
27333
- gap: "10px"
27334
- },
27335
- children: [/* @__PURE__ */ jsx(ClickableDateToken, {
27336
- value: fromValue,
27337
- setValue: setFromValue,
27338
- maxLevel
27339
- }), /* @__PURE__ */ jsx(ClickableDateToken, {
27340
- value: toValue,
27341
- setValue: setToValue,
27342
- maxLevel
27343
- })]
27344
- });
27567
+ function extractDateFromMoment(momentObj) {
27568
+ if (momentObj && momentObj.moment === "literal") {
27569
+ return hooks(momentObj.literal).toDate();
27570
+ }
27571
+ return /* @__PURE__ */ new Date();
27345
27572
  }
27346
- function dateTimeFilterChangeType(filter, type) {
27347
- let currentDate = /* @__PURE__ */ new Date();
27348
- let endDate = hooks(currentDate).add(1, "day").toDate();
27349
- if (filter.operator === "in") {
27350
- currentDate = extractDateFromMoment(filter.in);
27351
- } else if (filter.operator === "before") {
27352
- currentDate = extractDateFromMoment(filter.before);
27353
- } else if (filter.operator === "after") {
27354
- currentDate = extractDateFromMoment(filter.after);
27355
- } else if (filter.operator === "to") {
27356
- currentDate = extractDateFromMoment(filter.fromMoment);
27357
- endDate = extractDateFromMoment(filter.toMoment);
27573
+ function dateTimeFilterChangeType(filter, type, units) {
27574
+ let n = "7";
27575
+ let fromMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
27576
+ let toMoment = createTemporalLiteral(/* @__PURE__ */ new Date(), units);
27577
+ switch (filter.operator) {
27578
+ case "last":
27579
+ case "next":
27580
+ n = filter.n;
27581
+ units = filter.units;
27582
+ break;
27583
+ case "after":
27584
+ fromMoment = filter.after;
27585
+ toMoment = filter.after;
27586
+ break;
27587
+ case "before":
27588
+ fromMoment = filter.before;
27589
+ toMoment = filter.before;
27590
+ break;
27591
+ case "to":
27592
+ fromMoment = filter.fromMoment;
27593
+ toMoment = filter.toMoment;
27594
+ break;
27358
27595
  }
27359
27596
  switch (type) {
27360
- case "is_equal_to":
27597
+ case "last":
27598
+ case "next":
27361
27599
  return {
27362
- operator: "in",
27363
- in: createTemporalLiteral(currentDate)
27600
+ operator: type,
27601
+ n,
27602
+ units
27364
27603
  };
27365
- case "is_before":
27604
+ case "after":
27366
27605
  return {
27367
- operator: "before",
27368
- before: createTemporalLiteral(currentDate)
27606
+ operator: type,
27607
+ after: fromMoment
27369
27608
  };
27370
- case "is_after":
27609
+ case "before":
27371
27610
  return {
27372
- operator: "after",
27373
- after: createTemporalLiteral(currentDate)
27611
+ operator: type,
27612
+ before: fromMoment
27374
27613
  };
27375
- case "is_between":
27614
+ case "to":
27376
27615
  return {
27377
- operator: "to",
27378
- fromMoment: createTemporalLiteral(currentDate),
27379
- toMoment: createTemporalLiteral(endDate)
27616
+ operator: type,
27617
+ fromMoment,
27618
+ toMoment
27380
27619
  };
27381
- case "is_null":
27620
+ case "null":
27382
27621
  return {
27383
27622
  operator: "null"
27384
27623
  };
27385
- case "is_not_null":
27624
+ case "-null":
27386
27625
  return {
27387
27626
  operator: "null",
27388
27627
  not: true
27389
27628
  };
27390
- default:
27391
- return filter;
27392
27629
  }
27630
+ return filter;
27393
27631
  }
27394
27632
  function FilterDialog({
27395
27633
  fieldInfo,
@@ -27522,21 +27760,46 @@ function useFilterModal({
27522
27760
  }
27523
27761
  setQuery == null ? void 0 : setQuery(rootQuery == null ? void 0 : rootQuery.build());
27524
27762
  };
27525
- const FilterModal = () => /* @__PURE__ */ jsx(Root$2, {
27526
- open,
27527
- onOpenChange: setOpen,
27528
- children: /* @__PURE__ */ jsx(Portal$3, {
27529
- children: /* @__PURE__ */ jsx(Overlay, {
27530
- ...{
27531
- className: "mly5uxqc1 mlyixxii4 mly13vifvy mlyu96u03 mly3m8u43 mly1ey2m1c mlyrvj5dj mly1ku5rj1 mly11uqc5h"
27532
- },
27533
- children: /* @__PURE__ */ jsxs(Content$1, {
27534
- ...{},
27535
- style: x2 && y2 ? {
27536
- position: "fixed",
27537
- top: y2,
27538
- left: x2
27539
- } : {},
27763
+ const FilterModal = () => {
27764
+ const {
27765
+ refs,
27766
+ floatingStyles
27767
+ } = useFloating({
27768
+ placement: "right-start",
27769
+ strategy: "fixed",
27770
+ open,
27771
+ middleware: [offset$1({
27772
+ mainAxis: 3,
27773
+ crossAxis: 3
27774
+ }), shift({
27775
+ boundary: document.body,
27776
+ crossAxis: true,
27777
+ padding: 10
27778
+ })],
27779
+ whileElementsMounted: autoUpdate
27780
+ });
27781
+ return /* @__PURE__ */ jsx(Root$2, {
27782
+ open,
27783
+ onOpenChange: setOpen,
27784
+ children: /* @__PURE__ */ jsxs(Portal$3, {
27785
+ children: [/* @__PURE__ */ jsx(Overlay, {
27786
+ ...{
27787
+ className: "mly5uxqc1 mlyixxii4 mly13vifvy mlyu96u03 mly3m8u43 mly1ey2m1c mlyrvj5dj mly1ku5rj1 mly11uqc5h"
27788
+ },
27789
+ children: /* @__PURE__ */ jsx("div", {
27790
+ style: {
27791
+ position: "fixed",
27792
+ left: x2,
27793
+ top: y2
27794
+ },
27795
+ ref: refs.setReference
27796
+ })
27797
+ }), /* @__PURE__ */ jsxs(Content$1, {
27798
+ ...{
27799
+ className: "mly11uqc5h"
27800
+ },
27801
+ style: floatingStyles,
27802
+ ref: refs.setFloating,
27540
27803
  children: [/* @__PURE__ */ jsx(Title, {
27541
27804
  ...{
27542
27805
  className: "mly1s85apg"
@@ -27554,10 +27817,10 @@ function useFilterModal({
27554
27817
  setFilter: (filter2) => setFilter(filter2),
27555
27818
  setOpen
27556
27819
  })]
27557
- })
27820
+ })]
27558
27821
  })
27559
- })
27560
- });
27822
+ });
27823
+ };
27561
27824
  return {
27562
27825
  openFilterModal,
27563
27826
  FilterModal
@@ -27591,26 +27854,22 @@ function getDefaultFilter(fieldInfo) {
27591
27854
  return {
27592
27855
  kind: "date",
27593
27856
  parsed: {
27594
- operator: "after",
27595
- after: createTemporalDefault()
27857
+ operator: "last",
27858
+ n: "7",
27859
+ units: "day"
27596
27860
  }
27597
27861
  };
27598
27862
  } else {
27599
27863
  return {
27600
27864
  kind: "timestamp",
27601
27865
  parsed: {
27602
- operator: "after",
27603
- after: createTemporalDefault()
27866
+ operator: "last",
27867
+ n: "7",
27868
+ units: "day"
27604
27869
  }
27605
27870
  };
27606
27871
  }
27607
27872
  }
27608
- function createTemporalDefault() {
27609
- return {
27610
- moment: "literal",
27611
- literal: hooks(/* @__PURE__ */ new Date()).format("YYYY-MM-DD HH:mm:ss.0")
27612
- };
27613
- }
27614
27873
  function MalloyExplorerProvider({
27615
27874
  source,
27616
27875
  query,
@@ -27656,12 +27915,10 @@ function QueryActionBar({
27656
27915
  };
27657
27916
  return /* @__PURE__ */ jsxs("div", {
27658
27917
  ...{
27659
- className: "mly78zum5 mly1qughib mly6s0dn4 mly1vjfegm"
27918
+ className: "mly78zum5 mly1qughib mly6s0dn4 mly153ncpu"
27660
27919
  },
27661
27920
  children: [/* @__PURE__ */ jsx("div", {
27662
- ...{
27663
- className: "mly6icuqf mly117nqv4 mly1j61zf2"
27664
- },
27921
+ ..._stylex.props(fontStyles.largeBody, styles$k.title),
27665
27922
  children: "Query"
27666
27923
  }), /* @__PURE__ */ jsxs("div", {
27667
27924
  ...{
@@ -27696,7 +27953,13 @@ function QueryActionBar({
27696
27953
  })]
27697
27954
  });
27698
27955
  }
27699
- const styles$g = {
27956
+ const styles$k = {
27957
+ title: {
27958
+ fontWeight: "mly1xlr1w8",
27959
+ $$css: true
27960
+ }
27961
+ };
27962
+ const styles$j = {
27700
27963
  labelWithIcon: {
27701
27964
  display: "mly78zum5",
27702
27965
  alignItems: "mly6s0dn4",
@@ -27794,6 +28057,10 @@ const hoverStyles = {
27794
28057
  display: "mly2b4tyj",
27795
28058
  flexShrink: "mly2lah0s",
27796
28059
  $$css: true
28060
+ },
28061
+ hoverOpen: {
28062
+ display: "mly3nfvp2",
28063
+ $$css: true
27797
28064
  }
27798
28065
  };
27799
28066
  function ClearButton({
@@ -27871,9 +28138,6 @@ function segmentNestNo(segment, name) {
27871
28138
  }
27872
28139
  function addGroupBy(rootQuery, segment, field, path, setQuery) {
27873
28140
  segment.addGroupBy(field.name, path);
27874
- if (!segmentHasLimit(segment)) {
27875
- segment.setLimit(1e3);
27876
- }
27877
28141
  setQuery == null ? void 0 : setQuery(rootQuery.build());
27878
28142
  }
27879
28143
  function getSegmentIfPresent(parent) {
@@ -27887,6 +28151,21 @@ function getSegmentIfPresent(parent) {
27887
28151
  }
27888
28152
  return void 0;
27889
28153
  }
28154
+ const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
28155
+ const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
28156
+ const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
28157
+ function tagToRenderer(tag) {
28158
+ if (tag) {
28159
+ const tagProps = tag.getProperties();
28160
+ const tags = Object.keys(tagProps);
28161
+ for (const tag2 of tags) {
28162
+ if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
28163
+ return tag2;
28164
+ }
28165
+ }
28166
+ }
28167
+ return null;
28168
+ }
27890
28169
  function atomicTypeToIcon(type) {
27891
28170
  return atomicTypeMap[type];
27892
28171
  }
@@ -27912,6 +28191,11 @@ function fieldToIcon(field) {
27912
28191
  function relationshipToIcon(relationship) {
27913
28192
  return relationshipMap[relationship];
27914
28193
  }
28194
+ function viewToVisualizationIcon(view) {
28195
+ const currentTag = view.getTag();
28196
+ const currentRenderer = tagToRenderer(currentTag) ?? "table";
28197
+ return `viz_${currentRenderer}`;
28198
+ }
27915
28199
  const atomicTypeMap = {
27916
28200
  array_type: "array",
27917
28201
  string_type: "string",
@@ -27950,16 +28234,11 @@ function FieldToken({
27950
28234
  className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly1ypdohk mlym9y5t7"
27951
28235
  }
27952
28236
  }[!!hoverActionsVisible << 0],
27953
- children: [/* @__PURE__ */ jsx("div", {
27954
- style: {
27955
- display: "inline-grid"
27956
- },
27957
- children: /* @__PURE__ */ jsx(Token, {
27958
- label: field.name,
27959
- color: fieldKindToColor(field.kind),
27960
- icon: fieldToIcon(field),
27961
- ...props2
27962
- })
28237
+ children: [/* @__PURE__ */ jsx(Token, {
28238
+ label: field.name,
28239
+ color: fieldKindToColor(field.kind),
28240
+ icon: fieldToIcon(field),
28241
+ ...props2
27963
28242
  }), hoverActions && /* @__PURE__ */ jsx("div", {
27964
28243
  ...{
27965
28244
  className: "mly1vsucm1 mly2lah0s"
@@ -27976,52 +28255,37 @@ function BadgeForField({
27976
28255
  label: "view",
27977
28256
  icon: "view_filled",
27978
28257
  color: "purple",
27979
- customStyle: styles$f.noBackground
28258
+ customStyle: styles$i.noBackground
27980
28259
  });
27981
28260
  } else if (field.kind === "dimension") {
27982
28261
  return /* @__PURE__ */ jsx(Badge, {
27983
28262
  label: "dimension",
27984
- icon: "dimension",
28263
+ icon: fieldToIcon(field),
27985
28264
  color: "cyan",
27986
- customStyle: styles$f.noBackground
28265
+ customStyle: styles$i.noBackground
27987
28266
  });
27988
28267
  } else if (field.kind === "measure") {
27989
28268
  return /* @__PURE__ */ jsx(Badge, {
27990
28269
  label: "measure",
27991
- icon: "measure",
28270
+ icon: fieldToIcon(field),
27992
28271
  color: "green",
27993
- customStyle: styles$f.noBackground
28272
+ customStyle: styles$i.noBackground
27994
28273
  });
27995
28274
  } else if (field.kind === "join") {
27996
28275
  return /* @__PURE__ */ jsx(Badge, {
27997
28276
  label: "join",
27998
- icon: "many_to_one",
28277
+ icon: fieldToIcon(field),
27999
28278
  color: "gray",
28000
- customStyle: styles$f.noBackground
28279
+ customStyle: styles$i.noBackground
28001
28280
  });
28002
28281
  }
28003
28282
  }
28004
- const styles$f = {
28283
+ const styles$i = {
28005
28284
  noBackground: {
28006
28285
  backgroundColor: "mlyjbqb8w",
28007
28286
  $$css: true
28008
28287
  }
28009
28288
  };
28010
- const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
28011
- const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
28012
- const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
28013
- function tagToRenderer(tag) {
28014
- if (tag) {
28015
- const tagProps = tag.getProperties();
28016
- const tags = Object.keys(tagProps);
28017
- for (const tag2 of tags) {
28018
- if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
28019
- return tag2;
28020
- }
28021
- }
28022
- }
28023
- return null;
28024
- }
28025
28289
  function Visualization$1({
28026
28290
  rootQuery,
28027
28291
  view
@@ -28045,7 +28309,7 @@ function Visualization$1({
28045
28309
  onClick: () => setRenderer(viz)
28046
28310
  }));
28047
28311
  const tokens2 = [/* @__PURE__ */ jsx(SelectorToken, {
28048
- customStyle: styles$e.first,
28312
+ customStyle: styles$h.first,
28049
28313
  icon: `viz_${currentRenderer}`,
28050
28314
  value: currentRenderer,
28051
28315
  items: vizes,
@@ -28055,7 +28319,7 @@ function Visualization$1({
28055
28319
  children: tokens2
28056
28320
  });
28057
28321
  }
28058
- const styles$e = {
28322
+ const styles$h = {
28059
28323
  first: {
28060
28324
  flexGrow: "mly1iyjqo2",
28061
28325
  justifyContent: "mlylqzeqv",
@@ -28084,7 +28348,7 @@ function ViewAttributeTable({
28084
28348
  }) {
28085
28349
  const dimensions = viewInfo.schema.fields.filter((f2) => f2.kind === "dimension");
28086
28350
  return /* @__PURE__ */ jsx("div", {
28087
- ..._stylex.props(styles$d.attributeTableContainer, style),
28351
+ ..._stylex.props(styles$g.attributeTableContainer, style),
28088
28352
  children: /* @__PURE__ */ jsx(ScrollableArea, {
28089
28353
  children: /* @__PURE__ */ jsx("table", {
28090
28354
  ...{
@@ -28124,9 +28388,9 @@ function ViewAttributeTableRow({
28124
28388
  className: "mlydpxx8g"
28125
28389
  },
28126
28390
  children: [/* @__PURE__ */ jsx("td", {
28127
- ..._stylex.props(styles$d.attributeTableKeyCell, fontStyles.supporting),
28391
+ ..._stylex.props(styles$g.attributeTableKeyCell, fontStyles.supporting),
28128
28392
  children: /* @__PURE__ */ jsx("div", {
28129
- ..._stylex.props(styles$d.attributeTableKeyCellContent, fontStyles.supporting),
28393
+ ..._stylex.props(styles$g.attributeTableKeyCellContent, fontStyles.supporting),
28130
28394
  children: attribute
28131
28395
  })
28132
28396
  }), /* @__PURE__ */ jsx("td", {
@@ -28137,7 +28401,7 @@ function ViewAttributeTableRow({
28137
28401
  })]
28138
28402
  });
28139
28403
  }
28140
- const styles$d = {
28404
+ const styles$g = {
28141
28405
  attributeTableContainer: {
28142
28406
  padding: "mlye8ttls",
28143
28407
  paddingInline: null,
@@ -28293,7 +28557,7 @@ function HoverText({
28293
28557
  asChild: true,
28294
28558
  children: /* @__PURE__ */ jsx("div", {
28295
28559
  ref: textRef,
28296
- ..._stylex.props(styles$c.text, fontStyles.supporting),
28560
+ ..._stylex.props(styles$f.text, fontStyles.supporting),
28297
28561
  children: text2
28298
28562
  })
28299
28563
  }), /* @__PURE__ */ jsx(Portal$4, {
@@ -28301,7 +28565,7 @@ function HoverText({
28301
28565
  side,
28302
28566
  align,
28303
28567
  children: /* @__PURE__ */ jsx("pre", {
28304
- ..._stylex.props(styles$c.hoverText, fontStyles.tooltipText),
28568
+ ..._stylex.props(styles$f.hoverText, fontStyles.tooltipText),
28305
28569
  children: text2
28306
28570
  })
28307
28571
  })
@@ -28310,7 +28574,7 @@ function HoverText({
28310
28574
  })
28311
28575
  });
28312
28576
  }
28313
- const styles$c = {
28577
+ const styles$f = {
28314
28578
  text: {
28315
28579
  whiteSpace: "mlyuxw1ft",
28316
28580
  textOverflow: "mlylyipyv",
@@ -28372,7 +28636,7 @@ function FieldHoverCard({
28372
28636
  details = /* @__PURE__ */ jsx(ViewAttributeTable, {
28373
28637
  viewInfo: field,
28374
28638
  isCompact: true,
28375
- style: styles$b.viewAttributeTable
28639
+ style: styles$e.viewAttributeTable
28376
28640
  });
28377
28641
  } else if (field.kind === "dimension") {
28378
28642
  details = /* @__PURE__ */ jsx(TopValuesTable, {
@@ -28381,7 +28645,7 @@ function FieldHoverCard({
28381
28645
  });
28382
28646
  }
28383
28647
  return /* @__PURE__ */ jsxs("div", {
28384
- ..._stylex.props(styles$b.container, fontStyles.body),
28648
+ ..._stylex.props(styles$e.container, fontStyles.body),
28385
28649
  children: [/* @__PURE__ */ jsxs("div", {
28386
28650
  children: [/* @__PURE__ */ jsx("div", {
28387
28651
  ...{
@@ -28391,7 +28655,7 @@ function FieldHoverCard({
28391
28655
  field
28392
28656
  })
28393
28657
  }), /* @__PURE__ */ jsx("div", {
28394
- ..._stylex.props(fontStyles.supporting, styles$b.path),
28658
+ ..._stylex.props(fontStyles.supporting, styles$e.path),
28395
28659
  children: pathString
28396
28660
  }), /* @__PURE__ */ jsx("div", {
28397
28661
  ..._stylex.props(fontStyles.emphasized),
@@ -28405,7 +28669,7 @@ function FieldHoverCard({
28405
28669
  })]
28406
28670
  });
28407
28671
  }
28408
- const styles$b = {
28672
+ const styles$e = {
28409
28673
  container: {
28410
28674
  width: "mlybl57os",
28411
28675
  maxHeight: "mly1t2cwa7",
@@ -28445,6 +28709,7 @@ const styles$b = {
28445
28709
  $$css: true
28446
28710
  }
28447
28711
  };
28712
+ const isArrayOrRecord = (field) => field.kind === "dimension" && (field.type.kind === "array_type" && field.type.element_type.kind === "record_type" || field.type.kind === "record_type");
28448
28713
  function FieldList({
28449
28714
  view,
28450
28715
  fields,
@@ -28456,8 +28721,9 @@ function FieldList({
28456
28721
  const groups = useMemo(() => {
28457
28722
  const groups2 = [];
28458
28723
  const buildGroups = (types22, path, name, fields2) => {
28459
- const filteredFields = sortFieldInfos(fields2).filter((field) => field.kind !== "join").filter((field) => field.name.includes(search) && types22.includes(field.kind)).filter((field) => filter ? filter(view, field, path) : true);
28724
+ const filteredFields = sortFieldInfos(fields2).filter((field) => field.kind !== "join").filter((field) => !isArrayOrRecord(field)).filter((field) => field.name.includes(search) && types22.includes(field.kind)).filter((field) => filter ? filter(view, field, path) : true);
28460
28725
  const joins = fields2.filter((field) => field.kind === "join");
28726
+ const arraysAndRecords = fields2.filter(isArrayOrRecord);
28461
28727
  if (filteredFields.length) {
28462
28728
  groups2.push({
28463
28729
  path,
@@ -28465,6 +28731,19 @@ function FieldList({
28465
28731
  fields: filteredFields
28466
28732
  });
28467
28733
  }
28734
+ for (const array of arraysAndRecords) {
28735
+ if (array.type.kind === "array_type" && array.type.element_type.kind === "record_type") {
28736
+ buildGroups(types22, [...path, array.name], array.name, array.type.element_type.fields.map((dimension) => ({
28737
+ kind: "dimension",
28738
+ ...dimension
28739
+ })));
28740
+ } else if (array.type.kind === "record_type") {
28741
+ buildGroups(types22, [...path, array.name], array.name, array.type.fields.map((dimension) => ({
28742
+ kind: "dimension",
28743
+ ...dimension
28744
+ })));
28745
+ }
28746
+ }
28468
28747
  for (const join of joins) {
28469
28748
  buildGroups(
28470
28749
  types22.filter((type) => type !== "view"),
@@ -28482,14 +28761,14 @@ function FieldList({
28482
28761
  children: groups.length ? groups.map((group) => /* @__PURE__ */ jsxs("div", {
28483
28762
  children: [/* @__PURE__ */ jsx("div", {
28484
28763
  children: /* @__PURE__ */ jsx("div", {
28485
- ..._stylex.props(addMenuStyles.item, styles$a.fieldItem),
28764
+ ..._stylex.props(addMenuStyles.item, styles$d.fieldItem),
28486
28765
  "data-disabled": "true",
28487
28766
  children: group.name
28488
28767
  })
28489
28768
  }), group.fields.map((field) => /* @__PURE__ */ jsx("div", {
28490
28769
  role: "menuitem",
28491
28770
  tabIndex: -1,
28492
- ..._stylex.props(addMenuStyles.item, styles$a.fieldItem),
28771
+ ..._stylex.props(addMenuStyles.item, styles$d.fieldItem),
28493
28772
  children: /* @__PURE__ */ jsx(FieldToken, {
28494
28773
  field,
28495
28774
  onClick: (event) => onClick(field, group.path, event),
@@ -28512,7 +28791,7 @@ function FieldList({
28512
28791
  })
28513
28792
  });
28514
28793
  }
28515
- const styles$a = {
28794
+ const styles$d = {
28516
28795
  fieldItem: {
28517
28796
  height: "mly1qx5ct2",
28518
28797
  paddingTop: "mly1y1aw1k",
@@ -28564,13 +28843,15 @@ function OperationActionTitle({
28564
28843
  types: types2,
28565
28844
  onClick
28566
28845
  }) {
28846
+ const [isMenuOpen, setIsMenuOpen] = React.useState(false);
28567
28847
  return /* @__PURE__ */ jsxs("div", {
28568
- ..._stylex.props(styles$g.title, hoverStyles.main),
28848
+ ..._stylex.props(styles$j.title, hoverStyles.main),
28569
28849
  children: [/* @__PURE__ */ jsx("div", {
28570
28850
  children: title
28571
28851
  }), /* @__PURE__ */ jsx("div", {
28572
- ..._stylex.props(hoverStyles.hoverActions),
28852
+ ..._stylex.props(hoverStyles.hoverActions, isMenuOpen ? hoverStyles.hoverOpen : void 0),
28573
28853
  children: /* @__PURE__ */ jsxs(Root2$2, {
28854
+ onOpenChange: setIsMenuOpen,
28574
28855
  children: [/* @__PURE__ */ jsx(Trigger$2, {
28575
28856
  asChild: true,
28576
28857
  children: /* @__PURE__ */ jsx("div", {
@@ -28647,7 +28928,7 @@ function GroupByOperations({
28647
28928
  addGroupBy(rootQuery, segment, field, path, setQuery);
28648
28929
  }
28649
28930
  }), /* @__PURE__ */ jsx("div", {
28650
- ..._stylex.props(styles$g.tokenContainer),
28931
+ ..._stylex.props(styles$j.tokenContainer),
28651
28932
  children: groupBys.map((groupBy) => {
28652
28933
  const fieldInfo = groupBy.getFieldInfo();
28653
28934
  const path = groupBy.field.getReference().path ?? [];
@@ -28737,10 +29018,10 @@ function FilterOperations({
28737
29018
  }
28738
29019
  return /* @__PURE__ */ jsxs("div", {
28739
29020
  children: [/* @__PURE__ */ jsx("div", {
28740
- ..._stylex.props(styles$g.title),
29021
+ ..._stylex.props(styles$j.title),
28741
29022
  children: "filter by"
28742
29023
  }), /* @__PURE__ */ jsx("div", {
28743
- ..._stylex.props(styles$g.tokenContainer),
29024
+ ..._stylex.props(styles$j.tokenContainer),
28744
29025
  children: filters.map((filterOperation, key2) => {
28745
29026
  return /* @__PURE__ */ jsx(ErrorElement, {
28746
29027
  fallback: /* @__PURE__ */ jsxs("div", {
@@ -28998,7 +29279,7 @@ function LimitOperation({
28998
29279
  }
28999
29280
  return /* @__PURE__ */ jsxs("div", {
29000
29281
  children: [/* @__PURE__ */ jsx("div", {
29001
- ..._stylex.props(styles$g.title),
29282
+ ..._stylex.props(styles$j.title),
29002
29283
  children: "limit"
29003
29284
  }), /* @__PURE__ */ jsxs("div", {
29004
29285
  ..._stylex.props(hoverStyles.main),
@@ -29050,7 +29331,7 @@ function AggregateOperations({
29050
29331
  setQuery == null ? void 0 : setQuery(rootQuery.build());
29051
29332
  }
29052
29333
  }), " ", /* @__PURE__ */ jsx("div", {
29053
- ..._stylex.props(styles$g.tokenContainer),
29334
+ ..._stylex.props(styles$j.tokenContainer),
29054
29335
  children: aggregates.map((aggregate) => {
29055
29336
  const fieldInfo = aggregate.getFieldInfo();
29056
29337
  const path = aggregate.field.getReference().path ?? [];
@@ -29091,10 +29372,10 @@ function OrderByOperations({
29091
29372
  }
29092
29373
  return /* @__PURE__ */ jsxs("div", {
29093
29374
  children: [/* @__PURE__ */ jsx("div", {
29094
- ..._stylex.props(styles$g.title),
29375
+ ..._stylex.props(styles$j.title),
29095
29376
  children: "order by"
29096
29377
  }), /* @__PURE__ */ jsx("div", {
29097
- ..._stylex.props(styles$g.tokenContainer),
29378
+ ..._stylex.props(styles$j.tokenContainer),
29098
29379
  children: orderBys.map((orderBy) => {
29099
29380
  const {
29100
29381
  fieldReference
@@ -29177,16 +29458,21 @@ function CollapsiblePanel({
29177
29458
  },
29178
29459
  children: [/* @__PURE__ */ jsxs("div", {
29179
29460
  ...{
29180
- className: "mly78zum5 mly1qughib mlyfawy5m mly167g77z mly6s0dn4"
29461
+ className: "mlyrvj5dj mly1mt1orb mly52fmzj mlylqzeqv mlyfawy5m mly167g77z mly6s0dn4"
29181
29462
  },
29182
- children: [icon && /* @__PURE__ */ jsx(Icon, {
29183
- name: icon,
29184
- customStyle: styles$9.icon
29185
- }), /* @__PURE__ */ jsx("div", {
29463
+ children: [/* @__PURE__ */ jsxs("div", {
29186
29464
  ...{
29187
- className: "mlyuxw1ft mlyehqz9p mly1ghz6dp mly1iyjqo2"
29465
+ className: "mlyrvj5dj mly1mt1orb mlylqzeqv mly6s0dn4 mly167g77z"
29188
29466
  },
29189
- children: title
29467
+ children: [icon && /* @__PURE__ */ jsx(Icon, {
29468
+ name: icon,
29469
+ customStyle: styles$c.icon
29470
+ }), /* @__PURE__ */ jsx("div", {
29471
+ ...{
29472
+ className: "mlyuxw1ft mlyb3r6kr mlylyipyv mlyehqz9p mly1ghz6dp"
29473
+ },
29474
+ children: title
29475
+ })]
29190
29476
  }), /* @__PURE__ */ jsxs("div", {
29191
29477
  ...{
29192
29478
  className: "mly78zum5"
@@ -29217,7 +29503,7 @@ function CollapsiblePanel({
29217
29503
  })]
29218
29504
  });
29219
29505
  }
29220
- const styles$9 = {
29506
+ const styles$c = {
29221
29507
  icon: {
29222
29508
  $$css: true
29223
29509
  }
@@ -29317,7 +29603,7 @@ function AddFieldItem({
29317
29603
  const trigger = /* @__PURE__ */ jsxs("div", {
29318
29604
  role: "menuitem",
29319
29605
  tabIndex: -1,
29320
- ..._stylex.props(addMenuStyles.item, addMenuStyles.clickable),
29606
+ ..._stylex.props(addMenuStyles.item, addMenuStyles.clickable, open ? styles$b.open : null),
29321
29607
  "data-disabled": disabled ? "true" : void 0,
29322
29608
  children: [/* @__PURE__ */ jsxs("div", {
29323
29609
  ..._stylex.props(addMenuStyles.label),
@@ -29352,7 +29638,6 @@ function AddFieldItem({
29352
29638
  children: [/* @__PURE__ */ jsx(Trigger$2, {
29353
29639
  asChild: true,
29354
29640
  disabled,
29355
- onMouseEnter: () => setOpen(true),
29356
29641
  children: trigger
29357
29642
  }), /* @__PURE__ */ jsx(Portal$1, {
29358
29643
  children: /* @__PURE__ */ jsxs(Content2$2, {
@@ -29373,6 +29658,22 @@ function AddFieldItem({
29373
29658
  })]
29374
29659
  });
29375
29660
  }
29661
+ const styles$b = {
29662
+ open: {
29663
+ background: "mly1p5yd3t",
29664
+ backgroundAttachment: null,
29665
+ backgroundClip: null,
29666
+ backgroundColor: null,
29667
+ backgroundImage: null,
29668
+ backgroundOrigin: null,
29669
+ backgroundPosition: null,
29670
+ backgroundPositionX: null,
29671
+ backgroundPositionY: null,
29672
+ backgroundRepeat: null,
29673
+ backgroundSize: null,
29674
+ $$css: true
29675
+ }
29676
+ };
29376
29677
  function AddOrderBy({
29377
29678
  rootQuery,
29378
29679
  view
@@ -29561,9 +29862,6 @@ function AddMenu({
29561
29862
  const segment = view.getOrAddDefaultSegment();
29562
29863
  if (field.kind === "dimension") {
29563
29864
  segment.addGroupBy(field.name, path);
29564
- if (!segmentHasLimit(segment)) {
29565
- segment.setLimit(1e3);
29566
- }
29567
29865
  } else if (field.kind === "measure") {
29568
29866
  segment.addAggregate(field.name, path);
29569
29867
  } else {
@@ -29617,15 +29915,6 @@ function AddMenu({
29617
29915
  })]
29618
29916
  });
29619
29917
  }
29620
- function VisualizationIcon({
29621
- view
29622
- }) {
29623
- const currentTag = view.getTag();
29624
- const currentRenderer = tagToRenderer(currentTag) ?? "table";
29625
- return /* @__PURE__ */ jsx(Icon, {
29626
- name: `viz_${currentRenderer}`
29627
- });
29628
- }
29629
29918
  function NestOperations({
29630
29919
  rootQuery,
29631
29920
  nests
@@ -29636,41 +29925,41 @@ function NestOperations({
29636
29925
  if (nests.length === 0) {
29637
29926
  return null;
29638
29927
  }
29928
+ const getControls = (nest) => /* @__PURE__ */ jsxs(Fragment, {
29929
+ children: [/* @__PURE__ */ jsx(DropdownMenu, {
29930
+ trigger: /* @__PURE__ */ jsx(Button, {
29931
+ variant: "flat",
29932
+ icon: "meatballs",
29933
+ size: "compact",
29934
+ tooltip: "More Actions"
29935
+ }),
29936
+ children: /* @__PURE__ */ jsx(DropdownMenuItem, {
29937
+ icon: "clear",
29938
+ label: "Delete Query",
29939
+ onClick: () => {
29940
+ nest.delete();
29941
+ setQuery == null ? void 0 : setQuery(rootQuery.build());
29942
+ }
29943
+ })
29944
+ }), /* @__PURE__ */ jsx(AddMenu, {
29945
+ rootQuery,
29946
+ view: nest.view
29947
+ })]
29948
+ });
29639
29949
  return /* @__PURE__ */ jsx("div", {
29640
- ..._stylex.props(styles$g.tokenContainer),
29950
+ ..._stylex.props(styles$j.tokenContainer),
29641
29951
  children: nests.map((nest) => {
29952
+ const defaultOpen = nest.view.definition.node.kind === "segment" && nest.view.definition.node.operations.length === 0;
29642
29953
  return /* @__PURE__ */ jsx("div", {
29643
29954
  ...{
29644
29955
  className: "mlyj3b58b mly1yf7rl7 mly1xmf6yo mlyh8yej3"
29645
29956
  },
29646
29957
  children: /* @__PURE__ */ jsx(CollapsiblePanel, {
29647
29958
  title: nest.name,
29648
- icon: "nest",
29649
- defaultOpen: false,
29650
- controls: /* @__PURE__ */ jsxs(Fragment, {
29651
- children: [/* @__PURE__ */ jsx(DropdownMenu, {
29652
- trigger: /* @__PURE__ */ jsx(Button, {
29653
- variant: "flat",
29654
- icon: "meatballs",
29655
- size: "compact",
29656
- tooltip: "More Actions"
29657
- }),
29658
- children: /* @__PURE__ */ jsx(DropdownMenuItem, {
29659
- icon: "clear",
29660
- label: "Delete Query",
29661
- onClick: () => {
29662
- nest.delete();
29663
- setQuery == null ? void 0 : setQuery(rootQuery.build());
29664
- }
29665
- })
29666
- }), /* @__PURE__ */ jsx(AddMenu, {
29667
- rootQuery,
29668
- view: nest.view
29669
- })]
29670
- }),
29671
- collapsedControls: /* @__PURE__ */ jsx(VisualizationIcon, {
29672
- view: nest.view
29673
- }),
29959
+ icon: viewToVisualizationIcon(nest.view),
29960
+ defaultOpen,
29961
+ controls: getControls(nest),
29962
+ collapsedControls: getControls(nest),
29674
29963
  children: /* @__PURE__ */ jsx(View, {
29675
29964
  rootQuery,
29676
29965
  view: nest.view
@@ -29807,11 +30096,11 @@ function CollapsingView({
29807
30096
  })]
29808
30097
  }), !collapsed && /* @__PURE__ */ jsx(ViewAttributeTable, {
29809
30098
  viewInfo: viewDef.getViewInfo(),
29810
- style: styles$8.preview
30099
+ style: styles$a.preview
29811
30100
  })]
29812
30101
  });
29813
30102
  }
29814
- const styles$8 = {
30103
+ const styles$a = {
29815
30104
  preview: {
29816
30105
  height: "mlyt7dq6l",
29817
30106
  maxHeight: "mly1hkcv85",
@@ -29853,21 +30142,33 @@ function Query({
29853
30142
  size: "compact",
29854
30143
  tooltip: "More Actions"
29855
30144
  }),
29856
- children: setQuery ? /* @__PURE__ */ jsx(DropdownMenuItem, {
29857
- icon: "clear",
29858
- label: "Clear query",
29859
- onClick: () => {
29860
- setQuery == null ? void 0 : setQuery(void 0);
29861
- },
29862
- disabled: rootQuery.isEmpty()
30145
+ children: setQuery ? /* @__PURE__ */ jsxs(Fragment, {
30146
+ children: [/* @__PURE__ */ jsx(DropdownMenuItem, {
30147
+ icon: "clear",
30148
+ label: "Clear query",
30149
+ onClick: () => {
30150
+ setQuery == null ? void 0 : setQuery(void 0);
30151
+ },
30152
+ disabled: rootQuery.isEmpty()
30153
+ }), /* @__PURE__ */ jsx(DropdownMenuItem, {
30154
+ icon: "nest",
30155
+ label: "Nest query",
30156
+ onClick: () => {
30157
+ if (rootQuery.definition instanceof ASTArrowQueryDefinition) {
30158
+ rootQuery.definition.view.convertToNest("Nest");
30159
+ }
30160
+ setQuery == null ? void 0 : setQuery(rootQuery.build());
30161
+ },
30162
+ disabled: rootQuery.isEmpty()
30163
+ })]
29863
30164
  }) : /* @__PURE__ */ jsx(Fragment, {})
29864
30165
  }), query.definition instanceof ASTArrowQueryDefinition ? /* @__PURE__ */ jsx(AddMenu, {
29865
30166
  rootQuery,
29866
30167
  view: query.definition
29867
30168
  }) : null]
29868
30169
  }),
29869
- collapsedControls: /* @__PURE__ */ jsx(VisualizationIcon, {
29870
- view: query
30170
+ collapsedControls: /* @__PURE__ */ jsx(Icon, {
30171
+ name: viewToVisualizationIcon(query)
29871
30172
  }),
29872
30173
  children: [query.definition instanceof ASTArrowQueryDefinition ? /* @__PURE__ */ jsxs("div", {
29873
30174
  style: {
@@ -29915,9 +30216,9 @@ function Source({
29915
30216
  } = useContext(ExplorerPanelsContext);
29916
30217
  if (!(isSourcePanelOpen && setIsSourcePanelOpen) && rootQuery.definition instanceof ASTArrowQueryDefinition) {
29917
30218
  return /* @__PURE__ */ jsxs("div", {
29918
- ..._stylex.props(styles$g.queryCard, styles$7.flex),
30219
+ ..._stylex.props(styles$j.queryCard, styles$9.flex),
29919
30220
  children: [/* @__PURE__ */ jsxs("div", {
29920
- ..._stylex.props(styles$g.labelWithIcon),
30221
+ ..._stylex.props(styles$j.labelWithIcon),
29921
30222
  children: [/* @__PURE__ */ jsx(Icon, {
29922
30223
  name: "database"
29923
30224
  }), rootQuery.definition.as.ArrowQueryDefinition().source.as.ReferenceQueryArrowSource().name]
@@ -29930,7 +30231,7 @@ function Source({
29930
30231
  }
29931
30232
  return null;
29932
30233
  }
29933
- const styles$7 = {
30234
+ const styles$9 = {
29934
30235
  flex: {
29935
30236
  display: "mly78zum5",
29936
30237
  justifyContent: "mly1qughib",
@@ -29994,6 +30295,12 @@ function LiteralValueEditor({
29994
30295
  granularity: "second"
29995
30296
  })
29996
30297
  });
30298
+ case "filter_expression_literal":
30299
+ return /* @__PURE__ */ jsx(EditableToken, {
30300
+ value: value.filter_expression_value,
30301
+ onChange: (value2) => setValue(value2),
30302
+ customStyle
30303
+ });
29997
30304
  }
29998
30305
  }
29999
30306
  function Parameters({
@@ -30017,6 +30324,7 @@ function Parameters({
30017
30324
  children: sourceParameters.map((parameter) => {
30018
30325
  var _a2;
30019
30326
  return /* @__PURE__ */ jsxs(TokenGroup, {
30327
+ customStyle: styles$8.tokenGroup,
30020
30328
  children: [/* @__PURE__ */ jsx(Token, {
30021
30329
  icon: atomicTypeToIcon(parameter.type.kind),
30022
30330
  label: parameter.name
@@ -30034,6 +30342,12 @@ function Parameters({
30034
30342
  }
30035
30343
  return null;
30036
30344
  }
30345
+ const styles$8 = {
30346
+ tokenGroup: {
30347
+ display: "mly78zum5",
30348
+ $$css: true
30349
+ }
30350
+ };
30037
30351
  function QueryEditor() {
30038
30352
  const {
30039
30353
  rootQuery,
@@ -30043,21 +30357,40 @@ function QueryEditor() {
30043
30357
  console.error("Missing <MalloyExplorerProvider>");
30044
30358
  return null;
30045
30359
  }
30046
- return /* @__PURE__ */ jsxs("div", {
30047
- ...{
30048
- className: "mly6icuqf mlyif65rj mlywxc2jc mly78zum5 mlydt5ytf mly167g77z"
30049
- },
30050
- children: [/* @__PURE__ */ jsx(Source, {
30051
- rootQuery
30052
- }), /* @__PURE__ */ jsx(Parameters, {
30053
- rootQuery
30054
- }), /* @__PURE__ */ jsx(Query, {
30055
- rootQuery,
30056
- query: rootQuery,
30057
- setQuery
30058
- })]
30360
+ return /* @__PURE__ */ jsx(ScrollableArea, {
30361
+ children: /* @__PURE__ */ jsxs("div", {
30362
+ ..._stylex.props(fontStyles.body, styles$7.main),
30363
+ children: [/* @__PURE__ */ jsx(Source, {
30364
+ rootQuery
30365
+ }), /* @__PURE__ */ jsx(Parameters, {
30366
+ rootQuery
30367
+ }), /* @__PURE__ */ jsx(Query, {
30368
+ rootQuery,
30369
+ query: rootQuery,
30370
+ setQuery
30371
+ })]
30372
+ })
30059
30373
  });
30060
30374
  }
30375
+ const styles$7 = {
30376
+ main: {
30377
+ display: "mly78zum5",
30378
+ flexDirection: "mlydt5ytf",
30379
+ gap: "mly167g77z",
30380
+ rowGap: null,
30381
+ columnGap: null,
30382
+ padding: "mly1fut7tt",
30383
+ paddingInline: null,
30384
+ paddingStart: null,
30385
+ paddingLeft: null,
30386
+ paddingEnd: null,
30387
+ paddingRight: null,
30388
+ paddingBlock: null,
30389
+ paddingTop: null,
30390
+ paddingBottom: null,
30391
+ $$css: true
30392
+ }
30393
+ };
30061
30394
  function QueryPanel({
30062
30395
  runQuery
30063
30396
  }) {
@@ -30065,20 +30398,10 @@ function QueryPanel({
30065
30398
  ...{
30066
30399
  className: "mly78zum5 mlydt5ytf mly2lah0s mlyh8yej3 mly5yr21d mlyotlr4g mly1roky18"
30067
30400
  },
30068
- children: [/* @__PURE__ */ jsx("div", {
30069
- ...{
30070
- className: "mly78zum5 mlydt5ytf mly153ncpu"
30071
- },
30072
- children: /* @__PURE__ */ jsx(QueryActionBar, {
30073
- runQuery
30074
- })
30401
+ children: [/* @__PURE__ */ jsx(QueryActionBar, {
30402
+ runQuery
30075
30403
  }), /* @__PURE__ */ jsx(ScrollableArea, {
30076
- children: /* @__PURE__ */ jsx("div", {
30077
- ...{
30078
- className: "mly78zum5 mlydt5ytf mly1fut7tt mly167g77z"
30079
- },
30080
- children: /* @__PURE__ */ jsx(QueryEditor, {})
30081
- })
30404
+ children: /* @__PURE__ */ jsx(QueryEditor, {})
30082
30405
  })]
30083
30406
  });
30084
30407
  }
@@ -30871,7 +31194,22 @@ function flattenFieldsTree(fields, path = []) {
30871
31194
  }];
30872
31195
  }
30873
31196
  case "measure":
31197
+ return [{
31198
+ path,
31199
+ field
31200
+ }];
30874
31201
  case "dimension":
31202
+ if (field.type.kind === "array_type" && field.type.element_type.kind === "record_type") {
31203
+ return flattenFieldsTree(field.type.element_type.fields.map((dimension) => ({
31204
+ kind: "dimension",
31205
+ ...dimension
31206
+ })), [...path, field.name]);
31207
+ } else if (field.type.kind === "record_type") {
31208
+ return flattenFieldsTree(field.type.fields.map((dimension) => ({
31209
+ kind: "dimension",
31210
+ ...dimension
31211
+ })), [...path, field.name]);
31212
+ }
30875
31213
  return [{
30876
31214
  path,
30877
31215
  field
@@ -31365,7 +31703,9 @@ const styles$1 = {
31365
31703
  $$css: true
31366
31704
  }
31367
31705
  };
31368
- function SourcePanel() {
31706
+ function SourcePanel({
31707
+ onRefresh
31708
+ }) {
31369
31709
  const {
31370
31710
  source
31371
31711
  } = React.useContext(QueryEditorContext);
@@ -31438,13 +31778,23 @@ function SourcePanel() {
31438
31778
  variant: "flat",
31439
31779
  size: "compact",
31440
31780
  onClick: () => setSubpanelType(null)
31441
- }), setIsSourcePanelOpen && /* @__PURE__ */ jsx("div", {
31442
- children: /* @__PURE__ */ jsx(Button, {
31443
- icon: "chevronLeft",
31781
+ }), /* @__PURE__ */ jsxs("div", {
31782
+ ...{
31783
+ className: "mly78zum5"
31784
+ },
31785
+ children: [/* @__PURE__ */ jsx(Button, {
31786
+ icon: "refresh",
31787
+ tooltip: "Refresh the source",
31788
+ onClick: onRefresh,
31789
+ size: "compact",
31790
+ variant: "flat"
31791
+ }), setIsSourcePanelOpen && /* @__PURE__ */ jsx(Button, {
31792
+ icon: "sidebarCollapse",
31444
31793
  tooltip: "Close the source panel",
31445
31794
  onClick: () => setIsSourcePanelOpen(false),
31446
- size: "compact"
31447
- })
31795
+ size: "compact",
31796
+ variant: "flat"
31797
+ })]
31448
31798
  })]
31449
31799
  }), /* @__PURE__ */ jsx(TextInput, {
31450
31800
  value: searchQuery,