dara-core 1.15.6a1__py3-none-any.whl → 1.16.0__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.
Files changed (51) hide show
  1. dara/core/__init__.py +16 -27
  2. dara/core/auth/base.py +3 -2
  3. dara/core/auth/definitions.py +0 -3
  4. dara/core/auth/utils.py +1 -1
  5. dara/core/base_definitions.py +122 -65
  6. dara/core/cli.py +12 -0
  7. dara/core/configuration.py +5 -8
  8. dara/core/defaults.py +0 -3
  9. dara/core/definitions.py +95 -231
  10. dara/core/interactivity/__init__.py +12 -18
  11. dara/core/interactivity/actions.py +22 -19
  12. dara/core/interactivity/any_data_variable.py +2 -4
  13. dara/core/interactivity/any_variable.py +10 -2
  14. dara/core/interactivity/condition.py +7 -10
  15. dara/core/interactivity/data_variable.py +11 -12
  16. dara/core/interactivity/derived_data_variable.py +7 -7
  17. dara/core/interactivity/derived_variable.py +20 -17
  18. dara/core/interactivity/filtering.py +1 -1
  19. dara/core/interactivity/plain_variable.py +53 -6
  20. dara/core/interactivity/url_variable.py +7 -6
  21. dara/core/internal/download.py +1 -1
  22. dara/core/internal/encoder_registry.py +14 -0
  23. dara/core/internal/hashing.py +1 -1
  24. dara/core/internal/normalization.py +0 -24
  25. dara/core/internal/routing.py +10 -10
  26. dara/core/internal/scheduler.py +3 -2
  27. dara/core/internal/settings.py +2 -4
  28. dara/core/internal/store.py +0 -3
  29. dara/core/internal/tasks.py +2 -2
  30. dara/core/internal/websocket.py +29 -20
  31. dara/core/js_tooling/js_utils.py +1 -1
  32. dara/core/main.py +2 -2
  33. dara/core/persistence.py +12 -4
  34. dara/core/umd/dara.core.umd.js +13 -277
  35. dara/core/visual/components/__init__.py +0 -3
  36. dara/core/visual/components/fallback.py +3 -3
  37. dara/core/visual/components/invalid_component.py +3 -3
  38. dara/core/visual/components/menu.py +3 -3
  39. dara/core/visual/components/progress_tracker.py +3 -2
  40. dara/core/visual/components/raw_string.py +3 -3
  41. dara/core/visual/components/router_content.py +3 -3
  42. dara/core/visual/components/sidebar_frame.py +3 -3
  43. dara/core/visual/components/topbar_frame.py +3 -3
  44. dara/core/visual/css/__init__.py +2 -6
  45. dara/core/visual/dynamic_component.py +3 -6
  46. {dara_core-1.15.6a1.dist-info → dara_core-1.16.0.dist-info}/METADATA +13 -12
  47. {dara_core-1.15.6a1.dist-info → dara_core-1.16.0.dist-info}/RECORD +50 -51
  48. dara/core/visual/components/for_cmp.py +0 -150
  49. {dara_core-1.15.6a1.dist-info → dara_core-1.16.0.dist-info}/LICENSE +0 -0
  50. {dara_core-1.15.6a1.dist-info → dara_core-1.16.0.dist-info}/WHEEL +0 -0
  51. {dara_core-1.15.6a1.dist-info → dara_core-1.16.0.dist-info}/entry_points.txt +0 -0
@@ -11588,7 +11588,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
11588
11588
  map: map$1$1,
11589
11589
  object: object$1$1,
11590
11590
  optional: optional$1$1,
11591
- set: set$1$2,
11591
+ set: set$1$1,
11592
11592
  tuple: tuple$1$1,
11593
11593
  writableArray: writableArray$1$1,
11594
11594
  writableDict: writableDict$1$1,
@@ -11651,7 +11651,7 @@ var __privateWrapper = (obj, member, setter, getter) => ({
11651
11651
  dict: dict$1$1,
11652
11652
  object: object$1$1,
11653
11653
  optional: optional$1$1,
11654
- set: set$1$2,
11654
+ set: set$1$1,
11655
11655
  map: map$1$1,
11656
11656
  writableArray: writableArray$1$1,
11657
11657
  writableDict: writableDict$1$1,
@@ -49604,7 +49604,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
49604
49604
  };
49605
49605
  function createListComponent(_ref2) {
49606
49606
  var _class;
49607
- var getItemOffset = _ref2.getItemOffset, getEstimatedTotalSize2 = _ref2.getEstimatedTotalSize, getItemSize = _ref2.getItemSize, getOffsetForIndexAndAlignment = _ref2.getOffsetForIndexAndAlignment, getStartIndexForOffset = _ref2.getStartIndexForOffset, getStopIndexForStartIndex = _ref2.getStopIndexForStartIndex, initInstanceProps = _ref2.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref2.shouldResetStyleCacheOnItemSizeChange, validateProps = _ref2.validateProps;
49607
+ var getItemOffset = _ref2.getItemOffset, getEstimatedTotalSize = _ref2.getEstimatedTotalSize, getItemSize = _ref2.getItemSize, getOffsetForIndexAndAlignment = _ref2.getOffsetForIndexAndAlignment, getStartIndexForOffset = _ref2.getStartIndexForOffset, getStopIndexForStartIndex = _ref2.getStopIndexForStartIndex, initInstanceProps = _ref2.initInstanceProps, shouldResetStyleCacheOnItemSizeChange = _ref2.shouldResetStyleCacheOnItemSizeChange, validateProps = _ref2.validateProps;
49608
49608
  return _class = /* @__PURE__ */ function(_PureComponent) {
49609
49609
  _inheritsLoose$1(List2, _PureComponent);
49610
49610
  function List2(props) {
@@ -49832,7 +49832,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
49832
49832
  }));
49833
49833
  }
49834
49834
  }
49835
- var estimatedTotalSize = getEstimatedTotalSize2(this.props, this._instanceProps);
49835
+ var estimatedTotalSize = getEstimatedTotalSize(this.props, this._instanceProps);
49836
49836
  return React.createElement(outerElementType || outerTagName || "div", {
49837
49837
  className,
49838
49838
  onScroll,
@@ -49900,161 +49900,6 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
49900
49900
  _ref2.width;
49901
49901
  _ref3.instance;
49902
49902
  };
49903
- var DEFAULT_ESTIMATED_ITEM_SIZE$1 = 50;
49904
- var getItemMetadata$1 = function getItemMetadata(props, index2, instanceProps) {
49905
- var _ref2 = props, itemSize = _ref2.itemSize;
49906
- var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
49907
- if (index2 > lastMeasuredIndex) {
49908
- var offset2 = 0;
49909
- if (lastMeasuredIndex >= 0) {
49910
- var itemMetadata = itemMetadataMap[lastMeasuredIndex];
49911
- offset2 = itemMetadata.offset + itemMetadata.size;
49912
- }
49913
- for (var i2 = lastMeasuredIndex + 1; i2 <= index2; i2++) {
49914
- var size2 = itemSize(i2);
49915
- itemMetadataMap[i2] = {
49916
- offset: offset2,
49917
- size: size2
49918
- };
49919
- offset2 += size2;
49920
- }
49921
- instanceProps.lastMeasuredIndex = index2;
49922
- }
49923
- return itemMetadataMap[index2];
49924
- };
49925
- var findNearestItem$1 = function findNearestItem(props, instanceProps, offset2) {
49926
- var itemMetadataMap = instanceProps.itemMetadataMap, lastMeasuredIndex = instanceProps.lastMeasuredIndex;
49927
- var lastMeasuredItemOffset = lastMeasuredIndex > 0 ? itemMetadataMap[lastMeasuredIndex].offset : 0;
49928
- if (lastMeasuredItemOffset >= offset2) {
49929
- return findNearestItemBinarySearch$1(props, instanceProps, lastMeasuredIndex, 0, offset2);
49930
- } else {
49931
- return findNearestItemExponentialSearch$1(props, instanceProps, Math.max(0, lastMeasuredIndex), offset2);
49932
- }
49933
- };
49934
- var findNearestItemBinarySearch$1 = function findNearestItemBinarySearch(props, instanceProps, high, low, offset2) {
49935
- while (low <= high) {
49936
- var middle = low + Math.floor((high - low) / 2);
49937
- var currentOffset = getItemMetadata$1(props, middle, instanceProps).offset;
49938
- if (currentOffset === offset2) {
49939
- return middle;
49940
- } else if (currentOffset < offset2) {
49941
- low = middle + 1;
49942
- } else if (currentOffset > offset2) {
49943
- high = middle - 1;
49944
- }
49945
- }
49946
- if (low > 0) {
49947
- return low - 1;
49948
- } else {
49949
- return 0;
49950
- }
49951
- };
49952
- var findNearestItemExponentialSearch$1 = function findNearestItemExponentialSearch(props, instanceProps, index2, offset2) {
49953
- var itemCount = props.itemCount;
49954
- var interval = 1;
49955
- while (index2 < itemCount && getItemMetadata$1(props, index2, instanceProps).offset < offset2) {
49956
- index2 += interval;
49957
- interval *= 2;
49958
- }
49959
- return findNearestItemBinarySearch$1(props, instanceProps, Math.min(index2, itemCount - 1), Math.floor(index2 / 2), offset2);
49960
- };
49961
- var getEstimatedTotalSize = function getEstimatedTotalSize2(_ref2, _ref3) {
49962
- var itemCount = _ref2.itemCount;
49963
- var itemMetadataMap = _ref3.itemMetadataMap, estimatedItemSize = _ref3.estimatedItemSize, lastMeasuredIndex = _ref3.lastMeasuredIndex;
49964
- var totalSizeOfMeasuredItems = 0;
49965
- if (lastMeasuredIndex >= itemCount) {
49966
- lastMeasuredIndex = itemCount - 1;
49967
- }
49968
- if (lastMeasuredIndex >= 0) {
49969
- var itemMetadata = itemMetadataMap[lastMeasuredIndex];
49970
- totalSizeOfMeasuredItems = itemMetadata.offset + itemMetadata.size;
49971
- }
49972
- var numUnmeasuredItems = itemCount - lastMeasuredIndex - 1;
49973
- var totalSizeOfUnmeasuredItems = numUnmeasuredItems * estimatedItemSize;
49974
- return totalSizeOfMeasuredItems + totalSizeOfUnmeasuredItems;
49975
- };
49976
- var VariableSizeList = /* @__PURE__ */ createListComponent({
49977
- getItemOffset: function getItemOffset(props, index2, instanceProps) {
49978
- return getItemMetadata$1(props, index2, instanceProps).offset;
49979
- },
49980
- getItemSize: function getItemSize(props, index2, instanceProps) {
49981
- return instanceProps.itemMetadataMap[index2].size;
49982
- },
49983
- getEstimatedTotalSize,
49984
- getOffsetForIndexAndAlignment: function getOffsetForIndexAndAlignment(props, index2, align, scrollOffset, instanceProps, scrollbarSize) {
49985
- var direction = props.direction, height = props.height, layout = props.layout, width = props.width;
49986
- var isHorizontal = direction === "horizontal" || layout === "horizontal";
49987
- var size2 = isHorizontal ? width : height;
49988
- var itemMetadata = getItemMetadata$1(props, index2, instanceProps);
49989
- var estimatedTotalSize = getEstimatedTotalSize(props, instanceProps);
49990
- var maxOffset = Math.max(0, Math.min(estimatedTotalSize - size2, itemMetadata.offset));
49991
- var minOffset = Math.max(0, itemMetadata.offset - size2 + itemMetadata.size + scrollbarSize);
49992
- if (align === "smart") {
49993
- if (scrollOffset >= minOffset - size2 && scrollOffset <= maxOffset + size2) {
49994
- align = "auto";
49995
- } else {
49996
- align = "center";
49997
- }
49998
- }
49999
- switch (align) {
50000
- case "start":
50001
- return maxOffset;
50002
- case "end":
50003
- return minOffset;
50004
- case "center":
50005
- return Math.round(minOffset + (maxOffset - minOffset) / 2);
50006
- case "auto":
50007
- default:
50008
- if (scrollOffset >= minOffset && scrollOffset <= maxOffset) {
50009
- return scrollOffset;
50010
- } else if (scrollOffset < minOffset) {
50011
- return minOffset;
50012
- } else {
50013
- return maxOffset;
50014
- }
50015
- }
50016
- },
50017
- getStartIndexForOffset: function getStartIndexForOffset(props, offset2, instanceProps) {
50018
- return findNearestItem$1(props, instanceProps, offset2);
50019
- },
50020
- getStopIndexForStartIndex: function getStopIndexForStartIndex(props, startIndex, scrollOffset, instanceProps) {
50021
- var direction = props.direction, height = props.height, itemCount = props.itemCount, layout = props.layout, width = props.width;
50022
- var isHorizontal = direction === "horizontal" || layout === "horizontal";
50023
- var size2 = isHorizontal ? width : height;
50024
- var itemMetadata = getItemMetadata$1(props, startIndex, instanceProps);
50025
- var maxOffset = scrollOffset + size2;
50026
- var offset2 = itemMetadata.offset + itemMetadata.size;
50027
- var stopIndex = startIndex;
50028
- while (stopIndex < itemCount - 1 && offset2 < maxOffset) {
50029
- stopIndex++;
50030
- offset2 += getItemMetadata$1(props, stopIndex, instanceProps).size;
50031
- }
50032
- return stopIndex;
50033
- },
50034
- initInstanceProps: function initInstanceProps(props, instance) {
50035
- var _ref4 = props, estimatedItemSize = _ref4.estimatedItemSize;
50036
- var instanceProps = {
50037
- itemMetadataMap: {},
50038
- estimatedItemSize: estimatedItemSize || DEFAULT_ESTIMATED_ITEM_SIZE$1,
50039
- lastMeasuredIndex: -1
50040
- };
50041
- instance.resetAfterIndex = function(index2, shouldForceUpdate) {
50042
- if (shouldForceUpdate === void 0) {
50043
- shouldForceUpdate = true;
50044
- }
50045
- instanceProps.lastMeasuredIndex = Math.min(instanceProps.lastMeasuredIndex, index2 - 1);
50046
- instance._getItemStyleCache(-1);
50047
- if (shouldForceUpdate) {
50048
- instance.forceUpdate();
50049
- }
50050
- };
50051
- return instanceProps;
50052
- },
50053
- shouldResetStyleCacheOnItemSizeChange: false,
50054
- validateProps: function validateProps(_ref5) {
50055
- _ref5.itemSize;
50056
- }
50057
- });
50058
49903
  var FixedSizeList = /* @__PURE__ */ createListComponent({
50059
49904
  getItemOffset: function getItemOffset(_ref2, index2) {
50060
49905
  var itemSize = _ref2.itemSize;
@@ -50064,7 +49909,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
50064
49909
  var itemSize = _ref2.itemSize;
50065
49910
  return itemSize;
50066
49911
  },
50067
- getEstimatedTotalSize: function getEstimatedTotalSize2(_ref3) {
49912
+ getEstimatedTotalSize: function getEstimatedTotalSize(_ref3) {
50068
49913
  var itemCount = _ref3.itemCount, itemSize = _ref3.itemSize;
50069
49914
  return itemSize * itemCount;
50070
49915
  },
@@ -54634,7 +54479,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
54634
54479
  }
54635
54480
  var _assignValue = assignValue$3;
54636
54481
  var assignValue$2 = _assignValue, castPath$1 = _castPath, isIndex = _isIndex, isObject$2 = isObject_1, toKey = _toKey;
54637
- function baseSet$2(object2, path, value, customizer) {
54482
+ function baseSet$1(object2, path, value, customizer) {
54638
54483
  if (!isObject$2(object2)) {
54639
54484
  return object2;
54640
54485
  }
@@ -54657,14 +54502,14 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
54657
54502
  }
54658
54503
  return object2;
54659
54504
  }
54660
- var _baseSet = baseSet$2;
54661
- var baseGet = _baseGet, baseSet$1 = _baseSet, castPath = _castPath;
54505
+ var _baseSet = baseSet$1;
54506
+ var baseGet = _baseGet, baseSet = _baseSet, castPath = _castPath;
54662
54507
  function basePickBy$1(object2, paths, predicate) {
54663
54508
  var index2 = -1, length = paths.length, result = {};
54664
54509
  while (++index2 < length) {
54665
54510
  var path = paths[index2], value = baseGet(object2, path);
54666
54511
  if (predicate(value, path)) {
54667
- baseSet$1(result, castPath(path, object2), value);
54512
+ baseSet(result, castPath(path, object2), value);
54668
54513
  }
54669
54514
  }
54670
54515
  return result;
@@ -56703,7 +56548,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56703
56548
  return success$1(out, warnings);
56704
56549
  };
56705
56550
  }
56706
- function set$1(checker) {
56551
+ function set(checker) {
56707
56552
  return (value, path = new Path$1()) => {
56708
56553
  if (!(value instanceof Set)) {
56709
56554
  return failure$1("value is not a Set", path);
@@ -56773,7 +56618,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
56773
56618
  object,
56774
56619
  optional,
56775
56620
  dict,
56776
- set: set$1,
56621
+ set,
56777
56622
  map,
56778
56623
  writableArray,
56779
56624
  writableDict,
@@ -57055,7 +56900,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57055
56900
  map: map$1,
57056
56901
  object: object$1,
57057
56902
  optional: optional$1,
57058
- set: set$1$1,
56903
+ set: set$1,
57059
56904
  tuple: tuple$1,
57060
56905
  writableArray: writableArray$1,
57061
56906
  writableDict: writableDict$1,
@@ -57116,7 +56961,7 @@ You must set sticky: 'left' | 'right' for the '${bugWithUnderColumnsSticky.Heade
57116
56961
  dict: dict$1,
57117
56962
  object: object$1,
57118
56963
  optional: optional$1,
57119
- set: set$1$1,
56964
+ set: set$1,
57120
56965
  map: map$1,
57121
56966
  writableArray: writableArray$1,
57122
56967
  writableDict: writableDict$1,
@@ -58825,50 +58670,6 @@ Inferred class string: "${iconClasses}."`
58825
58670
  serialize: urlSerializer
58826
58671
  };
58827
58672
  }
58828
- var baseSet = _baseSet;
58829
- function set(object2, path, value) {
58830
- return object2 == null ? object2 : baseSet(object2, path, value);
58831
- }
58832
- var set_1 = set;
58833
- function isTemplateMarker(value) {
58834
- return value && typeof value === "object" && value.__typename === "TemplateMarker";
58835
- }
58836
- function hasTemplateMarkers(component) {
58837
- if (!component || typeof component !== "object") {
58838
- return false;
58839
- }
58840
- for (const value of Object.values(component)) {
58841
- if (isTemplateMarker(value)) {
58842
- return true;
58843
- }
58844
- if (value && typeof value === "object") {
58845
- return hasTemplateMarkers(value);
58846
- }
58847
- }
58848
- return false;
58849
- }
58850
- function getMarkerPaths(template) {
58851
- const paths = {};
58852
- function recurse(component, path) {
58853
- for (const [key, value] of Object.entries(component)) {
58854
- if (isTemplateMarker(value)) {
58855
- paths[path + key] = value.field_name;
58856
- } else if (value instanceof Object) {
58857
- recurse(value, `${path + key}.`);
58858
- }
58859
- }
58860
- }
58861
- recurse(template, "");
58862
- return paths;
58863
- }
58864
- function replaceMarkers(template, data, paths) {
58865
- const templateCopy = cloneDeep_1(template);
58866
- for (const [path, fieldName] of Object.entries(paths)) {
58867
- const value = data[fieldName];
58868
- set_1(templateCopy, path, value);
58869
- }
58870
- return templateCopy;
58871
- }
58872
58673
  const Wrapper$2 = styled__default.default.div`
58873
58674
  display: flex;
58874
58675
  align-items: center;
@@ -59854,15 +59655,6 @@ Inferred class string: "${iconClasses}."`
59854
59655
  const { get: getComponent } = useComponentRegistry();
59855
59656
  const importers = React.useContext(importersCtx);
59856
59657
  const fallbackCtx$1 = React.useContext(fallbackCtx);
59857
- const firstRender = React.useRef(true);
59858
- if (firstRender.current) {
59859
- if (hasTemplateMarkers(props.component)) {
59860
- throw new Error(
59861
- `Component "${props.component.name}" has unhandled template markers. Make sure it's used in a component which handles templated components`
59862
- );
59863
- }
59864
- firstRender.current = false;
59865
- }
59866
59658
  React.useEffect(() => {
59867
59659
  var _a2;
59868
59660
  if (((_a2 = props.component) == null ? void 0 : _a2.name) === "RawString") {
@@ -86441,61 +86233,6 @@ Inferred class string: "${iconClasses}."`
86441
86233
  const [style, css2] = useComponentStyles(props);
86442
86234
  return /* @__PURE__ */ React__default.default.createElement(StyledDots, { $rawCss: css2, style });
86443
86235
  }
86444
- function ForChild(props) {
86445
- const component = React.useMemo(() => {
86446
- const withoutMarkers = replaceMarkers(props.template, props.data, props.markerPaths);
86447
- withoutMarkers.props.style = props.style;
86448
- return withoutMarkers;
86449
- }, [props.template, props.data]);
86450
- return /* @__PURE__ */ React__default.default.createElement(DynamicComponent, { component });
86451
- }
86452
- function For(props) {
86453
- const data = useAnyVariable(props.data);
86454
- const markerPaths = React.useMemo(() => getMarkerPaths(props.template), [props.template]);
86455
- const ListChild = React.useCallback(
86456
- (listProps) => {
86457
- return /* @__PURE__ */ React__default.default.createElement(
86458
- ForChild,
86459
- {
86460
- data: listProps.data[listProps.index],
86461
- key: listProps.data[listProps.index][props.key_accessor],
86462
- markerPaths,
86463
- style: listProps.style,
86464
- template: props.template
86465
- }
86466
- );
86467
- },
86468
- [markerPaths, props.key_accessor]
86469
- );
86470
- const getItemSize = React.useCallback(
86471
- (index2) => {
86472
- return data[index2][props.size_accessor];
86473
- },
86474
- [data, props.size_accessor]
86475
- );
86476
- const getItemKey = React.useCallback(
86477
- (index2, listData) => {
86478
- return listData[index2][props.key_accessor];
86479
- },
86480
- [props.key_accessor]
86481
- );
86482
- if (!props.virtualize) {
86483
- return /* @__PURE__ */ React__default.default.createElement(React__default.default.Fragment, null, data.map((item, index2) => /* @__PURE__ */ React__default.default.createElement(ListChild, { data, index: index2, key: item[props.key_accessor], style: {} })));
86484
- }
86485
- return /* @__PURE__ */ React__default.default.createElement(AutoSizer, null, ({ height, width }) => /* @__PURE__ */ React__default.default.createElement(
86486
- VariableSizeList,
86487
- {
86488
- height,
86489
- itemCount: data.length,
86490
- itemData: data,
86491
- itemKey: getItemKey,
86492
- itemSize: getItemSize,
86493
- layout: props.direction,
86494
- width
86495
- },
86496
- ListChild
86497
- ));
86498
- }
86499
86236
  exports.BasicAuthLogin = BasicAuthLogin;
86500
86237
  exports.BasicAuthLogout = BasicAuthLogout;
86501
86238
  exports.Center = Center;
@@ -86508,7 +86245,6 @@ Inferred class string: "${iconClasses}."`
86508
86245
  exports.DynamicComponent = DynamicComponent;
86509
86246
  exports.EventBus = EventBus;
86510
86247
  exports.EventCapturer = EventCapturer;
86511
- exports.For = For;
86512
86248
  exports.Menu = Menu;
86513
86249
  exports.NavigateTo = NavigateTo;
86514
86250
  exports.Notifications = index$1;
@@ -23,7 +23,6 @@ from dara.core.visual.components.fallback import (
23
23
  Fallback,
24
24
  RowFallbackDef,
25
25
  )
26
- from dara.core.visual.components.for_cmp import For, ForDef
27
26
  from dara.core.visual.components.invalid_component import InvalidComponent
28
27
  from dara.core.visual.components.menu import Menu, MenuDef
29
28
  from dara.core.visual.components.progress_tracker import (
@@ -50,8 +49,6 @@ __all__ = [
50
49
  'SideBarFrameDef',
51
50
  'TopBarFrame',
52
51
  'TopBarFrameDef',
53
- 'For',
54
- 'ForDef',
55
52
  'DefaultFallbackDef',
56
53
  'RowFallbackDef',
57
54
  'Fallback',
@@ -17,14 +17,14 @@ limitations under the License.
17
17
 
18
18
  from typing import ClassVar
19
19
 
20
- from dara.core.definitions import BaseFallback, JsComponentDef, StyledComponentInstance
20
+ from dara.core.definitions import BaseFallback, JsComponentDef
21
21
 
22
22
  DefaultFallbackDef = JsComponentDef(name='DefaultFallback', js_module='@darajs/core', py_module='dara.core')
23
23
  RowFallbackDef = JsComponentDef(name='RowFallback', js_module='@darajs/core', py_module='dara.core')
24
24
 
25
25
 
26
26
  class Fallback:
27
- class Default(BaseFallback, StyledComponentInstance):
27
+ class Default(BaseFallback):
28
28
  """
29
29
  ![FallbackDefault](../../../../../docs/packages/dara-core/assets/FallbackDefault.gif)
30
30
 
@@ -49,7 +49,7 @@ class Fallback:
49
49
 
50
50
  py_component: ClassVar[str] = 'DefaultFallback'
51
51
 
52
- class Row(BaseFallback, StyledComponentInstance):
52
+ class Row(BaseFallback):
53
53
  """
54
54
  ![FallbackRow](../../../../../docs/packages/dara-core/assets/FallbackRow.gif)
55
55
 
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  """
17
17
 
18
+ from pydantic import ConfigDict
19
+
18
20
  from dara.core.definitions import ComponentInstance
19
21
 
20
22
 
@@ -24,6 +26,4 @@ class InvalidComponent(ComponentInstance):
24
26
  """
25
27
 
26
28
  error: str
27
-
28
- class Config:
29
- extra = 'forbid'
29
+ model_config = ConfigDict(extra='forbid')
@@ -17,6 +17,8 @@ limitations under the License.
17
17
 
18
18
  from typing import List
19
19
 
20
+ from pydantic import ConfigDict
21
+
20
22
  from dara.core.definitions import ComponentInstance, JsComponentDef, TemplateRouterLink
21
23
 
22
24
  MenuDef = JsComponentDef(name='Menu', js_module='@darajs/core', py_module='dara.core')
@@ -24,6 +26,4 @@ MenuDef = JsComponentDef(name='Menu', js_module='@darajs/core', py_module='dara.
24
26
 
25
27
  class Menu(ComponentInstance):
26
28
  routes: List[TemplateRouterLink]
27
-
28
- class Config:
29
- extra = 'forbid'
29
+ model_config = ConfigDict(extra='forbid')
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  """
17
17
 
18
+ from pydantic import ConfigDict
19
+
18
20
  from dara.core.definitions import ComponentInstance, JsComponentDef
19
21
 
20
22
  ProgressTrackerDef = JsComponentDef(name='ProgressTracker', js_module='@darajs/core', py_module='dara.core')
@@ -49,5 +51,4 @@ class ProgressTracker(ComponentInstance):
49
51
 
50
52
  """
51
53
 
52
- class Config:
53
- extra = 'forbid'
54
+ model_config = ConfigDict(extra='forbid')
@@ -15,6 +15,8 @@ See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  """
17
17
 
18
+ from pydantic import ConfigDict
19
+
18
20
  from dara.core.definitions import ComponentInstance
19
21
 
20
22
 
@@ -25,6 +27,4 @@ class RawString(ComponentInstance):
25
27
  """
26
28
 
27
29
  content: str
28
-
29
- class Config:
30
- extra = 'forbid'
30
+ model_config = ConfigDict(extra='forbid')
@@ -17,6 +17,8 @@ limitations under the License.
17
17
 
18
18
  from typing import List
19
19
 
20
+ from pydantic import ConfigDict
21
+
20
22
  from dara.core.definitions import (
21
23
  ComponentInstance,
22
24
  JsComponentDef,
@@ -28,6 +30,4 @@ RouterContentDef = JsComponentDef(name='RouterContent', js_module='@darajs/core'
28
30
 
29
31
  class RouterContent(ComponentInstance):
30
32
  routes: List[TemplateRouterContent]
31
-
32
- class Config:
33
- extra = 'forbid'
33
+ model_config = ConfigDict(extra='forbid')
@@ -17,6 +17,8 @@ limitations under the License.
17
17
 
18
18
  from typing import Optional
19
19
 
20
+ from pydantic import ConfigDict
21
+
20
22
  from dara.core.definitions import ComponentInstance, JsComponentDef
21
23
 
22
24
  SideBarFrameDef = JsComponentDef(name='SideBarFrame', js_module='@darajs/core', py_module='dara.core')
@@ -32,6 +34,4 @@ class SideBarFrame(ComponentInstance):
32
34
  side_bar_padding: Optional[str] = None
33
35
  side_bar_position: Optional[str] = None
34
36
  side_bar_width: Optional[str] = None
35
-
36
- class Config:
37
- extra = 'forbid'
37
+ model_config = ConfigDict(extra='forbid')
@@ -17,6 +17,8 @@ limitations under the License.
17
17
 
18
18
  from typing import Optional
19
19
 
20
+ from pydantic import ConfigDict
21
+
20
22
  from dara.core.definitions import ComponentInstance, JsComponentDef
21
23
 
22
24
  TopBarFrameDef = JsComponentDef(name='TopBarFrame', js_module='@darajs/core', py_module='dara.core')
@@ -32,6 +34,4 @@ class TopBarFrame(ComponentInstance):
32
34
  top_bar_padding: Optional[str] = None
33
35
  top_bar_position: Optional[str] = None
34
36
  top_bar_height: Optional[str] = None
35
-
36
- class Config:
37
- extra = 'forbid'
37
+ model_config = ConfigDict(extra='forbid')
@@ -24,7 +24,7 @@ from __future__ import annotations
24
24
 
25
25
  from typing import Literal, Optional, Union
26
26
 
27
- from pydantic import Field
27
+ from pydantic import ConfigDict, Field
28
28
 
29
29
  from dara.core.base_definitions import DaraBaseModel
30
30
 
@@ -7684,8 +7684,4 @@ class CSSProperties(DaraBaseModel):
7684
7684
  default=None,
7685
7685
  description='The non-standard **`zoom`** CSS property can be used to control the magnification level of an element. `transform: scale()` should be used instead of this property, if possible. However, unlike CSS Transforms, `zoom` affects the layout size of the element.\n\n**Syntax**: `normal | reset | <number> | <percentage>`\n\n**Initial value**: `normal`\n\n| Chrome | Firefox | Safari | Edge | IE |\n| :----: | :-----: | :-----: | :----: | :-----: |\n| **1** | No | **3.1** | **12** | **5.5** |',
7686
7686
  )
7687
-
7688
- class Config:
7689
- extra = 'allow'
7690
- use_enum_values = True
7691
- smart_union = True
7687
+ model_config = ConfigDict(extra='allow', use_enum_values=True)
@@ -14,9 +14,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
14
  See the License for the specific language governing permissions and
15
15
  limitations under the License.
16
16
  """
17
-
18
- from __future__ import annotations
19
-
20
17
  import json
21
18
  import uuid
22
19
  from contextvars import ContextVar
@@ -59,8 +56,8 @@ CURRENT_COMPONENT_ID = ContextVar('current_component_id', default='')
59
56
 
60
57
  class PyComponentInstance(ComponentInstance):
61
58
  func_name: str
62
- dynamic_kwargs: Optional[Mapping[str, AnyVariable]]
63
- polling_interval: Optional[int]
59
+ dynamic_kwargs: Optional[Mapping[str, AnyVariable]] = None
60
+ polling_interval: Optional[int] = None
64
61
  js_module: ClassVar[Optional[str]] = None
65
62
 
66
63
 
@@ -327,7 +324,7 @@ def _make_render_safe(handler: Callable):
327
324
 
328
325
  # Handle primitives being returned by just displaying the value as a string
329
326
  safe_result = RawString(content=str(result))
330
- elif not isinstance(result, ComponentInstance):
327
+ elif not ComponentInstance.isinstance(result):
331
328
  # Otherwise it must be a component instance, return the error for frontend to display
332
329
  safe_result = InvalidComponent(
333
330
  error=f'PyComponent "{handler.__name__}" did not return a ComponentInstance, found "{result}"'