@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/esm/index.js
CHANGED
|
@@ -26142,6 +26142,108 @@ function LiteralValue({
|
|
|
26142
26142
|
});
|
|
26143
26143
|
}
|
|
26144
26144
|
}
|
|
26145
|
+
const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
|
|
26146
|
+
const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
|
|
26147
|
+
const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
|
|
26148
|
+
function tagToRenderer(tag) {
|
|
26149
|
+
if (tag) {
|
|
26150
|
+
const tagProps = tag.getProperties();
|
|
26151
|
+
const tags = Object.keys(tagProps);
|
|
26152
|
+
for (const tag2 of tags) {
|
|
26153
|
+
if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
|
|
26154
|
+
return tag2;
|
|
26155
|
+
}
|
|
26156
|
+
}
|
|
26157
|
+
}
|
|
26158
|
+
return null;
|
|
26159
|
+
}
|
|
26160
|
+
function atomicTypeToIcon(type) {
|
|
26161
|
+
return atomicTypeMap[type];
|
|
26162
|
+
}
|
|
26163
|
+
function fieldKindToColor(kind) {
|
|
26164
|
+
return fieldKindMap[kind];
|
|
26165
|
+
}
|
|
26166
|
+
function fieldToIcon(field) {
|
|
26167
|
+
let icon;
|
|
26168
|
+
switch (field.kind) {
|
|
26169
|
+
case "view":
|
|
26170
|
+
icon = "query";
|
|
26171
|
+
break;
|
|
26172
|
+
case "dimension":
|
|
26173
|
+
case "measure":
|
|
26174
|
+
icon = atomicTypeToIcon(field.type.kind);
|
|
26175
|
+
break;
|
|
26176
|
+
case "join":
|
|
26177
|
+
icon = relationshipToIcon(field.relationship);
|
|
26178
|
+
break;
|
|
26179
|
+
}
|
|
26180
|
+
return icon;
|
|
26181
|
+
}
|
|
26182
|
+
function relationshipToIcon(relationship) {
|
|
26183
|
+
return relationshipMap[relationship];
|
|
26184
|
+
}
|
|
26185
|
+
function viewToVisualizationIcon(view) {
|
|
26186
|
+
const currentTag = view.getTag();
|
|
26187
|
+
const currentRenderer = tagToRenderer(currentTag) ?? "table";
|
|
26188
|
+
return `viz_${currentRenderer}`;
|
|
26189
|
+
}
|
|
26190
|
+
const atomicTypeMap = {
|
|
26191
|
+
array_type: "array",
|
|
26192
|
+
string_type: "string",
|
|
26193
|
+
date_type: "date",
|
|
26194
|
+
boolean_type: "boolean",
|
|
26195
|
+
number_type: "number",
|
|
26196
|
+
json_type: "json",
|
|
26197
|
+
record_type: "json",
|
|
26198
|
+
sql_native_type: "sql_native",
|
|
26199
|
+
timestamp_type: "date",
|
|
26200
|
+
filter_expression_type: "filter"
|
|
26201
|
+
};
|
|
26202
|
+
const fieldKindMap = {
|
|
26203
|
+
view: "purple",
|
|
26204
|
+
dimension: "cyan",
|
|
26205
|
+
measure: "green",
|
|
26206
|
+
join: void 0
|
|
26207
|
+
};
|
|
26208
|
+
const relationshipMap = {
|
|
26209
|
+
many: "many_to_one",
|
|
26210
|
+
cross: "one_to_many",
|
|
26211
|
+
one: "one_to_one"
|
|
26212
|
+
};
|
|
26213
|
+
function FieldToken({
|
|
26214
|
+
field,
|
|
26215
|
+
hoverActions,
|
|
26216
|
+
hoverActionsVisible,
|
|
26217
|
+
...props2
|
|
26218
|
+
}) {
|
|
26219
|
+
let label = field.name;
|
|
26220
|
+
if (field.kind === "dimension" && (field.type.kind === "timestamp_type" || field.type.kind === "date_type")) {
|
|
26221
|
+
if (field.type.timeframe) {
|
|
26222
|
+
label += `.${field.type.timeframe}`;
|
|
26223
|
+
}
|
|
26224
|
+
}
|
|
26225
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26226
|
+
...{
|
|
26227
|
+
0: {
|
|
26228
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly28fmrt mly1x0xcia"
|
|
26229
|
+
},
|
|
26230
|
+
1: {
|
|
26231
|
+
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mlym9y5t7"
|
|
26232
|
+
}
|
|
26233
|
+
}[!!hoverActionsVisible << 0],
|
|
26234
|
+
children: [/* @__PURE__ */ jsx(Token, {
|
|
26235
|
+
label,
|
|
26236
|
+
color: fieldKindToColor(field.kind),
|
|
26237
|
+
icon: fieldToIcon(field),
|
|
26238
|
+
...props2
|
|
26239
|
+
}), hoverActions && /* @__PURE__ */ jsx("div", {
|
|
26240
|
+
...{
|
|
26241
|
+
className: "mly1vsucm1 mly2lah0s"
|
|
26242
|
+
},
|
|
26243
|
+
children: hoverActions
|
|
26244
|
+
})]
|
|
26245
|
+
});
|
|
26246
|
+
}
|
|
26145
26247
|
function DrillOperations({
|
|
26146
26248
|
drills
|
|
26147
26249
|
}) {
|
|
@@ -26159,9 +26261,8 @@ function DrillOperations({
|
|
|
26159
26261
|
children: drills.map((drill, key2) => /* @__PURE__ */ jsxs(TokenGroup, {
|
|
26160
26262
|
color: "cyan",
|
|
26161
26263
|
customStyle: localStyles.tokenGroup,
|
|
26162
|
-
children: [/* @__PURE__ */ jsx(
|
|
26163
|
-
|
|
26164
|
-
icon: "filter"
|
|
26264
|
+
children: [/* @__PURE__ */ jsx(FieldToken, {
|
|
26265
|
+
field: drill.filter.fieldReference.getFieldInfo()
|
|
26165
26266
|
}), /* @__PURE__ */ jsx(Token, {
|
|
26166
26267
|
label: "="
|
|
26167
26268
|
}), drill.filter instanceof ASTFilterWithLiteralEquality ? /* @__PURE__ */ jsx(LiteralValue, {
|
|
@@ -30115,108 +30216,6 @@ function findUniqueFieldName(fields, rename, path = []) {
|
|
|
30115
30216
|
}
|
|
30116
30217
|
return `${rename} ${idx}`;
|
|
30117
30218
|
}
|
|
30118
|
-
const QUERY_RENDERERS = ["table", "bar_chart", "dashboard", "json", "line_chart", "list", "list_detail", "point_map", "scatter_chart", "segment_map", "shape_map", "sparkline"];
|
|
30119
|
-
const ATOMIC_RENDERERS = ["number", "boolean", "currency", "image", "url", "percent", "text", "time"];
|
|
30120
|
-
const RENDERERS = [...QUERY_RENDERERS, ...ATOMIC_RENDERERS];
|
|
30121
|
-
function tagToRenderer(tag) {
|
|
30122
|
-
if (tag) {
|
|
30123
|
-
const tagProps = tag.getProperties();
|
|
30124
|
-
const tags = Object.keys(tagProps);
|
|
30125
|
-
for (const tag2 of tags) {
|
|
30126
|
-
if (RENDERERS.includes(tag2) && !tagProps[tag2].deleted) {
|
|
30127
|
-
return tag2;
|
|
30128
|
-
}
|
|
30129
|
-
}
|
|
30130
|
-
}
|
|
30131
|
-
return null;
|
|
30132
|
-
}
|
|
30133
|
-
function atomicTypeToIcon(type) {
|
|
30134
|
-
return atomicTypeMap[type];
|
|
30135
|
-
}
|
|
30136
|
-
function fieldKindToColor(kind) {
|
|
30137
|
-
return fieldKindMap[kind];
|
|
30138
|
-
}
|
|
30139
|
-
function fieldToIcon(field) {
|
|
30140
|
-
let icon;
|
|
30141
|
-
switch (field.kind) {
|
|
30142
|
-
case "view":
|
|
30143
|
-
icon = "query";
|
|
30144
|
-
break;
|
|
30145
|
-
case "dimension":
|
|
30146
|
-
case "measure":
|
|
30147
|
-
icon = atomicTypeToIcon(field.type.kind);
|
|
30148
|
-
break;
|
|
30149
|
-
case "join":
|
|
30150
|
-
icon = relationshipToIcon(field.relationship);
|
|
30151
|
-
break;
|
|
30152
|
-
}
|
|
30153
|
-
return icon;
|
|
30154
|
-
}
|
|
30155
|
-
function relationshipToIcon(relationship) {
|
|
30156
|
-
return relationshipMap[relationship];
|
|
30157
|
-
}
|
|
30158
|
-
function viewToVisualizationIcon(view) {
|
|
30159
|
-
const currentTag = view.getTag();
|
|
30160
|
-
const currentRenderer = tagToRenderer(currentTag) ?? "table";
|
|
30161
|
-
return `viz_${currentRenderer}`;
|
|
30162
|
-
}
|
|
30163
|
-
const atomicTypeMap = {
|
|
30164
|
-
array_type: "array",
|
|
30165
|
-
string_type: "string",
|
|
30166
|
-
date_type: "date",
|
|
30167
|
-
boolean_type: "boolean",
|
|
30168
|
-
number_type: "number",
|
|
30169
|
-
json_type: "json",
|
|
30170
|
-
record_type: "json",
|
|
30171
|
-
sql_native_type: "sql_native",
|
|
30172
|
-
timestamp_type: "date",
|
|
30173
|
-
filter_expression_type: "filter"
|
|
30174
|
-
};
|
|
30175
|
-
const fieldKindMap = {
|
|
30176
|
-
view: "purple",
|
|
30177
|
-
dimension: "cyan",
|
|
30178
|
-
measure: "green",
|
|
30179
|
-
join: void 0
|
|
30180
|
-
};
|
|
30181
|
-
const relationshipMap = {
|
|
30182
|
-
many: "many_to_one",
|
|
30183
|
-
cross: "one_to_many",
|
|
30184
|
-
one: "one_to_one"
|
|
30185
|
-
};
|
|
30186
|
-
function FieldToken({
|
|
30187
|
-
field,
|
|
30188
|
-
hoverActions,
|
|
30189
|
-
hoverActionsVisible,
|
|
30190
|
-
...props2
|
|
30191
|
-
}) {
|
|
30192
|
-
let label = field.name;
|
|
30193
|
-
if (field.kind === "dimension" && (field.type.kind === "timestamp_type" || field.type.kind === "date_type")) {
|
|
30194
|
-
if (field.type.timeframe) {
|
|
30195
|
-
label += `.${field.type.timeframe}`;
|
|
30196
|
-
}
|
|
30197
|
-
}
|
|
30198
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
30199
|
-
...{
|
|
30200
|
-
0: {
|
|
30201
|
-
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mly28fmrt mly1x0xcia"
|
|
30202
|
-
},
|
|
30203
|
-
1: {
|
|
30204
|
-
className: "mly78zum5 mly6s0dn4 mly1nhvcw1 mly1jnr06f mlym9y5t7"
|
|
30205
|
-
}
|
|
30206
|
-
}[!!hoverActionsVisible << 0],
|
|
30207
|
-
children: [/* @__PURE__ */ jsx(Token, {
|
|
30208
|
-
label,
|
|
30209
|
-
color: fieldKindToColor(field.kind),
|
|
30210
|
-
icon: fieldToIcon(field),
|
|
30211
|
-
...props2
|
|
30212
|
-
}), hoverActions && /* @__PURE__ */ jsx("div", {
|
|
30213
|
-
...{
|
|
30214
|
-
className: "mly1vsucm1 mly2lah0s"
|
|
30215
|
-
},
|
|
30216
|
-
children: hoverActions
|
|
30217
|
-
})]
|
|
30218
|
-
});
|
|
30219
|
-
}
|
|
30220
30219
|
function BadgeForField({
|
|
30221
30220
|
field
|
|
30222
30221
|
}) {
|
|
@@ -31203,7 +31202,8 @@ function ValueList({
|
|
|
31203
31202
|
search,
|
|
31204
31203
|
fieldPath,
|
|
31205
31204
|
ref,
|
|
31206
|
-
customStyle
|
|
31205
|
+
customStyle,
|
|
31206
|
+
showPath = true
|
|
31207
31207
|
}) {
|
|
31208
31208
|
const {
|
|
31209
31209
|
searchResults
|
|
@@ -31219,12 +31219,12 @@ function ValueList({
|
|
|
31219
31219
|
onClick: () => onClick(value),
|
|
31220
31220
|
children: [/* @__PURE__ */ jsx(Value, {
|
|
31221
31221
|
value
|
|
31222
|
-
}), /* @__PURE__ */ jsx("div", {
|
|
31222
|
+
}), showPath ? /* @__PURE__ */ jsx("div", {
|
|
31223
31223
|
...{
|
|
31224
31224
|
className: "mly1jwwhvr"
|
|
31225
31225
|
},
|
|
31226
31226
|
children: value.fieldName
|
|
31227
|
-
})]
|
|
31227
|
+
}) : null]
|
|
31228
31228
|
}, value.fieldName + ":" + value.fieldValue)) : search ? /* @__PURE__ */ jsx("div", {
|
|
31229
31229
|
..._stylex.props(addMenuStyles.item),
|
|
31230
31230
|
"data-disabled": "true",
|
|
@@ -31418,7 +31418,8 @@ const StringFilterCore = ({
|
|
|
31418
31418
|
setSearchValue("");
|
|
31419
31419
|
}
|
|
31420
31420
|
},
|
|
31421
|
-
customStyle: styles$i.valueList
|
|
31421
|
+
customStyle: styles$i.valueList,
|
|
31422
|
+
showPath: false
|
|
31422
31423
|
})
|
|
31423
31424
|
})]
|
|
31424
31425
|
}) : currentFilter.operator === "~" ? /* @__PURE__ */ jsx(StringEditor, {
|