@cubejs-client/playground 0.28.57 → 0.28.62
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/lib/index.js
CHANGED
|
@@ -3447,7 +3447,7 @@ function gap(_a) {
|
|
|
3447
3447
|
if (direction === 'column') {
|
|
3448
3448
|
return css(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n & > div {\n margin-bottom: ", "px};\n }\n\n & > div:last-child {\n margin-bottom: 0;\n }\n "], ["\n & > div {\n margin-bottom: ", "px};\n }\n\n & > div:last-child {\n margin-bottom: 0;\n }\n "])), gap * STEP);
|
|
3449
3449
|
}
|
|
3450
|
-
return css(templateObject_3$
|
|
3450
|
+
return css(templateObject_3$2 || (templateObject_3$2 = __makeTemplateObject(["\n & > div {\n margin-right: ", "px};\n }\n\n & > div:last-child {\n margin-right: 0;\n }\n "], ["\n & > div {\n margin-right: ", "px};\n }\n\n & > div:last-child {\n margin-right: 0;\n }\n "])), gap * STEP);
|
|
3451
3451
|
}
|
|
3452
3452
|
return '';
|
|
3453
3453
|
}
|
|
@@ -3485,7 +3485,7 @@ function margin(props) {
|
|
|
3485
3485
|
}
|
|
3486
3486
|
return null;
|
|
3487
3487
|
}
|
|
3488
|
-
var templateObject_1$l, templateObject_2$7, templateObject_3$
|
|
3488
|
+
var templateObject_1$l, templateObject_2$7, templateObject_3$2;
|
|
3489
3489
|
|
|
3490
3490
|
var Box = styled.div(templateObject_1$k || (templateObject_1$k = __makeTemplateObject(["\n align-self: ", ";\n flex-grow: ", ";\n"], ["\n align-self: ", ";\n flex-grow: ", ";\n"])), function (props) { return props.align; }, function (props) { return props.grow; });
|
|
3491
3491
|
var templateObject_1$k;
|
|
@@ -3538,7 +3538,7 @@ function useCubeMemberSearch(memberTypeCubeMap) {
|
|
|
3538
3538
|
}
|
|
3539
3539
|
|
|
3540
3540
|
var SubMenu = Menu$1.SubMenu;
|
|
3541
|
-
var StyledMenu$1 = styled(Menu$1)(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n position: relative;\n max-height: 600px;\n overflow-y: scroll;\n\n li {\n font-size: var(--font-size-base);\n }\n\n .ant-menu-sub.ant-menu-inline {\n background: white;\n }\n\n & li > div.ant-menu-submenu-title {\n font-weight: 500;\n color: var(--menu-highlight-color);\n }\n\n & li.ant-menu-item-group {\n & > div {\n text-transform: uppercase;\n font-size: 10px;\n }\n\n & ul > li {\n padding-left: 12px !important;\n }\n }\n\n .ant-menu-item-group-list > li {\n margin: 0 !important;\n\n &::after {\n display: none;\n }\n }\n\n .ant-menu-item-selected,\n .ant-menu-item-active:not(.ant-menu-item-selected) {\n background: var(--primary-9) !important;\n color: var(--primary-color);\n }\n\n .ant-menu-item-selected.ant-menu-item-active {\n background: var(--primary-8) !important;\n }\n\n .ant-menu-submenu-arrow {\n left: 10px;\n right: initial;\n }\n"], ["\n position: relative;\n max-height: 600px;\n overflow-y: scroll;\n\n li {\n font-size: var(--font-size-base);\n }\n\n .ant-menu-sub.ant-menu-inline {\n background: white;\n }\n\n & li > div.ant-menu-submenu-title {\n font-weight: 500;\n color: var(--menu-highlight-color);\n }\n\n & li.ant-menu-item-group {\n & > div {\n text-transform: uppercase;\n font-size: 10px;\n }\n\n & ul > li {\n padding-left: 12px !important;\n }\n }\n\n .ant-menu-item-group-list > li {\n margin: 0 !important;\n\n &::after {\n display: none;\n }\n }\n\n .ant-menu-item-selected,\n .ant-menu-item-active:not(.ant-menu-item-selected) {\n background: var(--primary-9) !important;\n color: var(--primary-color);\n }\n\n .ant-menu-item-selected.ant-menu-item-active {\n background: var(--primary-8) !important;\n }\n\n .ant-menu-submenu-arrow {\n left: 10px;\n right: initial;\n }\n"])));
|
|
3541
|
+
var StyledMenu$1 = styled(Menu$1)(templateObject_1$j || (templateObject_1$j = __makeTemplateObject(["\n position: relative;\n max-height: 600px;\n overflow-y: scroll;\n overflow-x: hidden;\n\n li {\n font-size: var(--font-size-base);\n }\n\n .ant-menu-sub.ant-menu-inline {\n background: white;\n }\n\n & li > div.ant-menu-submenu-title {\n font-weight: 500;\n color: var(--menu-highlight-color);\n }\n\n & li.ant-menu-item-group {\n & > div {\n text-transform: uppercase;\n font-size: 10px;\n }\n\n & ul > li {\n padding-left: 12px !important;\n }\n }\n\n .ant-menu-item-group-list > li {\n margin: 0 !important;\n\n &::after {\n display: none;\n }\n }\n\n .ant-menu-item-selected,\n .ant-menu-item-active:not(.ant-menu-item-selected) {\n background: var(--primary-9) !important;\n color: var(--primary-color);\n }\n\n .ant-menu-item-selected.ant-menu-item-active {\n background: var(--primary-8) !important;\n }\n\n .ant-menu-submenu-arrow {\n left: 10px;\n right: initial;\n }\n"], ["\n position: relative;\n max-height: 600px;\n overflow-y: scroll;\n overflow-x: hidden;\n\n li {\n font-size: var(--font-size-base);\n }\n\n .ant-menu-sub.ant-menu-inline {\n background: white;\n }\n\n & li > div.ant-menu-submenu-title {\n font-weight: 500;\n color: var(--menu-highlight-color);\n }\n\n & li.ant-menu-item-group {\n & > div {\n text-transform: uppercase;\n font-size: 10px;\n }\n\n & ul > li {\n padding-left: 12px !important;\n }\n }\n\n .ant-menu-item-group-list > li {\n margin: 0 !important;\n\n &::after {\n display: none;\n }\n }\n\n .ant-menu-item-selected,\n .ant-menu-item-active:not(.ant-menu-item-selected) {\n background: var(--primary-9) !important;\n color: var(--primary-color);\n }\n\n .ant-menu-item-selected.ant-menu-item-active {\n background: var(--primary-8) !important;\n }\n\n .ant-menu-submenu-arrow {\n left: 10px;\n right: initial;\n }\n"])));
|
|
3542
3542
|
var SearchInputWrapper = styled.div(templateObject_2$6 || (templateObject_2$6 = __makeTemplateObject(["\n position: relative;\n border-right: 1px solid rgba(0, 0, 0, 0.06);\n padding: 16px 12px 10px 12px;\n\n ::after {\n z-index: 1;\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: relative;\n border-right: 1px solid rgba(0, 0, 0, 0.06);\n padding: 16px 12px 10px 12px;\n\n ::after {\n z-index: 1;\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"])));
|
|
3543
3543
|
var MEMBER_TYPES = ['measures', 'dimensions', 'segments', 'timeDimensions'];
|
|
3544
3544
|
function filterMembersByCube(membersByCube, keys) {
|
|
@@ -4155,7 +4155,7 @@ function buildSettings(values) {
|
|
|
4155
4155
|
return nextSettings;
|
|
4156
4156
|
}
|
|
4157
4157
|
|
|
4158
|
-
var Wrapper$
|
|
4158
|
+
var Wrapper$3 = styled.div(templateObject_1$g || (templateObject_1$g = __makeTemplateObject(["\n display: flex;\n gap: 32px;\n flex-direction: column;\n padding: 24px;\n"], ["\n display: flex;\n gap: 32px;\n flex-direction: column;\n padding: 24px;\n"])));
|
|
4159
4159
|
var partionGranularities = GRANULARITIES.filter(function (_a) {
|
|
4160
4160
|
var name = _a.name;
|
|
4161
4161
|
return !['second', 'minute'].includes(name || '');
|
|
@@ -4241,7 +4241,7 @@ function Settings$1(_a) {
|
|
|
4241
4241
|
});
|
|
4242
4242
|
return __assign(__assign({}, prevValues), values);
|
|
4243
4243
|
});
|
|
4244
|
-
} }, { children: jsxs(Wrapper$
|
|
4244
|
+
} }, { children: jsxs(Wrapper$3, { children: [jsxs(Card, { children: [jsx(TitleWithTooltip, __assign({ title: "Refresh Key" }, { children: "Specify how often to refresh your pre-aggregated data" }), void 0), jsx(Typography.Paragraph, { children: "If you do not specify any Refresh Key, refreshes will still default to every 1 hour." }, void 0), jsxs(Row, __assign({ gutter: 8, wrap: false, align: "top" }, { children: [jsx(Col, __assign({ flex: "85px" }, { children: jsx(Form.Item, __assign({ name: "refreshKey.checked.every", valuePropName: "checked" }, { children: jsx(Checkbox, { children: "Every" }, void 0) }), void 0) }), void 0), jsx(Col, __assign({ flex: "auto" }, { children: jsxs(Flex, __assign({ direction: "column", gap: 2 }, { children: [jsxs(Space, { children: [jsx(Radio, { checked: !isCron, disabled: !values['refreshKey.checked.every'], onClick: function () { return toggleCron(false); } }, void 0), jsx(Form.Item, __assign({ name: "refreshKey.value", noStyle: true }, { children: jsx(Input, { "data-testid": "rd-input-every", disabled: !values['refreshKey.checked.every'] || isCron, type: "number", min: 0, style: { maxWidth: 80 } }, void 0) }), void 0), jsx(Form.Item, __assign({ name: "refreshKey.granularity", noStyle: true }, { children: jsx(GranularitySelect, { "data-testid": "rd-select-every-granularity", disabled: !values['refreshKey.checked.every'] || isCron }, void 0) }), void 0)] }, void 0), jsxs(Space, __assign({ align: "start", style: { marginBottom: 32 } }, { children: [jsx(Radio, { disabled: !values['refreshKey.checked.every'], checked: isCron, style: { paddingTop: 5 }, onClick: function () { return toggleCron(true); } }, void 0), jsxs(Flex, __assign({ direction: "column", gap: 1 }, { children: [jsx(Form.Item, __assign({ name: "refreshKey.cron", rules: [
|
|
4245
4245
|
{
|
|
4246
4246
|
validator: function (_, value, callback) {
|
|
4247
4247
|
if (value &&
|
|
@@ -4358,8 +4358,9 @@ function useRollupDesignerContext() {
|
|
|
4358
4358
|
|
|
4359
4359
|
var Paragraph = Typography.Paragraph; Typography.Link; var Text$1 = Typography.Text;
|
|
4360
4360
|
var TabPane = Tabs.TabPane;
|
|
4361
|
-
var
|
|
4362
|
-
var
|
|
4361
|
+
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"])));
|
|
4362
|
+
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"])));
|
|
4363
|
+
var RollupQueryBox = styled.div(templateObject_3$1 || (templateObject_3$1 = __makeTemplateObject(["\n padding: 0 24px 32px;\n background: #f6f6f8;\n\n & .ant-tabs-nav {\n margin-bottom: 24px;\n }\n\n & .ant-tabs-tab {\n div,\n .ant-typography {\n font-weight: 500;\n }\n }\n\n & .ant-typography > .anticon {\n padding-left: 12px;\n }\n"], ["\n padding: 0 24px 32px;\n background: #f6f6f8;\n\n & .ant-tabs-nav {\n margin-bottom: 24px;\n }\n\n & .ant-tabs-tab {\n div,\n .ant-typography {\n font-weight: 500;\n }\n }\n\n & .ant-typography > .anticon {\n padding-left: 12px;\n }\n"])));
|
|
4363
4364
|
function getSelectedKeys(references) {
|
|
4364
4365
|
var keys = new Set();
|
|
4365
4366
|
['measures', 'dimensions', 'timeDimensions', 'segments'].map(function (memberKey) {
|
|
@@ -4540,9 +4541,15 @@ function RollupDesigner(_a) {
|
|
|
4540
4541
|
if (error) {
|
|
4541
4542
|
return (jsx("div", __assign({ style: { margin: '32px 24px' } }, { children: jsx(FatalError, { error: error }, void 0) }), void 0));
|
|
4542
4543
|
}
|
|
4543
|
-
return (jsxs(
|
|
4544
|
+
return (jsxs(Wrapper$2, { children: [jsx(MainBox, __assign({ grow: 1, style: { overflowX: 'scroll' } }, { children: jsxs(Tabs, __assign({ style: { minHeight: '100%' } }, { children: [jsx(TabPane, __assign({ tab: jsx("span", __assign({ "data-testid": "rd-members-tab" }, { children: "Members" }), void 0) }, { children: jsxs(Flex, __assign({ gap: 2 }, { children: [jsx(Box, __assign({ style: {
|
|
4545
|
+
minWidth: 280,
|
|
4546
|
+
maxWidth: 280,
|
|
4547
|
+
} }, { children: jsx(Cubes, { openKeys: openKeys, selectedKeys: selectedKeys, memberTypeCubeMap: memberTypeCubeMap, firstOpenCubeName: firstOpenCubeName, onSelect: function (memberType, key) {
|
|
4544
4548
|
handleMemberToggle(memberType)(key);
|
|
4545
|
-
}, onOpenKeysChange: setOpenKeys }, void 0) }), void 0), jsxs(Box, __assign({ grow: 1, style: {
|
|
4549
|
+
}, onOpenKeysChange: setOpenKeys }, void 0) }), void 0), jsxs(Box, __assign({ grow: 1, style: {
|
|
4550
|
+
marginTop: 24,
|
|
4551
|
+
overflowX: 'scroll',
|
|
4552
|
+
} }, { children: [((_b = references.measures) === null || _b === void 0 ? void 0 : _b.length) ? (jsxs(Fragment, { children: [jsx(Members, { title: "Measures", members: references.measures.map(function (name) { return indexedMembers[name]; }), onRemove: handleMemberToggle('measures') }, void 0), jsx(Divider, {}, void 0)] }, void 0)) : null, ((_c = references.dimensions) === null || _c === void 0 ? void 0 : _c.length) ? (jsxs(Fragment, { children: [jsx(Members, { title: "Dimensions", members: references.dimensions.map(function (name) { return indexedMembers[name]; }), onRemove: handleMemberToggle('dimensions') }, void 0), jsx(Divider, {}, void 0)] }, void 0)) : null, references.segments.length ? (jsxs(Fragment, { children: [jsx(Members, { title: "Segments", members: references.segments.map(function (name) { return indexedMembers[name]; }), onRemove: handleMemberToggle('segments') }, void 0), jsx(Divider, {}, void 0)] }, void 0)) : null, references.timeDimensions.length ? (jsx(TimeDimension, { member: indexedMembers[references.timeDimensions[0].dimension], granularity: references.timeDimensions[0].granularity, onGranularityChange: function (granularity) {
|
|
4546
4553
|
setReferences(__assign(__assign({}, references), { timeDimensions: [
|
|
4547
4554
|
__assign(__assign({}, (references.timeDimensions[0] || {})), (granularity ? { granularity: granularity } : null)),
|
|
4548
4555
|
] }));
|
|
@@ -4552,9 +4559,9 @@ function RollupDesigner(_a) {
|
|
|
4552
4559
|
!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: matching ? (jsx(Text$1, { children: "This rollup will match the following query:" }, void 0)) : (jsxs(Space, __assign({ direction: "vertical" }, { 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 () {
|
|
4553
4560
|
setReferences(getPreAggregationReferences(transformedQuery, segments));
|
|
4554
4561
|
setMatching(true);
|
|
4555
|
-
} }, { children: "Match Rollup" }), 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)] }
|
|
4562
|
+
} }, { children: "Match Rollup" }), 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));
|
|
4556
4563
|
}
|
|
4557
|
-
var templateObject_1$f, templateObject_2$5;
|
|
4564
|
+
var templateObject_1$f, templateObject_2$5, templateObject_3$1;
|
|
4558
4565
|
|
|
4559
4566
|
var sqlFormatter = {};
|
|
4560
4567
|
|