@flanksource/clicky-ui 0.3.84 → 0.3.86
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/components/Combobox.cjs +8 -6
- package/dist/components/Combobox.cjs.map +1 -1
- package/dist/components/Combobox.d.ts.map +1 -1
- package/dist/components/Combobox.js +8 -6
- package/dist/components/Combobox.js.map +1 -1
- package/dist/components/ComboboxMenu.cjs +7 -4
- package/dist/components/ComboboxMenu.cjs.map +1 -1
- package/dist/components/ComboboxMenu.d.ts +3 -2
- package/dist/components/ComboboxMenu.d.ts.map +1 -1
- package/dist/components/ComboboxMenu.js +7 -4
- package/dist/components/ComboboxMenu.js.map +1 -1
- package/dist/components/FilterBar.cjs +64 -47
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +20 -2
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +63 -46
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/TimeRange.cjs +156 -128
- package/dist/components/TimeRange.cjs.map +1 -1
- package/dist/components/TimeRange.d.ts +8 -1
- package/dist/components/TimeRange.d.ts.map +1 -1
- package/dist/components/TimeRange.js +156 -128
- package/dist/components/TimeRange.js.map +1 -1
- package/dist/components/combobox-types.d.ts +5 -0
- package/dist/components/combobox-types.d.ts.map +1 -1
- package/dist/components/filter-bar-context.cjs.map +1 -1
- package/dist/components/filter-bar-context.d.ts +2 -0
- package/dist/components/filter-bar-context.d.ts.map +1 -1
- package/dist/components/filter-bar-context.js.map +1 -1
- package/dist/components/filter-bar-field-utils.cjs +18 -4
- package/dist/components/filter-bar-field-utils.cjs.map +1 -1
- package/dist/components/filter-bar-field-utils.d.ts +3 -2
- package/dist/components/filter-bar-field-utils.d.ts.map +1 -1
- package/dist/components/filter-bar-field-utils.js +19 -5
- package/dist/components/filter-bar-field-utils.js.map +1 -1
- package/dist/components/filter-bar-menu.cjs +189 -0
- package/dist/components/filter-bar-menu.cjs.map +1 -0
- package/dist/components/filter-bar-menu.d.ts +25 -0
- package/dist/components/filter-bar-menu.d.ts.map +1 -0
- package/dist/components/filter-bar-menu.js +189 -0
- package/dist/components/filter-bar-menu.js.map +1 -0
- package/dist/components/filter-bar-multi.cjs +1 -1
- package/dist/components/filter-bar-multi.cjs.map +1 -1
- package/dist/components/filter-bar-multi.js +2 -2
- package/dist/components/filter-bar-multi.js.map +1 -1
- package/dist/components/filter-bar-popup.cjs +37 -0
- package/dist/components/filter-bar-popup.cjs.map +1 -0
- package/dist/components/filter-bar-popup.d.ts +32 -0
- package/dist/components/filter-bar-popup.d.ts.map +1 -0
- package/dist/components/filter-bar-popup.js +37 -0
- package/dist/components/filter-bar-popup.js.map +1 -0
- package/dist/components/filter-bar-tree.cjs +1 -1
- package/dist/components/filter-bar-tree.cjs.map +1 -1
- package/dist/components/filter-bar-tree.js +2 -2
- package/dist/components/filter-bar-tree.js.map +1 -1
- package/dist/components/json-schema-form-table-array.cjs +5 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.d.ts.map +1 -1
- package/dist/components/json-schema-form-table-array.js +5 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/connections/ConnectionPicker.cjs +6 -2
- package/dist/connections/ConnectionPicker.cjs.map +1 -1
- package/dist/connections/ConnectionPicker.d.ts.map +1 -1
- package/dist/connections/ConnectionPicker.js +6 -2
- package/dist/connections/ConnectionPicker.js.map +1 -1
- package/dist/connections/CreateConnectionDialog.cjs +8 -21
- package/dist/connections/CreateConnectionDialog.cjs.map +1 -1
- package/dist/connections/CreateConnectionDialog.d.ts +2 -1
- package/dist/connections/CreateConnectionDialog.d.ts.map +1 -1
- package/dist/connections/CreateConnectionDialog.js +8 -21
- package/dist/connections/CreateConnectionDialog.js.map +1 -1
- package/dist/data/ExpandableMarkdown.cjs +59 -0
- package/dist/data/ExpandableMarkdown.cjs.map +1 -0
- package/dist/data/ExpandableMarkdown.d.ts +17 -0
- package/dist/data/ExpandableMarkdown.d.ts.map +1 -0
- package/dist/data/ExpandableMarkdown.js +59 -0
- package/dist/data/ExpandableMarkdown.js.map +1 -0
- package/dist/data/MultiGaugeBar.cjs +49 -21
- package/dist/data/MultiGaugeBar.cjs.map +1 -1
- package/dist/data/MultiGaugeBar.d.ts +5 -2
- package/dist/data/MultiGaugeBar.d.ts.map +1 -1
- package/dist/data/MultiGaugeBar.js +49 -21
- package/dist/data/MultiGaugeBar.js.map +1 -1
- package/dist/data/flow-node/BoxNode.cjs +45 -0
- package/dist/data/flow-node/BoxNode.cjs.map +1 -0
- package/dist/data/flow-node/BoxNode.d.ts +28 -0
- package/dist/data/flow-node/BoxNode.d.ts.map +1 -0
- package/dist/data/flow-node/BoxNode.js +45 -0
- package/dist/data/flow-node/BoxNode.js.map +1 -0
- package/dist/data/flow-node/FlowMetrics.cjs +208 -0
- package/dist/data/flow-node/FlowMetrics.cjs.map +1 -0
- package/dist/data/flow-node/FlowMetrics.d.ts +60 -0
- package/dist/data/flow-node/FlowMetrics.d.ts.map +1 -0
- package/dist/data/flow-node/FlowMetrics.js +206 -0
- package/dist/data/flow-node/FlowMetrics.js.map +1 -0
- package/dist/data/flow-node/WorkloadNode.cjs +63 -0
- package/dist/data/flow-node/WorkloadNode.cjs.map +1 -0
- package/dist/data/flow-node/WorkloadNode.d.ts +42 -0
- package/dist/data/flow-node/WorkloadNode.d.ts.map +1 -0
- package/dist/data/flow-node/WorkloadNode.js +63 -0
- package/dist/data/flow-node/WorkloadNode.js.map +1 -0
- package/dist/data/flow-node/index.d.ts +5 -0
- package/dist/data/flow-node/index.d.ts.map +1 -0
- package/dist/data/flow-node/latency.cjs +37 -0
- package/dist/data/flow-node/latency.cjs.map +1 -0
- package/dist/data/flow-node/latency.d.ts +13 -0
- package/dist/data/flow-node/latency.d.ts.map +1 -0
- package/dist/data/flow-node/latency.js +35 -0
- package/dist/data/flow-node/latency.js.map +1 -0
- package/dist/data/traces/index.d.ts +1 -0
- package/dist/data/traces/index.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.cjs +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceDetail.js +4 -7
- package/dist/data/traces/otel/OtelTraceDetail.js.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.cjs +90 -56
- package/dist/data/traces/otel/OtelTraceSearch.cjs.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.d.ts.map +1 -1
- package/dist/data/traces/otel/OtelTraceSearch.js +91 -57
- package/dist/data/traces/otel/OtelTraceSearch.js.map +1 -1
- package/dist/data/traces/otel/QueryBar.cjs +83 -10
- package/dist/data/traces/otel/QueryBar.cjs.map +1 -1
- package/dist/data/traces/otel/QueryBar.d.ts.map +1 -1
- package/dist/data/traces/otel/QueryBar.js +83 -10
- package/dist/data/traces/otel/QueryBar.js.map +1 -1
- package/dist/data/traces/otel/TraceResults.cjs +81 -13
- package/dist/data/traces/otel/TraceResults.cjs.map +1 -1
- package/dist/data/traces/otel/TraceResults.d.ts +11 -3
- package/dist/data/traces/otel/TraceResults.d.ts.map +1 -1
- package/dist/data/traces/otel/TraceResults.js +81 -13
- package/dist/data/traces/otel/TraceResults.js.map +1 -1
- package/dist/data/traces/otel/api.cjs.map +1 -1
- package/dist/data/traces/otel/api.d.ts +14 -0
- package/dist/data/traces/otel/api.d.ts.map +1 -1
- package/dist/data/traces/otel/api.js.map +1 -1
- package/dist/data/traces/otel/query.cjs +2 -2
- package/dist/data/traces/otel/query.cjs.map +1 -1
- package/dist/data/traces/otel/query.d.ts +1 -1
- package/dist/data/traces/otel/query.d.ts.map +1 -1
- package/dist/data/traces/otel/query.js +2 -2
- package/dist/data/traces/otel/query.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.cjs.map +1 -1
- package/dist/data/version-info.js +3 -3
- package/dist/data/version-info.js.map +1 -1
- package/dist/data/workload-panel/MemoryStack.cjs +38 -1
- package/dist/data/workload-panel/MemoryStack.cjs.map +1 -1
- package/dist/data/workload-panel/MemoryStack.d.ts.map +1 -1
- package/dist/data/workload-panel/MemoryStack.js +38 -1
- package/dist/data/workload-panel/MemoryStack.js.map +1 -1
- package/dist/data.cjs +18 -1
- package/dist/data.d.ts +2 -0
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +8 -2
- package/dist/file-findings/AnnotatedCode.cjs +18 -2
- package/dist/file-findings/AnnotatedCode.cjs.map +1 -1
- package/dist/file-findings/AnnotatedCode.d.ts +2 -0
- package/dist/file-findings/AnnotatedCode.d.ts.map +1 -1
- package/dist/file-findings/AnnotatedCode.js +18 -2
- package/dist/file-findings/AnnotatedCode.js.map +1 -1
- package/dist/file-findings/FileFindingsView.cjs.map +1 -1
- package/dist/file-findings/FileFindingsView.d.ts +2 -0
- package/dist/file-findings/FileFindingsView.d.ts.map +1 -1
- package/dist/file-findings/FileFindingsView.js.map +1 -1
- package/dist/file-findings/file-review/FileReview.cjs +2 -1
- package/dist/file-findings/file-review/FileReview.cjs.map +1 -1
- package/dist/file-findings/file-review/FileReview.d.ts +3 -1
- package/dist/file-findings/file-review/FileReview.d.ts.map +1 -1
- package/dist/file-findings/file-review/FileReview.js +2 -1
- package/dist/file-findings/file-review/FileReview.js.map +1 -1
- package/dist/index.cjs +18 -1
- package/dist/index.js +8 -2
- package/dist/profiles/editor/profileEditor.cjs +29 -30
- package/dist/profiles/editor/profileEditor.cjs.map +1 -1
- package/dist/profiles/editor/profileEditor.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditor.js +29 -30
- package/dist/profiles/editor/profileEditor.js.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.cjs +44 -43
- package/dist/profiles/editor/profileEditorPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.d.ts +10 -5
- package/dist/profiles/editor/profileEditorPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileEditorPreview.js +44 -43
- package/dist/profiles/editor/profileEditorPreview.js.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.cjs +153 -48
- package/dist/profiles/editor/profileMappingPreview.cjs.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.d.ts +16 -2
- package/dist/profiles/editor/profileMappingPreview.d.ts.map +1 -1
- package/dist/profiles/editor/profileMappingPreview.js +155 -50
- package/dist/profiles/editor/profileMappingPreview.js.map +1 -1
- package/dist/profiles/editor/sampleError.cjs +29 -0
- package/dist/profiles/editor/sampleError.cjs.map +1 -0
- package/dist/profiles/editor/sampleError.d.ts +16 -0
- package/dist/profiles/editor/sampleError.d.ts.map +1 -0
- package/dist/profiles/editor/sampleError.js +27 -0
- package/dist/profiles/editor/sampleError.js.map +1 -0
- package/dist/profiles/query/profileSampleResult.cjs.map +1 -1
- package/dist/profiles/query/profileSampleResult.d.ts +2 -0
- package/dist/profiles/query/profileSampleResult.d.ts.map +1 -1
- package/dist/profiles/query/profileSampleResult.js.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.cjs +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.cjs.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts +2 -0
- package/dist/profiles/wizard/profileWizardQueryStep.d.ts.map +1 -1
- package/dist/profiles/wizard/profileWizardQueryStep.js +1 -0
- package/dist/profiles/wizard/profileWizardQueryStep.js.map +1 -1
- package/dist/react-grab/core/index.js +1 -1
- package/dist/react-grab/{core-BERtFDWh.js → core-BK5CU6Lb.js} +2 -2
- package/dist/react-grab/index.js +1 -1
- package/dist/react-grab/{renderer-KT3FY3K2.js → renderer-DcHrsQ8k.js} +1 -1
- package/dist/rpc/apiClient.cjs +12 -15
- package/dist/rpc/apiClient.cjs.map +1 -1
- package/dist/rpc/apiClient.js +12 -15
- package/dist/rpc/apiClient.js.map +1 -1
- package/dist/runtime/barrels.json +6481 -6441
- package/dist/runtime/importmap.json +2198 -2190
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComboboxMenu.js","names":["_Fragment"],"sources":["../../src/components/ComboboxMenu.tsx"],"sourcesContent":["import { Fragment, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { FilterPill } from \"../data/FilterPill\";\nimport { Icon, LabelIcon } from \"../data/Icon\";\nimport { UiCheck } from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport type { ComboboxOption, ComboboxTriStateMode } from \"./combobox-types\";\nimport type { ComboboxMenuPosition } from \"../lib/combobox\";\n\nexport function ComboboxMenu({\n customEntry,\n filtered,\n floatingZ,\n footer,\n header,\n ariaLabel,\n hasOptions,\n highlighted,\n isSelected,\n listId,\n listRef,\n loading,\n menuPos,\n modes,\n multiple,\n onHighlight,\n onSelect,\n onSetMode,\n tristate,\n}: {\n customEntry: ComboboxOption | null;\n filtered: ComboboxOption[];\n floatingZ: number;\n footer: ReactNode;\n header?: ReactNode;\n ariaLabel?: string | undefined;\n /** Whether the control has an option set at all (before filtering). */\n hasOptions: boolean;\n highlighted: number;\n isSelected: (value: string) => boolean;\n listId: string | undefined;\n listRef: RefObject<HTMLDivElement | null>;\n loading: boolean | undefined;\n menuPos: ComboboxMenuPosition;\n modes: Record<string, ComboboxTriStateMode>;\n multiple: boolean;\n onHighlight: (index: number) => void;\n onSelect: (option: ComboboxOption) => void;\n onSetMode: (value: string, mode: string) => void;\n tristate: boolean;\n}) {\n const mobile = menuPos.strategy === \"mobile\";\n const listbox = (\n <div\n id={header ? undefined : listId}\n ref={listRef}\n role={header ? undefined : \"listbox\"}\n aria-label={header ? undefined : ariaLabel}\n aria-multiselectable={!header && multiple ? true : undefined}\n style={{\n position: mobile ? \"absolute\" : \"fixed\",\n ...(menuPos.top != null\n ? { top: menuPos.top }\n : { bottom: menuPos.bottom }),\n left: menuPos.left,\n ...(mobile ? { width: menuPos.width } : { minWidth: menuPos.width }),\n maxWidth: menuPos.maxWidth,\n maxHeight: menuPos.maxHeight,\n zIndex: mobile ? undefined : floatingZ,\n pointerEvents: mobile ? \"auto\" : undefined,\n }}\n className={cn(\n \"overflow-auto rounded-md border border-border bg-popover p-1 text-popover-foreground shadow-lg shadow-black/5\",\n !mobile && \"w-max\",\n )}\n >\n {header}\n <div\n className={cn(filtered.some(option => option.layout === \"responsive\") && \"@container/combobox-options\")}\n id={header ? listId : undefined}\n role={header ? \"listbox\" : undefined}\n aria-label={header ? ariaLabel : undefined}\n aria-multiselectable={header && multiple ? true : undefined}\n >\n {loading && filtered.length === 0 && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n Loading…\n </div>\n )}\n {/* \"No results\" answers \"did my query match anything?\" — a control with\n no option set at all (a free tag list) was never asked the question, so\n it says nothing rather than reporting an empty search. */}\n {!loading && filtered.length === 0 && !customEntry && hasOptions && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n No results\n </div>\n )}\n {filtered.map((option, index) => {\n const selected = isSelected(option.value);\n const mode = tristate && Object.hasOwn(modes, option.value) ? modes[option.value] : undefined;\n const showHeader =\n option.group != null && option.group !== filtered[index - 1]?.group;\n const selectionIndicator = (\n <span\n data-slot=\"combobox-selection-indicator\"\n aria-hidden\n className={cn(\n \"shrink-0 text-xs\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <Icon icon={UiCheck} />\n </span>\n );\n return (\n <Fragment key={option.value}>\n {showHeader && (\n <div\n role=\"presentation\"\n className=\"select-none px-2 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\"\n >\n {option.group}\n </div>\n )}\n <div\n id={listId ? `${listId}-${index}` : undefined}\n role=\"option\"\n aria-selected={tristate ? mode != null : selected}\n aria-disabled={option.disabled}\n {...(mode != null\n ? {\n \"aria-label\": `${option.label}, ${\n mode === \"include\" ? \"included\" : \"excluded\"\n }`,\n }\n : {})}\n {...(option.title !== undefined ? { title: option.title } : {})}\n {...(tristate ? { \"data-filter-option\": option.value } : {})}\n onMouseDown={(event) => {\n event.preventDefault();\n if (!tristate && !option.disabled) onSelect(option);\n }}\n {...(tristate\n ? {\n onClick: () => {\n if (!option.disabled) onSelect(option);\n },\n }\n : {})}\n onMouseEnter={() => onHighlight(index)}\n className={cn(\n \"flex cursor-pointer rounded-sm py-1.5 text-sm\",\n multiple ? \"gap-2 px-2\" : \"gap-1.5 px-1.5\",\n option.layout === \"responsive\" ? \"items-start @min-[28rem]/combobox-options:items-center\" : option.description && option.descriptionLayout !== \"inline\" ? \"items-start\" : \"items-center\",\n index === highlighted && \"bg-accent\",\n selected && !tristate && \"font-medium\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {tristate ? (\n <div className=\"min-w-0 flex-1\">\n <FilterPill\n mode={mode ?? \"neutral\"}\n togglePosition=\"right\"\n interactive={false}\n label={\n <span className=\"inline-flex min-w-0 items-center gap-1.5\">\n <LabelIcon\n icon={option.icon}\n className=\"shrink-0 text-sm text-muted-foreground\"\n />\n <span className=\"truncate\">{option.label}</span>\n </span>\n }\n onModeChange={(next) => onSetMode(option.value, next)}\n className=\"w-full justify-between\"\n {...(option.count !== undefined\n ? { count: option.count }\n : {})}\n />\n <ComboboxOptionDescription\n description={option.description}\n />\n </div>\n ) : (\n <>\n {multiple && selectionIndicator}\n <LabelIcon\n icon={option.icon}\n className={cn(\n \"shrink-0 text-sm text-muted-foreground\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n )}\n />\n <ComboboxOptionText option={option} />\n {option.trailing != null && option.layout !== \"responsive\" && (\n // Capped and truncating rather than `shrink-0`: in a menu\n // clamped by the viewport edge the label is what identifies\n // the option, so the preview yields first.\n <span className=\"ml-auto min-w-0 max-w-[55%] truncate pl-2 text-right text-xs text-muted-foreground\">\n {option.trailing}\n </span>\n )}\n {!multiple && selectionIndicator}\n </>\n )}\n </div>\n </Fragment>\n );\n })}\n {customEntry && (\n <div\n id={listId ? `${listId}-${filtered.length}` : undefined}\n role=\"option\"\n aria-selected={false}\n data-filter-add-custom={customEntry.value}\n title={customEntry.title}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onSelect(customEntry)}\n onMouseEnter={() => onHighlight(filtered.length)}\n className={cn(\n \"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-primary\",\n highlighted === filtered.length && \"bg-accent\",\n )}\n >\n <LabelIcon\n icon={customEntry.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 truncate\">{customEntry.label}</span>\n </div>\n )}\n {footer != null && (\n <div className=\"select-none px-2 py-1.5 text-[11px] text-muted-foreground\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n return createPortal(\n mobile ? (\n <div\n data-slot=\"combobox-viewport-layer\"\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: floatingZ,\n pointerEvents: \"none\",\n }}\n >\n {listbox}\n </div>\n ) : (\n listbox\n ),\n document.body,\n );\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n const responsive = option.layout === \"responsive\";\n return (\n <span data-slot=\"combobox-option-text\" className={cn(\"min-w-0 flex-1\", responsive ? \"flex flex-col gap-1 @min-[28rem]/combobox-options:flex-row @min-[28rem]/combobox-options:items-center @min-[28rem]/combobox-options:gap-2\" : option.descriptionLayout === \"inline\" && \"flex items-center gap-2\")}>\n <span className={cn(\"block min-w-0\", responsive ? \"whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:flex-1 @min-[28rem]/combobox-options:truncate\" : \"truncate\")}>{option.label}</span>\n <ComboboxOptionDescription description={option.description} inline={option.descriptionLayout === \"inline\"} responsive={responsive} />\n {responsive && option.trailing != null && (\n <span className=\"min-w-0 text-xs font-normal text-muted-foreground @min-[28rem]/combobox-options:ml-auto @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:truncate @min-[28rem]/combobox-options:pl-2 @min-[28rem]/combobox-options:text-right\">\n {option.trailing}\n </span>\n )}\n </span>\n );\n}\n\nfunction ComboboxOptionDescription({\n description,\n inline = false,\n responsive = false,\n}: {\n description: string | undefined;\n inline?: boolean;\n responsive?: boolean;\n}) {\n return description ? (\n <span className={cn(\"text-xs font-normal leading-4 text-muted-foreground\", responsive ? \"min-w-0 whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:shrink-0 @min-[28rem]/combobox-options:truncate\" : inline ? \"min-w-0 truncate\" : \"mt-0.5 block whitespace-pre-line\")}>\n {description}\n </span>\n ) : null;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,aAAa,EAC3B,aACA,UACA,WACA,QACA,QACA,WACA,YACA,aACA,YACA,QACA,SACA,SACA,SACA,OACA,UACA,aACA,UACA,WACA,YAsBC;CACD,MAAM,SAAS,QAAQ,aAAa;CACpC,MAAM,UACJ,qBAAC,OAAD;EACE,IAAI,SAAS,KAAA,IAAY;EACzB,KAAK;EACL,MAAM,SAAS,KAAA,IAAY;EAC3B,cAAY,SAAS,KAAA,IAAY;EACjC,wBAAsB,CAAC,UAAU,WAAW,OAAO,KAAA;EACnD,OAAO;GACL,UAAU,SAAS,aAAa;GAChC,GAAI,QAAQ,OAAO,OACf,EAAE,KAAK,QAAQ,IAAI,IACnB,EAAE,QAAQ,QAAQ,OAAO;GAC7B,MAAM,QAAQ;GACd,GAAI,SAAS,EAAE,OAAO,QAAQ,MAAM,IAAI,EAAE,UAAU,QAAQ,MAAM;GAClE,UAAU,QAAQ;GAClB,WAAW,QAAQ;GACnB,QAAQ,SAAS,KAAA,IAAY;GAC7B,eAAe,SAAS,SAAS,KAAA;EACnC;EACA,WAAW,GACT,iHACA,CAAC,UAAU,OACb;EArBF,UAAA,CAuBG,QACD,qBAAC,OAAD;GACE,WAAW,GAAG,SAAS,MAAK,WAAU,OAAO,WAAW,YAAY,KAAK,6BAA6B;GACtG,IAAI,SAAS,SAAS,KAAA;GACtB,MAAM,SAAS,YA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kC;EACpU,UAAA;CACG,CAAA,IACJ;AACN"}
|
|
1
|
+
{"version":3,"file":"ComboboxMenu.js","names":["_Fragment"],"sources":["../../src/components/ComboboxMenu.tsx"],"sourcesContent":["import { Fragment, type ReactNode, type RefObject } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { FilterPill } from \"../data/FilterPill\";\nimport { Icon, LabelIcon } from \"../data/Icon\";\nimport { UiCheck } from \"../icons\";\nimport { cn } from \"../lib/utils\";\nimport type { ComboboxOption, ComboboxTriStateMode } from \"./combobox-types\";\nimport type { ComboboxMenuPosition } from \"../lib/combobox\";\n\nexport function ComboboxMenu({\n customEntry,\n filtered,\n floatingZ,\n footer,\n header,\n ariaLabel,\n hasOptions,\n highlighted,\n isSelected,\n listId,\n listRef,\n loading,\n menuPos,\n modes,\n multiple,\n onHighlight,\n onSelect,\n onSetMode,\n tristate,\n}: {\n customEntry: ComboboxOption | null;\n filtered: ComboboxOption[];\n floatingZ: number;\n footer: ReactNode;\n header?: ReactNode;\n ariaLabel?: string | undefined;\n /** Whether the control has an option set at all (before filtering). */\n hasOptions: boolean;\n highlighted: number;\n isSelected: (value: string) => boolean;\n listId: string | undefined;\n listRef: RefObject<HTMLDivElement | null>;\n loading: boolean | undefined;\n /** Floating position; omit to render the list inline in the normal flow below the control. */\n menuPos?: ComboboxMenuPosition | null;\n modes: Record<string, ComboboxTriStateMode>;\n multiple: boolean;\n onHighlight: (index: number) => void;\n onSelect: (option: ComboboxOption) => void;\n onSetMode: (value: string, mode: string) => void;\n tristate: boolean;\n}) {\n const inline = menuPos == null;\n const mobile = menuPos?.strategy === \"mobile\";\n const isEmpty =\n filtered.length === 0 && !customEntry && !loading && !hasOptions && footer == null && !header;\n const listbox = (\n <div\n id={header ? undefined : listId}\n ref={listRef}\n role={header ? undefined : \"listbox\"}\n aria-label={header ? undefined : ariaLabel}\n aria-multiselectable={!header && multiple ? true : undefined}\n {...(menuPos != null\n ? {\n style: {\n position: mobile ? \"absolute\" : \"fixed\",\n ...(menuPos.top != null\n ? { top: menuPos.top }\n : { bottom: menuPos.bottom }),\n left: menuPos.left,\n ...(mobile ? { width: menuPos.width } : { minWidth: menuPos.width }),\n maxWidth: menuPos.maxWidth,\n maxHeight: menuPos.maxHeight,\n zIndex: mobile ? undefined : floatingZ,\n pointerEvents: mobile ? \"auto\" : undefined,\n } as const,\n }\n : {})}\n className={cn(\n \"text-popover-foreground\",\n // Inline is headless: the host panel owns the chrome, sizing and scrolling.\n inline\n ? \"mt-1 w-full\"\n : \"overflow-auto rounded-md border border-border bg-popover p-1 shadow-lg shadow-black/5\",\n !inline && !mobile && \"w-max\",\n )}\n >\n {header}\n <div\n className={cn(filtered.some(option => option.layout === \"responsive\") && \"@container/combobox-options\")}\n id={header ? listId : undefined}\n role={header ? \"listbox\" : undefined}\n aria-label={header ? ariaLabel : undefined}\n aria-multiselectable={header && multiple ? true : undefined}\n >\n {loading && filtered.length === 0 && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n Loading…\n </div>\n )}\n {/* \"No results\" answers \"did my query match anything?\" — a control with\n no option set at all (a free tag list) was never asked the question, so\n it says nothing rather than reporting an empty search. */}\n {!loading && filtered.length === 0 && !customEntry && hasOptions && (\n <div className=\"px-2 py-4 text-center text-sm text-muted-foreground\">\n No results\n </div>\n )}\n {filtered.map((option, index) => {\n const selected = isSelected(option.value);\n const mode = tristate && Object.hasOwn(modes, option.value) ? modes[option.value] : undefined;\n const showHeader =\n option.group != null && option.group !== filtered[index - 1]?.group;\n const selectionIndicator = (\n <span\n data-slot=\"combobox-selection-indicator\"\n aria-hidden\n className={cn(\n \"shrink-0 text-xs\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n selected ? \"opacity-100\" : \"opacity-0\",\n )}\n >\n <Icon icon={UiCheck} />\n </span>\n );\n return (\n <Fragment key={option.value}>\n {showHeader && (\n <div\n role=\"presentation\"\n className=\"select-none px-2 pb-1 pt-2 text-[10px] font-medium uppercase tracking-wide text-muted-foreground\"\n >\n {option.group}\n </div>\n )}\n <div\n id={listId ? `${listId}-${index}` : undefined}\n role=\"option\"\n aria-selected={tristate ? mode != null : selected}\n aria-disabled={option.disabled}\n {...(mode != null\n ? {\n \"aria-label\": `${option.label}, ${\n mode === \"include\" ? \"included\" : \"excluded\"\n }`,\n }\n : {})}\n {...(option.title !== undefined ? { title: option.title } : {})}\n {...(tristate ? { \"data-filter-option\": option.value } : {})}\n onMouseDown={(event) => {\n event.preventDefault();\n if (!tristate && !option.disabled) onSelect(option);\n }}\n {...(tristate\n ? {\n onClick: () => {\n if (!option.disabled) onSelect(option);\n },\n }\n : {})}\n onMouseEnter={() => onHighlight(index)}\n className={cn(\n \"flex cursor-pointer rounded-sm py-1.5 text-sm\",\n multiple ? \"gap-2 px-2\" : \"gap-1.5 px-1.5\",\n option.layout === \"responsive\" ? \"items-start @min-[28rem]/combobox-options:items-center\" : option.description && option.descriptionLayout !== \"inline\" ? \"items-start\" : \"items-center\",\n index === highlighted && \"bg-accent\",\n selected && !tristate && \"font-medium\",\n option.disabled && \"cursor-not-allowed opacity-50\",\n )}\n >\n {tristate ? (\n <div className=\"min-w-0 flex-1\">\n <FilterPill\n mode={mode ?? \"neutral\"}\n togglePosition=\"right\"\n interactive={false}\n label={\n <span className=\"inline-flex min-w-0 items-center gap-1.5\">\n <LabelIcon\n icon={option.icon}\n className=\"shrink-0 text-sm text-muted-foreground\"\n />\n <span className=\"truncate\">{option.label}</span>\n </span>\n }\n onModeChange={(next) => onSetMode(option.value, next)}\n className=\"w-full justify-between\"\n {...(option.count !== undefined\n ? { count: option.count }\n : {})}\n />\n <ComboboxOptionDescription\n description={option.description}\n />\n </div>\n ) : (\n <>\n {multiple && selectionIndicator}\n <LabelIcon\n icon={option.icon}\n className={cn(\n \"shrink-0 text-sm text-muted-foreground\",\n option.description && option.descriptionLayout !== \"inline\" && \"mt-1\",\n )}\n />\n <ComboboxOptionText option={option} />\n {option.trailing != null && option.layout !== \"responsive\" && (\n // Capped and truncating rather than `shrink-0`: in a menu\n // clamped by the viewport edge the label is what identifies\n // the option, so the preview yields first.\n <span className=\"ml-auto min-w-0 max-w-[55%] truncate pl-2 text-right text-xs text-muted-foreground\">\n {option.trailing}\n </span>\n )}\n {!multiple && selectionIndicator}\n </>\n )}\n </div>\n </Fragment>\n );\n })}\n {customEntry && (\n <div\n id={listId ? `${listId}-${filtered.length}` : undefined}\n role=\"option\"\n aria-selected={false}\n data-filter-add-custom={customEntry.value}\n title={customEntry.title}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => onSelect(customEntry)}\n onMouseEnter={() => onHighlight(filtered.length)}\n className={cn(\n \"flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-primary\",\n highlighted === filtered.length && \"bg-accent\",\n )}\n >\n <LabelIcon\n icon={customEntry.icon}\n className=\"text-sm text-muted-foreground\"\n />\n <span className=\"min-w-0 truncate\">{customEntry.label}</span>\n </div>\n )}\n {footer != null && (\n <div className=\"select-none px-2 py-1.5 text-[11px] text-muted-foreground\">\n {footer}\n </div>\n )}\n </div>\n </div>\n );\n if (inline) return isEmpty ? null : listbox;\n return createPortal(\n mobile ? (\n <div\n data-slot=\"combobox-viewport-layer\"\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: floatingZ,\n pointerEvents: \"none\",\n }}\n >\n {listbox}\n </div>\n ) : (\n listbox\n ),\n document.body,\n );\n}\n\nfunction ComboboxOptionText({ option }: { option: ComboboxOption }) {\n const responsive = option.layout === \"responsive\";\n return (\n <span data-slot=\"combobox-option-text\" className={cn(\"min-w-0 flex-1\", responsive ? \"flex flex-col gap-1 @min-[28rem]/combobox-options:flex-row @min-[28rem]/combobox-options:items-center @min-[28rem]/combobox-options:gap-2\" : option.descriptionLayout === \"inline\" && \"flex items-center gap-2\")}>\n <span className={cn(\"block min-w-0\", responsive ? \"whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:flex-1 @min-[28rem]/combobox-options:truncate\" : \"truncate\")}>{option.label}</span>\n <ComboboxOptionDescription description={option.description} inline={option.descriptionLayout === \"inline\"} responsive={responsive} />\n {responsive && option.trailing != null && (\n <span className=\"min-w-0 text-xs font-normal text-muted-foreground @min-[28rem]/combobox-options:ml-auto @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:truncate @min-[28rem]/combobox-options:pl-2 @min-[28rem]/combobox-options:text-right\">\n {option.trailing}\n </span>\n )}\n </span>\n );\n}\n\nfunction ComboboxOptionDescription({\n description,\n inline = false,\n responsive = false,\n}: {\n description: string | undefined;\n inline?: boolean;\n responsive?: boolean;\n}) {\n return description ? (\n <span className={cn(\"text-xs font-normal leading-4 text-muted-foreground\", responsive ? \"min-w-0 whitespace-normal [overflow-wrap:anywhere] @min-[28rem]/combobox-options:max-w-[55%] @min-[28rem]/combobox-options:shrink-0 @min-[28rem]/combobox-options:truncate\" : inline ? \"min-w-0 truncate\" : \"mt-0.5 block whitespace-pre-line\")}>\n {description}\n </span>\n ) : null;\n}\n"],"mappings":";;;;;;;;AASA,SAAgB,aAAa,EAC3B,aACA,UACA,WACA,QACA,QACA,WACA,YACA,aACA,YACA,QACA,SACA,SACA,SACA,OACA,UACA,aACA,UACA,WACA,YAuBC;CACD,MAAM,SAAS,WAAW;CAC1B,MAAM,SAAS,SAAS,aAAa;CACrC,MAAM,UACJ,SAAS,WAAW,KAAK,CAAC,eAAe,CAAC,WAAW,CAAC,cAAc,UAAU,QAAQ,CAAC;CACzF,MAAM,UACJ,qBAAC,OAAD;EACE,IAAI,SAAS,KAAA,IAAY;EACzB,KAAK;EACL,MAAM,SAAS,KAAA,IAAY;EAC3B,cAAY,SAAS,KAAA,IAAY;EACjC,wBAAsB,CAAC,UAAU,WAAW,OAAO,KAAA;EACnD,GAAK,WAAW,OACZ,EACE,OAAO;GACL,UAAU,SAAS,aAAa;GAChC,GAAI,QAAQ,OAAO,OACf,EAAE,KAAK,QAAQ,IAAI,IACnB,EAAE,QAAQ,QAAQ,OAAO;GAC7B,M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AA8I,OAAO,sBAAsB,YAAY,yBAAyB;EAApS,UAAA;GACE,oBAAC,QAAD;IAAM,WAAW,GAAG,iBAAiB,aAAa,2HAA2H,UAAU;IAAI,UAAA,OAAO;GAAY,CAAA;GAC9M,oBAAC,2BAAD;IAA2B,aAAa,OAAO;IAAa,QAAQ,OAAO,sBAAsB;IAAsB;GAAa,CAAA;GACnI,cAAc,OAAO,YAAY,QAChC,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,OAAO;GACJ,CAAA;EAEJ;;AAEV;AAEA,SAAS,0BAA0B,EACjC,aACA,SAAS,OACT,aAAa,SAKZ;CACD,OAAO,cACL,oBAAC,QAAD;EAAM,WAAW,GAAG,uDAAuD,aAAa,+KAA+K,SAAS,qBAAqB,kCAAkC;EACpU,UAAA;CACG,CAAA,IACJ;AACN"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const require_FilterPill = require("../data/FilterPill.cjs");
|
|
2
2
|
const require_filter_bar_context = require("./filter-bar-context.cjs");
|
|
3
3
|
const require_filter_bar_field_utils = require("./filter-bar-field-utils.cjs");
|
|
4
|
+
const require_filter_bar_menu = require("./filter-bar-menu.cjs");
|
|
5
|
+
const require_filter_bar_popup = require("./filter-bar-popup.cjs");
|
|
4
6
|
const require_filter_bar_multi = require("./filter-bar-multi.cjs");
|
|
5
7
|
const require_filter_bar_tree = require("./filter-bar-tree.cjs");
|
|
6
8
|
const require_filter_bar_utils = require("./filter-bar-utils.cjs");
|
|
@@ -17,7 +19,6 @@ const require_use_media_query = require("../hooks/use-media-query.cjs");
|
|
|
17
19
|
const require_breakpoints = require("../lib/breakpoints.cjs");
|
|
18
20
|
const require_use_container_width = require("../hooks/use-container-width.cjs");
|
|
19
21
|
const require_Modal = require("../overlay/Modal.cjs");
|
|
20
|
-
const require_modalStack = require("../overlay/modalStack.cjs");
|
|
21
22
|
const require_button = require("./button.cjs");
|
|
22
23
|
const require_Combobox = require("./Combobox.cjs");
|
|
23
24
|
const require_DateTimePicker = require("./DateTimePicker.cjs");
|
|
@@ -34,7 +35,8 @@ var FILTER_BAR_GAP_PX = 8;
|
|
|
34
35
|
var FILTER_BAR_OVERFLOW_TRIGGER_ESTIMATE_PX = 44;
|
|
35
36
|
/** The bar's own row. Shared with the overlay so the two cannot drift apart. */
|
|
36
37
|
var FILTER_BAR_ROW_CLASS = "flex items-center gap-2 overflow-visible bg-background py-1.5";
|
|
37
|
-
function FilterBar({ search, filters, timeRange, dateRange, children, leading, trailing, className, autoSubmit = true, onApply, applyLabel = "Apply", isPending = false, overflowMode = "responsive", overlay }) {
|
|
38
|
+
function FilterBar({ search, filters, timeRange, dateRange, children, leading, trailing, className, autoSubmit = true, onApply, applyLabel = "Apply", isPending = false, overflowMode = "responsive", variant = "inline", overlay }) {
|
|
39
|
+
const menuVariant = variant === "menu";
|
|
38
40
|
const hasRangeControls = Boolean(timeRange || dateRange);
|
|
39
41
|
const showApply = !autoSubmit && !!onApply;
|
|
40
42
|
const allFilters = (0, react.useMemo)(() => {
|
|
@@ -53,7 +55,7 @@ function FilterBar({ search, filters, timeRange, dateRange, children, leading, t
|
|
|
53
55
|
compact
|
|
54
56
|
}), [autoSubmit, compact]);
|
|
55
57
|
const mobileCollapse = overflowMode === "responsive" ? mobileFilterOverflow : mobilePageOverflow;
|
|
56
|
-
const responsiveOverflow = allFilters.length > 0 && (overflowMode === "responsive" || mobileCollapse || hasForcedOverflow);
|
|
58
|
+
const responsiveOverflow = !menuVariant && allFilters.length > 0 && (overflowMode === "responsive" || mobileCollapse || hasForcedOverflow);
|
|
57
59
|
const filterListRef = (0, react.useRef)(null);
|
|
58
60
|
const overflowTriggerRef = (0, react.useRef)(null);
|
|
59
61
|
const filterNodeRefs = (0, react.useRef)(/* @__PURE__ */ new Map());
|
|
@@ -160,7 +162,13 @@ function FilterBar({ search, filters, timeRange, dateRange, children, leading, t
|
|
|
160
162
|
}),
|
|
161
163
|
search && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchField, { search }),
|
|
162
164
|
children,
|
|
163
|
-
allFilters.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
165
|
+
menuVariant && allFilters.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StagedFilterBarMenu, {
|
|
166
|
+
filters: allFilters,
|
|
167
|
+
applyLabel,
|
|
168
|
+
isPending,
|
|
169
|
+
...onApply ? { onApply } : {}
|
|
170
|
+
}),
|
|
171
|
+
!menuVariant && allFilters.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
164
172
|
ref: filterListRef,
|
|
165
173
|
"data-filter-bar-list": true,
|
|
166
174
|
className: require_utils.cn("flex min-w-0 items-center gap-2", overflowMode === "wrap" ? "flex-wrap" : inlineFilters.length > 0 && "flex-1"),
|
|
@@ -219,11 +227,42 @@ function FilterBar({ search, filters, timeRange, dateRange, children, leading, t
|
|
|
219
227
|
})]
|
|
220
228
|
});
|
|
221
229
|
}
|
|
222
|
-
function
|
|
230
|
+
function StagedFilterBarMenu({ filters, applyLabel, isPending, onApply }) {
|
|
231
|
+
const [stagedValues, setStagedValues] = (0, react.useState)({});
|
|
232
|
+
const stagedFilters = filters.map((filter) => filterWithStagedValue(filter, Object.hasOwn(stagedValues, filter.key) ? stagedValues[filter.key] : filterBarFilterValue(filter), (next) => setStagedValues((current) => ({
|
|
233
|
+
...current,
|
|
234
|
+
[filter.key]: next
|
|
235
|
+
}))));
|
|
236
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_filter_bar_menu.FilterBarMenu, {
|
|
237
|
+
filters: stagedFilters,
|
|
238
|
+
activeCount: filters.filter(require_filter_bar_utils.isFilterBarFilterActive).length,
|
|
239
|
+
applyLabel,
|
|
240
|
+
isPending,
|
|
241
|
+
onOpenChange: () => setStagedValues({}),
|
|
242
|
+
onApply: () => {
|
|
243
|
+
applyStagedFilterValues(filters, stagedValues);
|
|
244
|
+
onApply?.();
|
|
245
|
+
},
|
|
246
|
+
renderPanel: (filter) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterBarFilterPanel, {
|
|
247
|
+
filter,
|
|
248
|
+
chrome: "embedded",
|
|
249
|
+
autoSubmit: false,
|
|
250
|
+
hideLabel: true,
|
|
251
|
+
inlineMenus: true
|
|
252
|
+
})
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
function FilterBarFilterPanel({ filter, chrome = "full", autoSubmit = true, hideLabel = false, inlineMenus = false }) {
|
|
223
256
|
const contextValue = (0, react.useMemo)(() => ({
|
|
224
257
|
autoSubmit,
|
|
225
|
-
compact: false
|
|
226
|
-
|
|
258
|
+
compact: false,
|
|
259
|
+
hideLabels: hideLabel,
|
|
260
|
+
inlineMenus
|
|
261
|
+
}), [
|
|
262
|
+
autoSubmit,
|
|
263
|
+
hideLabel,
|
|
264
|
+
inlineMenus
|
|
265
|
+
]);
|
|
227
266
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_filter_bar_context.FilterBarContext.Provider, {
|
|
228
267
|
value: contextValue,
|
|
229
268
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterBarFilterPanelContent, {
|
|
@@ -337,7 +376,7 @@ function OverflowFiltersMenu({ triggerRef, filters, activeHidden, allHidden, mob
|
|
|
337
376
|
const [stagedValues, setStagedValues] = (0, react.useState)({});
|
|
338
377
|
const hasHidden = filters.length > 0;
|
|
339
378
|
const hiddenFilterKeys = (0, react.useMemo)(() => filters.map((filter) => filter.key).join("\0"), [filters]);
|
|
340
|
-
const { refs, floatingStyles, context, floatingZ, getReferenceProps, getFloatingProps } = useAnchoredPopup(open && !mobilePage, (next) => {
|
|
379
|
+
const { refs, floatingStyles, context, floatingZ, getReferenceProps, getFloatingProps } = require_filter_bar_popup.useAnchoredPopup(open && !mobilePage, (next) => {
|
|
341
380
|
setStagedValues(createFilterValueMap(filters));
|
|
342
381
|
setOpen(next);
|
|
343
382
|
}, "bottom-end");
|
|
@@ -732,12 +771,14 @@ function SelectMultiFilterValueControl({ filter }) {
|
|
|
732
771
|
});
|
|
733
772
|
}
|
|
734
773
|
function FilterBarRangePanel({ kind, label, from = "", to = "", onApply, presets, startOnly, timeEnabled, timeZone, timeZones, fromPlaceholder, toPlaceholder, emptyLabel, disabled }) {
|
|
774
|
+
const { inlineMenus } = (0, react.useContext)(require_filter_bar_context.FilterBarContext);
|
|
735
775
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
736
|
-
className: "w-72 p-3 text-popover-foreground",
|
|
776
|
+
className: inlineMenus ? "text-popover-foreground" : "w-72 p-3 text-popover-foreground",
|
|
737
777
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_TimeRange.TimeRange, {
|
|
738
778
|
kind,
|
|
739
779
|
label,
|
|
740
780
|
align: "left",
|
|
781
|
+
inline: inlineMenus === true,
|
|
741
782
|
from,
|
|
742
783
|
to,
|
|
743
784
|
onApply,
|
|
@@ -756,7 +797,7 @@ function FilterBarRangePanel({ kind, label, from = "", to = "", onApply, presets
|
|
|
756
797
|
}
|
|
757
798
|
function EnumFilterField({ filter, grow }) {
|
|
758
799
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
|
|
759
|
-
...require_filter_bar_field_utils.
|
|
800
|
+
...require_filter_bar_field_utils.useComboboxLabelProps(filter),
|
|
760
801
|
options: enumOptionsToCombobox(filter.options),
|
|
761
802
|
value: filter.value,
|
|
762
803
|
onChange: filter.onChange,
|
|
@@ -829,7 +870,7 @@ function TextFilterField({ filter, grow }) {
|
|
|
829
870
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
830
871
|
title: filter.description,
|
|
831
872
|
className: require_utils.cn("flex h-8 items-center gap-2 rounded-md border border-input bg-muted/30 pl-2 pr-2 text-xs", grow ? "min-w-[12rem] max-w-[18rem] flex-1" : "min-w-[11rem] max-w-[15rem] shrink-0", filter.disabled && "opacity-60", filter.className),
|
|
832
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
873
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputFieldLabel, {
|
|
833
874
|
icon: filter.icon,
|
|
834
875
|
label: filter.label
|
|
835
876
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
@@ -852,14 +893,19 @@ function FilterFieldLabel({ icon, label }) {
|
|
|
852
893
|
}), label]
|
|
853
894
|
});
|
|
854
895
|
}
|
|
896
|
+
function InputFieldLabel(props) {
|
|
897
|
+
if ((0, react.useContext)(require_filter_bar_context.FilterBarContext).hideLabels) return null;
|
|
898
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FilterFieldLabel, { ...props });
|
|
899
|
+
}
|
|
855
900
|
function LookupFilterField({ filter, grow }) {
|
|
901
|
+
const labelProps = require_filter_bar_field_utils.useComboboxLabelProps(filter);
|
|
856
902
|
const [draft, setDraft] = useDebouncedTextDraft(filter.value, filter.onChange);
|
|
857
903
|
if (filter.inputType === "date" || filter.inputType === "number") {
|
|
858
904
|
const dateTitle = filter.inputType === "date" && draft ? require_timestamp_format.formatDateTimeRelative(draft) : void 0;
|
|
859
905
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
860
906
|
title: dateTitle ?? filter.description,
|
|
861
907
|
className: require_utils.cn("flex h-8 items-center gap-2 rounded-md border border-input bg-muted/30 pl-2 pr-2 text-xs", require_filter_bar_field_utils.lookupFieldWidthClass(grow), filter.disabled && "opacity-60", filter.className),
|
|
862
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
908
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InputFieldLabel, {
|
|
863
909
|
icon: filter.icon,
|
|
864
910
|
label: filter.label
|
|
865
911
|
}), filter.inputType === "date" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_DateTimePicker.DateTimePicker, {
|
|
@@ -883,7 +929,7 @@ function LookupFilterField({ filter, grow }) {
|
|
|
883
929
|
});
|
|
884
930
|
}
|
|
885
931
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
|
|
886
|
-
...
|
|
932
|
+
...labelProps,
|
|
887
933
|
options: lookupOptionsToCombobox(filter.options),
|
|
888
934
|
value: filter.value,
|
|
889
935
|
onChange: (text) => filter.onChange(resolveLookupText(filter, text)),
|
|
@@ -891,13 +937,15 @@ function LookupFilterField({ filter, grow }) {
|
|
|
891
937
|
size: "sm",
|
|
892
938
|
className: require_utils.cn(require_filter_bar_field_utils.lookupFieldWidthClass(grow), filter.className),
|
|
893
939
|
...filter.placeholder !== void 0 ? { placeholder: filter.placeholder } : {},
|
|
940
|
+
...filter.onSearch !== void 0 ? { onSearch: filter.onSearch } : {},
|
|
941
|
+
...filter.loading !== void 0 ? { loading: filter.loading } : {},
|
|
894
942
|
...filter.disabled !== void 0 ? { disabled: filter.disabled } : {}
|
|
895
943
|
});
|
|
896
944
|
}
|
|
897
945
|
function LookupMultiFilterField({ filter, grow }) {
|
|
898
946
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Combobox.Combobox, {
|
|
899
947
|
multiple: true,
|
|
900
|
-
...require_filter_bar_field_utils.
|
|
948
|
+
...require_filter_bar_field_utils.useComboboxLabelProps(filter),
|
|
901
949
|
options: lookupOptionsToCombobox(filter.options),
|
|
902
950
|
value: filter.value,
|
|
903
951
|
onChange: filter.onChange,
|
|
@@ -923,7 +971,7 @@ function lookupMultiFilterFooter(filter) {
|
|
|
923
971
|
}
|
|
924
972
|
function NumberFilterField({ filter, grow }) {
|
|
925
973
|
const [open, setOpen] = (0, react.useState)(false);
|
|
926
|
-
const popup = useAnchoredPopup(open, setOpen);
|
|
974
|
+
const popup = require_filter_bar_popup.useAnchoredPopup(open, setOpen);
|
|
927
975
|
const bounds = resolveNumberFilterBounds(filter);
|
|
928
976
|
const [draft, setDraft] = useDebouncedNumberDraft(filter.value, (next) => applyBoundedFilterValue(filter, next));
|
|
929
977
|
const sliderMin = clampNumber(parseFilterNumber(draft.min) ?? bounds.min, bounds.min, bounds.max);
|
|
@@ -1338,7 +1386,7 @@ function NestedMultiFilterField({ filter, grow }) {
|
|
|
1338
1386
|
const [open, setOpen] = (0, react.useState)(false);
|
|
1339
1387
|
const [activeGroup, setActiveGroup] = (0, react.useState)(null);
|
|
1340
1388
|
const [draft, setDraft] = require_filter_bar_field_utils.useDebouncedMultiDraft(filter.value, filter.onChange);
|
|
1341
|
-
const popup = useAnchoredPopup(open, (next) => {
|
|
1389
|
+
const popup = require_filter_bar_popup.useAnchoredPopup(open, (next) => {
|
|
1342
1390
|
setOpen(next);
|
|
1343
1391
|
if (!next) setActiveGroup(null);
|
|
1344
1392
|
});
|
|
@@ -1558,37 +1606,6 @@ function RangeControlButton({ kind, label, from = "", to = "", onApply, presets,
|
|
|
1558
1606
|
...className ? { className } : {}
|
|
1559
1607
|
});
|
|
1560
1608
|
}
|
|
1561
|
-
function useAnchoredPopup(open, onOpenChange, placement = "bottom-start") {
|
|
1562
|
-
const floatingZ = require_modalStack.useFloatingZIndex();
|
|
1563
|
-
const { refs, floatingStyles, context } = (0, _floating_ui_react.useFloating)({
|
|
1564
|
-
open,
|
|
1565
|
-
onOpenChange,
|
|
1566
|
-
placement,
|
|
1567
|
-
whileElementsMounted: _floating_ui_react.autoUpdate,
|
|
1568
|
-
middleware: [
|
|
1569
|
-
(0, _floating_ui_react.offset)(6),
|
|
1570
|
-
(0, _floating_ui_react.flip)({ padding: 8 }),
|
|
1571
|
-
(0, _floating_ui_react.shift)({ padding: 8 })
|
|
1572
|
-
]
|
|
1573
|
-
});
|
|
1574
|
-
const { getReferenceProps, getFloatingProps } = (0, _floating_ui_react.useInteractions)([
|
|
1575
|
-
(0, _floating_ui_react.useClick)(context),
|
|
1576
|
-
(0, _floating_ui_react.useDismiss)(context, { escapeKey: false }),
|
|
1577
|
-
(0, _floating_ui_react.useRole)(context, { role: "dialog" })
|
|
1578
|
-
]);
|
|
1579
|
-
require_modalStack.useEscapeLayer(open, () => {
|
|
1580
|
-
onOpenChange(false);
|
|
1581
|
-
if (refs.domReference.current instanceof HTMLElement) refs.domReference.current.focus();
|
|
1582
|
-
});
|
|
1583
|
-
return {
|
|
1584
|
-
refs,
|
|
1585
|
-
floatingStyles,
|
|
1586
|
-
context,
|
|
1587
|
-
floatingZ,
|
|
1588
|
-
getReferenceProps,
|
|
1589
|
-
getFloatingProps
|
|
1590
|
-
};
|
|
1591
|
-
}
|
|
1592
1609
|
function useDebouncedTextDraft(value, onChange, debounceMs = 500) {
|
|
1593
1610
|
const { autoSubmit } = (0, react.useContext)(require_filter_bar_context.FilterBarContext);
|
|
1594
1611
|
const [draft, setDraft] = (0, react.useState)(value);
|