dara-core 1.25.0__py3-none-any.whl → 1.25.1__py3-none-any.whl
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.
- dara/core/_assets/auto_js/dara.core.umd.cjs +200 -102
- dara/core/interactivity/derived_variable.py +20 -3
- dara/core/interactivity/plain_variable.py +20 -5
- dara/core/interactivity/stream_variable.py +25 -5
- dara/core/internal/dependency_resolution.py +18 -6
- dara/core/internal/normalization.py +17 -3
- dara/core/router/dependency_graph.py +18 -0
- {dara_core-1.25.0.dist-info → dara_core-1.25.1.dist-info}/METADATA +10 -10
- {dara_core-1.25.0.dist-info → dara_core-1.25.1.dist-info}/RECORD +12 -12
- {dara_core-1.25.0.dist-info → dara_core-1.25.1.dist-info}/LICENSE +0 -0
- {dara_core-1.25.0.dist-info → dara_core-1.25.1.dist-info}/WHEEL +0 -0
- {dara_core-1.25.0.dist-info → dara_core-1.25.1.dist-info}/entry_points.txt +0 -0
|
@@ -4227,7 +4227,7 @@
|
|
|
4227
4227
|
let recoilValue = null;
|
|
4228
4228
|
const {
|
|
4229
4229
|
key,
|
|
4230
|
-
get,
|
|
4230
|
+
get: get2,
|
|
4231
4231
|
cachePolicy_UNSTABLE: cachePolicy
|
|
4232
4232
|
} = options;
|
|
4233
4233
|
const set2 = options.set != null ? options.set : void 0;
|
|
@@ -4423,7 +4423,7 @@
|
|
|
4423
4423
|
};
|
|
4424
4424
|
};
|
|
4425
4425
|
try {
|
|
4426
|
-
result =
|
|
4426
|
+
result = get2({
|
|
4427
4427
|
get: getRecoilValue,
|
|
4428
4428
|
getCallback
|
|
4429
4429
|
});
|
|
@@ -5028,9 +5028,9 @@
|
|
|
5028
5028
|
const sel = Recoil_selector({
|
|
5029
5029
|
key: `${options.key}__withFallback`,
|
|
5030
5030
|
get: ({
|
|
5031
|
-
get
|
|
5031
|
+
get: get2
|
|
5032
5032
|
}) => {
|
|
5033
|
-
const baseValue =
|
|
5033
|
+
const baseValue = get2(base);
|
|
5034
5034
|
return baseValue instanceof DefaultValue$2$1 ? options.default : baseValue;
|
|
5035
5035
|
},
|
|
5036
5036
|
// $FlowFixMe[incompatible-call]
|
|
@@ -5312,10 +5312,10 @@
|
|
|
5312
5312
|
Recoil_selectorFamily({
|
|
5313
5313
|
key: "__waitForNone",
|
|
5314
5314
|
get: (dependencies) => ({
|
|
5315
|
-
get
|
|
5315
|
+
get: get2
|
|
5316
5316
|
}) => {
|
|
5317
5317
|
const deps = unwrapDependencies(dependencies);
|
|
5318
|
-
const [results, exceptions] = concurrentRequests(
|
|
5318
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5319
5319
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5320
5320
|
},
|
|
5321
5321
|
dangerouslyAllowMutability: true
|
|
@@ -5323,10 +5323,10 @@
|
|
|
5323
5323
|
Recoil_selectorFamily({
|
|
5324
5324
|
key: "__waitForAny",
|
|
5325
5325
|
get: (dependencies) => ({
|
|
5326
|
-
get
|
|
5326
|
+
get: get2
|
|
5327
5327
|
}) => {
|
|
5328
5328
|
const deps = unwrapDependencies(dependencies);
|
|
5329
|
-
const [results, exceptions] = concurrentRequests(
|
|
5329
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5330
5330
|
if (exceptions.some((exp) => !Recoil_isPromise(exp))) {
|
|
5331
5331
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5332
5332
|
}
|
|
@@ -5350,10 +5350,10 @@
|
|
|
5350
5350
|
Recoil_selectorFamily({
|
|
5351
5351
|
key: "__waitForAll",
|
|
5352
5352
|
get: (dependencies) => ({
|
|
5353
|
-
get
|
|
5353
|
+
get: get2
|
|
5354
5354
|
}) => {
|
|
5355
5355
|
const deps = unwrapDependencies(dependencies);
|
|
5356
|
-
const [results, exceptions] = concurrentRequests(
|
|
5356
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5357
5357
|
if (exceptions.every((exp) => exp == null)) {
|
|
5358
5358
|
return wrapResults(dependencies, results);
|
|
5359
5359
|
}
|
|
@@ -5368,10 +5368,10 @@
|
|
|
5368
5368
|
Recoil_selectorFamily({
|
|
5369
5369
|
key: "__waitForAllSettled",
|
|
5370
5370
|
get: (dependencies) => ({
|
|
5371
|
-
get
|
|
5371
|
+
get: get2
|
|
5372
5372
|
}) => {
|
|
5373
5373
|
const deps = unwrapDependencies(dependencies);
|
|
5374
|
-
const [results, exceptions] = concurrentRequests(
|
|
5374
|
+
const [results, exceptions] = concurrentRequests(get2, deps);
|
|
5375
5375
|
if (exceptions.every((exp) => !Recoil_isPromise(exp))) {
|
|
5376
5376
|
return wrapLoadables(dependencies, results, exceptions);
|
|
5377
5377
|
}
|
|
@@ -5388,10 +5388,10 @@
|
|
|
5388
5388
|
Recoil_selectorFamily({
|
|
5389
5389
|
key: "__noWait",
|
|
5390
5390
|
get: (dependency) => ({
|
|
5391
|
-
get
|
|
5391
|
+
get: get2
|
|
5392
5392
|
}) => {
|
|
5393
5393
|
try {
|
|
5394
|
-
return Recoil_selector.value(loadableWithValue$4(
|
|
5394
|
+
return Recoil_selector.value(loadableWithValue$4(get2(dependency)));
|
|
5395
5395
|
} catch (exception) {
|
|
5396
5396
|
return Recoil_selector.value(Recoil_isPromise(exception) ? loadableWithPromise$3(exception) : loadableWithError$3(exception));
|
|
5397
5397
|
}
|
|
@@ -6651,7 +6651,7 @@
|
|
|
6651
6651
|
return cb(config$2);
|
|
6652
6652
|
});
|
|
6653
6653
|
},
|
|
6654
|
-
get: function
|
|
6654
|
+
get: function get2() {
|
|
6655
6655
|
return _config.cssPrefix;
|
|
6656
6656
|
}
|
|
6657
6657
|
});
|
|
@@ -13387,11 +13387,11 @@
|
|
|
13387
13387
|
if (hasRequiredGet) return get_1;
|
|
13388
13388
|
hasRequiredGet = 1;
|
|
13389
13389
|
var baseGet = require_baseGet();
|
|
13390
|
-
function
|
|
13390
|
+
function get2(object2, path, defaultValue) {
|
|
13391
13391
|
var result = object2 == null ? void 0 : baseGet(object2, path);
|
|
13392
13392
|
return result === void 0 ? defaultValue : result;
|
|
13393
13393
|
}
|
|
13394
|
-
get_1 =
|
|
13394
|
+
get_1 = get2;
|
|
13395
13395
|
return get_1;
|
|
13396
13396
|
}
|
|
13397
13397
|
var _baseHasIn;
|
|
@@ -13447,14 +13447,14 @@
|
|
|
13447
13447
|
function require_baseMatchesProperty() {
|
|
13448
13448
|
if (hasRequired_baseMatchesProperty) return _baseMatchesProperty;
|
|
13449
13449
|
hasRequired_baseMatchesProperty = 1;
|
|
13450
|
-
var baseIsEqual = require_baseIsEqual(),
|
|
13450
|
+
var baseIsEqual = require_baseIsEqual(), get2 = requireGet(), hasIn = requireHasIn(), isKey = require_isKey(), isStrictComparable = require_isStrictComparable(), matchesStrictComparable = require_matchesStrictComparable(), toKey = require_toKey();
|
|
13451
13451
|
var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2;
|
|
13452
13452
|
function baseMatchesProperty(path, srcValue) {
|
|
13453
13453
|
if (isKey(path) && isStrictComparable(srcValue)) {
|
|
13454
13454
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
13455
13455
|
}
|
|
13456
13456
|
return function(object2) {
|
|
13457
|
-
var objValue =
|
|
13457
|
+
var objValue = get2(object2, path);
|
|
13458
13458
|
return objValue === void 0 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
13459
13459
|
};
|
|
13460
13460
|
}
|
|
@@ -28021,7 +28021,7 @@
|
|
|
28021
28021
|
}
|
|
28022
28022
|
var passive2 = false;
|
|
28023
28023
|
var options = Object.defineProperty({}, "passive", {
|
|
28024
|
-
get: function
|
|
28024
|
+
get: function get2() {
|
|
28025
28025
|
passive2 = true;
|
|
28026
28026
|
}
|
|
28027
28027
|
});
|
|
@@ -33484,6 +33484,7 @@
|
|
|
33484
33484
|
overflow: hidden;
|
|
33485
33485
|
text-overflow: ellipsis;
|
|
33486
33486
|
white-space: nowrap;
|
|
33487
|
+
font-size: ${(props) => props.size ? `${props.size}rem` : "1rem"};
|
|
33487
33488
|
`;
|
|
33488
33489
|
const SelectedItem = styled.div`
|
|
33489
33490
|
overflow: hidden;
|
|
@@ -34529,6 +34530,7 @@
|
|
|
34529
34530
|
|
|
34530
34531
|
font-weight: ${(props) => (props === null || props === void 0 ? void 0 : props.heading) ? "bold" : "normal"};
|
|
34531
34532
|
color: ${(props) => getTextColor(props === null || props === void 0 ? void 0 : props.heading, props.isSelected, props.theme)};
|
|
34533
|
+
font-size: ${(props) => props.size ? `${props.size}rem` : "1rem"};
|
|
34532
34534
|
|
|
34533
34535
|
${(props) => {
|
|
34534
34536
|
if (props.heading) {
|
|
@@ -34554,13 +34556,13 @@
|
|
|
34554
34556
|
return [...acc, item];
|
|
34555
34557
|
}, []);
|
|
34556
34558
|
}
|
|
34557
|
-
const SectionedListItem = ({ item, index: index2, getItemProps, isSelected, isHighlighted }) => {
|
|
34559
|
+
const SectionedListItem = ({ item, index: index2, getItemProps, isSelected, isHighlighted, size: size2 }) => {
|
|
34558
34560
|
const theme2 = useClTheme();
|
|
34559
34561
|
const _a = getItemProps({ index: index2, item }), { itemClassName } = _a, itemProps = __rest$3(_a, ["itemClassName"]);
|
|
34560
34562
|
if (item.heading) {
|
|
34561
34563
|
delete itemProps.onClick;
|
|
34562
34564
|
}
|
|
34563
|
-
return jsxRuntimeExports.jsxs(ListItemSpan, Object.assign({}, itemProps, { heading: item.heading, section: item.section, isSelected, title: item.label, item, index: index2, isHighlighted, children: [item.label || item.section, item.badge && jsxRuntimeExports.jsx(Badge, { color: item.badge.color || theme2.colors.primary, children: item.badge.label })] }));
|
|
34565
|
+
return jsxRuntimeExports.jsxs(ListItemSpan, Object.assign({}, itemProps, { heading: item.heading, section: item.section, isSelected, title: item.label, item, index: index2, size: size2, isHighlighted, children: [item.label || item.section, item.badge && jsxRuntimeExports.jsx(Badge, { color: item.badge.color || theme2.colors.primary, children: item.badge.label })] }));
|
|
34564
34566
|
};
|
|
34565
34567
|
function SectionedList(props) {
|
|
34566
34568
|
var _a, _b, _c;
|
|
@@ -34652,8 +34654,8 @@
|
|
|
34652
34654
|
const role = useRole(context, { role: "listbox" });
|
|
34653
34655
|
const { getReferenceProps, getFloatingProps } = useInteractions([role]);
|
|
34654
34656
|
const dropdownStyle = React$1.useMemo(() => Object.assign(Object.assign({}, floatingStyles), { marginLeft: -1 }), [floatingStyles]);
|
|
34655
|
-
const renderListItem = React$1.useCallback((item, index2) => jsxRuntimeExports.jsx(SectionedListItem, { item, index: index2, getItemProps, isSelected: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value, isHighlighted: isOpen && kbdHighlightIdx !== void 0 && kbdHighlightIdx === index2 }, `item-${index2}-${isOpen && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) === item.label}`), [getItemProps, selectedItem, isOpen, kbdHighlightIdx]);
|
|
34656
|
-
return jsxRuntimeExports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: false, isOpen, style: props.style, id: props.id, children: [jsxRuntimeExports.jsxs(InputWrapper$2, { disabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntimeExports.jsx(Input, Object.assign({}, getInputProps({ value: inputValue }), getReferenceProps())), jsxRuntimeExports.jsx(ChevronButton$1, { disabled: props.disabled, isOpen, getToggleButtonProps })] }), ReactDOM.createPortal(jsxRuntimeExports.jsx(DropdownList$1, { items, getItemProps, getFloatingProps, style: dropdownStyle, isOpen, getMenuProps, ref: refs.setFloating, kbdHighlightIdx, children: renderListItem }), document.body)] });
|
|
34657
|
+
const renderListItem = React$1.useCallback((item, index2) => jsxRuntimeExports.jsx(SectionedListItem, { item, index: index2, getItemProps, size: props.size, isSelected: (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.value) === item.value, isHighlighted: isOpen && kbdHighlightIdx !== void 0 && kbdHighlightIdx === index2 }, `item-${index2}-${isOpen && (selectedItem === null || selectedItem === void 0 ? void 0 : selectedItem.label) === item.label}`), [getItemProps, selectedItem, isOpen, kbdHighlightIdx, props.size]);
|
|
34658
|
+
return jsxRuntimeExports.jsxs(Wrapper$6, { className: props.className, isDisabled: props.disabled, isErrored: false, isOpen, style: props.style, id: props.id, children: [jsxRuntimeExports.jsxs(InputWrapper$2, { disabled: props.disabled, isOpen, ref: refs.setReference, children: [jsxRuntimeExports.jsx(Input, Object.assign({}, getInputProps({ value: inputValue }), getReferenceProps(), { size: props.size })), jsxRuntimeExports.jsx(ChevronButton$1, { disabled: props.disabled, isOpen, getToggleButtonProps })] }), ReactDOM.createPortal(jsxRuntimeExports.jsx(DropdownList$1, { items, getItemProps, getFloatingProps, style: dropdownStyle, isOpen, size: props.size, getMenuProps, ref: refs.setFloating, kbdHighlightIdx, children: renderListItem }), document.body)] });
|
|
34657
34659
|
}
|
|
34658
34660
|
var toInteger_1;
|
|
34659
34661
|
var hasRequiredToInteger;
|
|
@@ -39081,6 +39083,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39081
39083
|
style: Object.assign(Object.assign(Object.assign({}, floatingStyles), { maxHeight: 800, minWidth: 150, zIndex: 9999 }), style)
|
|
39082
39084
|
}), { isOpen, children: jsxRuntimeExports.jsx(SectionedList, { items: allowColumnHiding ? [resetFunctions, columnToggles] : [resetFunctions], onSelect: onOptionSelect }, isOpen ? "open" : "closed") })), document.body)] });
|
|
39083
39085
|
};
|
|
39086
|
+
const { fontSize } = window.getComputedStyle(document.documentElement);
|
|
39087
|
+
const DEFAULT_ROW_HEIGHT = parseFloat(fontSize) * 2.5;
|
|
39084
39088
|
var __rest$2 = function(s, e2) {
|
|
39085
39089
|
var t2 = {};
|
|
39086
39090
|
for (var p2 in s) if (Object.prototype.hasOwnProperty.call(s, p2) && e2.indexOf(p2) < 0)
|
|
@@ -39092,8 +39096,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39092
39096
|
}
|
|
39093
39097
|
return t2;
|
|
39094
39098
|
};
|
|
39095
|
-
const { fontSize } = window.getComputedStyle(document.documentElement);
|
|
39096
|
-
const ROW_HEIGHT = parseFloat(fontSize) * 2.5;
|
|
39097
39099
|
const shouldForwardProp$2 = (prop) => !["isSorted", "onClickRow"].includes(prop);
|
|
39098
39100
|
const Row = styled.div.withConfig({ shouldForwardProp: shouldForwardProp$2 })`
|
|
39099
39101
|
cursor: ${(props) => props.onClickRow ? "pointer" : "default"};
|
|
@@ -39149,7 +39151,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39149
39151
|
align-items: center;
|
|
39150
39152
|
|
|
39151
39153
|
min-width: 80px;
|
|
39152
|
-
height: ${() => `${
|
|
39154
|
+
height: ${({ rowHeight }) => `${rowHeight}px`};
|
|
39153
39155
|
|
|
39154
39156
|
color: ${(props) => props.theme.colors.grey6};
|
|
39155
39157
|
|
|
@@ -39161,19 +39163,19 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39161
39163
|
}
|
|
39162
39164
|
`;
|
|
39163
39165
|
const CellContent = styled.span`
|
|
39164
|
-
overflow: hidden;
|
|
39166
|
+
overflow: ${({ hasRowHeight }) => hasRowHeight ? "unset" : "hidden"};
|
|
39165
39167
|
|
|
39166
39168
|
width: 100%;
|
|
39167
39169
|
padding: 0 1rem;
|
|
39168
39170
|
|
|
39169
|
-
text-overflow: ellipsis;
|
|
39170
|
-
white-space: nowrap;
|
|
39171
|
+
text-overflow: ${({ hasRowHeight }) => hasRowHeight ? "unset" : "ellipsis"};
|
|
39172
|
+
white-space: ${({ hasRowHeight }) => hasRowHeight ? "normal" : "nowrap"};
|
|
39171
39173
|
`;
|
|
39172
39174
|
const arePropsEqual = (prevProps, nextProps) => {
|
|
39173
39175
|
var _a;
|
|
39174
39176
|
return areEqual(prevProps, nextProps) && !(((_a = nextProps.data) === null || _a === void 0 ? void 0 : _a.headerGroups) || []).some((headerGroup) => ((headerGroup === null || headerGroup === void 0 ? void 0 : headerGroup.headers) || []).some((header) => header.isResizing));
|
|
39175
39177
|
};
|
|
39176
|
-
const RenderRow = React__namespace.memo(({ data: { width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns }, index: index2, style: renderRowStyle }) => {
|
|
39178
|
+
const RenderRow = React__namespace.memo(({ data: { width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, rowHeight }, index: index2, style: renderRowStyle }) => {
|
|
39177
39179
|
let row = rows[index2];
|
|
39178
39180
|
if (getItem) {
|
|
39179
39181
|
const value = getItem(index2);
|
|
@@ -39186,8 +39188,8 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39186
39188
|
}
|
|
39187
39189
|
if (!row) {
|
|
39188
39190
|
return jsxRuntimeExports.jsx("div", { children: headerGroups.map((headerGroup, gidx) => jsxRuntimeExports.jsx(RowPlaceholder, { style: {
|
|
39189
|
-
height:
|
|
39190
|
-
top: (index2 + 1) *
|
|
39191
|
+
height: rowHeight,
|
|
39192
|
+
top: (index2 + 1) * rowHeight,
|
|
39191
39193
|
width: totalColumnsWidth > width ? totalColumnsWidth : "100%"
|
|
39192
39194
|
}, children: headerGroup === null || headerGroup === void 0 ? void 0 : headerGroup.headers.map((col, cidx) => {
|
|
39193
39195
|
const headerProps = col.getHeaderProps();
|
|
@@ -39205,16 +39207,24 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39205
39207
|
}
|
|
39206
39208
|
};
|
|
39207
39209
|
const _a = row.getRowProps({ style: renderRowStyle }), { style: rowStyle } = _a, restRow = __rest$2(_a, ["style"]);
|
|
39208
|
-
return React$1.createElement(Row, Object.assign({}, restRow, { key: `row-${index2}`, onClick, onClickRow, style: Object.assign(Object.assign({}, rowStyle), {
|
|
39209
|
-
|
|
39210
|
+
return React$1.createElement(Row, Object.assign({}, restRow, { key: `row-${index2}`, onClick, onClickRow, style: Object.assign(Object.assign({}, rowStyle), {
|
|
39211
|
+
// The first row is the header row which is not controlled by this rowHeight prop so it needs to be part of the calculation.
|
|
39212
|
+
top: index2 === 0 ? DEFAULT_ROW_HEIGHT : index2 * rowHeight + DEFAULT_ROW_HEIGHT,
|
|
39213
|
+
width: totalColumnsWidth > width ? totalColumnsWidth : "100%"
|
|
39214
|
+
}) }), row.cells.map((cell, colIdx) => {
|
|
39215
|
+
var _a2, _b, _c, _d, _e2;
|
|
39210
39216
|
const cellProps = cell.getCellProps();
|
|
39211
39217
|
return React$1.createElement(
|
|
39212
39218
|
Cell,
|
|
39213
|
-
Object.assign({}, cellProps, { key: `cell-${index2}-${colIdx}`, style: Object.assign(Object.assign({}, cellProps.style), { backgroundColor, justifyContent: mappedColumns[colIdx].align, maxWidth: (_a2 = cell.column) === null || _a2 === void 0 ? void 0 : _a2.maxWidth, width: (
|
|
39219
|
+
Object.assign({}, cellProps, { rowHeight, key: `cell-${index2}-${colIdx}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, cellProps.style), { backgroundColor, justifyContent: mappedColumns[colIdx].align, maxWidth: (_a2 = cell.column) === null || _a2 === void 0 ? void 0 : _a2.maxWidth, width: (
|
|
39214
39220
|
// If width calc has messed up then use the raw width from the column
|
|
39215
39221
|
cellProps.style.width === "NaNpx" ? mappedColumns[colIdx].width : cellProps.style.width
|
|
39216
|
-
) })
|
|
39217
|
-
|
|
39222
|
+
) }), ((_b = mappedColumns[colIdx]) === null || _b === void 0 ? void 0 : _b.sticky) === "left" && typeof ((_c = mappedColumns[colIdx]) === null || _c === void 0 ? void 0 : _c.stickyOffset) === "number" ? {
|
|
39223
|
+
left: `${mappedColumns[colIdx].stickyOffset}px`
|
|
39224
|
+
} : {}), ((_d = mappedColumns[colIdx]) === null || _d === void 0 ? void 0 : _d.sticky) === "right" && typeof ((_e2 = mappedColumns[colIdx]) === null || _e2 === void 0 ? void 0 : _e2.stickyOffset) === "number" ? {
|
|
39225
|
+
right: `${mappedColumns[colIdx].stickyOffset}px`
|
|
39226
|
+
} : {}) }),
|
|
39227
|
+
jsxRuntimeExports.jsx(CellContent, { hasRowHeight: rowHeight !== DEFAULT_ROW_HEIGHT, children: cell.render("Cell", {
|
|
39218
39228
|
colIdx,
|
|
39219
39229
|
currentEditCell,
|
|
39220
39230
|
rowIdx: index2
|
|
@@ -39294,7 +39304,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39294
39304
|
justify-content: space-between;
|
|
39295
39305
|
|
|
39296
39306
|
min-width: 80px;
|
|
39297
|
-
height: ${
|
|
39307
|
+
height: ${DEFAULT_ROW_HEIGHT}px;
|
|
39298
39308
|
|
|
39299
39309
|
color: ${(props) => props.theme.colors.text};
|
|
39300
39310
|
|
|
@@ -39379,6 +39389,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39379
39389
|
});
|
|
39380
39390
|
return [...leftStickyCols, ...nonStickyCols, ...rightStickyCols];
|
|
39381
39391
|
};
|
|
39392
|
+
const appendStickyOffsets = (columns) => {
|
|
39393
|
+
let leftOffset = 0;
|
|
39394
|
+
let rightOffset = 0;
|
|
39395
|
+
const rightStickyColumnWidths = columns.filter((col) => col.sticky === "right").slice(1).map((col) => parseInt(col.width) || 150);
|
|
39396
|
+
return columns.map((col) => {
|
|
39397
|
+
if (col.sticky === "left") {
|
|
39398
|
+
const nextCol = Object.assign(Object.assign({}, col), { stickyOffset: leftOffset });
|
|
39399
|
+
const width = parseInt(col.width) || 150;
|
|
39400
|
+
leftOffset += width;
|
|
39401
|
+
return nextCol;
|
|
39402
|
+
}
|
|
39403
|
+
if (col.sticky === "right") {
|
|
39404
|
+
rightOffset = rightStickyColumnWidths.reduce((acc, width) => acc + width, 0);
|
|
39405
|
+
const nextCol = Object.assign(Object.assign({}, col), { stickyOffset: rightOffset });
|
|
39406
|
+
rightStickyColumnWidths.shift();
|
|
39407
|
+
return nextCol;
|
|
39408
|
+
}
|
|
39409
|
+
return col;
|
|
39410
|
+
});
|
|
39411
|
+
};
|
|
39382
39412
|
const filterComponentMap = {
|
|
39383
39413
|
categorical: CategoricalFilter,
|
|
39384
39414
|
datetime: DatetimeFilter,
|
|
@@ -39396,12 +39426,26 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39396
39426
|
return Object.assign(Object.assign({}, col), { Filter: filterComponentMap[col.filter] });
|
|
39397
39427
|
});
|
|
39398
39428
|
};
|
|
39429
|
+
const createActionColumn = (actions, accessor, sticky, disableSelectAll = false) => {
|
|
39430
|
+
const width = actions.includes(Actions.SELECT) ? 52 : actions.length * 24 + 24;
|
|
39431
|
+
return {
|
|
39432
|
+
Cell: ActionCell,
|
|
39433
|
+
Header: actions.includes(Actions.SELECT) && !disableSelectAll ? SelectHeader : "",
|
|
39434
|
+
accessor: accessor || "actions",
|
|
39435
|
+
actions,
|
|
39436
|
+
disableSortBy: true,
|
|
39437
|
+
maxWidth: width,
|
|
39438
|
+
minWidth: actions.includes(Actions.SELECT) ? 52 : 48,
|
|
39439
|
+
sticky: sticky || null,
|
|
39440
|
+
width
|
|
39441
|
+
};
|
|
39442
|
+
};
|
|
39399
39443
|
const cells = {
|
|
39400
39444
|
DATETIME: DatetimeCell,
|
|
39401
39445
|
EDIT_INPUT: EditInputCell,
|
|
39402
39446
|
EDIT_SELECT: EditSelectCell
|
|
39403
39447
|
};
|
|
39404
|
-
const createItemData$1 = memoizeOne$1((width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns) => ({
|
|
39448
|
+
const createItemData$1 = memoizeOne$1((width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, rowHeight) => ({
|
|
39405
39449
|
backgroundColor,
|
|
39406
39450
|
currentEditCell,
|
|
39407
39451
|
getItem,
|
|
@@ -39410,12 +39454,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39410
39454
|
onClickRow,
|
|
39411
39455
|
prepareRow,
|
|
39412
39456
|
rows,
|
|
39457
|
+
rowHeight,
|
|
39413
39458
|
throttledClickRow,
|
|
39414
39459
|
totalColumnsWidth,
|
|
39415
39460
|
width
|
|
39416
39461
|
}));
|
|
39417
|
-
const Table = React$1.forwardRef(({ allowHiding, backgroundColor, className, columns, data: data2, getItem, initialSort = [], itemCount, maxRows, onAction, onChange: onChange2, onClickRow, onItemsRendered, onFilter, onSort, showTableOptions, style, tableOptionsStyle }, ref) => {
|
|
39462
|
+
const Table = React$1.forwardRef(({ allowHiding, actions, backgroundColor, className, columns, data: data2, getItem, initialSort = [], itemCount, maxRows, onAction, onChange: onChange2, onClickRow, onItemsRendered, onFilter, onSort, rowHeight, showTableOptions, style, tableOptionsStyle }, ref) => {
|
|
39418
39463
|
const [currentSortBy, setCurrentSortBy] = React$1.useState(initialSort);
|
|
39464
|
+
const tableRowHeight = rowHeight || DEFAULT_ROW_HEIGHT;
|
|
39419
39465
|
React$1.useEffect(
|
|
39420
39466
|
() => {
|
|
39421
39467
|
setCurrentSortBy(initialSort);
|
|
@@ -39445,7 +39491,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39445
39491
|
throttledSetEditCell([Number(cell[0]), cell[1]]);
|
|
39446
39492
|
};
|
|
39447
39493
|
const infiniteData = React$1.useMemo(() => Array(itemCount).fill(0), [itemCount]);
|
|
39448
|
-
const mappedColumns = React$1.useMemo(() =>
|
|
39494
|
+
const mappedColumns = React$1.useMemo(() => {
|
|
39495
|
+
let processedColumns = columns;
|
|
39496
|
+
if (actions && actions.length > 0) {
|
|
39497
|
+
const actionColumn = createActionColumn(actions);
|
|
39498
|
+
processedColumns = [...columns, actionColumn];
|
|
39499
|
+
}
|
|
39500
|
+
return appendStickyOffsets(appendFilterComponents(orderStickyCols(processedColumns)));
|
|
39501
|
+
}, [columns, actions]);
|
|
39449
39502
|
const hasFixedColumns = React$1.useMemo(() => mappedColumns.some((column) => "sticky" in column), [mappedColumns]);
|
|
39450
39503
|
const totalColumnsWidth = React$1.useMemo(() => mappedColumns.reduce((acc, column) => acc + (parseInt(column.width) || 150), 0), [mappedColumns]);
|
|
39451
39504
|
const filterTypes = React$1.useMemo(() => ({
|
|
@@ -39501,11 +39554,15 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39501
39554
|
const showHeaderCellButtonContainer = showSort || showFilter || showOptions;
|
|
39502
39555
|
return React$1.createElement(
|
|
39503
39556
|
HeaderCell,
|
|
39504
|
-
Object.assign({}, headerProps, { key: `col-${gidx}-${cidx}`, style: Object.assign(Object.assign({}, headerProps.style), {
|
|
39557
|
+
Object.assign({}, headerProps, { key: `col-${gidx}-${cidx}`, style: Object.assign(Object.assign(Object.assign(Object.assign({}, headerProps.style), {
|
|
39505
39558
|
maxWidth: col.maxWidth,
|
|
39506
39559
|
// If width calc has messed up then use the raw width from the column
|
|
39507
39560
|
width: headerProps.style.width === "NaNpx" ? mappedColumns[cidx].width : headerProps.style.width
|
|
39508
|
-
})
|
|
39561
|
+
}), col.sticky === "left" && typeof col.stickyOffset === "number" ? {
|
|
39562
|
+
left: `${col.stickyOffset}px`
|
|
39563
|
+
} : {}), col.sticky === "right" && typeof col.stickyOffset === "number" ? {
|
|
39564
|
+
right: `${col.stickyOffset}px`
|
|
39565
|
+
} : {}) }),
|
|
39509
39566
|
jsxRuntimeExports.jsxs(HeaderTooltipContainer, { isPrimitiveHeader: typeof headerContent === "string", children: [jsxRuntimeExports.jsx(HeaderContentWrapper, Object.assign({}, sortProps, { isPrimitiveHeader: typeof headerContent === "string", title: typeof headerContent === "string" ? headerContent : "", children: headerContent })), col.tooltip && jsxRuntimeExports.jsx(Tooltip, { content: col.tooltip, children: jsxRuntimeExports.jsx(TooltipIcon, { icon: faCircleQuestion }) })] }),
|
|
39510
39567
|
showHeaderCellButtonContainer && jsxRuntimeExports.jsxs(HeaderCellButtonContainer, { children: [jsxRuntimeExports.jsxs(HeaderIconsWrapper, { children: [showSort && jsxRuntimeExports.jsx(HeaderIconWrapper, { children: jsxRuntimeExports.jsx(SortIcon, Object.assign({}, sortProps, { className: "tableSortArrow", icon: getSortIcon(col.isSorted, col.isSortedDesc), isSorted: col.isSorted })) }), showFilter ? jsxRuntimeExports.jsx(FilterContainer, { col }) : null, showOptions && jsxRuntimeExports.jsx(OptionsMenu, { allColumns, allowColumnHiding: allowHiding, numVisibleColumns, resetResizing, setAllFilters, style: tableOptionsStyle })] }), jsxRuntimeExports.jsx(ResizeBorder, Object.assign({}, resizerProps))] })
|
|
39511
39568
|
);
|
|
@@ -39514,28 +39571,15 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
39514
39571
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
39515
39572
|
useDeepCompare([tableProps, totalColumnsWidth, headerGroups])
|
|
39516
39573
|
);
|
|
39517
|
-
return jsxRuntimeExports.jsx(Wrapper$2, Object.assign({}, getTableProps(), { "$hasMaxRows": !!maxRows, className: `${className} ${hasFixedColumns ? "sticky" : ""}`, style: Object.assign({ height: maxRows ? (Math.min(rows.length, maxRows) + 1) *
|
|
39518
|
-
return jsxRuntimeExports.jsx(StyledFixedSizeList, { height, innerElementType: renderTable, itemCount: itemCount || rows.length, itemData: createItemData$1(width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns), itemSize:
|
|
39574
|
+
return jsxRuntimeExports.jsx(Wrapper$2, Object.assign({}, getTableProps(), { "$hasMaxRows": !!maxRows, className: `${className} ${hasFixedColumns ? "sticky" : ""}`, style: Object.assign({ height: maxRows ? (Math.min(rows.length, maxRows) + 1) * tableRowHeight : "100%" }, style), children: jsxRuntimeExports.jsx(AutoSizer, { children: ({ height, width }) => {
|
|
39575
|
+
return jsxRuntimeExports.jsx(StyledFixedSizeList, { height, innerElementType: renderTable, itemCount: itemCount || rows.length, itemData: createItemData$1(width, currentEditCell, headerGroups, rows, prepareRow, getItem, totalColumnsWidth, onClickRow, throttledClickRow, backgroundColor, mappedColumns, tableRowHeight), itemSize: tableRowHeight, onItemsRendered, style: {
|
|
39519
39576
|
overflowX: width < totalColumnsWidth ? "auto" : "hidden",
|
|
39520
|
-
overflowY: height < (rows.length + 1) *
|
|
39577
|
+
overflowY: height < (rows.length + 1) * tableRowHeight ? "auto" : "hidden"
|
|
39521
39578
|
}, width, children: RenderRow }, "table-list");
|
|
39522
39579
|
} }) }));
|
|
39523
39580
|
});
|
|
39524
39581
|
Table.displayName = "Table";
|
|
39525
|
-
Table.ActionColumn =
|
|
39526
|
-
const width = actions.includes(Actions.SELECT) ? 52 : actions.length * 24 + 24;
|
|
39527
|
-
return {
|
|
39528
|
-
Cell: ActionCell,
|
|
39529
|
-
Header: actions.includes(Actions.SELECT) && !disableSelectAll ? SelectHeader : "",
|
|
39530
|
-
accessor: accessor || "actions",
|
|
39531
|
-
actions,
|
|
39532
|
-
disableSortBy: true,
|
|
39533
|
-
maxWidth: width,
|
|
39534
|
-
minWidth: actions.includes(Actions.SELECT) ? 52 : 48,
|
|
39535
|
-
sticky: sticky || null,
|
|
39536
|
-
width
|
|
39537
|
-
};
|
|
39538
|
-
};
|
|
39582
|
+
Table.ActionColumn = createActionColumn;
|
|
39539
39583
|
Table.Actions = Actions;
|
|
39540
39584
|
Table.cells = cells;
|
|
39541
39585
|
styled.div`
|
|
@@ -45171,7 +45215,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
45171
45215
|
function baseAt(object2, paths) {
|
|
45172
45216
|
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object2 == null;
|
|
45173
45217
|
while (++index2 < length) {
|
|
45174
|
-
result2[index2] = skip ? undefined$1 :
|
|
45218
|
+
result2[index2] = skip ? undefined$1 : get2(object2, paths[index2]);
|
|
45175
45219
|
}
|
|
45176
45220
|
return result2;
|
|
45177
45221
|
}
|
|
@@ -45616,7 +45660,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
45616
45660
|
return matchesStrictComparable(toKey(path), srcValue);
|
|
45617
45661
|
}
|
|
45618
45662
|
return function(object2) {
|
|
45619
|
-
var objValue =
|
|
45663
|
+
var objValue = get2(object2, path);
|
|
45620
45664
|
return objValue === undefined$1 && objValue === srcValue ? hasIn(object2, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);
|
|
45621
45665
|
};
|
|
45622
45666
|
}
|
|
@@ -48371,7 +48415,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
48371
48415
|
function functionsIn(object2) {
|
|
48372
48416
|
return object2 == null ? [] : baseFunctions(object2, keysIn(object2));
|
|
48373
48417
|
}
|
|
48374
|
-
function
|
|
48418
|
+
function get2(object2, path, defaultValue) {
|
|
48375
48419
|
var result2 = object2 == null ? undefined$1 : baseGet(object2, path);
|
|
48376
48420
|
return result2 === undefined$1 ? defaultValue : result2;
|
|
48377
48421
|
}
|
|
@@ -49229,7 +49273,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
49229
49273
|
lodash2.forInRight = forInRight;
|
|
49230
49274
|
lodash2.forOwn = forOwn;
|
|
49231
49275
|
lodash2.forOwnRight = forOwnRight;
|
|
49232
|
-
lodash2.get =
|
|
49276
|
+
lodash2.get = get2;
|
|
49233
49277
|
lodash2.gt = gt2;
|
|
49234
49278
|
lodash2.gte = gte;
|
|
49235
49279
|
lodash2.has = has;
|
|
@@ -50930,12 +50974,22 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
|
|
|
50930
50974
|
await validateResponse(res, `Failed to cancel task with id: ${taskId}`);
|
|
50931
50975
|
return true;
|
|
50932
50976
|
}
|
|
50977
|
+
function serializeNestedKey$1(key) {
|
|
50978
|
+
if (typeof key === "string") {
|
|
50979
|
+
return key;
|
|
50980
|
+
}
|
|
50981
|
+
if (isLoopVariable(key)) {
|
|
50982
|
+
const loopNested = key.nested.join(",");
|
|
50983
|
+
return `LoopVar:${key.uid}:${loopNested}`;
|
|
50984
|
+
}
|
|
50985
|
+
return String(key);
|
|
50986
|
+
}
|
|
50933
50987
|
function getUniqueIdentifier(variable, opts = {
|
|
50934
50988
|
useNested: true
|
|
50935
50989
|
}) {
|
|
50936
50990
|
let identifier = variable.uid;
|
|
50937
50991
|
if (opts.useNested && "nested" in variable) {
|
|
50938
|
-
identifier += variable.nested.join(",");
|
|
50992
|
+
identifier += variable.nested.map(serializeNestedKey$1).join(",");
|
|
50939
50993
|
}
|
|
50940
50994
|
return identifier;
|
|
50941
50995
|
}
|
|
@@ -64524,22 +64578,15 @@ ${String(error)}`;
|
|
|
64524
64578
|
selectorFamilyRegistry.set(
|
|
64525
64579
|
key,
|
|
64526
64580
|
Recoil_index_11({
|
|
64527
|
-
get: (currentExtras) => ({ get }) => {
|
|
64528
|
-
const variableValue =
|
|
64529
|
-
return resolveNested(
|
|
64530
|
-
variableValue,
|
|
64531
|
-
variable.nested.map((n2) => String(n2))
|
|
64532
|
-
);
|
|
64581
|
+
get: (currentExtras) => ({ get: get2 }) => {
|
|
64582
|
+
const variableValue = get2(family(currentExtras));
|
|
64583
|
+
return resolveNested(variableValue, variable.nested);
|
|
64533
64584
|
},
|
|
64534
64585
|
key,
|
|
64535
64586
|
set: (currentExtras) => ({ set: set2 }, newValue) => {
|
|
64536
64587
|
set2(
|
|
64537
64588
|
family(currentExtras),
|
|
64538
|
-
(v) => setNested(
|
|
64539
|
-
v,
|
|
64540
|
-
variable.nested.map((n2) => String(n2)),
|
|
64541
|
-
newValue
|
|
64542
|
-
)
|
|
64589
|
+
(v) => setNested(v, variable.nested, newValue)
|
|
64543
64590
|
);
|
|
64544
64591
|
}
|
|
64545
64592
|
})
|
|
@@ -64570,10 +64617,20 @@ ${String(error)}`;
|
|
|
64570
64617
|
function isPlaceholder(value) {
|
|
64571
64618
|
return typeof value === "object" && "__ref" in value;
|
|
64572
64619
|
}
|
|
64620
|
+
function serializeNestedKey(key) {
|
|
64621
|
+
if (typeof key === "string") {
|
|
64622
|
+
return key;
|
|
64623
|
+
}
|
|
64624
|
+
if (isLoopVariable(key)) {
|
|
64625
|
+
const loopNested = key.nested.join(",");
|
|
64626
|
+
return `LoopVar:${key.uid}:${loopNested}`;
|
|
64627
|
+
}
|
|
64628
|
+
return String(key);
|
|
64629
|
+
}
|
|
64573
64630
|
function getIdentifier$1(variable) {
|
|
64574
64631
|
let id = `${variable.__typename}:${variable.uid}`;
|
|
64575
64632
|
if ("nested" in variable && variable.nested.length > 0) {
|
|
64576
|
-
id += `:${variable.nested.join(",")}`;
|
|
64633
|
+
id += `:${variable.nested.map(serializeNestedKey).join(",")}`;
|
|
64577
64634
|
}
|
|
64578
64635
|
return id;
|
|
64579
64636
|
}
|
|
@@ -69825,7 +69882,7 @@ ${String(error)}`;
|
|
|
69825
69882
|
cachePolicy_UNSTABLE: {
|
|
69826
69883
|
eviction: "most-recent"
|
|
69827
69884
|
},
|
|
69828
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
69885
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
69829
69886
|
const resolvedVariables = await Promise.all(
|
|
69830
69887
|
variable.variables.map(async (v) => {
|
|
69831
69888
|
if (!isVariable(v)) {
|
|
@@ -69834,17 +69891,17 @@ ${String(error)}`;
|
|
|
69834
69891
|
return resolveVariable(v, wsClient, taskContext, extrasSerializable.extras);
|
|
69835
69892
|
})
|
|
69836
69893
|
);
|
|
69837
|
-
const selfTrigger =
|
|
69894
|
+
const selfTrigger = get2(getOrRegisterTrigger(variable));
|
|
69838
69895
|
const selectorKey = key + extrasSerializable.toJSON();
|
|
69839
69896
|
const triggerList = buildTriggerList(variable.variables);
|
|
69840
|
-
const triggers = registerChildTriggers(triggerList,
|
|
69897
|
+
const triggers = registerChildTriggers(triggerList, get2);
|
|
69841
69898
|
triggers.unshift(selfTrigger);
|
|
69842
69899
|
const derivedResult = resolveDerivedValue({
|
|
69843
69900
|
key: selectorKey,
|
|
69844
69901
|
variables: variable.variables,
|
|
69845
69902
|
deps: variable.deps,
|
|
69846
69903
|
resolvedVariables,
|
|
69847
|
-
resolutionStrategy: { name: "get", get },
|
|
69904
|
+
resolutionStrategy: { name: "get", get: get2 },
|
|
69848
69905
|
triggerList,
|
|
69849
69906
|
triggers
|
|
69850
69907
|
});
|
|
@@ -69874,7 +69931,7 @@ ${String(error)}`;
|
|
|
69874
69931
|
cachePolicy_UNSTABLE: {
|
|
69875
69932
|
eviction: "most-recent"
|
|
69876
69933
|
},
|
|
69877
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
69934
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
69878
69935
|
const selectorKey = key + extrasSerializable.toJSON();
|
|
69879
69936
|
const throwError = (error) => {
|
|
69880
69937
|
error.selectorId = key;
|
|
@@ -69894,7 +69951,7 @@ ${String(error)}`;
|
|
|
69894
69951
|
taskContext,
|
|
69895
69952
|
extrasSerializable.extras
|
|
69896
69953
|
);
|
|
69897
|
-
let derivedResult =
|
|
69954
|
+
let derivedResult = get2(dvResultSelector);
|
|
69898
69955
|
if (derivedResult.type === "previous") {
|
|
69899
69956
|
return derivedResult.entry.result;
|
|
69900
69957
|
}
|
|
@@ -69991,14 +70048,14 @@ ${String(error)}`;
|
|
|
69991
70048
|
selectorFamilyRegistry.set(
|
|
69992
70049
|
key,
|
|
69993
70050
|
Recoil_index_11({
|
|
69994
|
-
get: (extrasSerializable) => ({ get }) => {
|
|
70051
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
69995
70052
|
const dvSelector = getOrRegisterDerivedVariableValue(
|
|
69996
70053
|
variable,
|
|
69997
70054
|
wsClient,
|
|
69998
70055
|
taskContext,
|
|
69999
70056
|
extrasSerializable.extras
|
|
70000
70057
|
);
|
|
70001
|
-
const value =
|
|
70058
|
+
const value = get2(dvSelector);
|
|
70002
70059
|
return "nested" in variable ? resolveNested(value, variable.nested) : value;
|
|
70003
70060
|
},
|
|
70004
70061
|
key: nanoid$1()
|
|
@@ -70890,12 +70947,12 @@ ${String(error)}`;
|
|
|
70890
70947
|
unescapePathComponent
|
|
70891
70948
|
});
|
|
70892
70949
|
var getExports = requireGet();
|
|
70893
|
-
const
|
|
70950
|
+
const get = /* @__PURE__ */ getDefaultExportFromCjs(getExports);
|
|
70894
70951
|
function extractKey(item, keyAccessor) {
|
|
70895
70952
|
if (item === null || item === void 0) {
|
|
70896
70953
|
return void 0;
|
|
70897
70954
|
}
|
|
70898
|
-
const key =
|
|
70955
|
+
const key = get(item, keyAccessor);
|
|
70899
70956
|
if (typeof key === "string" || typeof key === "number") {
|
|
70900
70957
|
return key;
|
|
70901
70958
|
}
|
|
@@ -71187,7 +71244,7 @@ ${String(error)}`;
|
|
|
71187
71244
|
key,
|
|
71188
71245
|
Recoil_index_11({
|
|
71189
71246
|
key: nanoid$1(),
|
|
71190
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
71247
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
71191
71248
|
const resolvedVariables = await Promise.all(
|
|
71192
71249
|
variable.variables.map(async (v) => {
|
|
71193
71250
|
if (!isVariable(v)) {
|
|
@@ -71197,8 +71254,8 @@ ${String(error)}`;
|
|
|
71197
71254
|
})
|
|
71198
71255
|
);
|
|
71199
71256
|
const triggerList = buildTriggerList(variable.variables);
|
|
71200
|
-
registerChildTriggers(triggerList,
|
|
71201
|
-
const resolvedValues = resolvedVariables.map((v) => resolveValue(v,
|
|
71257
|
+
registerChildTriggers(triggerList, get2);
|
|
71258
|
+
const resolvedValues = resolvedVariables.map((v) => resolveValue(v, get2));
|
|
71202
71259
|
const params = {
|
|
71203
71260
|
uid: variable.uid,
|
|
71204
71261
|
resolvedValues,
|
|
@@ -71227,19 +71284,19 @@ ${String(error)}`;
|
|
|
71227
71284
|
key,
|
|
71228
71285
|
Recoil_index_11({
|
|
71229
71286
|
key: nanoid$1(),
|
|
71230
|
-
get: (extrasSerializable) => ({ get }) => {
|
|
71287
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
71231
71288
|
const paramsSelector = getOrRegisterStreamVariableParams(
|
|
71232
71289
|
variable,
|
|
71233
71290
|
client2,
|
|
71234
71291
|
taskContext,
|
|
71235
71292
|
extrasSerializable.extras
|
|
71236
71293
|
);
|
|
71237
|
-
const atomKey =
|
|
71294
|
+
const atomKey = get2(paramsSelector);
|
|
71238
71295
|
const atom2 = streamAtomFamily(atomKey);
|
|
71239
71296
|
if (!streamAtomRegistry.has(atomKey)) {
|
|
71240
71297
|
streamAtomRegistry.set(atomKey, atom2);
|
|
71241
71298
|
}
|
|
71242
|
-
const streamState =
|
|
71299
|
+
const streamState = get2(atom2);
|
|
71243
71300
|
return getStreamValue(streamState, variable.key_accessor);
|
|
71244
71301
|
}
|
|
71245
71302
|
})
|
|
@@ -71261,14 +71318,14 @@ ${String(error)}`;
|
|
|
71261
71318
|
key,
|
|
71262
71319
|
Recoil_index_11({
|
|
71263
71320
|
key: nanoid$1(),
|
|
71264
|
-
get: (extrasSerializable) => ({ get }) => {
|
|
71321
|
+
get: (extrasSerializable) => ({ get: get2 }) => {
|
|
71265
71322
|
const valueSelector = getOrRegisterStreamVariableValue(
|
|
71266
71323
|
variable,
|
|
71267
71324
|
client2,
|
|
71268
71325
|
taskContext,
|
|
71269
71326
|
extrasSerializable.extras
|
|
71270
71327
|
);
|
|
71271
|
-
const value =
|
|
71328
|
+
const value = get2(valueSelector);
|
|
71272
71329
|
return "nested" in variable ? resolveNested(value, variable.nested) : value;
|
|
71273
71330
|
}
|
|
71274
71331
|
})
|
|
@@ -71307,10 +71364,11 @@ ${String(error)}`;
|
|
|
71307
71364
|
}
|
|
71308
71365
|
let returnVal = obj;
|
|
71309
71366
|
for (const key of nested) {
|
|
71310
|
-
|
|
71367
|
+
const stringKey = key;
|
|
71368
|
+
if (!Object.keys(returnVal).includes(stringKey)) {
|
|
71311
71369
|
return null;
|
|
71312
71370
|
}
|
|
71313
|
-
returnVal = returnVal[
|
|
71371
|
+
returnVal = returnVal[stringKey];
|
|
71314
71372
|
}
|
|
71315
71373
|
return returnVal;
|
|
71316
71374
|
}
|
|
@@ -71347,6 +71405,7 @@ ${String(error)}`;
|
|
|
71347
71405
|
type: "derived",
|
|
71348
71406
|
uid: variable.uid,
|
|
71349
71407
|
values,
|
|
71408
|
+
// After templating, nested should be all strings
|
|
71350
71409
|
nested: variable.nested
|
|
71351
71410
|
};
|
|
71352
71411
|
}
|
|
@@ -71391,6 +71450,7 @@ ${String(error)}`;
|
|
|
71391
71450
|
type: "derived",
|
|
71392
71451
|
uid: variable.uid,
|
|
71393
71452
|
values,
|
|
71453
|
+
// After templating, nested should be all strings
|
|
71394
71454
|
nested: variable.nested
|
|
71395
71455
|
};
|
|
71396
71456
|
}
|
|
@@ -72444,7 +72504,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
72444
72504
|
cachePolicy_UNSTABLE: {
|
|
72445
72505
|
eviction: "most-recent"
|
|
72446
72506
|
},
|
|
72447
|
-
get: (extrasSerializable) => async ({ get }) => {
|
|
72507
|
+
get: (extrasSerializable) => async ({ get: get2 }) => {
|
|
72448
72508
|
const throwError = (error) => {
|
|
72449
72509
|
error.selectorId = key;
|
|
72450
72510
|
error.selectorExtras = extrasSerializable.toJSON();
|
|
@@ -72466,9 +72526,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
72466
72526
|
const resolvedKwargsList = Object.values(resolvedKwargs);
|
|
72467
72527
|
const kwargsList = Object.values(dynamicKwargs);
|
|
72468
72528
|
const triggerAtom = getOrRegisterComponentTrigger(uid2, loop_instance_uid);
|
|
72469
|
-
const selfTrigger =
|
|
72529
|
+
const selfTrigger = get2(triggerAtom);
|
|
72470
72530
|
const triggerList = buildTriggerList(kwargsList);
|
|
72471
|
-
const triggers = registerChildTriggers(triggerList,
|
|
72531
|
+
const triggers = registerChildTriggers(triggerList, get2);
|
|
72472
72532
|
triggers.unshift(selfTrigger);
|
|
72473
72533
|
const { extras } = extrasSerializable;
|
|
72474
72534
|
let derivedResult = resolveDerivedValue({
|
|
@@ -72476,7 +72536,7 @@ Inferred class string: "${iconClasses}."`
|
|
|
72476
72536
|
variables: kwargsList,
|
|
72477
72537
|
deps: kwargsList,
|
|
72478
72538
|
resolvedVariables: resolvedKwargsList,
|
|
72479
|
-
resolutionStrategy: { name: "get", get },
|
|
72539
|
+
resolutionStrategy: { name: "get", get: get2 },
|
|
72480
72540
|
triggerList,
|
|
72481
72541
|
triggers
|
|
72482
72542
|
});
|
|
@@ -72768,6 +72828,9 @@ Inferred class string: "${iconClasses}."`
|
|
|
72768
72828
|
}
|
|
72769
72829
|
var isPlainObjectExports = requireIsPlainObject();
|
|
72770
72830
|
const isPlainObject = /* @__PURE__ */ getDefaultExportFromCjs(isPlainObjectExports);
|
|
72831
|
+
function isVariableWithNested(value) {
|
|
72832
|
+
return value && typeof value === "object" && "__typename" in value && typeof value.__typename === "string" && value.__typename.includes("Variable") && "nested" in value && Array.isArray(value.nested);
|
|
72833
|
+
}
|
|
72771
72834
|
function createMarkers(scope, loopInstanceUid) {
|
|
72772
72835
|
const markers = [];
|
|
72773
72836
|
if (scope.action) {
|
|
@@ -72807,6 +72870,33 @@ Inferred class string: "${iconClasses}."`
|
|
|
72807
72870
|
);
|
|
72808
72871
|
continue;
|
|
72809
72872
|
}
|
|
72873
|
+
if (isVariableWithNested(value) && !isLoopVariable(value)) {
|
|
72874
|
+
for (let i2 = 0; i2 < value.nested.length; i2++) {
|
|
72875
|
+
const nestedKey = value.nested[i2];
|
|
72876
|
+
if (isLoopVariable(nestedKey)) {
|
|
72877
|
+
markers.push({
|
|
72878
|
+
type: "nested_loop_var",
|
|
72879
|
+
path: dotPath,
|
|
72880
|
+
nestedIndex: i2,
|
|
72881
|
+
loopVarNested: nestedKey.nested
|
|
72882
|
+
});
|
|
72883
|
+
if (isDerivedVariable(value)) {
|
|
72884
|
+
markers.push({
|
|
72885
|
+
type: "derived_var",
|
|
72886
|
+
path: dotPath,
|
|
72887
|
+
loopInstanceUid: nestedKey.uid
|
|
72888
|
+
});
|
|
72889
|
+
}
|
|
72890
|
+
if (isPyComponent(value)) {
|
|
72891
|
+
markers.push({
|
|
72892
|
+
type: "server_component",
|
|
72893
|
+
path: dotPath,
|
|
72894
|
+
loopInstanceUid: nestedKey.uid
|
|
72895
|
+
});
|
|
72896
|
+
}
|
|
72897
|
+
}
|
|
72898
|
+
}
|
|
72899
|
+
}
|
|
72810
72900
|
if (isPlainObject(value) || Array.isArray(value)) {
|
|
72811
72901
|
const newScope = updateScope(scope, value, dotPath);
|
|
72812
72902
|
walk(value, [...pathSegments, key], newScope);
|
|
@@ -72847,6 +72937,14 @@ Inferred class string: "${iconClasses}."`
|
|
|
72847
72937
|
set(clonedRenderer, marker.path, value);
|
|
72848
72938
|
break;
|
|
72849
72939
|
}
|
|
72940
|
+
case "nested_loop_var": {
|
|
72941
|
+
const resolvedKey = resolveNested(loopValue, marker.loopVarNested);
|
|
72942
|
+
const variable = get(clonedRenderer, marker.path);
|
|
72943
|
+
if (variable && Array.isArray(variable.nested)) {
|
|
72944
|
+
variable.nested[marker.nestedIndex] = String(resolvedKey);
|
|
72945
|
+
}
|
|
72946
|
+
break;
|
|
72947
|
+
}
|
|
72850
72948
|
case "action": {
|
|
72851
72949
|
set(clonedRenderer, `${marker.path}.loading.uid`, nanoid$1());
|
|
72852
72950
|
break;
|
|
@@ -22,6 +22,7 @@ import uuid
|
|
|
22
22
|
from collections.abc import Awaitable, Callable
|
|
23
23
|
from inspect import Parameter, signature
|
|
24
24
|
from typing import (
|
|
25
|
+
TYPE_CHECKING,
|
|
25
26
|
Any,
|
|
26
27
|
Generic,
|
|
27
28
|
Protocol,
|
|
@@ -41,6 +42,15 @@ from pydantic import (
|
|
|
41
42
|
)
|
|
42
43
|
from typing_extensions import TypedDict, TypeVar, runtime_checkable
|
|
43
44
|
|
|
45
|
+
if TYPE_CHECKING:
|
|
46
|
+
from dara.core.interactivity.loop_variable import LoopVariable
|
|
47
|
+
|
|
48
|
+
# Type alias for static type checking
|
|
49
|
+
NestedKey = str | LoopVariable
|
|
50
|
+
else:
|
|
51
|
+
# At runtime, use Any to avoid forward reference issues with Pydantic
|
|
52
|
+
NestedKey = Any
|
|
53
|
+
|
|
44
54
|
from dara.core.base_definitions import (
|
|
45
55
|
BaseCachePolicy,
|
|
46
56
|
BaseTask,
|
|
@@ -172,7 +182,7 @@ class DerivedVariable(ClientVariable, Generic[VariableType]):
|
|
|
172
182
|
variables: list[AnyVariable]
|
|
173
183
|
polling_interval: int | None
|
|
174
184
|
deps: list[AnyVariable] | None = Field(validate_default=True)
|
|
175
|
-
nested: list[
|
|
185
|
+
nested: list[NestedKey] = Field(default_factory=list)
|
|
176
186
|
uid: str
|
|
177
187
|
model_config = ConfigDict(extra='forbid', use_enum_values=True, arbitrary_types_allowed=True)
|
|
178
188
|
|
|
@@ -185,7 +195,7 @@ class DerivedVariable(ClientVariable, Generic[VariableType]):
|
|
|
185
195
|
polling_interval: int | None = None,
|
|
186
196
|
deps: list[AnyVariable] | None = None,
|
|
187
197
|
uid: str | None = None,
|
|
188
|
-
nested: list[
|
|
198
|
+
nested: list[NestedKey] | None = None,
|
|
189
199
|
filter_resolver: FilterResolver | None = None,
|
|
190
200
|
**kwargs,
|
|
191
201
|
):
|
|
@@ -271,7 +281,14 @@ class DerivedVariable(ClientVariable, Generic[VariableType]):
|
|
|
271
281
|
|
|
272
282
|
return deps
|
|
273
283
|
|
|
274
|
-
def get(self, key:
|
|
284
|
+
def get(self, key: NestedKey):
|
|
285
|
+
"""
|
|
286
|
+
Create a copy of this DerivedVariable that points to a nested key.
|
|
287
|
+
|
|
288
|
+
The key can be a string or a LoopVariable for dynamic access within a For loop.
|
|
289
|
+
|
|
290
|
+
:param key: the key to access; can be a string or LoopVariable
|
|
291
|
+
"""
|
|
275
292
|
return self.model_copy(update={'nested': [*self.nested, key]}, deep=True)
|
|
276
293
|
|
|
277
294
|
def trigger(self, force: bool = True):
|
|
@@ -21,7 +21,7 @@ import warnings
|
|
|
21
21
|
from collections.abc import Callable
|
|
22
22
|
from contextlib import contextmanager
|
|
23
23
|
from contextvars import ContextVar
|
|
24
|
-
from typing import Any, Generic
|
|
24
|
+
from typing import TYPE_CHECKING, Any, Generic
|
|
25
25
|
|
|
26
26
|
from fastapi.encoders import jsonable_encoder
|
|
27
27
|
from pydantic import (
|
|
@@ -40,6 +40,15 @@ from dara.core.internal.utils import call_async
|
|
|
40
40
|
from dara.core.logging import dev_logger
|
|
41
41
|
from dara.core.persistence import BackendStore, BrowserStore, PersistenceStore
|
|
42
42
|
|
|
43
|
+
if TYPE_CHECKING:
|
|
44
|
+
from dara.core.interactivity.loop_variable import LoopVariable
|
|
45
|
+
|
|
46
|
+
# Type alias for static type checking
|
|
47
|
+
NestedKey = str | LoopVariable
|
|
48
|
+
else:
|
|
49
|
+
# At runtime, use Any to avoid forward reference issues with Pydantic
|
|
50
|
+
NestedKey = Any
|
|
51
|
+
|
|
43
52
|
VARIABLE_INIT_OVERRIDE = ContextVar[Callable[[dict], dict] | None]('VARIABLE_INIT_OVERRIDE', default=None)
|
|
44
53
|
|
|
45
54
|
VariableType = TypeVar('VariableType')
|
|
@@ -56,7 +65,7 @@ class Variable(ClientVariable, Generic[VariableType, PersistenceStoreType_co]):
|
|
|
56
65
|
default: VariableType | None = None
|
|
57
66
|
store: SerializeAsAny[PersistenceStoreType_co | None] = None
|
|
58
67
|
uid: str
|
|
59
|
-
nested: list[
|
|
68
|
+
nested: list[NestedKey] = Field(default_factory=list)
|
|
60
69
|
model_config = ConfigDict(extra='forbid')
|
|
61
70
|
|
|
62
71
|
def __init__(
|
|
@@ -65,7 +74,7 @@ class Variable(ClientVariable, Generic[VariableType, PersistenceStoreType_co]):
|
|
|
65
74
|
persist_value: bool | None = False,
|
|
66
75
|
uid: str | None = None,
|
|
67
76
|
store: PersistenceStoreType_co | None = None,
|
|
68
|
-
nested: list[
|
|
77
|
+
nested: list[NestedKey] | None = None,
|
|
69
78
|
**kwargs,
|
|
70
79
|
):
|
|
71
80
|
"""
|
|
@@ -144,11 +153,13 @@ class Variable(ClientVariable, Generic[VariableType, PersistenceStoreType_co]):
|
|
|
144
153
|
yield
|
|
145
154
|
VARIABLE_INIT_OVERRIDE.reset(token)
|
|
146
155
|
|
|
147
|
-
def get(self, key:
|
|
156
|
+
def get(self, key: NestedKey):
|
|
148
157
|
"""
|
|
149
158
|
Create a copy of this Variable that points to a nested key. This is useful when
|
|
150
159
|
storing e.g. a dictionary in a Variable and wanting to access a specific key.
|
|
151
160
|
|
|
161
|
+
The key can be a string or a LoopVariable for dynamic access within a For loop.
|
|
162
|
+
|
|
152
163
|
```python
|
|
153
164
|
from dara.core import Variable, UpdateVariable
|
|
154
165
|
from dara_dashboarding_extension import Input, Text, Stack, Button
|
|
@@ -177,7 +188,11 @@ class Variable(ClientVariable, Generic[VariableType, PersistenceStoreType_co]):
|
|
|
177
188
|
)
|
|
178
189
|
)
|
|
179
190
|
|
|
180
|
-
|
|
191
|
+
# Dynamic access using LoopVariable
|
|
192
|
+
items = Variable([{'id': 'a'}, {'id': 'b'}])
|
|
193
|
+
For(items=items, renderer=Input(value=state.get(items.list_item.get('id'))))
|
|
194
|
+
|
|
195
|
+
:param key: the key to access; can be a string or LoopVariable
|
|
181
196
|
```
|
|
182
197
|
"""
|
|
183
198
|
return self.model_copy(update={'nested': [*self.nested, key]}, deep=True)
|
|
@@ -21,12 +21,21 @@ import asyncio
|
|
|
21
21
|
import contextlib
|
|
22
22
|
from collections.abc import AsyncGenerator, Callable
|
|
23
23
|
from dataclasses import dataclass
|
|
24
|
-
from typing import Any, Generic, Literal
|
|
24
|
+
from typing import TYPE_CHECKING, Any, Generic, Literal
|
|
25
25
|
|
|
26
26
|
from fastapi import Request
|
|
27
27
|
from pydantic import ConfigDict, Field, SerializerFunctionWrapHandler, field_validator, model_serializer
|
|
28
28
|
from typing_extensions import TypeVar
|
|
29
29
|
|
|
30
|
+
if TYPE_CHECKING:
|
|
31
|
+
from dara.core.interactivity.loop_variable import LoopVariable
|
|
32
|
+
|
|
33
|
+
# Type alias for static type checking
|
|
34
|
+
NestedKey = str | LoopVariable
|
|
35
|
+
else:
|
|
36
|
+
# At runtime, use Any to avoid forward reference issues with Pydantic
|
|
37
|
+
NestedKey = Any
|
|
38
|
+
|
|
30
39
|
from dara.core.base_definitions import BaseTask
|
|
31
40
|
from dara.core.interactivity.any_variable import AnyVariable
|
|
32
41
|
from dara.core.interactivity.client_variable import ClientVariable
|
|
@@ -119,7 +128,7 @@ class StreamVariable(ClientVariable, Generic[VariableType]):
|
|
|
119
128
|
uid: str
|
|
120
129
|
variables: list[AnyVariable] = Field(default_factory=list)
|
|
121
130
|
key_accessor: str | None = None
|
|
122
|
-
nested: list[
|
|
131
|
+
nested: list[NestedKey] = Field(default_factory=list)
|
|
123
132
|
|
|
124
133
|
model_config = ConfigDict(extra='forbid')
|
|
125
134
|
|
|
@@ -160,7 +169,7 @@ class StreamVariable(ClientVariable, Generic[VariableType]):
|
|
|
160
169
|
variables: list[AnyVariable] | None = None,
|
|
161
170
|
key_accessor: str | None = None,
|
|
162
171
|
uid: str | None = None,
|
|
163
|
-
nested: list[
|
|
172
|
+
nested: list[NestedKey] | None = None,
|
|
164
173
|
**kwargs,
|
|
165
174
|
):
|
|
166
175
|
"""
|
|
@@ -201,13 +210,15 @@ class StreamVariable(ClientVariable, Generic[VariableType]):
|
|
|
201
210
|
),
|
|
202
211
|
)
|
|
203
212
|
|
|
204
|
-
def get(self, *keys:
|
|
213
|
+
def get(self, *keys: NestedKey) -> StreamVariable[Any]:
|
|
205
214
|
"""
|
|
206
215
|
Access a nested value within the stream's accumulated state.
|
|
207
216
|
|
|
208
217
|
This is useful when the stream accumulates complex state (via snapshot/patch)
|
|
209
218
|
and you want to access a specific part of it.
|
|
210
219
|
|
|
220
|
+
Keys can be strings or LoopVariables for dynamic access within a For loop.
|
|
221
|
+
|
|
211
222
|
Example::
|
|
212
223
|
|
|
213
224
|
dashboard = StreamVariable(dashboard_stream, variables=[id_var])
|
|
@@ -215,11 +226,20 @@ class StreamVariable(ClientVariable, Generic[VariableType]):
|
|
|
215
226
|
# Access nested value
|
|
216
227
|
Text(dashboard.get('meta', 'count'))
|
|
217
228
|
|
|
229
|
+
# Dynamic access using LoopVariable
|
|
230
|
+
items = Variable([{'id': 'a'}, {'id': 'b'}])
|
|
231
|
+
For(items=items, renderer=Text(dashboard.get(items.list_item.get('id'))))
|
|
232
|
+
|
|
218
233
|
:param keys: One or more keys to traverse into the nested structure.
|
|
234
|
+
Can be strings or LoopVariables.
|
|
219
235
|
:return: A new StreamVariable pointing to the nested path.
|
|
220
236
|
"""
|
|
237
|
+
from dara.core.interactivity.loop_variable import LoopVariable
|
|
238
|
+
|
|
239
|
+
# Preserve LoopVariables as-is, convert other types to strings
|
|
240
|
+
processed_keys: list[NestedKey] = [k if isinstance(k, LoopVariable) else str(k) for k in keys]
|
|
221
241
|
return self.model_copy(
|
|
222
|
-
update={'nested': [*self.nested, *
|
|
242
|
+
update={'nested': [*self.nested, *processed_keys]},
|
|
223
243
|
deep=True,
|
|
224
244
|
)
|
|
225
245
|
|
|
@@ -17,6 +17,7 @@ limitations under the License.
|
|
|
17
17
|
|
|
18
18
|
from typing import Any, Literal, TypeGuard
|
|
19
19
|
|
|
20
|
+
from pydantic import BaseModel
|
|
20
21
|
from typing_extensions import TypedDict
|
|
21
22
|
|
|
22
23
|
from dara.core.base_definitions import BaseTask, PendingTask
|
|
@@ -75,16 +76,27 @@ def _resolve_nested(value: Any, nested: list[str] | None) -> Any:
|
|
|
75
76
|
if not nested or len(nested) == 0:
|
|
76
77
|
return value
|
|
77
78
|
|
|
78
|
-
# Not a dict
|
|
79
|
-
if value is None or not isinstance(value, dict):
|
|
79
|
+
# Not a dict/model
|
|
80
|
+
if value is None or not isinstance(value, (dict, BaseModel)):
|
|
80
81
|
return value
|
|
81
82
|
|
|
82
83
|
result = value
|
|
83
84
|
for key in nested:
|
|
84
|
-
#
|
|
85
|
-
if
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
# Defensive check: LoopVariable should have been resolved by frontend templating
|
|
86
|
+
if isinstance(key, dict):
|
|
87
|
+
raise ValueError(
|
|
88
|
+
'LoopVariable found in nested path during backend resolution. '
|
|
89
|
+
'This should have been resolved by frontend templating.'
|
|
90
|
+
)
|
|
91
|
+
# Can recurse into a dict or a pydantic model
|
|
92
|
+
if isinstance(result, dict):
|
|
93
|
+
# Path does not exist, resolve to None
|
|
94
|
+
if key not in result:
|
|
95
|
+
return None
|
|
96
|
+
result = result[key]
|
|
97
|
+
elif isinstance(result, BaseModel):
|
|
98
|
+
# fall back to None, if key doesn't exist/is None, we'll skip iterating anyway
|
|
99
|
+
result = getattr(result, key, None)
|
|
88
100
|
|
|
89
101
|
return result
|
|
90
102
|
|
|
@@ -21,7 +21,6 @@ from typing import (
|
|
|
21
21
|
Generic,
|
|
22
22
|
TypeGuard,
|
|
23
23
|
TypeVar,
|
|
24
|
-
cast,
|
|
25
24
|
overload,
|
|
26
25
|
)
|
|
27
26
|
|
|
@@ -57,13 +56,26 @@ class Referrable(TypedDict):
|
|
|
57
56
|
|
|
58
57
|
|
|
59
58
|
class ReferrableWithNested(Referrable):
|
|
60
|
-
nested: list[str]
|
|
59
|
+
nested: list[str | dict] # dict represents serialized LoopVariable
|
|
61
60
|
|
|
62
61
|
|
|
63
62
|
class ReferrableWithFilters(Referrable):
|
|
64
63
|
filters: dict
|
|
65
64
|
|
|
66
65
|
|
|
66
|
+
def _serialize_nested_key(key: str | dict) -> str:
|
|
67
|
+
"""
|
|
68
|
+
Serialize a single nested key for identifier computation.
|
|
69
|
+
|
|
70
|
+
Handles both string keys and LoopVariable dicts.
|
|
71
|
+
"""
|
|
72
|
+
if isinstance(key, dict) and key.get('__typename') == 'LoopVariable':
|
|
73
|
+
# Format: LoopVar:uid:nested.joined
|
|
74
|
+
loop_nested = ','.join(key.get('nested', []))
|
|
75
|
+
return f'LoopVar:{key["uid"]}:{loop_nested}'
|
|
76
|
+
return str(key)
|
|
77
|
+
|
|
78
|
+
|
|
67
79
|
def _get_identifier(obj: Referrable) -> str:
|
|
68
80
|
"""
|
|
69
81
|
Get a unique identifier from a 'referrable' object
|
|
@@ -74,7 +86,9 @@ def _get_identifier(obj: Referrable) -> str:
|
|
|
74
86
|
|
|
75
87
|
# If it's a Variable with 'nested', the property should be included in the identifier
|
|
76
88
|
if _is_referrable_nested(obj) and len(obj['nested']) > 0:
|
|
77
|
-
|
|
89
|
+
# Handle mixed string/LoopVariable nested
|
|
90
|
+
nested_parts = [_serialize_nested_key(k) for k in obj['nested']]
|
|
91
|
+
nested = ','.join(nested_parts)
|
|
78
92
|
identifier = f'{identifier}:{nested}'
|
|
79
93
|
|
|
80
94
|
return identifier
|
|
@@ -4,6 +4,14 @@ from dara.core.definitions import ComponentInstance
|
|
|
4
4
|
from dara.core.interactivity.derived_variable import DerivedVariable
|
|
5
5
|
from dara.core.visual.dynamic_component import PyComponentInstance
|
|
6
6
|
|
|
7
|
+
# Control flow components have conditional children that shouldn't be preloaded
|
|
8
|
+
# since only one branch will actually render at runtime
|
|
9
|
+
CONTROL_FLOW_SKIP_ATTRS: dict[str, set[str]] = {
|
|
10
|
+
'If': {'true_children', 'false_children'},
|
|
11
|
+
'Match': {'when', 'default'},
|
|
12
|
+
'For': {'renderer', 'placeholder'},
|
|
13
|
+
}
|
|
14
|
+
|
|
7
15
|
|
|
8
16
|
class DependencyGraph(BaseModel):
|
|
9
17
|
"""
|
|
@@ -33,6 +41,9 @@ class DependencyGraph(BaseModel):
|
|
|
33
41
|
def _analyze_component_dependencies(component: ComponentInstance, graph: DependencyGraph) -> None:
|
|
34
42
|
"""
|
|
35
43
|
Recursively analyze a component tree to build a dependency graph of DerivedVariables and PyComponentInstances.
|
|
44
|
+
|
|
45
|
+
Note: Control flow components (If, Match, For) are treated as boundaries - their conditional
|
|
46
|
+
child properties are not recursed into since only one branch will render at runtime.
|
|
36
47
|
"""
|
|
37
48
|
try:
|
|
38
49
|
from dara.components import Table
|
|
@@ -45,8 +56,15 @@ def _analyze_component_dependencies(component: ComponentInstance, graph: Depende
|
|
|
45
56
|
graph.py_components[component.uid] = component
|
|
46
57
|
return
|
|
47
58
|
|
|
59
|
+
# Get properties to skip for control flow components
|
|
60
|
+
component_name = type(component).__name__
|
|
61
|
+
skip_attrs = CONTROL_FLOW_SKIP_ATTRS.get(component_name, set())
|
|
62
|
+
|
|
48
63
|
# otherwise check each field
|
|
49
64
|
for attr in component.model_fields_set:
|
|
65
|
+
# Skip conditional child properties of control flow components
|
|
66
|
+
if attr in skip_attrs:
|
|
67
|
+
continue
|
|
50
68
|
value = getattr(component, attr, None)
|
|
51
69
|
|
|
52
70
|
# Handle encountered variables and py_components
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: dara-core
|
|
3
|
-
Version: 1.25.
|
|
3
|
+
Version: 1.25.1
|
|
4
4
|
Summary: Dara Framework Core
|
|
5
5
|
Home-page: https://dara.causalens.com/
|
|
6
6
|
License: Apache-2.0
|
|
@@ -21,10 +21,10 @@ Requires-Dist: cachetools (>=5.0.0)
|
|
|
21
21
|
Requires-Dist: certifi (>=2024.7.4)
|
|
22
22
|
Requires-Dist: click (>=8.1.3,<9.0.0)
|
|
23
23
|
Requires-Dist: colorama (>=0.4.6,<0.5.0)
|
|
24
|
-
Requires-Dist: create-dara-app (==1.25.
|
|
24
|
+
Requires-Dist: create-dara-app (==1.25.1)
|
|
25
25
|
Requires-Dist: croniter (>=6.0.0,<7.0.0)
|
|
26
26
|
Requires-Dist: cryptography (>=42.0.4)
|
|
27
|
-
Requires-Dist: dara-components (==1.25.
|
|
27
|
+
Requires-Dist: dara-components (==1.25.1) ; extra == "all"
|
|
28
28
|
Requires-Dist: exceptiongroup (>=1.1.3,<2.0.0)
|
|
29
29
|
Requires-Dist: fastapi (>=0.115.0,<0.121.0)
|
|
30
30
|
Requires-Dist: fastapi_vite_dara (==0.4.0)
|
|
@@ -55,7 +55,7 @@ Description-Content-Type: text/markdown
|
|
|
55
55
|
|
|
56
56
|
# Dara Application Framework
|
|
57
57
|
|
|
58
|
-
<img src="https://github.com/causalens/dara/blob/v1.25.
|
|
58
|
+
<img src="https://github.com/causalens/dara/blob/v1.25.1/img/dara_light.svg?raw=true">
|
|
59
59
|
|
|
60
60
|

|
|
61
61
|
[](https://www.apache.org/licenses/LICENSE-2.0)
|
|
@@ -100,7 +100,7 @@ source .venv/bin/activate
|
|
|
100
100
|
dara start
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-

|
|
104
104
|
|
|
105
105
|
Note: `pip` installation uses [PEP 660](https://peps.python.org/pep-0660/) `pyproject.toml`-based editable installs which require `pip >= 21.3` and `setuptools >= 64.0.0`. You can upgrade both with:
|
|
106
106
|
|
|
@@ -117,9 +117,9 @@ Explore some of our favorite apps - a great way of getting started and getting t
|
|
|
117
117
|
|
|
118
118
|
| Dara App | Description |
|
|
119
119
|
| -------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
|
-
|  | Demonstrates how to use incorporate a LLM chat box into your decision app to understand model insights |
|
|
121
|
+
|  | Demonstrates how to enable the user to interact with plots, trigger actions based on clicks, mouse movements and other interactions with `Bokeh` or `Plotly` plots |
|
|
122
|
+
|  | Demonstrates how to use the `CausalGraphViewer` component to display your graphs or networks, customising the displayed information through colors and tooltips, and updating the page based on user interaction. |
|
|
123
123
|
|
|
124
124
|
Check out our [App Gallery](https://dara.causalens.com/gallery) for more inspiration!
|
|
125
125
|
|
|
@@ -146,9 +146,9 @@ And the supporting UI packages and tools.
|
|
|
146
146
|
- `ui-utils` - miscellaneous utility functions
|
|
147
147
|
- `ui-widgets` - widget components
|
|
148
148
|
|
|
149
|
-
More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.25.
|
|
149
|
+
More information on the repository structure can be found in the [CONTRIBUTING.md](https://github.com/causalens/dara/blob/v1.25.1/CONTRIBUTING.md) file.
|
|
150
150
|
|
|
151
151
|
## License
|
|
152
152
|
|
|
153
|
-
Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.25.
|
|
153
|
+
Dara is open-source and licensed under the [Apache 2.0 License](https://github.com/causalens/dara/blob/v1.25.1/LICENSE).
|
|
154
154
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
dara/core/__init__.py,sha256=yTp-lXT0yy9XqLGYWlmjPgFG5g2eEg2KhKo8KheTHoo,1408
|
|
2
2
|
dara/core/_assets/__init__.py,sha256=13vMoWHvl1zcFcjNHh8lbTwWOvu4f7krYSco978qxwM,723
|
|
3
3
|
dara/core/_assets/auto_js/dara.core.css,sha256=yT3PKpi2sKI2-kQIF8xtVbTPQqgpK7-Ua7tfzDPuSsI,4095881
|
|
4
|
-
dara/core/_assets/auto_js/dara.core.umd.cjs,sha256=
|
|
4
|
+
dara/core/_assets/auto_js/dara.core.umd.cjs,sha256=lVOHHDvZZflaUaIa3Cgx41JXU-2NyFCb8kD49Z8qIZ4,5191480
|
|
5
5
|
dara/core/_assets/auto_js/react-dom.development.js,sha256=vR2Fq5LXMKS5JsTo2CMl6oGCJT8scJV2wXSteTtx8aE,1077040
|
|
6
6
|
dara/core/_assets/auto_js/react-is.development.js,sha256=2IRgmaphdMq6wx2MbsmVUQ0UwapGETNjgano3XEkGcc,7932
|
|
7
7
|
dara/core/_assets/auto_js/react-query.development.js,sha256=lI2fTKMvWmjbagGQaVtZYr51_-C_U_so064JwetuDS0,130366
|
|
@@ -37,16 +37,16 @@ dara/core/interactivity/client_variable.py,sha256=Ku59TBDXrqEsMkc-upQ_GspWqHGBdt
|
|
|
37
37
|
dara/core/interactivity/condition.py,sha256=BHfRA5kkULBjLbS9Q2NpkWUxcCicm0aKTTrsEWQQCVE,1567
|
|
38
38
|
dara/core/interactivity/data_variable.py,sha256=FJ6vtsZ-39C2KrOIaxSnjOBCD0mOHjvunMUkUjXon6Q,2500
|
|
39
39
|
dara/core/interactivity/derived_data_variable.py,sha256=nfHYrd2a4dT7penr2JhPVnHAv3MGpKn1pIIF5mh4xQo,3611
|
|
40
|
-
dara/core/interactivity/derived_variable.py,sha256=
|
|
40
|
+
dara/core/interactivity/derived_variable.py,sha256=pTB1w9j9Xlxxv2WoWS4O5ccMkrnsgvcMdjFubwqhxIs,32837
|
|
41
41
|
dara/core/interactivity/filtering.py,sha256=_F0OtECufYCptRI6h98_vDliG9xcPD5SItlQkjiNqR4,9667
|
|
42
42
|
dara/core/interactivity/loop_variable.py,sha256=9AvHUuyuneSLJstscv-o8gMd_FMd8p-U8QK5GqsPCVo,3611
|
|
43
43
|
dara/core/interactivity/non_data_variable.py,sha256=k2yXTowWmH5UhG9iJfYo_bUG7AT5fdKSwX5LcDQ71-4,178
|
|
44
|
-
dara/core/interactivity/plain_variable.py,sha256=
|
|
44
|
+
dara/core/interactivity/plain_variable.py,sha256=naN_7ejDKnbCGxDmyFZ7xkO-B4yFTPKgtj-9so64QXg,13707
|
|
45
45
|
dara/core/interactivity/server_variable.py,sha256=s1OoLIyWIVF0TAId5Pv3b6ZZpBEHjzTotYQufAYHjZI,11109
|
|
46
46
|
dara/core/interactivity/state_variable.py,sha256=Xpiazq25XS12dgvr3m1ojoqSy7svdmMaRMBxABusOzQ,2441
|
|
47
47
|
dara/core/interactivity/stream_event.py,sha256=83zAwf_MqjoWONNvutGW4uoIlTXXBJvLUGg7JuPNIWs,10059
|
|
48
48
|
dara/core/interactivity/stream_utils.py,sha256=xcqr4mQj4IH0bI_hfZ2jb2FImYftJea1qGmC_-Wh1oY,2404
|
|
49
|
-
dara/core/interactivity/stream_variable.py,sha256=
|
|
49
|
+
dara/core/interactivity/stream_variable.py,sha256=pYKakNcwPazIgrTrMZHcMrcDVNFF0mfk6308irKEjpY,13614
|
|
50
50
|
dara/core/interactivity/switch_variable.py,sha256=dhmAnF2KmL4944TJVipV-30BPYSLoD-uxyBP49W3V9Q,14099
|
|
51
51
|
dara/core/interactivity/tabular_variable.py,sha256=rUz9jnU6ya_0J7dhIN8d0VCDfzO7N5AsvksrHNtCO7k,3337
|
|
52
52
|
dara/core/interactivity/url_variable.py,sha256=lAtHgYvLA8RE-eFfv4Ix27T5YLGT5e0c0q9O5eQPOos,2282
|
|
@@ -59,7 +59,7 @@ dara/core/internal/cache_store/lru.py,sha256=6Jd4TmUX1LaEPnOraf8cSnL9Rx-A_LDhjqO
|
|
|
59
59
|
dara/core/internal/cache_store/ttl.py,sha256=WzSZfdhK-nTf0fwCwtaRbJ-9I-FeTNBXgnZgSvZMbKQ,4966
|
|
60
60
|
dara/core/internal/cgroup.py,sha256=yKCTY8RxyxnNy-Mw4tfzeZew1dL8qw381gHBVE96-OA,3217
|
|
61
61
|
dara/core/internal/custom_response.py,sha256=MM0xEX7kVZWyX943Obl7sic3bxXr6kHGLWe6pc5pcYg,1304
|
|
62
|
-
dara/core/internal/dependency_resolution.py,sha256=
|
|
62
|
+
dara/core/internal/dependency_resolution.py,sha256=Y3o9wnvEmFSfTaqc5Dqw2msDzwl5VtCNC2TmCkeLGHQ,11910
|
|
63
63
|
dara/core/internal/devtools.py,sha256=4LsK7sqES33fAqb53dyH3n0OSWang3W-MiPsmo57aXU,2586
|
|
64
64
|
dara/core/internal/download.py,sha256=wBSUapMY6evZ_sA5ZgvnWhaRtzVMIDIC51mPzFCMWuM,3548
|
|
65
65
|
dara/core/internal/encoder_registry.py,sha256=Q8F5Y2uZVkx7EUtk4MZ99wvPBWaMnPKcFZzK92FYNPw,11159
|
|
@@ -67,7 +67,7 @@ dara/core/internal/execute_action.py,sha256=di2WBTHw6smcRRYv1uqJbnnMxPTRq2uxYLdq
|
|
|
67
67
|
dara/core/internal/hashing.py,sha256=LTX249EpWfJ8ikx66o8t4gtSYxvcC00RKLOW6epbqCA,1094
|
|
68
68
|
dara/core/internal/import_discovery.py,sha256=8DFtLulbOIoPr4yxnS1OO431dZA27hLEjylklW_cm6s,8042
|
|
69
69
|
dara/core/internal/multi_resource_lock.py,sha256=mUoc6KKk8mpLGCXfa6nFd60yNuas4b6wsAk8VrvGDxI,2496
|
|
70
|
-
dara/core/internal/normalization.py,sha256=
|
|
70
|
+
dara/core/internal/normalization.py,sha256=aCRCT5G9RZJzPGlVvMgNoqOZVXSs_Ku5QiqVp81hsfY,6583
|
|
71
71
|
dara/core/internal/pandas_utils.py,sha256=1au2ixLfqdvwuFApwah580Y0WD6puw_Q0lBgFtK-Hdo,6514
|
|
72
72
|
dara/core/internal/pool/__init__.py,sha256=pBbXE5GR3abVC9Lg3i0QxfdmsrBDMJUYAYb0SiAEBkk,657
|
|
73
73
|
dara/core/internal/pool/channel.py,sha256=mLYa-R4KBGjRENDc9r1Hym5TpIeLv9y5kLJtjI7YXZA,4911
|
|
@@ -109,7 +109,7 @@ dara/core/persistence.py,sha256=EAEER1T0MHBrtT-iLZ-eXzAsqwu4Klqw5mDlTPSdPkI,1932
|
|
|
109
109
|
dara/core/router/__init__.py,sha256=yGI_MgLQU37ircCtYVNjnhqCjWQxKd5amoNqvMyrhOs,121
|
|
110
110
|
dara/core/router/compat.py,sha256=B83wq46AwQARTDfZwGrpr0slrnQmi_T7shOUNpqltSM,3112
|
|
111
111
|
dara/core/router/components.py,sha256=Wsf_bBnnN-1EE5jhbjPSOyDv_TVKEsY4royyOQOazM4,6132
|
|
112
|
-
dara/core/router/dependency_graph.py,sha256=
|
|
112
|
+
dara/core/router/dependency_graph.py,sha256=iX2f7l_FaEuaTHsEyl2wOl_eboic9EXEOsMXpmduQP4,3368
|
|
113
113
|
dara/core/router/router.py,sha256=ys3k48pIjTdbmch5516O4TAeo8IIUPThdqgeoXC-kMQ,32593
|
|
114
114
|
dara/core/visual/__init__.py,sha256=QN0wbG9HPQ_vXh8BO8DnBXeYLIENVTNtRmYzZf1lx7c,577
|
|
115
115
|
dara/core/visual/components/__init__.py,sha256=Jrh38Q4Lc8iFFVKPuEaDeloYHVLohTTHgK92u1e_ZtY,2515
|
|
@@ -137,8 +137,8 @@ dara/core/visual/themes/__init__.py,sha256=aM4mgoIYo2neBSw5FRzswsht7PUKjLthiHLmF
|
|
|
137
137
|
dara/core/visual/themes/dark.py,sha256=QazCRDqh_SCOyQhdwMkH1wbHf301oL7gCFj91plbLww,2020
|
|
138
138
|
dara/core/visual/themes/definitions.py,sha256=dtET2YUlwXkO6gJ23MqSb8gIq-LxJ343CWsgueWSifM,2787
|
|
139
139
|
dara/core/visual/themes/light.py,sha256=dtHb6Q1HOb5r_AvJfe0vZajikVc-GnBEUrGsTcI5MHA,2022
|
|
140
|
-
dara_core-1.25.
|
|
141
|
-
dara_core-1.25.
|
|
142
|
-
dara_core-1.25.
|
|
143
|
-
dara_core-1.25.
|
|
144
|
-
dara_core-1.25.
|
|
140
|
+
dara_core-1.25.1.dist-info/LICENSE,sha256=r9u1w2RvpLMV6YjuXHIKXRBKzia3fx_roPwboGcLqCc,10944
|
|
141
|
+
dara_core-1.25.1.dist-info/METADATA,sha256=SF56wMSWO_gCpH-bl9TMw_-fRLautCupnHJlT22Azeg,7523
|
|
142
|
+
dara_core-1.25.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
143
|
+
dara_core-1.25.1.dist-info/entry_points.txt,sha256=nAT9o1kJCmTK1saDh29PFGFD6cbxDDDjTj31HDEDwfU,197
|
|
144
|
+
dara_core-1.25.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|