@etsoo/react 1.8.77 → 1.8.79

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.
@@ -120,6 +120,9 @@ var ReactUtils;
120
120
  shared_1.DateUtils.formatForInput(value, isDateTime ? false : undefined) ??
121
121
  "";
122
122
  }
123
+ else if (!!value && typeof value === "object") {
124
+ item.value = JSON.stringify(value);
125
+ }
123
126
  else {
124
127
  item.value = `${value ?? ""}`;
125
128
  }
@@ -158,7 +158,7 @@ const ScrollerList = (props) => {
158
158
  localRef.current?.scrollToRow(param);
159
159
  }
160
160
  };
161
- }, []);
161
+ }, [rows]);
162
162
  // When layout ready
163
163
  react_1.default.useEffect(() => {
164
164
  // Return clear function
@@ -117,6 +117,9 @@ export var ReactUtils;
117
117
  DateUtils.formatForInput(value, isDateTime ? false : undefined) ??
118
118
  "";
119
119
  }
120
+ else if (!!value && typeof value === "object") {
121
+ item.value = JSON.stringify(value);
122
+ }
120
123
  else {
121
124
  item.value = `${value ?? ""}`;
122
125
  }
@@ -152,7 +152,7 @@ export const ScrollerList = (props) => {
152
152
  localRef.current?.scrollToRow(param);
153
153
  }
154
154
  };
155
- }, []);
155
+ }, [rows]);
156
156
  // When layout ready
157
157
  React.useEffect(() => {
158
158
  // Return clear function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.8.77",
3
+ "version": "1.8.79",
4
4
  "description": "TypeScript ReactJs UI Independent Framework",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -119,10 +119,10 @@ export namespace ReactUtils {
119
119
  callback == null
120
120
  ? undefined
121
121
  : typeof callback === "function"
122
- ? callback
123
- : (item, value) => {
124
- item[callback] = value as any;
125
- };
122
+ ? callback
123
+ : (item, value) => {
124
+ item[callback] = value as any;
125
+ };
126
126
 
127
127
  let k: keyof typeof refs;
128
128
  for (k in refs) {
@@ -144,6 +144,8 @@ export namespace ReactUtils {
144
144
  item.value =
145
145
  DateUtils.formatForInput(value, isDateTime ? false : undefined) ??
146
146
  "";
147
+ } else if (!!value && typeof value === "object") {
148
+ item.value = JSON.stringify(value);
147
149
  } else {
148
150
  item.value = `${value ?? ""}`;
149
151
  }
@@ -172,8 +174,8 @@ export namespace ReactUtils {
172
174
  callback == null
173
175
  ? undefined
174
176
  : typeof callback === "function"
175
- ? callback
176
- : (item) => item[callback];
177
+ ? callback
178
+ : (item) => item[callback];
177
179
 
178
180
  const formatValue = (value: unknown) => {
179
181
  if (ignoreEmpty && value === "") return null;
@@ -231,40 +231,36 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
231
231
  if (stateRefs.current.isMounted !== false) setRows(items, true);
232
232
  };
233
233
 
234
- React.useImperativeHandle(
235
- mRef,
236
- () => {
237
- return {
238
- get element() {
239
- return localRef.current?.element;
240
- },
241
- delete(index) {
242
- const item = rows.at(index);
243
- if (item) {
244
- const newRows = [...rows];
245
- newRows.splice(index, 1);
246
- setRows(newRows);
247
- }
248
- return item;
249
- },
250
- insert(item, start) {
234
+ React.useImperativeHandle(mRef, () => {
235
+ return {
236
+ get element() {
237
+ return localRef.current?.element;
238
+ },
239
+ delete(index) {
240
+ const item = rows.at(index);
241
+ if (item) {
251
242
  const newRows = [...rows];
252
- newRows.splice(start, 0, item);
243
+ newRows.splice(index, 1);
253
244
  setRows(newRows);
254
- },
255
- refresh(): void {
256
- loadDataLocal(0);
257
- },
245
+ }
246
+ return item;
247
+ },
248
+ insert(item, start) {
249
+ const newRows = [...rows];
250
+ newRows.splice(start, 0, item);
251
+ setRows(newRows);
252
+ },
253
+ refresh(): void {
254
+ loadDataLocal(0);
255
+ },
258
256
 
259
- reset,
257
+ reset,
260
258
 
261
- scrollToRow(param: ScrollToRowParam): void {
262
- localRef.current?.scrollToRow(param);
263
- }
264
- };
265
- },
266
- []
267
- );
259
+ scrollToRow(param: ScrollToRowParam): void {
260
+ localRef.current?.scrollToRow(param);
261
+ }
262
+ };
263
+ }, [rows]);
268
264
 
269
265
  // When layout ready
270
266
  React.useEffect(() => {