xmlui 0.9.15 → 0.9.17
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/{apiInterceptorWorker-DHw39GG3.mjs → apiInterceptorWorker-D94b73xQ.mjs} +1 -1
- package/dist/{index-DFC3vDn-.mjs → index-B6kr6jsm.mjs} +120 -63
- package/dist/index.css +98 -45
- package/dist/scripts/src/components/App/AppLayoutContext.js +1 -0
- package/dist/scripts/src/components/App/AppNative.js +4 -0
- package/dist/scripts/src/components/Select/Select.js +5 -2
- package/dist/scripts/src/components/Select/SelectNative.js +3 -3
- package/dist/scripts/src/components-core/InspectorContext.js +4 -2
- package/dist/scripts/src/components-core/loader/ApiLoader.js +2 -2
- package/dist/scripts/src/components-core/loader/DataLoader.js +5 -4
- package/dist/scripts/src/components-core/loader/ExternalDataLoader.js +2 -2
- package/dist/scripts/src/components-core/loader/Loader.js +3 -8
- package/dist/scripts/src/components-core/loader/MockLoaderRenderer.js +3 -3
- package/dist/scripts/src/components-core/loader/PageableLoader.js +3 -7
- package/dist/scripts/src/components-core/rendering/renderChild.js +2 -1
- package/dist/scripts/src/components-core/theming/layout-resolver.js +4 -4
- package/dist/scripts/src/components-core/utils/extractParam.js +7 -0
- package/dist/style.css +98 -45
- package/dist/xmlui-metadata.mjs +16 -9
- package/dist/xmlui-metadata.umd.js +16 -9
- package/dist/xmlui-standalone.umd.js +220 -110
- package/dist/xmlui.d.ts +1 -0
- package/dist/xmlui.mjs +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -968,7 +968,7 @@
|
|
|
968
968
|
* This function allows other CSS modules to get the value of the CSS variable specified in $componentVariable.
|
|
969
969
|
Optionally, you can provide a $fallbackValue to set the variable's value if that is not defined.
|
|
970
970
|
*/
|
|
971
|
-
.
|
|
971
|
+
._wrapper_1c9ty_13 {
|
|
972
972
|
--footer-height: 0px;
|
|
973
973
|
--header-height: 0px;
|
|
974
974
|
width: 100%;
|
|
@@ -978,138 +978,191 @@
|
|
|
978
978
|
flex-direction: column;
|
|
979
979
|
isolation: isolate;
|
|
980
980
|
}
|
|
981
|
-
.
|
|
981
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23 {
|
|
982
982
|
flex-direction: row;
|
|
983
983
|
overflow: initial;
|
|
984
984
|
}
|
|
985
|
-
.
|
|
985
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23 ._contentWrapper_1c9ty_27 {
|
|
986
986
|
overflow: auto;
|
|
987
987
|
scroll-padding-block: var(--xmlui-scroll-padding-block-Pages);
|
|
988
988
|
position: relative;
|
|
989
989
|
scrollbar-gutter: stable both-edges;
|
|
990
990
|
}
|
|
991
|
-
.
|
|
991
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23 ._navPanelWrapper_1c9ty_33 {
|
|
992
992
|
width: var(--xmlui-width-navPanel-App);
|
|
993
993
|
flex-shrink: 0;
|
|
994
994
|
}
|
|
995
|
-
.
|
|
995
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23 ._PagesWrapper_1c9ty_37 {
|
|
996
996
|
min-height: initial;
|
|
997
997
|
flex: 1;
|
|
998
998
|
}
|
|
999
|
-
.
|
|
999
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23 ._footerWrapper_1c9ty_41 {
|
|
1000
1000
|
position: static;
|
|
1001
1001
|
}
|
|
1002
|
-
.
|
|
1002
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23._sticky_1c9ty_44 ._contentWrapper_1c9ty_27 {
|
|
1003
1003
|
scroll-padding-top: var(--header-height);
|
|
1004
1004
|
}
|
|
1005
|
-
.
|
|
1005
|
+
._wrapper_1c9ty_13._vertical_1c9ty_23._sticky_1c9ty_44 ._footerWrapper_1c9ty_41 {
|
|
1006
1006
|
position: sticky;
|
|
1007
1007
|
bottom: 0;
|
|
1008
1008
|
}
|
|
1009
|
-
.
|
|
1009
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51 {
|
|
1010
1010
|
overflow: auto;
|
|
1011
1011
|
scroll-padding-block: var(--xmlui-scroll-padding-block-Pages);
|
|
1012
1012
|
}
|
|
1013
|
-
.
|
|
1013
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51 ._PagesWrapper_1c9ty_37 {
|
|
1014
1014
|
min-height: initial;
|
|
1015
1015
|
}
|
|
1016
|
-
.
|
|
1016
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51 ._footerWrapper_1c9ty_41 {
|
|
1017
1017
|
position: static;
|
|
1018
1018
|
}
|
|
1019
|
-
.
|
|
1019
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51._sticky_1c9ty_44 {
|
|
1020
1020
|
scroll-padding-top: var(--header-height);
|
|
1021
1021
|
min-height: 100%;
|
|
1022
1022
|
}
|
|
1023
|
-
.
|
|
1023
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51._sticky_1c9ty_44 ._footerWrapper_1c9ty_41 {
|
|
1024
1024
|
position: sticky;
|
|
1025
1025
|
bottom: 0;
|
|
1026
1026
|
}
|
|
1027
|
-
.
|
|
1027
|
+
._wrapper_1c9ty_13._horizontal_1c9ty_51 ._navPanelWrapper_1c9ty_33 {
|
|
1028
1028
|
border-bottom: var(--xmlui-borderBottom-AppHeader);
|
|
1029
1029
|
justify-content: end;
|
|
1030
1030
|
}
|
|
1031
|
-
.
|
|
1031
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 {
|
|
1032
1032
|
min-height: 100%;
|
|
1033
1033
|
height: 100%;
|
|
1034
1034
|
overflow: auto;
|
|
1035
1035
|
scroll-padding-block: var(--xmlui-scroll-padding-block-Pages);
|
|
1036
1036
|
}
|
|
1037
|
-
.
|
|
1037
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 ._navPanelWrapper_1c9ty_33 {
|
|
1038
1038
|
width: var(--xmlui-width-navPanel-App);
|
|
1039
1039
|
position: sticky;
|
|
1040
1040
|
height: calc(var(--containerHeight, 100vh) - var(--footer-height) - var(--header-height));
|
|
1041
1041
|
top: var(--header-height);
|
|
1042
1042
|
}
|
|
1043
|
-
.
|
|
1043
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 ._PagesWrapper_1c9ty_37 {
|
|
1044
1044
|
overflow: initial;
|
|
1045
1045
|
min-height: calc(var(--containerHeight, 100vh) - var(--header-height) - var(--footer-height));
|
|
1046
1046
|
height: 100%;
|
|
1047
1047
|
}
|
|
1048
|
-
.
|
|
1048
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 ._PagesWrapperInner_1c9ty_90 {
|
|
1049
1049
|
height: 100%;
|
|
1050
1050
|
}
|
|
1051
|
-
.
|
|
1051
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 ._PagesWrapperInner_1c9ty_90 > .xmlui-page-root {
|
|
1052
1052
|
height: 100%;
|
|
1053
1053
|
}
|
|
1054
|
-
.
|
|
1054
|
+
._wrapper_1c9ty_13._verticalFullHeader_1c9ty_73 ._footerWrapper_1c9ty_41 {
|
|
1055
1055
|
position: sticky;
|
|
1056
1056
|
left: 0;
|
|
1057
1057
|
right: 0;
|
|
1058
1058
|
bottom: 0;
|
|
1059
1059
|
}
|
|
1060
|
-
.
|
|
1060
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 {
|
|
1061
|
+
min-height: 100%;
|
|
1062
|
+
height: 100%;
|
|
1063
|
+
overflow: auto;
|
|
1064
|
+
scroll-padding-block: var(--xmlui-scroll-padding-block-Pages);
|
|
1065
|
+
}
|
|
1066
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._header_1c9ty_108 {
|
|
1067
|
+
max-width: var(--xmlui-maxWidth-App);
|
|
1068
|
+
margin: auto;
|
|
1069
|
+
}
|
|
1070
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._navPanelWrapper_1c9ty_33 {
|
|
1071
|
+
width: var(--xmlui-width-navPanel-App);
|
|
1072
|
+
position: sticky;
|
|
1073
|
+
height: calc(var(--containerHeight, 100vh) - var(--footer-height) - var(--header-height));
|
|
1074
|
+
top: var(--header-height);
|
|
1075
|
+
}
|
|
1076
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._PagesWrapper_1c9ty_37 {
|
|
1077
|
+
overflow: initial;
|
|
1078
|
+
min-height: calc(var(--containerHeight, 100vh) - var(--header-height) - var(--footer-height));
|
|
1079
|
+
height: 100%;
|
|
1080
|
+
}
|
|
1081
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._PagesWrapperInner_1c9ty_90 {
|
|
1082
|
+
height: 100%;
|
|
1083
|
+
}
|
|
1084
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._PagesWrapperInner_1c9ty_90 > .xmlui-page-root {
|
|
1085
|
+
height: 100%;
|
|
1086
|
+
}
|
|
1087
|
+
._wrapper_1c9ty_13._verticalConstrained_1c9ty_102 ._footerWrapper_1c9ty_41 {
|
|
1088
|
+
position: sticky;
|
|
1089
|
+
left: 0;
|
|
1090
|
+
right: 0;
|
|
1091
|
+
bottom: 0;
|
|
1092
|
+
}
|
|
1093
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135 {
|
|
1061
1094
|
scrollbar-gutter: stable both-edges;
|
|
1062
1095
|
}
|
|
1063
|
-
.
|
|
1096
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135 ._headerWrapper_1c9ty_138 {
|
|
1064
1097
|
margin-inline: calc(-1 * var(--scrollbar-width));
|
|
1065
1098
|
}
|
|
1066
|
-
.
|
|
1099
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135 ._headerWrapper_1c9ty_138 > div {
|
|
1067
1100
|
padding-inline: var(--scrollbar-width);
|
|
1068
1101
|
}
|
|
1069
|
-
.
|
|
1102
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135 ._footerWrapper_1c9ty_41 {
|
|
1070
1103
|
margin-inline: calc(-1 * var(--scrollbar-width));
|
|
1071
1104
|
}
|
|
1072
|
-
.
|
|
1105
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135 ._footerWrapper_1c9ty_41 > div {
|
|
1073
1106
|
padding-inline: var(--scrollbar-width);
|
|
1074
1107
|
}
|
|
1075
|
-
.
|
|
1108
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalFullHeader_1c9ty_73 {
|
|
1076
1109
|
scroll-padding-top: var(--header-height);
|
|
1077
1110
|
}
|
|
1078
|
-
.
|
|
1111
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalFullHeader_1c9ty_73 ._content_1c9ty_27 {
|
|
1112
|
+
margin-inline: calc(-1 * var(--scrollbar-width));
|
|
1113
|
+
}
|
|
1114
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalFullHeader_1c9ty_73 ._contentWrapper_1c9ty_27 {
|
|
1115
|
+
padding-inline: var(--scrollbar-width);
|
|
1116
|
+
}
|
|
1117
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 {
|
|
1118
|
+
scroll-padding-top: var(--header-height);
|
|
1119
|
+
}
|
|
1120
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 ._content_1c9ty_27 {
|
|
1121
|
+
width: var(--xmlui-maxWidth-App);
|
|
1122
|
+
margin-inline: calc(-1 * var(--scrollbar-width));
|
|
1123
|
+
margin: auto;
|
|
1124
|
+
}
|
|
1125
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 ._contentWrapper_1c9ty_27 {
|
|
1126
|
+
padding-inline: var(--scrollbar-width);
|
|
1127
|
+
}
|
|
1128
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 ._headerWrapper_1c9ty_138 > div {
|
|
1129
|
+
width: var(--xmlui-maxWidth-App);
|
|
1130
|
+
}
|
|
1131
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 ._footerWrapper_1c9ty_41 {
|
|
1079
1132
|
margin-inline: calc(-1 * var(--scrollbar-width));
|
|
1080
1133
|
}
|
|
1081
|
-
.
|
|
1134
|
+
._wrapper_1c9ty_13._scrollWholePage_1c9ty_135._verticalConstrained_1c9ty_102 ._footerWrapper_1c9ty_41 > div {
|
|
1082
1135
|
padding-inline: var(--scrollbar-width);
|
|
1083
1136
|
}
|
|
1084
|
-
.
|
|
1137
|
+
._wrapper_1c9ty_13:not(._scrollWholePage_1c9ty_135) {
|
|
1085
1138
|
overflow: hidden;
|
|
1086
1139
|
}
|
|
1087
|
-
.
|
|
1140
|
+
._wrapper_1c9ty_13:not(._scrollWholePage_1c9ty_135) ._content_1c9ty_27 {
|
|
1088
1141
|
min-height: 0;
|
|
1089
1142
|
height: 100%;
|
|
1090
1143
|
}
|
|
1091
|
-
.
|
|
1144
|
+
._wrapper_1c9ty_13:not(._scrollWholePage_1c9ty_135) ._contentWrapper_1c9ty_27 {
|
|
1092
1145
|
overflow: initial;
|
|
1093
1146
|
}
|
|
1094
|
-
.
|
|
1147
|
+
._wrapper_1c9ty_13:not(._scrollWholePage_1c9ty_135) ._PagesWrapper_1c9ty_37 {
|
|
1095
1148
|
overflow: auto;
|
|
1096
1149
|
scroll-padding-block: var(--xmlui-scroll-padding-block-Pages);
|
|
1097
1150
|
min-height: 0;
|
|
1098
1151
|
height: 100%;
|
|
1099
1152
|
scrollbar-gutter: stable both-edges;
|
|
1100
1153
|
}
|
|
1101
|
-
.
|
|
1154
|
+
._wrapper_1c9ty_13:not(._scrollWholePage_1c9ty_135) ._PagesWrapperInner_1c9ty_90 {
|
|
1102
1155
|
min-height: 100%;
|
|
1103
1156
|
height: 0;
|
|
1104
1157
|
}
|
|
1105
|
-
.
|
|
1158
|
+
._wrapper_1c9ty_13._noScrollbarGutters_1c9ty_200 {
|
|
1106
1159
|
scrollbar-gutter: auto;
|
|
1107
1160
|
}
|
|
1108
|
-
.
|
|
1161
|
+
._wrapper_1c9ty_13._noScrollbarGutters_1c9ty_200 ._PagesWrapper_1c9ty_37 {
|
|
1109
1162
|
scrollbar-gutter: auto;
|
|
1110
1163
|
}
|
|
1111
1164
|
|
|
1112
|
-
.
|
|
1165
|
+
._headerWrapper_1c9ty_138 {
|
|
1113
1166
|
z-index: 1;
|
|
1114
1167
|
min-height: 0;
|
|
1115
1168
|
flex-shrink: 0;
|
|
@@ -1118,17 +1171,17 @@
|
|
|
1118
1171
|
box-shadow: var(--xmlui-boxShadow-header-App);
|
|
1119
1172
|
background-color: var(--xmlui-backgroundColor-AppHeader);
|
|
1120
1173
|
}
|
|
1121
|
-
.
|
|
1174
|
+
._headerWrapper_1c9ty_138._sticky_1c9ty_44 {
|
|
1122
1175
|
position: sticky;
|
|
1123
1176
|
}
|
|
1124
1177
|
|
|
1125
|
-
.
|
|
1178
|
+
._content_1c9ty_27 {
|
|
1126
1179
|
display: flex;
|
|
1127
1180
|
flex-direction: row;
|
|
1128
1181
|
isolation: isolate;
|
|
1129
1182
|
}
|
|
1130
1183
|
|
|
1131
|
-
.
|
|
1184
|
+
._contentWrapper_1c9ty_27 {
|
|
1132
1185
|
position: relative;
|
|
1133
1186
|
min-width: 0;
|
|
1134
1187
|
flex: 1;
|
|
@@ -1139,21 +1192,21 @@
|
|
|
1139
1192
|
border-left: var(--xmlui-borderLeft-content-App);
|
|
1140
1193
|
}
|
|
1141
1194
|
|
|
1142
|
-
.
|
|
1195
|
+
._navPanelWrapper_1c9ty_33 {
|
|
1143
1196
|
display: flex;
|
|
1144
1197
|
position: sticky;
|
|
1145
1198
|
top: 0;
|
|
1146
1199
|
}
|
|
1147
|
-
.
|
|
1200
|
+
._navPanelWrapper_1c9ty_33:empty {
|
|
1148
1201
|
display: none;
|
|
1149
1202
|
}
|
|
1150
1203
|
|
|
1151
|
-
.
|
|
1204
|
+
._PagesWrapper_1c9ty_37 {
|
|
1152
1205
|
flex: 1;
|
|
1153
1206
|
isolation: isolate;
|
|
1154
1207
|
}
|
|
1155
1208
|
|
|
1156
|
-
.
|
|
1209
|
+
._PagesWrapperInner_1c9ty_90 {
|
|
1157
1210
|
--page-padding-left: var(--xmlui-space-4);
|
|
1158
1211
|
--page-padding-right: var(--xmlui-space-4);
|
|
1159
1212
|
--page-padding-top: var(--xmlui-space-5);
|
|
@@ -1171,7 +1224,7 @@
|
|
|
1171
1224
|
display: flex;
|
|
1172
1225
|
flex-direction: column;
|
|
1173
1226
|
}
|
|
1174
|
-
.
|
|
1227
|
+
._PagesWrapperInner_1c9ty_90 > .xmlui-page-root {
|
|
1175
1228
|
padding-top: var(--page-padding-top-override, var(--page-padding-top));
|
|
1176
1229
|
padding-bottom: var(--page-padding-bottom-override, var(--page-padding-bottom));
|
|
1177
1230
|
padding-right: var(--page-padding-right-override, var(--page-padding-right));
|
|
@@ -1183,7 +1236,7 @@
|
|
|
1183
1236
|
margin-right: calc(-1 * var(--page-padding-right));
|
|
1184
1237
|
}
|
|
1185
1238
|
|
|
1186
|
-
.
|
|
1239
|
+
._footerWrapper_1c9ty_41 {
|
|
1187
1240
|
flex-shrink: 0;
|
|
1188
1241
|
}/*
|
|
1189
1242
|
* This file contains all CSS variables AppEngine uses for styling the UI, including individual visual components.
|
|
@@ -185,6 +185,9 @@ function App({ children, style, layout, loggedInUser, scrollWholePage, noScrollb
|
|
|
185
185
|
case "vertical-full-header":
|
|
186
186
|
content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.verticalFullHeader), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: header }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.content, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("aside", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel }), (0, jsx_runtime_1.jsx)("main", { className: App_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(ScrollContext_1.ScrollContext.Provider, { value: scrollContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapperInner, style: pagesWrapperInnerStyle, children: children }) }) }) })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] }));
|
|
187
187
|
break;
|
|
188
|
+
case "vertical-constrained-width":
|
|
189
|
+
content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.verticalConstrained), style: styleWithHelpers, ref: scrollPageContainerRef, children: [(0, jsx_runtime_1.jsx)("header", { className: (0, classnames_1.default)(App_module_scss_1.default.headerWrapper, App_module_scss_1.default.sticky), ref: headerRefCallback, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.header, style: { paddingInline: 0 }, children: header }) }), (0, jsx_runtime_1.jsxs)("div", { className: App_module_scss_1.default.content, children: [navPanelVisible && (0, jsx_runtime_1.jsx)("aside", { className: App_module_scss_1.default.navPanelWrapper, children: navPanel }), (0, jsx_runtime_1.jsx)("main", { className: App_module_scss_1.default.contentWrapper, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapper, ref: noScrollPageContainerRef, children: (0, jsx_runtime_1.jsx)(ScrollContext_1.ScrollContext.Provider, { value: scrollContainerRef, children: (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.PagesWrapperInner, style: pagesWrapperInnerStyle, children: children }) }) }) })] }), (0, jsx_runtime_1.jsx)("div", { className: App_module_scss_1.default.footerWrapper, ref: footerRefCallback, children: footer })] }));
|
|
190
|
+
break;
|
|
188
191
|
case "condensed":
|
|
189
192
|
case "condensed-sticky":
|
|
190
193
|
content = ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(wrapperBaseClasses, App_module_scss_1.default.horizontal, {
|
|
@@ -210,6 +213,7 @@ function getAppLayoutOrientation(appLayout) {
|
|
|
210
213
|
case "vertical":
|
|
211
214
|
case "vertical-sticky":
|
|
212
215
|
case "vertical-full-header":
|
|
216
|
+
case "vertical-constrained-width":
|
|
213
217
|
return "vertical";
|
|
214
218
|
default:
|
|
215
219
|
return "horizontal";
|
|
@@ -88,8 +88,11 @@ exports.selectComponentRenderer = (0, renderers_1.createComponentRenderer)(COMP,
|
|
|
88
88
|
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionLabelTemplate, item: item, renderChild: renderChild }));
|
|
89
89
|
}
|
|
90
90
|
: undefined, optionRenderer: node.props.optionTemplate
|
|
91
|
-
? (item) => {
|
|
92
|
-
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionTemplate, item: item,
|
|
91
|
+
? (item, val, inTrigger) => {
|
|
92
|
+
return ((0, jsx_runtime_1.jsx)(container_helpers_1.MemoizedItem, { node: node.props.optionTemplate, item: item, contextVars: {
|
|
93
|
+
$selectedValue: val,
|
|
94
|
+
$inTrigger: inTrigger
|
|
95
|
+
}, renderChild: (...args) => ((0, jsx_runtime_1.jsx)(react_select_1.SelectItemText, { children: renderChild(...args) })) }));
|
|
93
96
|
}
|
|
94
97
|
: undefined, valueRenderer: node.props.valueTemplate
|
|
95
98
|
? (item, removeItem) => {
|
|
@@ -200,7 +200,7 @@ exports.ComboboxOption = (0, react_1.forwardRef)(function Combobox(option, forwa
|
|
|
200
200
|
}, [selectedValue, value, multiSelect]);
|
|
201
201
|
return ((0, jsx_runtime_1.jsx)(cmdk_1.CommandItem, { id: id, ref: forwardedRef, disabled: !enabled, value: `${value}`, className: Select_module_scss_1.default.multiComboboxOption, onSelect: () => {
|
|
202
202
|
onChange(value);
|
|
203
|
-
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiComboboxOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }, id));
|
|
203
|
+
}, "data-state": selected ? "checked" : undefined, keywords: keywords, children: (0, jsx_runtime_1.jsx)("div", { className: Select_module_scss_1.default.multiComboboxOptionContent, children: optionRenderer ? (optionRenderer({ label, value, enabled, keywords }, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [optionLabelRenderer ? optionLabelRenderer({ label, value }) : label, selected && (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" })] })) }) }, id));
|
|
204
204
|
});
|
|
205
205
|
function HiddenOption(option) {
|
|
206
206
|
const { onOptionRemove, onOptionAdd } = (0, OptionContext_1.useOption)();
|
|
@@ -218,7 +218,7 @@ function HiddenOption(option) {
|
|
|
218
218
|
const SelectOption = react_1.default.forwardRef((option, ref) => {
|
|
219
219
|
const { value, label, enabled = true } = option;
|
|
220
220
|
const { onOptionRemove, onOptionAdd } = (0, OptionContext_1.useOption)();
|
|
221
|
-
const { optionLabelRenderer, optionRenderer } = (0, SelectContext_1.useSelect)();
|
|
221
|
+
const { optionLabelRenderer, optionRenderer, value: selectedValue, multiSelect } = (0, SelectContext_1.useSelect)();
|
|
222
222
|
(0, react_1.useLayoutEffect)(() => {
|
|
223
223
|
onOptionAdd(option);
|
|
224
224
|
return () => onOptionRemove(option);
|
|
@@ -227,6 +227,6 @@ const SelectOption = react_1.default.forwardRef((option, ref) => {
|
|
|
227
227
|
label,
|
|
228
228
|
value,
|
|
229
229
|
enabled,
|
|
230
|
-
})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_select_1.ItemText, { className: Select_module_scss_1.default.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label }) : label }), (0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.selectItemIndicator, children: (0, jsx_runtime_1.jsx)(react_select_1.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" }) }) })] })) }) }));
|
|
230
|
+
}, selectedValue, false)) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_select_1.ItemText, { className: Select_module_scss_1.default.selectItemContent, children: optionLabelRenderer ? optionLabelRenderer({ value, label }) : label }), (0, jsx_runtime_1.jsx)("span", { className: Select_module_scss_1.default.selectItemIndicator, children: (0, jsx_runtime_1.jsx)(react_select_1.ItemIndicator, { children: (0, jsx_runtime_1.jsx)(IconNative_1.default, { name: "checkmark" }) }) })] })) }) }));
|
|
231
231
|
});
|
|
232
232
|
SelectOption.displayName = "SelectOption";
|
|
@@ -19,7 +19,7 @@ const InspectorButton_module_scss_1 = __importDefault(require("./InspectorButton
|
|
|
19
19
|
const ComponentRegistryContext_1 = require("../components/ComponentRegistryContext");
|
|
20
20
|
// --- The context object that is used to store the inspector information.
|
|
21
21
|
exports.InspectorContext = (0, react_1.createContext)(null);
|
|
22
|
-
function InspectorProvider({ children, sources, }) {
|
|
22
|
+
function InspectorProvider({ children, sources, projectCompilation, }) {
|
|
23
23
|
const { root } = (0, ThemeContext_1.useTheme)();
|
|
24
24
|
const [inspectable, setInspectable] = (0, react_1.useState)({});
|
|
25
25
|
const [inspectedNode, setInspectedNode] = (0, react_1.useState)(null);
|
|
@@ -60,8 +60,9 @@ function InspectorProvider({ children, sources, }) {
|
|
|
60
60
|
devToolsSide,
|
|
61
61
|
setDevToolsSide,
|
|
62
62
|
devToolsEnabled: showCode,
|
|
63
|
+
projectCompilation: projectCompilation,
|
|
63
64
|
};
|
|
64
|
-
}, [devToolsSide, devToolsSize, sources, inspectedNode, showCode]);
|
|
65
|
+
}, [devToolsSide, devToolsSize, sources, inspectedNode, showCode, projectCompilation]);
|
|
65
66
|
return ((0, jsx_runtime_1.jsxs)(exports.InspectorContext.Provider, { value: contextValue, children: [children, process.env.VITE_USER_COMPONENTS_Inspect !== "false" &&
|
|
66
67
|
showCode &&
|
|
67
68
|
inspectedNode !== null &&
|
|
@@ -145,6 +146,7 @@ function InspectButton({ inspectId, node, setInspectedNode, setShowCode, }) {
|
|
|
145
146
|
function useDevTools() {
|
|
146
147
|
const context = (0, react_1.useContext)(exports.InspectorContext);
|
|
147
148
|
return {
|
|
149
|
+
projectCompilation: context === null || context === void 0 ? void 0 : context.projectCompilation,
|
|
148
150
|
inspectedNode: context === null || context === void 0 ? void 0 : context.inspectedNode,
|
|
149
151
|
sources: context === null || context === void 0 ? void 0 : context.sources,
|
|
150
152
|
setIsOpen: context === null || context === void 0 ? void 0 : context.setIsOpen,
|
|
@@ -21,7 +21,7 @@ const Loader_1 = require("./Loader");
|
|
|
21
21
|
/**
|
|
22
22
|
* Represents a non-displayed React component, which handles the specified API loader
|
|
23
23
|
*/
|
|
24
|
-
function ApiLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, state, doNotRemoveNulls, }) {
|
|
24
|
+
function ApiLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, state, doNotRemoveNulls, structuralSharing = true, }) {
|
|
25
25
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
26
26
|
const url = (0, extractParam_1.extractParam)(state, loader.props.url, appContext);
|
|
27
27
|
const loadable = !!url;
|
|
@@ -39,7 +39,7 @@ function ApiLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged,
|
|
|
39
39
|
}
|
|
40
40
|
return responseObj;
|
|
41
41
|
}), [doNotRemoveNulls, loadable, loader.props.raw, url]);
|
|
42
|
-
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad }));
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad, structuralSharing: structuralSharing }));
|
|
43
43
|
}
|
|
44
44
|
const ApiLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
45
45
|
description: `Represents a loader that calls an API through an HTTP/HTTPS GET request`,
|
|
@@ -26,7 +26,7 @@ const PageableLoader_1 = require("../loader/PageableLoader");
|
|
|
26
26
|
const Loader_1 = require("../loader/Loader");
|
|
27
27
|
const AppContext_1 = require("../AppContext");
|
|
28
28
|
const hooks_1 = require("../utils/hooks");
|
|
29
|
-
function DataLoader({ loader, state, registerComponentApi, onLoaded, onError, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, transformResult, }) {
|
|
29
|
+
function DataLoader({ loader, state, registerComponentApi, onLoaded, onError, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, transformResult, structuralSharing = true, }) {
|
|
30
30
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
31
31
|
const url = (0, extractParam_1.extractParam)(state, loader.props.url, appContext);
|
|
32
32
|
const queryParamsInner = (0, react_1.useMemo)(() => {
|
|
@@ -290,7 +290,7 @@ function DataLoader({ loader, state, registerComponentApi, onLoaded, onError, lo
|
|
|
290
290
|
}
|
|
291
291
|
}), [appContext, loader.props.errorNotificationMessage, loaderError, onError]);
|
|
292
292
|
const pollIntervalInSeconds = (0, extractParam_1.extractParam)(state, loader.props.pollIntervalInSeconds, appContext);
|
|
293
|
-
return hasPaging ? ((0, jsx_runtime_1.jsx)(PageableLoader_1.PageableLoader, { queryId: queryId, state: state, loader: loader, loaderInProgressChanged: inProgress, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaded, loaderError: error, loaderFn: doLoad, registerComponentApi: registerComponentApi, pollIntervalInSeconds: pollIntervalInSeconds, onLoaded: onLoaded, transformResult: transformResult }, queryId === null || queryId === void 0 ? void 0 : queryId.join(""))) : ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { queryId: queryId, state: state, loader: loader, loaderInProgressChanged: inProgress, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaded, loaderError: error, loaderFn: doLoad, pollIntervalInSeconds: pollIntervalInSeconds, registerComponentApi: registerComponentApi, onLoaded: onLoaded, transformResult: transformResult }, queryId === null || queryId === void 0 ? void 0 : queryId.join("")));
|
|
293
|
+
return hasPaging ? ((0, jsx_runtime_1.jsx)(PageableLoader_1.PageableLoader, { queryId: queryId, state: state, loader: loader, loaderInProgressChanged: inProgress, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaded, loaderError: error, loaderFn: doLoad, registerComponentApi: registerComponentApi, pollIntervalInSeconds: pollIntervalInSeconds, onLoaded: onLoaded, transformResult: transformResult, structuralSharing: structuralSharing }, queryId === null || queryId === void 0 ? void 0 : queryId.join(""))) : ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { queryId: queryId, state: state, loader: loader, loaderInProgressChanged: inProgress, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaded, loaderError: error, loaderFn: doLoad, pollIntervalInSeconds: pollIntervalInSeconds, registerComponentApi: registerComponentApi, onLoaded: onLoaded, transformResult: transformResult, structuralSharing: structuralSharing }, queryId === null || queryId === void 0 ? void 0 : queryId.join("")));
|
|
294
294
|
}
|
|
295
295
|
exports.DataLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
296
296
|
description: "This component manages data fetching from a web API",
|
|
@@ -310,17 +310,18 @@ exports.DataLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
310
310
|
errorNotificationMessage: (0, ComponentDefs_1.d)("The message to show when an error occurs"),
|
|
311
311
|
transformResult: (0, ComponentDefs_1.d)("Function for transforming the datasource result"),
|
|
312
312
|
dataType: (0, ComponentDefs_1.d)("Type of data to fetch (default: json, or csv, or sql)"),
|
|
313
|
+
structuralSharing: (0, ComponentDefs_1.d)("Whether to use structural sharing for the data"),
|
|
313
314
|
},
|
|
314
315
|
events: {
|
|
315
316
|
loaded: (0, ComponentDefs_1.d)("Event to trigger when the data is loaded"),
|
|
316
317
|
error: (0, ComponentDefs_1.d)("This event fires when an error occurs while fetching data"),
|
|
317
318
|
},
|
|
318
319
|
});
|
|
319
|
-
exports.dataLoaderRenderer = (0, renderers_1.createLoaderRenderer)("DataLoader", ({ loader, state, loaderLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, registerComponentApi, lookupAction, lookupSyncCallback, }) => {
|
|
320
|
+
exports.dataLoaderRenderer = (0, renderers_1.createLoaderRenderer)("DataLoader", ({ loader, state, loaderLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, registerComponentApi, lookupAction, lookupSyncCallback, extractValue }) => {
|
|
320
321
|
var _a, _b, _c;
|
|
321
322
|
// --- Check for required properties
|
|
322
323
|
if (!((_a = loader.props) === null || _a === void 0 ? void 0 : _a.url) || !loader.props.url.trim()) {
|
|
323
324
|
throw new Error("You must specify a non-empty (not whitespace-only) 'url' property for DataSource");
|
|
324
325
|
}
|
|
325
|
-
return ((0, jsx_runtime_1.jsx)(DataLoader, { loader: loader, state: state, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, registerComponentApi: registerComponentApi, transformResult: lookupSyncCallback(loader.props.transformResult), onLoaded: lookupAction((_b = loader.events) === null || _b === void 0 ? void 0 : _b.loaded, { eventName: "loaded" }), onError: lookupAction((_c = loader.events) === null || _c === void 0 ? void 0 : _c.error, { eventName: "error" }) }));
|
|
326
|
+
return ((0, jsx_runtime_1.jsx)(DataLoader, { loader: loader, state: state, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, registerComponentApi: registerComponentApi, transformResult: lookupSyncCallback(loader.props.transformResult), onLoaded: lookupAction((_b = loader.events) === null || _b === void 0 ? void 0 : _b.loaded, { eventName: "loaded" }), onError: lookupAction((_c = loader.events) === null || _c === void 0 ? void 0 : _c.error, { eventName: "error" }), structuralSharing: extractValue.asOptionalBoolean(loader.props.structuralSharing) }));
|
|
326
327
|
}, exports.DataLoaderMd);
|
|
@@ -21,7 +21,7 @@ const Loader_1 = require("./Loader");
|
|
|
21
21
|
/**
|
|
22
22
|
* Represents a non-displayed React component, which handles the specified API loader
|
|
23
23
|
*/
|
|
24
|
-
function ExternalDataLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, loaderLoaded, state, doNotRemoveNulls, }) {
|
|
24
|
+
function ExternalDataLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, loaderLoaded, state, doNotRemoveNulls, structuralSharing = true, }) {
|
|
25
25
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
26
26
|
const method = (0, extractParam_1.extractParam)(state, loader.props.method, appContext);
|
|
27
27
|
const headers = (0, extractParam_1.extractParam)(state, loader.props.headers, appContext);
|
|
@@ -43,7 +43,7 @@ function ExternalDataLoader({ loader, loaderInProgressChanged, loaderIsRefetchin
|
|
|
43
43
|
}
|
|
44
44
|
return responseObj;
|
|
45
45
|
}), [urlLoadable, headers, data, url, method, doNotRemoveNulls]);
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad }));
|
|
46
|
+
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad, structuralSharing: structuralSharing }));
|
|
47
47
|
}
|
|
48
48
|
exports.ExternalDataLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
49
49
|
description: `Represents a loader that calls an API through an HTTP/HTTPS GET request`,
|
|
@@ -16,19 +16,18 @@ const immer_1 = require("immer");
|
|
|
16
16
|
const extractParam_1 = require("../utils/extractParam");
|
|
17
17
|
const AppContext_1 = require("../AppContext");
|
|
18
18
|
const hooks_1 = require("../utils/hooks");
|
|
19
|
-
function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, registerComponentApi, onLoaded, loaderLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, transformResult, }) {
|
|
19
|
+
function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, registerComponentApi, onLoaded, loaderLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, transformResult, structuralSharing = true }) {
|
|
20
20
|
const { uid } = loader;
|
|
21
21
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
22
|
-
const [isRefetching, setIsRefetching] = (0, react_1.useState)(false);
|
|
23
22
|
// --- Rely on react-query to decide when data fetching should use the cache or when is should fetch the data from
|
|
24
23
|
// --- its data source.
|
|
25
24
|
// --- data: The data obtained by the query
|
|
26
25
|
// --- status: Query execution status
|
|
27
26
|
// --- error: Error information about the current query error (in "error" state)
|
|
28
27
|
// --- refetch: The function that can be used to re-fetch the data (because of data/state changes)
|
|
29
|
-
const { data, status, isFetching, error, refetch } = (0, react_query_1.useQuery)({
|
|
28
|
+
const { data, status, isFetching, error, refetch, isRefetching } = (0, react_query_1.useQuery)({
|
|
30
29
|
queryKey: (0, react_1.useMemo)(() => (queryId ? queryId : [uid, (0, extractParam_1.extractParam)(state, loader.props, appContext)]), [appContext, loader.props, queryId, state, uid]),
|
|
31
|
-
structuralSharing
|
|
30
|
+
structuralSharing,
|
|
32
31
|
queryFn: (0, react_1.useCallback)((_a) => __awaiter(this, [_a], void 0, function* ({ signal }) {
|
|
33
32
|
// console.log("[Loader queryFn] Starting to fetch data...");
|
|
34
33
|
try {
|
|
@@ -66,7 +65,6 @@ function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, regis
|
|
|
66
65
|
let intervalId;
|
|
67
66
|
if (pollIntervalInSeconds) {
|
|
68
67
|
intervalId = setInterval(() => {
|
|
69
|
-
setIsRefetching(true);
|
|
70
68
|
refetch();
|
|
71
69
|
}, pollIntervalInSeconds * 1000);
|
|
72
70
|
}
|
|
@@ -100,13 +98,11 @@ function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, regis
|
|
|
100
98
|
// console.log("[Loader] Calling onLoaded with data:", data);
|
|
101
99
|
// console.log("[Loader] onLoaded function exists:", !!onLoaded);
|
|
102
100
|
onLoaded === null || onLoaded === void 0 ? void 0 : onLoaded(data, isRefetching);
|
|
103
|
-
setIsRefetching(false);
|
|
104
101
|
}, 0);
|
|
105
102
|
}
|
|
106
103
|
else if (status === "error" && error !== prevError) {
|
|
107
104
|
// console.log("[Loader] Calling loaderError with error:", error);
|
|
108
105
|
loaderError(error);
|
|
109
|
-
setIsRefetching(false);
|
|
110
106
|
}
|
|
111
107
|
}, [data, error, loaderError, loaderLoaded, onLoaded, prevData, prevError, status, isRefetching]);
|
|
112
108
|
(0, react_1.useLayoutEffect)(() => {
|
|
@@ -117,7 +113,6 @@ function Loader({ state, loader, loaderFn, queryId, pollIntervalInSeconds, regis
|
|
|
117
113
|
(0, react_1.useEffect)(() => {
|
|
118
114
|
registerComponentApi === null || registerComponentApi === void 0 ? void 0 : registerComponentApi({
|
|
119
115
|
refetch: (options) => __awaiter(this, void 0, void 0, function* () {
|
|
120
|
-
setIsRefetching(true);
|
|
121
116
|
refetch(options);
|
|
122
117
|
}),
|
|
123
118
|
update: (updater) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -18,7 +18,7 @@ const extractParam_1 = require("../utils/extractParam");
|
|
|
18
18
|
const renderers_1 = require("../renderers");
|
|
19
19
|
const AppContext_1 = require("../AppContext");
|
|
20
20
|
const Loader_1 = require("./Loader");
|
|
21
|
-
function
|
|
21
|
+
function MockLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged, loaderError, loaderLoaded, state, structuralSharing }) {
|
|
22
22
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
23
23
|
const waitTime = (0, extractParam_1.extractParam)(state, loader.props.waitTime, appContext);
|
|
24
24
|
const responseObj = (0, extractParam_1.extractParam)(state, loader.props.data, appContext);
|
|
@@ -26,7 +26,7 @@ function ApiLoader({ loader, loaderInProgressChanged, loaderIsRefetchingChanged,
|
|
|
26
26
|
waitTime && (yield (0, misc_1.asyncWait)(waitTime));
|
|
27
27
|
return responseObj;
|
|
28
28
|
}), [responseObj, waitTime]);
|
|
29
|
-
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad }));
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(Loader_1.Loader, { state: state, loader: loader, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderIsRefetchingChanged, loaderLoaded: loaderLoaded, loaderError: loaderError, loaderFn: doLoad, structuralSharing: structuralSharing }));
|
|
30
30
|
}
|
|
31
31
|
exports.MockLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
32
32
|
description: "A loader that simulates a delay and returns a predefined response",
|
|
@@ -36,5 +36,5 @@ exports.MockLoaderMd = (0, ComponentDefs_1.createMetadata)({
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
exports.mockLoaderRenderer = (0, renderers_1.createLoaderRenderer)("MockLoader", ({ loader, state, loaderInProgressChanged, loaderLoaded, loaderError }) => {
|
|
39
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
39
|
+
return ((0, jsx_runtime_1.jsx)(MockLoader, { loader: loader, state: state, loaderInProgressChanged: loaderInProgressChanged, loaderIsRefetchingChanged: loaderInProgressChanged, loaderLoaded: loaderLoaded, loaderError: loaderError }));
|
|
40
40
|
}, exports.MockLoaderMd);
|
|
@@ -49,12 +49,11 @@ const immer_1 = __importStar(require("immer"));
|
|
|
49
49
|
const extractParam_1 = require("../utils/extractParam");
|
|
50
50
|
const AppContext_1 = require("../AppContext");
|
|
51
51
|
const hooks_1 = require("../utils/hooks");
|
|
52
|
-
function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi, pollIntervalInSeconds, onLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, transformResult, }) {
|
|
52
|
+
function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi, pollIntervalInSeconds, onLoaded, loaderInProgressChanged, loaderIsRefetchingChanged, loaderLoaded, loaderError, transformResult, structuralSharing = true, }) {
|
|
53
53
|
const { uid } = loader;
|
|
54
54
|
const appContext = (0, AppContext_1.useAppContext)();
|
|
55
55
|
const queryKey = (0, react_1.useMemo)(() => (queryId ? queryId : [uid, (0, extractParam_1.extractParam)(state, loader.props, appContext)]), [appContext, loader.props, queryId, state, uid]);
|
|
56
56
|
const thizRef = (0, react_1.useRef)(queryKey);
|
|
57
|
-
const [isRefetching, setIsRefetching] = (0, react_1.useState)(false);
|
|
58
57
|
const getPreviousPageParam = (0, react_1.useCallback)((firstPage) => {
|
|
59
58
|
let prevPageParam = undefined;
|
|
60
59
|
const prevPageSelector = loader.props.prevPageSelector;
|
|
@@ -84,11 +83,12 @@ function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi
|
|
|
84
83
|
// useEffect(()=>{
|
|
85
84
|
// console.log("TRANSFORM RESULT CHANGED", transformResult);
|
|
86
85
|
// }, [transformResult]);
|
|
87
|
-
const { data, status, error, hasNextPage, isFetchingNextPage, hasPreviousPage, isFetchingPreviousPage, isFetching, refetch, fetchPreviousPage, fetchNextPage, } = (0, react_query_1.useInfiniteQuery)({
|
|
86
|
+
const { data, status, error, hasNextPage, isFetchingNextPage, hasPreviousPage, isFetchingPreviousPage, isFetching, refetch, fetchPreviousPage, fetchNextPage, isRefetching, } = (0, react_query_1.useInfiniteQuery)({
|
|
88
87
|
queryKey,
|
|
89
88
|
queryFn: (0, react_1.useCallback)((_a) => __awaiter(this, [_a], void 0, function* ({ signal, pageParam }) {
|
|
90
89
|
return yield loaderFn(signal, pageParam);
|
|
91
90
|
}), [loaderFn]),
|
|
91
|
+
structuralSharing,
|
|
92
92
|
select: (0, react_1.useCallback)((data) => {
|
|
93
93
|
let result = [];
|
|
94
94
|
if (data) {
|
|
@@ -156,12 +156,10 @@ function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi
|
|
|
156
156
|
// access to the latest loader value
|
|
157
157
|
setTimeout(() => {
|
|
158
158
|
onLoaded === null || onLoaded === void 0 ? void 0 : onLoaded(data, isRefetching);
|
|
159
|
-
setIsRefetching(false);
|
|
160
159
|
}, 0);
|
|
161
160
|
}
|
|
162
161
|
else if (status === "error" && prevError !== error) {
|
|
163
162
|
loaderError(error);
|
|
164
|
-
setIsRefetching(false);
|
|
165
163
|
}
|
|
166
164
|
}, [
|
|
167
165
|
data,
|
|
@@ -179,7 +177,6 @@ function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi
|
|
|
179
177
|
let intervalId;
|
|
180
178
|
if (pollIntervalInSeconds) {
|
|
181
179
|
intervalId = setInterval(() => {
|
|
182
|
-
setIsRefetching(true);
|
|
183
180
|
refetch();
|
|
184
181
|
}, pollIntervalInSeconds * 1000);
|
|
185
182
|
}
|
|
@@ -200,7 +197,6 @@ function PageableLoader({ state, loader, loaderFn, queryId, registerComponentApi
|
|
|
200
197
|
fetchPrevPage,
|
|
201
198
|
fetchNextPage: stableFetchNextPage,
|
|
202
199
|
refetch: (options) => __awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
setIsRefetching(true);
|
|
204
200
|
refetch(options);
|
|
205
201
|
}),
|
|
206
202
|
update: (updater) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -32,7 +32,8 @@ function renderChild({ node, state, dispatch, appContext, lookupAction, lookupSy
|
|
|
32
32
|
}
|
|
33
33
|
// --- A TextNode value may contain nexted expressions, so we extract it.
|
|
34
34
|
if (node.type === "TextNode") {
|
|
35
|
-
|
|
35
|
+
const extractedValue = (0, extractParam_1.extractParam)(state, nodeValue, appContext, true);
|
|
36
|
+
return typeof extractedValue === "boolean" ? extractedValue.toString() : extractedValue;
|
|
36
37
|
}
|
|
37
38
|
// --- Rendering a Slot requires some preparations, as TextNode and
|
|
38
39
|
// --- TextNodeCData are virtual nodes. Also, slots may have default templates
|