@malloydata/malloy-explorer 0.0.282-dev250528154617 → 0.0.285-dev250529214052
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/cjs/index.cjs +110 -109
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +110 -109
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/QueryPanel/AddMenu/ValueList.d.ts +2 -1
- package/package.json +6 -6
package/dist/cjs/index.cjs
CHANGED
|
@@ -26160,6 +26160,108 @@ function LiteralValue({
|
|
|
26160
26160
|
});
|
|
26161
26161
|
}
|
|
26162
26162
|
}
|
|
26163
|
+
const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
|
|
26164
|
+
const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
|
|
26165
|
+
const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
|
|
26166
|
+
function tagToRenderer(tag) {
|
|
26167
|
+
if (tag) {
|
|
26168
|
+
const tagProps = tag.getProperties();
|
|
26169
|
+
const tags = Object.keys(tagProps);
|
|
26170
|
+
for (const tag2 of tags) {
|
|
26171
|
+
if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
|
|
26172
|
+
return tag2;
|
|
26173
|
+
}
|
|
26174
|
+
}
|
|
26175
|
+
}
|
|
26176
|
+
return null;
|
|
26177
|
+
}
|
|
26178
|
+
function atomicTypeToIcon(type) {
|
|
26179
|
+
return atomicTypeMap[type];
|
|
26180
|
+
}
|
|
26181
|
+
function fieldKindToColor(kind) {
|
|
26182
|
+
return fieldKindMap[kind];
|
|
26183
|
+
}
|
|
26184
|
+
function fieldToIcon(field) {
|
|
26185
|
+
let icon;
|
|
26186
|
+
switch (field.kind) {
|
|
26187
|
+
case "view":
|
|
26188
|
+
icon = "query";
|
|
26189
|
+
break;
|
|
26190
|
+
case "dimension":
|
|
26191
|
+
case "measure":
|
|
26192
|
+
icon = atomicTypeToIcon(field.type.kind);
|
|
26193
|
+
break;
|
|
26194
|
+
case "join":
|
|
26195
|
+
icon = relationshipToIcon(field.relationship);
|
|
26196
|
+
break;
|
|
26197
|
+
}
|
|
26198
|
+
return icon;
|
|
26199
|
+
}
|
|
26200
|
+
function relationshipToIcon(relationship) {
|
|
26201
|
+
return relationshipMap[relationship];
|
|
26202
|
+
}
|
|
26203
|
+
function viewToVisualizationIcon(view) {
|
|
26204
|
+
const currentTag = view.getTag();
|
|
26205
|
+
const currentRenderer = tagToRenderer(currentTag) ?? "table";
|
|
26206
|
+
return `viz_${currentRenderer}`;
|
|
26207
|
+
}
|
|
26208
|
+
const atomicTypeMap = {
|
|
26209
|
+
array_type: "array",
|
|
26210
|
+
string_type: "string",
|
|
26211
|
+
date_type: "date",
|
|
26212
|
+
boolean_type: "boolean",
|
|
26213
|
+
number_type: "number",
|
|
26214
|
+
json_type: "json",
|
|
26215
|
+
record_type: "json",
|
|
26216
|
+
sql_native_type: "sql_native",
|
|
26217
|
+
timestamp_type: "date",
|
|
26218
|
+
filter_expression_type: "filter"
|
|
26219
|
+
};
|
|
26220
|
+
const fieldKindMap = {
|
|
26221
|
+
view: "purple",
|
|
26222
|
+
dimension: "cyan",
|
|
26223
|
+
measure: "green",
|
|
26224
|
+
join: void 0
|
|
26225
|
+
};
|
|
26226
|
+
const relationshipMap = {
|
|
26227
|
+
many: "many_to_one",
|
|
26228
|
+
cross: "one_to_many",
|
|
26229
|
+
one: "one_to_one"
|
|
26230
|
+
};
|
|
26231
|
+
function FieldToken({
|
|
26232
|
+
field,
|
|
26233
|
+
hoverActions,
|
|
26234
|
+
hoverActionsVisible,
|
|
26235
|
+
...props2
|
|
26236
|
+
}) {
|
|
26237
|
+
let label = field.name;
|
|
26238
|
+
if (field.kind === "dimension" && (field.type.kind === "timestamp_type" || field.type.kind === "date_type")) {
|
|
26239
|
+
if (field.type.timeframe) {
|
|
26240
|
+
label += `.${field.type.timeframe}`;
|
|
26241
|
+
}
|
|
26242
|
+
}
|
|
26243
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
26244
|
+
...{
|
|
26245
|
+
0: {
|
|
26246
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly28fmrt mly1x0xcia"
|
|
26247
|
+
},
|
|
26248
|
+
1: {
|
|
26249
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mlym9y5t7"
|
|
26250
|
+
}
|
|
26251
|
+
}[!!hoverActionsVisible << 0],
|
|
26252
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(Token, {
|
|
26253
|
+
label,
|
|
26254
|
+
color: fieldKindToColor(field.kind),
|
|
26255
|
+
icon: fieldToIcon(field),
|
|
26256
|
+
...props2
|
|
26257
|
+
}), hoverActions && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
26258
|
+
...{
|
|
26259
|
+
className: "mly1vsucm1 mly2lah0s"
|
|
26260
|
+
},
|
|
26261
|
+
children: hoverActions
|
|
26262
|
+
})]
|
|
26263
|
+
});
|
|
26264
|
+
}
|
|
26163
26265
|
function DrillOperations({
|
|
26164
26266
|
drills
|
|
26165
26267
|
}) {
|
|
@@ -26177,9 +26279,8 @@ function DrillOperations({
|
|
|
26177
26279
|
children: drills.map((drill, key2) => /* @__PURE__ */ jsxRuntime.jsxs(TokenGroup, {
|
|
26178
26280
|
color: "cyan",
|
|
26179
26281
|
customStyle: localStyles.tokenGroup,
|
|
26180
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(
|
|
26181
|
-
|
|
26182
|
-
icon: "filter"
|
|
26282
|
+
children: [/* @__PURE__ */ jsxRuntime.jsx(FieldToken, {
|
|
26283
|
+
field: drill.filter.fieldReference.getFieldInfo()
|
|
26183
26284
|
}), /* @__PURE__ */ jsxRuntime.jsx(Token, {
|
|
26184
26285
|
label: "="
|
|
26185
26286
|
}), drill.filter instanceof QB.ASTFilterWithLiteralEquality ? /* @__PURE__ */ jsxRuntime.jsx(LiteralValue, {
|
|
@@ -30133,108 +30234,6 @@ function findUniqueFieldName(fields, rename, path = []) {
|
|
|
30133
30234
|
}
|
|
30134
30235
|
return `${rename} ${idx}`;
|
|
30135
30236
|
}
|
|
30136
|
-
const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
|
|
30137
|
-
const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
|
|
30138
|
-
const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
|
|
30139
|
-
function tagToRenderer(tag) {
|
|
30140
|
-
if (tag) {
|
|
30141
|
-
const tagProps = tag.getProperties();
|
|
30142
|
-
const tags = Object.keys(tagProps);
|
|
30143
|
-
for (const tag2 of tags) {
|
|
30144
|
-
if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
|
|
30145
|
-
return tag2;
|
|
30146
|
-
}
|
|
30147
|
-
}
|
|
30148
|
-
}
|
|
30149
|
-
return null;
|
|
30150
|
-
}
|
|
30151
|
-
function atomicTypeToIcon(type) {
|
|
30152
|
-
return atomicTypeMap[type];
|
|
30153
|
-
}
|
|
30154
|
-
function fieldKindToColor(kind) {
|
|
30155
|
-
return fieldKindMap[kind];
|
|
30156
|
-
}
|
|
30157
|
-
function fieldToIcon(field) {
|
|
30158
|
-
let icon;
|
|
30159
|
-
switch (field.kind) {
|
|
30160
|
-
case "view":
|
|
30161
|
-
icon = "query";
|
|
30162
|
-
break;
|
|
30163
|
-
case "dimension":
|
|
30164
|
-
case "measure":
|
|
30165
|
-
icon = atomicTypeToIcon(field.type.kind);
|
|
30166
|
-
break;
|
|
30167
|
-
case "join":
|
|
30168
|
-
icon = relationshipToIcon(field.relationship);
|
|
30169
|
-
break;
|
|
30170
|
-
}
|
|
30171
|
-
return icon;
|
|
30172
|
-
}
|
|
30173
|
-
function relationshipToIcon(relationship) {
|
|
30174
|
-
return relationshipMap[relationship];
|
|
30175
|
-
}
|
|
30176
|
-
function viewToVisualizationIcon(view) {
|
|
30177
|
-
const currentTag = view.getTag();
|
|
30178
|
-
const currentRenderer = tagToRenderer(currentTag) ?? "table";
|
|
30179
|
-
return `viz_${currentRenderer}`;
|
|
30180
|
-
}
|
|
30181
|
-
const atomicTypeMap = {
|
|
30182
|
-
array_type: "array",
|
|
30183
|
-
string_type: "string",
|
|
30184
|
-
date_type: "date",
|
|
30185
|
-
boolean_type: "boolean",
|
|
30186
|
-
number_type: "number",
|
|
30187
|
-
json_type: "json",
|
|
30188
|
-
record_type: "json",
|
|
30189
|
-
sql_native_type: "sql_native",
|
|
30190
|
-
timestamp_type: "date",
|
|
30191
|
-
filter_expression_type: "filter"
|
|
30192
|
-
};
|
|
30193
|
-
const fieldKindMap = {
|
|
30194
|
-
view: "purple",
|
|
30195
|
-
dimension: "cyan",
|
|
30196
|
-
measure: "green",
|
|
30197
|
-
join: void 0
|
|
30198
|
-
};
|
|
30199
|
-
const relationshipMap = {
|
|
30200
|
-
many: "many_to_one",
|
|
30201
|
-
cross: "one_to_many",
|
|
30202
|
-
one: "one_to_one"
|
|
30203
|
-
};
|
|
30204
|
-
function FieldToken({
|
|
30205
|
-
field,
|
|
30206
|
-
hoverActions,
|
|
30207
|
-
hoverActionsVisible,
|
|
30208
|
-
...props2
|
|
30209
|
-
}) {
|
|
30210
|
-
let label = field.name;
|
|
30211
|
-
if (field.kind === "dimension" && (field.type.kind === "timestamp_type" || field.type.kind === "date_type")) {
|
|
30212
|
-
if (field.type.timeframe) {
|
|
30213
|
-
label += `.${field.type.timeframe}`;
|
|
30214
|
-
}
|
|
30215
|
-
}
|
|
30216
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
30217
|
-
...{
|
|
30218
|
-
0: {
|
|
30219
|
-
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly28fmrt mly1x0xcia"
|
|
30220
|
-
},
|
|
30221
|
-
1: {
|
|
30222
|
-
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mlym9y5t7"
|
|
30223
|
-
}
|
|
30224
|
-
}[!!hoverActionsVisible << 0],
|
|
30225
|
-
children: [/* @__PURE__ */ jsxRuntime.jsx(Token, {
|
|
30226
|
-
label,
|
|
30227
|
-
color: fieldKindToColor(field.kind),
|
|
30228
|
-
icon: fieldToIcon(field),
|
|
30229
|
-
...props2
|
|
30230
|
-
}), hoverActions && /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
30231
|
-
...{
|
|
30232
|
-
className: "mly1vsucm1 mly2lah0s"
|
|
30233
|
-
},
|
|
30234
|
-
children: hoverActions
|
|
30235
|
-
})]
|
|
30236
|
-
});
|
|
30237
|
-
}
|
|
30238
30237
|
function BadgeForField({
|
|
30239
30238
|
field
|
|
30240
30239
|
}) {
|
|
@@ -31221,7 +31220,8 @@ function ValueList({
|
|
|
31221
31220
|
search,
|
|
31222
31221
|
fieldPath,
|
|
31223
31222
|
ref,
|
|
31224
|
-
customStyle
|
|
31223
|
+
customStyle,
|
|
31224
|
+
showPath = true
|
|
31225
31225
|
}) {
|
|
31226
31226
|
const {
|
|
31227
31227
|
searchResults
|
|
@@ -31237,12 +31237,12 @@ function ValueList({
|
|
|
31237
31237
|
onClick: () => onClick(value),
|
|
31238
31238
|
children: [/* @__PURE__ */ jsxRuntime.jsx(Value, {
|
|
31239
31239
|
value
|
|
31240
|
-
}), /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
31240
|
+
}), showPath ? /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
31241
31241
|
...{
|
|
31242
31242
|
className: "mly1jwwhvr"
|
|
31243
31243
|
},
|
|
31244
31244
|
children: value.fieldName
|
|
31245
|
-
})]
|
|
31245
|
+
}) : null]
|
|
31246
31246
|
}, value.fieldName + ":" + value.fieldValue)) : search ? /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
31247
31247
|
..._stylex.props(addMenuStyles.item),
|
|
31248
31248
|
"data-disabled": "true",
|
|
@@ -31436,7 +31436,8 @@ const StringFilterCore = ({
|
|
|
31436
31436
|
setSearchValue("");
|
|
31437
31437
|
}
|
|
31438
31438
|
},
|
|
31439
|
-
customStyle: styles$i.valueList
|
|
31439
|
+
customStyle: styles$i.valueList,
|
|
31440
|
+
showPath: false
|
|
31440
31441
|
})
|
|
31441
31442
|
})]
|
|
31442
31443
|
}) : currentFilter.operator === "~" ? /* @__PURE__ */ jsxRuntime.jsx(StringEditor, {
|