@memobit/libs 3.12.2 → 3.12.4

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.
@@ -1 +1 @@
1
- .control-panel{--control-panel-width:280px;--control-panel-shadow:none;--control-panel-nav-depth:0;width:var(--control-panel-width);margin:var(--spacing-16);min-height:calc(100vh - var(--spacing-32));min-height:calc(100dvh - var(--spacing-32));background:var(--card-background-color);border:var(--spacing-1) solid var(--delimiter-color);border-radius:var(--radius);box-shadow:var(--control-panel-shadow);flex-shrink:0;transition:width .3s,transform .3s,border-color .3s;overflow-x:hidden}.control-panel__nav{gap:var(--spacing-4);padding:var(--spacing-8);border-top:var(--spacing-1) solid var(--delimiter-color);flex-direction:column;display:flex}.control-panel__nav-node{gap:var(--spacing-4);flex-direction:column;display:flex}.control-panel__nav-row{align-items:center;gap:var(--spacing-4);padding-left:calc(var(--control-panel-nav-depth) * var(--spacing-16));display:flex}.control-panel__nav-toggle,.control-panel__nav-toggle-placeholder{width:var(--spacing-24);height:var(--spacing-24);flex-shrink:0}.control-panel__nav-toggle{border-radius:var(--radius-sm);color:var(--body-color-muted);cursor:pointer;transition:background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control-panel__nav-toggle:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__nav-toggle--open{color:var(--body-accent-color);transform:rotate(90deg)}.control-panel__nav-toggle-placeholder{display:inline-block}.control-panel__nav-children{gap:var(--spacing-4);flex-direction:column;display:none}.control-panel__nav-children--open{display:flex}.control-panel__nav-item{align-items:center;gap:var(--spacing-8);width:100%;min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:var(--spacing-1) solid transparent;border-radius:var(--radius);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-normal);text-align:left;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);background:0 0;display:flex}.control-panel__nav-item:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__nav-item--active{border-color:var(--body-accent-color);background:var(--card-background-accent-color);color:var(--body-accent-color);font-weight:var(--font-weight-medium)}.control-panel__nav-item--dimmed{opacity:.45}.control-panel__nav-item--dimmed:hover{opacity:1}.control-panel__nav-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.control-panel__nav-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.control-panel__nav-icon{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.control-panel__nav-badges{align-items:center;gap:var(--spacing-4);padding-left:var(--spacing-8);margin-left:auto;display:flex}.control-panel__nav-badge{min-width:18px;height:18px;padding:0 var(--spacing-4);border-radius:var(--radius-full);font-size:var(--font-size-xxs);font-weight:var(--font-weight-semibold);justify-content:center;align-items:center;line-height:1;display:inline-flex}.control-panel__nav-badge--danger{background-color:var(--button-danger-background-color);color:var(--button-danger-color)}.control-panel__nav-badge--warning{background-color:var(--button-warning-background-color);color:var(--button-warning-color)}.control-panel__nav-count{padding-left:var(--spacing-8);color:var(--body-color-muted);font-size:var(--font-size-xs);margin-left:auto}.control-panel__actions{gap:var(--spacing-8);padding:var(--spacing-16);flex-direction:column;display:flex}.control-panel__action{justify-content:flex-start}.control-panel--closed:not(.control-panel--mobile){border-right-width:0;width:0}.control-panel--closed:not(.control-panel--mobile)>*{visibility:hidden;pointer-events:none}.control-panel--mobile{border:0;border-right:var(--spacing-1) solid var(--delimiter-color);z-index:1000;min-height:0;box-shadow:var(--spacing-2) 0 var(--spacing-8) var(--box-shadow);border-radius:0;margin:0;position:fixed;top:0;bottom:0;left:0;transform:translate(-100%)}.control-panel--mobile.control-panel--open{transform:translate(0)}.control-panel--contained{position:absolute}.control-panel--flush:not(.control-panel--mobile){border-radius:0;min-height:100dvh;margin:0}.control-panel__overlay{z-index:999;background:#00000080;position:fixed;inset:0}.control-panel__overlay--contained{position:absolute}.control-panel__filters{align-items:flex-start;gap:var(--spacing-16);padding:var(--spacing-16);border-top:var(--spacing-1) solid var(--delimiter-color);flex-wrap:wrap;display:flex}.control-panel__filters-header{justify-content:space-between;align-items:center;gap:var(--spacing-12);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);flex:100%;display:flex}.control-panel__filters-heading{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__filters-count{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-6);background:var(--body-accent-color);color:var(--button-info-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.control-panel__filters-clear{color:var(--body-accent-color);cursor:pointer;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);background:0 0;border:0;padding:0}.control-panel__filters--collapsible{gap:var(--spacing-4)}.control-panel__filter{gap:var(--spacing-8);flex-direction:column;flex:100%;min-width:0;display:flex}.control-panel__filter--checkbox{flex:none}.control-panel__filter--collapsible{gap:var(--spacing-4);padding-bottom:var(--spacing-4);border-bottom:var(--spacing-1) solid var(--delimiter-color)}.control-panel__filter--collapsible:last-child{border-bottom:0;padding-bottom:0}.control-panel__filter-toggle{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-6) 0;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;font-family:inherit;display:flex}.control-panel__filter-toggle:hover .control-panel__filter-title,.control-panel__filter-toggle:hover .control-panel__filter-caret{color:var(--body-color-accent)}.control-panel__filter-toggle .control-panel__filter-title{flex:0 auto;min-width:0}.control-panel__filter-summary{min-width:0;color:var(--body-accent-color);font-size:var(--font-size-xs);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:auto;overflow:hidden}.control-panel__filter-caret{color:var(--body-color-muted);flex-shrink:0;margin-left:auto;transition:color .2s;display:inline-flex}.control-panel__filter-title{align-items:center;gap:var(--spacing-6);color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);letter-spacing:0;text-transform:uppercase;display:flex}.control-panel__filter-title--active{color:var(--body-accent-color)}.control-panel__filter-active-dot{width:var(--spacing-6);height:var(--spacing-6);background:var(--body-accent-color);border-radius:999px;flex-shrink:0}.control-panel__filter-list,.control-panel__filter-chips{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-list--inline{flex-flow:wrap}.control-panel__filter-list--inline .control-panel__filter-radio{flex:none}.control-panel__filter-list--inline .control-panel__filter-radio-label{width:auto}.control-panel__filter-chips{flex-flow:wrap}.control-panel__filter-chips-wrap{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-chip-search{width:100%}.control-panel__filter-chip-avatar{width:var(--spacing-20);height:var(--spacing-20);border-radius:var(--radius-full);object-fit:cover;margin-left:calc(var(--spacing-4) * -1);margin-right:var(--spacing-6);vertical-align:middle;flex-shrink:0}.control-panel__filter-radio{min-height:var(--spacing-40);border:var(--spacing-1) solid transparent;border-radius:var(--radius);color:var(--body-color);font-size:var(--font-size-sm);background:0 0;align-items:center;transition:background .2s,border-color .2s,color .2s;display:flex}.control-panel__filter-radio:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__filter-radio--selected{border-color:var(--body-accent-color);background:var(--card-background-accent-color);color:var(--body-accent-color)}.control-panel__filter-radio--disabled{opacity:.45;cursor:not-allowed}.control-panel__filter-radio--disabled:hover{color:var(--body-color);background:0 0}.control-panel__filter-radio--disabled .control-panel__filter-radio-label{cursor:not-allowed}.control-panel__filter-radio-label{align-items:center;gap:var(--spacing-8);width:100%;min-width:0;padding:10px var(--spacing-12);cursor:pointer;display:flex}.control-panel__filter-radio-input{opacity:0;pointer-events:none;width:0;height:0;margin:0;position:absolute}.control-panel__filter-swatch{border-radius:999px;flex-shrink:0;width:10px;height:10px}.control-panel__filter-icon{color:var(--body-color);flex-shrink:0;align-items:center;display:inline-flex}.control-panel__filter-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.control-panel__filter-count{color:var(--body-color-muted);font-size:var(--font-size-xs);text-align:right;margin-left:auto}.control-panel__filter-search,.control-panel__filter-text .input-text-wrapper,.control-panel__filter-number .input-number-wrapper{width:100%}.control-panel__filter-range{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__filter-range .input-number-wrapper{flex:1;min-width:0}.control-panel__filter-date-range{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-date-range .datepicker{width:100%;max-width:none}.control-panel__filter-date-presets{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.control-panel__filter-range-sep{color:var(--body-color-muted);flex-shrink:0}.control-panel__filter-dropdown{width:100%}.control-panel__options{gap:var(--spacing-16);padding:var(--spacing-16);flex-direction:column;display:flex}.control-panel__options-header{align-items:center;gap:var(--spacing-12);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);display:flex}.control-panel__options-heading{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__option-group{gap:var(--spacing-12);flex-direction:column;display:flex}.control-panel__option-group-label{color:var(--body-accent-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);letter-spacing:.05em;text-transform:uppercase}.control-panel__option{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__option--checkbox{align-items:flex-start}.control-panel__option--slider .slider-input{margin-bottom:0}.control-panel__option-slider-value{color:var(--body-accent-color);font-variant-numeric:tabular-nums;text-transform:none;margin-left:auto}.control-panel__option-view-toggle{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.control-panel::-webkit-scrollbar{width:var(--scrollbar-size)}.control-panel::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control-panel::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-radius)}.control-panel::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover-color)}@media (width>=769px){.control-panel{overflow-y:auto}}
1
+ .control-panel{--control-panel-width:280px;--control-panel-shadow:none;--control-panel-nav-depth:0;width:var(--control-panel-width);margin:var(--spacing-16);min-height:calc(100vh - var(--spacing-32));min-height:calc(100dvh - var(--spacing-32));background:var(--card-background-color);border:var(--spacing-1) solid var(--delimiter-color);border-radius:var(--radius);box-shadow:var(--control-panel-shadow);flex-shrink:0;transition:width .3s,transform .3s,border-color .3s;overflow-x:hidden}.control-panel__nav{gap:var(--spacing-4);padding:var(--spacing-8);border-top:var(--spacing-1) solid var(--delimiter-color);flex-direction:column;display:flex}.control-panel__nav-node{gap:var(--spacing-4);flex-direction:column;display:flex}.control-panel__nav-row{align-items:center;gap:var(--spacing-4);padding-left:calc(var(--control-panel-nav-depth) * var(--spacing-16));display:flex}.control-panel__nav-toggle,.control-panel__nav-toggle-placeholder{width:var(--spacing-24);height:var(--spacing-24);flex-shrink:0}.control-panel__nav-toggle{border-radius:var(--radius-sm);color:var(--body-color-muted);cursor:pointer;transition:background var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex}.control-panel__nav-toggle:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__nav-toggle--open{color:var(--body-accent-color);transform:rotate(90deg)}.control-panel__nav-toggle-placeholder{display:inline-block}.control-panel__nav-children{gap:var(--spacing-4);flex-direction:column;display:none}.control-panel__nav-children--open{display:flex}.control-panel__nav-item{align-items:center;gap:var(--spacing-8);width:100%;min-height:var(--spacing-40);padding:var(--spacing-8) var(--spacing-12);border:var(--spacing-1) solid transparent;border-radius:var(--radius);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-normal);text-align:left;cursor:pointer;transition:background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), opacity var(--transition-fast);background:0 0;display:flex}.control-panel__nav-item:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__nav-item--active{border-color:var(--body-accent-color);background:var(--card-background-accent-color);color:var(--body-accent-color);font-weight:var(--font-weight-medium)}.control-panel__nav-item--dimmed{opacity:.45}.control-panel__nav-item--dimmed:hover{opacity:1}.control-panel__nav-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.control-panel__nav-dot{border-radius:50%;flex-shrink:0;width:8px;height:8px}.control-panel__nav-icon{flex-shrink:0;justify-content:center;align-items:center;display:inline-flex}.control-panel__nav-badges{align-items:center;gap:var(--spacing-4);padding-left:var(--spacing-8);margin-left:auto;display:flex}.control-panel__nav-badge{min-width:18px;height:18px;padding:0 var(--spacing-4);border-radius:var(--radius-full);font-size:var(--font-size-xxs);font-weight:var(--font-weight-semibold);justify-content:center;align-items:center;line-height:1;display:inline-flex}.control-panel__nav-badge--danger{background-color:var(--button-danger-background-color);color:var(--button-danger-color)}.control-panel__nav-badge--warning{background-color:var(--button-warning-background-color);color:var(--button-warning-color)}.control-panel__nav-count{padding-left:var(--spacing-8);color:var(--body-color-muted);font-size:var(--font-size-xs);margin-left:auto}.control-panel__actions{gap:var(--spacing-8);padding:var(--spacing-16);flex-direction:column;display:flex}.control-panel__action{justify-content:flex-start}.control-panel--closed:not(.control-panel--mobile){border-right-width:0;width:0}.control-panel--closed:not(.control-panel--mobile)>*{visibility:hidden;pointer-events:none}.control-panel--mobile{border:0;border-right:var(--spacing-1) solid var(--delimiter-color);z-index:1000;min-height:0;box-shadow:var(--spacing-2) 0 var(--spacing-8) var(--box-shadow);border-radius:0;margin:0;position:fixed;top:0;bottom:0;left:0;transform:translate(-100%)}.control-panel--mobile.control-panel--open{transform:translate(0)}.control-panel--contained{position:absolute}.control-panel--flush:not(.control-panel--mobile){border-radius:0;min-height:100dvh;margin:0}.control-panel__overlay{z-index:999;background:#00000080;position:fixed;inset:0}.control-panel__overlay--contained{position:absolute}.control-panel__filters{align-items:flex-start;gap:var(--spacing-16);padding:var(--spacing-16);border-top:var(--spacing-1) solid var(--delimiter-color);flex-wrap:wrap;display:flex}.control-panel__filters-header{justify-content:space-between;align-items:center;gap:var(--spacing-12);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);flex:100%;display:flex}.control-panel__filters-heading{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__filters-count{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-6);background:var(--body-accent-color);color:var(--button-info-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);border-radius:999px;justify-content:center;align-items:center;display:inline-flex}.control-panel__filters-clear{color:var(--body-accent-color);cursor:pointer;font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);background:0 0;border:0;padding:0}.control-panel__filters--collapsible{gap:var(--spacing-4)}.control-panel__filter{gap:var(--spacing-8);flex-direction:column;flex:100%;min-width:0;display:flex}.control-panel__filter--checkbox{flex:none}.control-panel__filter--collapsible{gap:var(--spacing-4);padding-bottom:var(--spacing-4);border-bottom:var(--spacing-1) solid var(--delimiter-color)}.control-panel__filter--collapsible:last-child{border-bottom:0;padding-bottom:0}.control-panel__filter-toggle{align-items:center;gap:var(--spacing-8);width:100%;padding:var(--spacing-6) 0;color:inherit;cursor:pointer;text-align:left;background:0 0;border:0;font-family:inherit;display:flex}.control-panel__filter-toggle:hover .control-panel__filter-title,.control-panel__filter-toggle:hover .control-panel__filter-caret{color:var(--body-color-accent)}.control-panel__filter-toggle .control-panel__filter-title{flex:0 auto;min-width:0}.control-panel__filter-summary{min-width:0;color:var(--body-accent-color);font-size:var(--font-size-xs);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:auto;overflow:hidden}.control-panel__filter-caret{color:var(--body-color-muted);flex-shrink:0;margin-left:auto;transition:color .2s;display:inline-flex}.control-panel__filter-title{align-items:center;gap:var(--spacing-6);color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);letter-spacing:0;text-transform:uppercase;display:flex}.control-panel__filter-title--active{color:var(--body-accent-color)}.control-panel__filter-active-dot{width:var(--spacing-6);height:var(--spacing-6);background:var(--body-accent-color);border-radius:999px;flex-shrink:0}.control-panel__filter-list,.control-panel__filter-chips{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-list--inline{flex-flow:wrap}.control-panel__filter-list--inline .control-panel__filter-radio{flex:none}.control-panel__filter-list--inline .control-panel__filter-radio-label{width:auto}.control-panel__filter-chips{flex-flow:wrap}.control-panel__filter-chips-wrap{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-chip-search{width:100%}.control-panel__filter-chip-avatar{width:var(--spacing-20);height:var(--spacing-20);border-radius:var(--radius-full);object-fit:cover;margin-left:calc(var(--spacing-4) * -1);margin-right:var(--spacing-6);vertical-align:middle;flex-shrink:0}.control-panel__filter-radio{min-height:var(--spacing-40);border:var(--spacing-1) solid transparent;border-radius:var(--radius);color:var(--body-color);font-size:var(--font-size-sm);background:0 0;align-items:center;transition:background .2s,border-color .2s,color .2s;display:flex}.control-panel__filter-radio:hover{background:var(--card-background-accent-color);color:var(--body-color-accent)}.control-panel__filter-radio--selected{border-color:var(--body-accent-color);background:var(--card-background-accent-color);color:var(--body-accent-color)}.control-panel__filter-radio--disabled{opacity:.45;cursor:not-allowed}.control-panel__filter-radio--disabled:hover{color:var(--body-color);background:0 0}.control-panel__filter-radio--disabled .control-panel__filter-radio-label{cursor:not-allowed}.control-panel__filter-radio--stale,.control-panel__filter-radio--stale:hover{border-style:dashed;border-color:var(--button-warning-background-color);color:var(--button-warning-background-color)}.control-panel__filter-chip--stale.chip{border-style:dashed}.control-panel__filter-option--stale .dropdown-option-content{color:var(--button-warning-background-color)}.control-panel__filter-radio-label{align-items:center;gap:var(--spacing-8);width:100%;min-width:0;padding:10px var(--spacing-12);cursor:pointer;display:flex}.control-panel__filter-radio-input{opacity:0;pointer-events:none;width:0;height:0;margin:0;position:absolute}.control-panel__filter-swatch{border-radius:999px;flex-shrink:0;width:10px;height:10px}.control-panel__filter-icon{color:var(--body-color);flex-shrink:0;align-items:center;display:inline-flex}.control-panel__filter-label{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.control-panel__filter-count{color:var(--body-color-muted);font-size:var(--font-size-xs);text-align:right;margin-left:auto}.control-panel__filter-search,.control-panel__filter-text .input-text-wrapper,.control-panel__filter-number .input-number-wrapper{width:100%}.control-panel__filter-range{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__filter-range .input-number-wrapper{flex:1;min-width:0}.control-panel__filter-date-range{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__filter-date-range .datepicker{width:100%;max-width:none}.control-panel__filter-date-presets{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.control-panel__filter-range-sep{color:var(--body-color-muted);flex-shrink:0}.control-panel__filter-dropdown{width:100%}.control-panel__options{gap:var(--spacing-16);padding:var(--spacing-16);flex-direction:column;display:flex}.control-panel__options-header{align-items:center;gap:var(--spacing-12);color:var(--body-color);font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);display:flex}.control-panel__options-heading{align-items:center;gap:var(--spacing-8);display:flex}.control-panel__option-group{gap:var(--spacing-12);flex-direction:column;display:flex}.control-panel__option-group-label{color:var(--body-accent-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);letter-spacing:.05em;text-transform:uppercase}.control-panel__option{gap:var(--spacing-8);flex-direction:column;display:flex}.control-panel__option--checkbox{align-items:flex-start}.control-panel__option--slider .slider-input{margin-bottom:0}.control-panel__option-slider-value{color:var(--body-accent-color);font-variant-numeric:tabular-nums;text-transform:none;margin-left:auto}.control-panel__option-view-toggle{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.control-panel::-webkit-scrollbar{width:var(--scrollbar-size)}.control-panel::-webkit-scrollbar-track{background:var(--scrollbar-track-color)}.control-panel::-webkit-scrollbar-thumb{background:var(--scrollbar-thumb-color);border-radius:var(--scrollbar-radius)}.control-panel::-webkit-scrollbar-thumb:hover{background:var(--scrollbar-thumb-hover-color)}@media (width>=769px){.control-panel{overflow-y:auto}}
@@ -1,102 +1,142 @@
1
1
  import { Icon as b } from "../Icon/Icon2.js";
2
- import { Button as C } from "../Button/Button2.js";
3
- import { Tooltip as k } from "../Tooltip/Tooltip2.js";
4
- import { Chip as S } from "../Chip/Chip2.js";
5
- import { InputNumber as x } from "../InputNumber/InputNumber2.js";
6
- import { InputText as w } from "../InputText/InputText2.js";
7
- import { DatePicker as R } from "../DatePicker/DatePicker2.js";
8
- import { Dropdown as E } from "../Dropdown/Dropdown2.js";
9
- import { InputDate as L } from "../InputDate/InputDate2.js";
10
- import { InputSearch as D } from "../InputSearch/InputSearch2.js";
11
- import { Rating as M } from "../Rating/Rating2.js";
12
- import { DEFAULT_DATE_RANGE_PRESETS as T } from "./ControlPanel.types.js";
13
- import { Fragment as P, useEffect as V, useRef as j, useState as A } from "react";
14
- import { jsx as n, jsxs as _ } from "react/jsx-runtime";
15
- var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], I = (e) => e.every((r) => typeof r == "number") ? e : e.map(String), N = 2, U = (e) => {
16
- const r = e.options ?? [];
17
- return f(e.value).map((o) => r.find((t) => t.value === o)?.label ?? String(o));
18
- }, B = (e) => {
19
- const { type: r, value: o } = e;
20
- if (o == null || o === "") return;
21
- if (r === "checkbox") return o === !0 ? "On" : void 0;
22
- if (r === "range") {
23
- const [s, d] = Array.isArray(o) ? o : [];
24
- return s === void 0 && d === void 0 ? void 0 : s === void 0 ? `≤ ${d}` : d === void 0 ? `≥ ${s}` : `${s} – ${d}`;
2
+ import { Button as V } from "../Button/Button2.js";
3
+ import { Tooltip as A } from "../Tooltip/Tooltip2.js";
4
+ import { Chip as f } from "../Chip/Chip2.js";
5
+ import { InputNumber as D } from "../InputNumber/InputNumber2.js";
6
+ import { InputText as j } from "../InputText/InputText2.js";
7
+ import { DatePicker as H } from "../DatePicker/DatePicker2.js";
8
+ import { Dropdown as O } from "../Dropdown/Dropdown2.js";
9
+ import { InputDate as U } from "../InputDate/InputDate2.js";
10
+ import { InputSearch as L } from "../InputSearch/InputSearch2.js";
11
+ import { Rating as B } from "../Rating/Rating2.js";
12
+ import { DEFAULT_DATE_RANGE_PRESETS as Y } from "./ControlPanel.types.js";
13
+ import { Fragment as R, useEffect as z, useMemo as E, useRef as G, useState as k } from "react";
14
+ import { jsx as n, jsxs as v } from "react/jsx-runtime";
15
+ var W = 3, C = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], $ = (e) => e.every((l) => typeof l == "number") ? e : e.map(String), y = (e, l) => String(e) === String(l), M = "No longer available. Click to remove.", q = (e, l) => e.filter((t) => t !== "" && !l.some((o) => y(o.value, t))).map((t) => ({
16
+ className: "control-panel__filter-option--stale",
17
+ details: "No longer available",
18
+ icon: "warning",
19
+ label: String(t),
20
+ value: t
21
+ })), w = 2, J = (e) => {
22
+ const l = e.options ?? [];
23
+ return C(e.value).map((t) => l.find((o) => y(o.value, t))?.label ?? String(t));
24
+ }, K = (e) => {
25
+ const { type: l, value: t } = e;
26
+ if (t == null || t === "") return;
27
+ if (l === "checkbox") return t === !0 ? "On" : void 0;
28
+ if (l === "range") {
29
+ const [c, i] = Array.isArray(t) ? t : [];
30
+ return c === void 0 && i === void 0 ? void 0 : c === void 0 ? `≤ ${i}` : i === void 0 ? `≥ ${c}` : `${c} – ${i}`;
25
31
  }
26
- if (r === "date-range") {
27
- const [s, d] = Array.isArray(o) ? o : [];
28
- return !s && !d ? void 0 : s ? d ? `${s} → ${d}` : `from ${s}` : `until ${d}`;
32
+ if (l === "date-range") {
33
+ const [c, i] = Array.isArray(t) ? t : [];
34
+ return !c && !i ? void 0 : c ? i ? `${c} → ${i}` : `from ${c}` : `until ${i}`;
29
35
  }
30
- if (r === "rating") return typeof o == "number" && o > 0 ? String(o) : void 0;
31
- if (r === "text" || r === "search" || r === "date" || r === "number") return String(o);
32
- const t = U(e);
33
- if (t.length !== 0)
34
- return t.length <= N ? t.join(", ") : `${t.slice(0, N).join(", ")} +${t.length - N}`;
35
- }, te = ({ filter: e, collapsible: r = !1, onChange: o }) => {
36
- const t = r && e.type !== "checkbox", [s, d] = A(e.defaultExpanded ?? !1), a = e.summary ?? B(e), i = /* @__PURE__ */ _("span", {
36
+ if (l === "rating") return typeof t == "number" && t > 0 ? String(t) : void 0;
37
+ if (l === "text" || l === "search" || l === "date" || l === "number") return String(t);
38
+ const o = J(e);
39
+ if (o.length !== 0)
40
+ return o.length <= w ? o.join(", ") : `${o.slice(0, w).join(", ")} +${o.length - w}`;
41
+ }, me = ({ filter: e, collapsible: l = !1, onChange: t }) => {
42
+ const o = l && e.type !== "checkbox", [c, i] = k(e.defaultExpanded ?? !1), _ = e.summary ?? K(e), N = /* @__PURE__ */ v("span", {
37
43
  className: `control-panel__filter-title${e.isActive ? " control-panel__filter-title--active" : ""}`,
38
44
  children: [
39
45
  e.isActive && /* @__PURE__ */ n("span", { className: "control-panel__filter-active-dot" }),
40
46
  e.icon && /* @__PURE__ */ n(b, { name: e.icon }),
41
47
  e.label
42
48
  ]
43
- }), l = [
49
+ }), I = [
44
50
  "control-panel__filter",
45
51
  e.type === "checkbox" ? "control-panel__filter--checkbox" : "",
46
- t ? "control-panel__filter--collapsible" : "",
47
- t && !s ? "control-panel__filter--collapsed" : ""
52
+ o ? "control-panel__filter--collapsible" : "",
53
+ o && !c ? "control-panel__filter--collapsed" : ""
48
54
  ].filter(Boolean).join(" ");
49
- return /* @__PURE__ */ _("div", {
50
- className: l,
51
- children: [t ? /* @__PURE__ */ _("button", {
55
+ return /* @__PURE__ */ v("div", {
56
+ className: I,
57
+ children: [o ? /* @__PURE__ */ v("button", {
52
58
  className: "control-panel__filter-toggle",
53
59
  type: "button",
54
- onClick: () => d((p) => !p),
60
+ onClick: () => i((a) => !a),
55
61
  children: [
56
- i,
57
- !s && a && /* @__PURE__ */ n("span", {
62
+ N,
63
+ !c && _ && /* @__PURE__ */ n("span", {
58
64
  className: "control-panel__filter-summary",
59
- children: a
65
+ children: _
60
66
  }),
61
67
  /* @__PURE__ */ n("span", {
62
68
  className: "control-panel__filter-caret",
63
- children: /* @__PURE__ */ n(b, { name: s ? "caret-up" : "caret-down" })
69
+ children: /* @__PURE__ */ n(b, { name: c ? "caret-up" : "caret-down" })
64
70
  })
65
71
  ]
66
- }) : e.type !== "checkbox" && i, (!t || s) && /* @__PURE__ */ n(z, {
72
+ }) : e.type !== "checkbox" && N, (!o || c) && /* @__PURE__ */ n(X, {
67
73
  filter: e,
68
- onChange: o
74
+ onChange: t
69
75
  })]
70
76
  });
71
- }, Y = ({ placeholder: e, value: r, onChange: o }) => {
72
- const [t, s] = A(r), d = j(r);
73
- return V(() => {
74
- r !== d.current && (d.current = r, s(r));
75
- }, [r]), /* @__PURE__ */ n(D, {
77
+ }, Q = ({ placeholder: e, value: l, onChange: t }) => {
78
+ const [o, c] = k(l), i = G(l);
79
+ return z(() => {
80
+ l !== i.current && (i.current = l, c(l));
81
+ }, [l]), /* @__PURE__ */ n(L, {
76
82
  className: "control-panel__filter-search",
77
- onChange: (a) => {
78
- d.current = a, s(a), o(a);
83
+ onChange: (_) => {
84
+ i.current = _, c(_), t(_);
79
85
  },
80
86
  placeholder: e,
81
- value: t
87
+ value: o
82
88
  });
83
- }, z = ({ filter: e, onChange: r }) => {
84
- const o = f(e.value), t = e.options ?? [], [s, d] = A("");
85
- if (e.type === "checkbox") return /* @__PURE__ */ n(S, {
89
+ }, T = ({ option: e, onRemove: l }) => /* @__PURE__ */ n(A, {
90
+ title: M,
91
+ children: /* @__PURE__ */ n("div", {
92
+ className: "control-panel__filter-radio control-panel__filter-radio--selected control-panel__filter-radio--stale",
93
+ children: /* @__PURE__ */ v("label", {
94
+ className: "control-panel__filter-radio-label",
95
+ children: [
96
+ /* @__PURE__ */ n("input", {
97
+ checked: !0,
98
+ className: "control-panel__filter-radio-input",
99
+ onChange: l,
100
+ type: "checkbox"
101
+ }),
102
+ /* @__PURE__ */ n(b, {
103
+ className: "control-panel__filter-icon",
104
+ name: "warning"
105
+ }),
106
+ /* @__PURE__ */ n("span", {
107
+ className: "control-panel__filter-label",
108
+ children: e.label
109
+ }),
110
+ /* @__PURE__ */ n(b, {
111
+ className: "control-panel__filter-icon",
112
+ name: "clear"
113
+ })
114
+ ]
115
+ })
116
+ })
117
+ }), X = ({ filter: e, onChange: l }) => {
118
+ const t = C(e.value), o = e.options ?? [], c = E(() => q(C(e.value), e.options ?? []), [e.value, e.options]), i = E(() => c.length > 0 ? [...c, ...e.options ?? []] : e.options ?? [], [c, e.options]), _ = () => l({
119
+ filterId: e.id,
120
+ type: e.type,
121
+ value: null,
122
+ option: null,
123
+ options: []
124
+ }), [N, I] = k("");
125
+ if (e.type === "checkbox") return /* @__PURE__ */ n(f, {
86
126
  count: e.count,
87
127
  selected: e.value === !0,
88
- onClick: () => r({
128
+ onClick: () => l({
89
129
  filterId: e.id,
90
130
  type: e.type,
91
131
  value: e.value !== !0
92
132
  }),
93
133
  children: e.label
94
134
  });
95
- if (e.type === "date") return /* @__PURE__ */ n(L, {
135
+ if (e.type === "date") return /* @__PURE__ */ n(U, {
96
136
  min: e.minDate,
97
137
  max: e.maxDate,
98
138
  value: typeof e.value == "string" ? e.value : "",
99
- onChange: (a) => r({
139
+ onChange: (a) => l({
100
140
  filterId: e.id,
101
141
  type: e.type,
102
142
  value: a ?? null
@@ -104,8 +144,8 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
104
144
  });
105
145
  if (e.type === "text") return /* @__PURE__ */ n("div", {
106
146
  className: "control-panel__filter-text",
107
- children: /* @__PURE__ */ n(w, {
108
- onChange: (a) => r({
147
+ children: /* @__PURE__ */ n(j, {
148
+ onChange: (a) => l({
109
149
  filterId: e.id,
110
150
  type: e.type,
111
151
  value: a
@@ -114,10 +154,10 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
114
154
  value: typeof e.value == "string" ? e.value : ""
115
155
  })
116
156
  });
117
- if (e.type === "search") return /* @__PURE__ */ n(Y, {
157
+ if (e.type === "search") return /* @__PURE__ */ n(Q, {
118
158
  placeholder: e.placeholder,
119
159
  value: typeof e.value == "string" ? e.value : "",
120
- onChange: (a) => r({
160
+ onChange: (a) => l({
121
161
  filterId: e.id,
122
162
  type: e.type,
123
163
  value: a
@@ -125,124 +165,127 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
125
165
  });
126
166
  if (e.type === "number") return /* @__PURE__ */ n("div", {
127
167
  className: "control-panel__filter-number",
128
- children: /* @__PURE__ */ n(x, {
168
+ children: /* @__PURE__ */ n(D, {
129
169
  min: e.min,
130
170
  max: e.max,
131
171
  step: e.step,
132
172
  placeholder: e.placeholder,
133
173
  value: typeof e.value == "number" ? e.value : void 0,
134
- onChange: (a) => r({
174
+ onChange: (a) => l({
135
175
  filterId: e.id,
136
176
  type: e.type,
137
177
  value: a ?? null
138
178
  })
139
179
  })
140
180
  });
141
- if (e.type === "rating") return /* @__PURE__ */ n(M, {
181
+ if (e.type === "rating") return /* @__PURE__ */ n(B, {
142
182
  selectable: !0,
143
183
  icon: e.ratingIcon ?? "star",
144
184
  maxRate: e.maxRate ?? 10,
145
185
  rating: typeof e.value == "number" ? e.value : 0,
146
186
  variant: e.ratingVariant ?? "warning",
147
- onSelect: (a) => r({
187
+ onSelect: (a) => l({
148
188
  filterId: e.id,
149
189
  type: e.type,
150
190
  value: a
151
191
  })
152
192
  });
153
193
  if (e.type === "range") {
154
- const a = Array.isArray(e.value) ? e.value : [], i = a[0], l = a[1], p = i !== void 0 && l !== void 0 && i > l, m = (u, v) => r({
194
+ const a = Array.isArray(e.value) ? e.value : [], d = a[0], r = a[1], m = d !== void 0 && r !== void 0 && d > r, u = (p, h) => l({
155
195
  filterId: e.id,
156
196
  type: e.type,
157
- value: [u, v]
197
+ value: [p, h]
158
198
  });
159
- return /* @__PURE__ */ _("div", {
199
+ return /* @__PURE__ */ v("div", {
160
200
  className: "control-panel__filter-range",
161
201
  children: [
162
- /* @__PURE__ */ n(x, {
202
+ /* @__PURE__ */ n(D, {
163
203
  min: e.min,
164
204
  max: e.max,
165
205
  step: e.step,
166
206
  placeholder: "Min",
167
- value: i,
168
- error: p ? "Min exceeds max" : void 0,
169
- onChange: (u) => m(u, l)
207
+ value: d,
208
+ error: m ? "Min exceeds max" : void 0,
209
+ onChange: (p) => u(p, r)
170
210
  }),
171
211
  /* @__PURE__ */ n("span", {
172
212
  className: "control-panel__filter-range-sep",
173
213
  children: "—"
174
214
  }),
175
- /* @__PURE__ */ n(x, {
215
+ /* @__PURE__ */ n(D, {
176
216
  min: e.min,
177
217
  max: e.max,
178
218
  step: e.step,
179
219
  placeholder: "Max",
180
- value: l,
181
- error: p ? "Max is below min" : void 0,
182
- onChange: (u) => m(i, u)
220
+ value: r,
221
+ error: m ? "Max is below min" : void 0,
222
+ onChange: (p) => u(d, p)
183
223
  })
184
224
  ]
185
225
  });
186
226
  }
187
227
  if (e.type === "date-range") {
188
- const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, p = e.presets ?? T, m = (c) => {
189
- if (!c) return;
190
- const [h, g, $] = c.split("-").map(Number);
191
- return new Date(h, g - 1, $);
192
- }, u = (c) => `${c.getFullYear()}-${String(c.getMonth() + 1).padStart(2, "0")}-${String(c.getDate()).padStart(2, "0")}`, v = (c, h) => r({
228
+ const a = Array.isArray(e.value) ? e.value : [], d = a[0] || void 0, r = a[1] || void 0, m = e.presets ?? Y, u = (s) => {
229
+ if (!s) return;
230
+ const [g, S, P] = s.split("-").map(Number);
231
+ return new Date(g, S - 1, P);
232
+ }, p = (s) => `${s.getFullYear()}-${String(s.getMonth() + 1).padStart(2, "0")}-${String(s.getDate()).padStart(2, "0")}`, h = (s, g) => l({
193
233
  filterId: e.id,
194
234
  type: e.type,
195
- value: [c ?? "", h ?? ""]
196
- }), y = (c) => {
197
- const h = e.maxDate ? m(e.maxDate) : /* @__PURE__ */ new Date();
198
- if (!h) return;
199
- const g = new Date(h);
200
- g.setDate(g.getDate() - c), v(u(g), u(h));
235
+ value: [s ?? "", g ?? ""]
236
+ }), x = (s) => {
237
+ const g = e.maxDate ? u(e.maxDate) : /* @__PURE__ */ new Date();
238
+ if (!g) return;
239
+ const S = new Date(g);
240
+ S.setDate(S.getDate() - s), h(p(S), p(g));
201
241
  };
202
- return /* @__PURE__ */ _("div", {
242
+ return /* @__PURE__ */ v("div", {
203
243
  className: "control-panel__filter-date-range",
204
- children: [p.length > 0 && /* @__PURE__ */ n("div", {
244
+ children: [m.length > 0 && /* @__PURE__ */ n("div", {
205
245
  className: "control-panel__filter-date-presets",
206
- children: p.map((c) => /* @__PURE__ */ n(C, {
246
+ children: m.map((s) => /* @__PURE__ */ n(V, {
207
247
  size: "small",
208
248
  variant: "default",
209
- onClick: () => y(c.days),
210
- children: c.label
211
- }, c.days))
212
- }), /* @__PURE__ */ n(R, {
249
+ onClick: () => x(s.days),
250
+ children: s.label
251
+ }, s.days))
252
+ }), /* @__PURE__ */ n(H, {
213
253
  mode: "range",
214
- minDate: m(e.minDate),
215
- maxDate: m(e.maxDate),
254
+ minDate: u(e.minDate),
255
+ maxDate: u(e.maxDate),
216
256
  placeholder: e.placeholder ?? "Select range",
217
- value: i && l ? {
218
- start: m(i),
219
- end: m(l)
257
+ value: d && r ? {
258
+ start: u(d),
259
+ end: u(r)
220
260
  } : void 0,
221
- onChange: (c) => {
222
- if (c && typeof c == "object" && !Array.isArray(c) && "start" in c) {
223
- v(u(c.start), u(c.end));
261
+ onChange: (s) => {
262
+ if (s && typeof s == "object" && !Array.isArray(s) && "start" in s) {
263
+ h(p(s.start), p(s.end));
224
264
  return;
225
265
  }
226
- v(void 0, void 0);
266
+ h(void 0, void 0);
227
267
  }
228
268
  })]
229
269
  });
230
270
  }
231
271
  if (e.type === "dropdown")
232
- return !e.multiple && t.length > 0 && t.length <= H ? /* @__PURE__ */ n("div", {
272
+ return !e.multiple && o.length > 0 && o.length <= W ? /* @__PURE__ */ v("div", {
233
273
  className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
234
- children: t.map((a) => {
235
- const i = e.value === a.value;
274
+ children: [c.map((a) => /* @__PURE__ */ n(T, {
275
+ option: a,
276
+ onRemove: _
277
+ }, `stale-${a.value}`)), o.map((a) => {
278
+ const d = t.some((r) => y(r, a.value));
236
279
  return /* @__PURE__ */ n("div", {
237
- className: `control-panel__filter-radio ${i ? "control-panel__filter-radio--selected" : ""}`,
238
- children: /* @__PURE__ */ _("label", {
280
+ className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""}`,
281
+ children: /* @__PURE__ */ v("label", {
239
282
  className: "control-panel__filter-radio-label",
240
283
  children: [
241
284
  /* @__PURE__ */ n("input", {
242
- checked: i,
285
+ checked: d,
243
286
  className: "control-panel__filter-radio-input",
244
287
  name: e.id,
245
- onChange: () => r({
288
+ onChange: () => l({
246
289
  filterId: e.id,
247
290
  type: e.type,
248
291
  value: a.value,
@@ -268,22 +311,22 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
268
311
  ]
269
312
  })
270
313
  }, a.value);
271
- })
272
- }) : /* @__PURE__ */ n(E, {
314
+ })]
315
+ }) : /* @__PURE__ */ n(O, {
273
316
  className: "control-panel__filter-dropdown",
274
317
  multiple: e.multiple,
275
318
  name: e.id,
276
319
  onChange: (a) => {
277
- const i = Array.isArray(a) ? a : a ? [a] : [];
278
- r({
320
+ const d = Array.isArray(a) ? a : a ? [a] : [];
321
+ l({
279
322
  filterId: e.id,
280
323
  type: e.type,
281
- value: Array.isArray(a) ? I(a.map((l) => l.value)) : a?.value ?? null,
324
+ value: Array.isArray(a) ? $(a.map((r) => r.value)) : a?.value ?? null,
282
325
  option: Array.isArray(a) ? null : a,
283
- options: i
326
+ options: d
284
327
  });
285
328
  },
286
- options: t,
329
+ options: i,
287
330
  placeholder: e.placeholder,
288
331
  searchable: e.searchable ?? !0,
289
332
  selectedCountDisplay: "inline",
@@ -291,68 +334,88 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
291
334
  value: typeof e.value == "boolean" ? null : e.value
292
335
  });
293
336
  if (e.type === "chips") {
294
- const a = s.trim().toLowerCase(), i = e.searchable && a ? t.filter((l) => l.label.toLowerCase().includes(a)) : t;
295
- return /* @__PURE__ */ _("div", {
337
+ const a = N.trim().toLowerCase(), d = e.searchable && a ? o.filter((r) => r.label.toLowerCase().includes(a)) : o;
338
+ return /* @__PURE__ */ v("div", {
296
339
  className: "control-panel__filter-chips-wrap",
297
- children: [e.searchable && t.length > 0 && /* @__PURE__ */ n(D, {
340
+ children: [e.searchable && o.length > 0 && /* @__PURE__ */ n(L, {
298
341
  className: "control-panel__filter-chip-search",
299
- value: s,
300
- onChange: d,
342
+ value: N,
343
+ onChange: I,
301
344
  placeholder: e.placeholder ?? "Filter..."
302
- }), /* @__PURE__ */ n("div", {
345
+ }), /* @__PURE__ */ v("div", {
303
346
  className: "control-panel__filter-chips",
304
347
  style: e.maxHeight !== void 0 ? {
305
348
  maxHeight: typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight,
306
349
  overflowY: "auto"
307
350
  } : void 0,
308
- children: i.map((l) => {
309
- const p = o.includes(l.value), m = /* @__PURE__ */ _(S, {
310
- color: l.color,
311
- count: l.count,
312
- disabled: l.disabled,
313
- icon: l.icon,
314
- selected: p,
351
+ children: [c.map((r) => /* @__PURE__ */ n(A, {
352
+ title: M,
353
+ children: /* @__PURE__ */ n(f, {
354
+ className: "control-panel__filter-chip--stale",
355
+ icon: "warning",
356
+ selected: !0,
357
+ variant: "warning",
315
358
  onClick: () => {
316
- if (l.disabled) return;
317
- const u = e.multiple === !1, v = u ? p ? [] : [l.value] : p ? o.filter((y) => y !== l.value) : [...o, l.value];
318
- r({
359
+ const m = t.filter((u) => !y(u, r.value));
360
+ l({
319
361
  filterId: e.id,
320
362
  type: e.type,
321
- value: u ? v[0] ?? null : I(v),
322
- option: l,
323
- options: t.filter((y) => v.includes(y.value))
363
+ value: e.multiple === !1 ? null : $(m),
364
+ option: null,
365
+ options: o.filter((u) => m.some((p) => y(p, u.value)))
324
366
  });
325
367
  },
326
- children: [l.imageUrl && /* @__PURE__ */ n("img", {
368
+ children: r.label
369
+ })
370
+ }, `stale-${r.value}`)), d.map((r) => {
371
+ const m = t.some((p) => y(p, r.value)), u = /* @__PURE__ */ v(f, {
372
+ color: r.color,
373
+ count: r.count,
374
+ disabled: r.disabled,
375
+ icon: r.icon,
376
+ selected: m,
377
+ onClick: () => {
378
+ if (r.disabled) return;
379
+ const p = e.multiple === !1, h = p ? m ? [] : [r.value] : m ? t.filter((x) => !y(x, r.value)) : [...t, r.value];
380
+ l({
381
+ filterId: e.id,
382
+ type: e.type,
383
+ value: p ? h[0] ?? null : $(h),
384
+ option: r,
385
+ options: o.filter((x) => h.some((s) => y(s, x.value)))
386
+ });
387
+ },
388
+ children: [r.imageUrl && /* @__PURE__ */ n("img", {
327
389
  className: "control-panel__filter-chip-avatar",
328
- src: l.imageUrl,
390
+ src: r.imageUrl,
329
391
  alt: ""
330
- }), l.label]
392
+ }), r.label]
331
393
  });
332
- return l.tooltip ? /* @__PURE__ */ n(k, {
333
- title: l.tooltip,
334
- children: m
335
- }, l.value) : /* @__PURE__ */ n(P, { children: m }, l.value);
336
- })
394
+ return r.tooltip ? /* @__PURE__ */ n(A, {
395
+ title: r.tooltip,
396
+ children: u
397
+ }, r.value) : /* @__PURE__ */ n(R, { children: u }, r.value);
398
+ })]
337
399
  })]
338
400
  });
339
401
  }
340
- return /* @__PURE__ */ n("div", {
402
+ return /* @__PURE__ */ v("div", {
341
403
  className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
342
- children: t.map((a) => {
343
- const i = e.value === a.value;
344
- return /* @__PURE__ */ n("div", {
345
- className: `control-panel__filter-radio ${i ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
346
- title: a.tooltip,
347
- children: /* @__PURE__ */ _("label", {
404
+ children: [c.map((a) => /* @__PURE__ */ n(T, {
405
+ option: a,
406
+ onRemove: _
407
+ }, `stale-${a.value}`)), o.map((a) => {
408
+ const d = t.some((m) => y(m, a.value)), r = /* @__PURE__ */ n("div", {
409
+ className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
410
+ children: /* @__PURE__ */ v("label", {
348
411
  className: "control-panel__filter-radio-label",
349
412
  children: [
350
413
  /* @__PURE__ */ n("input", {
351
- checked: i,
414
+ checked: d,
352
415
  className: "control-panel__filter-radio-input",
353
416
  disabled: a.disabled,
354
417
  name: e.id,
355
- onChange: () => r({
418
+ onChange: () => l({
356
419
  filterId: e.id,
357
420
  type: e.type,
358
421
  value: a.value,
@@ -380,10 +443,14 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
380
443
  })
381
444
  ]
382
445
  })
383
- }, a.value);
384
- })
446
+ });
447
+ return a.tooltip ? /* @__PURE__ */ n(A, {
448
+ title: a.tooltip,
449
+ children: r
450
+ }, a.value) : /* @__PURE__ */ n(R, { children: r }, a.value);
451
+ })]
385
452
  });
386
453
  };
387
454
  export {
388
- te as ControlPanelFilterItem
455
+ me as ControlPanelFilterItem
389
456
  };
@@ -1,28 +1,28 @@
1
1
  import './Dropdown.css';
2
- import { Icon as D } from "../Icon/Icon2.js";
3
- import { Button as ae } from "../Button/Button2.js";
2
+ import { Icon as R } from "../Icon/Icon2.js";
3
+ import { Button as fe } from "../Button/Button2.js";
4
4
  import { Tooltip as je } from "../Tooltip/Tooltip2.js";
5
5
  import { InputText as Ce } from "../InputText/InputText2.js";
6
6
  import { foldDiacritics as pe } from "../../helpers/Search.js";
7
7
  /* empty css */
8
- import { useEffect as k, useId as _e, useRef as L, useState as O } from "react";
8
+ import { useEffect as k, useId as _e, useRef as L, useState as S } from "react";
9
9
  import { jsx as c, jsxs as g } from "react/jsx-runtime";
10
10
  import { createPortal as ze } from "react-dom";
11
11
  import { caretDown as Fe, clear as ue } from "@memobit/icons";
12
- var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", disabled: x = !1, error: A, highlighted: me = !1, id: ge, label: J, maxVisibleSelectedLabels: ve = 1, multilineChips: be = !1, multiple: i = !1, name: N, onChange: u, onSearchChange: xe, options: m, placeholder: H = "Select an option", searchable: a = !0, searchValue: M, selectedCountDisplay: j = "inline", showChips: C = !1, sortSelectedFirst: Q = !1, success: _, usePortal: $ = !0, value: d, valueAsChip: Ne = !0 }) => {
13
- const [p, v] = O(!1), [s, l] = O(M || ""), [f, X] = O(m), [S, y] = O(-1), [o, w] = O([]), [R, $e] = O({
12
+ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", disabled: x = !1, error: A, highlighted: me = !1, id: ge, label: J, maxVisibleSelectedLabels: ve = 1, multilineChips: be = !1, multiple: i = !1, name: N, onChange: u, onSearchChange: xe, options: m, placeholder: H = "Select an option", searchable: f = !0, searchValue: T, selectedCountDisplay: j = "inline", showChips: C = !1, sortSelectedFirst: Q = !1, success: _, usePortal: $ = !0, value: d, valueAsChip: Ne = !0 }) => {
13
+ const [p, v] = S(!1), [s, l] = S(T || ""), [a, X] = S(m), [O, y] = S(-1), [r, w] = S([]), [B, $e] = S({
14
14
  top: 0,
15
15
  bottom: 0,
16
16
  left: 0,
17
17
  width: 0,
18
18
  maxHeight: 300
19
- }), [z, ke] = O(!1), I = L(null), E = L([]), F = L(null), Le = L(null), Y = _e(), Z = ge ?? `dropdown-${Y}`, U = L(null), V = L(o);
19
+ }), [z, ke] = S(!1), I = L(null), E = L([]), F = L(null), Le = L(null), Y = _e(), Z = ge ?? `dropdown-${Y}`, U = L(null), V = L(r);
20
20
  k(() => {
21
- V.current = o;
21
+ V.current = r;
22
22
  }), k(() => {
23
23
  if (p && Q && i) {
24
- const n = new Set(V.current.map((r) => r.value)), e = [], t = [];
25
- m.forEach((r) => (n.has(r.value) ? e : t).push(r)), U.current = [...e, ...t];
24
+ const n = new Set(V.current.map((o) => o.value)), e = [], t = [];
25
+ m.forEach((o) => (n.has(o.value) ? e : t).push(o)), U.current = [...e, ...t];
26
26
  } else p || (U.current = null);
27
27
  }, [
28
28
  p,
@@ -31,16 +31,16 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
31
31
  m
32
32
  ]), k(() => {
33
33
  const n = U.current ?? m;
34
- if (!a || !s) X(n);
34
+ if (!f || !s) X(n);
35
35
  else {
36
- const e = pe(s), t = n.filter((r) => pe(r.label).includes(e));
36
+ const e = pe(s), t = n.filter((o) => pe(o.label).includes(e));
37
37
  X(t);
38
38
  }
39
39
  y(-1);
40
40
  }, [
41
41
  s,
42
42
  m,
43
- a,
43
+ f,
44
44
  p
45
45
  ]);
46
46
  const ee = L(d);
@@ -62,19 +62,19 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
62
62
  }
63
63
  if (m.length > 0) {
64
64
  if (i && Array.isArray(d)) {
65
- const t = m.filter((r) => typeof r.value == "number" ? d.includes(r.value) : d.includes(r.value.toString()));
66
- w(t), e && l("");
65
+ const t = new Set(d.map(String)), o = m.filter((D) => t.has(D.value.toString()));
66
+ w(o), e && l("");
67
67
  } else if (!i && (typeof d == "string" || typeof d == "number")) {
68
- const t = m.find((r) => typeof r.value == "number" && typeof d == "number" ? r.value === d : r.value.toString() === d.toString());
68
+ const t = m.find((o) => typeof o.value == "number" && typeof d == "number" ? o.value === d : o.value.toString() === d.toString());
69
69
  if (t)
70
70
  w([t]), e && l(t.label);
71
71
  else if (h && typeof d == "string" && d.trim()) {
72
- const r = {
72
+ const o = {
73
73
  label: d.trim(),
74
74
  value: d.trim(),
75
75
  className: "custom-option"
76
76
  };
77
- w([r]), e && l(d.trim());
77
+ w([o]), e && l(d.trim());
78
78
  } else e && (w([]), l(""));
79
79
  }
80
80
  } else if (h && !i && typeof d == "string" && d.trim()) {
@@ -89,17 +89,17 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
89
89
  d,
90
90
  m,
91
91
  i,
92
- a,
92
+ f,
93
93
  h
94
94
  ]), k(() => {
95
- a && M !== void 0 && l(M);
96
- }, [M, a]), k(() => {
95
+ f && T !== void 0 && l(T);
96
+ }, [T, f]), k(() => {
97
97
  if (!p || !I.current) return;
98
98
  const n = () => {
99
99
  if (!I.current) return;
100
- const t = I.current.getBoundingClientRect(), r = window.visualViewport, T = r?.offsetTop ?? 0, Te = T + (r?.height ?? window.innerHeight), de = 300, Ae = 8, G = Te - t.bottom, le = t.top - T, fe = G < de && le > G;
101
- if (ke(fe), $) {
102
- const He = Math.max(0, (fe ? le : G) - Ae);
100
+ const t = I.current.getBoundingClientRect(), o = window.visualViewport, D = o?.offsetTop ?? 0, Te = D + (o?.height ?? window.innerHeight), de = 300, Ae = 8, G = Te - t.bottom, le = t.top - D, ae = G < de && le > G;
101
+ if (ke(ae), $) {
102
+ const He = Math.max(0, (ae ? le : G) - Ae);
103
103
  $e({
104
104
  top: t.bottom,
105
105
  bottom: window.innerHeight - t.top,
@@ -121,8 +121,8 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
121
121
  const t = document.querySelector(".dropdown-menu--portal");
122
122
  if (t && t.contains(e.target)) return;
123
123
  }
124
- if (h && !i && s.trim() && !(o.length > 0 && o[0].label.toLowerCase() === s.trim().toLowerCase())) {
125
- const t = m.find((r) => r.label.toLowerCase() === s.toLowerCase() || r.value.toString() === s) || {
124
+ if (h && !i && s.trim() && !(r.length > 0 && r[0].label.toLowerCase() === s.trim().toLowerCase())) {
125
+ const t = m.find((o) => o.label.toLowerCase() === s.toLowerCase() || o.value.toString() === s) || {
126
126
  label: s.trim(),
127
127
  value: s.trim(),
128
128
  className: "custom-option"
@@ -130,7 +130,7 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
130
130
  w([t]), l(t.label), v(!1), u && u(t, N);
131
131
  return;
132
132
  }
133
- v(!1), !i && o.length > 0 ? l(o[0].label) : i && a && l("");
133
+ v(!1), !i && r.length > 0 ? l(r[0].label) : i && f && l("");
134
134
  }
135
135
  };
136
136
  return document.addEventListener("mousedown", n), () => {
@@ -144,16 +144,16 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
144
144
  N,
145
145
  u,
146
146
  m,
147
- a,
148
- o,
147
+ f,
148
+ r,
149
149
  $
150
150
  ]);
151
151
  const K = (n) => {
152
152
  if (!n.disabled)
153
153
  if (i) {
154
- const e = o.some((r) => r.value === n.value);
154
+ const e = r.some((o) => o.value === n.value);
155
155
  let t;
156
- e ? t = o.filter((r) => r.value !== n.value) : t = [...o, n], w(t), a && l(""), u && u(t, N);
156
+ e ? t = r.filter((o) => o.value !== n.value) : t = [...r, n], w(t), f && l(""), u && u(t, N);
157
157
  } else
158
158
  l(n.label), w([n]), v(!1), u && u(n, N);
159
159
  }, P = () => {
@@ -169,21 +169,21 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
169
169
  className: "custom-option"
170
170
  };
171
171
  if (i) {
172
- const t = [...o, e];
172
+ const t = [...r, e];
173
173
  w(t), l(""), u && u(t, N);
174
174
  } else
175
175
  w([e]), l(e.label), v(!1), u && u(e, N);
176
176
  }, ne = (n) => {
177
- const e = o.filter((t) => t.value !== n.value);
178
- w(e), u && (i ? u(e, N) : (u(null, N), a || l("")));
179
- }, Oe = () => {
180
- w([]), (!a || !i) && l(""), v(!1), u && u(i ? [] : null, N);
181
- }, Se = (n) => {
177
+ const e = r.filter((t) => t.value !== n.value);
178
+ w(e), u && (i ? u(e, N) : (u(null, N), f || l("")));
179
+ }, Se = () => {
180
+ w([]), (!f || !i) && l(""), v(!1), u && u(i ? [] : null, N);
181
+ }, Oe = (n) => {
182
182
  l(n), p || v(!0), xe?.(n);
183
183
  }, te = () => {
184
- x || (v(!0), !i && a && o.length > 0 && l(""), (i || a) && F.current?.focus());
184
+ x || (v(!0), !i && f && r.length > 0 && l(""), (i || f) && F.current?.focus());
185
185
  }, ye = () => {
186
- x || (v(!p), p || (y(-1), !i && a && o.length > 0 && l(""), (i || a) && F.current?.focus()));
186
+ x || (v(!p), p || (y(-1), !i && f && r.length > 0 && l(""), (i || f) && F.current?.focus()));
187
187
  }, Ie = (n) => {
188
188
  if (!x) {
189
189
  if (!p) {
@@ -192,59 +192,59 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
192
192
  }
193
193
  switch (n.key) {
194
194
  case "ArrowDown":
195
- if (n.preventDefault(), h && s && f.length === 0) return;
195
+ if (n.preventDefault(), h && s && a.length === 0) return;
196
196
  y((e) => {
197
- const t = e < (h && s && !f.some((r) => r.label.toLowerCase() === s.toLowerCase()) ? f.length : f.length - 1) ? e + 1 : 0;
198
- return t < f.length && E.current[t] && E.current[t]?.scrollIntoView({ block: "nearest" }), t;
197
+ const t = e < (h && s && !a.some((o) => o.label.toLowerCase() === s.toLowerCase()) ? a.length : a.length - 1) ? e + 1 : 0;
198
+ return t < a.length && E.current[t] && E.current[t]?.scrollIntoView({ block: "nearest" }), t;
199
199
  });
200
200
  break;
201
201
  case "ArrowUp":
202
- if (n.preventDefault(), h && s && f.length === 0) return;
202
+ if (n.preventDefault(), h && s && a.length === 0) return;
203
203
  y((e) => {
204
- const t = h && s && !f.some((T) => T.label.toLowerCase() === s.toLowerCase()) ? f.length : f.length - 1, r = e > 0 ? e - 1 : t;
205
- return r < f.length && E.current[r] && E.current[r]?.scrollIntoView({ block: "nearest" }), r;
204
+ const t = h && s && !a.some((D) => D.label.toLowerCase() === s.toLowerCase()) ? a.length : a.length - 1, o = e > 0 ? e - 1 : t;
205
+ return o < a.length && E.current[o] && E.current[o]?.scrollIntoView({ block: "nearest" }), o;
206
206
  });
207
207
  break;
208
208
  case "Enter":
209
- n.preventDefault(), S >= 0 && S < f.length ? K(f[S]) : (h && s && S === f.length || h && s && f.length === 0) && P();
209
+ n.preventDefault(), O >= 0 && O < a.length ? K(a[O]) : (h && s && O === a.length || h && s && a.length === 0) && P();
210
210
  break;
211
211
  case "Escape":
212
- n.preventDefault(), v(!1), !i && o.length > 0 ? l(o[0].label) : i && a && l("");
212
+ n.preventDefault(), v(!1), !i && r.length > 0 ? l(r[0].label) : i && f && l("");
213
213
  break;
214
214
  case "Backspace":
215
- i && s === "" && o.length > 0 && (n.preventDefault(), ne(o[o.length - 1]));
215
+ i && s === "" && r.length > 0 && (n.preventDefault(), ne(r[r.length - 1]));
216
216
  }
217
217
  }
218
- }, q = (n) => o.some((e) => e.value === n.value), Ee = () => {
219
- if (o.length === 0) return "";
218
+ }, q = (n) => r.some((e) => e.value === n.value), Ee = () => {
219
+ if (r.length === 0) return "";
220
220
  const n = Math.max(1, ve);
221
- if (o.length <= n) return o.map((r) => r.label).join(", ");
222
- const e = o.slice(0, n).map((r) => r.label).join(", "), t = o.length - n;
221
+ if (r.length <= n) return r.map((o) => o.label).join(", ");
222
+ const e = r.slice(0, n).map((o) => o.label).join(", "), t = r.length - n;
223
223
  return `${e} (+${t} ${t === 1 ? "other" : "others"})`;
224
- }, De = () => i && C || a && p ? s : o.length > 0 ? i ? Ee() : o[0].label : "", Re = () => i && C ? o.length > 0 ? "" : H : p && a ? H : o.length > 0 ? "" : H, Be = () => !i || o.length === 0 || j === "none" ? null : j === "floating" ? /* @__PURE__ */ g("div", {
224
+ }, De = () => i && C || f && p ? s : r.length > 0 ? i ? Ee() : r[0].label : "", Re = () => i && C ? r.length > 0 ? "" : H : p && f ? H : r.length > 0 ? "" : H, Be = () => !i || r.length === 0 || j === "none" ? null : j === "floating" ? /* @__PURE__ */ g("div", {
225
225
  className: "dropdown-selected-count",
226
- children: [o.length, " selected"]
227
- }) : null, re = () => !!(h && s && s.trim() && !f.some((n) => n.label.toLowerCase() === s.toLowerCase() || n.value.toString() === s)), Me = () => {
226
+ children: [r.length, " selected"]
227
+ }) : null, oe = () => !!(h && s && s.trim() && !a.some((n) => n.label.toLowerCase() === s.toLowerCase() || n.value.toString() === s)), Me = () => {
228
228
  if (!p || x) return null;
229
229
  const n = /* @__PURE__ */ c("div", {
230
230
  ref: Le,
231
231
  className: `dropdown-menu ${$ ? "dropdown-menu--portal" : ""} ${z ? "dropdown-menu--upward" : ""}`,
232
232
  style: $ ? {
233
233
  position: "fixed",
234
- top: z ? "auto" : `${R.top}px`,
235
- bottom: z ? `${R.bottom}px` : "auto",
236
- left: `${R.left}px`,
237
- width: `${R.width}px`,
238
- maxHeight: `${R.maxHeight}px`,
234
+ top: z ? "auto" : `${B.top}px`,
235
+ bottom: z ? `${B.bottom}px` : "auto",
236
+ left: `${B.left}px`,
237
+ width: `${B.width}px`,
238
+ maxHeight: `${B.maxHeight}px`,
239
239
  zIndex: 9999
240
240
  } : void 0,
241
- children: f.length > 0 || re() ? /* @__PURE__ */ g("ul", {
241
+ children: a.length > 0 || oe() ? /* @__PURE__ */ g("ul", {
242
242
  className: "dropdown-options-list",
243
- children: [f.map((e, t) => /* @__PURE__ */ g("li", {
244
- ref: (r) => {
245
- E.current[t] = r;
243
+ children: [a.map((e, t) => /* @__PURE__ */ g("li", {
244
+ ref: (o) => {
245
+ E.current[t] = o;
246
246
  },
247
- className: `dropdown-option ${e.className || ""} ${S === t ? "focused" : ""} ${q(e) ? "selected" : ""} ${e.disabled ? "dropdown-option--disabled" : ""}`,
247
+ className: `dropdown-option ${e.className || ""} ${O === t ? "focused" : ""} ${q(e) ? "selected" : ""} ${e.disabled ? "dropdown-option--disabled" : ""}`,
248
248
  onClick: () => K(e),
249
249
  onMouseEnter: () => y(t),
250
250
  title: e.tooltip,
@@ -275,27 +275,27 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
275
275
  className: "dropdown-option-prefix",
276
276
  children: e.prefix
277
277
  }),
278
- e.icon && /* @__PURE__ */ c(D, { name: e.icon }),
278
+ e.icon && /* @__PURE__ */ c(R, { name: e.icon }),
279
279
  /* @__PURE__ */ c("span", { children: e.label }),
280
- e.suffixIcon && /* @__PURE__ */ c(D, { name: e.suffixIcon })
280
+ e.suffixIcon && /* @__PURE__ */ c(R, { name: e.suffixIcon })
281
281
  ]
282
282
  }), e.details && /* @__PURE__ */ c("span", {
283
283
  className: "dropdown-option-details",
284
284
  children: e.details
285
285
  })]
286
286
  })]
287
- }, `dd-option-${Y}-${t}`)), re() && /* @__PURE__ */ c("li", {
287
+ }, `dd-option-${Y}-${t}`)), oe() && /* @__PURE__ */ c("li", {
288
288
  ref: (e) => {
289
- E.current[f.length] = e;
289
+ E.current[a.length] = e;
290
290
  },
291
- className: `dropdown-option dropdown-option--create ${S === f.length ? "focused" : ""}`,
291
+ className: `dropdown-option dropdown-option--create ${O === a.length ? "focused" : ""}`,
292
292
  onClick: P,
293
- onMouseEnter: () => y(f.length),
293
+ onMouseEnter: () => y(a.length),
294
294
  children: /* @__PURE__ */ c("div", {
295
295
  className: "dropdown-option-content",
296
296
  children: /* @__PURE__ */ g("span", {
297
297
  className: "dropdown-option-label",
298
- children: [/* @__PURE__ */ c(D, { name: "plus" }), /* @__PURE__ */ g("span", { children: [
298
+ children: [/* @__PURE__ */ c(R, { name: "plus" }), /* @__PURE__ */ g("span", { children: [
299
299
  "Create “",
300
300
  s,
301
301
  "”"
@@ -309,7 +309,7 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
309
309
  })
310
310
  });
311
311
  return $ ? ze(n, document.body) : n;
312
- }, b = !i && o.length === 1 ? o[0] : null, B = Ne && !p && !i && o.length > 0, oe = !!(b?.icon && !s && !B), ie = !!(b?.suffixIcon && !B), W = i && C, se = o.length > 0, ce = a || h;
312
+ }, b = !i && r.length === 1 ? r[0] : null, M = Ne && !p && !i && r.length > 0, re = !!(b?.icon && !s && !M), ie = !!(b?.suffixIcon && !M), W = i && C, se = r.length > 0, ce = f || h;
313
313
  return /* @__PURE__ */ g("div", {
314
314
  className: `dropdown-container ${A ? "dropdown-error" : ""} ${_ ? "dropdown-success" : ""} ${me ? "dropdown-highlighted" : ""} ${i ? "multiple" : ""} ${x ? "disabled" : ""} ${i ? `count-display-${j}` : ""} ${he}`,
315
315
  ref: I,
@@ -320,21 +320,21 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
320
320
  children: J
321
321
  }),
322
322
  /* @__PURE__ */ g("div", {
323
- className: `dropdown-input-container ${oe ? "dropdown-input-container--has-prefix-icon" : ""} ${ie ? "dropdown-input-container--has-suffix-icon" : ""} ${W ? "dropdown-input-container--chips" : ""} ${W && be ? "dropdown-input-container--chips-multiline" : ""} ${se ? "dropdown-input-container--clearable" : ""}`,
323
+ className: `dropdown-input-container ${re ? "dropdown-input-container--has-prefix-icon" : ""} ${ie ? "dropdown-input-container--has-suffix-icon" : ""} ${W ? "dropdown-input-container--chips" : ""} ${W && be ? "dropdown-input-container--chips-multiline" : ""} ${se ? "dropdown-input-container--clearable" : ""}`,
324
324
  children: [
325
- oe && b?.icon && /* @__PURE__ */ c("span", {
325
+ re && b?.icon && /* @__PURE__ */ c("span", {
326
326
  className: "dropdown-selected-icon dropdown-selected-icon--prefix",
327
- children: /* @__PURE__ */ c(D, { name: b.icon })
327
+ children: /* @__PURE__ */ c(R, { name: b.icon })
328
328
  }),
329
- B && b && /* @__PURE__ */ g("span", {
329
+ M && b && /* @__PURE__ */ g("span", {
330
330
  className: "dropdown-value-chip",
331
331
  onClick: te,
332
- children: [b.icon && /* @__PURE__ */ c(D, { name: b.icon }), /* @__PURE__ */ c("span", {
332
+ children: [b.icon && /* @__PURE__ */ c(R, { name: b.icon }), /* @__PURE__ */ c("span", {
333
333
  className: "dropdown-value-chip__label",
334
334
  children: b.label
335
335
  })]
336
336
  }),
337
- W && o.map((n) => /* @__PURE__ */ g("span", {
337
+ W && r.map((n) => /* @__PURE__ */ g("span", {
338
338
  className: "dropdown-chip",
339
339
  children: [/* @__PURE__ */ c("span", {
340
340
  className: "dropdown-chip__label",
@@ -355,9 +355,9 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
355
355
  /* @__PURE__ */ c(Ce, {
356
356
  ref: F,
357
357
  id: Z,
358
- placeholder: B ? "" : Re(),
359
- value: B ? "" : De(),
360
- onChange: ce ? Se : void 0,
358
+ placeholder: M ? "" : Re(),
359
+ value: M ? "" : De(),
360
+ onChange: ce ? Oe : void 0,
361
361
  onClick: te,
362
362
  onKeyDown: Ie,
363
363
  autoComplete: "off",
@@ -370,20 +370,20 @@ var Ve = ({ allowCustomValue: h = !1, autofocus: we = !1, className: he = "", di
370
370
  children: [
371
371
  ie && b?.suffixIcon && /* @__PURE__ */ c("span", {
372
372
  className: "dropdown-selected-icon dropdown-selected-icon--suffix",
373
- children: /* @__PURE__ */ c(D, { name: b.suffixIcon })
373
+ children: /* @__PURE__ */ c(R, { name: b.suffixIcon })
374
374
  }),
375
375
  se && /* @__PURE__ */ c("span", {
376
376
  className: "dropdown-action-button dropdown-clear-button",
377
- children: /* @__PURE__ */ c(ae, {
377
+ children: /* @__PURE__ */ c(fe, {
378
378
  variant: "plain",
379
- onClick: Oe,
379
+ onClick: Se,
380
380
  disabled: x,
381
381
  children: ue
382
382
  })
383
383
  }),
384
384
  /* @__PURE__ */ c("span", {
385
385
  className: `dropdown-action-button dropdown-toggle-button ${p ? "open" : ""}`,
386
- children: /* @__PURE__ */ c(ae, {
386
+ children: /* @__PURE__ */ c(fe, {
387
387
  variant: "plain",
388
388
  onClick: ye,
389
389
  disabled: x,
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 520,
26
+ libBuildNumber: 524,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
package/dist/index.d.ts CHANGED
@@ -3177,7 +3177,7 @@ export declare interface SwipeHandlers {
3177
3177
  onTouchCancel: () => void;
3178
3178
  }
3179
3179
 
3180
- export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'ivory-serif' | 'kindred-ink' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal';
3180
+ export declare type Theme = 'amber-meridian' | 'archive-indigo' | 'arctic-blue' | 'asphalt-code' | 'atelier-media' | 'audit-ember' | 'azure-night' | 'blossom-meadow' | 'blueprint-clay' | 'blush-market' | 'brass-chronicle' | 'carbon-velocity' | 'chalk-circuit' | 'chrono-atlas' | 'clinical-aqua' | 'cobalt-pulse' | 'citrus-vital' | 'command-slate' | 'crawler-dusk' | 'crimson-dusk' | 'cyber-forest' | 'dashdarkx' | 'ember-night' | 'emerald-ledger' | 'frost-petal' | 'garden-harvest' | 'gilded-bear' | 'graphite-shell' | 'horizon-amber' | 'horizon-drift' | 'ivory-serif' | 'kindred-ink' | 'lamplight' | 'lavender-mist' | 'light-blue' | 'lumen' | 'luna' | 'mesh-circuit' | 'midnight-atlas' | 'midnight-amber' | 'midnight-folio' | 'mint-meadow' | 'mintone' | 'neon-tokyo' | 'noir-marquee' | 'ocean-breeze' | 'ocean-depths' | 'orbital-night' | 'sandstone' | 'sandy-parchment' | 'screening-room' | 'signal-burst' | 'signal-clarity' | 'slate-focus' | 'slate-bazaar' | 'spectrum-vault' | 'tailwind-vue-dark' | 'terminal-phosphor' | 'terracotta-kitchen' | 'twilight-pulse' | 'vault-guard' | 'velvet-reel' | 'velvet-tome' | 'verdant-pulse' | 'vital-aurora' | 'vital-signal';
3181
3181
 
3182
3182
  export { THEME_CONFIGS }
3183
3183
 
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
- var I = "3.12.2", B = 520, L = "4308de2", _ = "2026-10-17T07:54:26.042Z", r = "520";
1
+ var I = "3.12.4", B = 524, L = "e26bc6f", _ = "2026-10-19T21:26:10.045Z", r = "524";
2
2
  export {
3
3
  _ as LIB_BUILD_DATE,
4
4
  r as LIB_BUILD_ID,
package/dist/version.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "version": "3.12.2",
3
- "buildNumber": 520,
4
- "commit": "4308de2",
5
- "buildDate": "2026-10-17T07:54:26.042Z"
2
+ "version": "3.12.4",
3
+ "buildNumber": 524,
4
+ "commit": "e26bc6f",
5
+ "buildDate": "2026-10-19T21:26:10.045Z"
6
6
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memobit/libs",
3
- "version": "3.12.2",
3
+ "version": "3.12.4",
4
4
  "description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
5
5
  "keywords": [
6
6
  "react",