@plasmicpkgs/antd5 0.0.110 → 0.0.112

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/antd.esm.js CHANGED
@@ -476,7 +476,7 @@ function themeToAntdConfig(opts) {
476
476
  };
477
477
  }
478
478
  function AntdConfigProvider(props) {
479
- const _a = props, { children, themeStyles } = _a, rest = __objRest$b(_a, ["children", "themeStyles"]);
479
+ const _a = props, { children, themeStyles, loadingText, removeLoading } = _a, rest = __objRest$b(_a, ["children", "themeStyles", "loadingText", "removeLoading"]);
480
480
  return /* @__PURE__ */ React.createElement(
481
481
  ConfigProvider,
482
482
  __spreadValues$i({
@@ -487,7 +487,14 @@ function AntdConfigProvider(props) {
487
487
  lineHeight: themeStyles.lineHeight ? parseInt(themeStyles.lineHeight) : void 0,
488
488
  colorTextBase: themeStyles.color
489
489
  }))),
490
- /* @__PURE__ */ React.createElement(ForkedApp, null, /* @__PURE__ */ React.createElement(InnerConfigProvider, null, children))
490
+ /* @__PURE__ */ React.createElement(ForkedApp, null, /* @__PURE__ */ React.createElement(
491
+ InnerConfigProvider,
492
+ {
493
+ loadingText,
494
+ removeLoading
495
+ },
496
+ children
497
+ ))
491
498
  );
492
499
  }
493
500
  function normTokenValue(val) {
@@ -500,7 +507,7 @@ function normTokenValue(val) {
500
507
  }
501
508
  }
502
509
  function InnerConfigProvider(props) {
503
- const { children } = props;
510
+ const { children, loadingText, removeLoading } = props;
504
511
  const { token } = theme.useToken();
505
512
  const makeVarName = (name) => `--antd-${name}`;
506
513
  const cssStyles = React.useMemo(
@@ -535,7 +542,7 @@ function InnerConfigProvider(props) {
535
542
  actions
536
543
  },
537
544
  children
538
- ) : children, /* @__PURE__ */ React.createElement(GlobalLoadingIndicator, null));
545
+ ) : children, !removeLoading && /* @__PURE__ */ React.createElement(GlobalLoadingIndicator, { loadingText }));
539
546
  }
540
547
  let warned = false;
541
548
  function warnOutdatedDeps() {
@@ -546,7 +553,8 @@ function warnOutdatedDeps() {
546
553
  warned = true;
547
554
  }
548
555
  }
549
- function GlobalLoadingIndicator() {
556
+ function GlobalLoadingIndicator(props) {
557
+ const { loadingText } = props;
550
558
  const app = useAppContext();
551
559
  React.useEffect(() => {
552
560
  if (addLoadingStateListener) {
@@ -554,7 +562,7 @@ function GlobalLoadingIndicator() {
554
562
  (isLoading) => {
555
563
  if (isLoading) {
556
564
  app.message.open({
557
- content: "Loading...",
565
+ content: loadingText != null ? loadingText : "Loading...",
558
566
  duration: 0,
559
567
  key: `plasmic-antd5-global-loading-indicator`
560
568
  });
@@ -562,7 +570,7 @@ function GlobalLoadingIndicator() {
562
570
  app.message.destroy(`plasmic-antd5-global-loading-indicator`);
563
571
  }
564
572
  },
565
- // Diabled immediat because it's creating an infinite rendering
573
+ // Disabled immediat because it's creating an infinite rendering
566
574
  // https://app.shortcut.com/plasmic/story/36991
567
575
  { immediate: false }
568
576
  );
@@ -870,6 +878,14 @@ const registerConfigProvider = makeRegisterGlobalContext(
870
878
  type: "number",
871
879
  defaultValue: 4
872
880
  },
881
+ loadingText: {
882
+ type: "string",
883
+ defaultValueHint: "Loading..."
884
+ },
885
+ removeLoading: {
886
+ type: "boolean",
887
+ defaultValueHint: false
888
+ },
873
889
  wireframe: {
874
890
  type: "boolean",
875
891
  defaultValue: false