@cubejs-client/playground 0.29.26 → 0.29.42
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/CHANGELOG.md +46 -0
- package/build/asset-manifest.json +11 -10
- package/build/index.html +1 -1
- package/build/static/js/{2.2048bb82.chunk.js → 2.423113bb.chunk.js} +2 -2
- package/build/static/js/{2.2048bb82.chunk.js.LICENSE.txt → 2.423113bb.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{3.c5c09f3d.chunk.js → 3.d6210325.chunk.js} +2 -2
- package/build/static/js/{3.c5c09f3d.chunk.js.LICENSE.txt → 3.d6210325.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{4.c0ac086b.chunk.js → 4.2d19fca1.chunk.js} +1 -1
- package/build/static/js/main.a986e072.chunk.js +1 -0
- package/build/static/js/runtime-main.0bebce59.js +1 -0
- package/build/static/media/questdb.c7cab014.svg +53 -0
- package/lib/.tsbuildinfo +1 -1
- package/lib/{GraphiQLSandbox-81c8867c.js → GraphiQLSandbox-bf955426.js} +3 -3
- package/lib/{GraphiQLSandbox-81c8867c.js.map → GraphiQLSandbox-bf955426.js.map} +1 -1
- package/lib/components/RollupDesigner/Context.d.ts +4 -3
- package/lib/components/RollupDesigner/RollupDesigner.d.ts +2 -1
- package/lib/components/RollupDesigner/components/RollupDesignerModal.d.ts +1 -0
- package/lib/hooks/deep-effect.d.ts +1 -1
- package/lib/hooks/deep-memo.d.ts +1 -1
- package/lib/hooks/index.d.ts +11 -8
- package/lib/hooks/window-size.d.ts +6 -0
- package/lib/{index-0fc6ccb8.js → index-8c4dbf47.js} +228 -102
- package/lib/index-8c4dbf47.js.map +1 -0
- package/lib/index.js +2 -2
- package/package.json +4 -4
- package/build/static/js/main.2f493cae.chunk.js +0 -1
- package/build/static/js/runtime-main.fa2c5803.js +0 -1
- package/lib/index-0fc6ccb8.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import React, { createContext, useState, useContext,
|
|
2
|
+
import React, { createContext, useState, useContext, useCallback, useMemo, useRef, useEffect, Component, useLayoutEffect, lazy, Suspense, Fragment as Fragment$1, memo } from 'react';
|
|
3
3
|
import equals from 'fast-deep-equal';
|
|
4
4
|
import { BrowserRouter, Redirect, withRouter } from 'react-router-dom';
|
|
5
5
|
import styled, { createGlobalStyle, ThemeProvider, css } from 'styled-components';
|
|
@@ -226,16 +226,30 @@ var GlobalStyles = createGlobalStyle(templateObject_1$w || (templateObject_1$w =
|
|
|
226
226
|
.join('\n '));
|
|
227
227
|
var templateObject_1$w;
|
|
228
228
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
229
|
+
var AppContext = createContext({});
|
|
230
|
+
function AppContextProvider(_a) {
|
|
231
|
+
var children = _a.children, contextProps = __rest(_a, ["children"]);
|
|
232
|
+
var _b = useState(contextProps || null), context = _b[0], setContextState = _b[1];
|
|
233
|
+
var setContext = useCallback(function (context) {
|
|
234
|
+
setContextState(function (currentContext) { return (__assign(__assign(__assign({}, currentContext), context), { playgroundContext: __assign(__assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.playgroundContext), context === null || context === void 0 ? void 0 : context.playgroundContext) })); });
|
|
235
|
+
}, []);
|
|
236
|
+
return (jsx(AppContext.Provider, __assign({ value: __assign(__assign({ apiUrl: null, schemaVersion: 0, ready: false }, context), { token: (context === null || context === void 0 ? void 0 : context.token) || null, playgroundContext: (context === null || context === void 0 ? void 0 : context.playgroundContext) || {}, setContext: setContext }) }, { children: children }), void 0));
|
|
235
237
|
}
|
|
236
238
|
|
|
237
|
-
function
|
|
238
|
-
return useContext(
|
|
239
|
+
function useAppContext() {
|
|
240
|
+
return useContext(AppContext);
|
|
241
|
+
}
|
|
242
|
+
function usePlaygroundContext() {
|
|
243
|
+
var playgroundContext = useAppContext().playgroundContext;
|
|
244
|
+
return playgroundContext;
|
|
245
|
+
}
|
|
246
|
+
function useIsCloud() {
|
|
247
|
+
var playgroundContext = useAppContext().playgroundContext;
|
|
248
|
+
return (playgroundContext === null || playgroundContext === void 0 ? void 0 : playgroundContext.isCloud) || false;
|
|
249
|
+
}
|
|
250
|
+
function useToken() {
|
|
251
|
+
var token = useAppContext().token;
|
|
252
|
+
return token;
|
|
239
253
|
}
|
|
240
254
|
|
|
241
255
|
function useCubejsApi(apiUrl, token) {
|
|
@@ -249,6 +263,48 @@ function useCubejsApi(apiUrl, token) {
|
|
|
249
263
|
}, [apiUrl, token]);
|
|
250
264
|
}
|
|
251
265
|
|
|
266
|
+
function useDeepCompareMemoize(value) {
|
|
267
|
+
var ref = useRef([]);
|
|
268
|
+
if (!equals(value, ref.current)) {
|
|
269
|
+
ref.current = value;
|
|
270
|
+
}
|
|
271
|
+
return ref.current;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
function useDeepDependencies(dependencies) {
|
|
275
|
+
var memo = useRef();
|
|
276
|
+
if (!equals(memo.current, dependencies)) {
|
|
277
|
+
memo.current = dependencies;
|
|
278
|
+
}
|
|
279
|
+
return memo.current;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function useDeepEffect(callback, dependencies) {
|
|
283
|
+
var memoizedDependencies = useDeepDependencies(dependencies);
|
|
284
|
+
return useEffect(callback, memoizedDependencies);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
function useDeepMemo(callback, dependencies) {
|
|
288
|
+
var memoizedDependencies = useDeepDependencies(dependencies);
|
|
289
|
+
return useMemo(callback, memoizedDependencies);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
function useIdentifier() {
|
|
293
|
+
var identifier = useAppContext().identifier;
|
|
294
|
+
return identifier || '';
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function useIsMounted() {
|
|
298
|
+
var isMountedRef = useRef(true);
|
|
299
|
+
var isMounted = useCallback(function () { return isMountedRef.current; }, []);
|
|
300
|
+
useEffect(function () {
|
|
301
|
+
return function () {
|
|
302
|
+
isMountedRef.current = false;
|
|
303
|
+
};
|
|
304
|
+
}, []);
|
|
305
|
+
return isMounted;
|
|
306
|
+
}
|
|
307
|
+
|
|
252
308
|
function getNameMemberPairs(members) {
|
|
253
309
|
var items = [];
|
|
254
310
|
members.forEach(function (cube) {
|
|
@@ -315,37 +371,6 @@ function useLivePreviewContext() {
|
|
|
315
371
|
return useContext(LivePreviewContextContext);
|
|
316
372
|
}
|
|
317
373
|
|
|
318
|
-
var AppContext = createContext({});
|
|
319
|
-
function AppContextProvider(_a) {
|
|
320
|
-
var children = _a.children, contextProps = __rest(_a, ["children"]);
|
|
321
|
-
var _b = useState(contextProps || null), context = _b[0], setContextState = _b[1];
|
|
322
|
-
var setContext = useCallback(function (context) {
|
|
323
|
-
setContextState(function (currentContext) { return (__assign(__assign(__assign({}, currentContext), context), { playgroundContext: __assign(__assign({}, currentContext === null || currentContext === void 0 ? void 0 : currentContext.playgroundContext), context === null || context === void 0 ? void 0 : context.playgroundContext) })); });
|
|
324
|
-
}, []);
|
|
325
|
-
return (jsx(AppContext.Provider, __assign({ value: __assign(__assign({ apiUrl: null, schemaVersion: 0, ready: false }, context), { token: (context === null || context === void 0 ? void 0 : context.token) || null, playgroundContext: (context === null || context === void 0 ? void 0 : context.playgroundContext) || {}, setContext: setContext }) }, { children: children }), void 0));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
function useAppContext() {
|
|
329
|
-
return useContext(AppContext);
|
|
330
|
-
}
|
|
331
|
-
function usePlaygroundContext() {
|
|
332
|
-
var playgroundContext = useAppContext().playgroundContext;
|
|
333
|
-
return playgroundContext;
|
|
334
|
-
}
|
|
335
|
-
function useIsCloud() {
|
|
336
|
-
var playgroundContext = useAppContext().playgroundContext;
|
|
337
|
-
return (playgroundContext === null || playgroundContext === void 0 ? void 0 : playgroundContext.isCloud) || false;
|
|
338
|
-
}
|
|
339
|
-
function useToken() {
|
|
340
|
-
var token = useAppContext().token;
|
|
341
|
-
return token;
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
function useIdentifier() {
|
|
345
|
-
var identifier = useAppContext().identifier;
|
|
346
|
-
return identifier || '';
|
|
347
|
-
}
|
|
348
|
-
|
|
349
374
|
var storage = new (/** @class */ (function () {
|
|
350
375
|
function Storage() {
|
|
351
376
|
var _this = this;
|
|
@@ -429,39 +454,8 @@ function useLocalStorage(itemKey, defaultValue) {
|
|
|
429
454
|
}, [key, value]);
|
|
430
455
|
}
|
|
431
456
|
|
|
432
|
-
function
|
|
433
|
-
|
|
434
|
-
var isMounted = useCallback(function () { return isMountedRef.current; }, []);
|
|
435
|
-
useEffect(function () {
|
|
436
|
-
return function () {
|
|
437
|
-
isMountedRef.current = false;
|
|
438
|
-
};
|
|
439
|
-
}, []);
|
|
440
|
-
return isMounted;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
function useDeepDependencies(dependencies) {
|
|
444
|
-
var memo = useRef();
|
|
445
|
-
if (!equals(memo.current, dependencies)) {
|
|
446
|
-
memo.current = dependencies;
|
|
447
|
-
}
|
|
448
|
-
return memo.current;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
function useDeepEffect(callback, dependencies) {
|
|
452
|
-
var memoizedDependencies = useDeepDependencies(dependencies);
|
|
453
|
-
return useEffect(callback, memoizedDependencies);
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
function useDeepMemo(callback, dependencies) {
|
|
457
|
-
var memoizedDependencies = useDeepDependencies(dependencies);
|
|
458
|
-
return useMemo(callback, memoizedDependencies);
|
|
459
|
-
}
|
|
460
|
-
|
|
461
|
-
function useToggle(defaultValue) {
|
|
462
|
-
if (defaultValue === void 0) { defaultValue = false; }
|
|
463
|
-
var _a = useState(defaultValue), isOn = _a[0], toggle = _a[1];
|
|
464
|
-
return [isOn, function () { return toggle(function (value) { return !value; }); }];
|
|
457
|
+
function useSecurityContext() {
|
|
458
|
+
return useContext(SecurityContextContext);
|
|
465
459
|
}
|
|
466
460
|
|
|
467
461
|
function useServerCoreVersionGte(version) {
|
|
@@ -480,6 +474,48 @@ function useServerCoreVersionGte(version) {
|
|
|
480
474
|
return gt;
|
|
481
475
|
}
|
|
482
476
|
|
|
477
|
+
function useSetter(setter, initialValue) {
|
|
478
|
+
var _a = useState(setter(initialValue)), state = _a[0], setValue = _a[1];
|
|
479
|
+
return [
|
|
480
|
+
state,
|
|
481
|
+
function (value) {
|
|
482
|
+
setValue(setter(state, value));
|
|
483
|
+
},
|
|
484
|
+
];
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function useToggle(defaultValue) {
|
|
488
|
+
if (defaultValue === void 0) { defaultValue = false; }
|
|
489
|
+
var _a = useState(defaultValue), isOn = _a[0], toggle = _a[1];
|
|
490
|
+
return [isOn, function () { return toggle(function (value) { return !value; }); }];
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
function useWindowSize() {
|
|
494
|
+
// Initialize state with undefined width/height so server and client renders match
|
|
495
|
+
// Learn more here: https://joshwcomeau.com/react/the-perils-of-rehydration/
|
|
496
|
+
var _a = useState({
|
|
497
|
+
width: undefined,
|
|
498
|
+
height: undefined,
|
|
499
|
+
}), windowSize = _a[0], setWindowSize = _a[1];
|
|
500
|
+
useEffect(function () {
|
|
501
|
+
// Handler to call on window resize
|
|
502
|
+
function handleResize() {
|
|
503
|
+
// Set window width/height to state
|
|
504
|
+
setWindowSize({
|
|
505
|
+
width: window.innerWidth,
|
|
506
|
+
height: window.innerHeight,
|
|
507
|
+
});
|
|
508
|
+
}
|
|
509
|
+
// Add event listener
|
|
510
|
+
window.addEventListener('resize', handleResize);
|
|
511
|
+
// Call handler right away so state gets updated with initial window size
|
|
512
|
+
handleResize();
|
|
513
|
+
// Remove event listener on cleanup
|
|
514
|
+
return function () { return window.removeEventListener('resize', handleResize); };
|
|
515
|
+
}, []); // Empty array ensures that effect is only run on mount
|
|
516
|
+
return windowSize;
|
|
517
|
+
}
|
|
518
|
+
|
|
483
519
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
484
520
|
|
|
485
521
|
var pretty = function(jsObject, indentLength, outputTo, fullFunction) {
|
|
@@ -4311,7 +4347,7 @@ var Link = Typography.Link;
|
|
|
4311
4347
|
function RollupDesignerModal(_a) {
|
|
4312
4348
|
var onAfterClose = _a.onAfterClose, props = __rest(_a, ["onAfterClose"]);
|
|
4313
4349
|
var _b = useRollupDesignerContext(), isModalOpen = _b.isModalOpen, toggleModal = _b.toggleModal, memberTypeCubeMap = _b.memberTypeCubeMap;
|
|
4314
|
-
return (jsx(Modal, __assign({ title: "Rollup Designer", visible: isModalOpen, bodyStyle: { padding: 0 }, destroyOnClose: true, wrapClassName: "rollup-designer", footer: jsx(Link, __assign({ href: "https://cube.dev/docs/caching/pre-aggregations/getting-started", target: "_blank" }, { children: jsxs(Flex, __assign({ justifyContent: "center", gap: 1 }, { children: [jsx(Box, { children: jsx(InfoCircleOutlined, {}, void 0) }, void 0), jsx(Box, { children: "Further reading about pre-aggregations for reference." }, void 0), jsx(Box, { children: jsx(ArrowRightOutlined, {}, void 0) }, void 0)] }), void 0) }), void 0), width: 1190, afterClose: onAfterClose, onCancel: function () { return toggleModal(); } }, { children: jsx("div", __assign({ "data-testid": "rd-modal" }, { children: jsx(RollupDesigner, { apiUrl: props.apiUrl, memberTypeCubeMap: memberTypeCubeMap }, void 0) }), void 0) }), void 0));
|
|
4350
|
+
return (jsx(Modal, __assign({ title: "Rollup Designer", visible: isModalOpen, bodyStyle: { padding: 0 }, destroyOnClose: true, wrapClassName: "rollup-designer", footer: jsx(Link, __assign({ href: "https://cube.dev/docs/caching/pre-aggregations/getting-started", target: "_blank" }, { children: jsxs(Flex, __assign({ justifyContent: "center", gap: 1 }, { children: [jsx(Box, { children: jsx(InfoCircleOutlined, {}, void 0) }, void 0), jsx(Box, { children: "Further reading about pre-aggregations for reference." }, void 0), jsx(Box, { children: jsx(ArrowRightOutlined, {}, void 0) }, void 0)] }), void 0) }), void 0), width: 1190, afterClose: onAfterClose, onCancel: function () { return toggleModal(); } }, { children: jsx("div", __assign({ "data-testid": "rd-modal" }, { children: jsx(RollupDesigner, { apiUrl: props.apiUrl, token: props.token, memberTypeCubeMap: memberTypeCubeMap }, void 0) }), void 0) }), void 0));
|
|
4315
4351
|
}
|
|
4316
4352
|
|
|
4317
4353
|
var Context = createContext({});
|
|
@@ -4371,13 +4407,13 @@ function RollupDesignerContext(_a) {
|
|
|
4371
4407
|
setTransformedQuery: setTransformedQuery,
|
|
4372
4408
|
memberTypeCubeMap: memberTypeCubeMap,
|
|
4373
4409
|
error: error,
|
|
4374
|
-
} }, { children: [children, jsx(RollupDesignerModal, { apiUrl: props.apiUrl, onAfterClose: reset }, void 0)] }), void 0));
|
|
4410
|
+
} }, { children: [children, jsx(RollupDesignerModal, { apiUrl: props.apiUrl, token: props.token, onAfterClose: reset }, void 0)] }), void 0));
|
|
4375
4411
|
}
|
|
4376
4412
|
function useRollupDesignerContext() {
|
|
4377
4413
|
return useContext(Context);
|
|
4378
4414
|
}
|
|
4379
4415
|
|
|
4380
|
-
var Paragraph = Typography.Paragraph
|
|
4416
|
+
var Paragraph = Typography.Paragraph, Text$1 = Typography.Text;
|
|
4381
4417
|
var TabPane = Tabs.TabPane;
|
|
4382
4418
|
var Wrapper$2 = styled.div(templateObject_1$f || (templateObject_1$f = __makeTemplateObject(["\n display: grid;\n grid-template-columns: 1fr 400px;\n gap: 16px;\n"], ["\n display: grid;\n grid-template-columns: 1fr 400px;\n gap: 16px;\n"])));
|
|
4383
4419
|
var MainBox = styled(Box)(templateObject_2$5 || (templateObject_2$5 = __makeTemplateObject(["\n & .ant-tabs-nav {\n padding-left: 24px;\n margin: 0;\n }\n"], ["\n & .ant-tabs-nav {\n padding-left: 24px;\n margin: 0;\n }\n"])));
|
|
@@ -4400,25 +4436,27 @@ function getSelectedKeys(references) {
|
|
|
4400
4436
|
}
|
|
4401
4437
|
function RollupDesigner(_a) {
|
|
4402
4438
|
var _b, _c;
|
|
4403
|
-
var apiUrl = _a.apiUrl, memberTypeCubeMap = _a.memberTypeCubeMap;
|
|
4439
|
+
var apiUrl = _a.apiUrl, memberTypeCubeMap = _a.memberTypeCubeMap, designerToken = _a.token;
|
|
4404
4440
|
var isMounted = useIsMounted();
|
|
4405
|
-
var
|
|
4441
|
+
var appToken = useToken();
|
|
4442
|
+
var token = appToken || designerToken;
|
|
4406
4443
|
var _d = useCloud(), isCloud = _d.isCloud, cloud = __rest(_d, ["isCloud"]);
|
|
4407
4444
|
var _e = useRollupDesignerContext(), query = _e.query, transformedQuery = _e.transformedQuery, isLoading = _e.isLoading, error = _e.error;
|
|
4408
4445
|
var _f = useState(true), isCronValid = _f[0], setCronValidity = _f[1];
|
|
4409
4446
|
var _g = useState({}), settings = _g[0], setSettings = _g[1];
|
|
4410
4447
|
var _h = useState([]), openKeys = _h[0], setOpenKeys = _h[1];
|
|
4411
4448
|
var _j = useState(null), firstOpenCubeName = _j[0], setFirstOpenCubeName = _j[1];
|
|
4412
|
-
Boolean(transformedQuery === null || transformedQuery === void 0 ? void 0 : transformedQuery.leafMeasureAdditive);
|
|
4413
4449
|
var _k = useState(true), matching = _k[0], setMatching = _k[1];
|
|
4414
4450
|
var _l = useState(false), saving = _l[0], setSaving = _l[1];
|
|
4415
4451
|
var _m = useState('main'), preAggName = _m[0], setPreAggName = _m[1];
|
|
4416
|
-
var _o =
|
|
4452
|
+
var _o = useState(null), nonAdditiveMeasure = _o[0], setNonAdditiveMeasure = _o[1];
|
|
4453
|
+
var _p = query || {}; _p.order; _p.limit; _p.filters; var matchedQuery = __rest(_p, ["order", "limit", "filters"]);
|
|
4417
4454
|
var timeDimension = (matchedQuery.timeDimensions || [])[0];
|
|
4418
4455
|
// There's nothing we can do to for a rollup to match such query
|
|
4419
|
-
var hideMatchRollupButton = (timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.dimension) &&
|
|
4456
|
+
var hideMatchRollupButton = ((timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.dimension) &&
|
|
4420
4457
|
!(timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.dateRange) &&
|
|
4421
|
-
!(timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.granularity)
|
|
4458
|
+
!(timeDimension === null || timeDimension === void 0 ? void 0 : timeDimension.granularity)) ||
|
|
4459
|
+
(transformedQuery && !transformedQuery.leafMeasureAdditive);
|
|
4422
4460
|
var segments = new Set();
|
|
4423
4461
|
memberTypeCubeMap.segments.forEach(function (_a) {
|
|
4424
4462
|
var members = _a.members;
|
|
@@ -4427,13 +4465,22 @@ function RollupDesigner(_a) {
|
|
|
4427
4465
|
return segments.add(name);
|
|
4428
4466
|
});
|
|
4429
4467
|
});
|
|
4430
|
-
var
|
|
4468
|
+
var _q = useState(getPreAggregationReferences(transformedQuery, segments)), references = _q[0], setReferences = _q[1];
|
|
4431
4469
|
useDeepEffect(function () {
|
|
4432
4470
|
var references = getPreAggregationReferences(transformedQuery, segments);
|
|
4433
4471
|
setReferences(references);
|
|
4434
4472
|
var openKeys = getSelectedKeys(references).map(function (key) { return key.split('.')[0]; });
|
|
4435
4473
|
setOpenKeys(openKeys);
|
|
4436
4474
|
setFirstOpenCubeName(openKeys[0] || null);
|
|
4475
|
+
if ((transformedQuery === null || transformedQuery === void 0 ? void 0 : transformedQuery.measureToLeafMeasures) != null) {
|
|
4476
|
+
for (var _i = 0, _a = Object.entries(transformedQuery.measureToLeafMeasures); _i < _a.length; _i++) {
|
|
4477
|
+
var _b = _a[_i], measure = _b[0], leafMeasures = _b[1];
|
|
4478
|
+
if (leafMeasures.length > 1) {
|
|
4479
|
+
setNonAdditiveMeasure(measure);
|
|
4480
|
+
break;
|
|
4481
|
+
}
|
|
4482
|
+
}
|
|
4483
|
+
}
|
|
4437
4484
|
}, [transformedQuery, segments]);
|
|
4438
4485
|
var selectedKeys = useDeepMemo(function () {
|
|
4439
4486
|
var selectedKeys = getSelectedKeys(references);
|
|
@@ -4486,6 +4533,43 @@ function RollupDesigner(_a) {
|
|
|
4486
4533
|
}
|
|
4487
4534
|
return cubeName;
|
|
4488
4535
|
}, [transformedQuery, references]);
|
|
4536
|
+
var _r = useDeepMemo(function () {
|
|
4537
|
+
var _a;
|
|
4538
|
+
var _b = (transformedQuery || {}).measureToLeafMeasures, measureToLeafMeasures = _b === void 0 ? {} : _b;
|
|
4539
|
+
var showDecomposedMeasureAlert = false;
|
|
4540
|
+
var showNonAdditiveMeasureAlert = false;
|
|
4541
|
+
var showCountDistinctAlert = false;
|
|
4542
|
+
if (nonAdditiveMeasure && measureToLeafMeasures[nonAdditiveMeasure]) {
|
|
4543
|
+
showDecomposedMeasureAlert = measureToLeafMeasures[nonAdditiveMeasure].every(function (_a) {
|
|
4544
|
+
var additive = _a.additive;
|
|
4545
|
+
return additive;
|
|
4546
|
+
});
|
|
4547
|
+
}
|
|
4548
|
+
if (transformedQuery && !transformedQuery.leafMeasureAdditive) {
|
|
4549
|
+
var allLeafMeasures_1 = Object.values(measureToLeafMeasures).reduce(function (memo, leafMeasures) { return __spreadArray(__spreadArray([], memo, true), leafMeasures, true); }, []);
|
|
4550
|
+
showNonAdditiveMeasureAlert = references.measures.some(function (measure) {
|
|
4551
|
+
var leafMeasure = allLeafMeasures_1.find(function (leafMeasure) { return leafMeasure.measure === measure; });
|
|
4552
|
+
if (!leafMeasure) {
|
|
4553
|
+
return false;
|
|
4554
|
+
}
|
|
4555
|
+
return !leafMeasure.additive;
|
|
4556
|
+
});
|
|
4557
|
+
var hasCountDistinctMeasures = references.measures.some(function (measure) {
|
|
4558
|
+
var leafMeasure = allLeafMeasures_1.find(function (leafMeasure) { return leafMeasure.measure === measure; });
|
|
4559
|
+
if (!leafMeasure) {
|
|
4560
|
+
return false;
|
|
4561
|
+
}
|
|
4562
|
+
return leafMeasure.type === 'countDistinct';
|
|
4563
|
+
});
|
|
4564
|
+
showCountDistinctAlert =
|
|
4565
|
+
hasCountDistinctMeasures && !((_a = references.timeDimensions[0]) === null || _a === void 0 ? void 0 : _a.granularity);
|
|
4566
|
+
}
|
|
4567
|
+
return [
|
|
4568
|
+
showDecomposedMeasureAlert,
|
|
4569
|
+
showNonAdditiveMeasureAlert,
|
|
4570
|
+
showCountDistinctAlert,
|
|
4571
|
+
];
|
|
4572
|
+
}, [references, transformedQuery, nonAdditiveMeasure]), showDecomposedMeasureAlert = _r[0], showNonAdditiveMeasureAlert = _r[1], showCountDistinctAlert = _r[2];
|
|
4489
4573
|
var indexedMembers = Object.fromEntries(getNameMemberPairs(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], memberTypeCubeMap.measures, true), memberTypeCubeMap.dimensions, true), memberTypeCubeMap.timeDimensions, true), memberTypeCubeMap.segments, true)));
|
|
4490
4574
|
function handleAddToSchemaClick() {
|
|
4491
4575
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -4557,7 +4641,10 @@ function RollupDesigner(_a) {
|
|
|
4557
4641
|
.code, copyMessage: "Rollup definition is copied", theme: "light" }, void 0), cubeName ? (jsx(Button, __assign({ "data-testid": "rd-add-btn", type: "primary", loading: saving, disabled: !isCronValid, style: { width: '100%' }, onClick: handleAddToSchemaClick }, { children: "Add to the Data Schema" }), void 0)) : null] }, void 0));
|
|
4558
4642
|
}
|
|
4559
4643
|
if (isLoading) {
|
|
4560
|
-
return (jsxs(Flex, __assign({ gap: 4, style: { margin: 24 } }, { children: [jsx(Box, __assign({ style: { minWidth: 256 } }, { children: jsx(Skeleton, {}, void 0) }), void 0), jsxs(Box, __assign({ grow: 1 }, { children: [jsx(Skeleton, {}, void 0), jsx(Skeleton, {}, void 0)] }), void 0), jsx(Box, __assign({ style: {
|
|
4644
|
+
return (jsxs(Flex, __assign({ gap: 4, style: { margin: 24 } }, { children: [jsx(Box, __assign({ style: { minWidth: 256 } }, { children: jsx(Skeleton, {}, void 0) }), void 0), jsxs(Box, __assign({ grow: 1 }, { children: [jsx(Skeleton, {}, void 0), jsx(Skeleton, {}, void 0)] }), void 0), jsx(Box, __assign({ style: {
|
|
4645
|
+
width: 420,
|
|
4646
|
+
minWidth: 420,
|
|
4647
|
+
} }, { children: jsx(Skeleton, {}, void 0) }), void 0)] }), void 0));
|
|
4561
4648
|
}
|
|
4562
4649
|
if (error) {
|
|
4563
4650
|
return (jsx("div", __assign({ style: { margin: '32px 24px' } }, { children: jsx(FatalError, { error: error }, void 0) }), void 0));
|
|
@@ -4576,11 +4663,11 @@ function RollupDesigner(_a) {
|
|
|
4576
4663
|
] }));
|
|
4577
4664
|
}, onRemove: handleMemberToggle('timeDimensions') }, void 0)) : null] }), void 0)] }), void 0) }), "members"), jsx(TabPane, __assign({ tab: jsx("span", __assign({ "data-testid": "rd-settings-tab" }, { children: "Settings" }), void 0) }, { children: jsx(Settings$1, { hasTimeDimension: references.timeDimensions.length > 0, members: references.measures
|
|
4578
4665
|
.concat(references.dimensions)
|
|
4579
|
-
.concat(references.timeDimensions.map(function (td) { return td.dimension; })), onCronExpressionValidityChange: setCronValidity, onChange: function (values) { return setSettings(buildSettings(values)); } }, void 0) }), "settings")] }), void 0) }), void 0), jsx(RollupQueryBox, { children: jsxs(Tabs, { children: [jsx(TabPane, __assign({ tab: jsx("span", __assign({ "data-testid": "rd-definition-tab" }, { children: "Rollup Definition" }), void 0) }, { children: jsxs(Flex, __assign({ direction: "column", justifyContent: "flex-start" }, { children: [!areReferencesEmpty(references) &&
|
|
4580
|
-
!references.timeDimensions.length && (jsx(Box, __assign({ style: { marginBottom: 24 } }, { children: jsx(Alert$1, { type: "warning", message: "This rollup has no time dimension so it cannot be partitioned" }, void 0) }), void 0)),
|
|
4581
|
-
|
|
4582
|
-
|
|
4583
|
-
|
|
4666
|
+
.concat(references.timeDimensions.map(function (td) { return td.dimension; })), onCronExpressionValidityChange: setCronValidity, onChange: function (values) { return setSettings(buildSettings(values)); } }, void 0) }), "settings")] }), void 0) }), void 0), jsx(RollupQueryBox, { children: jsxs(Tabs, { children: [jsx(TabPane, __assign({ tab: jsx("span", __assign({ "data-testid": "rd-definition-tab" }, { children: "Rollup Definition" }), void 0) }, { children: jsxs(Flex, __assign({ direction: "column", justifyContent: "flex-start" }, { children: [showNonAdditiveMeasureAlert && (jsx(Box, __assign({ style: { marginBottom: 24 } }, { children: jsx(Alert$1, { type: "info", message: jsx(Text$1, { children: "This rollup contains a non-additive measure" }, void 0) }, void 0) }), void 0)), showDecomposedMeasureAlert && (jsx(Box, __assign({ style: { marginBottom: 24 } }, { children: jsx(Alert$1, { type: "info", message: jsxs(Text$1, { children: ["Because ", jsx("b", { children: nonAdditiveMeasure }, void 0), " is a non-additive measure that is calculated with additive measures, this rollup is configured with the additive measures that calculate this non-additive measure. See more info in", ' ', jsx(Typography.Link, __assign({ href: "https://cube.dev/docs/recipes/non-additivity#data-schema-decomposing-into-a-formula-with-additive-measures", target: "_blank" }, { children: "our docs" }), void 0), "."] }, void 0) }, void 0) }), void 0)), !areReferencesEmpty(references) &&
|
|
4667
|
+
!references.timeDimensions.length && (jsx(Box, __assign({ style: { marginBottom: 24 } }, { children: jsx(Alert$1, { type: "warning", message: "This rollup has no time dimension so it cannot be partitioned" }, void 0) }), void 0)), jsxs(Box, __assign({ style: { marginBottom: 16 } }, { children: [!areReferencesEmpty(references) ? (jsxs(Paragraph, { children: ["Add the following rollup pre-aggregation", jsx("br", {}, void 0), " to the ", jsx("b", { children: cubeName }, void 0), " cube:"] }, void 0)) : (jsx(Alert$1, { type: "warning", message: "Add some references" }, void 0)), jsx(Paragraph, __assign({ style: { margin: '24px 0 4px' } }, { children: "Rollup Name" }), void 0), jsx(Input, { value: preAggName, suffix: jsx(EditOutlined, {}, void 0), onChange: function (event) { return setPreAggName(event.target.value); } }, void 0)] }), void 0), jsx(Box, { children: rollupBody() }, void 0)] }), void 0) }), "rollup"), isQueryPresent(query) ? (jsx(TabPane, __assign({ tab: matching ? (jsx("span", __assign({ "data-testid": "rd-query-tab" }, { children: "Query Compatibility" }), void 0)) : (jsxs(Typography.Text, __assign({ "data-testid": "rd-query-tab" }, { children: ["Query Compatibility", jsx(WarningFilled, { style: { color: '#FBBC05' } }, void 0)] }), void 0)) }, { children: jsxs(Flex, __assign({ direction: "column", justifyContent: "flex-start" }, { children: [jsx(Box, __assign({ style: { marginBottom: 32 } }, { children: jsxs(Space, __assign({ direction: "vertical", size: 24 }, { children: [showCountDistinctAlert && (jsx(Alert$1, { type: "warning", message: jsx(Text$1, { children: "This query does not have any time dimension granularity, which prevents pre-aggregating any count distinct measures." }, void 0) }, void 0)), matching ? (jsx(Text$1, { children: "This rollup will match the following query:" }, void 0)) : (jsxs(Fragment, { children: [jsx(Alert$1, { "data-testid": "rd-incompatible-query", type: "warning", message: jsxs(Text$1, { children: ["This rollup does ", jsx("b", { children: "NOT" }, void 0), " match the following query:"] }, void 0) }, void 0), !hideMatchRollupButton && (jsx(Button, __assign({ "data-testid": "rd-match-rollup-btn", type: "primary", ghost: true, onClick: function () {
|
|
4668
|
+
setReferences(getPreAggregationReferences(transformedQuery, segments));
|
|
4669
|
+
setMatching(true);
|
|
4670
|
+
} }, { children: "Match Rollup" }), void 0))] }, void 0))] }), void 0) }), void 0), jsx(CodeSnippet, { style: { minWidth: 200 }, code: prettifyObject(matchedQuery), copyMessage: "Query is copied", theme: "light" }, void 0)] }), void 0) }), "query")) : null] }, void 0) }, void 0)] }, void 0));
|
|
4584
4671
|
}
|
|
4585
4672
|
var templateObject_1$f, templateObject_2$5, templateObject_3$1;
|
|
4586
4673
|
|
|
@@ -6303,7 +6390,7 @@ var GraphQLIcon = function () {
|
|
|
6303
6390
|
return (jsx(Icon, { component: function () { return (jsx("svg", __assign({ version: "1.1", height: "1em", width: "1em", x: "0px", y: "0px", viewBox: "0 0 400 400", "enable-background": "new 0 0 400 400", fill: "currentColor" }, { children: jsxs("g", { children: [jsx("rect", { x: "122", y: "-0.4", transform: "matrix(-0.866 -0.5 0.5 -0.866 163.3196 363.3136)", width: "16.6", height: "320.3" }, void 0), jsx("rect", { x: "39.8", y: "272.2", width: "320.3", height: "16.6" }, void 0), jsx("rect", { x: "37.9", y: "312.2", transform: "matrix(-0.866 -0.5 0.5 -0.866 83.0693 663.3409)", width: "185", height: "16.6" }, void 0), jsx("rect", { x: "177.1", y: "71.1", transform: "matrix(-0.866 -0.5 0.5 -0.866 463.3409 283.0693)", width: "185", height: "16.6" }, void 0), jsx("rect", { x: "122.1", y: "-13", transform: "matrix(-0.5 -0.866 0.866 -0.5 126.7903 232.1221)", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "109.6", y: "151.6", transform: "matrix(-0.5 -0.866 0.866 -0.5 266.0828 473.3766)", width: "320.3", height: "16.6" }, void 0), jsx("rect", { x: "52.5", y: "107.5", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "330.9", y: "107.5", width: "16.6", height: "185" }, void 0), jsx("rect", { x: "262.4", y: "240.1", transform: "matrix(-0.5 -0.866 0.866 -0.5 126.7953 714.2875)", width: "14.5", height: "160.9" }, void 0), jsx("path", { d: "M369.5,297.9c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C373.5,259.9,379.2,281.2,369.5,297.9" }, void 0), jsx("path", { d: "M90.9,137c-9.6,16.7-31,22.4-47.7,12.8c-16.7-9.6-22.4-31-12.8-47.7c9.6-16.7,31-22.4,47.7-12.8 C94.8,99,100.5,120.3,90.9,137" }, void 0), jsx("path", { d: "M30.5,297.9c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6,16.7,3.9,38-12.8,47.7 C61.4,320.3,40.1,314.6,30.5,297.9" }, void 0), jsx("path", { d: "M309.1,137c-9.6-16.7-3.9-38,12.8-47.7c16.7-9.6,38-3.9,47.7,12.8c9.6,16.7,3.9,38-12.8,47.7 C340.1,159.4,318.7,153.7,309.1,137" }, void 0), jsx("path", { d: "M200,395.8c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,380.1,219.3,395.8,200,395.8" }, void 0), jsx("path", { d: "M200,74c-19.3,0-34.9-15.6-34.9-34.9c0-19.3,15.6-34.9,34.9-34.9c19.3,0,34.9,15.6,34.9,34.9 C234.9,58.4,219.3,74,200,74" }, void 0)] }, void 0) }), void 0)); } }, void 0));
|
|
6304
6391
|
};
|
|
6305
6392
|
|
|
6306
|
-
var GraphiQLSandbox = lazy(function () { return import('./GraphiQLSandbox-
|
|
6393
|
+
var GraphiQLSandbox = lazy(function () { return import('./GraphiQLSandbox-bf955426.js'); });
|
|
6307
6394
|
var frameworkToTemplate = {
|
|
6308
6395
|
react: 'create-react-app',
|
|
6309
6396
|
angular: 'angular-cli',
|
|
@@ -6608,8 +6695,17 @@ var Wrapper$1 = styled.div(templateObject_5 || (templateObject_5 = __makeTemplat
|
|
|
6608
6695
|
function ChartRenderer(_a) {
|
|
6609
6696
|
var queryId = _a.queryId, areQueriesEqual = _a.areQueriesEqual, isFetchingMeta = _a.isFetchingMeta, iframeRef = _a.iframeRef, framework = _a.framework, queryHasMissingMembers = _a.queryHasMissingMembers, onRunButtonClick = _a.onRunButtonClick;
|
|
6610
6697
|
var cubejsApi = useContext(CubeContext).cubejsApi;
|
|
6611
|
-
var _b =
|
|
6612
|
-
|
|
6698
|
+
var _b = useState('auto'), containerSize = _b[0], setContainerSize = _b[1];
|
|
6699
|
+
useWindowSize(); // triggers the following useEffect() on window size change
|
|
6700
|
+
useEffect(function () {
|
|
6701
|
+
if (iframeRef === null || iframeRef === void 0 ? void 0 : iframeRef.current) {
|
|
6702
|
+
var container = iframeRef === null || iframeRef === void 0 ? void 0 : iframeRef.current;
|
|
6703
|
+
var height = window.innerHeight - container.getBoundingClientRect().y - 40;
|
|
6704
|
+
setContainerSize("".concat(height, "px"));
|
|
6705
|
+
}
|
|
6706
|
+
}); // no deps, it's better to re-check position on every render
|
|
6707
|
+
var _c = useChartRendererState(queryId), isChartRendererReady = _c.isChartRendererReady, isQueryLoading = _c.isQueryLoading, resultSetExists = _c.resultSetExists, queryError = _c.queryError, isBuildInProgress = _c.isBuildInProgress, slowQuery = _c.slowQuery, slowQueryFromCache = _c.slowQueryFromCache;
|
|
6708
|
+
var _d = useChartRendererStateMethods(), setResultSetExists = _d.setResultSetExists, setChartRendererReady = _d.setChartRendererReady, setQueryError = _d.setQueryError;
|
|
6613
6709
|
var runButtonRef = useRef(null);
|
|
6614
6710
|
// for you, ovr :)
|
|
6615
6711
|
useHotkeys('cmd+enter', function () {
|
|
@@ -6658,7 +6754,7 @@ function ChartRenderer(_a) {
|
|
|
6658
6754
|
: slowQueryFromCache
|
|
6659
6755
|
? "This query takes more than 5 seconds to execute. It was served from the cache because Cube.js wasn't able to renew it in less than 5 seconds. Please consider using pre-aggregations to improve its performance. "
|
|
6660
6756
|
: '';
|
|
6661
|
-
return (jsxs(Fragment, { children: [(slowQuery || slowQueryFromCache) && (jsx(Alert$1, { style: { marginBottom: 24 }, message: slowQueryMsg, type: "warning" }, void 0)), renderExtras(), jsx(ChartContainer, __assign({ invisible: invisible }, { children: cubejsApi ? (jsx("iframe", { id: "iframe-".concat(queryId), "data-testid": "chart-renderer", ref: iframeRef, title: "Chart renderer", src: "/chart-renderers/".concat(framework, "/index.html#queryId=").concat(queryId) }, void 0)) : null }), void 0)] }, void 0));
|
|
6757
|
+
return (jsxs(Fragment, { children: [(slowQuery || slowQueryFromCache) && (jsx(Alert$1, { style: { marginBottom: 24 }, message: slowQueryMsg, type: "warning" }, void 0)), renderExtras(), jsx(ChartContainer, __assign({ invisible: invisible }, { children: cubejsApi ? (jsx("iframe", { id: "iframe-".concat(queryId), "data-testid": "chart-renderer", ref: iframeRef, style: { height: containerSize }, title: "Chart renderer", src: "/chart-renderers/".concat(framework, "/index.html#queryId=").concat(queryId) }, void 0)) : null }), void 0)] }, void 0));
|
|
6662
6758
|
}
|
|
6663
6759
|
var templateObject_1$6, templateObject_2$2, templateObject_3, templateObject_4, templateObject_5;
|
|
6664
6760
|
|
|
@@ -6760,7 +6856,7 @@ var ButtonDropdown = function (_a) {
|
|
|
6760
6856
|
};
|
|
6761
6857
|
|
|
6762
6858
|
var Menu = styled(Menu$1)(templateObject_1$5 || (templateObject_1$5 = __makeTemplateObject(["\n max-height: 320px;\n overflow: hidden auto;\n padding-top: 0;\n\n li.ant-dropdown-menu-item-active {\n background: #f3f3fb;\n }\n"], ["\n max-height: 320px;\n overflow: hidden auto;\n padding-top: 0;\n\n li.ant-dropdown-menu-item-active {\n background: #f3f3fb;\n }\n"])));
|
|
6763
|
-
var SearchMenuItem = styled(Menu.Item)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: sticky;\n top: 0;\n background: white;\n padding-top:
|
|
6859
|
+
var SearchMenuItem = styled(Menu.Item)(templateObject_2$1 || (templateObject_2$1 = __makeTemplateObject(["\n position: sticky;\n top: 0;\n // this isn't the best solution ever, but according to the situation other solutions are worse\n // antd uses double class pattern (.disabled.active.active) to override the value of background color. actually the\n // easiest way to override it is to use smtn with higher specificity\n background: white !important;\n padding-top: 8px;\n padding-bottom: 8px;\n margin-bottom: 8px;\n cursor: default;\n\n ::after {\n display: block;\n position: absolute;\n content: '';\n width: 100%;\n left: 0;\n bottom: -20px;\n height: 20px;\n background: linear-gradient(\n to bottom,\n rgba(255, 255, 255, 1),\n rgba(255, 255, 255, 0)\n );\n }\n"], ["\n position: sticky;\n top: 0;\n // this isn't the best solution ever, but according to the situation other solutions are worse\n // antd uses double class pattern (.disabled.active.active) to override the value of background color. actually the\n // easiest way to override it is to use smtn with higher specificity\n background: white !important;\n padding-top: 8px;\n padding-bottom: 8px;\n margin-bottom: 8px;\n cursor: default;\n\n ::after {\n display: block;\n position: absolute;\n content: '';\n width: 100%;\n left: 0;\n bottom: -20px;\n height: 20px;\n background: linear-gradient(\n to bottom,\n rgba(255, 255, 255, 1),\n rgba(255, 255, 255, 0)\n );\n }\n"])));
|
|
6764
6860
|
function filterMembersByKeys(members, keys) {
|
|
6765
6861
|
var cubeNames = keys.map(function (key) { return key.split('.')[0]; });
|
|
6766
6862
|
return members
|
|
@@ -6782,6 +6878,7 @@ function visibilityFilter(_a) {
|
|
|
6782
6878
|
function MemberMenu(_a) {
|
|
6783
6879
|
var _this = this;
|
|
6784
6880
|
var availableCubes = _a.availableCubes, _b = _a.showNoMembersPlaceholder, showNoMembersPlaceholder = _b === void 0 ? true : _b, onClick = _a.onClick, buttonProps = __rest(_a, ["availableCubes", "showNoMembersPlaceholder", "onClick"]);
|
|
6881
|
+
var searchInputRef = useRef(null);
|
|
6785
6882
|
var flexSearch = useRef(FlexSearch.create({ encode: 'advanced' }));
|
|
6786
6883
|
var _c = useState(''), search = _c[0], setSearch = _c[1];
|
|
6787
6884
|
var _d = useState([]), filteredKeys = _d[0], setFilteredKeys = _d[1];
|
|
@@ -6818,23 +6915,52 @@ function MemberMenu(_a) {
|
|
|
6818
6915
|
var members = search
|
|
6819
6916
|
? filterMembersByKeys(availableCubes, filteredKeys)
|
|
6820
6917
|
: availableCubes;
|
|
6821
|
-
return (jsx(ButtonDropdown, __assign({}, buttonProps, {
|
|
6918
|
+
return (jsx(ButtonDropdown, __assign({}, buttonProps, { onClick: function () {
|
|
6919
|
+
// we need to delay focusing since React needs to render <Menu /> first :)
|
|
6920
|
+
setTimeout(function () {
|
|
6921
|
+
var _a;
|
|
6922
|
+
(_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
6923
|
+
});
|
|
6924
|
+
}, overlay: jsx(Menu, __assign({ onKeyDown: function (e) {
|
|
6925
|
+
var _a, _b;
|
|
6926
|
+
if ([
|
|
6927
|
+
'ArrowDown',
|
|
6928
|
+
'ArrowUp',
|
|
6929
|
+
'ArrowLeft',
|
|
6930
|
+
'ArrowRight',
|
|
6931
|
+
'Enter',
|
|
6932
|
+
'Escape',
|
|
6933
|
+
'Tab',
|
|
6934
|
+
'CapsLock',
|
|
6935
|
+
].includes(e.key)) {
|
|
6936
|
+
return;
|
|
6937
|
+
}
|
|
6938
|
+
if (document.activeElement === ((_a = searchInputRef.current) === null || _a === void 0 ? void 0 : _a.input))
|
|
6939
|
+
return;
|
|
6940
|
+
(_b = searchInputRef.current) === null || _b === void 0 ? void 0 : _b.focus({ preventScroll: true });
|
|
6941
|
+
}, onClick: function (event) {
|
|
6942
|
+
if (['__not-found__', '__search_field__'].includes(event.key)) {
|
|
6943
|
+
return;
|
|
6944
|
+
}
|
|
6822
6945
|
setSearch('');
|
|
6823
6946
|
setFilteredKeys([]);
|
|
6824
6947
|
onClick(indexedMembers[event.key]);
|
|
6825
|
-
} }, { children: hasMembers ? (jsxs(Fragment, { children: [jsx(SearchMenuItem, __assign({ disabled: true }, { children: jsx(Input, { placeholder: "Search", autoFocus: true,
|
|
6826
|
-
if (['ArrowDown', 'ArrowUp'].includes(event.key)) {
|
|
6948
|
+
} }, { children: hasMembers ? (jsxs(Fragment, { children: [jsx(SearchMenuItem, __assign({ disabled: true }, { children: jsx(Input, { ref: searchInputRef, placeholder: "Search", autoFocus: true, allowClear: true, onKeyDown: function (event) {
|
|
6949
|
+
if (['ArrowDown', 'ArrowUp', 'Enter'].includes(event.key)) {
|
|
6827
6950
|
event.preventDefault();
|
|
6828
6951
|
}
|
|
6952
|
+
if (['ArrowLeft', 'ArrowRight'].includes(event.key)) {
|
|
6953
|
+
event.stopPropagation();
|
|
6954
|
+
}
|
|
6829
6955
|
}, onChange: function (event) {
|
|
6830
6956
|
setSearch(event.target.value);
|
|
6831
|
-
} }, void 0) }),
|
|
6957
|
+
} }, void 0) }), "__search_field__"), members.map(function (cube) {
|
|
6832
6958
|
var members = cube.members.filter(visibilityFilter);
|
|
6833
6959
|
if (!members.length) {
|
|
6834
6960
|
return null;
|
|
6835
6961
|
}
|
|
6836
6962
|
return (jsx(Menu.ItemGroup, __assign({ title: cube.cubeTitle }, { children: members.map(function (m) { return (jsx(Menu.Item, __assign({ "data-testid": m.name }, { children: m.shortTitle }), m.name)); }) }), cube.cubeName));
|
|
6837
|
-
})] }, void 0)) : showNoMembersPlaceholder ? (jsx(Menu.Item, __assign({ disabled: true }, { children: "No members found" }),
|
|
6963
|
+
})] }, void 0)) : showNoMembersPlaceholder ? (jsx(Menu.Item, __assign({ disabled: true }, { children: "No members found" }), "__not-found__")) : null }), void 0) }), void 0));
|
|
6838
6964
|
}
|
|
6839
6965
|
var templateObject_1$5, templateObject_2$1;
|
|
6840
6966
|
|
|
@@ -6892,7 +7018,7 @@ var FilterGroup = function (_a) {
|
|
|
6892
7018
|
}, onClick: function (updateWith) {
|
|
6893
7019
|
return updateMethods.update(m, __assign(__assign({}, m), { dimension: updateWith }));
|
|
6894
7020
|
} }, { children: m.dimension.title }), void 0) }), void 0));
|
|
6895
|
-
return (jsxs(Fragment$1, { children: [isMissing ? (jsx(MissingMemberTooltip, { children: buttonGroup }, void 0)) : (buttonGroup), jsx(StyledSelect, __assign({ disabled: disabled, value: m.operator, style: { width: 200 }, onChange: function (operator) { return updateMethods.update(m, __assign(__assign({}, m), { operator: operator })); } }, { children: m.operators.map(function (operator) { return (jsx(StyledSelect.Option, __assign({ value: operator.name }, { children: operator.title }), operator.name)); }) }), void 0), jsx(FilterInput, { disabled: disabled, member: m, updateMethods: updateMethods }, "filterInput")] }, m.
|
|
7021
|
+
return (jsxs(Fragment$1, { children: [isMissing ? (jsx(MissingMemberTooltip, { children: buttonGroup }, void 0)) : (buttonGroup), jsx(StyledSelect, __assign({ disabled: disabled, value: m.operator, style: { width: 200 }, onChange: function (operator) { return updateMethods.update(m, __assign(__assign({}, m), { operator: operator })); } }, { children: m.operators.map(function (operator) { return (jsx(StyledSelect.Option, __assign({ value: operator.name }, { children: operator.title }), operator.name)); }) }), void 0), jsx(FilterInput, { disabled: disabled, member: m, updateMethods: updateMethods }, "filterInput")] }, m.member));
|
|
6896
7022
|
}), jsx(MemberMenu, __assign({ availableCubes: availableMembers, type: "dashed", disabled: disabled, icon: jsx(PlusOutlined, {}, void 0), onClick: function (m) { return updateMethods.add({ member: m }); } }, { children: !members.length ? addMemberName : null }), void 0)] }, void 0));
|
|
6897
7023
|
};
|
|
6898
7024
|
|
|
@@ -7266,5 +7392,5 @@ var QueryBuilder = memo(QueryBuilderComponent, function (prevProps, nextProps) {
|
|
|
7266
7392
|
return equals(prevProps, nextProps);
|
|
7267
7393
|
});
|
|
7268
7394
|
|
|
7269
|
-
export { CloudProvider as C, QueryBuilder as Q, RollupDesignerContext as R, __assign as _, unCapitalize as a, __spreadArray as b, useSecurityContext as c, useToken as d, useDeepMemo as e, __makeTemplateObject as f, fetchPoll as g, setTelemetry as h, useCloud as i, Context as j, useRollupDesignerContext as k,
|
|
7270
|
-
//# sourceMappingURL=index-
|
|
7395
|
+
export { useSetter as A, useToggle as B, CloudProvider as C, useWindowSize as D, QueryBuilder as Q, RollupDesignerContext as R, __assign as _, unCapitalize as a, __spreadArray as b, useSecurityContext as c, useToken as d, useDeepMemo as e, __makeTemplateObject as f, fetchPoll as g, setTelemetry as h, useCloud as i, Context as j, useRollupDesignerContext as k, useAppContext as l, metaToTypes as m, usePlaygroundContext as n, useIsCloud as o, useCubejsApi as p, useDeepCompareMemoize as q, useDeepDependencies as r, setTracker as s, useDeepEffect as t, uniqArray as u, useIdentifier as v, useIsMounted as w, useLivePreviewContext as x, useLocalStorage as y, useServerCoreVersionGte as z };
|
|
7396
|
+
//# sourceMappingURL=index-8c4dbf47.js.map
|