@oliasoft-open-source/react-ui-library 4.20.0-beta-1 → 4.20.0-beta-2

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
@@ -376,6 +376,7 @@ The `Button` component is a versatile interface element that supports various st
376
376
  | `testId` | A test identifier for the button. | None (optional) |
377
377
  | `tooltip` | Tooltip content. Can be text or a ReactNode. | None (optional) |
378
378
  | `inverted` | Deprecated. | `false` |
379
+ | `tabIndex` | The tab index of the button. | None (optional) |
379
380
 
380
381
  ### Usage Example
381
382
 
@@ -1360,6 +1361,7 @@ The `OptionDropdown` component is used to display a dropdown menu with selectabl
1360
1361
  | `onChange` | A function to be called when the selected options change. | - |
1361
1362
  | `showHeader` | A boolean indicating whether to display a header above the dropdown options. | `true` |
1362
1363
  | `maxHeight` | The maximum height of the dropdown menu. | `'40vh'` |
1364
+ | `testId` | Test ID used for testing purposes. | - |
1363
1365
 
1364
1366
  ### Usage Example
1365
1367
 
package/dist/index.d.ts CHANGED
@@ -957,6 +957,7 @@ export declare interface IOptionDropdownProps {
957
957
  showHeader?: boolean;
958
958
  maxHeight?: string;
959
959
  small?: boolean;
960
+ testId?: string;
960
961
  }
961
962
 
962
963
  declare interface IOptionItem {
@@ -1695,7 +1696,7 @@ export declare const NativeSelect: ({ disabled, error, warning, tooltip, options
1695
1696
 
1696
1697
  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
1698
 
1698
- export declare const OptionDropdown: ({ name, label, options, onChange, small, showHeader, maxHeight, }: IOptionDropdownProps) => ReactElement;
1699
+ export declare const OptionDropdown: ({ name, label, options, onChange, small, showHeader, maxHeight, testId, }: IOptionDropdownProps) => ReactElement;
1699
1700
 
1700
1701
  export declare const Page: ({ children, left, padding: paddingProp, scroll, top, }: ILayoutPageProps) => JSX_2.Element;
1701
1702
 
package/dist/index.js CHANGED
@@ -15196,77 +15196,86 @@ const Layer$1 = ({
15196
15196
  options,
15197
15197
  onChangeOptions,
15198
15198
  showHeader,
15199
- maxHeight
15199
+ maxHeight,
15200
+ testId
15200
15201
  }) => {
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);
15202
+ return /* @__PURE__ */ jsxs(
15203
+ "div",
15204
+ {
15205
+ className: cx$2("menu", styles$r.menu),
15206
+ style: { maxHeight },
15207
+ "data-testid": testId ? `${testId}-option-dropdown-layer` : void 0,
15208
+ children: [
15209
+ showHeader && /* @__PURE__ */ jsxs(Fragment$1, { children: [
15210
+ /* @__PURE__ */ jsxs("div", { className: styles$r.header, children: [
15211
+ /* @__PURE__ */ jsx(
15212
+ "a",
15213
+ {
15214
+ onClick: (evt) => {
15215
+ const next2 = options.map((option2) => ({
15216
+ ...option2,
15217
+ selected: true
15218
+ }));
15219
+ onChangeOptions(evt, next2);
15220
+ },
15221
+ children: "All"
15263
15222
  }
15264
- },
15265
- index2
15266
- );
15267
- }
15268
- })
15269
- ] });
15223
+ ),
15224
+ /* @__PURE__ */ jsx(
15225
+ "a",
15226
+ {
15227
+ onClick: (evt) => {
15228
+ const next2 = options.map((option2) => ({
15229
+ ...option2,
15230
+ selected: false
15231
+ }));
15232
+ onChangeOptions(evt, next2);
15233
+ },
15234
+ children: "Clear"
15235
+ }
15236
+ ),
15237
+ /* @__PURE__ */ jsx(
15238
+ "a",
15239
+ {
15240
+ onClick: (evt) => {
15241
+ const next2 = options.map((option2) => ({
15242
+ ...option2,
15243
+ selected: !(option2 == null ? void 0 : option2.selected)
15244
+ }));
15245
+ onChangeOptions(evt, next2);
15246
+ },
15247
+ children: "Invert"
15248
+ }
15249
+ )
15250
+ ] }),
15251
+ /* @__PURE__ */ jsx(Divider, { margin: 0 })
15252
+ ] }),
15253
+ options.map((option2, index2) => {
15254
+ switch (option2.type) {
15255
+ case DropdownType.HEADING:
15256
+ return /* @__PURE__ */ jsx(Heading$1, { label: option2.label }, index2);
15257
+ case DropdownType.DIVIDER:
15258
+ return /* @__PURE__ */ jsx(Divider, { margin: 0 }, index2);
15259
+ default:
15260
+ return /* @__PURE__ */ jsx(
15261
+ Option$1,
15262
+ {
15263
+ option: option2,
15264
+ onChange: (evt) => {
15265
+ const { value } = option2;
15266
+ const next2 = options.map(
15267
+ (option22) => option22.value !== value ? option22 : { ...option22, selected: !(option22 == null ? void 0 : option22.selected) }
15268
+ );
15269
+ onChangeOptions(evt, next2);
15270
+ }
15271
+ },
15272
+ index2
15273
+ );
15274
+ }
15275
+ })
15276
+ ]
15277
+ }
15278
+ );
15270
15279
  };
15271
15280
  const OptionDropdown = ({
15272
15281
  name: name2,
@@ -15275,12 +15284,15 @@ const OptionDropdown = ({
15275
15284
  onChange,
15276
15285
  small: small2 = false,
15277
15286
  showHeader = true,
15278
- maxHeight = "40vh"
15287
+ maxHeight = "40vh",
15288
+ testId
15279
15289
  }) => {
15280
15290
  return /* @__PURE__ */ jsx(
15281
15291
  Menu,
15282
15292
  {
15293
+ testId,
15283
15294
  menu: {
15295
+ testId: testId ? `${testId}-menu-layer` : void 0,
15284
15296
  small: small2,
15285
15297
  label: label2,
15286
15298
  trigger: TriggerType.DROP_DOWN_BUTTON,
@@ -15288,6 +15300,7 @@ const OptionDropdown = ({
15288
15300
  sections: /* @__PURE__ */ jsx(
15289
15301
  Layer$1,
15290
15302
  {
15303
+ testId,
15291
15304
  options,
15292
15305
  onChangeOptions: (evt, nextOptions) => {
15293
15306
  evt.target.name = name2;