@ballistix.digital/react-components 9.5.1 → 9.5.3-rc-372.0

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
@@ -2296,7 +2296,6 @@ const $0c7305af577f9538$var$styles = {
2296
2296
  var $0c7305af577f9538$export$2e2bcd8739ae039 = $0c7305af577f9538$var$styles;
2297
2297
 
2298
2298
 
2299
- const $cb1b9d36d0757897$var$searchPrefix = '__search__';
2300
2299
  const $cb1b9d36d0757897$var$SelectMenu = (props)=>{
2301
2300
  const { name: name = 'select-menu-form', label: label, description: description, hint: hint, placeholder: placeholder, options: options, required: required, value: value, error: error, isRequired: isRequired = false, isLoading: isLoading, isTouched: isTouched = false, isDisabled: isDisabled, isClearable: isClearable = true, isMultiple: isMultiple = false, isSearchable: isSearchable = true, isSolo: isSolo = false, isOptionalLabelHidden: isOptionalLabelHidden = false, onChange: onChange, onSearchInputChange: onSearchInputChange, onClear: onClear, onBlur: onBlur, searchInputOptionRenderer: searchInputOptionRenderer, dataTestId: dataTestId, styles: stylesOverrides } = props;
2302
2301
  const [isFocus, setIsFocus] = (0, $iA2ta$react.useState)(true);
@@ -2329,7 +2328,8 @@ const $cb1b9d36d0757897$var$SelectMenu = (props)=>{
2329
2328
  ...options,
2330
2329
  {
2331
2330
  label: searchValue,
2332
- value: $cb1b9d36d0757897$var$searchPrefix + searchValue
2331
+ value: searchValue,
2332
+ isSearch: true
2333
2333
  }
2334
2334
  ];
2335
2335
  }, [
@@ -2391,6 +2391,25 @@ const $cb1b9d36d0757897$var$SelectMenu = (props)=>{
2391
2391
  }, [
2392
2392
  error
2393
2393
  ]);
2394
+ const handleFormatOptionLabel = (data)=>{
2395
+ if (searchInputOptionRenderer && !!data.isSearch) {
2396
+ const tagItem = (0, $iA2ta$reactjsxruntime.jsx)("div", {
2397
+ className: styles.tagItem,
2398
+ children: (0, $iA2ta$reactjsxruntime.jsx)("p", {
2399
+ className: styles.tagItemText,
2400
+ children: data.label
2401
+ })
2402
+ });
2403
+ return (0, $iA2ta$reactjsxruntime.jsx)("div", {
2404
+ className: styles.listItem,
2405
+ children: searchInputOptionRenderer(tagItem)
2406
+ });
2407
+ }
2408
+ return (0, $iA2ta$reactjsxruntime.jsx)("div", {
2409
+ className: styles.listItem,
2410
+ children: data.label
2411
+ });
2412
+ };
2394
2413
  return (0, $iA2ta$reactjsxruntime.jsxs)("div", {
2395
2414
  className: styles.container,
2396
2415
  "data-testid": selectDataTestId,
@@ -2435,28 +2454,7 @@ const $cb1b9d36d0757897$var$SelectMenu = (props)=>{
2435
2454
  onChange: handleChange,
2436
2455
  onSearchInputChange: handleSearchInputChange,
2437
2456
  //
2438
- formatOptionLabel: (data)=>{
2439
- if (searchInputOptionRenderer && data.value.startsWith($cb1b9d36d0757897$var$searchPrefix)) {
2440
- const tagItem = (0, $iA2ta$reactjsxruntime.jsx)("div", {
2441
- className: styles.listItem,
2442
- children: (0, $iA2ta$reactjsxruntime.jsx)("div", {
2443
- className: styles.tagItem,
2444
- children: (0, $iA2ta$reactjsxruntime.jsx)("p", {
2445
- className: styles.tagItemText,
2446
- children: data.label
2447
- })
2448
- })
2449
- });
2450
- return (0, $iA2ta$reactjsxruntime.jsx)("div", {
2451
- className: styles.listItem,
2452
- children: searchInputOptionRenderer(tagItem)
2453
- });
2454
- }
2455
- return (0, $iA2ta$reactjsxruntime.jsx)("div", {
2456
- className: styles.listItem,
2457
- children: data.label
2458
- });
2459
- },
2457
+ formatOptionLabel: searchInputOptionRenderer ? handleFormatOptionLabel : undefined,
2460
2458
  classNames: {
2461
2459
  menuButton: ()=>(0, $622cd2936b18c771$export$4370d69198e9314a)(styles.input, `bx-select-menu-${name}`, state === null && '*:text-gray-300! ', state === null && !isValid && isTouched && '*:text-red-300!'),
2462
2460
  menu: styles.menu,
@@ -5692,11 +5690,13 @@ const $b59f83fca3d8e62d$var$CheckboxInput = (props)=>{
5692
5690
  (0, $iA2ta$reactjsxruntime.jsx)("label", {
5693
5691
  htmlFor: name,
5694
5692
  className: styles.label,
5693
+ onClick: handleClick,
5695
5694
  children: title
5696
5695
  }),
5697
5696
  description && (0, $iA2ta$reactjsxruntime.jsx)("p", {
5698
5697
  id: `${name}-description`,
5699
5698
  className: styles.description,
5699
+ onClick: handleClick,
5700
5700
  children: description
5701
5701
  })
5702
5702
  ]