@trops/dash-core 0.1.150 → 0.1.151

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -10725,9 +10725,14 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
10725
10725
  _useState12 = _slicedToArray(_useState11, 2),
10726
10726
  taskStates = _useState12[0],
10727
10727
  setTaskStates = _useState12[1];
10728
+ var _useState13 = useState(true),
10729
+ _useState14 = _slicedToArray(_useState13, 2),
10730
+ isLoading = _useState14[0],
10731
+ setIsLoading = _useState14[1];
10728
10732
  useEffect(function () {
10729
10733
  var _window$mainApi4;
10730
10734
  if (scheduledTaskDefs.length > 0 && widgetUuid && (_window$mainApi4 = window.mainApi) !== null && _window$mainApi4 !== void 0 && (_window$mainApi4 = _window$mainApi4.scheduler) !== null && _window$mainApi4 !== void 0 && _window$mainApi4.getTasks) {
10735
+ setIsLoading(true);
10731
10736
  window.mainApi.scheduler.getTasks(widgetUuid).then(function (tasks) {
10732
10737
  var stateMap = {};
10733
10738
  var _iterator = _createForOfIteratorHelper$b(tasks || []),
@@ -10743,10 +10748,25 @@ var PanelEditItemSchedule = function PanelEditItemSchedule(_ref2) {
10743
10748
  _iterator.f();
10744
10749
  }
10745
10750
  setTaskStates(stateMap);
10751
+ setIsLoading(false);
10746
10752
  });
10753
+ } else {
10754
+ setIsLoading(false);
10747
10755
  }
10748
10756
  }, [widgetUuid, scheduledTaskDefs.length]);
10749
10757
  if (!item || scheduledTaskDefs.length === 0) return null;
10758
+ if (isLoading) {
10759
+ return /*#__PURE__*/jsxs("div", {
10760
+ className: "flex flex-col flex-1 min-h-0 p-6",
10761
+ children: [/*#__PURE__*/jsx(SubHeading3, {
10762
+ title: "Schedule",
10763
+ padding: false
10764
+ }), /*#__PURE__*/jsx("div", {
10765
+ className: "text-sm opacity-50 mt-4",
10766
+ children: "Loading schedules..."
10767
+ })]
10768
+ });
10769
+ }
10750
10770
  return /*#__PURE__*/jsxs("div", {
10751
10771
  className: "flex flex-col flex-1 min-h-0 overflow-y-auto p-6 space-y-4",
10752
10772
  children: [/*#__PURE__*/jsx(SubHeading3, {