@oliasoft-open-source/react-ui-library 4.19.6-beta-5 → 4.19.7

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/README.md CHANGED
@@ -9,6 +9,7 @@ The React UI Library by Oliasoft is a versatile set of React UI components desig
9
9
  To install the React UI Library, you can use either npm or yarn as follows:
10
10
 
11
11
  Using npm:
12
+
12
13
  ```bash
13
14
  npm install @oliasoft-open-source/react-ui-library
14
15
  ```
@@ -1359,6 +1360,7 @@ The `OptionDropdown` component is used to display a dropdown menu with selectabl
1359
1360
  | `onChange` | A function to be called when the selected options change. | - |
1360
1361
  | `showHeader` | A boolean indicating whether to display a header above the dropdown options. | `true` |
1361
1362
  | `maxHeight` | The maximum height of the dropdown menu. | `'40vh'` |
1363
+ | `testId` | Test ID used for testing purposes. | - |
1362
1364
 
1363
1365
  ### Usage Example
1364
1366
 
package/dist/index.d.ts CHANGED
@@ -43,7 +43,7 @@ export declare enum BreadcrumbLinkType {
43
43
  CUSTOM = "custom"
44
44
  }
45
45
 
46
- export declare const Button: ({ active, basic, colored, disabled, ignoreDisabledContext, groupOrder, icon, label, loading, name, pill, round, small, styles, width, title, type, onClick, error, warning, testId, tooltip, inverted, component: Component, url, tabIndex, }: IButtonProps) => JSX_2.Element;
46
+ export declare const Button: ({ active, basic, colored, disabled, ignoreDisabledContext, groupOrder, icon, label, loading, name, pill, round, small, styles, width, title, type, onClick, error, warning, testId, tooltip, inverted, component: Component, url, }: IButtonProps) => JSX_2.Element;
47
47
 
48
48
  export declare const ButtonGroup: (props: IButtonGroupProps) => JSX_2.Element;
49
49
 
@@ -227,7 +227,6 @@ export declare interface IButtonProps {
227
227
  inverted?: boolean;
228
228
  component?: default_2.ElementType;
229
229
  url?: string;
230
- tabIndex?: number;
231
230
  }
232
231
 
233
232
  export declare interface ICardProps {
@@ -767,7 +766,6 @@ export declare interface IMenuProps {
767
766
  warning?: any;
768
767
  title?: string;
769
768
  selected?: boolean;
770
- tabIndex?: number;
771
769
  }
772
770
 
773
771
  export declare interface IMenuSection {
@@ -957,6 +955,7 @@ export declare interface IOptionDropdownProps {
957
955
  showHeader?: boolean;
958
956
  maxHeight?: string;
959
957
  small?: boolean;
958
+ testId?: string;
960
959
  }
961
960
 
962
961
  declare interface IOptionItem {
@@ -1695,7 +1694,7 @@ export declare const NativeSelect: ({ disabled, error, warning, tooltip, options
1695
1694
 
1696
1695
  export declare const NumberInput: ({ name, placeholder, disabled, error, left, small, width, value, onChange, onFocus, onBlur, selectOnFocus, tabIndex, testId, tooltip, warning, validationCallback, allowEmpty, isInTable, groupOrder, enableCosmeticRounding, enableDisplayRounding, roundDisplayValue, disableInternalErrorValidationMessages, }: INumberInputProps) => JSX_2.Element;
1697
1696
 
1698
- export declare const OptionDropdown: ({ name, label, options, onChange, small, showHeader, maxHeight, }: IOptionDropdownProps) => ReactElement;
1697
+ export declare const OptionDropdown: ({ name, label, options, onChange, small, showHeader, maxHeight, testId, }: IOptionDropdownProps) => ReactElement;
1699
1698
 
1700
1699
  export declare const Page: ({ children, left, padding: paddingProp, scroll, top, }: ILayoutPageProps) => JSX_2.Element;
1701
1700
 
package/dist/index.js CHANGED
@@ -4101,8 +4101,7 @@ const Button$1 = ({
4101
4101
  inverted: inverted2 = false,
4102
4102
  // *Deprecated*
4103
4103
  component: Component2 = "button",
4104
- url,
4105
- tabIndex
4104
+ url
4106
4105
  }) => {
4107
4106
  const disabledContext = useContext(DisabledContext);
4108
4107
  const color2 = (() => {
@@ -4163,7 +4162,6 @@ const Button$1 = ({
4163
4162
  "data-warning": warning2 || null,
4164
4163
  "data-testid": testId,
4165
4164
  to: url,
4166
- tabIndex,
4167
4165
  children: [
4168
4166
  icon2 && /* @__PURE__ */ jsx("span", { className: buttonStyles.icon, children: /* @__PURE__ */ jsx(Icon, { icon: icon2 }) }),
4169
4167
  loading && /* @__PURE__ */ jsx("span", { className: buttonStyles.icon, children: /* @__PURE__ */ jsx(
@@ -4571,8 +4569,7 @@ const Button = ({
4571
4569
  loading,
4572
4570
  error: error2,
4573
4571
  warning: warning2,
4574
- active: active2,
4575
- tabIndex
4572
+ active: active2
4576
4573
  }) => {
4577
4574
  const disabledContext = useContext(DisabledContext);
4578
4575
  const buttonLabel2 = trigger2 === TriggerType.BUTTON ? label2 : trigger2 === TriggerType.DROP_DOWN_BUTTON ? /* @__PURE__ */ jsxs("span", { className: styles$M.middleAlignedInline, children: [
@@ -4601,8 +4598,7 @@ const Button = ({
4601
4598
  disabled: disabled2,
4602
4599
  error: error2,
4603
4600
  warning: warning2,
4604
- active: active2,
4605
- tabIndex
4601
+ active: active2
4606
4602
  }
4607
4603
  )
4608
4604
  }
@@ -4696,7 +4692,6 @@ const Trigger$1 = React__default.forwardRef(
4696
4692
  tooltip: tooltip2,
4697
4693
  testId,
4698
4694
  selected: selected2,
4699
- tabIndex,
4700
4695
  ...restProps
4701
4696
  }, ref) => {
4702
4697
  const triggerElement = trigger2 === TriggerType.BUTTON || trigger2 === TriggerType.DROP_DOWN_BUTTON ? /* @__PURE__ */ jsx(
@@ -4712,8 +4707,7 @@ const Trigger$1 = React__default.forwardRef(
4712
4707
  loading,
4713
4708
  error: error2,
4714
4709
  warning: warning2,
4715
- active: isOpen2,
4716
- tabIndex
4710
+ active: isOpen2
4717
4711
  }
4718
4712
  ) : trigger2 === TriggerType.TEXT ? /* @__PURE__ */ jsx(
4719
4713
  Text$1,
@@ -4879,8 +4873,7 @@ const DropDownMenu = ({
4879
4873
  tooltip: tooltip2,
4880
4874
  error: error2,
4881
4875
  warning: warning2,
4882
- selected: selected2,
4883
- tabIndex
4876
+ selected: selected2
4884
4877
  }) => {
4885
4878
  const disabledContext = useContext(DisabledContext);
4886
4879
  const {
@@ -4950,8 +4943,7 @@ const DropDownMenu = ({
4950
4943
  error: error2,
4951
4944
  warning: warning2,
4952
4945
  testId,
4953
- selected: selected2,
4954
- tabIndex
4946
+ selected: selected2
4955
4947
  }
4956
4948
  ),
4957
4949
  isOpen2 && renderLayer(
@@ -9092,7 +9084,7 @@ const Input$1 = forwardRef(
9092
9084
  },
9093
9085
  onPaste = () => {
9094
9086
  },
9095
- selectOnFocus = true,
9087
+ selectOnFocus = false,
9096
9088
  name: name2 = void 0,
9097
9089
  type = "text",
9098
9090
  tabIndex = 0,
@@ -9124,7 +9116,7 @@ const Input$1 = forwardRef(
9124
9116
  const handleFocus = (e2) => {
9125
9117
  onFocus(e2);
9126
9118
  if (selectOnFocus) {
9127
- setTimeout(() => e2.target.select(), 50);
9119
+ e2.target.select();
9128
9120
  }
9129
9121
  };
9130
9122
  return /* @__PURE__ */ jsx("div", { style: { width: width2 }, className: order2, children: /* @__PURE__ */ jsx(
@@ -15196,77 +15188,86 @@ const Layer$1 = ({
15196
15188
  options,
15197
15189
  onChangeOptions,
15198
15190
  showHeader,
15199
- maxHeight
15191
+ maxHeight,
15192
+ testId
15200
15193
  }) => {
15201
- return /* @__PURE__ */ jsxs("div", { className: cx$2("menu", styles$r.menu), style: { maxHeight }, children: [
15202
- showHeader && /* @__PURE__ */ jsxs(Fragment$1, { children: [
15203
- /* @__PURE__ */ jsxs("div", { className: styles$r.header, children: [
15204
- /* @__PURE__ */ jsx(
15205
- "a",
15206
- {
15207
- onClick: (evt) => {
15208
- const next2 = options.map((option2) => ({
15209
- ...option2,
15210
- selected: true
15211
- }));
15212
- onChangeOptions(evt, next2);
15213
- },
15214
- children: "All"
15215
- }
15216
- ),
15217
- /* @__PURE__ */ jsx(
15218
- "a",
15219
- {
15220
- onClick: (evt) => {
15221
- const next2 = options.map((option2) => ({
15222
- ...option2,
15223
- selected: false
15224
- }));
15225
- onChangeOptions(evt, next2);
15226
- },
15227
- children: "Clear"
15228
- }
15229
- ),
15230
- /* @__PURE__ */ jsx(
15231
- "a",
15232
- {
15233
- onClick: (evt) => {
15234
- const next2 = options.map((option2) => ({
15235
- ...option2,
15236
- selected: !(option2 == null ? void 0 : option2.selected)
15237
- }));
15238
- onChangeOptions(evt, next2);
15239
- },
15240
- children: "Invert"
15241
- }
15242
- )
15243
- ] }),
15244
- /* @__PURE__ */ jsx(Divider, { margin: 0 })
15245
- ] }),
15246
- options.map((option2, index2) => {
15247
- switch (option2.type) {
15248
- case DropdownType.HEADING:
15249
- return /* @__PURE__ */ jsx(Heading$1, { label: option2.label }, index2);
15250
- case DropdownType.DIVIDER:
15251
- return /* @__PURE__ */ jsx(Divider, { margin: 0 }, index2);
15252
- default:
15253
- return /* @__PURE__ */ jsx(
15254
- Option$1,
15255
- {
15256
- option: option2,
15257
- onChange: (evt) => {
15258
- const { value } = option2;
15259
- const next2 = options.map(
15260
- (option22) => option22.value !== value ? option22 : { ...option22, selected: !(option22 == null ? void 0 : option22.selected) }
15261
- );
15262
- onChangeOptions(evt, next2);
15194
+ return /* @__PURE__ */ jsxs(
15195
+ "div",
15196
+ {
15197
+ className: cx$2("menu", styles$r.menu),
15198
+ style: { maxHeight },
15199
+ "data-testid": testId ? `${testId}-option-dropdown-layer` : void 0,
15200
+ children: [
15201
+ showHeader && /* @__PURE__ */ jsxs(Fragment$1, { children: [
15202
+ /* @__PURE__ */ jsxs("div", { className: styles$r.header, children: [
15203
+ /* @__PURE__ */ jsx(
15204
+ "a",
15205
+ {
15206
+ onClick: (evt) => {
15207
+ const next2 = options.map((option2) => ({
15208
+ ...option2,
15209
+ selected: true
15210
+ }));
15211
+ onChangeOptions(evt, next2);
15212
+ },
15213
+ children: "All"
15263
15214
  }
15264
- },
15265
- index2
15266
- );
15267
- }
15268
- })
15269
- ] });
15215
+ ),
15216
+ /* @__PURE__ */ jsx(
15217
+ "a",
15218
+ {
15219
+ onClick: (evt) => {
15220
+ const next2 = options.map((option2) => ({
15221
+ ...option2,
15222
+ selected: false
15223
+ }));
15224
+ onChangeOptions(evt, next2);
15225
+ },
15226
+ children: "Clear"
15227
+ }
15228
+ ),
15229
+ /* @__PURE__ */ jsx(
15230
+ "a",
15231
+ {
15232
+ onClick: (evt) => {
15233
+ const next2 = options.map((option2) => ({
15234
+ ...option2,
15235
+ selected: !(option2 == null ? void 0 : option2.selected)
15236
+ }));
15237
+ onChangeOptions(evt, next2);
15238
+ },
15239
+ children: "Invert"
15240
+ }
15241
+ )
15242
+ ] }),
15243
+ /* @__PURE__ */ jsx(Divider, { margin: 0 })
15244
+ ] }),
15245
+ options.map((option2, index2) => {
15246
+ switch (option2.type) {
15247
+ case DropdownType.HEADING:
15248
+ return /* @__PURE__ */ jsx(Heading$1, { label: option2.label }, index2);
15249
+ case DropdownType.DIVIDER:
15250
+ return /* @__PURE__ */ jsx(Divider, { margin: 0 }, index2);
15251
+ default:
15252
+ return /* @__PURE__ */ jsx(
15253
+ Option$1,
15254
+ {
15255
+ option: option2,
15256
+ onChange: (evt) => {
15257
+ const { value } = option2;
15258
+ const next2 = options.map(
15259
+ (option22) => option22.value !== value ? option22 : { ...option22, selected: !(option22 == null ? void 0 : option22.selected) }
15260
+ );
15261
+ onChangeOptions(evt, next2);
15262
+ }
15263
+ },
15264
+ index2
15265
+ );
15266
+ }
15267
+ })
15268
+ ]
15269
+ }
15270
+ );
15270
15271
  };
15271
15272
  const OptionDropdown = ({
15272
15273
  name: name2,
@@ -15275,12 +15276,15 @@ const OptionDropdown = ({
15275
15276
  onChange,
15276
15277
  small: small2 = false,
15277
15278
  showHeader = true,
15278
- maxHeight = "40vh"
15279
+ maxHeight = "40vh",
15280
+ testId
15279
15281
  }) => {
15280
15282
  return /* @__PURE__ */ jsx(
15281
15283
  Menu,
15282
15284
  {
15285
+ testId,
15283
15286
  menu: {
15287
+ testId: testId ? `${testId}-menu-layer` : void 0,
15284
15288
  small: small2,
15285
15289
  label: label2,
15286
15290
  trigger: TriggerType.DROP_DOWN_BUTTON,
@@ -15288,6 +15292,7 @@ const OptionDropdown = ({
15288
15292
  sections: /* @__PURE__ */ jsx(
15289
15293
  Layer$1,
15290
15294
  {
15295
+ testId,
15291
15296
  options,
15292
15297
  onChangeOptions: (evt, nextOptions) => {
15293
15298
  evt.target.name = name2;
@@ -51468,7 +51473,7 @@ const NumberInput = ({
51468
51473
  },
51469
51474
  onBlur = () => {
51470
51475
  },
51471
- selectOnFocus,
51476
+ selectOnFocus = false,
51472
51477
  tabIndex = 0,
51473
51478
  testId,
51474
51479
  tooltip: tooltip2 = null,
@@ -51553,7 +51558,11 @@ const NumberInput = ({
51553
51558
  useEffect(() => {
51554
51559
  if (inputRef && (inputRef == null ? void 0 : inputRef.current) && enableDisplayRounding && focus2) {
51555
51560
  const textInput = inputRef.current;
51556
- if (textInput && !selectOnFocus) {
51561
+ if (textInput) {
51562
+ if (selectOnFocus) {
51563
+ textInput.select();
51564
+ return;
51565
+ }
51557
51566
  setTimeout(() => {
51558
51567
  const { length: length2 } = safeToString(displayValue);
51559
51568
  textInput.setSelectionRange(length2, length2);
@@ -66435,7 +66444,7 @@ const UnitInput = ({
66435
66444
  enableCosmeticRounding = true,
66436
66445
  enableDisplayRounding = false,
66437
66446
  roundDisplayValue,
66438
- selectOnFocus
66447
+ selectOnFocus = false
66439
66448
  }) => {
66440
66449
  const context2 = useUnitContext();
66441
66450
  const runAfterUpdate = useRunAfterUpdate();
@@ -66710,7 +66719,6 @@ const UnitInput = ({
66710
66719
  groupOrder: "last",
66711
66720
  disabled: disabledUnit,
66712
66721
  testId: testId && `${testId}-menu`,
66713
- tabIndex: -1,
66714
66722
  menu: {
66715
66723
  label: displayUnitLabel,
66716
66724
  trigger: "DropDownButton",