@wavemaker-ai/react-runtime 1.0.0-rc.322 → 1.0.0-rc.326

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 (258) hide show
  1. package/actions/login-action.js +1 -1
  2. package/components/advanced/carousel/index.d.ts +1 -0
  3. package/components/advanced/carousel/template.d.ts +1 -0
  4. package/components/advanced/login/index.d.ts +1 -0
  5. package/components/advanced/marquee/index.d.ts +1 -0
  6. package/components/basic/anchor/index.d.ts +1 -0
  7. package/components/basic/anchor/index.js +19 -14
  8. package/components/basic/audio/index.d.ts +1 -0
  9. package/components/basic/html/index.d.ts +1 -0
  10. package/components/basic/icon/index.d.ts +1 -0
  11. package/components/basic/icon/index.js +13 -16
  12. package/components/basic/iframe/index.d.ts +1 -0
  13. package/components/basic/label/index.d.ts +1 -0
  14. package/components/basic/label/index.js +5 -3
  15. package/components/basic/label/props.d.ts +1 -1
  16. package/components/basic/picture/index.d.ts +1 -0
  17. package/components/basic/picture/index.js +3 -2
  18. package/components/basic/progress-bar/index.d.ts +1 -0
  19. package/components/basic/progress-circle/index.d.ts +1 -0
  20. package/components/basic/richtexteditor/index.d.ts +2 -0
  21. package/components/basic/search/index.d.ts +6 -0
  22. package/components/basic/search/index.js +69 -9
  23. package/components/basic/search/props.d.ts +4 -0
  24. package/components/basic/spinner/index.d.ts +2 -0
  25. package/components/basic/spinner/index.js +11 -9
  26. package/components/basic/spinner/props.d.ts +5 -0
  27. package/components/basic/tile/index.d.ts +1 -0
  28. package/components/basic/tree/index.d.ts +1 -0
  29. package/components/basic/video/index.d.ts +1 -0
  30. package/components/chart/index.d.ts +2 -0
  31. package/components/chart/props.d.ts +1 -0
  32. package/components/chart/src/chart.js +12 -1
  33. package/components/chart/src/types.d.ts +2 -0
  34. package/components/common/WmAppIcon/index.d.ts +15 -0
  35. package/components/common/WmAppIcon/index.js +130 -0
  36. package/components/common/WmAppIcon/props.d.ts +17 -0
  37. package/components/common/WmAppIcon/props.js +0 -0
  38. package/components/common/index.d.ts +3 -1
  39. package/components/common/index.js +10 -2
  40. package/components/common/wm-skeleton.d.ts +7 -0
  41. package/components/common/wm-skeleton.js +11 -1
  42. package/components/container/accordion/accordion-pane/index.d.ts +2 -0
  43. package/components/container/accordion/accordion-pane/index.js +10 -1
  44. package/components/container/accordion/accordion-pane/props.d.ts +1 -0
  45. package/components/container/accordion/index.d.ts +1 -0
  46. package/components/container/accordion/index.js +2 -2
  47. package/components/container/index.d.ts +1 -0
  48. package/components/container/index.js +6 -1
  49. package/components/container/layout-grid/grid-column/index.d.ts +1 -0
  50. package/components/container/layout-grid/grid-row/index.d.ts +1 -0
  51. package/components/container/layout-grid/grid-row/index.js +1 -1
  52. package/components/container/layout-grid/index.d.ts +1 -0
  53. package/components/container/linear-layout/index.d.ts +1 -0
  54. package/components/container/linear-layout/linear-layout-item/index.d.ts +1 -0
  55. package/components/container/panel/components/panel-header/index.js +16 -16
  56. package/components/container/panel/index.d.ts +1 -0
  57. package/components/container/repeat-template/index.d.ts +1 -0
  58. package/components/container/tabs/index.d.ts +1 -0
  59. package/components/container/tabs/index.js +18 -18
  60. package/components/container/tabs/props.d.ts +1 -0
  61. package/components/container/tabs/tab-pane/index.d.ts +2 -0
  62. package/components/container/tabs/tab-pane/index.js +2 -0
  63. package/components/container/tabs/tab-pane/props.d.ts +1 -0
  64. package/components/container/wizard/components/StepComponents.js +14 -6
  65. package/components/container/wizard/index.d.ts +2 -0
  66. package/components/container/wizard/index.js +2 -2
  67. package/components/container/wizard/props.d.ts +4 -0
  68. package/components/container/wizard/wizard-step/index.d.ts +1 -0
  69. package/components/container/wizard/wizard-step/index.js +6 -0
  70. package/components/data/card/card-actions/index.d.ts +1 -0
  71. package/components/data/card/card-content/index.d.ts +1 -0
  72. package/components/data/card/card-footer/index.d.ts +1 -0
  73. package/components/data/card/index.d.ts +1 -0
  74. package/components/data/card/index.js +13 -6
  75. package/components/data/form/base-form/hooks/useFormSubmission.d.ts +1 -1
  76. package/components/data/form/base-form/hooks/useFormSubmission.js +3 -1
  77. package/components/data/form/base-form/index.js +11 -14
  78. package/components/data/form/base-form/props.d.ts +3 -0
  79. package/components/data/form/dynamic-fields/index.js +1 -0
  80. package/components/data/form/form-action/index.d.ts +2 -0
  81. package/components/data/form/form-action/index.js +6 -4
  82. package/components/data/form/form-controller/withFormController.js +19 -2
  83. package/components/data/form/form-field/base-field.js +8 -5
  84. package/components/data/form/form-field/index.js +14 -9
  85. package/components/data/form/form-field/props.d.ts +1 -0
  86. package/components/data/form/form-header/index.d.ts +1 -1
  87. package/components/data/form/form-header/index.js +10 -1
  88. package/components/data/form/index.js +5 -3
  89. package/components/data/form/props.d.ts +1 -0
  90. package/components/data/list/components/ListHeader.js +19 -3
  91. package/components/data/list/components/ListItemWithTemplate.js +10 -3
  92. package/components/data/list/components/ListItems.d.ts +1 -1
  93. package/components/data/list/components/ListItems.js +5 -1
  94. package/components/data/list/components/LoadMoreButton.js +14 -2
  95. package/components/data/list/components/StandardListItems.js +1 -1
  96. package/components/data/list/components/props.d.ts +11 -5
  97. package/components/data/list/hooks/props.d.ts +2 -2
  98. package/components/data/list/hooks/useListEffects.js +1 -1
  99. package/components/data/list/hooks/useListEventHandlers.js +3 -2
  100. package/components/data/list/index.d.ts +5 -1
  101. package/components/data/list/index.js +28 -7
  102. package/components/data/list/props.d.ts +14 -2
  103. package/components/data/list/utils/constants.d.ts +0 -1
  104. package/components/data/list/utils/constants.js +0 -2
  105. package/components/data/list/utils/list-helpers.d.ts +5 -1
  106. package/components/data/list/utils/list-helpers.js +10 -0
  107. package/components/data/pagination/components/PageSizeSelector.js +49 -155
  108. package/components/data/pagination/hooks/usePagination.js +24 -1
  109. package/components/data/table/components/RowCells.js +18 -4
  110. package/components/data/table/components/TableBody.js +5 -3
  111. package/components/data/table/components/TableDataRow.js +16 -3
  112. package/components/data/table/components/TableHeader.js +10 -8
  113. package/components/data/table/components/TablePanelHeading.js +15 -3
  114. package/components/data/table/hooks/useDynamicColumns.js +1 -1
  115. package/components/data/table/hooks/useResponsiveColumns.d.ts +1 -0
  116. package/components/data/table/hooks/useRowExpansion.js +41 -31
  117. package/components/data/table/hooks/useRowHandlers.js +0 -1
  118. package/components/data/table/hooks/useServerSideSorting.js +0 -1
  119. package/components/data/table/hooks/useTableColumns.js +17 -9
  120. package/components/data/table/hooks/useTableData.js +30 -2
  121. package/components/data/table/hooks/useTableEdit.js +0 -1
  122. package/components/data/table/index.d.ts +4 -0
  123. package/components/data/table/index.js +93 -47
  124. package/components/data/table/live-table/index.d.ts +1 -0
  125. package/components/data/table/live-table/index.js +0 -1
  126. package/components/data/table/props.d.ts +15 -2
  127. package/components/data/table/table-action/index.d.ts +1 -0
  128. package/components/data/table/table-column/index.d.ts +1 -0
  129. package/components/data/table/table-row/index.d.ts +1 -0
  130. package/components/data/table/table-row-action/index.d.ts +1 -0
  131. package/components/data/table/utils/buildSelectionColumns.d.ts +1 -1
  132. package/components/data/table/utils/buildSelectionColumns.js +95 -71
  133. package/components/data/table/utils/columnBuilder.d.ts +29 -2
  134. package/components/data/table/utils/columnBuilder.js +40 -26
  135. package/components/data/table/utils/columnWidthDistribution.d.ts +1 -1
  136. package/components/data/table/utils/columnWidthDistribution.js +14 -1
  137. package/components/data/table/utils/constants.d.ts +0 -4
  138. package/components/data/table/utils/constants.js +0 -7
  139. package/components/data/table/utils/dynamic-columns.d.ts +1 -1
  140. package/components/data/table/utils/dynamic-columns.js +3 -8
  141. package/components/data/table/utils/expansionColumn.d.ts +23 -0
  142. package/components/data/table/utils/expansionColumn.js +56 -0
  143. package/components/data/table/utils/index.d.ts +14 -2
  144. package/components/data/table/utils/index.js +45 -19
  145. package/components/dialogs/alert-dialog/index.d.ts +2 -0
  146. package/components/dialogs/confirm-dialog/index.d.ts +2 -0
  147. package/components/dialogs/dialog/index.d.ts +2 -0
  148. package/components/dialogs/dialog/index.js +3 -2
  149. package/components/dialogs/dialog-actions/index.d.ts +1 -0
  150. package/components/dialogs/dialog-body/index.d.ts +1 -0
  151. package/components/dialogs/dialog-content/index.d.ts +1 -0
  152. package/components/dialogs/dialog-header/index.d.ts +1 -0
  153. package/components/dialogs/dialog-header/index.js +11 -12
  154. package/components/dialogs/iframe-dialog/index.d.ts +2 -0
  155. package/components/dialogs/login-dialog/index.d.ts +4 -0
  156. package/components/dialogs/login-dialog/index.js +2 -1
  157. package/components/dialogs/login-dialog/props.d.ts +1 -0
  158. package/components/dialogs/page-dialog/index.d.ts +4 -0
  159. package/components/dialogs/page-dialog/index.js +2 -1
  160. package/components/dialogs/page-dialog/props.d.ts +1 -0
  161. package/components/form/button/index.d.ts +1 -0
  162. package/components/form/button/index.js +29 -33
  163. package/components/form/button-group/index.d.ts +1 -0
  164. package/components/input/calendar/index.d.ts +2 -0
  165. package/components/input/chips/index.d.ts +2 -0
  166. package/components/input/chips/index.js +9 -3
  167. package/components/input/chips/utils.d.ts +5 -0
  168. package/components/input/chips/utils.js +29 -0
  169. package/components/input/color-picker/index.d.ts +2 -0
  170. package/components/input/composite/index.d.ts +1 -0
  171. package/components/input/composite/index.js +1 -0
  172. package/components/input/currency/index.d.ts +2 -0
  173. package/components/input/default/checkbox/index.d.ts +6 -0
  174. package/components/input/default/checkbox/index.js +48 -18
  175. package/components/input/default/checkbox/props.d.ts +8 -0
  176. package/components/input/default/checkboxset/index.d.ts +2 -0
  177. package/components/input/default/radioset/index.d.ts +2 -0
  178. package/components/input/default/radioset/index.js +2 -1
  179. package/components/input/default/switch/index.d.ts +6 -0
  180. package/components/input/default/switch/index.js +36 -9
  181. package/components/input/default/switch/prop.d.ts +2 -0
  182. package/components/input/epoch/date/index.d.ts +1 -0
  183. package/components/input/epoch/datetime/index.d.ts +1 -0
  184. package/components/input/epoch/time/index.d.ts +1 -0
  185. package/components/input/fileupload/components/ListItems.d.ts +5 -1
  186. package/components/input/fileupload/components/ListItems.js +27 -5
  187. package/components/input/fileupload/components/MultiUpload.js +12 -1
  188. package/components/input/fileupload/components/SingleUpload.js +12 -1
  189. package/components/input/fileupload/index.d.ts +3 -0
  190. package/components/input/fileupload/index.js +11 -0
  191. package/components/input/fileupload/props.d.ts +10 -0
  192. package/components/input/number/index.d.ts +2 -0
  193. package/components/input/rating/index.d.ts +6 -0
  194. package/components/input/rating/index.js +10 -5
  195. package/components/input/rating/props.d.ts +8 -0
  196. package/components/input/select/index.d.ts +2 -0
  197. package/components/input/select/index.js +1 -2
  198. package/components/input/slider/index.d.ts +6 -0
  199. package/components/input/slider/index.js +19 -2
  200. package/components/input/slider/props.d.ts +2 -0
  201. package/components/input/text/index.d.ts +7 -1
  202. package/components/input/text/index.js +25 -6
  203. package/components/input/text/props.d.ts +8 -0
  204. package/components/input/textarea/index.d.ts +2 -0
  205. package/components/input/textarea/index.js +10 -5
  206. package/components/input/textarea/util.d.ts +1 -0
  207. package/components/input/textarea/util.js +17 -0
  208. package/components/input/upload/index.d.ts +2 -0
  209. package/components/navbar/index.d.ts +7 -0
  210. package/components/navbar/index.js +21 -7
  211. package/components/navbar/nav/index.d.ts +1 -0
  212. package/components/navbar/nav-item/index.d.ts +1 -0
  213. package/components/navigation/breadcrumb/index.d.ts +1 -0
  214. package/components/navigation/menu/index.d.ts +3 -1
  215. package/components/navigation/menu/index.js +22 -4
  216. package/components/navigation/menu/props.d.ts +1 -0
  217. package/components/navigation/popover/index.d.ts +1 -0
  218. package/components/navigation/popover/index.js +23 -9
  219. package/components/page/index.js +1 -1
  220. package/components/page/page-content/index.js +6 -2
  221. package/components/page/partial/index.d.ts +1 -0
  222. package/components/page/partial-container/index.js +2 -1
  223. package/components/prefab/index.js +3 -2
  224. package/components/prefab/props.d.ts +1 -0
  225. package/context/WidgetProvider.js +2 -1
  226. package/core/appstore.d.ts +10 -0
  227. package/core/appstore.js +9 -1
  228. package/core/constants/events.d.ts +3 -0
  229. package/core/constants/events.js +13 -1
  230. package/core/proxy-service.d.ts +1 -0
  231. package/core/proxy-service.js +54 -3
  232. package/core/util/index.d.ts +2 -0
  233. package/core/util/index.js +32 -1
  234. package/higherOrder/BasePage.js +106 -30
  235. package/higherOrder/props.d.ts +1 -0
  236. package/higherOrder/useActivePageReactivity.d.ts +21 -0
  237. package/higherOrder/useActivePageReactivity.js +57 -0
  238. package/higherOrder/withBaseWrapper.js +11 -7
  239. package/higherOrder/withRenderLogger.d.ts +15 -0
  240. package/higherOrder/withRenderLogger.js +53 -0
  241. package/hooks/useAuth.js +7 -1
  242. package/package-lock.json +273 -263
  243. package/package.json +4 -3
  244. package/runtime-dynamic/components/partial-content.js +3 -1
  245. package/runtime-dynamic/factories/dynamic-component.js +44 -8
  246. package/runtime-dynamic/factories/utils.js +7 -1
  247. package/runtime-dynamic/services/compile-render.js +2 -1
  248. package/runtime-dynamic/services/css-scoping.d.ts +2 -0
  249. package/runtime-dynamic/services/css-scoping.js +39 -20
  250. package/store/slices/i18nSlice.d.ts +2 -0
  251. package/store/slices/i18nSlice.js +3 -1
  252. package/types/index.d.ts +6 -0
  253. package/utils/attr.js +4 -1
  254. package/utils/custom-expression/parser.js +11 -8
  255. package/utils/svg-icon.d.ts +27 -0
  256. package/utils/svg-icon.js +75 -0
  257. package/utils/transformedDataset-utils.d.ts +3 -3
  258. package/utils/transformedDataset-utils.js +1 -2
@@ -42,6 +42,15 @@ function hasListGroupAutoLayoutClass(layoutProps) {
42
42
  const extra_LayoutAttrs = [wrap, alignment, gap, columngap];
43
43
  return extra_LayoutAttrs.some((v) => v !== void 0 && v !== null);
44
44
  }
45
+ const resolveDisableItem = (disableitem, item, index) => {
46
+ if (!disableitem) {
47
+ return false;
48
+ }
49
+ if (typeof disableitem === "function") {
50
+ return !!disableitem(item, index);
51
+ }
52
+ return disableitem;
53
+ };
45
54
  const flattenIfArrayOfArrays = (arr) => {
46
55
  if (arr.length === 0) return arr;
47
56
  const first = arr[0];
@@ -139,5 +148,6 @@ export {
139
148
  getSelectedItemWidgets,
140
149
  getTextAlignClass,
141
150
  hasListGroupAutoLayoutClass,
151
+ resolveDisableItem,
142
152
  saveListState
143
153
  };
@@ -1,12 +1,10 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useMemo, memo } from "react";
3
- import Box from "@mui/material/Box";
4
- import Typography from "@mui/material/Typography";
5
- import Select from "@mui/material/Select";
6
- import MenuItem from "@mui/material/MenuItem";
7
- import FormControl from "@mui/material/FormControl";
3
+ import TablePagination from "@mui/material/TablePagination";
8
4
  import { APP_LOCALE } from "../../list/utils/constants";
9
5
  import { useAppSelector } from "../../../../store";
6
+ const EmptyPaginationActions = () => null;
7
+ EmptyPaginationActions.displayName = "EmptyPaginationActions";
10
8
  const PageSizeSelectorComponent = ({
11
9
  pagesizeoptions = "5,10,20,50,100",
12
10
  maxResults = 10,
@@ -25,164 +23,60 @@ const PageSizeSelectorComponent = ({
25
23
  }
26
24
  return parsedOptions;
27
25
  }, [pagesizeoptions, paginationMeta == null ? void 0 : paginationMeta.size]);
28
- const effectiveMaxResults = useMemo(() => {
29
- return (paginationMeta == null ? void 0 : paginationMeta.size) || maxResults;
30
- }, [paginationMeta == null ? void 0 : paginationMeta.size, maxResults]);
31
- const rowSummary = useMemo(() => {
32
- if (!dataSize) {
33
- return null;
34
- }
35
- const startIndex = Math.min((currentPage - 1) * effectiveMaxResults + 1, dataSize);
36
- const endIndex = Math.min(currentPage * effectiveMaxResults, dataSize);
37
- return {
38
- startIndex,
39
- endIndex,
40
- totalRecords: dataSize
41
- };
42
- }, [currentPage, effectiveMaxResults, dataSize]);
43
- const handleChange = (event) => {
26
+ const effectiveMaxResults = (paginationMeta == null ? void 0 : paginationMeta.size) || maxResults;
27
+ const handleRowsPerPageChange = (event) => {
44
28
  const newValue = Number(event.target.value);
45
29
  if (onPageSizeChange) {
46
30
  onPageSizeChange(event, newValue);
47
31
  }
48
32
  };
49
- return /* @__PURE__ */ jsxs(
50
- Box,
33
+ return /* @__PURE__ */ jsx(
34
+ TablePagination,
51
35
  {
52
- sx: {
53
- display: "flex",
54
- flexWrap: "wrap",
55
- alignItems: "center",
56
- gap: 2
57
- },
36
+ component: "div",
58
37
  className: "pagination page-size-selector",
59
- children: [
60
- /* @__PURE__ */ jsxs(
61
- Box,
62
- {
63
- sx: {
64
- display: "flex",
65
- alignItems: "center",
66
- gap: 1
67
- },
68
- children: [
69
- /* @__PURE__ */ jsxs(
70
- Typography,
71
- {
72
- component: "label",
73
- sx: {
74
- fontSize: "14px",
75
- color: "text.primary",
76
- whiteSpace: "nowrap"
77
- },
78
- title: itemsPerPageLabel,
79
- children: [
80
- itemsPerPageLabel,
81
- " :"
82
- ]
83
- }
84
- ),
85
- /* @__PURE__ */ jsx(
86
- FormControl,
87
- {
88
- size: "small",
89
- sx: {
90
- minWidth: 70,
91
- "& .MuiInputBase-root": {
92
- height: "auto"
93
- }
94
- },
95
- children: /* @__PURE__ */ jsx(
96
- Select,
97
- {
98
- id: "page-size-select",
99
- value: effectiveMaxResults,
100
- onChange: handleChange,
101
- sx: {
102
- fontSize: "14px",
103
- minHeight: "auto",
104
- "& .MuiSelect-select": {
105
- paddingTop: "6px",
106
- paddingBottom: "6px",
107
- paddingLeft: "10px",
108
- paddingRight: "32px",
109
- // Space for dropdown arrow
110
- minHeight: "auto"
111
- },
112
- "& .MuiOutlinedInput-notchedOutline": {
113
- borderColor: "rgba(0, 0, 0, 0.23)"
114
- }
115
- },
116
- MenuProps: {
117
- PaperProps: {
118
- sx: {
119
- maxHeight: 300,
120
- "& .MuiMenuItem-root": {
121
- fontSize: "14px",
122
- padding: "6px 16px",
123
- // Override any global padding
124
- margin: 0
125
- // Override any global margin
126
- },
127
- "& .MuiList-root": {
128
- padding: "8px 0"
129
- // Ensure proper list padding
130
- },
131
- "& li": {
132
- padding: 0,
133
- // Override global li padding
134
- margin: 0
135
- // Override global li margin
136
- }
137
- }
138
- },
139
- anchorOrigin: {
140
- vertical: "bottom",
141
- horizontal: "center"
142
- },
143
- transformOrigin: {
144
- vertical: "top",
145
- horizontal: "center"
146
- }
147
- },
148
- children: options.map((option) => /* @__PURE__ */ jsx(MenuItem, { value: option, children: option }, option))
149
- }
150
- )
151
- }
152
- )
153
- ]
154
- }
155
- ),
156
- rowSummary && /* @__PURE__ */ jsx(
157
- Box,
158
- {
159
- sx: {
160
- display: "flex",
161
- alignItems: "center",
162
- gap: 0.5
163
- },
164
- className: "item-range",
165
- children: /* @__PURE__ */ jsxs(
166
- Typography,
167
- {
168
- sx: {
169
- fontSize: "14px",
170
- color: "text.primary"
171
- },
172
- children: [
173
- /* @__PURE__ */ jsxs(Box, { component: "span", children: [
174
- rowSummary.startIndex,
175
- " - ",
176
- rowSummary.endIndex
177
- ] }),
178
- /* @__PURE__ */ jsx(Box, { component: "span", sx: { mx: 0.5 }, children: "\xA0\xA0of\xA0\xA0" }),
179
- /* @__PURE__ */ jsx(Box, { component: "span", children: rowSummary.totalRecords })
180
- ]
38
+ count: dataSize,
39
+ page: Math.max(0, currentPage - 1),
40
+ onPageChange: () => {
41
+ },
42
+ rowsPerPage: effectiveMaxResults,
43
+ onRowsPerPageChange: handleRowsPerPageChange,
44
+ rowsPerPageOptions: options,
45
+ labelRowsPerPage: `${itemsPerPageLabel} :`,
46
+ ActionsComponent: EmptyPaginationActions,
47
+ slotProps: {
48
+ toolbar: {
49
+ className: "items-per-page"
50
+ },
51
+ selectLabel: {
52
+ className: "app-label",
53
+ title: itemsPerPageLabel
54
+ },
55
+ select: {
56
+ id: "page-size-select",
57
+ size: "small",
58
+ className: "btn app-button dropdown-toggle page-size-select",
59
+ MenuProps: {
60
+ disableScrollLock: true,
61
+ anchorOrigin: { vertical: "top", horizontal: "left" },
62
+ transformOrigin: { vertical: "bottom", horizontal: "left" },
63
+ slotProps: {
64
+ paper: {
65
+ elevation: 0,
66
+ className: "dropdown-menu pagesize-options"
181
67
  }
182
- )
68
+ }
183
69
  }
184
- )
185
- ]
70
+ },
71
+ menuItem: {
72
+ className: "dropdown-item"
73
+ },
74
+ displayedRows: dataSize ? {
75
+ className: "item-range"
76
+ } : {
77
+ className: "page-size-no-range"
78
+ }
79
+ }
186
80
  }
187
81
  );
188
82
  };
@@ -821,12 +821,35 @@ const usePagination = ({
821
821
  }
822
822
  }
823
823
  }, [isServerSidePagination, totalItems, paginationMeta]);
824
+ const hasServerReportedPage = isServerSidePagination && (paginationMeta == null ? void 0 : paginationMeta.number) !== void 0 && (paginationMeta == null ? void 0 : paginationMeta.number) !== null;
824
825
  useEffect(() => {
826
+ if (hasServerReportedPage) {
827
+ return;
828
+ }
825
829
  if (initialPage !== void 0 && initialPage !== paginationState.currentPage) {
826
830
  setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentPage: initialPage }));
827
831
  disableNavigation();
828
832
  }
829
- }, [initialPage, paginationState.currentPage, disableNavigation]);
833
+ }, [initialPage, paginationState.currentPage, disableNavigation, hasServerReportedPage]);
834
+ useEffect(() => {
835
+ if (!isServerSidePagination) {
836
+ return;
837
+ }
838
+ const metaPageNumber = paginationMeta == null ? void 0 : paginationMeta.number;
839
+ if (metaPageNumber === void 0 || metaPageNumber === null) {
840
+ return;
841
+ }
842
+ const serverCurrentPage = metaPageNumber + 1;
843
+ if (serverCurrentPage > 0 && serverCurrentPage !== paginationState.currentPage) {
844
+ setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentPage: serverCurrentPage }));
845
+ disableNavigation();
846
+ }
847
+ }, [
848
+ isServerSidePagination,
849
+ paginationMeta == null ? void 0 : paginationMeta.number,
850
+ paginationState.currentPage,
851
+ disableNavigation
852
+ ]);
830
853
  useEffect(() => {
831
854
  if (maxResults !== paginationState.currentMaxResults) {
832
855
  setPaginationState((prev) => __spreadProps(__spreadValues({}, prev), { currentMaxResults: maxResults }));
@@ -33,7 +33,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
33
33
  import { memo, Fragment as Fragment2 } from "react";
34
34
  import { TableCell } from "@mui/material";
35
35
  import { flexRender } from "@tanstack/react-table";
36
- import { getColClass, TABLE_CSS_CLASSES } from "../utils";
36
+ import { getColClass, TABLE_CSS_CLASSES, getDomHiddenCellStyle } from "../utils";
37
37
  const CustomExpressionRenderBody = memo(
38
38
  function CustomExpressionRenderBody2({ rowData, render }) {
39
39
  return /* @__PURE__ */ jsx(Fragment, { children: render(rowData) });
@@ -71,14 +71,28 @@ const RowCells = memo(
71
71
  tabIndex: 0,
72
72
  "data-col-id": cellIndex,
73
73
  className: `${TABLE_CSS_CLASSES.tableCell} ${colClass || ""} ${((_e = cell.column.columnDef.meta) == null ? void 0 : _e.className) || ""}`.trim(),
74
- style: __spreadProps(__spreadValues({
74
+ style: __spreadProps(__spreadValues(__spreadValues({
75
75
  width: cell.column.getSize(),
76
76
  textAlign: (_f = cell.column.columnDef.meta) == null ? void 0 : _f.textAlign,
77
77
  backgroundColor: (_g = cell.column.columnDef.meta) == null ? void 0 : _g.backgroundColor
78
78
  }, (() => {
79
- const _a2 = cell.column.columnDef.meta || {}, { className, textAlign, backgroundColor } = _a2, otherMeta = __objRest(_a2, ["className", "textAlign", "backgroundColor"]);
79
+ const _a2 = cell.column.columnDef.meta || {}, {
80
+ className,
81
+ textAlign,
82
+ backgroundColor,
83
+ _cell,
84
+ _actions,
85
+ domHidden
86
+ } = _a2, otherMeta = __objRest(_a2, [
87
+ "className",
88
+ "textAlign",
89
+ "backgroundColor",
90
+ "_cell",
91
+ "_actions",
92
+ "domHidden"
93
+ ]);
80
94
  return otherMeta;
81
- })()), {
95
+ })()), getDomHiddenCellStyle(cell.column.columnDef.meta)), {
82
96
  fontSize: "inherit",
83
97
  color: "inherit"
84
98
  }),
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
29
29
  import { jsx, jsxs } from "react/jsx-runtime";
30
30
  import { memo, useMemo, useCallback } from "react";
31
31
  import { TableBody, TableRow, TableCell, Box } from "@mui/material";
32
- import { TABLE_CSS_CLASSES, TABLE_MESSAGES } from "../utils";
32
+ import { TABLE_CSS_CLASSES, TABLE_MESSAGES, getRowExpansionConfig } from "../utils";
33
33
  import { RowExpansionButton } from "./RowExpansionButton";
34
34
  import isEqual from "lodash-es/isEqual";
35
35
  import { TableDataRow } from "./TableDataRow";
@@ -180,7 +180,7 @@ const TableBodyComponentBase = ({
180
180
  customColumnsRevision = 0,
181
181
  columnsVersion = 0
182
182
  }) => {
183
- const hasExpansion = !!((rowExpansionConfig == null ? void 0 : rowExpansionConfig.show) && toggleRowExpansion && isRowExpanded);
183
+ const hasExpansion = rowExpansionConfig ? true : false;
184
184
  const expansionInsertIndex = useExpansionPosition(
185
185
  hasExpansion,
186
186
  rowExpansionConfig || null,
@@ -190,6 +190,8 @@ const TableBodyComponentBase = ({
190
190
  const renderExpansionCell = useCallback(
191
191
  (rowId, rowData) => {
192
192
  if (!hasExpansion || !rowExpansionConfig) return null;
193
+ const rowConfig = getRowExpansionConfig(rowExpansionConfig, rowId, rowData);
194
+ if (!rowConfig) return null;
193
195
  return /* @__PURE__ */ jsx(
194
196
  ExpansionCell,
195
197
  {
@@ -197,7 +199,7 @@ const TableBodyComponentBase = ({
197
199
  rowData,
198
200
  isExpanded: isRowExpanded(rowId),
199
201
  onToggle: toggleRowExpansion,
200
- config: rowExpansionConfig
202
+ config: rowConfig
201
203
  },
202
204
  `expansion-${rowId}`
203
205
  );
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
15
15
  return a;
16
16
  };
17
17
  import { jsx, jsxs } from "react/jsx-runtime";
18
- import { memo, Fragment, useMemo } from "react";
18
+ import { memo, Fragment, useMemo, useCallback } from "react";
19
19
  import { TableRow } from "@mui/material";
20
20
  import { RowCells } from "./RowCells";
21
21
  import { useEditedRow } from "../hooks/use-edited-rows";
@@ -44,6 +44,10 @@ const TableDataRowComponent = ({
44
44
  customColumnsRevision = 0,
45
45
  columnsVersion = 0
46
46
  }) => {
47
+ const handleClick = useCallback(
48
+ (event) => onRowClick(event, row.original, rowId),
49
+ [onRowClick, row.original, rowId]
50
+ );
47
51
  const editedTableData = useEditedRow(rowId);
48
52
  const mergedRowData = useMemo(() => {
49
53
  if (!editedTableData) {
@@ -65,7 +69,7 @@ const TableDataRowComponent = ({
65
69
  TableRow,
66
70
  {
67
71
  className: `${TABLE_CSS_CLASSES.tableRow} ${isActive ? "active" : ""} ${rowClass}`,
68
- onClick: (event) => onRowClick(event, row.original, rowId),
72
+ onClick: handleClick,
69
73
  "data-row-id": row.index,
70
74
  role: "row",
71
75
  tabIndex: 0,
@@ -117,7 +121,16 @@ const TableDataRow = memo(TableDataRowComponent, (prev, next) => {
117
121
  "index",
118
122
  "customExpressionColumns",
119
123
  "customColumnsRevision",
120
- "columnsVersion"
124
+ "columnsVersion",
125
+ // closure-captured props — stale closure if memo skips when these change
126
+ "onRowClick",
127
+ "renderExpansionCell",
128
+ "hasExpansion",
129
+ "expansionInsertIndex",
130
+ "ExpandedContent",
131
+ "onInstanceLoad",
132
+ "rowExpansionConfig",
133
+ "totalColumns"
121
134
  ];
122
135
  return keys.every((key) => prev[key] === next[key]);
123
136
  });
@@ -33,7 +33,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
33
33
  import React, { memo, useMemo } from "react";
34
34
  import { TableHead, TableRow, TableCell, Box } from "@mui/material";
35
35
  import { flexRender } from "@tanstack/react-table";
36
- import { TABLE_CSS_CLASSES } from "../utils";
36
+ import { TABLE_CSS_CLASSES, getDomHiddenCellStyle } from "../utils";
37
37
  import { TableFilterRow } from "./TableFilters";
38
38
  import { calculateMaxDepth, generateHeaderRows, hasTableGroups } from "../utils/groupHeaderUtils";
39
39
  const StandardHeaderCell = memo(
@@ -57,18 +57,19 @@ const StandardHeaderCell = memo(
57
57
  "title",
58
58
  "onClick"
59
59
  ]);
60
- var _a2, _b2;
60
+ var _a2, _b2, _c;
61
61
  const canSort = enablesort && header.column.getCanSort();
62
62
  const isSorted = header.column.getIsSorted();
63
63
  const metaClassName = ((_b2 = (_a2 = header.column.columnDef) == null ? void 0 : _a2.meta) == null ? void 0 : _b2.className) || "";
64
64
  const resizableClass = header.column.getCanResize() ? " ui-resizable" : "";
65
65
  const mergedClassName = `${TABLE_CSS_CLASSES.headerCell} ${metaClassName} ${className || ""} ${resizableClass}`.trim();
66
- const mergedStyle = __spreadValues({
66
+ const headerMeta = (_c = header.column.columnDef) == null ? void 0 : _c.meta;
67
+ const mergedStyle = __spreadValues(__spreadValues({
67
68
  cursor: canSort ? "pointer" : "default",
68
69
  userSelect: "none",
69
70
  width: header.getSize(),
70
71
  position: "relative"
71
- }, style);
72
+ }, getDomHiddenCellStyle(headerMeta)), style);
72
73
  const headerTitle = header.column.columnDef.header && typeof header.column.columnDef.header !== "function" ? header.column.columnDef.header.toString() : "";
73
74
  return /* @__PURE__ */ jsx(
74
75
  TableCell,
@@ -172,7 +173,7 @@ const TableHeaderComponent = memo(
172
173
  onHeaderclick,
173
174
  tableName
174
175
  }) => {
175
- const hasExpansion = rowExpansionConfig && rowExpansionConfig.show;
176
+ const hasExpansion = rowExpansionConfig ? true : false;
176
177
  const hasGroups = useMemo(() => {
177
178
  return tableStructure && hasTableGroups(tableStructure);
178
179
  }, [tableStructure]);
@@ -378,12 +379,13 @@ const TableHeaderComponent = memo(
378
379
  };
379
380
  const isClickable = enablecolumnselection && !isSystemColumn || enablesort && header.column.getCanSort();
380
381
  const headerCellResizableClass = header.column.getCanResize() ? " ui-resizable" : "";
382
+ const headerMeta = header.column.columnDef.meta;
381
383
  cells.push(
382
384
  /* @__PURE__ */ jsxs(
383
385
  TableCell,
384
386
  {
385
387
  className: `${TABLE_CSS_CLASSES.headerCell} ${((_b = (_a = header.column.columnDef) == null ? void 0 : _a.meta) == null ? void 0 : _b.className) || ""} ${headerCellResizableClass}`.trim(),
386
- style: {
388
+ style: __spreadValues({
387
389
  cursor: isClickable ? "pointer" : "default",
388
390
  userSelect: "none",
389
391
  width: header.getSize(),
@@ -392,7 +394,7 @@ const TableHeaderComponent = memo(
392
394
  color: "inherit",
393
395
  fontWeight: "bold",
394
396
  lineHeight: "inherit"
395
- },
397
+ }, getDomHiddenCellStyle(headerMeta)),
396
398
  title: header.column.columnDef.header && typeof header.column.columnDef.header !== "function" ? header.column.columnDef.header.toString() : "",
397
399
  onClick: handleHeaderClick,
398
400
  role: "columnheader",
@@ -400,7 +402,7 @@ const TableHeaderComponent = memo(
400
402
  tabIndex: 0,
401
403
  "data-col-field": header.column.id,
402
404
  children: [
403
- header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()),
405
+ /* @__PURE__ */ jsx("span", { className: "header-data", children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
404
406
  enablesort && !enablecolumnselection && header.column.getCanSort() && /* @__PURE__ */ jsx(
405
407
  Box,
406
408
  {
@@ -25,10 +25,13 @@ import { getButtonClasses } from "../utils";
25
25
  import WmMenu from "../../../navigation/menu";
26
26
  import { DataSource } from "../../types";
27
27
  import { isEmpty, values } from "lodash";
28
+ import { WmAppIcon } from "../../../common/WmAppIcon";
28
29
  const TablePanelHeadingComponent = ({
29
30
  title,
30
31
  subheading,
31
32
  iconclass,
33
+ iconurl,
34
+ prefabName,
32
35
  exportformat = [],
33
36
  headerActions,
34
37
  spacing = "normal",
@@ -118,10 +121,19 @@ const TablePanelHeadingComponent = ({
118
121
  }
119
122
  }
120
123
  },
121
- [datasource, columns, sortInfo, filterInfo, exportdatasize, onBeforeExport, listener]
124
+ [datasource, columns, sortInfo, filterInfo, exportdatasize, onBeforeExport]
122
125
  );
123
126
  return /* @__PURE__ */ jsx(Box, { className: "panel-heading", children: /* @__PURE__ */ jsxs(Box, { component: "h3", className: "panel-title", children: [
124
- /* @__PURE__ */ jsx(Box, { className: "pull-left", children: iconclass && /* @__PURE__ */ jsx(Box, { component: "i", className: `app-icon panel-icon ${iconclass}` }) }),
127
+ /* @__PURE__ */ jsx(Box, { className: "pull-left", children: /* @__PURE__ */ jsx(
128
+ WmAppIcon,
129
+ {
130
+ iconclass,
131
+ iconurl,
132
+ prefabName,
133
+ defaultClasses: iconurl ? "panel-image-icon" : "panel-icon",
134
+ alt: "Table icon"
135
+ }
136
+ ) }),
125
137
  /* @__PURE__ */ jsxs(Box, { className: "pull-left", children: [
126
138
  title && /* @__PURE__ */ jsx(Box, { component: "div", className: "heading", children: title }),
127
139
  subheading && /* @__PURE__ */ jsx(Box, { component: "div", className: "description", children: subheading })
@@ -171,7 +183,7 @@ const TablePanelHeadingComponent = ({
171
183
  };
172
184
  TablePanelHeadingComponent.displayName = "TablePanelHeading";
173
185
  const TablePanelHeading = memo(TablePanelHeadingComponent, (prevProps, nextProps) => {
174
- return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
186
+ return prevProps.title === nextProps.title && prevProps.subheading === nextProps.subheading && prevProps.iconclass === nextProps.iconclass && prevProps.iconurl === nextProps.iconurl && prevProps.exportformat === nextProps.exportformat && prevProps.headerActions === nextProps.headerActions && prevProps.spacing === nextProps.spacing && prevProps.isGridEditMode === nextProps.isGridEditMode && prevProps.isLoading === nextProps.isLoading && prevProps.listener === nextProps.listener && prevProps.datasource === nextProps.datasource && prevProps.columns === nextProps.columns && prevProps.sortInfo === nextProps.sortInfo && prevProps.filterInfo === nextProps.filterInfo && prevProps.exportdatasize === nextProps.exportdatasize && prevProps.onBeforeExport === nextProps.onBeforeExport;
175
187
  });
176
188
  export {
177
189
  TablePanelHeading
@@ -64,7 +64,7 @@ const useDynamicColumns = ({
64
64
  dynamicColumns: columnsWithListener,
65
65
  isDynamicTable: true
66
66
  };
67
- }, [dataset, children, listener]);
67
+ }, [dataset, children]);
68
68
  return { dynamicColumns, isDynamicTable };
69
69
  };
70
70
  var useDynamicColumns_default = useDynamicColumns;
@@ -83,4 +83,5 @@ export declare const useResponsiveColumns: (columns: WmTableColumnProps[]) => {
83
83
  prefabName?: string;
84
84
  loading?: boolean;
85
85
  showSkeleton?: boolean;
86
+ widget?: string;
86
87
  }[];