@plasmicpkgs/antd5 0.0.109 → 0.0.111
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/.tsbuildinfo +1 -1
- package/dist/antd.esm.js +35 -13
- package/dist/antd.esm.js.map +1 -1
- package/dist/index.js +35 -13
- package/dist/index.js.map +1 -1
- package/dist/registerConfigProvider.d.ts +2 -0
- package/package.json +4 -4
- package/skinny/registerConfigProvider.cjs.js +35 -13
- package/skinny/registerConfigProvider.cjs.js.map +1 -1
- package/skinny/registerConfigProvider.d.ts +2 -0
- package/skinny/registerConfigProvider.esm.js +35 -13
- package/skinny/registerConfigProvider.esm.js.map +1 -1
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(
|
|
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,
|
|
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
|
-
//
|
|
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
|
);
|
|
@@ -822,27 +830,33 @@ const registerConfigProvider = makeRegisterGlobalContext(
|
|
|
822
830
|
props: {
|
|
823
831
|
colorPrimary: {
|
|
824
832
|
type: "color",
|
|
825
|
-
defaultValue: "#1677ff"
|
|
833
|
+
defaultValue: "#1677ff",
|
|
834
|
+
disableTokens: true
|
|
826
835
|
},
|
|
827
836
|
colorSuccess: {
|
|
828
837
|
type: "color",
|
|
829
|
-
defaultValue: "#52c41a"
|
|
838
|
+
defaultValue: "#52c41a",
|
|
839
|
+
disableTokens: true
|
|
830
840
|
},
|
|
831
841
|
colorWarning: {
|
|
832
842
|
type: "color",
|
|
833
|
-
defaultValue: "#faad14"
|
|
843
|
+
defaultValue: "#faad14",
|
|
844
|
+
disableTokens: true
|
|
834
845
|
},
|
|
835
846
|
colorError: {
|
|
836
847
|
type: "color",
|
|
837
|
-
defaultValue: "#ff4d4f"
|
|
848
|
+
defaultValue: "#ff4d4f",
|
|
849
|
+
disableTokens: true
|
|
838
850
|
},
|
|
839
851
|
colorInfo: {
|
|
840
852
|
type: "color",
|
|
841
|
-
defaultValue: "#1677ff"
|
|
853
|
+
defaultValue: "#1677ff",
|
|
854
|
+
disableTokens: true
|
|
842
855
|
},
|
|
843
856
|
colorBgBase: {
|
|
844
857
|
type: "color",
|
|
845
|
-
defaultValue: "#ffffff"
|
|
858
|
+
defaultValue: "#ffffff",
|
|
859
|
+
disableTokens: true
|
|
846
860
|
},
|
|
847
861
|
lineWidth: {
|
|
848
862
|
type: "number",
|
|
@@ -864,6 +878,14 @@ const registerConfigProvider = makeRegisterGlobalContext(
|
|
|
864
878
|
type: "number",
|
|
865
879
|
defaultValue: 4
|
|
866
880
|
},
|
|
881
|
+
loadingText: {
|
|
882
|
+
type: "string",
|
|
883
|
+
defaultValueHint: "Loading..."
|
|
884
|
+
},
|
|
885
|
+
removeLoading: {
|
|
886
|
+
type: "boolean",
|
|
887
|
+
defaultValueHint: false
|
|
888
|
+
},
|
|
867
889
|
wireframe: {
|
|
868
890
|
type: "boolean",
|
|
869
891
|
defaultValue: false
|