@alfadocs/ui-kit-debug 1.16.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{balance-badge-cell-CgkxYO96.js → balance-badge-cell-DNjHODfP.js} +461 -449
- package/dist/_chunks/balance-badge-cell-DNjHODfP.js.map +1 -0
- package/dist/_chunks/calendar-workspace-Ca0n_r1v.js +7341 -0
- package/dist/_chunks/calendar-workspace-Ca0n_r1v.js.map +1 -0
- package/dist/_chunks/{file-manager-DJMeB3V8.js → file-manager-spc3_khe.js} +152 -136
- package/dist/_chunks/file-manager-spc3_khe.js.map +1 -0
- package/dist/_chunks/{link-cell-renderer-CIASXsVM.js → link-cell-renderer-B-xrUPew.js} +126 -116
- package/dist/_chunks/link-cell-renderer-B-xrUPew.js.map +1 -0
- package/dist/_chunks/{signature-field-CEiPe-vX.js → signature-field-0rFODJlW.js} +34 -19
- package/dist/_chunks/signature-field-0rFODJlW.js.map +1 -0
- package/dist/agent-catalog.json +10 -56
- package/dist/agent-i18n/en.json +3 -5
- package/dist/components/data-table/calendar-day.d.ts +26 -0
- package/dist/components/data-table/calendar-day.d.ts.map +1 -0
- package/dist/components/data-table/cell-renderers/date-cell-renderer.d.ts.map +1 -1
- package/dist/components/data-table/filters/date-range-filter.d.ts +2 -20
- package/dist/components/data-table/filters/date-range-filter.d.ts.map +1 -1
- package/dist/components/data-table/index.js +1 -1
- package/dist/components/file-manager/index.js +1 -1
- package/dist/components/patient-table/cell-renderers/transaction-chip-cell.d.ts +6 -0
- package/dist/components/patient-table/cell-renderers/transaction-chip-cell.d.ts.map +1 -1
- package/dist/components/patient-table/columns.d.ts +6 -0
- package/dist/components/patient-table/columns.d.ts.map +1 -1
- package/dist/components/patient-table/index.js +1 -1
- package/dist/components/patient-table/patient-table.d.ts +6 -0
- package/dist/components/patient-table/patient-table.d.ts.map +1 -1
- package/dist/components/signature-field/index.js +1 -1
- package/dist/i18n/locales/ar.d.ts +0 -38
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +2 -40
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts +0 -38
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +2 -40
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/el.d.ts +0 -38
- package/dist/i18n/locales/el.d.ts.map +1 -1
- package/dist/i18n/locales/el.js +2 -40
- package/dist/i18n/locales/el.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +0 -38
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +2 -40
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts +0 -38
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +2 -40
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts +0 -38
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +2 -40
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts +0 -38
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +2 -40
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/it.d.ts +0 -38
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +2 -40
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts +0 -38
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +2 -40
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts +0 -38
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +2 -40
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts +0 -38
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +2 -40
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts +0 -38
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +2 -40
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ro.d.ts +0 -38
- package/dist/i18n/locales/ro.d.ts.map +1 -1
- package/dist/i18n/locales/ro.js +2 -40
- package/dist/i18n/locales/ro.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts +0 -38
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +2 -40
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/sq.d.ts +0 -38
- package/dist/i18n/locales/sq.d.ts.map +1 -1
- package/dist/i18n/locales/sq.js +2 -40
- package/dist/i18n/locales/sq.js.map +1 -1
- package/dist/i18n/locales/sv.d.ts +0 -38
- package/dist/i18n/locales/sv.d.ts.map +1 -1
- package/dist/i18n/locales/sv.js +2 -40
- package/dist/i18n/locales/sv.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts +0 -38
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +2 -40
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/zh.d.ts +0 -38
- package/dist/i18n/locales/zh.d.ts.map +1 -1
- package/dist/i18n/locales/zh.js +2 -40
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/index.js +5 -5
- package/dist/locales/ar.json +2 -40
- package/dist/locales/de.json +2 -40
- package/dist/locales/el.json +2 -40
- package/dist/locales/en.json +2 -40
- package/dist/locales/es.json +2 -40
- package/dist/locales/fr.json +2 -40
- package/dist/locales/hi.json +2 -40
- package/dist/locales/it.json +2 -40
- package/dist/locales/ja.json +2 -40
- package/dist/locales/nl.json +2 -40
- package/dist/locales/pl.json +2 -40
- package/dist/locales/pt.json +2 -40
- package/dist/locales/ro.json +2 -40
- package/dist/locales/ru.json +2 -40
- package/dist/locales/sq.json +2 -40
- package/dist/locales/sv.json +2 -40
- package/dist/locales/tr.json +2 -40
- package/dist/locales/zh.json +2 -40
- package/dist/patterns/calendar/calendar-workspace.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.sheets.d.ts +4 -8
- package/dist/patterns/calendar/calendar.sheets.d.ts.map +1 -1
- package/dist/patterns/calendar/calendar.surface.d.ts.map +1 -1
- package/dist/patterns/calendar/index.js +1 -1
- package/package.json +1 -1
- package/dist/_chunks/balance-badge-cell-CgkxYO96.js.map +0 -1
- package/dist/_chunks/calendar-workspace-B87-QI8L.js +0 -7606
- package/dist/_chunks/calendar-workspace-B87-QI8L.js.map +0 -1
- package/dist/_chunks/file-manager-DJMeB3V8.js.map +0 -1
- package/dist/_chunks/folder-plus-CutOs4DP.js +0 -22
- package/dist/_chunks/folder-plus-CutOs4DP.js.map +0 -1
- package/dist/_chunks/link-cell-renderer-CIASXsVM.js.map +0 -1
- package/dist/_chunks/signature-CpFNpsVK.js +0 -21
- package/dist/_chunks/signature-CpFNpsVK.js.map +0 -1
- package/dist/_chunks/signature-field-CEiPe-vX.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-cell-renderer-B-xrUPew.js","sources":["../../src/components/data-table/calendar-day.ts","../../src/components/data-table/filters/date-range-filter.tsx","../../src/components/data-table/filters/select-filter.tsx","../../src/components/data-table/filters/typeahead-filter.tsx","../../src/components/data-table/filters/number-filter.tsx","../../src/components/data-table/cell-renderers/status-cell-renderer.tsx","../../src/components/data-table/cell-renderers/user-cell-renderer.tsx","../../src/components/data-table/cell-renderers/image-cell-renderer.tsx","../../src/components/data-table/cell-renderers/tag-list-cell-renderer.tsx","../../src/components/data-table/cell-renderers/date-cell-renderer.tsx","../../src/components/data-table/cell-renderers/link-cell-renderer.tsx"],"sourcesContent":["/**\n * Calendar-day helpers, shared by the date filter and the date cell renderer.\n *\n * A calendar day is not an instant. `new Date('2008-09-06')` is UTC midnight,\n * which every local getter then reads back shifted: west of UTC it is the 5th.\n * Everything here works in local date parts so a day stays the day it was\n * written with, whatever zone the browser is in.\n */\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst ISO_DAY_PREFIX = /^(\\d{4}-\\d{2}-\\d{2})/;\n\n/**\n * A `Date` as `YYYY-MM-DD`, read off the LOCAL date parts — `toISOString()`\n * would shift a local midnight to the previous day anywhere east of UTC.\n */\nexport function toIsoDate(d: Date | undefined): string | null {\n if (!d) return null;\n const y = d.getFullYear();\n const m = String(d.getMonth() + 1).padStart(2, '0');\n const day = String(d.getDate()).padStart(2, '0');\n return `${y}-${m}-${day}`;\n}\n\n/** Whether a value is a bare `YYYY-MM-DD` — a calendar day, carrying no instant. */\nexport function isCalendarDay(s: unknown): s is string {\n return typeof s === 'string' && DATE_ONLY.test(s);\n}\n\n/** A bare day parses as LOCAL midnight; anything with a time/offset as-is. */\nexport function fromIsoDate(s: string | null | undefined): Date | undefined {\n if (!s) return undefined;\n const d = DATE_ONLY.test(s)\n ? new Date(\n Number(s.slice(0, 4)),\n Number(s.slice(5, 7)) - 1,\n Number(s.slice(8, 10)),\n )\n : new Date(s);\n return Number.isNaN(d.getTime()) ? undefined : d;\n}\n\n/**\n * The calendar day a cell value stands for, as `YYYY-MM-DD`.\n *\n * An ISO string is read as the day it was WRITTEN with — `2026-04-15T17:32+02:00`\n * is the 15th and `1933-04-04T00:00+01:00` the 4th, whatever zone the browser\n * is in. Anything else is parsed and read off its local parts.\n */\nexport function dayOf(cellValue: unknown): string | null {\n if (cellValue === null || cellValue === undefined || cellValue === '')\n return null;\n if (typeof cellValue === 'string') {\n const prefix = ISO_DAY_PREFIX.exec(cellValue);\n if (prefix) return prefix[1];\n }\n const d = cellValue instanceof Date ? cellValue : new Date(String(cellValue));\n return Number.isNaN(d.getTime()) ? null : toIsoDate(d);\n}\n","import { useEffect, useState } from 'react';\nimport type {\n CustomFilterProps,\n CustomFloatingFilterProps,\n} from 'ag-grid-react';\nimport { useGridFilter } from 'ag-grid-react';\nimport type { IFilter } from 'ag-grid-community';\nimport { DateRangePicker } from '../../date-range-picker';\nimport type { DateRangeValue } from '../../date-range-picker';\n// Calendar-day handling lives in one place: the date cell renderer needs the\n// same rules and must not import from a filter to get them.\nimport { dayOf, fromIsoDate, toIsoDate } from '../calendar-day';\n\nexport { dayOf, fromIsoDate, toIsoDate };\n\n/**\n * Custom AG Grid filter component for date *ranges*. AG Grid Community's\n * built-in `agDateColumnFilter` only handles single-date comparison —\n * platform needs \"between X and Y\" for invoice / transaction lists.\n *\n * Wire on a colDef:\n * ```tsx\n * { field: 'date', filter: DateRangeFilter }\n * ```\n *\n * The filter model has shape `{ type: 'inRange', dateFrom, dateTo }` to\n * stay close to AG Grid's own date-filter convention so server-side\n * adapters can interpret it the same way.\n */\nexport interface DateRangeFilterModel {\n type: 'inRange';\n dateFrom: string | null;\n dateTo: string | null;\n}\n\n/**\n * `filterParams` a colDef may pass to `DateRangeFilter` /\n * `DateRangeFloatingFilter`.\n *\n * `commitMode` is forwarded to the wrapped `DateRangePicker`. Leave it unset\n * (picker default `'auto'`, commit-on-complete-range) for cheap client-side row\n * models; set `'apply'` for SERVER-side row models so each range edit defers to\n * one Apply and fires a single datasource round-trip instead of one per commit.\n */\nexport interface DateRangeFilterParams {\n placeholder?: string;\n commitMode?: 'auto' | 'apply';\n}\n\n/** Whether a cell's day lies within `[dateFrom, dateTo]` (either end open). */\nexport function dayInRange(\n cellValue: unknown,\n dateFrom: string | null | undefined,\n dateTo: string | null | undefined,\n): boolean {\n if (!dateFrom && !dateTo) return true;\n const day = dayOf(cellValue);\n if (!day) return false;\n if (dateFrom && day < dateFrom) return false;\n if (dateTo && day > dateTo) return false;\n return true;\n}\n\nexport function DateRangeFilter(\n props: CustomFilterProps<unknown, unknown, DateRangeFilterModel>,\n) {\n const { model, onModelChange, getValue, doesRowPassOtherFilter } = props;\n const filterParams =\n (props.colDef?.filterParams as DateRangeFilterParams | undefined) ?? {};\n // Picker UI state, seeded from the model and kept in sync when the model\n // changes externally — a programmatic default (e.g. \"this week\"), a server\n // restore, or an AG Grid reset. Mirrors `SelectFilter`'s `pending` sync.\n const [range, setRange] = useState<DateRangeValue>(() => ({\n from: fromIsoDate(model?.dateFrom),\n to: fromIsoDate(model?.dateTo),\n }));\n useEffect(() => {\n setRange({\n from: fromIsoDate(model?.dateFrom),\n to: fromIsoDate(model?.dateTo),\n });\n }, [model?.dateFrom, model?.dateTo]);\n\n // Tell AG Grid how to evaluate a row against the current model. AG Grid\n // calls this for each row; we read the cell value via `getValue(node)`\n // (a Date or ISO string), compare to the bounds. Bounds come from the\n // MODEL (the source of truth) — not the picker state — so a model set\n // programmatically applies even before the picker UI has mounted, exactly\n // as `SelectFilter` reads `model.values` directly.\n useGridFilter({\n doesFilterPass: (params) => {\n void doesRowPassOtherFilter;\n return dayInRange(getValue(params.node), model?.dateFrom, model?.dateTo);\n },\n });\n\n function apply(next: DateRangeValue) {\n setRange(next);\n if (!next.from && !next.to) {\n onModelChange(null);\n return;\n }\n onModelChange({\n type: 'inRange',\n dateFrom: toIsoDate(next.from),\n dateTo: toIsoDate(next.to),\n } satisfies DateRangeFilterModel);\n }\n\n return (\n <div\n data-component=\"date-range-filter\"\n className=\"ds:p-[var(--spacing-sm)] ds:min-w-[280px]\"\n >\n <DateRangePicker\n value={range}\n onChange={apply}\n commitMode={filterParams.commitMode}\n size=\"sm\"\n />\n </div>\n );\n}\n\n/**\n * Floating-filter companion for `DateRangeFilter`.\n *\n * Renders the kit's `<DateRangePicker>` directly as the floating-filter\n * input — its built-in trigger button + calendar popover IS the filter\n * UI. Earlier versions wrapped the picker in a second `<Popover>`,\n * producing the \"click → empty popover with another trigger → click\n * again → calendar\" double-step that read as duplicated UI.\n */\nexport function DateRangeFloatingFilter(\n props: CustomFloatingFilterProps<\n IFilter,\n unknown,\n unknown,\n DateRangeFilterModel\n >,\n) {\n const { model, onModelChange, column } = props;\n // Let a colDef supply a short `filterParams.placeholder` for the in-row\n // trigger — the default \"Select date range\" is long for a narrow filter\n // column. (The label truncates cleanly either way; a short placeholder just\n // reads better.)\n const filterParams =\n (column?.getColDef?.()?.filterParams as\n | DateRangeFilterParams\n | undefined) ?? {};\n const [range, setRange] = useState<DateRangeValue>(() => ({\n from: fromIsoDate(model?.dateFrom),\n to: fromIsoDate(model?.dateTo),\n }));\n // Reflect external model changes (a programmatic default, a parent-filter\n // edit, an AG Grid reset) in the in-row picker trigger.\n useEffect(() => {\n setRange({\n from: fromIsoDate(model?.dateFrom),\n to: fromIsoDate(model?.dateTo),\n });\n }, [model?.dateFrom, model?.dateTo]);\n\n function apply(next: DateRangeValue) {\n setRange(next);\n if (!next.from && !next.to) {\n onModelChange(null);\n return;\n }\n onModelChange({\n type: 'inRange',\n dateFrom: toIsoDate(next.from),\n dateTo: toIsoDate(next.to),\n } satisfies DateRangeFilterModel);\n }\n\n return (\n <div data-component=\"date-range-floating-filter\" className=\"ds:w-full\">\n <DateRangePicker\n value={range}\n onChange={apply}\n commitMode={filterParams.commitMode}\n size=\"sm\"\n placeholder={filterParams.placeholder}\n />\n </div>\n );\n}\n","import { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport type {\n CustomFilterProps,\n CustomFloatingFilterProps,\n} from 'ag-grid-react';\nimport { useGridFilter } from 'ag-grid-react';\nimport type { GridApi, IFilter, IRowNode } from 'ag-grid-community';\nimport { useTranslation } from 'react-i18next';\nimport { Checkbox } from '../../checkbox';\nimport { Button } from '../../button';\nimport { MultiSelect } from '../../multi-select';\nimport { ScrollArea } from '../../scroll-area/scroll-area';\n\n/**\n * Custom AG Grid filter component — multi-select facet filter.\n *\n * The Community-friendly equivalent of AG Grid Enterprise's\n * `agSetColumnFilter`. Surfaces a checkbox list of every value the column\n * can take, so users tick to include / untick to exclude. Much faster than\n * the default `agTextColumnFilter` for closed enums (status, room,\n * operator).\n *\n * Wire on a colDef:\n * ```tsx\n * {\n * field: 'status',\n * filter: SelectFilter,\n * filterParams: {\n * options: [\n * { value: 'open', label: 'Aperte' },\n * { value: 'paid', label: 'Pagate' },\n * ],\n * },\n * }\n * ```\n *\n * Model shape `{ type: 'set', values: Array<string | number> }` matches\n * AG Grid Enterprise's set-filter convention so server-side adapters can\n * read either implementation the same way.\n */\n\nexport interface SelectFilterOption {\n value: string | number;\n label: string;\n}\n\nexport interface SelectFilterModel {\n type: 'set';\n values: Array<string | number>;\n}\n\nexport interface SelectFilterParams {\n options?: SelectFilterOption[];\n placeholder?: string;\n}\n\ntype SelectFilterValue = string | number;\n\nfunction toValueKey(v: SelectFilterValue): string {\n return typeof v === 'number' ? `n:${v}` : `s:${v}`;\n}\n\n/** How a filter surface reads one row's value for its column. */\ntype SelectValueReader = (node: IRowNode) => unknown;\n\n/** Numeric collation, so a derived numeric column lists 1, 2, 3, 10 rather\n * than the lexicographic 1, 10, 2, 3. */\nconst LABEL_COLLATOR = new Intl.Collator(undefined, { numeric: true });\n\n/** Distinct values the column actually holds, label-sorted. `forEachNode`\n * walks the whole client-side row model, so the list does not shrink as\n * other columns filter rows out. */\nfunction collectColumnOptions(\n api: GridApi | undefined,\n readValue: SelectValueReader,\n): SelectFilterOption[] {\n if (!api) return [];\n const seen = new Map<string, SelectFilterOption>();\n api.forEachNode((node: IRowNode) => {\n const raw = readValue(node);\n if (raw === null || raw === undefined) return;\n const value =\n typeof raw === 'string' || typeof raw === 'number' ? raw : String(raw);\n const key = toValueKey(value);\n if (!seen.has(key)) seen.set(key, { value, label: String(value) });\n });\n return Array.from(seen.values()).sort((a, b) =>\n LABEL_COLLATOR.compare(String(a.label), String(b.label)),\n );\n}\n\nfunction sameOptions(\n a: SelectFilterOption[],\n b: SelectFilterOption[],\n): boolean {\n if (a.length !== b.length) return false;\n return a.every(\n (opt, i) =>\n toValueKey(opt.value) === toValueKey(b[i].value) &&\n opt.label === b[i].label,\n );\n}\n\n/**\n * The universe of choices for one Select-filtered column.\n *\n * An explicit `options` filterParam always wins — INCLUDING an empty one,\n * which means \"this column has no facets\", not \"derive them for me\". Omit\n * `options` entirely and the list is DERIVED from the values the column\n * actually holds, and re-derived as the row data changes, so both the popup\n * panel and its floating-filter twin offer the same, data-accurate choices.\n */\nfunction useSelectFilterOptions(\n api: GridApi | undefined,\n options: SelectFilterOption[] | undefined,\n readValue: SelectValueReader,\n): SelectFilterOption[] {\n const explicit = options;\n const hasExplicit = explicit !== undefined;\n const [derived, setDerived] = useState<SelectFilterOption[]>([]);\n\n // Latest-reader ref so a new `getValue` identity per grid render does not\n // tear down and rebuild the grid event subscription below.\n const readValueRef = useRef(readValue);\n useEffect(() => {\n readValueRef.current = readValue;\n });\n\n useEffect(() => {\n if (hasExplicit || !api) return;\n const recompute = () => {\n setDerived((prev) => {\n const next = collectColumnOptions(api, readValueRef.current);\n return sameOptions(prev, next) ? prev : next;\n });\n };\n recompute();\n api.addEventListener('modelUpdated', recompute);\n api.addEventListener('cellValueChanged', recompute);\n return () => {\n if (api.isDestroyed()) return;\n api.removeEventListener('modelUpdated', recompute);\n api.removeEventListener('cellValueChanged', recompute);\n };\n }, [api, hasExplicit]);\n\n return explicit ?? derived;\n}\n\nexport function SelectFilter(\n props: CustomFilterProps<unknown, unknown, SelectFilterModel> &\n SelectFilterParams,\n) {\n const { model, onModelChange, getValue, api, options, placeholder } = props;\n const { t } = useTranslation('ui');\n\n const readValue = useCallback<SelectValueReader>(\n (node) => getValue(node) as unknown,\n [getValue],\n );\n const derivedOptions = useSelectFilterOptions(api, options, readValue);\n\n // Working set — checkboxes mutate `pending` only; we commit to the\n // grid via `onModelChange` when the user clicks Apply (or clears).\n const initialSelected = useMemo<Set<string>>(() => {\n const set = new Set<string>();\n const incoming = model?.values ?? [];\n for (const v of incoming) set.add(toValueKey(v));\n return set;\n }, [model]);\n\n const [pending, setPending] = useState<Set<string>>(initialSelected);\n\n // Sync local `pending` if the model changes externally (e.g. when AG\n // Grid pushes a reset). `model` is the dependency — Set instances are\n // compared by reference in React, so the memo above is sufficient.\n useEffect(() => {\n setPending(initialSelected);\n }, [initialSelected]);\n\n useGridFilter({\n doesFilterPass: (params) => {\n const active = model?.values;\n if (!active || active.length === 0) return true;\n const raw = getValue(params.node) as unknown;\n if (raw === null || raw === undefined) return false;\n const value: SelectFilterValue =\n typeof raw === 'string' || typeof raw === 'number' ? raw : String(raw);\n const key = toValueKey(value);\n return active.some((v) => toValueKey(v) === key);\n },\n });\n\n function toggle(optionKey: string) {\n setPending((prev) => {\n const next = new Set(prev);\n if (next.has(optionKey)) next.delete(optionKey);\n else next.add(optionKey);\n return next;\n });\n }\n\n function apply() {\n if (pending.size === 0) {\n onModelChange(null);\n return;\n }\n const values: SelectFilterValue[] = [];\n for (const opt of derivedOptions) {\n if (pending.has(toValueKey(opt.value))) values.push(opt.value);\n }\n // A ticked value can leave the data before Apply (the derived list is\n // live). Committing `values: []` would read as an active filter that\n // matches every row, so clear instead.\n if (values.length === 0) {\n onModelChange(null);\n return;\n }\n onModelChange({ type: 'set', values });\n }\n\n function clear() {\n setPending(new Set());\n onModelChange(null);\n }\n\n const placeholderLabel = placeholder ?? t('dataTable.selectFilter.all');\n\n return (\n <div\n data-component=\"select-filter\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[200px] ds:max-w-[260px]\"\n >\n <ScrollArea orientation=\"vertical\" className=\"ds:max-h-[240px]\">\n <div\n role=\"group\"\n aria-label={placeholderLabel}\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-xs)]\"\n >\n {derivedOptions.length === 0 ? (\n <p className=\"ds:text-[length:var(--font-size-sm)] ds:text-[var(--muted-foreground)] ds:py-[var(--spacing-xs)]\">\n {t('dataTable.agGrid.noRowsToShow')}\n </p>\n ) : (\n derivedOptions.map((option) => {\n const key = toValueKey(option.value);\n return (\n <Checkbox\n key={key}\n size=\"sm\"\n label={option.label}\n checked={pending.has(key)}\n onCheckedChange={() => toggle(key)}\n />\n );\n })\n )}\n </div>\n </ScrollArea>\n <div className=\"ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]\">\n <Button intent=\"ghost\" size=\"sm\" onClick={clear} type=\"button\">\n {t('dataTable.selectFilter.clear')}\n </Button>\n <Button intent=\"primary\" size=\"sm\" onClick={apply} type=\"button\">\n {t('dataTable.selectFilter.apply')}\n </Button>\n </div>\n </div>\n );\n}\n\n/**\n * Floating-filter companion for `SelectFilter`.\n *\n * Renders the kit's `<MultiSelect>` directly as the floating-filter\n * input — its built-in trigger + checkbox dropdown IS the filter UI.\n * Earlier versions wrapped MultiSelect in another `<Popover>`,\n * producing the \"click trigger → empty popover with another trigger →\n * click → checkbox list\" double-step that read as duplicated UI.\n *\n * MultiSelect's options use `string` values; we string-convert the\n * model's `(string | number)[]` for the trigger and parse back on\n * apply. The grid model still tracks the original primitive types so\n * `doesFilterPass` keeps matching numeric columns correctly.\n *\n * Choices come from the same `useSelectFilterOptions` universe the popup\n * panel uses: an explicit `options` filterParam if the consumer declared\n * one, otherwise the column's own distinct values. Reading only\n * `filterParams.options` used to leave the trigger empty beside a working\n * panel whenever the consumer relied on derivation.\n */\nexport function SelectFloatingFilter(\n props: CustomFloatingFilterProps<\n IFilter,\n unknown,\n unknown,\n SelectFilterModel\n >,\n) {\n const { model, onModelChange, column, api } = props;\n\n const colDef = column?.getColDef?.();\n const filterParams =\n (colDef?.filterParams as SelectFilterParams | undefined) ?? {};\n\n // The floating filter has no `getValue`; read through the grid instead.\n // A column with a `filterValueGetter` should declare `options` — the two\n // reads would otherwise disagree with the panel's.\n const readValue = useCallback<SelectValueReader>(\n (node) =>\n api && column\n ? (api.getCellValue<unknown>({\n rowNode: node,\n colKey: column,\n }) as unknown)\n : undefined,\n [api, column],\n );\n const availableOptions = useSelectFilterOptions(\n api,\n filterParams.options,\n readValue,\n );\n // Name the floating-filter trigger after its column so the per-column Select\n // filters are distinguishable to assistive tech — they otherwise all read as\n // the generic MultiSelect placeholder. An explicit `placeholder` wins.\n const accessibleLabel =\n filterParams.placeholder ??\n (typeof colDef?.headerName === 'string' ? colDef.headerName : undefined);\n\n // MultiSelect's `value` is `string[]`. SelectFilter's model carries\n // `(string | number)[]` so we string-convert in / out. Build a lookup\n // from the stringified key back to the original primitive so the\n // model retains the consumer's typing.\n const valueByKey = useMemo(() => {\n const map = new Map<string, SelectFilterValue>();\n for (const opt of availableOptions) map.set(String(opt.value), opt.value);\n return map;\n }, [availableOptions]);\n\n const selectOptions = useMemo(\n () =>\n availableOptions.map((opt) => ({\n value: String(opt.value),\n label: opt.label,\n })),\n [availableOptions],\n );\n\n const currentValue = useMemo(\n () => (model?.values ?? []).map((v) => String(v)),\n [model],\n );\n\n function handleChange(next: string[]) {\n if (next.length === 0) {\n onModelChange(null);\n return;\n }\n const values: SelectFilterValue[] = [];\n for (const k of next) {\n const original = valueByKey.get(k);\n if (original !== undefined) values.push(original);\n }\n // Same live-list guard as the panel's Apply: an empty set is a cleared\n // filter, never an active one that matches everything.\n if (values.length === 0) {\n onModelChange(null);\n return;\n }\n onModelChange({ type: 'set', values });\n }\n\n return (\n <div data-component=\"select-floating-filter\" className=\"ds:w-full\">\n <MultiSelect\n size=\"sm\"\n options={selectOptions}\n value={currentValue}\n onChange={handleChange}\n placeholder={filterParams.placeholder}\n aria-label={accessibleLabel}\n allowClear\n />\n </div>\n );\n}\n","import { useEffect, useMemo, useState } from 'react';\nimport type {\n CustomFilterProps,\n CustomFloatingFilterProps,\n} from 'ag-grid-react';\nimport { useGridFilter } from 'ag-grid-react';\nimport type { IFilter, IRowNode } from 'ag-grid-community';\nimport { useTranslation } from 'react-i18next';\nimport { Autocomplete } from '../../autocomplete';\nimport { Button } from '../../button';\nimport type { OptionShape } from '../../_shared/option';\n\n/**\n * Custom AG Grid filter component — single-select typeahead filter.\n *\n * Wraps the kit's existing `<Autocomplete>` so the user types to filter a\n * bounded-but-large set of values (e.g. patient names), picks one\n * suggestion, and the grid filters to rows matching that value exactly.\n *\n * Wire on a colDef:\n * ```tsx\n * {\n * field: 'patient',\n * filter: TypeaheadFilter,\n * filterParams: {\n * options: PATIENTS.map(p => ({ value: p.name, label: p.name })),\n * },\n * }\n * ```\n *\n * Model shape `{ type: 'equals', value: string }` matches AG Grid's\n * text-filter `equals` convention so server-side adapters can read either\n * implementation the same way.\n */\n\nexport interface TypeaheadFilterOption {\n value: string;\n label: string;\n}\n\nexport interface TypeaheadFilterModel {\n type: 'equals';\n value: string;\n}\n\nexport interface TypeaheadFilterParams {\n options?: TypeaheadFilterOption[];\n loadOptions?: (\n input: string,\n opts: { signal: AbortSignal; locale: string },\n ) => Promise<TypeaheadFilterOption[]>;\n placeholder?: string;\n}\n\nfunction normalise(s: string): string {\n return s.trim().toLocaleLowerCase();\n}\n\nexport function TypeaheadFilter(\n props: CustomFilterProps<unknown, unknown, TypeaheadFilterModel> &\n TypeaheadFilterParams,\n) {\n const {\n model,\n onModelChange,\n getValue,\n api,\n column,\n options,\n loadOptions,\n placeholder,\n } = props;\n const { t } = useTranslation('ui');\n\n // Universe of choices. Prefer explicit `options`; fall back to the\n // column's distinct values when neither `options` nor `loadOptions` is\n // supplied. Same shape as SelectFilter's derivation so the two filters\n // present a consistent experience when consumers don't enumerate.\n const derivedOptions = useMemo<TypeaheadFilterOption[]>(() => {\n if (options && options.length > 0) return options;\n if (!api || !column) return [];\n const seen = new Map<string, TypeaheadFilterOption>();\n api.forEachNode((node: IRowNode) => {\n const raw = getValue(node) as unknown;\n if (raw === null || raw === undefined) return;\n const value = typeof raw === 'string' ? raw : String(raw);\n if (!seen.has(value)) {\n seen.set(value, { value, label: value });\n }\n });\n return Array.from(seen.values()).sort((a, b) =>\n a.label.localeCompare(b.label),\n );\n }, [options, api, column, getValue]);\n\n // Build the async `loadOptions` adapter that <Autocomplete> consumes.\n // Local-options path filters the snapshot synchronously and wraps it\n // in Promise.resolve(); explicit `loadOptions` is passed through.\n const adapterLoadOptions = useMemo(() => {\n return async (\n query: string,\n opts: { signal: AbortSignal; locale: string },\n ): Promise<OptionShape[]> => {\n if (loadOptions) {\n const result = await loadOptions(query, opts);\n return result.map((o) => ({ value: o.value, label: o.label }));\n }\n const q = normalise(query);\n const filtered = q\n ? derivedOptions.filter((o) => normalise(o.label).includes(q))\n : derivedOptions;\n return filtered\n .slice(0, 50)\n .map((o) => ({ value: o.value, label: o.label }));\n };\n }, [loadOptions, derivedOptions]);\n\n const [draft, setDraft] = useState<string>(model?.value ?? '');\n\n useEffect(() => {\n setDraft(model?.value ?? '');\n }, [model?.value]);\n\n useGridFilter({\n doesFilterPass: (params) => {\n const target = model?.value;\n if (!target) return true;\n const raw = getValue(params.node) as unknown;\n if (raw === null || raw === undefined) return false;\n const value = typeof raw === 'string' ? raw : String(raw);\n return normalise(value) === normalise(target);\n },\n });\n\n function handleSelect(option: OptionShape) {\n // Autocomplete itself commits `option.label` to the input value; we\n // mirror that here so the displayed text matches what the user just\n // picked, even when label and value diverge (e.g. id vs name).\n setDraft(option.label);\n onModelChange({ type: 'equals', value: option.value });\n }\n\n function handleChange(next: string) {\n setDraft(next);\n // Clear the applied model when the user empties the input so the\n // grid stops filtering as soon as the field is blank.\n if (next === '' && model) onModelChange(null);\n }\n\n function clear() {\n setDraft('');\n onModelChange(null);\n }\n\n const placeholderLabel =\n placeholder ?? t('dataTable.typeaheadFilter.placeholder');\n\n return (\n <div\n data-component=\"typeahead-filter\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]\"\n >\n <Autocomplete\n size=\"sm\"\n value={draft}\n onChange={handleChange}\n onSelect={handleSelect}\n loadOptions={adapterLoadOptions}\n placeholder={placeholderLabel}\n aria-label={placeholderLabel}\n />\n <div className=\"ds:flex ds:items-center ds:justify-end ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]\">\n <Button intent=\"ghost\" size=\"sm\" onClick={clear} type=\"button\">\n {t('dataTable.typeaheadFilter.clear')}\n </Button>\n </div>\n </div>\n );\n}\n\n/**\n * Floating-filter companion for `TypeaheadFilter`.\n *\n * Renders the kit's `<Autocomplete>` directly as the floating-filter\n * input — its built-in text input + portaled dropdown IS the filter\n * UI. Earlier versions wrapped Autocomplete in a second `<Popover>`,\n * producing the \"click trigger → popover with another search input →\n * type → list appears\" double-step that read as duplicated UI.\n */\nexport function TypeaheadFloatingFilter(\n props: CustomFloatingFilterProps<\n IFilter,\n unknown,\n unknown,\n TypeaheadFilterModel\n >,\n) {\n const { model, onModelChange, column } = props;\n const { t } = useTranslation('ui');\n\n const filterParams =\n (column?.getColDef?.()?.filterParams as\n | TypeaheadFilterParams\n | undefined) ?? {};\n const availableOptions = filterParams.options ?? [];\n const loadOptions = filterParams.loadOptions;\n const placeholderLabel =\n filterParams.placeholder ?? t('dataTable.typeaheadFilter.placeholder');\n\n const adapterLoadOptions = useMemo(() => {\n return async (\n query: string,\n opts: { signal: AbortSignal; locale: string },\n ): Promise<OptionShape[]> => {\n if (loadOptions) {\n const result = await loadOptions(query, opts);\n return result.map((o) => ({ value: o.value, label: o.label }));\n }\n const q = normalise(query);\n const filtered = q\n ? availableOptions.filter((o) => normalise(o.label).includes(q))\n : availableOptions;\n return filtered\n .slice(0, 50)\n .map((o) => ({ value: o.value, label: o.label }));\n };\n }, [loadOptions, availableOptions]);\n\n // Track the input's display value separately from the applied model.\n // The user can type freely; we only apply when they pick an option\n // from the dropdown (committing a known value to the model). Clearing\n // the input clears the filter.\n const [draft, setDraft] = useState<string>(model?.value ?? '');\n useEffect(() => {\n setDraft(model?.value ?? '');\n }, [model?.value]);\n\n function handleSelect(option: OptionShape) {\n setDraft(option.label);\n onModelChange({ type: 'equals', value: option.value });\n }\n\n function handleChange(next: string) {\n setDraft(next);\n if (next === '' && model) onModelChange(null);\n }\n\n return (\n <div data-component=\"typeahead-floating-filter\" className=\"ds:w-full\">\n <Autocomplete\n size=\"sm\"\n value={draft}\n onChange={handleChange}\n onSelect={handleSelect}\n loadOptions={adapterLoadOptions}\n placeholder={placeholderLabel}\n aria-label={placeholderLabel}\n />\n </div>\n );\n}\n","import { useEffect, useMemo, useState } from 'react';\nimport type {\n CustomFilterProps,\n CustomFloatingFilterProps,\n} from 'ag-grid-react';\nimport { useGridFilter } from 'ag-grid-react';\nimport type { IFilter } from 'ag-grid-community';\nimport { useTranslation } from 'react-i18next';\nimport { NumberInput } from '../../number-input';\nimport { Select } from '../../select';\nimport { Button } from '../../button';\n\n/**\n * Custom AG Grid filter component for numeric columns. AG Grid Community's\n * built-in `agNumberColumnFilter` paints a stock browser-skinned\n * `<input type=\"number\">` that does not match the kit's form language —\n * this wraps the DS `<NumberInput>` + `<Select>` so totals, prices,\n * quantities, etc. line up visually with neighbouring DS-styled cells.\n *\n * Wire on a colDef:\n * ```tsx\n * {\n * field: 'total',\n * filter: NumberFilter,\n * floatingFilterComponent: NumberFloatingFilter,\n * filterParams: { defaultOperator: 'greaterThan', min: 0 },\n * }\n * ```\n *\n * The full-popover variant exposes the operator dropdown (equals,\n * greaterThan, inRange, blank, …); the floating-filter row is a single\n * compact input whose operator is fixed to `defaultOperator`. Both speak\n * the same `NumberFilterModel` so server-side adapters can read either.\n *\n * Model shape `{ type, filter, filterTo? }` matches AG Grid's own\n * `agNumberColumnFilter` vocabulary so adapters can interchange.\n */\n\nexport type NumberFilterOperator =\n | 'equals'\n | 'notEqual'\n | 'greaterThan'\n | 'greaterThanOrEqual'\n | 'lessThan'\n | 'lessThanOrEqual'\n | 'inRange'\n | 'blank'\n | 'notBlank';\n\nexport interface NumberFilterModel {\n type: NumberFilterOperator;\n filter: number;\n filterTo?: number;\n}\n\nexport interface NumberFilterParams {\n defaultOperator?: NumberFilterOperator;\n min?: number;\n max?: number;\n step?: number;\n placeholder?: string;\n}\n\nconst ALL_OPERATORS: NumberFilterOperator[] = [\n 'equals',\n 'notEqual',\n 'greaterThan',\n 'greaterThanOrEqual',\n 'lessThan',\n 'lessThanOrEqual',\n 'inRange',\n 'blank',\n 'notBlank',\n];\n\nfunction operatorTakesValue(op: NumberFilterOperator): boolean {\n return op !== 'blank' && op !== 'notBlank';\n}\n\nfunction operatorTakesRange(op: NumberFilterOperator): boolean {\n return op === 'inRange';\n}\n\nfunction evaluate(\n op: NumberFilterOperator,\n cell: number | null,\n primary: number | null,\n secondary: number | null,\n): boolean {\n if (op === 'blank') return cell === null;\n if (op === 'notBlank') return cell !== null;\n if (cell === null) return false;\n if (primary === null) return true;\n switch (op) {\n case 'equals':\n return cell === primary;\n case 'notEqual':\n return cell !== primary;\n case 'greaterThan':\n return cell > primary;\n case 'greaterThanOrEqual':\n return cell >= primary;\n case 'lessThan':\n return cell < primary;\n case 'lessThanOrEqual':\n return cell <= primary;\n case 'inRange': {\n if (secondary === null) return cell >= primary;\n const lo = Math.min(primary, secondary);\n const hi = Math.max(primary, secondary);\n return cell >= lo && cell <= hi;\n }\n default:\n return true;\n }\n}\n\nfunction coerceCell(raw: unknown): number | null {\n if (raw === null || raw === undefined || raw === '') return null;\n const n = typeof raw === 'number' ? raw : Number(raw);\n return Number.isNaN(n) ? null : n;\n}\n\nexport function NumberFilter(\n props: CustomFilterProps<unknown, unknown, NumberFilterModel> &\n NumberFilterParams,\n) {\n const {\n model,\n onModelChange,\n getValue,\n defaultOperator,\n min,\n max,\n step,\n placeholder,\n } = props;\n const { t } = useTranslation('ui');\n\n const initialOperator: NumberFilterOperator =\n model?.type ?? defaultOperator ?? 'equals';\n const [operator, setOperator] =\n useState<NumberFilterOperator>(initialOperator);\n const [primary, setPrimary] = useState<number | null>(model?.filter ?? null);\n const [secondary, setSecondary] = useState<number | null>(\n model?.filterTo ?? null,\n );\n\n // If AG Grid pushes an externally-cleared / reset model, mirror it in\n // local state so the UI stays consistent with the applied filter. The\n // cleared model arrives as null OR undefined (removed from a setFilterModel\n // map), so a loose check is load-bearing here.\n useEffect(() => {\n if (model == null) {\n setOperator(defaultOperator ?? 'equals');\n setPrimary(null);\n setSecondary(null);\n return;\n }\n setOperator(model.type);\n setPrimary(model.filter ?? null);\n setSecondary(model.filterTo ?? null);\n }, [model, defaultOperator]);\n\n useGridFilter({\n doesFilterPass: (params) => {\n if (!model) return true;\n const cell = coerceCell(getValue(params.node));\n return evaluate(\n model.type,\n cell,\n model.filter ?? null,\n model.filterTo ?? null,\n );\n },\n });\n\n const operatorOptions = useMemo(\n () =>\n ALL_OPERATORS.map((op) => ({\n value: op,\n label: t(`dataTable.numberFilter.operators.${op}`),\n })),\n [t],\n );\n\n const placeholderLabel =\n placeholder ?? t('dataTable.numberFilter.placeholder');\n\n function apply() {\n if (!operatorTakesValue(operator)) {\n onModelChange({ type: operator, filter: 0 });\n return;\n }\n if (primary === null) {\n onModelChange(null);\n return;\n }\n if (operatorTakesRange(operator)) {\n onModelChange({\n type: operator,\n filter: primary,\n filterTo: secondary ?? undefined,\n });\n return;\n }\n onModelChange({ type: operator, filter: primary });\n }\n\n function clear() {\n setOperator(defaultOperator ?? 'equals');\n setPrimary(null);\n setSecondary(null);\n onModelChange(null);\n }\n\n const showValue = operatorTakesValue(operator);\n const showRange = operatorTakesRange(operator);\n\n return (\n <div\n data-component=\"number-filter\"\n className=\"ds:flex ds:flex-col ds:gap-[var(--spacing-sm)] ds:p-[var(--spacing-sm)] ds:min-w-[240px]\"\n >\n <Select\n size=\"sm\"\n options={operatorOptions}\n value={operator}\n onValueChange={(next) => {\n if (next === '') return;\n setOperator(next as NumberFilterOperator);\n }}\n aria-label={t('dataTable.numberFilter.operators.equals')}\n />\n {showValue && !showRange && (\n <NumberInput\n size=\"sm\"\n value={primary}\n onChange={setPrimary}\n min={min}\n max={max}\n step={step}\n placeholder={placeholderLabel}\n aria-label={placeholderLabel}\n />\n )}\n {showRange && (\n <div className=\"ds:flex ds:items-center ds:gap-[var(--spacing-xs)]\">\n <NumberInput\n size=\"sm\"\n value={primary}\n onChange={setPrimary}\n min={min}\n max={max}\n step={step}\n placeholder={t('dataTable.numberFilter.from')}\n aria-label={t('dataTable.numberFilter.from')}\n />\n <NumberInput\n size=\"sm\"\n value={secondary}\n onChange={setSecondary}\n min={min}\n max={max}\n step={step}\n placeholder={t('dataTable.numberFilter.to')}\n aria-label={t('dataTable.numberFilter.to')}\n />\n </div>\n )}\n <div className=\"ds:flex ds:items-center ds:justify-end ds:gap-[var(--spacing-xs)] ds:pt-[var(--spacing-xs)] ds:border-t ds:border-[var(--border)]\">\n <Button intent=\"ghost\" size=\"sm\" onClick={clear} type=\"button\">\n {t('dataTable.numberFilter.clear')}\n </Button>\n <Button intent=\"primary\" size=\"sm\" onClick={apply} type=\"button\">\n {t('dataTable.numberFilter.apply')}\n </Button>\n </div>\n </div>\n );\n}\n\n/**\n * Floating-filter companion for `NumberFilter`.\n *\n * Renders the kit's `<NumberInput>` directly as the inline filter input\n * with a fixed operator (`defaultOperator`, or `'equals'`). The operator\n * dropdown lives only in the full popover — the floating-filter row is\n * deliberately compact, matching the way `agNumberColumnFilter` ships\n * with AG Grid Community.\n *\n * Debounced commit at 200 ms so each keystroke does not re-run the grid\n * filter. Empty input or invalid number commits `null` so the column\n * reverts to \"no filter\" rather than `filter: NaN`.\n */\nexport function NumberFloatingFilter(\n props: CustomFloatingFilterProps<\n IFilter,\n unknown,\n unknown,\n NumberFilterModel\n >,\n) {\n const { model, onModelChange, column } = props;\n const { t } = useTranslation('ui');\n\n const filterParams =\n (column?.getColDef?.()?.filterParams as NumberFilterParams | undefined) ??\n {};\n const operator: NumberFilterOperator =\n filterParams.defaultOperator ?? 'equals';\n const placeholderLabel =\n filterParams.placeholder ?? t('dataTable.numberFilter.placeholder');\n\n const [draft, setDraft] = useState<number | null>(model?.filter ?? null);\n\n // Sync local draft when the model is reset externally (e.g. a global\n // clear from the column-header menu's \"Clear\" button).\n useEffect(() => {\n setDraft(model?.filter ?? null);\n }, [model?.filter]);\n\n // Debounced commit. We don't pull a hook in for this — a single\n // useEffect + setTimeout is cheaper than the cost of importing one,\n // and AG Grid only re-renders this floating filter per keystroke.\n useEffect(() => {\n if (draft === (model?.filter ?? null)) return;\n const handle = setTimeout(() => {\n if (draft === null || Number.isNaN(draft)) {\n onModelChange(null);\n return;\n }\n onModelChange({ type: operator, filter: draft });\n }, 200);\n return () => clearTimeout(handle);\n // `model` intentionally excluded — we only want to react to user\n // edits of `draft`. Model resets sync via the effect above.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [draft, operator]);\n\n return (\n <div data-component=\"number-floating-filter\" className=\"ds:w-full\">\n <NumberInput\n size=\"sm\"\n value={draft}\n onChange={setDraft}\n min={filterParams.min}\n max={filterParams.max}\n step={filterParams.step}\n placeholder={placeholderLabel}\n aria-label={placeholderLabel}\n />\n </div>\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Badge } from '../../badge/badge';\n\nexport type BadgeVariant = 'neutral' | 'info' | 'success' | 'warning' | 'error';\n\nexport interface StatusCellRendererParams {\n variantMap?: Record<string, BadgeVariant>;\n}\n\nexport function StatusCellRenderer(\n props: CustomCellRendererProps & StatusCellRendererParams,\n) {\n const { value, variantMap } = props;\n const variant: BadgeVariant = variantMap?.[value as string] ?? 'neutral';\n return (\n <Badge variant={variant} withDot size=\"sm\">\n {String(value ?? '')}\n </Badge>\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Avatar } from '../../avatar/avatar';\n\nexport interface UserCellValue {\n name: string;\n src?: string;\n}\n\nexport function UserCellRenderer(\n props: CustomCellRendererProps<unknown, UserCellValue>,\n) {\n const { value } = props;\n if (!value) return null;\n return (\n <span className=\"ds:inline-flex ds:items-center ds:gap-[var(--spacing-sm)]\">\n <Avatar name={value.name} src={value.src} size=\"sm\" />\n <span>{value.name}</span>\n </span>\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Avatar } from '../../avatar/avatar';\n\nexport interface ImageCellRendererParams {\n /** Field name on the row whose value holds the image URL. */\n srcField: string;\n /** Optional field name holding alt text. Falls back to '' (decorative). */\n altField?: string;\n /**\n * Optional field name holding a name string. When the src URL is missing or\n * rejected, the cell falls back to `<Avatar name={fallback}>` so the cell\n * still has a visual.\n */\n fallbackField?: string;\n /** Visual size of the image. Matches `<Avatar>` sizes (sm=32, md=40, lg=48). */\n size?: 'sm' | 'md' | 'lg';\n /** Corner radius preset. `circle` matches `<Avatar>`. */\n shape?: 'square' | 'rounded' | 'circle';\n}\n\nconst SIZE_CLASS: Record<\n NonNullable<ImageCellRendererParams['size']>,\n string\n> = {\n sm: 'ds:size-8',\n md: 'ds:size-10',\n lg: 'ds:size-12',\n};\n\nconst SHAPE_CLASS: Record<\n NonNullable<ImageCellRendererParams['shape']>,\n string\n> = {\n square: 'ds:rounded-none',\n rounded: 'ds:rounded-[var(--radius-md)]',\n circle: 'ds:rounded-[var(--radius-full)]',\n};\n\nfunction readField(row: unknown, field: string): string | undefined {\n if (!row || typeof row !== 'object') return undefined;\n const value = (row as Record<string, unknown>)[field];\n return typeof value === 'string' ? value : undefined;\n}\n\n// Accept http(s), image data: URLs, and same-origin absolute paths. Reject\n// `javascript:` / `vbscript:` / any other smuggled scheme. Browsers won't\n// execute non-image data: URLs in `<img>`, but rejecting them in JS gives a\n// single audit point.\n//\n// A leading `/` cannot carry a scheme, so a root-relative path is at least as\n// safe as an absolute URL — and it is what an app serving its own images\n// naturally produces. `//host/x` IS excluded: protocol-relative URLs are\n// cross-origin, which is the thing this guard exists to control.\nconst SAFE_SRC_RE = /^(?:https?:|data:image\\/|\\/(?!\\/))/i;\n\nfunction sanitizeSrc(raw: string | undefined): string | undefined {\n if (!raw) return undefined;\n const trimmed = raw.trim();\n if (trimmed.length === 0) return undefined;\n return SAFE_SRC_RE.test(trimmed) ? trimmed : undefined;\n}\n\nexport function ImageCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & ImageCellRendererParams,\n) {\n const {\n data,\n srcField,\n altField,\n fallbackField,\n size = 'md',\n shape = 'rounded',\n } = props;\n\n if (!data) return null;\n\n const rawSrc = readField(data, srcField);\n const src = sanitizeSrc(rawSrc);\n const alt = altField ? (readField(data, altField) ?? '') : '';\n const fallbackName = fallbackField\n ? readField(data, fallbackField)\n : undefined;\n\n // A circular image with a name is a person: let <Avatar> own it. It paints the\n // initials first, covers them once the photo decodes, and drops the <img> on\n // error so the initials persist — instead of a blank cell that later pops.\n if (shape === 'circle' && fallbackName) {\n return <Avatar src={src} name={fallbackName} size={size} />;\n }\n\n if (!src) {\n if (fallbackName) {\n return <Avatar name={fallbackName} size={size} />;\n }\n return null;\n }\n\n return (\n <img\n src={src}\n alt={alt}\n loading=\"lazy\"\n decoding=\"async\"\n className={['ds:object-cover', SIZE_CLASS[size], SHAPE_CLASS[shape]].join(\n ' ',\n )}\n />\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { useTranslation } from 'react-i18next';\nimport { Tag } from '../../tag/tag';\nimport { Tooltip } from '../../tooltip';\n\nexport interface TagListCellRendererParams {\n maxVisible?: number;\n}\n\nexport function TagListCellRenderer(\n props: CustomCellRendererProps<unknown, string[]> & TagListCellRendererParams,\n) {\n const { value, maxVisible = 3 } = props;\n const { t } = useTranslation();\n\n if (!Array.isArray(value) || value.length === 0) return null;\n\n const visible = value.slice(0, maxVisible);\n const overflow = value.length - maxVisible;\n\n return (\n <span className=\"ds:inline-flex ds:flex-wrap ds:items-center ds:gap-[var(--spacing-xs)]\">\n {visible.map((tag) => (\n <Tag key={tag} label={tag} size=\"sm\" />\n ))}\n {overflow > 0 && (\n <Tooltip label={value.slice(maxVisible).join(', ')}>\n <Tag\n label={t('inputs.multiSelect.overflow', { count: overflow })}\n size=\"sm\"\n variant=\"neutral\"\n fill=\"outline\"\n />\n </Tooltip>\n )}\n </span>\n );\n}\n","import type { CustomCellRendererProps } from 'ag-grid-react';\nimport { Timestamp } from '../../timestamp';\nimport { fromIsoDate, isCalendarDay } from '../calendar-day';\n\nexport type DateCellFormat = 'date' | 'time' | 'datetime' | 'relative';\n\nexport interface DateCellRendererParams {\n /** Which preset to use. Default `'date'`. */\n format?: DateCellFormat;\n /** Escape hatch — overrides the preset entirely. */\n options?: Intl.DateTimeFormatOptions;\n}\n\nconst PRESETS: Record<\n Exclude<DateCellFormat, 'relative'>,\n Intl.DateTimeFormatOptions\n> = {\n date: { year: 'numeric', month: 'short', day: 'numeric' },\n time: { hour: '2-digit', minute: '2-digit' },\n datetime: {\n year: 'numeric',\n month: 'short',\n day: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n },\n};\n\nexport function DateCellRenderer(\n props: CustomCellRendererProps & DateCellRendererParams,\n) {\n const { value, format = 'date', options } = props;\n if (value == null || value === '') return null;\n\n const calendarDay = isCalendarDay(value);\n\n // `shape=\"bare\"` keeps the cell font inherited from --ag-font-size. Timestamp\n // still emits a proper `<time dateTime>` for assistive tech and feeds.\n //\n // A relative reading (\"3 days ago\") is about the viewer's own day, so a bare\n // date is anchored to LOCAL midnight here.\n if (format === 'relative' && !options) {\n const relativeValue = calendarDay ? (fromIsoDate(value) ?? value) : value;\n return <Timestamp value={relativeValue as string | Date} shape=\"bare\" />;\n }\n\n const absoluteFormat =\n options ?? PRESETS[format === 'relative' ? 'date' : format];\n\n return (\n <Timestamp\n value={value as string | Date}\n format=\"absolute\"\n shape=\"bare\"\n // A bare `YYYY-MM-DD` is a calendar day and carries no instant, so it is\n // read AND written in UTC: it then renders the day it was written with in\n // every browser zone, and under any `timeZone` the caller names. Anchoring\n // it to a real zone instead would move the day for readers on one side —\n // local midnight loses a day west of UTC, UTC midnight loses one east of\n // the named zone. Values carrying a time are instants and keep the\n // caller's options untouched.\n absoluteFormat={\n calendarDay ? { ...absoluteFormat, timeZone: 'UTC' } : absoluteFormat\n }\n />\n );\n}\n","import type { MouseEvent } from 'react';\nimport type { CustomCellRendererProps } from 'ag-grid-react';\n\ntype Getter<T, TData> = T | ((data: TData) => T | undefined);\n\nexport interface LinkCellRendererParams<TData = unknown> {\n /** Anchor href — or a function that derives it from the row. */\n href?: Getter<string, TData>;\n /** Fallback / additional onClick. Prevents default when provided without href. */\n onClick?: (data: TData) => void;\n /** Small text rendered below the link — supports a row-aware function. */\n secondary?: Getter<string, TData>;\n}\n\nfunction resolve<T, TData>(\n source: Getter<T, TData> | undefined,\n data: TData,\n): T | undefined {\n if (typeof source === 'function') {\n return (source as (data: TData) => T | undefined)(data);\n }\n return source;\n}\n\nfunction safeHref(href: string): string {\n return /^(https?:\\/\\/|\\/|#|mailto:|tel:)/i.test(href) ? href : '#';\n}\n\nexport function LinkCellRenderer<TData = unknown>(\n props: CustomCellRendererProps<TData> & LinkCellRendererParams<TData>,\n) {\n const { value, data, href, onClick, secondary } = props;\n if (!data) return null;\n\n const resolvedHref = resolve(href, data);\n const resolvedSecondary = resolve(secondary, data);\n const content = value == null || value === '' ? '' : String(value);\n\n const linkClasses = [\n 'ds:text-[color:var(--primary)]',\n 'ds:hover:underline',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[color:var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:rounded-[var(--radius-sm)]',\n ].join(' ');\n\n const handleClick = (event: MouseEvent) => {\n if (!onClick) return;\n if (!resolvedHref) event.preventDefault();\n event.stopPropagation();\n onClick(data);\n };\n\n return (\n <span className=\"ds:flex ds:flex-col ds:leading-tight\">\n {resolvedHref ? (\n <a\n href={safeHref(resolvedHref)}\n onClick={handleClick}\n className={linkClasses}\n >\n {content}\n </a>\n ) : (\n <button\n type=\"button\"\n onClick={handleClick}\n className={[\n 'ds:appearance-none ds:bg-transparent ds:p-0 ds:text-start',\n linkClasses,\n ].join(' ')}\n >\n {content}\n </button>\n )}\n {resolvedSecondary ? (\n <span className=\"type-meta ds:text-[color:var(--muted-foreground)]\">\n {resolvedSecondary}\n </span>\n ) : null}\n </span>\n );\n}\n"],"names":["DATE_ONLY","ISO_DAY_PREFIX","toIsoDate","d","y","m","day","isCalendarDay","s","fromIsoDate","dayOf","cellValue","prefix","dayInRange","dateFrom","dateTo","DateRangeFilter","props","model","onModelChange","getValue","doesRowPassOtherFilter","filterParams","_a","range","setRange","useState","useEffect","useGridFilter","params","apply","next","jsx","DateRangePicker","DateRangeFloatingFilter","column","_b","toValueKey","v","LABEL_COLLATOR","collectColumnOptions","api","readValue","seen","node","raw","value","key","b","sameOptions","a","opt","i","useSelectFilterOptions","options","explicit","hasExplicit","derived","setDerived","readValueRef","useRef","recompute","prev","SelectFilter","placeholder","t","useTranslation","useCallback","derivedOptions","initialSelected","useMemo","set","incoming","pending","setPending","active","toggle","optionKey","values","clear","placeholderLabel","jsxs","ScrollArea","option","Checkbox","Button","SelectFloatingFilter","colDef","availableOptions","accessibleLabel","valueByKey","map","selectOptions","currentValue","handleChange","k","original","MultiSelect","normalise","TypeaheadFilter","loadOptions","adapterLoadOptions","query","opts","o","q","draft","setDraft","target","handleSelect","Autocomplete","TypeaheadFloatingFilter","ALL_OPERATORS","operatorTakesValue","op","operatorTakesRange","evaluate","cell","primary","secondary","lo","hi","coerceCell","n","NumberFilter","defaultOperator","min","max","step","initialOperator","operator","setOperator","setPrimary","setSecondary","operatorOptions","showValue","showRange","Select","NumberInput","NumberFloatingFilter","handle","StatusCellRenderer","variantMap","variant","Badge","UserCellRenderer","Avatar","SIZE_CLASS","SHAPE_CLASS","readField","row","field","SAFE_SRC_RE","sanitizeSrc","trimmed","ImageCellRenderer","data","srcField","altField","fallbackField","size","shape","rawSrc","src","alt","fallbackName","TagListCellRenderer","maxVisible","visible","overflow","tag","Tag","Tooltip","PRESETS","DateCellRenderer","format","calendarDay","relativeValue","Timestamp","absoluteFormat","resolve","source","safeHref","href","LinkCellRenderer","onClick","resolvedHref","resolvedSecondary","content","linkClasses","handleClick","event"],"mappings":";;;;;;;;;;;;;;;;;AASA,MAAMA,IAAY,uBACZC,KAAiB;AAMhB,SAASC,EAAUC,GAAoC;AAC5D,MAAI,CAACA,EAAG,QAAO;AACf,QAAMC,IAAID,EAAE,YAAA,GACNE,IAAI,OAAOF,EAAE,SAAA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;AAAA,UACT;AAAA,UACAD;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QAET,UAAAD;AAAA,MAAA;AAAA,IAAA;AAAA,IAGJD,IACC,gBAAA3J,EAAC,QAAA,EAAK,WAAU,qDACb,aACH,IACE;AAAA,EAAA,GACN;AAEJ;"}
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
import { jsx as s, jsxs as m, Fragment as v } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as k } from "react";
|
|
3
|
-
import { c as
|
|
4
|
-
import { useTranslation as
|
|
3
|
+
import { c as C } from "./index-D2ZczOXr.js";
|
|
4
|
+
import { useTranslation as _ } from "react-i18next";
|
|
5
5
|
import { S as T } from "./spinner-hbwuKwMf.js";
|
|
6
|
-
import { C as
|
|
7
|
-
import {
|
|
6
|
+
import { C as w } from "./check-DrFSN__t.js";
|
|
7
|
+
import { c as S } from "./createLucideIcon-DhHxpK9K.js";
|
|
8
8
|
import { P as $ } from "./pen-line-D0De5zdl.js";
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @license lucide-react v1.22.0 - ISC
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the ISC license.
|
|
13
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
14
|
+
*/
|
|
15
|
+
const P = [
|
|
16
|
+
[
|
|
17
|
+
"path",
|
|
18
|
+
{
|
|
19
|
+
d: "m21 17-2.156-1.868A.5.5 0 0 0 18 15.5v.5a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1c0-2.545-3.991-3.97-8.5-4a1 1 0 0 0 0 5c4.153 0 4.745-11.295 5.708-13.5a2.5 2.5 0 1 1 3.31 3.284",
|
|
20
|
+
key: "y32ogt"
|
|
21
|
+
}
|
|
22
|
+
],
|
|
23
|
+
["path", { d: "M3 21h18", key: "itz85i" }]
|
|
24
|
+
], V = S("signature", P), B = C(
|
|
10
25
|
[
|
|
11
26
|
// Overlay fields are always absolutely positioned within the
|
|
12
27
|
// renderPageOverlay box; the percent geometry rides the inline style.
|
|
@@ -85,7 +100,7 @@ const P = y(
|
|
|
85
100
|
},
|
|
86
101
|
defaultVariants: { state: "unsigned", active: !1 }
|
|
87
102
|
}
|
|
88
|
-
),
|
|
103
|
+
), D = k(
|
|
89
104
|
({
|
|
90
105
|
state: e = "unsigned",
|
|
91
106
|
insetInlineStart: o,
|
|
@@ -102,12 +117,12 @@ const P = y(
|
|
|
102
117
|
className: h,
|
|
103
118
|
...x
|
|
104
119
|
}, z) => {
|
|
105
|
-
const { t: i } =
|
|
120
|
+
const { t: i } = _(), f = p || e === "signing", n = {};
|
|
106
121
|
o !== void 0 && (n.insetInlineStart = `${o}%`), a !== void 0 && (n.insetBlockStart = `${a}%`), t !== void 0 && (n.inlineSize = `${t}%`), l !== void 0 && (n.blockSize = `${l}%`);
|
|
107
|
-
const F = r ?? i("signatureField.prompt"),
|
|
108
|
-
function
|
|
122
|
+
const F = r ?? i("signatureField.prompt"), N = e === "signing" ? r ? i("signatureField.signingNamed", { label: r }) : i("signatureField.signing") : e === "signed" ? r ? i("signatureField.signedNamed", { label: r }) : i("signatureField.signed") : r ?? i("signatureField.unsigned");
|
|
123
|
+
function j(y) {
|
|
109
124
|
if (f) {
|
|
110
|
-
|
|
125
|
+
y.preventDefault();
|
|
111
126
|
return;
|
|
112
127
|
}
|
|
113
128
|
d == null || d();
|
|
@@ -122,11 +137,11 @@ const P = y(
|
|
|
122
137
|
"data-component-id": b,
|
|
123
138
|
"data-state": e,
|
|
124
139
|
"data-active": g || void 0,
|
|
125
|
-
"aria-label":
|
|
140
|
+
"aria-label": N,
|
|
126
141
|
"aria-disabled": f || void 0,
|
|
127
142
|
"aria-busy": e === "signing" || void 0,
|
|
128
|
-
onClick:
|
|
129
|
-
className: [
|
|
143
|
+
onClick: j,
|
|
144
|
+
className: [B({ state: e, active: g }), h].filter(Boolean).join(" "),
|
|
130
145
|
style: n,
|
|
131
146
|
children: e === "signing" ? (
|
|
132
147
|
// Decorative: the button's aria-label + aria-busy are the single
|
|
@@ -155,7 +170,7 @@ const P = y(
|
|
|
155
170
|
) })
|
|
156
171
|
) : /* @__PURE__ */ m(v, { children: [
|
|
157
172
|
/* @__PURE__ */ s(
|
|
158
|
-
|
|
173
|
+
w,
|
|
159
174
|
{
|
|
160
175
|
"aria-hidden": "true",
|
|
161
176
|
className: "ds:block-size-4 ds:inline-size-4 ds:text-[var(--success)]"
|
|
@@ -165,7 +180,7 @@ const P = y(
|
|
|
165
180
|
] }) : u ? (
|
|
166
181
|
// Glyph-only unsigned prompt — the Signature squiggle reads as
|
|
167
182
|
// "sign here" on its own, where the pen + caption would overflow.
|
|
168
|
-
/* @__PURE__ */ s(
|
|
183
|
+
/* @__PURE__ */ s(V, { "aria-hidden": "true", className: "ds:size-5" })
|
|
169
184
|
) : /* @__PURE__ */ m(v, { children: [
|
|
170
185
|
/* @__PURE__ */ s(
|
|
171
186
|
$,
|
|
@@ -180,9 +195,9 @@ const P = y(
|
|
|
180
195
|
);
|
|
181
196
|
}
|
|
182
197
|
);
|
|
183
|
-
|
|
198
|
+
D.displayName = "SignatureField";
|
|
184
199
|
export {
|
|
185
|
-
|
|
186
|
-
|
|
200
|
+
D as S,
|
|
201
|
+
B as s
|
|
187
202
|
};
|
|
188
|
-
//# sourceMappingURL=signature-field-
|
|
203
|
+
//# sourceMappingURL=signature-field-0rFODJlW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-field-0rFODJlW.js","sources":["../../node_modules/lucide-react/dist/esm/icons/signature.mjs","../../src/components/signature-field/signature-field.tsx"],"sourcesContent":["/**\n * @license lucide-react v1.22.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.mjs';\n\nconst __iconNode = [\n [\n \"path\",\n {\n d: \"m21 17-2.156-1.868A.5.5 0 0 0 18 15.5v.5a1 1 0 0 1-1 1h-2a1 1 0 0 1-1-1c0-2.545-3.991-3.97-8.5-4a1 1 0 0 0 0 5c4.153 0 4.745-11.295 5.708-13.5a2.5 2.5 0 1 1 3.31 3.284\",\n key: \"y32ogt\"\n }\n ],\n [\"path\", { d: \"M3 21h18\", key: \"itz85i\" }]\n];\nconst Signature = createLucideIcon(\"signature\", __iconNode);\n\nexport { __iconNode, Signature as default };\n//# sourceMappingURL=signature.mjs.map\n","/* ------------------------------------------------------------------ */\n/* SignatureField — a single percent-positioned signature placeholder */\n/* rendered inside a PDFViewer page overlay (renderPageOverlay). */\n/* */\n/* Promoted from the story-only field demonstrated in */\n/* pdf-viewer.stories.tsx `WithSignatureFieldOverlays` (HTP-4889): the */\n/* sign.alfadocs.com rebuild needs N of these positioned over each PDF */\n/* page, each a real, keyboard-activatable control whose visual + a11y */\n/* state tracks unsigned → signing → signed. */\n/* */\n/* - Geometry: the consumer supplies percent coordinates */\n/* (insetInlineStart / insetBlockStart / inlineSize / blockSize) */\n/* relative to the overlay box. These are runtime-computed layout */\n/* values driven by consumer data, so they ride an inline `style` */\n/* per 23-constraints §Runtime-computed dimensions — the same */\n/* sanctioned exception PDFViewer/SignatureCapture use. All static */\n/* styling stays in CVA + tokens. Logical properties only, so the */\n/* field mirrors correctly over an RTL document. */\n/* - It IS an interactive control: a real <button>. The accessible name */\n/* reflects state (Sign here / Signing… / Signed); the 44/48px target */\n/* floor is enforced via --min-target-size. */\n/* ------------------------------------------------------------------ */\n\nimport {\n forwardRef,\n type ComponentPropsWithoutRef,\n type CSSProperties,\n type MouseEvent as ReactMouseEvent,\n} from 'react';\nimport { cva } from 'class-variance-authority';\nimport { useTranslation } from 'react-i18next';\nimport { Check, PenLine, Signature } from 'lucide-react';\nimport { Spinner } from '../spinner';\n\n/* ------------------------------------------------------------------ */\n/* Public types */\n/* ------------------------------------------------------------------ */\n\nexport type SignatureFieldState = 'unsigned' | 'signing' | 'signed';\n\nexport interface SignatureFieldProps extends Omit<\n ComponentPropsWithoutRef<'button'>,\n 'onClick' | 'children' | 'aria-label' | 'disabled'\n> {\n /** Lifecycle state. Drives both the visual treatment and the accessible name. */\n state?: SignatureFieldState;\n /**\n * Percent offset of the field's logical start edge within the overlay box.\n * Applied as a runtime-computed `inset-inline-start: {n}%`.\n */\n insetInlineStart?: number;\n /** Percent offset of the field's logical top edge. `inset-block-start: {n}%`. */\n insetBlockStart?: number;\n /** Percent of the overlay's logical inline size — the field width. */\n inlineSize?: number;\n /** Percent of the overlay's logical block size — the field height. */\n blockSize?: number;\n /** Called when an unsigned (or signed) field is activated by click / keyboard. */\n onActivate?: () => void;\n /** Captured signature image (PNG data URL or URL) shown when `state=\"signed\"`. */\n signedImageSrc?: string;\n /**\n * Caption shown in the unsigned prompt and used as the accessible name\n * (e.g. \"Sign here\", \"Date\", \"Initial here\"). Falls back to the\n * translated default prompt.\n */\n label?: string;\n /**\n * Visually hide the caption, leaving only a state glyph (the Signature\n * squiggle unsigned / check signed / spinner signing) — for small or\n * densely placed fields where a long label would overflow the box. The\n * `label` still forms the accessible name.\n */\n hideLabel?: boolean;\n /** Hard-disable the field (non-activatable, dimmed). Distinct from `state=\"signing\"`. */\n disabled?: boolean;\n /**\n * Marks the field as the one currently targeted by field-to-field navigation\n * (Next / Previous signature). Renders a **persistent** selection ring — not\n * the transient `:focus-visible` ring — so the signer can see which field\n * they're on as they step through, even after focus moves or is programmatic.\n */\n active?: boolean;\n}\n\n/* ------------------------------------------------------------------ */\n/* CVA */\n/* ------------------------------------------------------------------ */\n\nconst signatureFieldVariants = cva(\n [\n // Overlay fields are always absolutely positioned within the\n // renderPageOverlay box; the percent geometry rides the inline style.\n 'ds:absolute',\n 'ds:inline-flex ds:items-center ds:justify-center ds:gap-[var(--spacing-xs)]',\n // The visible box renders at its true percentage geometry. A min-size\n // floor here overstretched short fields past their authored box, so\n // neighbours collided (signed box overlapping the next field). The 44/48px\n // touch target is instead restored via a transparent ::before hit-area\n // expansion — the same pattern Button's `sm` size uses — applied on touch\n // viewports only; on desktop the precise box is the target.\n 'ds:before:absolute ds:before:content-[\"\"]',\n 'ds:before:inset-x-[calc((var(--min-target-size)-100%)/-2)]',\n 'ds:before:inset-y-[calc((var(--min-target-size)-100%)/-2)]',\n 'ds:sm:before:hidden',\n // Inline padding lives on the per-state variants below (not the base) so\n // the signed state's tighter padding can't collide with a base ps/pe on\n // the same logical side under Tailwind's JIT ordering.\n 'ds:rounded-[var(--radius-sm)]',\n 'ds:text-[length:var(--font-size-sm)] ds:font-medium',\n 'ds:transition-colors ds:duration-[var(--animation-duration)] ds:motion-reduce:transition-none',\n 'ds:focus-visible:outline-[length:var(--focus-ring-width)]',\n 'ds:focus-visible:outline-solid',\n 'ds:focus-visible:outline-[var(--ring)]',\n 'ds:focus-visible:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:focus-visible:outline-[CanvasText]',\n 'ds:aria-disabled:cursor-not-allowed',\n ].join(' '),\n {\n variants: {\n state: {\n unsigned: [\n 'ds:cursor-pointer',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:border ds:border-dashed ds:border-[color:var(--ring)]',\n 'ds:bg-[color-mix(in_srgb,var(--info)_8%,transparent)]',\n 'ds:text-[var(--foreground)]',\n 'ds:hover:bg-[color-mix(in_srgb,var(--info)_16%,transparent)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n signing: [\n 'ds:cursor-progress',\n 'ds:ps-[var(--spacing-sm)] ds:pe-[var(--spacing-sm)]',\n 'ds:border ds:border-dashed ds:border-[color:var(--border)]',\n 'ds:bg-[var(--muted)]',\n 'ds:text-[var(--muted-foreground)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n signed: [\n // overflow-hidden is NOT on the button root — it would clip the\n // ::before touch-target expansion. It lives on the inner image\n // wrapper instead (see render).\n 'ds:cursor-pointer',\n 'ds:p-[var(--spacing-xs)]',\n 'ds:border ds:border-solid ds:border-[color:var(--success)]',\n 'ds:bg-[color-mix(in_srgb,var(--success)_8%,transparent)]',\n 'ds:text-[var(--foreground)]',\n 'ds:forced-colors:border-[CanvasText]',\n ].join(' '),\n },\n // Persistent selection ring for the nav-targeted field. Uses the same\n // tokens as the focus ring but is NOT gated on :focus-visible, so it\n // stays visible as the signer steps between fields. When the field is\n // also focused, the base focus-visible ring composes over it (same\n // outline property, same value) — no visual clash.\n active: {\n true: [\n 'ds:outline-solid',\n 'ds:outline-[length:var(--focus-ring-width)]',\n 'ds:outline-[var(--ring)]',\n 'ds:outline-offset-[length:var(--focus-ring-offset)]',\n 'ds:forced-colors:outline-[Highlight]',\n ].join(' '),\n false: '',\n },\n },\n defaultVariants: { state: 'unsigned', active: false },\n },\n);\n\n/* ------------------------------------------------------------------ */\n/* SignatureField */\n/* ------------------------------------------------------------------ */\n\nexport const SignatureField = forwardRef<\n HTMLButtonElement,\n SignatureFieldProps\n>(\n (\n {\n state = 'unsigned',\n insetInlineStart,\n insetBlockStart,\n inlineSize,\n blockSize,\n onActivate,\n signedImageSrc,\n label,\n hideLabel = false,\n disabled = false,\n active = false,\n id,\n className,\n ...rest\n },\n ref,\n ) => {\n const { t } = useTranslation();\n\n const inactive = disabled || state === 'signing';\n\n // Runtime-computed overlay geometry — consumer percent coordinates over\n // the PDF page. Inline style is the sanctioned exception here\n // (23-constraints §Runtime-computed dimensions); logical properties keep\n // the field mirrored over RTL documents.\n const geometry: CSSProperties = {};\n if (insetInlineStart !== undefined) {\n geometry.insetInlineStart = `${insetInlineStart}%`;\n }\n if (insetBlockStart !== undefined) {\n geometry.insetBlockStart = `${insetBlockStart}%`;\n }\n if (inlineSize !== undefined) {\n geometry.inlineSize = `${inlineSize}%`;\n }\n if (blockSize !== undefined) {\n geometry.blockSize = `${blockSize}%`;\n }\n\n // `prompt` is the visible caption fallback; `unsigned` is the\n // accessible-name fallback — intentionally distinct strings.\n const promptText = label ?? t('signatureField.prompt');\n // The signed/signing names compose the field's `label` with the status so\n // several signed fields on one page stay individually identifiable (signed\n // fields remain activatable for re-signing); falls back to the bare status\n // when no label is supplied.\n const accessibleName =\n state === 'signing'\n ? label\n ? t('signatureField.signingNamed', { label })\n : t('signatureField.signing')\n : state === 'signed'\n ? label\n ? t('signatureField.signedNamed', { label })\n : t('signatureField.signed')\n : (label ?? t('signatureField.unsigned'));\n\n function handleClick(event: ReactMouseEvent<HTMLButtonElement>): void {\n if (inactive) {\n event.preventDefault();\n return;\n }\n onActivate?.();\n }\n\n return (\n <button\n ref={ref}\n type=\"button\"\n {...rest}\n data-component=\"signature-field\"\n data-component-id={id}\n data-state={state}\n data-active={active || undefined}\n aria-label={accessibleName}\n aria-disabled={inactive || undefined}\n aria-busy={state === 'signing' || undefined}\n onClick={handleClick}\n className={[signatureFieldVariants({ state, active }), className]\n .filter(Boolean)\n .join(' ')}\n // eslint-disable-next-line react/forbid-dom-props -- runtime-computed overlay geometry: consumer percent coordinates over the PDF page (23-constraints §Runtime-computed dimensions)\n style={geometry}\n >\n {state === 'signing' ? (\n // Decorative: the button's aria-label + aria-busy are the single\n // source of the status announcement, so the Spinner's own\n // role=\"status\" live region is hidden from assistive tech.\n <span aria-hidden=\"true\">\n <Spinner\n variant=\"pulse\"\n size=\"sm\"\n label={t('signatureField.signing')}\n />\n </span>\n ) : state === 'signed' ? (\n signedImageSrc ? (\n // overflow-hidden + rounding live on this inner wrapper (not the\n // button root) so the signature is clipped to the box WITHOUT\n // clipping the button's ::before touch-target expansion.\n <span className=\"ds:inline-size-full ds:block-size-full ds:overflow-hidden ds:rounded-[var(--radius-sm)]\">\n <img\n src={signedImageSrc}\n alt=\"\"\n aria-hidden=\"true\"\n className=\"ds:block-size-full ds:inline-size-full ds:object-contain\"\n />\n </span>\n ) : (\n <>\n <Check\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4 ds:text-[var(--success)]\"\n />\n {hideLabel ? null : <span>{t('signatureField.signed')}</span>}\n </>\n )\n ) : hideLabel ? (\n // Glyph-only unsigned prompt — the Signature squiggle reads as\n // \"sign here\" on its own, where the pen + caption would overflow.\n <Signature aria-hidden=\"true\" className=\"ds:size-5\" />\n ) : (\n <>\n <PenLine\n aria-hidden=\"true\"\n className=\"ds:block-size-4 ds:inline-size-4\"\n />\n <span>{promptText}</span>\n </>\n )}\n </button>\n );\n },\n);\n\nSignatureField.displayName = 'SignatureField';\n\nexport { signatureFieldVariants };\n"],"names":["__iconNode","Signature","createLucideIcon","signatureFieldVariants","cva","SignatureField","forwardRef","state","insetInlineStart","insetBlockStart","inlineSize","blockSize","onActivate","signedImageSrc","label","hideLabel","disabled","active","id","className","rest","ref","t","useTranslation","inactive","geometry","promptText","accessibleName","handleClick","event","jsx","Spinner","jsxs","Fragment","Check","PenLine"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa;AAAA,EACjB;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACX;AAAA,EACA;AAAA,EACE,CAAC,QAAQ,EAAE,GAAG,YAAY,KAAK,SAAQ,CAAE;AAC3C,GACMC,IAAYC,EAAiB,aAAaF,CAAU,GCsEpDG,IAAyBC;AAAA,EAC7B;AAAA;AAAA;AAAA,IAGE;AAAA,IACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAOA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA,EACA,KAAK,GAAG;AAAA,EACV;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,UAAU;AAAA,UACR;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,GAAG;AAAA,QACV,SAAS;AAAA,UACP;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QAAA,EACA,KAAK,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AA,YAAA;AAAA,UAAA;AAAA,UAEXnB,IAAY,OAAO,gBAAAe,EAAC,QAAA,EAAM,UAAAR,EAAE,uBAAuB,EAAA,CAAE;AAAA,QAAA,EAAA,CACxD,IAEAP;AAAA;AAAA;AAAA,UAGF,gBAAAe,EAAC7B,GAAA,EAAU,eAAY,QAAO,WAAU,YAAA,CAAY;AAAA,YAEpD,gBAAA+B,EAAAC,GAAA,EACE,UAAA;AAAA,UAAA,gBAAAH;AAAA,YAACK;AAAA,YAAA;AAAA,cACC,eAAY;AAAA,cACZ,WAAU;AAAA,YAAA;AAAA,UAAA;AAAA,UAEZ,gBAAAL,EAAC,UAAM,UAAAJ,EAAA,CAAW;AAAA,QAAA,EAAA,CACpB;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AAEArB,EAAe,cAAc;","x_google_ignoreList":[0]}
|
package/dist/agent-catalog.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"packageVersion": "1.
|
|
3
|
+
"packageVersion": "1.18.0",
|
|
4
4
|
"components": [
|
|
5
5
|
{
|
|
6
6
|
"kind": "component",
|
|
@@ -16598,19 +16598,19 @@
|
|
|
16598
16598
|
"as": "toolRail"
|
|
16599
16599
|
},
|
|
16600
16600
|
{
|
|
16601
|
-
"component": "button",
|
|
16601
|
+
"component": "icon-button",
|
|
16602
16602
|
"as": "newAppointment"
|
|
16603
16603
|
},
|
|
16604
16604
|
{
|
|
16605
|
-
"component": "button
|
|
16605
|
+
"component": "icon-button",
|
|
16606
16606
|
"as": "waitingListSplit"
|
|
16607
16607
|
},
|
|
16608
16608
|
{
|
|
16609
|
-
"component": "button",
|
|
16609
|
+
"component": "icon-button",
|
|
16610
16610
|
"as": "onlineBookings"
|
|
16611
16611
|
},
|
|
16612
16612
|
{
|
|
16613
|
-
"component": "button",
|
|
16613
|
+
"component": "icon-button",
|
|
16614
16614
|
"as": "findFreeSlots"
|
|
16615
16615
|
},
|
|
16616
16616
|
{
|
|
@@ -16805,10 +16805,6 @@
|
|
|
16805
16805
|
"component": "text-input",
|
|
16806
16806
|
"as": "appointmentDescription"
|
|
16807
16807
|
},
|
|
16808
|
-
{
|
|
16809
|
-
"component": "text-area",
|
|
16810
|
-
"as": "appointmentNotes"
|
|
16811
|
-
},
|
|
16812
16808
|
{
|
|
16813
16809
|
"component": "number-input",
|
|
16814
16810
|
"as": "repetitionCount"
|
|
@@ -16863,18 +16859,10 @@
|
|
|
16863
16859
|
"component": "radio-group",
|
|
16864
16860
|
"as": "deleteScope"
|
|
16865
16861
|
},
|
|
16866
|
-
{
|
|
16867
|
-
"component": "dialog",
|
|
16868
|
-
"as": "createBillConfirm"
|
|
16869
|
-
},
|
|
16870
16862
|
{
|
|
16871
16863
|
"component": "dropdown-menu",
|
|
16872
16864
|
"as": "signatureMenu"
|
|
16873
16865
|
},
|
|
16874
|
-
{
|
|
16875
|
-
"component": "dropdown-menu",
|
|
16876
|
-
"as": "documentsMenu"
|
|
16877
|
-
},
|
|
16878
16866
|
{
|
|
16879
16867
|
"component": "signature-status-chip",
|
|
16880
16868
|
"as": "signatureStatus"
|
|
@@ -16902,7 +16890,7 @@
|
|
|
16902
16890
|
},
|
|
16903
16891
|
{
|
|
16904
16892
|
"component": "whatsapp-button",
|
|
16905
|
-
"as": "
|
|
16893
|
+
"as": "whatsAppLink",
|
|
16906
16894
|
"entity": "patient"
|
|
16907
16895
|
},
|
|
16908
16896
|
{
|
|
@@ -17255,7 +17243,7 @@
|
|
|
17255
17243
|
{
|
|
17256
17244
|
"name": "request_signature",
|
|
17257
17245
|
"safety": "phi",
|
|
17258
|
-
"description": "Ask the patient to sign the appointment's documents from the details panel
|
|
17246
|
+
"description": "Ask the patient to sign the appointment's documents from the details panel, by SMS or e-mail through the kit menu. The chip beside it reports the channel a request has already gone out on. There is no \"On this device…\" item: on-device signing is the host's own e-signature surface and no seam here mounts it, so the menu offers only the two channels it can honour. Sends a patient-identifiable request.",
|
|
17259
17247
|
"descriptionKey": "ui.agent.calendar.workflows.requestSignature",
|
|
17260
17248
|
"uiActions": [
|
|
17261
17249
|
"dropdown-menu.open",
|
|
@@ -17268,47 +17256,13 @@
|
|
|
17268
17256
|
"signature.request"
|
|
17269
17257
|
]
|
|
17270
17258
|
},
|
|
17271
|
-
{
|
|
17272
|
-
"name": "create_bill",
|
|
17273
|
-
"safety": "phi",
|
|
17274
|
-
"description": "Raise a bill for the appointment from the details panel's Documents menu, behind a confirmation dialog. Refused while the appointment has no operator. Creates a patient-identifiable financial document.",
|
|
17275
|
-
"descriptionKey": "ui.agent.calendar.workflows.createBill",
|
|
17276
|
-
"uiActions": [
|
|
17277
|
-
"dropdown-menu.open",
|
|
17278
|
-
"dropdown-menu.close",
|
|
17279
|
-
"dialog.open",
|
|
17280
|
-
"dialog.close",
|
|
17281
|
-
"dialog.dismiss"
|
|
17282
|
-
],
|
|
17283
|
-
"stateReads": [
|
|
17284
|
-
"dropdown-menu.isOpen",
|
|
17285
|
-
"dialog.isOpen"
|
|
17286
|
-
],
|
|
17287
|
-
"apiActions": [
|
|
17288
|
-
"bill.create"
|
|
17289
|
-
]
|
|
17290
|
-
},
|
|
17291
|
-
{
|
|
17292
|
-
"name": "open_patient_folder",
|
|
17293
|
-
"safety": "read",
|
|
17294
|
-
"description": "Hand off from an appointment or a waiting-list row to its patient: the name in the details panel's identity strip and in the waiting queue is a link the host resolves to the patient folder. Navigation only.",
|
|
17295
|
-
"descriptionKey": "ui.agent.calendar.workflows.openPatientFolder",
|
|
17296
|
-
"uiActions": [
|
|
17297
|
-
"calendar.focus_event"
|
|
17298
|
-
],
|
|
17299
|
-
"apiActions": [
|
|
17300
|
-
"patient.get"
|
|
17301
|
-
]
|
|
17302
|
-
},
|
|
17303
17259
|
{
|
|
17304
17260
|
"name": "message_patient_whatsapp",
|
|
17305
17261
|
"safety": "phi",
|
|
17306
|
-
"description": "Reach the patient over WhatsApp from
|
|
17262
|
+
"description": "Reach the patient over WhatsApp from a waiting-list row. The affordance is a `wa.me` deep link the row opens in a new tab — it is disabled, and names its reason in its accessible name, when the entry carries no WhatsApp-capable number. There is no equivalent in the details panel: the send-reminder group is handed an empty channel list, because the host's legacy Snippets island is the only composing surface and no seam here mounts it. Hands a patient's contact detail to an outbound channel.",
|
|
17307
17263
|
"descriptionKey": "ui.agent.calendar.workflows.messagePatientWhatsapp",
|
|
17308
17264
|
"uiActions": [],
|
|
17309
|
-
"apiActions": [
|
|
17310
|
-
"patient.openWhatsAppSnippets"
|
|
17311
|
-
]
|
|
17265
|
+
"apiActions": []
|
|
17312
17266
|
},
|
|
17313
17267
|
{
|
|
17314
17268
|
"name": "filter_waiting_list",
|
|
@@ -17377,7 +17331,7 @@
|
|
|
17377
17331
|
{
|
|
17378
17332
|
"name": "find_free_slot",
|
|
17379
17333
|
"safety": "read",
|
|
17380
|
-
"description": "Search the practice for bookable time in the finder panel. Operator and chair scope are grouped checklists behind a popover per axis — a select-all row first, operators sectioned under their groups, nothing ticked searching every eligible resource — beside the care, the duration, the date range and, for a care that needs one, a medical-device select. The results list groups the slots under a day heading; a click steers the grid to that day and docks the editor prefilled with the date, time, duration, chair, operator and any seeded patient or care. The 185-day range warning is advisory (the search still runs), \"Show more slots\" pushes the To date out by 30 days and re-searches, and an alert
|
|
17334
|
+
"description": "Search the practice for bookable time in the finder panel. Operator and chair scope are grouped checklists behind a popover per axis — a select-all row first, operators sectioned under their groups, nothing ticked searching every eligible resource — beside the care, the duration, the date range and, for a care that needs one, a medical-device select. The results list groups the slots under a day heading; a click steers the grid to that day and docks the editor prefilled with the date, time, duration, chair, operator and any seeded patient or care. The 185-day range warning is advisory (the search still runs), \"Show more slots\" pushes the To date out by 30 days and re-searches, and an alert names which business hours are missing when the practice or its operators hold none (it links to the scheduler only where the host supplies that navigation, which this workspace does not). Read-only until a slot is booked.",
|
|
17381
17335
|
"descriptionKey": "ui.agent.calendar.workflows.findFreeSlot",
|
|
17382
17336
|
"uiActions": [
|
|
17383
17337
|
"collapsible.toggle",
|
package/dist/agent-i18n/en.json
CHANGED
|
@@ -181,14 +181,12 @@
|
|
|
181
181
|
"deleteAppointment": "Remove an appointment from the details panel behind an alert dialog. The dialog asks for the recurring scope when the appointment belongs to a series, and for the care-plan cleanup when it is the parent of a price-list recurrence — so confirming can drop far more than the one card. Irreversible from this surface.",
|
|
182
182
|
"managePatientNotes": "Read and write the patient's notes from the Notes sub-view beside History: add a note through the composer, pin one, edit one in a dialog or delete one behind an alert dialog. Every write goes to the host, which stamps the note's id, time and author — the kit attributes nothing to a clinical note. With no host seam, or without the edit permission, the sub-view is a read-only timeline. The rows carry ids and pin / flag / clinical markers only; the body and the author are never exposed as state. Writes patient-identifiable clinical data.",
|
|
183
183
|
"readModificationHistory": "Open the History sub-view of the details panel and read the appointment's modification ledger, newest first — what changed, from what to what, and when. No mutation.",
|
|
184
|
-
"requestSignature": "Ask the patient to sign the appointment's documents from the details panel
|
|
185
|
-
"
|
|
186
|
-
"openPatientFolder": "Hand off from an appointment or a waiting-list row to its patient: the name in the details panel's identity strip and in the waiting queue is a link the host resolves to the patient folder. Navigation only.",
|
|
187
|
-
"messagePatientWhatsapp": "Reach the patient over WhatsApp from the details panel or a waiting-list row. The kit only raises the bridge — the host mounts the legacy Snippets surface that composes and sends. The affordance is disabled, and names its reason in its accessible name, when the entry carries no SMS-capable number. Hands a patient's contact detail to an outbound channel.",
|
|
184
|
+
"requestSignature": "Ask the patient to sign the appointment's documents from the details panel, by SMS or e-mail through the kit menu. The chip beside it reports the channel a request has already gone out on. There is no \"On this device…\" item: on-device signing is the host's own e-signature surface and no seam here mounts it, so the menu offers only the two channels it can honour. Sends a patient-identifiable request.",
|
|
185
|
+
"messagePatientWhatsapp": "Reach the patient over WhatsApp from a waiting-list row. The affordance is a `wa.me` deep link the row opens in a new tab — it is disabled, and names its reason in its accessible name, when the entry carries no WhatsApp-capable number. There is no equivalent in the details panel: the send-reminder group is handed an empty channel list, because the host's legacy Snippets island is the only composing surface and no seam here mounts it. Hands a patient's contact detail to an outbound channel.",
|
|
188
186
|
"filterWaitingList": "Narrow the waiting queue: the four quick views (all, patients without an appointment, appointment scheduled over 30 days ago, on the list over 30 days) and, behind \"Show advanced filters\", the platform's nine optional client-side inputs — patient, patient assigned, operator, appointment scheduled, appointment scheduled from / to, on the waiting list from / to and description — applied only when \"Filter list\" is pressed. The toggle carries a count badge while any input is set, and changing the quick view drops the form. Selection only.",
|
|
189
187
|
"manageWaitingListEntry": "Add, amend or remove a waiting-list entry. The four-field form opens as a rail SUB-VIEW — from the toolbar split button's plus segment, from Add entry, or from a row's pencil — with a back arrow to the queue. Editing is refused on a row already linked to an appointment, because those fields belong to the appointment; the pencil stays focusable and names that reason. Remove deletes at once with no confirmation, platform parity, and its toast carries an Undo that puts the entry back. Writes patient-identifiable data.",
|
|
190
188
|
"scheduleWaitingPatient": "Give a waiting patient a slot. \"Schedule\" on an unlinked row hands off to the free-slot finder seeded from the entry — operator, chair, duration, patient, care and colour already filled in — and booking a slot opens the editor carrying the entry, so saving books the appointment and takes the entry off the list. A row already linked to an appointment reads \"Reschedule\" and seeds the same finder, but booking there MOVES the existing appointment rather than creating a second one. Writes patient-identifiable data.",
|
|
191
|
-
"findFreeSlot": "Search the practice for bookable time in the finder panel. Operator and chair scope are grouped checklists behind a popover per axis — a select-all row first, operators sectioned under their groups, nothing ticked searching every eligible resource — beside the care, the duration, the date range and, for a care that needs one, a medical-device select. The results list groups the slots under a day heading; a click steers the grid to that day and docks the editor prefilled with the date, time, duration, chair, operator and any seeded patient or care. The 185-day range warning is advisory (the search still runs), \"Show more slots\" pushes the To date out by 30 days and re-searches, and an alert
|
|
189
|
+
"findFreeSlot": "Search the practice for bookable time in the finder panel. Operator and chair scope are grouped checklists behind a popover per axis — a select-all row first, operators sectioned under their groups, nothing ticked searching every eligible resource — beside the care, the duration, the date range and, for a care that needs one, a medical-device select. The results list groups the slots under a day heading; a click steers the grid to that day and docks the editor prefilled with the date, time, duration, chair, operator and any seeded patient or care. The 185-day range warning is advisory (the search still runs), \"Show more slots\" pushes the To date out by 30 days and re-searches, and an alert names which business hours are missing when the practice or its operators hold none (it links to the scheduler only where the host supplies that navigation, which this workspace does not). Read-only until a slot is booked.",
|
|
192
190
|
"triageOnlineBooking": "Work the online-bookings panel — the platform's bookings page hosted in the rail, badged with the bookings of the last thirty days still missing a patient or an operator. A row can be shown on the grid, which selects it and docks its details, or completed, which docks the editor prefilled with what the person typed on the booking site so the missing patient or operator can be filled in and saved. Completing writes patient-identifiable data.",
|
|
193
191
|
"printDaySheet": "Print the front-desk call sheet. The toolbar's printer icon opens a dialog asking which day — one day, never the visible range — and Print renders that day's appointments through the browser, scoped by the filters in force and masked when privacy mode is on. Nothing is sent to a server, but the sheet itself is a patient-identifiable document."
|
|
194
192
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calendar-day helpers, shared by the date filter and the date cell renderer.
|
|
3
|
+
*
|
|
4
|
+
* A calendar day is not an instant. `new Date('2008-09-06')` is UTC midnight,
|
|
5
|
+
* which every local getter then reads back shifted: west of UTC it is the 5th.
|
|
6
|
+
* Everything here works in local date parts so a day stays the day it was
|
|
7
|
+
* written with, whatever zone the browser is in.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* A `Date` as `YYYY-MM-DD`, read off the LOCAL date parts — `toISOString()`
|
|
11
|
+
* would shift a local midnight to the previous day anywhere east of UTC.
|
|
12
|
+
*/
|
|
13
|
+
export declare function toIsoDate(d: Date | undefined): string | null;
|
|
14
|
+
/** Whether a value is a bare `YYYY-MM-DD` — a calendar day, carrying no instant. */
|
|
15
|
+
export declare function isCalendarDay(s: unknown): s is string;
|
|
16
|
+
/** A bare day parses as LOCAL midnight; anything with a time/offset as-is. */
|
|
17
|
+
export declare function fromIsoDate(s: string | null | undefined): Date | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The calendar day a cell value stands for, as `YYYY-MM-DD`.
|
|
20
|
+
*
|
|
21
|
+
* An ISO string is read as the day it was WRITTEN with — `2026-04-15T17:32+02:00`
|
|
22
|
+
* is the 15th and `1933-04-04T00:00+01:00` the 4th, whatever zone the browser
|
|
23
|
+
* is in. Anything else is parsed and read off its local parts.
|
|
24
|
+
*/
|
|
25
|
+
export declare function dayOf(cellValue: unknown): string | null;
|
|
26
|
+
//# sourceMappingURL=calendar-day.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calendar-day.d.ts","sourceRoot":"","sources":["../../../src/components/data-table/calendar-day.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;GAGG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAM5D;AAED,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,MAAM,CAErD;AAED,8EAA8E;AAC9E,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,GAAG,SAAS,CAU1E;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CASvD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-cell-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/cell-renderers/date-cell-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"date-cell-renderer.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/cell-renderers/date-cell-renderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAI7D,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAEvE,MAAM,WAAW,sBAAsB;IACrC,6CAA6C;IAC7C,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,oDAAoD;IACpD,OAAO,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;CACtC;AAiBD,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,uBAAuB,GAAG,sBAAsB,kDAqCxD"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { CustomFilterProps, CustomFloatingFilterProps } from 'ag-grid-react';
|
|
2
2
|
import type { IFilter } from 'ag-grid-community';
|
|
3
|
+
import { dayOf, fromIsoDate, toIsoDate } from '../calendar-day';
|
|
4
|
+
export { dayOf, fromIsoDate, toIsoDate };
|
|
3
5
|
/**
|
|
4
6
|
* Custom AG Grid filter component for date *ranges*. AG Grid Community's
|
|
5
7
|
* built-in `agDateColumnFilter` only handles single-date comparison —
|
|
@@ -32,26 +34,6 @@ export interface DateRangeFilterParams {
|
|
|
32
34
|
placeholder?: string;
|
|
33
35
|
commitMode?: 'auto' | 'apply';
|
|
34
36
|
}
|
|
35
|
-
/**
|
|
36
|
-
* The model stores calendar days (`YYYY-MM-DD`), never instants: a range is
|
|
37
|
-
* "from this day to that day" in the user's own calendar. So the day is read
|
|
38
|
-
* off the local date parts — `toISOString()` would shift a local midnight to
|
|
39
|
-
* the previous day anywhere east of UTC.
|
|
40
|
-
*/
|
|
41
|
-
export declare function toIsoDate(d: Date | undefined): string | null;
|
|
42
|
-
/** A bare day parses as LOCAL midnight; anything with a time/offset as-is. */
|
|
43
|
-
export declare function fromIsoDate(s: string | null | undefined): Date | undefined;
|
|
44
|
-
/**
|
|
45
|
-
* The calendar day a cell value stands for, as `YYYY-MM-DD`.
|
|
46
|
-
*
|
|
47
|
-
* An ISO string is read as the day it was WRITTEN with — `2026-04-15T17:32+02:00`
|
|
48
|
-
* is the 15th and `1933-04-04T00:00+01:00` the 4th, whatever zone the browser
|
|
49
|
-
* runs in. (Reducing the instant to the viewer's local day would move a
|
|
50
|
-
* practice-local timestamp across midnight for anyone in another zone, and
|
|
51
|
-
* made the result depend on the machine running the grid.) A `Date` has no
|
|
52
|
-
* offset of its own, so it is read in local time.
|
|
53
|
-
*/
|
|
54
|
-
export declare function dayOf(cellValue: unknown): string | null;
|
|
55
37
|
/** Whether a cell's day lies within `[dateFrom, dateTo]` (either end open). */
|
|
56
38
|
export declare function dayInRange(cellValue: unknown, dateFrom: string | null | undefined, dateTo: string | null | undefined): boolean;
|
|
57
39
|
export declare function DateRangeFilter(props: CustomFilterProps<unknown, unknown, DateRangeFilterModel>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-range-filter.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/filters/date-range-filter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"date-range-filter.d.ts","sourceRoot":"","sources":["../../../../src/components/data-table/filters/date-range-filter.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,yBAAyB,EAC1B,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAKjD,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEhE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED,+EAA+E;AAC/E,wBAAgB,UAAU,CACxB,SAAS,EAAE,OAAO,EAClB,QAAQ,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACnC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAChC,OAAO,CAOT;AAED,wBAAgB,eAAe,CAC7B,KAAK,EAAE,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,oBAAoB,CAAC,2CA0DjE;AAED;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,yBAAyB,CAC9B,OAAO,EACP,OAAO,EACP,OAAO,EACP,oBAAoB,CACrB,2CAgDF"}
|