@ceed/ads 1.5.6-next.1 → 1.5.6-next.3

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.
@@ -1,3 +1 @@
1
- export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void, options?: {
2
- disableStrict?: boolean;
3
- }): [T, (value: T | ((prev: T) => T)) => void, boolean];
1
+ export declare function useControlledState<T>(controlledValue: T | undefined, defaultValue: T, onChange?: (value: T) => void): [T, (value: T | ((prev: T) => T)) => void, boolean];
package/dist/index.cjs CHANGED
@@ -403,7 +403,7 @@ var IconButton_default = IconButton;
403
403
 
404
404
  // src/hooks/use-controlled-state/index.ts
405
405
  var import_react5 = require("react");
406
- function useControlledState(controlledValue, defaultValue, onChange, options) {
406
+ function useControlledState(controlledValue, defaultValue, onChange) {
407
407
  const { current: isControlled } = (0, import_react5.useRef)(controlledValue !== void 0);
408
408
  const [internalValue, setInternalValue] = (0, import_react5.useState)(
409
409
  controlledValue ?? defaultValue
@@ -2364,8 +2364,7 @@ var DatePicker = (0, import_react19.forwardRef)(
2364
2364
  (0, import_react19.useCallback)(
2365
2365
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
2366
2366
  [props.name, onChange]
2367
- ),
2368
- { disableStrict: true }
2367
+ )
2369
2368
  );
2370
2369
  const [displayValue, setDisplayValue] = (0, import_react19.useState)(
2371
2370
  () => value ? formatValueString(parseDate(value, format), displayFormat) : ""
@@ -3865,117 +3864,128 @@ function Component(props, apiRef) {
3865
3864
  ref: parentRef,
3866
3865
  ...backgroundProps
3867
3866
  },
3868
- /* @__PURE__ */ import_react25.default.createElement(Table, { ...innerProps }, /* @__PURE__ */ import_react25.default.createElement("thead", null, /* @__PURE__ */ import_react25.default.createElement("tr", null, checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
3869
- "th",
3870
- {
3871
- style: {
3872
- width: "40px",
3873
- textAlign: "center"
3874
- }
3875
- },
3876
- /* @__PURE__ */ import_react25.default.createElement(
3877
- RenderCheckbox,
3878
- {
3879
- onChange: onAllCheckboxChange,
3880
- checked: isAllSelected,
3881
- indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
3882
- ...checkboxProps
3883
- }
3884
- )
3885
- ), columns.map((c, i) => /* @__PURE__ */ import_react25.default.createElement(
3886
- HeadCell2,
3887
- {
3888
- tableId,
3889
- key: `${c.field.toString()}_${i}`,
3890
- stickyHeader: props.stickyHeader,
3891
- editMode: !!c.isCellEditable,
3892
- onSortChange: handleSortChange,
3893
- ...c
3894
- }
3895
- )))), /* @__PURE__ */ import_react25.default.createElement(
3896
- VirtualizedTableBody,
3867
+ /* @__PURE__ */ import_react25.default.createElement(
3868
+ Table,
3897
3869
  {
3898
- ref: tableBodyRef,
3870
+ ...innerProps,
3899
3871
  style: {
3900
- height: `${totalSize}px`
3872
+ tableLayout: "auto"
3901
3873
  }
3902
3874
  },
3903
- !!loading && /* @__PURE__ */ import_react25.default.createElement(OverlayWrapper, null, /* @__PURE__ */ import_react25.default.createElement(
3904
- "td",
3875
+ /* @__PURE__ */ import_react25.default.createElement("thead", null, /* @__PURE__ */ import_react25.default.createElement("tr", null, checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
3876
+ "th",
3905
3877
  {
3906
3878
  style: {
3907
- position: "fixed",
3908
- width: "var(--DataTableSheet-width)",
3909
- overflow: "visible"
3879
+ width: "40px",
3880
+ textAlign: "center"
3910
3881
  }
3911
3882
  },
3912
3883
  /* @__PURE__ */ import_react25.default.createElement(
3913
- Box_default,
3884
+ RenderCheckbox,
3914
3885
  {
3915
- sx: {
3916
- position: "absolute",
3917
- top: 0,
3918
- left: 0,
3919
- right: 0
3920
- }
3921
- },
3922
- /* @__PURE__ */ import_react25.default.createElement(LoadingOverlay, null)
3886
+ onChange: onAllCheckboxChange,
3887
+ checked: isAllSelected,
3888
+ indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
3889
+ ...checkboxProps
3890
+ }
3923
3891
  )
3924
- )),
3925
- virtualizedItems.map((virtualizedRow, index) => {
3926
- const rowIndex = virtualizedRow.index;
3927
- const row = dataInPage[rowIndex];
3928
- const rowId = getId(row, rowIndex);
3929
- const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
3930
- return /* @__PURE__ */ import_react25.default.createElement(
3931
- VirtualizedTableRow,
3892
+ ), columns.map((c, i) => /* @__PURE__ */ import_react25.default.createElement(
3893
+ HeadCell2,
3894
+ {
3895
+ tableId,
3896
+ key: `${c.field.toString()}_${i}`,
3897
+ stickyHeader: props.stickyHeader,
3898
+ editMode: !!c.isCellEditable,
3899
+ onSortChange: handleSortChange,
3900
+ ...c
3901
+ }
3902
+ )))),
3903
+ /* @__PURE__ */ import_react25.default.createElement(
3904
+ VirtualizedTableBody,
3905
+ {
3906
+ ref: tableBodyRef,
3907
+ style: {
3908
+ height: `${totalSize}px`
3909
+ }
3910
+ },
3911
+ !!loading && /* @__PURE__ */ import_react25.default.createElement(OverlayWrapper, null, /* @__PURE__ */ import_react25.default.createElement(
3912
+ "td",
3932
3913
  {
3933
- key: virtualizedRow.key,
3934
- "data-row-id": rowId,
3935
- "data-index": rowIndex,
3936
- role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,
3937
- tabIndex: focusedRowId === rowId ? 0 : -1,
3938
- onClick: getRowClickHandler(row, rowId),
3939
- onFocus: getRowFocusHandler(rowId),
3940
- "aria-checked": checkboxSelection ? isSelectedRow(rowId) : void 0,
3941
- striped,
3942
3914
  style: {
3943
- height: `${virtualizedRow.size}px`,
3944
- transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
3915
+ position: "fixed",
3916
+ width: "var(--DataTableSheet-width)",
3917
+ overflow: "visible"
3945
3918
  }
3946
3919
  },
3947
- checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
3948
- "th",
3920
+ /* @__PURE__ */ import_react25.default.createElement(
3921
+ Box_default,
3949
3922
  {
3950
- scope: "row",
3923
+ sx: {
3924
+ position: "absolute",
3925
+ top: 0,
3926
+ left: 0,
3927
+ right: 0
3928
+ }
3929
+ },
3930
+ /* @__PURE__ */ import_react25.default.createElement(LoadingOverlay, null)
3931
+ )
3932
+ )),
3933
+ virtualizedItems.map((virtualizedRow, index) => {
3934
+ const rowIndex = virtualizedRow.index;
3935
+ const row = dataInPage[rowIndex];
3936
+ const rowId = getId(row, rowIndex);
3937
+ const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
3938
+ return /* @__PURE__ */ import_react25.default.createElement(
3939
+ VirtualizedTableRow,
3940
+ {
3941
+ key: virtualizedRow.key,
3942
+ "data-row-id": rowId,
3943
+ "data-index": rowIndex,
3944
+ role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,
3945
+ tabIndex: focusedRowId === rowId ? 0 : -1,
3946
+ onClick: getRowClickHandler(row, rowId),
3947
+ onFocus: getRowFocusHandler(rowId),
3948
+ "aria-checked": checkboxSelection ? isSelectedRow(rowId) : void 0,
3949
+ striped,
3951
3950
  style: {
3952
- textAlign: "center"
3951
+ height: `${virtualizedRow.size}px`,
3952
+ transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
3953
3953
  }
3954
3954
  },
3955
+ checkboxSelection && /* @__PURE__ */ import_react25.default.createElement(
3956
+ "th",
3957
+ {
3958
+ scope: "row",
3959
+ style: {
3960
+ textAlign: "center"
3961
+ }
3962
+ },
3963
+ /* @__PURE__ */ import_react25.default.createElement(
3964
+ RenderCheckbox,
3965
+ {
3966
+ onClick: getCheckboxClickHandler(),
3967
+ onChange: getCheckboxChangeHandler(rowId),
3968
+ checked: isSelectedRow(rowId),
3969
+ ...checkboxProps
3970
+ }
3971
+ )
3972
+ ),
3955
3973
  /* @__PURE__ */ import_react25.default.createElement(
3956
- RenderCheckbox,
3974
+ BodyRow2,
3957
3975
  {
3958
- onClick: getCheckboxClickHandler(),
3959
- onChange: getCheckboxChangeHandler(rowId),
3960
- checked: isSelectedRow(rowId),
3961
- ...checkboxProps
3976
+ tableId,
3977
+ columns,
3978
+ row,
3979
+ rowId,
3980
+ editMode,
3981
+ noWrap: props.noWrap
3962
3982
  }
3963
3983
  )
3964
- ),
3965
- /* @__PURE__ */ import_react25.default.createElement(
3966
- BodyRow2,
3967
- {
3968
- tableId,
3969
- columns,
3970
- row,
3971
- rowId,
3972
- editMode,
3973
- noWrap: props.noWrap
3974
- }
3975
- )
3976
- );
3977
- })
3978
- ), Footer && /* @__PURE__ */ import_react25.default.createElement(Footer, null))
3984
+ );
3985
+ })
3986
+ ),
3987
+ Footer && /* @__PURE__ */ import_react25.default.createElement(Footer, null)
3988
+ )
3979
3989
  ),
3980
3990
  pagination && /* @__PURE__ */ import_react25.default.createElement(
3981
3991
  Pagination_default,
@@ -4142,8 +4152,7 @@ var DateRangePicker = (0, import_react26.forwardRef)(
4142
4152
  (0, import_react26.useCallback)(
4143
4153
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
4144
4154
  [props.name, onChange]
4145
- ),
4146
- { disableStrict: true }
4155
+ )
4147
4156
  );
4148
4157
  const [anchorEl, setAnchorEl] = (0, import_react26.useState)(null);
4149
4158
  const open = Boolean(anchorEl);
@@ -5070,8 +5079,7 @@ var MonthPicker = (0, import_react33.forwardRef)(
5070
5079
  (0, import_react33.useCallback)(
5071
5080
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
5072
5081
  [props.name, onChange]
5073
- ),
5074
- { disableStrict: true }
5082
+ )
5075
5083
  );
5076
5084
  const getFormattedDisplayValue = (0, import_react33.useCallback)(
5077
5085
  (inputValue) => {
@@ -5364,8 +5372,7 @@ var MonthRangePicker = (0, import_react34.forwardRef)(
5364
5372
  (0, import_react34.useCallback)(
5365
5373
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
5366
5374
  [props.name, onChange]
5367
- ),
5368
- { disableStrict: true }
5375
+ )
5369
5376
  );
5370
5377
  const [anchorEl, setAnchorEl] = (0, import_react34.useState)(null);
5371
5378
  const open = Boolean(anchorEl);
package/dist/index.js CHANGED
@@ -311,7 +311,7 @@ var IconButton_default = IconButton;
311
311
 
312
312
  // src/hooks/use-controlled-state/index.ts
313
313
  import { useState, useCallback, useEffect, useRef } from "react";
314
- function useControlledState(controlledValue, defaultValue, onChange, options) {
314
+ function useControlledState(controlledValue, defaultValue, onChange) {
315
315
  const { current: isControlled } = useRef(controlledValue !== void 0);
316
316
  const [internalValue, setInternalValue] = useState(
317
317
  controlledValue ?? defaultValue
@@ -2315,8 +2315,7 @@ var DatePicker = forwardRef6(
2315
2315
  useCallback7(
2316
2316
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
2317
2317
  [props.name, onChange]
2318
- ),
2319
- { disableStrict: true }
2318
+ )
2320
2319
  );
2321
2320
  const [displayValue, setDisplayValue] = useState5(
2322
2321
  () => value ? formatValueString(parseDate(value, format), displayFormat) : ""
@@ -3822,117 +3821,128 @@ function Component(props, apiRef) {
3822
3821
  ref: parentRef,
3823
3822
  ...backgroundProps
3824
3823
  },
3825
- /* @__PURE__ */ React23.createElement(Table, { ...innerProps }, /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, checkboxSelection && /* @__PURE__ */ React23.createElement(
3826
- "th",
3827
- {
3828
- style: {
3829
- width: "40px",
3830
- textAlign: "center"
3831
- }
3832
- },
3833
- /* @__PURE__ */ React23.createElement(
3834
- RenderCheckbox,
3835
- {
3836
- onChange: onAllCheckboxChange,
3837
- checked: isAllSelected,
3838
- indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
3839
- ...checkboxProps
3840
- }
3841
- )
3842
- ), columns.map((c, i) => /* @__PURE__ */ React23.createElement(
3843
- HeadCell2,
3844
- {
3845
- tableId,
3846
- key: `${c.field.toString()}_${i}`,
3847
- stickyHeader: props.stickyHeader,
3848
- editMode: !!c.isCellEditable,
3849
- onSortChange: handleSortChange,
3850
- ...c
3851
- }
3852
- )))), /* @__PURE__ */ React23.createElement(
3853
- VirtualizedTableBody,
3824
+ /* @__PURE__ */ React23.createElement(
3825
+ Table,
3854
3826
  {
3855
- ref: tableBodyRef,
3827
+ ...innerProps,
3856
3828
  style: {
3857
- height: `${totalSize}px`
3829
+ tableLayout: "auto"
3858
3830
  }
3859
3831
  },
3860
- !!loading && /* @__PURE__ */ React23.createElement(OverlayWrapper, null, /* @__PURE__ */ React23.createElement(
3861
- "td",
3832
+ /* @__PURE__ */ React23.createElement("thead", null, /* @__PURE__ */ React23.createElement("tr", null, checkboxSelection && /* @__PURE__ */ React23.createElement(
3833
+ "th",
3862
3834
  {
3863
3835
  style: {
3864
- position: "fixed",
3865
- width: "var(--DataTableSheet-width)",
3866
- overflow: "visible"
3836
+ width: "40px",
3837
+ textAlign: "center"
3867
3838
  }
3868
3839
  },
3869
3840
  /* @__PURE__ */ React23.createElement(
3870
- Box_default,
3841
+ RenderCheckbox,
3871
3842
  {
3872
- sx: {
3873
- position: "absolute",
3874
- top: 0,
3875
- left: 0,
3876
- right: 0
3877
- }
3878
- },
3879
- /* @__PURE__ */ React23.createElement(LoadingOverlay, null)
3843
+ onChange: onAllCheckboxChange,
3844
+ checked: isAllSelected,
3845
+ indeterminate: (selectionModel || []).length > 0 && !isAllSelected,
3846
+ ...checkboxProps
3847
+ }
3880
3848
  )
3881
- )),
3882
- virtualizedItems.map((virtualizedRow, index) => {
3883
- const rowIndex = virtualizedRow.index;
3884
- const row = dataInPage[rowIndex];
3885
- const rowId = getId(row, rowIndex);
3886
- const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
3887
- return /* @__PURE__ */ React23.createElement(
3888
- VirtualizedTableRow,
3849
+ ), columns.map((c, i) => /* @__PURE__ */ React23.createElement(
3850
+ HeadCell2,
3851
+ {
3852
+ tableId,
3853
+ key: `${c.field.toString()}_${i}`,
3854
+ stickyHeader: props.stickyHeader,
3855
+ editMode: !!c.isCellEditable,
3856
+ onSortChange: handleSortChange,
3857
+ ...c
3858
+ }
3859
+ )))),
3860
+ /* @__PURE__ */ React23.createElement(
3861
+ VirtualizedTableBody,
3862
+ {
3863
+ ref: tableBodyRef,
3864
+ style: {
3865
+ height: `${totalSize}px`
3866
+ }
3867
+ },
3868
+ !!loading && /* @__PURE__ */ React23.createElement(OverlayWrapper, null, /* @__PURE__ */ React23.createElement(
3869
+ "td",
3889
3870
  {
3890
- key: virtualizedRow.key,
3891
- "data-row-id": rowId,
3892
- "data-index": rowIndex,
3893
- role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,
3894
- tabIndex: focusedRowId === rowId ? 0 : -1,
3895
- onClick: getRowClickHandler(row, rowId),
3896
- onFocus: getRowFocusHandler(rowId),
3897
- "aria-checked": checkboxSelection ? isSelectedRow(rowId) : void 0,
3898
- striped,
3899
3871
  style: {
3900
- height: `${virtualizedRow.size}px`,
3901
- transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
3872
+ position: "fixed",
3873
+ width: "var(--DataTableSheet-width)",
3874
+ overflow: "visible"
3902
3875
  }
3903
3876
  },
3904
- checkboxSelection && /* @__PURE__ */ React23.createElement(
3905
- "th",
3877
+ /* @__PURE__ */ React23.createElement(
3878
+ Box_default,
3906
3879
  {
3907
- scope: "row",
3880
+ sx: {
3881
+ position: "absolute",
3882
+ top: 0,
3883
+ left: 0,
3884
+ right: 0
3885
+ }
3886
+ },
3887
+ /* @__PURE__ */ React23.createElement(LoadingOverlay, null)
3888
+ )
3889
+ )),
3890
+ virtualizedItems.map((virtualizedRow, index) => {
3891
+ const rowIndex = virtualizedRow.index;
3892
+ const row = dataInPage[rowIndex];
3893
+ const rowId = getId(row, rowIndex);
3894
+ const striped = stripe && (stripe === "even" && (rowIndex + 1) % 2 === 0 || stripe === "odd" && (rowIndex + 1) % 2 === 1);
3895
+ return /* @__PURE__ */ React23.createElement(
3896
+ VirtualizedTableRow,
3897
+ {
3898
+ key: virtualizedRow.key,
3899
+ "data-row-id": rowId,
3900
+ "data-index": rowIndex,
3901
+ role: checkboxSelection && !disableSelectionOnClick ? "checkbox" : void 0,
3902
+ tabIndex: focusedRowId === rowId ? 0 : -1,
3903
+ onClick: getRowClickHandler(row, rowId),
3904
+ onFocus: getRowFocusHandler(rowId),
3905
+ "aria-checked": checkboxSelection ? isSelectedRow(rowId) : void 0,
3906
+ striped,
3908
3907
  style: {
3909
- textAlign: "center"
3908
+ height: `${virtualizedRow.size}px`,
3909
+ transform: `translateY(${virtualizedRow.start - index * virtualizedRow.size}px)`
3910
3910
  }
3911
3911
  },
3912
+ checkboxSelection && /* @__PURE__ */ React23.createElement(
3913
+ "th",
3914
+ {
3915
+ scope: "row",
3916
+ style: {
3917
+ textAlign: "center"
3918
+ }
3919
+ },
3920
+ /* @__PURE__ */ React23.createElement(
3921
+ RenderCheckbox,
3922
+ {
3923
+ onClick: getCheckboxClickHandler(),
3924
+ onChange: getCheckboxChangeHandler(rowId),
3925
+ checked: isSelectedRow(rowId),
3926
+ ...checkboxProps
3927
+ }
3928
+ )
3929
+ ),
3912
3930
  /* @__PURE__ */ React23.createElement(
3913
- RenderCheckbox,
3931
+ BodyRow2,
3914
3932
  {
3915
- onClick: getCheckboxClickHandler(),
3916
- onChange: getCheckboxChangeHandler(rowId),
3917
- checked: isSelectedRow(rowId),
3918
- ...checkboxProps
3933
+ tableId,
3934
+ columns,
3935
+ row,
3936
+ rowId,
3937
+ editMode,
3938
+ noWrap: props.noWrap
3919
3939
  }
3920
3940
  )
3921
- ),
3922
- /* @__PURE__ */ React23.createElement(
3923
- BodyRow2,
3924
- {
3925
- tableId,
3926
- columns,
3927
- row,
3928
- rowId,
3929
- editMode,
3930
- noWrap: props.noWrap
3931
- }
3932
- )
3933
- );
3934
- })
3935
- ), Footer && /* @__PURE__ */ React23.createElement(Footer, null))
3941
+ );
3942
+ })
3943
+ ),
3944
+ Footer && /* @__PURE__ */ React23.createElement(Footer, null)
3945
+ )
3936
3946
  ),
3937
3947
  pagination && /* @__PURE__ */ React23.createElement(
3938
3948
  Pagination_default,
@@ -4107,8 +4117,7 @@ var DateRangePicker = forwardRef8(
4107
4117
  useCallback10(
4108
4118
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
4109
4119
  [props.name, onChange]
4110
- ),
4111
- { disableStrict: true }
4120
+ )
4112
4121
  );
4113
4122
  const [anchorEl, setAnchorEl] = useState7(null);
4114
4123
  const open = Boolean(anchorEl);
@@ -5057,8 +5066,7 @@ var MonthPicker = forwardRef9(
5057
5066
  useCallback12(
5058
5067
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
5059
5068
  [props.name, onChange]
5060
- ),
5061
- { disableStrict: true }
5069
+ )
5062
5070
  );
5063
5071
  const getFormattedDisplayValue = useCallback12(
5064
5072
  (inputValue) => {
@@ -5359,8 +5367,7 @@ var MonthRangePicker = forwardRef10(
5359
5367
  useCallback13(
5360
5368
  (value2) => onChange?.({ target: { name: props.name, value: value2 } }),
5361
5369
  [props.name, onChange]
5362
- ),
5363
- { disableStrict: true }
5370
+ )
5364
5371
  );
5365
5372
  const [anchorEl, setAnchorEl] = useState11(null);
5366
5373
  const open = Boolean(anchorEl);