Dropdown table โ
A dropdown that opens a native <table> for picking row(s). controlMonoDataDropdown wraps controlMonoTable (exposed as dd.grid), so the panel's table controls bind with :control-table.prop="dd.grid". Bind the field with :control-data-dropdown.prop="dd".
Control โ
controlMonoDataDropdown owns selection/value (it wraps a controlMonoTable, exposed as dd.grid); bind the field with :control-data-dropdown and read dd.modelValue from outside.
Because the options are forwarded to the wrapped grid, every controlMonoTable option works here too โ including searchValue, which names the searched columns and takes an array or a comma string. Omit it and the panel searches '*', every top-level field, like any other grid. The panel searches through a slotted <mono-table-search>, so its element-level search-value applies here as well.
controlMonoDataDropdown(data, { props }) declares every element's props in one place โ the same shape controlMonoTable and controlMonoForm use โ so the field is wired with only :control-data-dropdown.prop="dd". props.dropdownTable targets the field itself (label, placeholder, clearable, panel sizeโฆ); every other key targets the panel and is forwarded verbatim to the wrapped grid. The panel's mono-table-* still bind :control-table.prop="dd.grid" โ the panel really is a grid.
Basic โ
Single-select over a local array, with everything declared centrally.
Opening the panel puts the caret straight into the <mono-table-search slot="search">; closing it hands focus back to the field. Set :auto-focus-search="false" to keep focus on the field โ useful on touch, where focusing an input raises the virtual keyboard over the rows.
Keyboard โ
The panel has two zones โ search box and row list. Tab moves between them; โ/โ move the highlight (scrolling it in), Enter selects it, Esc closes. The highlighted row shows a leading bar (--mono-dropdown-table-cursor-width / -color); searching or paging moves it onto the new first row.
Sizes โ
xsโxxl, the same scale as <mono-select> and <mono-tag-input>.
Variants โ
outlined (default), filled and underlined.
underlined focuses with a soft glow under the line rather than a ring around the field โ tune it with --mono-dropdown-table-underline-glow (default 0 5px 6px -6px).
Colors โ
Every built-in color tints the focus ring, open state and selected-row highlight.
States โ
disabled, readonly (opens but can't change) and required.
Validation โ
validation-state (valid / invalid / warning) with a validation-message.
Clearable โ
clearable shows a โ that resets the selection (emitting mno-change with an empty value).
Appearance โ
Same size / variant / color / validation-state / label props as <mono-select>, so the two look identical.
Field & panel size โ
The field width is a css-size prop; the panel is sized separately by :dropdown.prop="{ width, height }" โ so a narrow field can open a wide grid.
Placement โ
The panel stays inside the viewport on its own, so a field low on the page โ or in a grid row below the fold โ is never clipped:
flip(defaulttrue) opens the panel upward when there isn't room below.shift(defaulttrue) slides it along the cross axis so it doesn't overflow a screen edge.- When neither side has room for the full panel, it opens on the roomier side and shrinks to fit, scrolling the table internally rather than running off-screen.
placement sets the preferred side + alignment (default bottom-start); with flip on it's a preference, not a guarantee. offset (default 6) is the gap between the field and the panel.
The resolved side is reflected on the root as is-top / is-bottom, so you can style a flipped panel.
Multiple โ
Multi-select with chips + a "+N more" overflow, a checkbox column and a select-all header checkbox.
Custom keys โ
keyExpr picks the value field; displayExpr (field name or (row) => string) picks the text.
Customized โ
cssClass appends a class to each field part (root / label / value / message / trigger / โฆ).
CSS variables โ
Themed through --mono-dropdown-table-* custom properties (they inherit and pierce the shadow boundary).
| Variable | Default | Controls |
|---|---|---|
--mono-dropdown-table-cursor-width | 3px | Keyboard-cursor bar on the highlighted panel row |
--mono-dropdown-table-cursor-color | focus color | Colour of that bar |
Event: change โ
mno-change carries modelValue, value and the resolved selectedItems ({ key, text, data }[]).
Event log โ
A live log of mno-change as rows are picked and cleared โ clearing emits mno-change with an empty value (there is no separate mno-clear).
Remote DataSource โ
Bound to a remote OData source; selected keys resolve to display text with a filter โฆ in load, and search runs server-side.
Scroll paging โ
Swap the numbered pager for a scrolling one on a flat grid โ bind <mono-table-paging type="โฆ"> to dd.grid, place it in the body slot right after the <table>, and give the panel a bounded :dropdown.prop="{ height }".
Infinity scroll โ
type="infinity-scroll" appends the next page onto dd.grid.items as you near the bottom โ render it as a plain v-for.
Against a remote source each scroll fetches the next server page.
Virtual scroll โ
type="virtual-scroll" keeps only the visible rows in the DOM; render spacer <tr>s from virtualPadTop / virtualPadBottom and pin a fixed :row-height.
The same windowing over a remote source.
Types โ
controlMonoDataDropdown is also exported as monoDataDropdown, and :control-data-dropdown is also accepted as :data-dropdown โ the older spellings still work.
Import
import { DropdownTableProps } from 'mono-helper'| Prop | Value | Default | Description |
|---|---|---|---|
dataDropdown | MonoDropdownController<any> | โ | The dropdown controller. Bind with `.prop`: `:data-dropdown.prop="dd"`. |
controlDataDropdown | MonoDropdownController<any> | โ | Renamed โ `:control-data-dropdown` / `:controlDataDropdown` alias `dataDropdown`. |
size | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | โ | Visual size of the field. |
color | 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | โ | Color theme applied to the field (focus ring / accent). |
variant | 'underlined' | 'outlined' | 'filled' | โ | Field style variant. |
label | string | โ | Text label shown above the field. |
placeholder | string | โ | Placeholder shown in the field when nothing is selected. |
helperText | string | โ | Helper text shown below the field. |
validationState | 'warning' | 'default' | 'valid' | 'invalid' | โ | Validation state controlling the field's appearance. |
validationMessage | string | โ | Validation message shown below the field. |
errorMessage | string | โ | Error message shown below the field (forces the invalid state). |
successMessage | string | โ | Success message shown below the field (forces the valid state). |
required | boolean | โ | Mark the field required (shows a `*` next to the label). |
disabled | boolean | โ | Disable the control (no open, no selection). |
readonly | boolean | โ | Read-only โ the panel opens but selection can't change. |
clearable | boolean | โ | Show a clear (โ) button in the field when there is a value. |
multiple | boolean | โ | Multi-select โ array value + chips. Falls back to the controller's `multiple`. |
max | number | โ | Max chips shown inline before a "+N more" overflow (multi). Default `5`. |
modelValue | unknown | โ | v-model value โ scalar (single) or array (multi). Bind `:model-value` + `@mno-change`. |
width | string | number | โ | Field sizing (the trigger + wrapper). A CSS length string (`"320px"`, `"80%"`) or a number (px). Distinct from `dropdown`, which sizes the popup panel. |
height | string | number | โ | โ |
minWidth | string | number | โ | โ |
maxWidth | string | number | โ | โ |
minHeight | string | number | โ | โ |
maxHeight | string | number | โ | โ |
dropdown | DropdownPanelOptions | โ | Sizes the popup panel only (independent of the field). Bind with `.prop`. |
placement | 'left' | 'right' | 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end' | 'right-start' | 'right-end' | โ | Preferred side + cross-axis alignment of the panel, e.g. `"bottom-start"` (default) or `"top-end"`. Same 12 values as `<mono-dropdown>`. With `flip` left on this is only a *preference* โ the panel still moves out of the way of a viewport edge. |
flip | boolean | โ | Open on the opposite side when the preferred one lacks room โ e.g. a field near the bottom of the viewport drops UPWARD instead of being clipped. Default `true`. |
shift | boolean | โ | Slide the panel along the cross axis so it stays inside the viewport โ e.g. a field near the right edge keeps its full width instead of overflowing. Default `true`. |
offset | number | โ | Gap between the field and the panel, in px. Default `6`. |
autoFocusSearch | boolean | โ | Focus the panel's search box (a `<mono-table-search slot="search">`) as soon as the panel opens, so the user can type straight away. Default `true`. Turn it off when the focus would be unwelcome โ e.g. on touch devices, where focusing an input pops the virtual keyboard over the rows. |
stayOpen | boolean | โ | Exempt this dropdown from every automatic close โ clicking or focusing anything outside it, which includes opening another one. Not a lock: its own trigger, Escape and picking a row still close it. |
cssClass | DropdownTableCssClass | โ | Per-part class overrides. Object, or a JSON string via the `css-class` attribute. |
cssClassName | string | โ | A single class added to the root (the string form of `css-class`). |
visible | boolean | โ | Whether the control is shown. Defaults to `true`. |
visibleType | 'invisible' | 'none' | โ | How it hides when `visible` is `false`. Defaults to `'none'`. |