@oliasoft-open-source/react-ui-library 4.0.0-beta-10 → 4.0.0-beta-11

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.js CHANGED
@@ -27455,23 +27455,23 @@ Page.propTypes = {
27455
27455
  scroll: propTypes$1.exports.bool,
27456
27456
  top: propTypes$1.exports.oneOfType([propTypes$1.exports.number, propTypes$1.exports.string])
27457
27457
  };
27458
- const inputInTable$6 = "_inputInTable_brru0_1";
27459
- const inputHover$6 = "_inputHover_brru0_13";
27460
- const inputFocus$6 = "_inputFocus_brru0_18";
27461
- const inputError$6 = "_inputError_brru0_25";
27462
- const inputWarning$6 = "_inputWarning_brru0_26";
27463
- const inputDisabled$6 = "_inputDisabled_brru0_61";
27464
- const hideScrollbars$6 = "_hideScrollbars_brru0_67";
27465
- const select = "_select_brru0_77";
27466
- const isInTable$2 = "_isInTable_brru0_121";
27467
- const unSelected = "_unSelected_brru0_133";
27468
- const error$3 = "_error_brru0_140";
27469
- const warning$5 = "_warning_brru0_157";
27470
- const small$6 = "_small_brru0_174";
27471
- const right$3 = "_right_brru0_182";
27472
- const groupOrderFirst$1 = "_groupOrderFirst_brru0_193";
27473
- const groupOrderMiddle$1 = "_groupOrderMiddle_brru0_194";
27474
- const groupOrderLast$1 = "_groupOrderLast_brru0_198";
27458
+ const inputInTable$6 = "_inputInTable_1cli0_1";
27459
+ const inputHover$6 = "_inputHover_1cli0_13";
27460
+ const inputFocus$6 = "_inputFocus_1cli0_18";
27461
+ const inputError$6 = "_inputError_1cli0_25";
27462
+ const inputWarning$6 = "_inputWarning_1cli0_26";
27463
+ const inputDisabled$6 = "_inputDisabled_1cli0_61";
27464
+ const hideScrollbars$6 = "_hideScrollbars_1cli0_67";
27465
+ const select = "_select_1cli0_77";
27466
+ const isInTable$2 = "_isInTable_1cli0_121";
27467
+ const unSelected = "_unSelected_1cli0_133";
27468
+ const error$3 = "_error_1cli0_140";
27469
+ const warning$5 = "_warning_1cli0_157";
27470
+ const small$6 = "_small_1cli0_174";
27471
+ const right$3 = "_right_1cli0_182";
27472
+ const groupOrderFirst$1 = "_groupOrderFirst_1cli0_193";
27473
+ const groupOrderMiddle$1 = "_groupOrderMiddle_1cli0_194";
27474
+ const groupOrderLast$1 = "_groupOrderLast_1cli0_198";
27475
27475
  const styles$n = {
27476
27476
  inputInTable: inputInTable$6,
27477
27477
  inputHover: inputHover$6,
@@ -28551,6 +28551,58 @@ const Section = ({
28551
28551
  });
28552
28552
  }
28553
28553
  };
28554
+ const getTextWidth = (text2, font) => {
28555
+ const element = document.createElement("canvas");
28556
+ const context2 = element.getContext("2d");
28557
+ context2.font = font;
28558
+ return context2.measureText(text2).width;
28559
+ };
28560
+ const FONT_SIZE = "14px";
28561
+ const FONT_SIZE_SMALL = "12px";
28562
+ const FONT_FAMILY = "Roobert";
28563
+ const FONT_FAMILY_FALLBACK = "sans-serif";
28564
+ const PADDING = 10;
28565
+ const PADDING_SMALL = 7;
28566
+ const TOGGLE_SIZE = 38;
28567
+ const TOGGLE_SIZE_SMALL = 24;
28568
+ const TAG_PADDING = 5;
28569
+ const TAG_PADDING_SMALL = 3;
28570
+ const TAG_BORDER_WIDTH = 1;
28571
+ const TAG_MARGIN = 2;
28572
+ const MAX_OPTIONS_LENGTH = 10;
28573
+ const getFont = (small2 = false, isFontLoaded = false) => {
28574
+ const fontSize = small2 ? FONT_SIZE_SMALL : FONT_SIZE;
28575
+ const fontFamily = isFontLoaded ? FONT_FAMILY : FONT_FAMILY_FALLBACK;
28576
+ return `${fontSize} ${fontFamily}`;
28577
+ };
28578
+ const getExtraOptionWidth = (small2 = false, scrollbar = false) => {
28579
+ const SCROLLBAR_WIDTH = 17;
28580
+ return (small2 ? PADDING_SMALL : PADDING) + (small2 ? TOGGLE_SIZE_SMALL : TOGGLE_SIZE) + (scrollbar ? SCROLLBAR_WIDTH : 0);
28581
+ };
28582
+ const getWidestOptionWidth = (options, small2, isFontLoaded, placeholder3) => {
28583
+ const font = getFont(small2, isFontLoaded);
28584
+ const placeholderWidth = placeholder3 ? getTextWidth(placeholder3, font) : 0;
28585
+ const widestTextWidth = Math.ceil(
28586
+ options.reduce((acc, option2) => {
28587
+ var _a, _b;
28588
+ const optionActionsWidth = ((_b = (_a = option2 == null ? void 0 : option2.actions) == null ? void 0 : _a.length) != null ? _b : 0) * 24;
28589
+ const optionIconWidth = option2.icon ? (small2 ? FONT_SIZE_SMALL : FONT_SIZE) + 7 : 0;
28590
+ const optionsText = `${option2.label} ${option2.details || ""}`;
28591
+ const optionWidth = getTextWidth(optionsText, font) + optionActionsWidth + optionIconWidth;
28592
+ acc = optionWidth > acc ? optionWidth : acc;
28593
+ return acc;
28594
+ }, placeholderWidth)
28595
+ );
28596
+ const hasScrollbar = (options == null ? void 0 : options.length) > MAX_OPTIONS_LENGTH;
28597
+ const extraWidth = getExtraOptionWidth(small2, hasScrollbar);
28598
+ return widestTextWidth + extraWidth;
28599
+ };
28600
+ const getMultiOptionWidth = (option2, small2, isFontLoaded) => {
28601
+ const font = getFont(true, isFontLoaded);
28602
+ const textWidth = getTextWidth(option2.label, font);
28603
+ const extraWidth = (small2 ? TAG_PADDING_SMALL : TAG_PADDING) * 2 + TAG_BORDER_WIDTH * 2 + TAG_MARGIN;
28604
+ return Math.ceil(textWidth + extraWidth);
28605
+ };
28554
28606
  const Layer = ({
28555
28607
  listRef,
28556
28608
  isMulti: isMulti2,
@@ -28583,7 +28635,7 @@ const Layer = ({
28583
28635
  })
28584
28636
  }) : /* @__PURE__ */ jsxRuntime.exports.jsx(FixedSizeList, {
28585
28637
  ref: listRef,
28586
- height: sections.length < 10 ? optionHeight * sections.length : optionHeight * 10,
28638
+ height: sections.length < MAX_OPTIONS_LENGTH ? optionHeight * sections.length : optionHeight * MAX_OPTIONS_LENGTH,
28587
28639
  itemCount: sections.length,
28588
28640
  itemSize: optionHeight,
28589
28641
  width,
@@ -28604,37 +28656,37 @@ const Layer = ({
28604
28656
  })
28605
28657
  });
28606
28658
  };
28607
- const inputInTable$5 = "_inputInTable_1dpp2_1";
28608
- const inputHover$5 = "_inputHover_1dpp2_13";
28609
- const inputFocus$5 = "_inputFocus_1dpp2_18";
28610
- const inputError$5 = "_inputError_1dpp2_25";
28611
- const inputWarning$5 = "_inputWarning_1dpp2_26";
28612
- const inputDisabled$5 = "_inputDisabled_1dpp2_61";
28613
- const hideScrollbars$5 = "_hideScrollbars_1dpp2_67";
28614
- const trigger$1 = "_trigger_1dpp2_81";
28615
- const isInTable$1 = "_isInTable_1dpp2_97";
28616
- const input = "_input_1dpp2_1";
28617
- const isOpen = "_isOpen_1dpp2_118";
28618
- const error$2 = "_error_1dpp2_126";
28619
- const warning$4 = "_warning_1dpp2_143";
28620
- const disabled$3 = "_disabled_1dpp2_160";
28621
- const icons = "_icons_1dpp2_166";
28622
- const clearAll = "_clearAll_1dpp2_173";
28623
- const iconOpen = "_iconOpen_1dpp2_174";
28624
- const small$4 = "_small_1dpp2_183";
28625
- const triggerInputContainer = "_triggerInputContainer_1dpp2_192";
28626
- const right$2 = "_right_1dpp2_201";
28627
- const multiOptions = "_multiOptions_1dpp2_214";
28628
- const multiOption = "_multiOption_1dpp2_214";
28629
- const label$4 = "_label_1dpp2_246";
28630
- const closeMultiOption = "_closeMultiOption_1dpp2_249";
28631
- const focus = "_focus_1dpp2_260";
28632
- const selectedSingleValue = "_selectedSingleValue_1dpp2_264";
28633
- const placeHolder = "_placeHolder_1dpp2_265";
28634
- const groupOrderFirst = "_groupOrderFirst_1dpp2_304";
28635
- const groupOrderMiddle = "_groupOrderMiddle_1dpp2_305";
28636
- const groupOrderLast = "_groupOrderLast_1dpp2_309";
28637
- const detailedLabel = "_detailedLabel_1dpp2_314";
28659
+ const inputInTable$5 = "_inputInTable_1nzsx_1";
28660
+ const inputHover$5 = "_inputHover_1nzsx_13";
28661
+ const inputFocus$5 = "_inputFocus_1nzsx_18";
28662
+ const inputError$5 = "_inputError_1nzsx_25";
28663
+ const inputWarning$5 = "_inputWarning_1nzsx_26";
28664
+ const inputDisabled$5 = "_inputDisabled_1nzsx_61";
28665
+ const hideScrollbars$5 = "_hideScrollbars_1nzsx_67";
28666
+ const trigger$1 = "_trigger_1nzsx_77";
28667
+ const isInTable$1 = "_isInTable_1nzsx_93";
28668
+ const input = "_input_1nzsx_1";
28669
+ const isOpen = "_isOpen_1nzsx_114";
28670
+ const error$2 = "_error_1nzsx_122";
28671
+ const warning$4 = "_warning_1nzsx_139";
28672
+ const disabled$3 = "_disabled_1nzsx_156";
28673
+ const icons = "_icons_1nzsx_162";
28674
+ const clearAll = "_clearAll_1nzsx_169";
28675
+ const iconOpen = "_iconOpen_1nzsx_170";
28676
+ const small$4 = "_small_1nzsx_178";
28677
+ const triggerInputContainer = "_triggerInputContainer_1nzsx_186";
28678
+ const right$2 = "_right_1nzsx_195";
28679
+ const multiOptions = "_multiOptions_1nzsx_208";
28680
+ const multiOption = "_multiOption_1nzsx_208";
28681
+ const label$4 = "_label_1nzsx_240";
28682
+ const closeMultiOption = "_closeMultiOption_1nzsx_243";
28683
+ const focus = "_focus_1nzsx_254";
28684
+ const selectedSingleValue = "_selectedSingleValue_1nzsx_258";
28685
+ const placeHolder = "_placeHolder_1nzsx_259";
28686
+ const groupOrderFirst = "_groupOrderFirst_1nzsx_298";
28687
+ const groupOrderMiddle = "_groupOrderMiddle_1nzsx_299";
28688
+ const groupOrderLast = "_groupOrderLast_1nzsx_303";
28689
+ const detailedLabel = "_detailedLabel_1nzsx_308";
28638
28690
  const styles$l = {
28639
28691
  inputInTable: inputInTable$5,
28640
28692
  inputHover: inputHover$5,
@@ -28668,56 +28720,6 @@ const styles$l = {
28668
28720
  groupOrderLast,
28669
28721
  detailedLabel
28670
28722
  };
28671
- const getTextWidth = (text2, font) => {
28672
- const element = document.createElement("canvas");
28673
- const context2 = element.getContext("2d");
28674
- context2.font = font;
28675
- return context2.measureText(text2).width;
28676
- };
28677
- const FONT_SIZE = "14px";
28678
- const FONT_SIZE_SMALL = "12px";
28679
- const FONT_FAMILY = "Roobert";
28680
- const FONT_FAMILY_FALLBACK = "sans-serif";
28681
- const PADDING = 14;
28682
- const PADDING_SMALL = 7;
28683
- const TOGGLE_SIZE = 38;
28684
- const TOGGLE_SIZE_SMALL = 24;
28685
- const TAG_PADDING = 5;
28686
- const TAG_PADDING_SMALL = 3;
28687
- const TAG_BORDER_WIDTH = 1;
28688
- const TAG_MARGIN = 2;
28689
- const getFont = (small2 = false, isFontLoaded = false) => {
28690
- const fontSize = small2 ? FONT_SIZE_SMALL : FONT_SIZE;
28691
- const fontFamily = isFontLoaded ? FONT_FAMILY : FONT_FAMILY_FALLBACK;
28692
- return `${fontSize} ${fontFamily}`;
28693
- };
28694
- const getExtraOptionWidth = (small2 = false, scrollbar = false) => {
28695
- const SCROLLBAR_WIDTH = 17;
28696
- return (small2 ? PADDING_SMALL : PADDING) + (small2 ? TOGGLE_SIZE_SMALL : TOGGLE_SIZE) + (scrollbar ? SCROLLBAR_WIDTH : 0);
28697
- };
28698
- const getWidestOptionWidth = (options, small2, isFontLoaded, placeholder3) => {
28699
- const font = getFont(small2, isFontLoaded);
28700
- const placeholderWidth = placeholder3 ? getTextWidth(placeholder3, font) : 0;
28701
- const widestTextWidth = Math.ceil(
28702
- options.reduce((acc, option2) => {
28703
- var _a, _b;
28704
- const optionActionsWidth = ((_b = (_a = option2 == null ? void 0 : option2.actions) == null ? void 0 : _a.length) != null ? _b : 0) * 24;
28705
- const optionIconWidth = option2.icon ? (small2 ? FONT_SIZE_SMALL : FONT_SIZE) + 7 : 0;
28706
- const optionsText = `${option2.label} ${option2.details || ""}`;
28707
- const optionWidth = getTextWidth(optionsText, font) + optionActionsWidth + optionIconWidth;
28708
- acc = optionWidth > acc ? optionWidth : acc;
28709
- return acc;
28710
- }, placeholderWidth)
28711
- );
28712
- const extraWidth = getExtraOptionWidth(small2, true);
28713
- return widestTextWidth + extraWidth;
28714
- };
28715
- const getMultiOptionWidth = (option2, small2, isFontLoaded) => {
28716
- const font = getFont(true, isFontLoaded);
28717
- const textWidth = getTextWidth(option2.label, font);
28718
- const extraWidth = (small2 ? TAG_PADDING_SMALL : TAG_PADDING) * 2 + TAG_BORDER_WIDTH * 2 + TAG_MARGIN;
28719
- return Math.ceil(textWidth + extraWidth);
28720
- };
28721
28723
  const MultiSelectedOptions = ({ selectedOptions, small: small2, width }) => {
28722
28724
  const isFontLoaded = useFontsReady();
28723
28725
  const [displayedOptions, setDisplayedOptions] = useState([]);