@oliasoft-open-source/react-ui-library 4.20.1 → 4.20.3-beta-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.d.ts CHANGED
@@ -1205,8 +1205,8 @@ export declare interface ISettingFieldProps {
1205
1205
  helpText?: string;
1206
1206
  disabled?: boolean;
1207
1207
  noPermission?: boolean;
1208
- selectedOption?: 'all_users' | 'superusers_admin';
1209
- handleSelectChange?: (value: 'all_users' | 'superusers_admin') => void;
1208
+ selectedOption?: boolean;
1209
+ handleSelectChange?: () => void;
1210
1210
  }
1211
1211
 
1212
1212
  export declare interface ISideBarProps {
package/dist/index.js CHANGED
@@ -14484,20 +14484,12 @@ class Virtualizer {
14484
14484
  const size2 = this.getSize();
14485
14485
  const scrollOffset = this.getScrollOffset();
14486
14486
  if (align === "auto") {
14487
- if (toOffset <= scrollOffset) {
14488
- align = "start";
14489
- } else if (toOffset >= scrollOffset + size2) {
14487
+ if (toOffset >= scrollOffset + size2) {
14490
14488
  align = "end";
14491
- } else {
14492
- align = "start";
14493
14489
  }
14494
14490
  }
14495
- if (align === "start") {
14496
- toOffset = toOffset;
14497
- } else if (align === "end") {
14498
- toOffset = toOffset - size2;
14499
- } else if (align === "center") {
14500
- toOffset = toOffset - size2 / 2;
14491
+ if (align === "end") {
14492
+ toOffset -= size2;
14501
14493
  }
14502
14494
  const scrollSizeProp = this.options.horizontal ? "scrollWidth" : "scrollHeight";
14503
14495
  const scrollSize = this.scrollElement ? "document" in this.scrollElement ? this.scrollElement.document.documentElement[scrollSizeProp] : this.scrollElement[scrollSizeProp] : 0;
@@ -14521,8 +14513,27 @@ class Virtualizer {
14521
14513
  return [scrollOffset, align];
14522
14514
  }
14523
14515
  }
14524
- const toOffset = align === "end" ? item2.end + this.options.scrollPaddingEnd : item2.start - this.options.scrollPaddingStart;
14525
- return [this.getOffsetForAlignment(toOffset, align), align];
14516
+ const centerOffset = item2.start - this.options.scrollPaddingStart + (item2.size - size2) / 2;
14517
+ switch (align) {
14518
+ case "center":
14519
+ return [this.getOffsetForAlignment(centerOffset, align), align];
14520
+ case "end":
14521
+ return [
14522
+ this.getOffsetForAlignment(
14523
+ item2.end + this.options.scrollPaddingEnd,
14524
+ align
14525
+ ),
14526
+ align
14527
+ ];
14528
+ default:
14529
+ return [
14530
+ this.getOffsetForAlignment(
14531
+ item2.start - this.options.scrollPaddingStart,
14532
+ align
14533
+ ),
14534
+ align
14535
+ ];
14536
+ }
14526
14537
  };
14527
14538
  this.isDynamicMode = () => this.elementsCache.size > 0;
14528
14539
  this.cancelScrollToIndex = () => {
@@ -14666,7 +14677,7 @@ function useVirtualizerBase(options) {
14666
14677
  () => new Virtualizer(resolvedOptions)
14667
14678
  );
14668
14679
  instance.setOptions(resolvedOptions);
14669
- React$4.useEffect(() => {
14680
+ useIsomorphicLayoutEffect$4(() => {
14670
14681
  return instance._didMount();
14671
14682
  }, []);
14672
14683
  useIsomorphicLayoutEffect$4(() => {
@@ -17060,6 +17071,7 @@ const useCustomSelectLogic = ({
17060
17071
  closeLayer();
17061
17072
  return;
17062
17073
  }
17074
+ setTriggerFocus();
17063
17075
  dispatch({
17064
17076
  type: ActionTypes$1.RESET_LAYER_FOCUS,
17065
17077
  options,
@@ -17169,6 +17181,10 @@ const useCustomSelectLogic = ({
17169
17181
  closeLayer();
17170
17182
  break;
17171
17183
  }
17184
+ case EventKey.TAB: {
17185
+ dispatch({ type: ActionTypes$1.CLOSE_LAYER });
17186
+ break;
17187
+ }
17172
17188
  }
17173
17189
  };
17174
17190
  return {
@@ -67087,8 +67103,8 @@ const SettingField = ({
67087
67103
  ] }, index2));
67088
67104
  };
67089
67105
  const options = [
67090
- { label: "All users", value: "all_users" },
67091
- { label: "Admin only", value: "superusers_admin" }
67106
+ { label: "All users", value: false },
67107
+ { label: "Admin only", value: true }
67092
67108
  ];
67093
67109
  return /* @__PURE__ */ jsxs("div", { className: styles.settingField, children: [
67094
67110
  /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", wrap: false, children: [
@@ -67102,9 +67118,7 @@ const SettingField = ({
67102
67118
  options,
67103
67119
  value: selectedOption,
67104
67120
  disabled: disabled2,
67105
- onChange: handleSelectChange ? (e2) => handleSelectChange(
67106
- e2.target.value
67107
- ) : void 0,
67121
+ onChange: handleSelectChange || void 0,
67108
67122
  "aria-label": "Select user type",
67109
67123
  width: "auto"
67110
67124
  }