@kumix/ui 0.3.7 → 0.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -25
- package/dist/cascader-types-BnH6wYD-.d.ts +183 -0
- package/dist/cascader-types-BnH6wYD-.d.ts.map +1 -0
- package/dist/components/agents/ai-sidebar.js +3 -5
- package/dist/components/agents/ai-sidebar.js.map +1 -1
- package/dist/components/motion/animated-sidebar.d.ts.map +1 -1
- package/dist/components/motion/animated-sidebar.js +12 -3
- package/dist/components/motion/animated-sidebar.js.map +1 -1
- package/dist/components/motion/attachment-upload.d.ts.map +1 -1
- package/dist/components/motion/attachment-upload.js +9 -5
- package/dist/components/motion/attachment-upload.js.map +1 -1
- package/dist/components/motion/bottom-sheet.d.ts.map +1 -1
- package/dist/components/motion/bottom-sheet.js +77 -74
- package/dist/components/motion/bottom-sheet.js.map +1 -1
- package/dist/components/motion/center-morph-modal.d.ts.map +1 -1
- package/dist/components/motion/center-morph-modal.js +82 -88
- package/dist/components/motion/center-morph-modal.js.map +1 -1
- package/dist/components/motion/combobox/content.js +1 -1
- package/dist/components/motion/combobox/context.d.ts +6 -0
- package/dist/components/motion/combobox/context.d.ts.map +1 -1
- package/dist/components/motion/combobox/context.js +1 -233
- package/dist/components/motion/combobox/list.js +1 -1
- package/dist/components/motion/combobox/trigger.js +7 -8
- package/dist/components/motion/combobox/trigger.js.map +1 -1
- package/dist/components/motion/combobox.js +1 -1
- package/dist/components/motion/command-palette.d.ts.map +1 -1
- package/dist/components/motion/command-palette.js +62 -45
- package/dist/components/motion/command-palette.js.map +1 -1
- package/dist/components/motion/drawer.d.ts.map +1 -1
- package/dist/components/motion/drawer.js +30 -30
- package/dist/components/motion/drawer.js.map +1 -1
- package/dist/components/motion/loader.js +20 -22
- package/dist/components/motion/loader.js.map +1 -1
- package/dist/components/motion/morphing-modal.d.ts.map +1 -1
- package/dist/components/motion/morphing-modal.js +83 -83
- package/dist/components/motion/morphing-modal.js.map +1 -1
- package/dist/components/motion/morphing-search.d.ts +28 -0
- package/dist/components/motion/morphing-search.d.ts.map +1 -0
- package/dist/components/motion/morphing-search.js +422 -0
- package/dist/components/motion/morphing-search.js.map +1 -0
- package/dist/components/motion/project-folder.js +20 -20
- package/dist/components/motion/project-folder.js.map +1 -1
- package/dist/components/reui/alert.d.ts +1 -1
- package/dist/components/reui/badge.d.ts +1 -1
- package/dist/components/reui/cascader/cascader-async.d.ts +90 -0
- package/dist/components/reui/cascader/cascader-async.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-async.js +549 -0
- package/dist/components/reui/cascader/cascader-async.js.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts +29 -0
- package/dist/components/reui/cascader/cascader-columns.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-columns.js +135 -0
- package/dist/components/reui/cascader/cascader-columns.js.map +1 -0
- package/dist/components/reui/cascader/cascader-context.d.ts +193 -0
- package/dist/components/reui/cascader/cascader-context.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-context.js +59 -0
- package/dist/components/reui/cascader/cascader-context.js.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts +85 -0
- package/dist/components/reui/cascader/cascader-footer.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-footer.js +456 -0
- package/dist/components/reui/cascader/cascader-footer.js.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts +17 -0
- package/dist/components/reui/cascader/cascader-i18n.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-i18n.js +68 -0
- package/dist/components/reui/cascader/cascader-i18n.js.map +1 -0
- package/dist/components/reui/cascader/cascader-item.d.ts +115 -0
- package/dist/components/reui/cascader/cascader-item.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-item.js +530 -0
- package/dist/components/reui/cascader/cascader-item.js.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts +141 -0
- package/dist/components/reui/cascader/cascader-lib.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-lib.js +576 -0
- package/dist/components/reui/cascader/cascader-lib.js.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts +59 -0
- package/dist/components/reui/cascader/cascader-nav.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-nav.js +312 -0
- package/dist/components/reui/cascader/cascader-nav.js.map +1 -0
- package/dist/components/reui/cascader/cascader-types.d.ts +2 -0
- package/dist/components/reui/cascader/cascader-types.js +2 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts +65 -0
- package/dist/components/reui/cascader/cascader-virtual.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader-virtual.js +240 -0
- package/dist/components/reui/cascader/cascader-virtual.js.map +1 -0
- package/dist/components/reui/cascader/cascader.d.ts +322 -0
- package/dist/components/reui/cascader/cascader.d.ts.map +1 -0
- package/dist/components/reui/cascader/cascader.js +1459 -0
- package/dist/components/reui/cascader/cascader.js.map +1 -0
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts +28 -47
- package/dist/components/reui/event-calendar/event-calendar-event.d.ts.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-event.js +26 -44
- package/dist/components/reui/event-calendar/event-calendar-event.js.map +1 -1
- package/dist/components/reui/event-calendar/event-calendar-nav.js +1 -1
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts +19 -57
- package/dist/components/reui/event-calendar/event-calendar-types.d.ts.map +1 -1
- package/dist/components/reui/filters/filters-advanced.d.ts +52 -0
- package/dist/components/reui/filters/filters-advanced.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-advanced.js +1191 -0
- package/dist/components/reui/filters/filters-advanced.js.map +1 -0
- package/dist/components/reui/filters/filters-builder.d.ts +43 -0
- package/dist/components/reui/filters/filters-builder.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-builder.js +152 -0
- package/dist/components/reui/filters/filters-builder.js.map +1 -0
- package/dist/components/reui/filters/filters-chip.d.ts +79 -0
- package/dist/components/reui/filters/filters-chip.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-chip.js +553 -0
- package/dist/components/reui/filters/filters-chip.js.map +1 -0
- package/dist/components/reui/filters/filters-context.d.ts +290 -0
- package/dist/components/reui/filters/filters-context.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-context.js +277 -0
- package/dist/components/reui/filters/filters-context.js.map +1 -0
- package/dist/components/reui/filters/filters-date.d.ts +43 -0
- package/dist/components/reui/filters/filters-date.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-date.js +143 -0
- package/dist/components/reui/filters/filters-date.js.map +1 -0
- package/dist/components/reui/filters/filters-dnd.d.ts +101 -0
- package/dist/components/reui/filters/filters-dnd.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-dnd.js +454 -0
- package/dist/components/reui/filters/filters-dnd.js.map +1 -0
- package/dist/components/reui/filters/filters-draft.d.ts +2 -0
- package/dist/components/reui/filters/filters-draft.js +128 -0
- package/dist/components/reui/filters/filters-draft.js.map +1 -0
- package/dist/components/reui/filters/filters-editors.d.ts +91 -0
- package/dist/components/reui/filters/filters-editors.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-editors.js +773 -0
- package/dist/components/reui/filters/filters-editors.js.map +1 -0
- package/dist/components/reui/filters/filters-i18n.d.ts +24 -0
- package/dist/components/reui/filters/filters-i18n.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-i18n.js +127 -0
- package/dist/components/reui/filters/filters-i18n.js.map +1 -0
- package/dist/components/reui/filters/filters-lib.d.ts +171 -0
- package/dist/components/reui/filters/filters-lib.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-lib.js +336 -0
- package/dist/components/reui/filters/filters-lib.js.map +1 -0
- package/dist/components/reui/filters/filters-operators.d.ts +49 -0
- package/dist/components/reui/filters/filters-operators.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-operators.js +300 -0
- package/dist/components/reui/filters/filters-operators.js.map +1 -0
- package/dist/components/reui/filters/filters-query.d.ts +132 -0
- package/dist/components/reui/filters/filters-query.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-query.js +476 -0
- package/dist/components/reui/filters/filters-query.js.map +1 -0
- package/dist/components/reui/filters/filters-types.d.ts +452 -0
- package/dist/components/reui/filters/filters-types.d.ts.map +1 -0
- package/dist/components/reui/filters/filters-types.js +2 -0
- package/dist/components/reui/filters/filters.d.ts +114 -0
- package/dist/components/reui/filters/filters.d.ts.map +1 -0
- package/dist/components/reui/filters/filters.js +638 -0
- package/dist/components/reui/filters/filters.js.map +1 -0
- package/dist/components/reui/gantt/gantt-bar.js +1 -1
- package/dist/components/reui/gantt/gantt-nav.js +1 -1
- package/dist/components/reui/gantt/gantt-types.d.ts +25 -71
- package/dist/components/reui/gantt/gantt-types.d.ts.map +1 -1
- package/dist/components/reui/gantt/gantt-view.js +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/field.js +2 -2
- package/dist/components/ui/field.js.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/context-BizvUNZv.js +298 -0
- package/dist/context-BizvUNZv.js.map +1 -0
- package/dist/filters-draft-DEAl3TO-.d.ts +70 -0
- package/dist/filters-draft-DEAl3TO-.d.ts.map +1 -0
- package/dist/hooks/use-on-open.d.ts +18 -0
- package/dist/hooks/use-on-open.d.ts.map +1 -0
- package/dist/hooks/use-on-open.js +27 -0
- package/dist/hooks/use-on-open.js.map +1 -0
- package/dist/hooks/use-row-cursor.d.ts +39 -0
- package/dist/hooks/use-row-cursor.d.ts.map +1 -0
- package/dist/hooks/use-row-cursor.js +77 -0
- package/dist/hooks/use-row-cursor.js.map +1 -0
- package/dist/lib/text-shimmer.d.ts +2 -2
- package/dist/lib/text-shimmer.d.ts.map +1 -1
- package/dist/lib/text-shimmer.js +2 -2
- package/dist/lib/text-shimmer.js.map +1 -1
- package/dist/presence-gate-BekdC4Bo.js +24 -0
- package/dist/presence-gate-BekdC4Bo.js.map +1 -0
- package/package.json +11 -11
- package/dist/components/motion/combobox/context.js.map +0 -1
- package/dist/components/reui/filters.d.ts +0 -176
- package/dist/components/reui/filters.d.ts.map +0 -1
- package/dist/components/reui/filters.js +0 -1223
- package/dist/components/reui/filters.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filters-chip.js","names":["React"],"sources":["../../../../src/components/reui/filters/filters-chip.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport {\n ArrowLeftRightIcon,\n ChevronRightIcon,\n CopyIcon,\n CornerDownRightIcon,\n EllipsisVerticalIcon,\n LayersIcon,\n SlidersHorizontalIcon,\n Trash2Icon,\n XIcon,\n} from \"lucide-react\";\n\nimport { cn } from \"@kumix/utils\";\nimport { Button } from \"../../ui/button\";\nimport { ButtonGroup, ButtonGroupText } from \"../../ui/button-group\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"../../ui/dropdown-menu\";\nimport { Popover, PopoverContent, PopoverTrigger } from \"../../ui/popover\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"../../ui/tooltip\";\nimport {\n filterControlSizes,\n filterReadOnlyProps,\n isFilterLocked,\n useFilterActions,\n useFilterChipAutoOpen,\n useFilterChipFocused,\n useFilterFocusEmpty,\n useFilterFocusStore,\n useFilterRender,\n useFilterReorderable,\n} from \"./filters-context\";\nimport { FilterMenu, useFilterOptions, useFilterValueResolution } from \"./filters-editors\";\nimport {\n collapseFilterPath,\n FILTER_MENU_CLASS,\n FILTER_MENU_LABEL_CLASS,\n formatFilterPath,\n getFilterField,\n getFilterFieldChain,\n} from \"./filters-lib\";\nimport {\n coerceFilterValue,\n getFilterArity,\n getFilterOperator,\n operatorTakesValue,\n visibleFilterOperators,\n} from \"./filters-operators\";\nimport { findFilterNode, isFilterGroup } from \"./filters-query\";\nimport type {\n FilterEditorProps,\n FilterField,\n FilterGroupNode,\n FilterOperator,\n FilterRule,\n} from \"./filters-types\";\n\n/** Which part of the chip a pointer or key is aimed at. No `field`: the chip's\n * attribute segment is display only, and only the builder re-picks one. */\ntype ChipSegment = \"operator\" | \"value\" | \"menu\";\n\n/** The ref half of `autoFocusProps`: a CALLBACK ref, the one shape an editor\n * can spread onto any element without a cast, and a no-op here. */\nconst noopAutoFocusRef: React.RefCallback<HTMLElement> = () => {};\n\nfunction defaultValueDisplay<V>(\n value: V | undefined,\n operator: FilterOperator | undefined,\n resolveOption: (value: string) => { label: string } | undefined,\n labels: ReturnType<typeof useFilterActions>[\"labels\"],\n // The field's own word for \"no value yet\", which a generic label cannot beat.\n fieldPlaceholder?: string,\n /** Whether the value is PICKED rather than typed: a select's search prompt\n * and \"enter text...\" both give way to `labels.selectPlaceholder`. */\n optionBacked?: boolean,\n): string {\n const emptyLabel = optionBacked\n ? labels.selectPlaceholder\n : (fieldPlaceholder ?? labels.valuePlaceholder);\n if (value === undefined || value === null || value === \"\") {\n return emptyLabel;\n }\n\n if (getFilterArity(operator) === \"range\" && Array.isArray(value)) {\n const [from, to] = value as unknown[];\n return labels.valueRange(String(from ?? \"\"), String(to ?? \"\"));\n }\n\n if (Array.isArray(value)) {\n const values = value as string[];\n if (values.length === 0) return emptyLabel;\n if (values.length === 1) {\n return resolveOption(values[0])?.label ?? String(values[0]);\n }\n return labels.valueCount(values.length);\n }\n\n if (typeof value === \"boolean\") return value ? \"True\" : \"False\";\n\n return resolveOption(String(value))?.label ?? String(value);\n}\n\n/** The same display with the option's own icon in front. A status filter reads\n * as its colour before its word, so dropping the swatch the picker showed\n * makes the chip harder to scan than the list it came from. */\nfunction valueWithIcon<V>(\n value: V | undefined,\n text: string,\n resolveOption: (value: string) => { icon?: React.ReactNode } | undefined,\n): React.ReactNode {\n const single =\n value === undefined || value === null || Array.isArray(value)\n ? Array.isArray(value) && value.length === 1\n ? String(value[0])\n : null\n : String(value);\n const icon = single ? resolveOption(single)?.icon : null;\n if (!icon) return text;\n return (\n <span className=\"flex items-center gap-1.5\">\n {icon}\n {text}\n </span>\n );\n}\n\n/** The glyph between two ancestors in a nested attribute path, a chevron\n * because the `pathSeparator` string read as loud as the names it parts.\n * DECORATIVE: `aria-hidden`, and the plain string is still what\n * `formatFilterPath` joins for the chip's accessible name and `title`. */\nfunction FilterPathSeparator() {\n return (\n <ChevronRightIcon\n aria-hidden=\"true\"\n data-slot=\"filter-path-separator\"\n className=\"mx-[3px] inline-block size-3 shrink-0 self-center align-[calc(0.3635em-0.375rem)] text-muted-foreground\"\n />\n );\n}\n\n/** The elided run of a collapsed path, with the FULL path behind it. THE\n * TOOLTIP IS NOT THE ACCESSIBLE ROUTE: it is hover and focus, so the segment\n * is `aria-hidden` and the whole path stays in the control's NAME. The host's\n * own `title` is dropped while collapsed (`pathCollapsed`) or both fire. */\nfunction FilterPathEllipsis({ full }: { full: string }) {\n return (\n <TooltipProvider>\n <Tooltip>\n <TooltipTrigger\n render={\n <span\n aria-hidden=\"true\"\n data-slot=\"filter-path-ellipsis\"\n /* A path SEGMENT with no air of its own: the chevron's margin\n is all that parts a name from the next, and this used to STACK\n an `mx` on it. Plain inline, no `vertical-align`: `middle` sat\n the dots 1.7px low and inline-block grew the run to 21.17px. */\n className=\"shrink-0 self-center text-muted-foreground\"\n >\n ...\n </span>\n }\n />\n <TooltipContent>{full}</TooltipContent>\n </Tooltip>\n </TooltipProvider>\n );\n}\n\n/** Everything a rule needs in order to be READ, in either chrome. */\nexport interface FilterRuleDisplay {\n pathText: string;\n pathLabel: React.ReactNode;\n /** Whether `pathLabel` shows fewer names than the path has, so the cell's\n * own `title` can step aside for the ellipsis segment's tooltip. */\n pathCollapsed: boolean;\n operatorLabel: string;\n valueLabel: React.ReactNode;\n /** The same value as PLAIN TEXT, for an accessible name. Never scraped from\n * the `renderValue` node: whatever text survives inside avatars and a count\n * badge announces \"plus one\" for two people. Kept separate from\n * `valueLabel`, not derived from it: a React node has no honest text to\n * read back. A field whose values do not stringify supplies `valueText`\n * itself, or the built-in fallback says \"[object Object]\" to exactly the\n * audience the visible display is hiding it from. */\n valueText: string;\n /** The same value with any collapsed COUNT spelled out. \"3 selected\" cannot\n * be recovered from, which is fine while the editor opens and not once\n * locked, so the control carries this as `title` and, locked, as its name. */\n valueFullText: string;\n valueEmpty: boolean;\n}\n\n/** How one rule reads, resolved once and shared by both chromes, so a consumer\n * `renderValue`, the field's own and the built-in cannot disagree. */\nexport function useFilterRuleDisplay<V, O>(\n rule: FilterRule<V>,\n field: FilterField<V, O> | undefined,\n operator: FilterOperator | undefined,\n): FilterRuleDisplay {\n const actions = useFilterActions<V, O>();\n const render = useFilterRender<V, O>();\n // Lazily: a label needs no options until an editor actually opens.\n const optionsState = useFilterOptions<V, O>(field, false);\n\n const values =\n rule.value === undefined || rule.value === null\n ? []\n : Array.isArray(rule.value)\n ? (rule.value as unknown[])\n : [rule.value];\n\n // Saved views: values the loader has never returned are resolved through the\n // field's own `resolveValues`, so a restored chip reads \"John Doe\", not an id.\n useFilterValueResolution(field, values);\n\n const pathText = formatFilterPath(actions.index, rule.path, actions.labels.pathSeparator);\n\n const chain = getFilterFieldChain(actions.index, rule.path);\n // The CASCADER's collapser, from the actions context rather than per host, so\n // a deep path reads the same on a chip and in a builder row.\n const segments = collapseFilterPath(chain, {\n maxSegments: actions.maxPathSegments,\n collapse: actions.pathCollapse,\n });\n const pathCollapsed = segments.some((segment) => segment.type === \"ellipsis\");\n const pathLabel = chain.length\n ? segments.map((segment, index) => (\n <React.Fragment\n /* Positional, because a field id is unique among its SIBLINGS only:\n \"Company > Team > Company\" is a legal path and its two ids collide. */\n key={segment.type === \"field\" ? `${index}:${segment.field.id}` : `${index}:ellipsis`}\n >\n {index > 0 ? <FilterPathSeparator /> : null}\n {segment.type === \"field\" ? (\n <span>{segment.field.label}</span>\n ) : (\n <FilterPathEllipsis full={pathText} />\n )}\n </React.Fragment>\n ))\n : pathText;\n\n const operatorLabel = operator\n ? rule.negated\n ? actions.labels.negated(operator.label)\n : operator.label\n : rule.operator || actions.labels.selectCondition;\n\n const valueEmpty =\n rule.value === undefined ||\n rule.value === null ||\n rule.value === (\"\" as unknown as V) ||\n values.length === 0;\n\n if (!field) {\n return {\n pathText,\n pathLabel,\n pathCollapsed,\n operatorLabel,\n valueLabel: \"\",\n valueText: \"\",\n valueFullText: \"\",\n valueEmpty,\n };\n }\n\n const valueContext = {\n value: rule.value,\n values,\n field,\n operator: operator ?? { value: rule.operator, label: rule.operator },\n // Resolved, not empty: a custom display needs the option behind each value.\n options: values\n .map((entry) => optionsState.resolve(String(entry)))\n .filter(Boolean) as NonNullable<ReturnType<typeof optionsState.resolve>>[],\n labels: actions.labels,\n };\n\n // Computed even when a custom display replaces it: this is the string the\n // accessible name is built from. `field.valueText` overrides it.\n const valueText = field.valueText\n ? field.valueText(valueContext)\n : defaultValueDisplay(\n rule.value,\n operator,\n optionsState.resolve,\n actions.labels,\n field.placeholder,\n // Option-backed by the FIELD, not the operator: `is any of` is\n // multi-value on a plain text field too, and that one is typed into.\n field.type === \"select\" ||\n field.type === \"multiselect\" ||\n Boolean(field.options?.length) ||\n Boolean(field.loadOptions),\n );\n\n const valueLabel = render.renderValue\n ? render.renderValue(valueContext)\n : field.renderValue\n ? field.renderValue(valueContext)\n : valueWithIcon(rule.value, valueText, optionsState.resolve);\n\n // The list behind the count, or the same text again. Multi-value only: a\n // RANGE also stores an array but already spells both ends out (\"10 to 99\").\n const valueFullText =\n field.valueText ||\n !Array.isArray(rule.value) ||\n getFilterArity(operator) === \"range\" ||\n values.length < 2\n ? valueText\n : actions.labels.valueDetail(\n valueText,\n values.map((entry) => optionsState.resolve(String(entry))?.label ?? String(entry)),\n );\n\n return {\n pathText,\n pathLabel,\n pathCollapsed,\n operatorLabel,\n valueLabel,\n valueText,\n valueFullText,\n valueEmpty,\n };\n}\n\ninterface FilterValueEditorProps<V = unknown, O = unknown> {\n rule: FilterRule<V>;\n field: FilterField<V, O>;\n operator: FilterOperator;\n /** Whether the surface holding it is showing. Gates the option service. */\n open: boolean;\n onClose: () => void;\n}\n\n/** The value editor - draft, option service, commit - with NO surface of its\n * own, so surface and wiring can be replaced independently. The draft lives\n * here, so a text filter dispatches once on commit, not once per keystroke. */\nfunction FilterValueEditor<V, O>({\n rule,\n field,\n operator,\n open,\n onClose,\n}: FilterValueEditorProps<V, O>) {\n const actions = useFilterActions<V, O>();\n const [draft, setDraft] = React.useState<V | undefined>(rule.value);\n\n React.useEffect(() => {\n if (open) setDraft(rule.value);\n }, [open, rule.value]);\n\n const options = useFilterOptions<V, O>(field, open);\n // A LOOKUP, not a definition: every result is a module-level built-in or the\n // consumer's own component, so the editor is never remounted mid-edit.\n const editor = React.useMemo(\n () => actions.resolveEditor(field, operator),\n [actions, field, operator],\n );\n\n if (!editor) return null;\n\n const editorProps: FilterEditorProps<V, O> = {\n field,\n operator,\n value: draft,\n onValueChange: (next) => setDraft(next as V),\n host: \"amend\",\n autoFocusProps: {\n ref: noopAutoFocusRef,\n autoFocus: true,\n },\n commit: (next, commitOptions) => {\n actions.updateRule(rule.id, {\n value: (next === undefined ? draft : next) as V,\n });\n // A multi-select commits per toggle and asks to stay put; others dismiss.\n if (commitOptions?.close === false) return;\n onClose();\n },\n cancel: onClose,\n // The same as cancel, honestly: `back` means something only to a `create`\n // host.\n back: onClose,\n options,\n labels: actions.labels,\n };\n\n // `createElement` rather than JSX: the component comes out of a lookup, so\n // `<Editor />` trips `react-hooks/static-components`. The fragment keeps the\n // props object, which carries a ref, from looking like a ref read in render.\n return <>{React.createElement(editor, editorProps)}</>;\n}\n\n/** One step of the flow, released when the panel that owes it has LEFT THE\n * DOM: both popovers keep portal content mounted through the exit transition,\n * so this unmount IS that moment and nothing is timed. `onRelease` is used AS\n * the cleanup, so an unmemoized callback fires its step early. */\nfunction FilterStepHandoff({ onRelease }: { onRelease: () => void }) {\n React.useEffect(() => onRelease, [onRelease]);\n return null;\n}\n\n/** The value host: the editor in a popover anchored to the value segment, and\n * BOTH routes end here. The operator popover used to draw the editor itself,\n * so a handed-off panel sat a segment's width left of a second press. */\nexport interface FilterValuePopoverProps<V = unknown, O = unknown> {\n rule: FilterRule<V>;\n field: FilterField<V, O>;\n operator: FilterOperator | undefined;\n /** The element that opens it, WITH its own children: a chip segment must be\n * a direct child of its `ButtonGroup` for the pill to fuse. */\n trigger: React.ReactElement;\n className?: string;\n}\n\nexport function FilterValuePopover<V, O>({\n rule,\n field,\n operator,\n trigger,\n className,\n}: FilterValuePopoverProps<V, O>) {\n const actions = useFilterActions<V, O>();\n const focusStore = useFilterFocusStore();\n const autoOpen = useFilterChipAutoOpen(rule.id) === \"value\";\n const [open, setOpen] = React.useState(false);\n const locked = isFilterLocked(actions);\n\n // The last step of the flow as well as the amend route; by now the condition\n // menu has UNMOUNTED (see `FilterStepHandoff`). CONSUMED as it is honoured,\n // or Escape closes the editor and this effect reopens it in the same frame.\n // The `set` stays OUTSIDE the `locked` guard on purpose: a handoff nobody\n // spends sits armed until some later chip spends it, and a chip that opened\n // because a DIFFERENT chip was arrowed onto is worse than one that opened\n // nothing.\n React.useEffect(() => {\n if (!autoOpen || open) return;\n if (!locked) setOpen(true);\n focusStore.set({ id: rule.id, segment: \"value\", autoOpen: false });\n }, [autoOpen, open, focusStore, rule.id, locked]);\n\n // Nothing to open, but the trigger still renders so the value keeps its\n // place, and it wears the bar's state: that hangs on the TRIGGER below,\n // which this path never reaches, so the segment used to look live.\n if (!operator || !actions.resolveEditor(field, operator)) {\n return React.cloneElement(trigger as React.ReactElement<Record<string, unknown>>, {\n disabled: actions.disabled,\n ...filterReadOnlyProps(actions),\n });\n }\n\n return (\n // REFUSES to open while locked rather than leaving it to the trigger: an\n // `aria-disabled` control that still opens an editor is one that lied.\n <Popover\n open={open}\n onOpenChange={(next) => {\n if (next && locked) return;\n setOpen(next);\n }}\n >\n {/* The trigger IS the segment, never a wrapper. `ButtonGroup` fuses\n DIRECT children only (`*:data-slot:rounded-r-none`,\n `[&>[data-slot]~[data-slot]]:border-l-0`), so a nested one keeps its\n own border and the chip reads as separate badges. */}\n <PopoverTrigger\n render={trigger}\n disabled={actions.disabled}\n {...filterReadOnlyProps(actions)}\n />\n <PopoverContent align=\"start\" className={cn(\"w-auto p-0\", className)}>\n <FilterValueEditor<V, O>\n rule={rule}\n field={field}\n operator={operator}\n open={open}\n onClose={() => {\n setOpen(false);\n focusStore.set({ id: rule.id, segment: \"value\", autoOpen: false });\n }}\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n/* A chip's ATTRIBUTE is fixed once the chip exists: no field popover here. A\n new field invalidates the operator and the value, so \"amending\" threw both\n away. The builder keeps its picker, where a row reads as a form. */\n\n/** The condition menu, and the step after it. The list is the cascader run\n * flat: the old hand-rolled one marked the keyboard HIGHLIGHT with\n * `aria-selected` and had no Home, End or typeahead. It HANDS OFF to the\n * value popover once its own panel has left the DOM; advancing in place\n * anchored the editor to the CONDITION segment and doubled up in the row. */\nexport interface FilterOperatorPopoverProps<V = unknown, O = unknown> {\n rule: FilterRule<V>;\n field: FilterField<V, O>;\n trigger: React.ReactElement;\n className?: string;\n}\n\nexport function FilterOperatorPopover<V, O>({\n rule,\n field,\n trigger,\n className,\n}: FilterOperatorPopoverProps<V, O>) {\n const actions = useFilterActions<V, O>();\n const focusStore = useFilterFocusStore();\n const autoOpen = useFilterChipAutoOpen(rule.id) === \"operator\";\n const [open, setOpen] = React.useState(false);\n const locked = isFilterLocked(actions);\n /** Whether the close this panel is going through IS the step being handed\n * on. A ref, so it survives the render that closes the popover. Every OPEN\n * clears it, so an Escape or an outside press finds it already lowered and\n * spends nothing; `release` leaves it standing because one twin asks again\n * later: Radix reads it from `onCloseAutoFocus`, a macrotask after the\n * unmount. Clearing it in `release` would break that twin only. */\n const handoff = React.useRef(false);\n const operators = actions.resolveOperators(field);\n\n // Memoized because the array IS the menu's identity: the cascader rebuilds\n // its index per `items` identity, so a fresh array rebuilds it per keystroke.\n const items = React.useMemo(\n () =>\n visibleFilterOperators(operators).map((entry) => ({\n value: entry.value,\n label: entry.label,\n })),\n [operators],\n );\n\n // Opened by the root the moment the chip is created. CONSUMED here, or the\n // handoff re-opens the menu on the frame Escape closes it. Consumed even\n // while locked, for the reason on the value popover's copy.\n React.useEffect(() => {\n if (!autoOpen || open) return;\n handoff.current = false;\n if (!locked) setOpen(true);\n focusStore.set({ id: rule.id, segment: \"operator\", autoOpen: false });\n }, [autoOpen, open, focusStore, rule.id, locked]);\n\n const close = () => {\n handoff.current = false;\n setOpen(false);\n focusStore.set({ id: rule.id, segment: \"operator\", autoOpen: false });\n };\n\n /** The parked step, spent on the frame this panel stops existing. Memoized\n * on nothing that changes, and load bearing: `FilterStepHandoff` uses this\n * AS its cleanup, so a new identity mid-flow fires the step too early. */\n const release = React.useCallback(() => {\n if (!handoff.current) return;\n focusStore.set({ id: rule.id, segment: \"value\", autoOpen: true });\n }, [focusStore, rule.id]);\n\n // The chip going away takes its step with it: React destroys a deleted\n // subtree top down, so this runs before the panel's own cleanup.\n React.useEffect(\n () => () => {\n handoff.current = false;\n },\n [],\n );\n\n return (\n <Popover\n open={open}\n onOpenChange={(next) => {\n if (next && locked) return;\n /* Escape, an outside press, a second press: none is the step being\n taken, so none may spend it. RETIRED ON OPEN, not on close, and that\n is a twin difference: in Radix an item choice dismisses through here\n too, so retiring on close wiped the request before the unmount. */\n if (next) handoff.current = false;\n setOpen(next);\n }}\n >\n <PopoverTrigger\n render={trigger}\n disabled={actions.disabled}\n {...filterReadOnlyProps(actions)}\n />\n <PopoverContent\n align=\"start\"\n /* Base UI restores focus to the trigger as this panel closes, which\n lands on the condition segment AFTER the value editor has opened and\n focused its input, so a keyboard user is dropped back a step and\n cannot reach the value at all. Suppressed only while the handoff is\n up; a function because Base UI resolves it at close time, which is\n when the ref is accurate. Radix runs the same guard through\n `onCloseAutoFocus`. */\n finalFocus={() => !handoff.current}\n /* `w-auto` with a FLOOR: a catalog sizes to its longest label, and a\n boolean field's \"is\" and \"is not\" would read as a scrap of paper. */\n className={cn(\"w-auto min-w-40 p-0\", className)}\n >\n {/* INSIDE the panel deliberately: only a child of the content is\n unmounted by the exit transition rather than by the close. */}\n <FilterStepHandoff onRelease={release} />\n <FilterMenu\n items={items}\n selected={rule.operator ? [rule.operator] : []}\n onSelectionChange={(values) => {\n const value = values[0];\n /* Deselecting the committed operator is a step back rather than a\n choice, so pressing the current row simply closes. */\n if (value === undefined) {\n close();\n return;\n }\n const chosen = getFilterOperator(operators, value);\n /* BUILDING versus AMENDING, the same fork the advanced row draws\n at its field step. A rule reaches this menu with no operator\n exactly once, while it is being added, and only then is the\n value the step after this one. Re-picking the condition on a\n rule that already has one is an edit of that one cell: it\n commits and closes, and the user opens the value themselves. */\n const building = !rule.operator;\n actions.updateRule(rule.id, {\n operator: value,\n /* The value moves with the operator: \"is\" to \"is any of\" would\n leave a bare string where every reader expects an array. */\n value: coerceFilterValue(\n rule.value,\n getFilterOperator(operators, rule.operator),\n chosen,\n ) as V,\n });\n if (building && operatorTakesValue(chosen)) {\n /* PARKED, not opened: `release` hands the row to its value\n surface once this panel has unmounted. */\n handoff.current = true;\n setOpen(false);\n return;\n }\n close();\n }}\n labels={actions.labels}\n ariaLabel={field.label}\n searchPlaceholder={actions.labels.searchOperators}\n /* No visible search field: a CLOSED enum of six to ten labels, all\n on screen. Still RENDERED, visually hidden, because it owns focus\n and `aria-activedescendant`: arrows, Home, End and typeahead. */\n searchable={false}\n /* Taller than a value list on purpose: the operator set is CLOSED, so\n all of it fits and the height buys the whole catalog. A value list\n is open ended and would only push its own footer off the screen. */\n maxHeight={320}\n /* Deliberately unpinned: one selected operator in a short list, so\n lifting it would lose the catalog's declared reading order. */\n />\n </PopoverContent>\n </Popover>\n );\n}\n\n/** The keyboard path to a CROSS-GROUP move: Alt+Arrow reorders within the\n * owning group only and Wrap creates a NEW group, so the drag layer's\n * cross-group move had no keyboard parity. Numbered in document order. */\nexport function FilterMoveToMenuItems({ nodeId }: { nodeId: string }) {\n const actions = useFilterActions();\n // A menu ITEM takes the native word: both twins already make `disabled`\n // roving-focusable and `aria-disabled`.\n const reorderable = useFilterReorderable();\n const locked = isFilterLocked(actions);\n // Read at render time: the menu's content mounts when the menu opens, so\n // this is the tree the user is looking at.\n const query = actions.getQuery();\n const found = findFilterNode(query, nodeId);\n if (!found?.parent) return null;\n\n const destinations: { id: string; label: string; size: number }[] = [];\n if (found.parent.id !== query.id) {\n destinations.push({\n id: query.id,\n label: actions.labels.moveToTopLevel,\n size: query.rules.length,\n });\n }\n\n let position = 0;\n // `inside` suppresses the PUSH and not the walk, so the numbering stays\n // document order rather than renumbering every group after this one. Counted\n // before the exclusions for the same reason: the current parent is not\n // offered but still holds its number, so the numbering is stable whichever\n // row's menu is open.\n const visit = (group: FilterGroupNode<unknown>, inside: boolean) => {\n for (const child of group.rules) {\n if (!isFilterGroup(child)) continue;\n position += 1;\n // Itself and everything under it: `moveFilterNodeTo` already refuses that\n // move - it would detach the subtree and leave a cycle - so offering it\n // would be a menu row that quietly does nothing.\n const within = inside || child.id === nodeId;\n if (!within && child.id !== found.parent!.id) {\n destinations.push({\n id: child.id,\n label: actions.labels.moveToGroup(position),\n size: child.rules.length,\n });\n }\n visit(child, within);\n }\n };\n visit(query, false);\n\n if (destinations.length === 0) return null;\n\n // The THIRD route into a move, gated on the same switch as the grip and\n // Alt+Arrow: ungated, a builder that draws no handle still reordered here.\n if (!reorderable) return null;\n\n return (\n <>\n {destinations.map((destination) => (\n <DropdownMenuItem\n key={destination.id}\n disabled={locked}\n onClick={() => actions.moveNodeTo(nodeId, destination.id, destination.size)}\n >\n {/* A bend into the destination: movement, not duplication or nesting. */}\n <CornerDownRightIcon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{destination.label}</span>\n </DropdownMenuItem>\n ))}\n </>\n );\n}\n\n/** The per-rule actions, without the trigger: the chip's kebab and a builder\n * row's kebab act on the same rule. `allowGrouping` is the CHROME's answer;\n * \"Convert to advanced filter\" is the CONSUMER's, and hides itself there. */\nexport function FilterRuleMenuItems({\n ruleId,\n /** Offer \"Wrap in condition group\". Off for the chip row, which cannot draw\n * a group; on in the builder, the only way to nest without dragging. */\n allowGrouping = false,\n}: {\n ruleId: string;\n allowGrouping?: boolean;\n}) {\n const actions = useFilterActions();\n // Gated here as well as at the trigger, because this is EXPORTED: a consumer\n // composing their own menu gets rows that say they are unavailable.\n const locked = isFilterLocked(actions);\n return (\n /* Every row leads with an icon. `IconPlaceholder` because the source ships\n under five icon sets; no size class, because each style already sizes an\n unsized svg in a menu row; `aria-hidden`, the label IS the name. */\n <>\n <DropdownMenuItem disabled={locked} onClick={() => actions.duplicateNode(ruleId)}>\n <CopyIcon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{actions.labels.duplicate}</span>\n </DropdownMenuItem>\n <DropdownMenuItem disabled={locked} onClick={() => actions.negateRule(ruleId)}>\n {/* Two arrows swapping: negation flips to the declared inverse. */}\n <ArrowLeftRightIcon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{actions.labels.negate}</span>\n </DropdownMenuItem>\n {allowGrouping ? (\n <DropdownMenuItem disabled={locked} onClick={() => actions.wrapNodeInGroup(ruleId)}>\n {/* Layers: braces read as grouping in only three of the five sets. */}\n <LayersIcon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{actions.labels.wrapInGroup}</span>\n </DropdownMenuItem>\n ) : null}\n {allowGrouping ? <FilterMoveToMenuItems nodeId={ruleId} /> : null}\n {/* OPTIONAL, and gated on both halves of \"would this do anything\": the\n handler is the consumer's opt-in, and an already-advanced bar has\n nothing to convert. NOT gated on `locked`: it changes no query, is\n handed no mutator, and the shipped kebab will not open while locked. */}\n {actions.convertToAdvanced && actions.variant !== \"advanced\" ? (\n <DropdownMenuItem onClick={() => actions.convertToAdvanced?.()}>\n {/* Sliders: the one \"advanced settings\" glyph in all five sets. */}\n <SlidersHorizontalIcon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{actions.labels.convertToAdvanced}</span>\n </DropdownMenuItem>\n ) : null}\n <DropdownMenuItem\n variant=\"destructive\"\n disabled={locked}\n onClick={() => actions.removeNode(ruleId)}\n >\n {/* No colour: the destructive variant already paints the row's svgs. */}\n <Trash2Icon aria-hidden=\"true\" />\n <span className={FILTER_MENU_LABEL_CLASS}>{actions.labels.remove}</span>\n </DropdownMenuItem>\n </>\n );\n}\n\nexport interface FilterChipProps<V = unknown> {\n rule: FilterRule<V>;\n index: number;\n}\n\n/** One filter, as a chip. Memoization means something here: the actions\n * context is stable, the focus store is subscribed to a boolean and the query\n * shares structure, so editing one filter of forty re-renders one chip. */\nfunction FilterChipImpl<V, O>({ rule, index }: FilterChipProps<V>) {\n const actions = useFilterActions<V, O>();\n const render = useFilterRender<V, O>();\n const focusStore = useFilterFocusStore();\n const focused = useFilterChipFocused(rule.id);\n const noFocus = useFilterFocusEmpty();\n const locked = isFilterLocked(actions);\n // THE CHIP'S HEIGHT, by way of the one button in it that has one:\n // `ButtonGroup` is `items-stretch` and no style gives a text segment a\n // height, so the kebab's rung is the pill's. The RADIUS survives because\n // every style whose `icon-sm` rounds differently re-pins it in a group.\n const sizes = filterControlSizes(actions);\n // The kebab is CONTROLLED so it can refuse to open: every mutating row\n // behind it is gated. That puts \"Convert to advanced filter\" out of reach\n // while locked; a consumer-composed menu still draws it.\n const [menuOpen, setMenuOpen] = React.useState(false);\n // Exactly one chip is in the tab order at a time. Before anything has been\n // focused that is the first chip, so Tab reaches the row in one press.\n const isTabStop = focused || (noFocus && index === 0);\n\n const field = getFilterField(actions.index, rule.path);\n const operators = field ? actions.resolveOperators(field) : [];\n const operator = getFilterOperator(operators, rule.operator);\n\n const {\n pathText,\n pathLabel,\n pathCollapsed,\n operatorLabel,\n valueLabel,\n valueText,\n valueFullText,\n valueEmpty,\n } = useFilterRuleDisplay<V, O>(rule, field, operator);\n\n if (!field) {\n // A rule pointing at a field the schema no longer has. Dropping it loses a\n // saved view's data; rendering nothing leaves an invisible condition still\n // filtering. It carries the SAME roving wiring as a real chip: `data-slot`\n // alone joined the arrow-key query with no `tabIndex` to land on.\n return (\n <ButtonGroup\n data-slot=\"filter-chip\"\n data-unknown=\"\"\n role=\"group\"\n aria-label={actions.labels.filterLabel(rule.path.join(actions.labels.pathSeparator))}\n data-focused={focused || undefined}\n data-rule-id={rule.id}\n data-index={index}\n tabIndex={isTabStop ? 0 : -1}\n onFocusCapture={() => {\n if (!focused) focusStore.set({ id: rule.id, segment: null, autoOpen: false });\n }}\n >\n <ButtonGroupText className=\"bg-background text-muted-foreground dark:bg-input/30\">\n {rule.path.join(actions.labels.pathSeparator)}\n </ButtonGroupText>\n <Button\n variant=\"outline\"\n size={sizes.icon}\n className=\"bg-background dark:bg-input/30\"\n aria-label={actions.labels.remove}\n /* It had no gate at all, so the one chip whose whole purpose is to be\n removed could be removed from a bar that refuses every other edit. */\n disabled={actions.disabled}\n {...filterReadOnlyProps(actions)}\n onClick={() => actions.removeNode(rule.id)}\n >\n <XIcon />\n </Button>\n </ButtonGroup>\n );\n }\n\n if (render.renderChip) return <>{render.renderChip(rule)}</>;\n\n const focusSegment = (segment: ChipSegment) =>\n focusStore.set({ id: rule.id, segment, autoOpen: false });\n\n // A rule with no condition yet, KEPT rather than removed (see\n // `isFilterRuleComplete`), so it has to read as unfinished. Through WORDS:\n // the dashed outline it replaces degraded to an underline under sera.\n const incomplete = !rule.operator;\n\n // The same test the value segment renders under, so the name matches the\n // chip: `valueText` alone appended a placeholder to valueless conditions.\n const hasValue = Boolean(rule.operator) && operatorTakesValue(operator);\n\n // The value's spoken form in the chip's NAME: a name is not a prompt, so\n // \"Description contains enter text...\" becomes \"no value\".\n const valueName = valueEmpty && !field.valueText ? actions.labels.noValue : valueText;\n\n return (\n <ButtonGroup\n data-slot=\"filter-chip\"\n role=\"group\"\n aria-label={actions.labels.filterLabel(\n `${pathText} ${operatorLabel}${hasValue ? ` ${valueName}` : \"\"}`.trim() +\n (incomplete ? `, ${actions.labels.incomplete}` : \"\"),\n )}\n data-focused={focused || undefined}\n data-incomplete={incomplete || undefined}\n data-rule-id={rule.id}\n tabIndex={isTabStop ? 0 : -1}\n className={cn(\n /* Sera is an underline style, so the boxed segments are normalised to\n its bottom-border-only look or the chip reads as a mix of both. */\n \"\",\n )}\n onFocusCapture={() => {\n if (!focused) focusStore.set({ id: rule.id, segment: null, autoOpen: false });\n }}\n data-index={index}\n >\n {/* DISPLAY ONLY: a div, not a button, not a tab stop, no popover. The\n attribute is fixed for the life of the chip. */}\n <ButtonGroupText\n /* Dropped while the path is collapsed: the ellipsis inside carries the\n same sentence as a tooltip, and the two would stack. */\n title={pathCollapsed ? undefined : pathText}\n className=\"cursor-default gap-1.5 bg-background dark:bg-input/30\"\n >\n {field.icon}\n {/* Zero gap INSIDE the path, so the separator's own margin is the only\n air around a chevron; `gap-1.5` used to stack 6px a side on it. */}\n <span className=\"flex items-center\">{pathLabel}</span>\n </ButtonGroupText>\n\n <FilterOperatorPopover\n rule={rule}\n field={field}\n trigger={\n <ButtonGroupText\n render={<button type=\"button\" />}\n className={cn(\n \"cursor-default bg-background hover:bg-accent dark:bg-input/30\",\n /* The operator is connective tissue between the field and the\n value, so it reads quieter than either - unless it is still\n the prompt \"Select condition\", the one thing to act on. */\n incomplete ? \"text-foreground\" : \"text-muted-foreground\",\n )}\n onPointerDown={() => focusSegment(\"operator\")}\n >\n {operatorLabel}\n </ButtonGroupText>\n }\n />\n\n {/* No condition, no value: `getFilterArity(undefined)` defaults to \"one\",\n so testing the operator alone renders a stray value segment. */}\n {hasValue ? (\n <FilterValuePopover\n rule={rule}\n field={field}\n operator={operator}\n trigger={\n <ButtonGroupText\n render={<button type=\"button\" />}\n /* Named explicitly rather than by its contents: avatars or a\n \"+2\" badge, and \"plus two\" says nothing about two people. It\n grows to the whole list when the editor cannot be opened,\n since locked it must carry what a press no longer reveals. */\n aria-label={locked ? valueFullText : valueText}\n /* The pointer's route to the same thing, and only when there is\n more to say than the segment already says. */\n title={valueFullText === valueText ? undefined : valueFullText}\n className={cn(\n \"cursor-default bg-background hover:bg-accent dark:bg-input/30\",\n valueEmpty && \"text-muted-foreground\",\n )}\n onPointerDown={() => focusSegment(\"value\")}\n >\n {valueLabel}\n </ButtonGroupText>\n }\n />\n ) : null}\n\n <DropdownMenu\n open={menuOpen}\n onOpenChange={(next) => {\n if (next && locked) return;\n setMenuOpen(next);\n }}\n >\n <DropdownMenuTrigger\n disabled={actions.disabled}\n {...filterReadOnlyProps(actions)}\n render={\n <Button\n variant=\"outline\"\n size={sizes.icon}\n /* The same surface the three text segments force. Styles whose\n outline button is transparent in dark (sera, luma, rhea) left\n the kebab as a notch in an otherwise filled pill. */\n className=\"bg-background dark:bg-input/30\"\n aria-label={actions.labels.chipMenu(field.label)}\n onPointerDown={() => focusSegment(\"menu\")}\n />\n }\n >\n <EllipsisVerticalIcon />\n </DropdownMenuTrigger>\n {/* The SAME sizing the builder's menus use, from one constant: a menu\n that cuts \"Convert to group\" in one chrome is one defect twice. */}\n <DropdownMenuContent align=\"end\" className={cn(FILTER_MENU_CLASS, actions.menuClassName)}>\n <FilterRuleMenuItems ruleId={rule.id} />\n </DropdownMenuContent>\n </DropdownMenu>\n </ButtonGroup>\n );\n}\n\nexport const FilterChip = React.memo(FilterChipImpl) as typeof FilterChipImpl;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqEA,MAAM,yBAAyD,CAAC;AAEhE,SAAS,oBACP,OACA,UACA,eACA,QAEA,kBAGA,cACQ;CACR,MAAM,aAAa,eACf,OAAO,oBACN,oBAAoB,OAAO;CAChC,IAAI,UAAU,KAAA,KAAa,UAAU,QAAQ,UAAU,IACrD,OAAO;CAGT,IAAI,eAAe,QAAQ,MAAM,WAAW,MAAM,QAAQ,KAAK,GAAG;EAChE,MAAM,CAAC,MAAM,MAAM;EACnB,OAAO,OAAO,WAAW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cAAc,uBAChB;KACA,qBAAqB,aAAa,OAAO;KAExC,UAAA;IACc,CAAA;GAEpB,CAAA,IACC;GAEJ,qBAAC,cAAD;IACE,MAAM;IACN,eAAe,SAAS;KACtB,IAAI,QAAQ,QAAQ;KACpB,YAAY,IAAI;IAClB;IALF,UAAA,CAOE,oBAAC,qBAAD;KACE,UAAU,QAAQ;KAClB,GAAI,oBAAoB,OAAO;KAC/B,QACE,oBAAC,QAAD;MACE,SAAQ;MACR,MAAM,MAAM;MAIZ,WAAU;MACV,cAAY,QAAQ,OAAO,SAAS,MAAM,KAAK;MAC/C,qBAAqB,aAAa,MAAM;KACzC,CAAA;KAGH,UAAA,oBAAC,sBAAD,CAAuB,CAAA;IACJ,CAAA,GAGrB,oBAAC,qBAAD;KAAqB,OAAM;KAAM,WAAW,GAAG,mBAAmB,QAAQ,aAAa;KACrF,UAAA,oBAAC,qBAAD,EAAqB,QAAQ,KAAK,GAAK,CAAA;IACpB,CAAA,CACT;;EACH;;AAEjB;AAEA,MAAa,aAAaA,QAAM,KAAK,cAAc"}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { FilterCombinator, FilterDraft, FilterDraftStep, FilterEditor, FilterEditorRegistry, FilterEmptyStateContext, FilterField, FilterIndex, FilterLabels, FilterOperator, FilterOption, FilterQuery, FilterRule, FilterValueDisplayContext, FilterValueType } from "./filters-types.js";
|
|
2
|
+
import { t as FilterDraftAction } from "../../../filters-draft-DEAl3TO-.js";
|
|
3
|
+
import { FilterPathCollapse } from "./filters-lib.js";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
|
+
//#region src/components/reui/filters/filters-context.d.ts
|
|
6
|
+
/** Four publishing channels, not one, so a chip never re-renders at the rate
|
|
7
|
+
* of the fastest: `actions` republishes on a schema, labels or config change,
|
|
8
|
+
* `state` on every query edit and keystroke, `render` on a `renderValue` /
|
|
9
|
+
* `renderChip` identity change, `focus` on every arrow key. The reorder flag
|
|
10
|
+
* and the row-state store further down are contexts too, but not channels the
|
|
11
|
+
* query is published through. */
|
|
12
|
+
/** Stable for the life of the component, bar a config change. Every mutator
|
|
13
|
+
* reads a latest-props ref rather than closing over the state it needs, so a
|
|
14
|
+
* keystroke rebuilds no handler and no memoized chip re-renders. The two lock
|
|
15
|
+
* flags are published rather than kept only in that ref: a refusal that lives
|
|
16
|
+
* in a ref arrives one commit late. The two resolvers are the deliberate
|
|
17
|
+
* exception: they are read DURING render, so they memoize on the values they
|
|
18
|
+
* read instead of going through the ref. Every mutator is also the MUTATION
|
|
19
|
+
* BOUNDARY - `disabled` and `readOnly` are enforced here, not at the call
|
|
20
|
+
* sites that draw the buttons, so a route added next month is refused by
|
|
21
|
+
* construction rather than by remembering. See `isFilterLocked`. */
|
|
22
|
+
interface FilterActionsContextValue<V = unknown, O = unknown> {
|
|
23
|
+
/** Normalized schema. Also on the state context, from the same memo. */
|
|
24
|
+
index: FilterIndex<V, O>;
|
|
25
|
+
labels: FilterLabels;
|
|
26
|
+
operatorCatalog: Record<FilterValueType, FilterOperator[]>;
|
|
27
|
+
editors: FilterEditorRegistry;
|
|
28
|
+
size: "sm" | "default";
|
|
29
|
+
/** The bar is off: nothing operable, and the controls leave the tab order. */
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
/** Readable and navigable, but not changeable. See `isFilterLocked`. */
|
|
32
|
+
readOnly: boolean;
|
|
33
|
+
/** Which chrome is drawing, so a chip kebab can hide its convert row. */
|
|
34
|
+
variant: "basic" | "advanced";
|
|
35
|
+
/** Consumer classes for the menus and the field picker, merged AFTER the
|
|
36
|
+
* primitive's own defaults so a consumer `w-*` wins through tailwind-merge
|
|
37
|
+
* rather than on source order. On the context: four chromes mount the same
|
|
38
|
+
* menu, and a per-chrome prop is set in four places and missed in a fifth. */
|
|
39
|
+
menuClassName: string | undefined;
|
|
40
|
+
fieldPickerClassName: string | undefined;
|
|
41
|
+
/** Turns on the chip kebab's "Convert to advanced filter" row: present means
|
|
42
|
+
* offered. A callback with no boolean beside it, since only the consumer
|
|
43
|
+
* can switch chromes. Changes no query, so it skips the mutation boundary,
|
|
44
|
+
* which is safe only because it is handed no setter: a consumer's handler
|
|
45
|
+
* has no route to the query at all. */
|
|
46
|
+
convertToAdvanced: (() => void) | undefined;
|
|
47
|
+
/** Path shortening, published so BOTH chromes render the same path. */
|
|
48
|
+
pathCollapse: FilterPathCollapse;
|
|
49
|
+
maxPathSegments: number;
|
|
50
|
+
/** Operators for a field, memoized on the catalog and the schema. */
|
|
51
|
+
resolveOperators: (field: FilterField<V, O>) => FilterOperator[];
|
|
52
|
+
resolveEditor: (field: FilterField<V, O>, operator: FilterOperator | undefined) => FilterEditor<V, O> | undefined;
|
|
53
|
+
/** Value-to-label store shared by every `useFilterOptions` under the root. */
|
|
54
|
+
resolution: FilterResolutionStore;
|
|
55
|
+
/** Appends a rule. Defaults to the ROOT group. The parent is a parameter
|
|
56
|
+
* rather than always the root because a nested group's add button is the
|
|
57
|
+
* keyboard path into that group, and routing it through the root then
|
|
58
|
+
* moving it would be two edits and two announcements for one action. */
|
|
59
|
+
addRule: (rule: FilterRule<V>, parentId?: string) => void;
|
|
60
|
+
/** Appends an empty group and returns its id, so the caller can focus it.
|
|
61
|
+
* Returns an EMPTY STRING when the bar is disabled or read only, the one
|
|
62
|
+
* mutator that has to report its refusal: focusing a group that was never
|
|
63
|
+
* created strands the tab stop. `""` rather than `string | null` keeps the
|
|
64
|
+
* callers that already test the id honest without widening a published
|
|
65
|
+
* signature. */
|
|
66
|
+
addGroup: (parentId?: string, combinator?: FilterCombinator) => string;
|
|
67
|
+
updateRule: (id: string, updates: Partial<Omit<FilterRule<V>, "id" | "type">>) => void;
|
|
68
|
+
/** Removes a rule OR a group, and prunes the groups that empties. Node-level
|
|
69
|
+
* rather than rule-level because a chip only ever removes a rule, while a
|
|
70
|
+
* builder row's trash and a group header's trash are the same button on two
|
|
71
|
+
* kinds of node. */
|
|
72
|
+
removeNode: (id: string) => void;
|
|
73
|
+
duplicateNode: (id: string) => void;
|
|
74
|
+
negateRule: (id: string) => void;
|
|
75
|
+
/** Reorders within the node's own parent. Out of range moves are no-ops. */
|
|
76
|
+
moveNode: (id: string, delta: number) => void;
|
|
77
|
+
/** Moves a node into another group, at an index. The drag-and-drop half. */
|
|
78
|
+
moveNodeTo: (id: string, parentId: string, index: number) => void;
|
|
79
|
+
/** Copies a node into another group, at an index. The Alt-drag half, apart
|
|
80
|
+
* from `duplicateNode` (which copies BESIDE, with no destination): the two
|
|
81
|
+
* composed would emit two queries for one gesture, and a controlled
|
|
82
|
+
* consumer would persist a tree the user never asked for. */
|
|
83
|
+
copyNodeTo: (id: string, parentId: string, index: number) => void;
|
|
84
|
+
/** Nests one node in a new group. The keyboard half of the same idea. */
|
|
85
|
+
wrapNodeInGroup: (id: string, combinator?: FilterCombinator) => void;
|
|
86
|
+
/** Dissolves a group into its parent. The inverse of `wrapNodeInGroup`. */
|
|
87
|
+
unwrapGroup: (groupId: string) => void;
|
|
88
|
+
setCombinator: (groupId: string, combinator: FilterCombinator) => void;
|
|
89
|
+
toggleCombinator: (groupId: string) => void;
|
|
90
|
+
clearQuery: () => void;
|
|
91
|
+
openCreate: () => void;
|
|
92
|
+
openAmend: (id: string, step: FilterDraftStep) => void;
|
|
93
|
+
closeDraft: () => void;
|
|
94
|
+
dispatchDraft: (action: FilterDraftAction<V>) => void;
|
|
95
|
+
/** Writes the bar's live region, for a change no visible surface reports: an
|
|
96
|
+
* editor's popover is the one place something destructive happens to rows
|
|
97
|
+
* the user is not on, with focus, name and text unchanged afterwards. Not a
|
|
98
|
+
* query write, so it skips `emit` and asks the lock nothing. */
|
|
99
|
+
announce: (message: string) => void;
|
|
100
|
+
/** Getters for event handlers, so a handler never closes over stale state. */
|
|
101
|
+
getQuery: () => FilterQuery<V>;
|
|
102
|
+
getDraft: () => FilterDraft<V> | null;
|
|
103
|
+
/** Fresh id from the SSR-safe factory. */
|
|
104
|
+
nextId: () => string;
|
|
105
|
+
}
|
|
106
|
+
/** `disabled` and `readOnly` are NOT two words for one state. `disabled` is
|
|
107
|
+
* the native attribute: not operable, out of the tab order. `readOnly` blocks
|
|
108
|
+
* MUTATION and preserves NAVIGATION, because a read-only bar exists so a
|
|
109
|
+
* keyboard or screen reader user can walk the chips and find out what the
|
|
110
|
+
* view is filtered by. Collapsing the two once put the native attribute on
|
|
111
|
+
* all thirteen advanced-builder cell controls while the roving tab stop sat
|
|
112
|
+
* on a disabled element, so not one row could be reached from the keyboard.
|
|
113
|
+
*
|
|
114
|
+
* So a mutating control keeps its tab stop and wears `aria-disabled` plus
|
|
115
|
+
* `data-readonly` (`filterReadOnlyProps`), this repo's convention for
|
|
116
|
+
* "present, focusable, not operable". `aria-readonly` is never used, being
|
|
117
|
+
* disallowed on the button, group and toolbar roles, so the BAR says it in
|
|
118
|
+
* prose through `labels.readOnly`. The refusal itself is enforced once, where
|
|
119
|
+
* all fourteen query writes pass through `emit` in `filters.tsx`. */
|
|
120
|
+
declare function isFilterLocked(state: {
|
|
121
|
+
disabled: boolean;
|
|
122
|
+
readOnly: boolean;
|
|
123
|
+
}): boolean;
|
|
124
|
+
/** What a MUTATING control wears while the bar is read only. `null` when the
|
|
125
|
+
* bar is disabled, because the native attribute already says it. A
|
|
126
|
+
* conditional spread, not explicit `undefined`s: `aria-disabled="false"` on
|
|
127
|
+
* an enabled control is noise, and `data-readonly` is a presence hook. */
|
|
128
|
+
declare function filterReadOnlyProps(state: {
|
|
129
|
+
disabled: boolean;
|
|
130
|
+
readOnly: boolean;
|
|
131
|
+
}): {
|
|
132
|
+
readonly "aria-disabled": true;
|
|
133
|
+
readonly "data-readonly": "";
|
|
134
|
+
} | null;
|
|
135
|
+
/** The two shadcn button sizes one filters size resolves to. Two rungs because
|
|
136
|
+
* shadcn ships a separate ladder for labelled and for icon-only buttons, and
|
|
137
|
+
* pairing them keeps a row's kebab as tall as the cell beside it. */
|
|
138
|
+
interface FilterControlSizes {
|
|
139
|
+
/** Labelled buttons: the row cells, both triggers, the panel footer. */
|
|
140
|
+
button: "sm" | "default";
|
|
141
|
+
/** Icon-only buttons, and also the CHIP's height: a chip is an
|
|
142
|
+
* `items-stretch` `ButtonGroup` and no style gives its text segment a
|
|
143
|
+
* height, so the segments stretch to the kebab, the one child that has one.
|
|
144
|
+
* Sizing the kebab sizes the pill. */
|
|
145
|
+
icon: "icon-sm" | "icon";
|
|
146
|
+
}
|
|
147
|
+
/** The pair for a bar's size, off anything with a `size`, so a
|
|
148
|
+
* consumer-composed chrome uses the same ladder as the shipped one. The
|
|
149
|
+
* fallback is for JavaScript callers: a `"lg"` TypeScript would have rejected
|
|
150
|
+
* must still draw buttons rather than throw on `.button`. */
|
|
151
|
+
declare function filterControlSizes(state: {
|
|
152
|
+
size: "sm" | "default";
|
|
153
|
+
}): FilterControlSizes;
|
|
154
|
+
declare const FilterActionsContext: React$1.Context<FilterActionsContextValue<unknown, unknown> | null>;
|
|
155
|
+
declare function useFilterActions<V = unknown, O = unknown>(): FilterActionsContextValue<V, O>;
|
|
156
|
+
/** Volatile by construction: typing one character into a value editor
|
|
157
|
+
* republishes it. Subscribe from the bar and the panel, never from a chip. */
|
|
158
|
+
interface FilterStateContextValue<V = unknown> {
|
|
159
|
+
query: FilterQuery<V>;
|
|
160
|
+
draft: FilterDraft<V> | null;
|
|
161
|
+
ruleCount: number;
|
|
162
|
+
/** Live region text. Empty except immediately after an announced change. */
|
|
163
|
+
announcement: string;
|
|
164
|
+
/** How many announcements have been made, so a REPEATED one is still heard:
|
|
165
|
+
* `aria-live` reports a DOM mutation and React writes nothing when the
|
|
166
|
+
* string is unchanged, so the chrome keys the region's contents on this. A
|
|
167
|
+
* counter rather than a timestamp: it is compared for identity, never read
|
|
168
|
+
* as a value, and is stable across a rerender that a clock is not. */
|
|
169
|
+
announcementSeq: number;
|
|
170
|
+
}
|
|
171
|
+
declare const FilterStateContext: React$1.Context<FilterStateContextValue<unknown> | null>;
|
|
172
|
+
declare function useFilterState<V = unknown>(): FilterStateContextValue<V>;
|
|
173
|
+
/** Consumer render overrides, on their own channel. They must be
|
|
174
|
+
* always-current closures yet change identity on every parent render when
|
|
175
|
+
* written inline, so isolating them re-renders only what calls them. */
|
|
176
|
+
interface FilterRenderContextValue<V = unknown, O = unknown> {
|
|
177
|
+
renderValue?: (context: FilterValueDisplayContext<V, O>) => React$1.ReactNode;
|
|
178
|
+
renderChip?: (rule: FilterRule<V>) => React$1.ReactNode;
|
|
179
|
+
renderEmpty?: (context: FilterEmptyStateContext) => React$1.ReactNode;
|
|
180
|
+
}
|
|
181
|
+
declare const FilterRenderContext: React$1.Context<FilterRenderContextValue<unknown, unknown>>;
|
|
182
|
+
declare function useFilterRender<V = unknown, O = unknown>(): FilterRenderContextValue<V, O>;
|
|
183
|
+
/** Which chip currently owns the row's single tab stop. */
|
|
184
|
+
interface FilterFocus {
|
|
185
|
+
id: string | null;
|
|
186
|
+
/** Which cell inside that row, for restoring focus after an edit. A chip
|
|
187
|
+
* draws only `field`, `operator`, `value` and `menu`; the rest are advanced
|
|
188
|
+
* builder cells, where a GROUP header is a row too (its `field` is the
|
|
189
|
+
* combinator sentence). One union, because the chromes share the store. */
|
|
190
|
+
segment: "combinator" | "field" | "operator" | "value" | "add" | "menu" | "ungroup" | "remove" | "drag" | null;
|
|
191
|
+
/** Open that segment's popover, not merely focus it. Picking a field commits
|
|
192
|
+
* the rule straight away and the chip appears with no condition yet, so the
|
|
193
|
+
* operator menu has to open ON THE CHIP without a second click. */
|
|
194
|
+
autoOpen: boolean;
|
|
195
|
+
}
|
|
196
|
+
/** An external store, deliberately NOT React state. A roving tabindex
|
|
197
|
+
* republishes on every arrow key, and `setState` would re-render the whole
|
|
198
|
+
* bar to move one outline. The SELECTOR hooks below each narrow to one value,
|
|
199
|
+
* so arrowing across forty chips re-renders two components. `useFilterFocus`
|
|
200
|
+
* is the exception: it returns the whole snapshot. */
|
|
201
|
+
interface FilterFocusStore {
|
|
202
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
203
|
+
getSnapshot: () => FilterFocus;
|
|
204
|
+
/** No-ops when nothing changed. */
|
|
205
|
+
set: (next: FilterFocus) => void;
|
|
206
|
+
}
|
|
207
|
+
declare function createFilterFocusStore(): FilterFocusStore;
|
|
208
|
+
declare const FilterFocusContext: React$1.Context<FilterFocusStore>;
|
|
209
|
+
declare const FilterReorderProvider: React$1.Provider<boolean>;
|
|
210
|
+
declare function useFilterReorderable(): boolean;
|
|
211
|
+
/** Which rules the user has actually edited the VALUE of, which decides WHEN
|
|
212
|
+
* an error may appear: "Add filter" mints a row with no value, so flagging
|
|
213
|
+
* every invalid row turns the builder red before the user did anything wrong.
|
|
214
|
+
* An issue is still COLLECTED for every rule - the footer count,
|
|
215
|
+
* `onQueryChange` and tree validity do not change - and only DRAWN once the
|
|
216
|
+
* user has committed a value. An external store for the focus store's reason,
|
|
217
|
+
* keyed by rule id and never pruned: a stale id costs one Set entry, and
|
|
218
|
+
* reconciling against the query on every commit is hot-path work. */
|
|
219
|
+
interface FilterRowStateStore {
|
|
220
|
+
subscribe: (listener: () => void) => () => void;
|
|
221
|
+
/** Bumped on every write. What a memo depends on, since the Sets are mutable. */
|
|
222
|
+
version: () => number;
|
|
223
|
+
/** Whether this rule has had a value committed to it by the user. */
|
|
224
|
+
has: (id: string) => boolean;
|
|
225
|
+
mark: (id: string) => void;
|
|
226
|
+
/** Starts this rule over. Changing a rule's ATTRIBUTE resets its operator
|
|
227
|
+
* and its value, so it has to reset this too, or the row stays warned about
|
|
228
|
+
* a value that no longer exists on a field the user navigated away from. */
|
|
229
|
+
unmark: (id: string) => void;
|
|
230
|
+
/** Whether this rule is still being CREATED: minted by Add filter and not
|
|
231
|
+
* yet given an attribute. The row enters the query with a guessed field to
|
|
232
|
+
* keep the tree valid, so while pending the builder draws only that cell. */
|
|
233
|
+
isPending: (id: string) => boolean;
|
|
234
|
+
markPending: (id: string) => void;
|
|
235
|
+
/** The attribute was chosen. The rest of the row appears. */
|
|
236
|
+
resolvePending: (id: string) => void;
|
|
237
|
+
/** Forgets everything. The bar's own Clear all, and a whole-tree replace. */
|
|
238
|
+
reset: () => void;
|
|
239
|
+
}
|
|
240
|
+
declare function createFilterRowStateStore(): FilterRowStateStore;
|
|
241
|
+
declare const FilterRowStateProvider: React$1.Provider<FilterRowStateStore>;
|
|
242
|
+
/** The store itself, for handlers that write without subscribing. */
|
|
243
|
+
declare function useFilterRowStateStore(): FilterRowStateStore;
|
|
244
|
+
/** Whether THIS rule is still waiting for its attribute. */
|
|
245
|
+
declare function useFilterRowPending(id: string): boolean;
|
|
246
|
+
/** Whether THIS rule may show an error yet. */
|
|
247
|
+
declare function useFilterTouched(id: string): boolean;
|
|
248
|
+
/** The whole focus snapshot, so the caller re-renders on EVERY move anywhere
|
|
249
|
+
* in the row. A chip wants `useFilterChipFocused` or `useFilterSegmentFocus`
|
|
250
|
+
* below instead. */
|
|
251
|
+
declare function useFilterFocus(): FilterFocus;
|
|
252
|
+
/** The store itself, for event handlers that write without subscribing. */
|
|
253
|
+
declare function useFilterFocusStore(): FilterFocusStore;
|
|
254
|
+
/** The segment of THIS chip that should open itself, or null. */
|
|
255
|
+
declare function useFilterChipAutoOpen(id: string): FilterFocus["segment"] | null;
|
|
256
|
+
/** Whether the row holds no focus, so the first chip keeps the tab stop. */
|
|
257
|
+
declare function useFilterFocusEmpty(): boolean;
|
|
258
|
+
/** Whether THIS chip owns the row's tab stop. */
|
|
259
|
+
declare function useFilterChipFocused(id: string): boolean;
|
|
260
|
+
/** Which segment of THIS rule owns the tab stop, or null when another rule
|
|
261
|
+
* does. A chip needs one boolean, but an advanced row is a grid ROW whose tab
|
|
262
|
+
* stop is a (row, column) pair, and the column has to come from this store
|
|
263
|
+
* too or the chromes disagree about where focus is after an edit. */
|
|
264
|
+
declare function useFilterSegmentFocus(id: string): FilterFocus["segment"];
|
|
265
|
+
/** The instance-wide value-to-label store. `useFilterOptions` caches per HOOK
|
|
266
|
+
* INSTANCE, and a chip's display and its editor are two instances, so a
|
|
267
|
+
* `loadOptions`-only field rendered its raw id the moment the menu closed.
|
|
268
|
+
* Every instance under one root writes here, and `resolveValues` results land
|
|
269
|
+
* here too. External rather than React state because labels arrive from
|
|
270
|
+
* effects and promises at their own pace, and the version bumps only when a
|
|
271
|
+
* NEW label lands, so a subscriber re-renders once per page of results. */
|
|
272
|
+
interface FilterResolutionStore {
|
|
273
|
+
subscribe: (onStoreChange: () => void) => () => void;
|
|
274
|
+
getVersion: () => number;
|
|
275
|
+
/** The option behind a stored value, or undefined while unresolved. */
|
|
276
|
+
get: (fieldKey: string, value: string) => FilterOption | undefined;
|
|
277
|
+
/** Records options under a field key. New values bump the version. */
|
|
278
|
+
set: (fieldKey: string, options: readonly FilterOption[]) => void;
|
|
279
|
+
/** Marks values as resolving and returns the subset nobody has claimed yet,
|
|
280
|
+
* so two chips holding the same id issue ONE request. Claims are permanent
|
|
281
|
+
* for values a fulfilled resolve did not return, which stops an id the
|
|
282
|
+
* server does not know from being re-asked forever. */
|
|
283
|
+
claim: (fieldKey: string, values: readonly string[]) => string[];
|
|
284
|
+
/** Releases claims after a FAILED resolve, so a later mount may retry. */
|
|
285
|
+
release: (fieldKey: string, values: readonly string[]) => void;
|
|
286
|
+
}
|
|
287
|
+
declare function createFilterResolutionStore(): FilterResolutionStore;
|
|
288
|
+
//#endregion
|
|
289
|
+
export { FilterActionsContext, FilterActionsContextValue, FilterControlSizes, FilterFocus, FilterFocusContext, FilterFocusStore, FilterRenderContext, FilterRenderContextValue, FilterReorderProvider, FilterResolutionStore, FilterRowStateProvider, FilterRowStateStore, FilterStateContext, FilterStateContextValue, createFilterFocusStore, createFilterResolutionStore, createFilterRowStateStore, filterControlSizes, filterReadOnlyProps, isFilterLocked, useFilterActions, useFilterChipAutoOpen, useFilterChipFocused, useFilterFocus, useFilterFocusEmpty, useFilterFocusStore, useFilterRender, useFilterReorderable, useFilterRowPending, useFilterRowStateStore, useFilterSegmentFocus, useFilterState, useFilterTouched };
|
|
290
|
+
//# sourceMappingURL=filters-context.d.ts.map
|
|
@@ -0,0 +1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