@ceed/ads 1.39.0 → 1.40.1

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/index.cjs CHANGED
@@ -3053,6 +3053,14 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
3053
3053
  },
3054
3054
  [inputReadOnly, isAlphabeticDisplay, buttonRef]
3055
3055
  );
3056
+ const handleInputClick = (0, import_react21.useCallback)(
3057
+ (event) => {
3058
+ if (inputReadOnly && !readOnly) {
3059
+ handleCalendarToggle(event);
3060
+ }
3061
+ },
3062
+ [inputReadOnly, readOnly, handleCalendarToggle]
3063
+ );
3056
3064
  const handlePresetClick = (0, import_react21.useCallback)(
3057
3065
  (presetValue) => {
3058
3066
  handleChange({
@@ -3104,7 +3112,8 @@ var DatePicker = (0, import_react21.forwardRef)((inProps, ref) => {
3104
3112
  cursor: isAlphabeticDisplay || inputReadOnly || readOnly ? "default" : "text"
3105
3113
  }
3106
3114
  },
3107
- onMouseDown: handleInputMouseDown
3115
+ onMouseDown: handleInputMouseDown,
3116
+ onClick: handleInputClick
3108
3117
  }
3109
3118
  },
3110
3119
  className,
@@ -4077,8 +4086,10 @@ function useDataTableRenderer({
4077
4086
  () => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
4078
4087
  [pinnedColumns?.right, visibleFieldSet]
4079
4088
  );
4089
+ const inferredFieldsKey = JSON.stringify(Object.keys(rows[0] || {}));
4090
+ const inferredFields = (0, import_react26.useMemo)(() => JSON.parse(inferredFieldsKey), [inferredFieldsKey]);
4080
4091
  const columns = (0, import_react26.useMemo)(() => {
4081
- const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : Object.keys(rows[0] || {}).map((key) => ({
4092
+ const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : inferredFields.map((key) => ({
4082
4093
  field: key
4083
4094
  }));
4084
4095
  return baseColumns.map((column) => {
@@ -4102,7 +4113,7 @@ function useDataTableRenderer({
4102
4113
  }, [
4103
4114
  visibleColumns,
4104
4115
  reorderedColumns,
4105
- rows,
4116
+ inferredFields,
4106
4117
  effectivePinnedLeft,
4107
4118
  effectivePinnedRight,
4108
4119
  visibleColumnsByField,
@@ -5349,6 +5360,14 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
5349
5360
  },
5350
5361
  [inputReadOnly, isAlphabeticDisplay, buttonRef]
5351
5362
  );
5363
+ const handleInputClick = (0, import_react30.useCallback)(
5364
+ (event) => {
5365
+ if (inputReadOnly && !readOnly) {
5366
+ handleCalendarToggle(event);
5367
+ }
5368
+ },
5369
+ [inputReadOnly, readOnly, handleCalendarToggle]
5370
+ );
5352
5371
  const handlePresetClick = (0, import_react30.useCallback)(
5353
5372
  (presetValue) => {
5354
5373
  if (props.value !== void 0) {
@@ -5402,7 +5421,8 @@ var DateRangePicker = (0, import_react30.forwardRef)((inProps, ref) => {
5402
5421
  cursor: isAlphabeticDisplay || inputReadOnly || readOnly ? "default" : "text"
5403
5422
  }
5404
5423
  },
5405
- onMouseDown: handleInputMouseDown
5424
+ onMouseDown: handleInputMouseDown,
5425
+ onClick: handleInputClick
5406
5426
  }
5407
5427
  },
5408
5428
  error,
package/dist/index.js CHANGED
@@ -2925,6 +2925,14 @@ var DatePicker = forwardRef6((inProps, ref) => {
2925
2925
  },
2926
2926
  [inputReadOnly, isAlphabeticDisplay, buttonRef]
2927
2927
  );
2928
+ const handleInputClick = useCallback9(
2929
+ (event) => {
2930
+ if (inputReadOnly && !readOnly) {
2931
+ handleCalendarToggle(event);
2932
+ }
2933
+ },
2934
+ [inputReadOnly, readOnly, handleCalendarToggle]
2935
+ );
2928
2936
  const handlePresetClick = useCallback9(
2929
2937
  (presetValue) => {
2930
2938
  handleChange({
@@ -2976,7 +2984,8 @@ var DatePicker = forwardRef6((inProps, ref) => {
2976
2984
  cursor: isAlphabeticDisplay || inputReadOnly || readOnly ? "default" : "text"
2977
2985
  }
2978
2986
  },
2979
- onMouseDown: handleInputMouseDown
2987
+ onMouseDown: handleInputMouseDown,
2988
+ onClick: handleInputClick
2980
2989
  }
2981
2990
  },
2982
2991
  className,
@@ -3954,8 +3963,10 @@ function useDataTableRenderer({
3954
3963
  () => pinnedColumns?.right?.filter((f) => visibleFieldSet.has(f)),
3955
3964
  [pinnedColumns?.right, visibleFieldSet]
3956
3965
  );
3966
+ const inferredFieldsKey = JSON.stringify(Object.keys(rows[0] || {}));
3967
+ const inferredFields = useMemo10(() => JSON.parse(inferredFieldsKey), [inferredFieldsKey]);
3957
3968
  const columns = useMemo10(() => {
3958
- const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : Object.keys(rows[0] || {}).map((key) => ({
3969
+ const baseColumns = visibleColumns.length > 0 ? visibleColumns : reorderedColumns.length > 0 ? [] : inferredFields.map((key) => ({
3959
3970
  field: key
3960
3971
  }));
3961
3972
  return baseColumns.map((column) => {
@@ -3979,7 +3990,7 @@ function useDataTableRenderer({
3979
3990
  }, [
3980
3991
  visibleColumns,
3981
3992
  reorderedColumns,
3982
- rows,
3993
+ inferredFields,
3983
3994
  effectivePinnedLeft,
3984
3995
  effectivePinnedRight,
3985
3996
  visibleColumnsByField,
@@ -5226,6 +5237,14 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
5226
5237
  },
5227
5238
  [inputReadOnly, isAlphabeticDisplay, buttonRef]
5228
5239
  );
5240
+ const handleInputClick = useCallback14(
5241
+ (event) => {
5242
+ if (inputReadOnly && !readOnly) {
5243
+ handleCalendarToggle(event);
5244
+ }
5245
+ },
5246
+ [inputReadOnly, readOnly, handleCalendarToggle]
5247
+ );
5229
5248
  const handlePresetClick = useCallback14(
5230
5249
  (presetValue) => {
5231
5250
  if (props.value !== void 0) {
@@ -5279,7 +5298,8 @@ var DateRangePicker = forwardRef8((inProps, ref) => {
5279
5298
  cursor: isAlphabeticDisplay || inputReadOnly || readOnly ? "default" : "text"
5280
5299
  }
5281
5300
  },
5282
- onMouseDown: handleInputMouseDown
5301
+ onMouseDown: handleInputMouseDown,
5302
+ onClick: handleInputClick
5283
5303
  }
5284
5304
  },
5285
5305
  error,