@xleddyl/443-components-vue 0.16.84 → 0.16.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CATALOG.md +15 -15
- package/README.md +2 -2
- package/dist/grid/DataGrid.vue +13 -1
- package/dist/grid/theme.d.ts +1 -0
- package/dist/grid/theme.mjs +4 -0
- package/dist/internal/overlays/DialogFrame.vue +8 -2
- package/dist/internal/overlays/DialogFrame.vue.d.ts +1 -0
- package/dist/styles/overlays/modal.css +16 -0
- package/package.json +1 -1
package/CATALOG.md
CHANGED
|
@@ -194,21 +194,21 @@ All field components work inside `FormField` and take `invalid`, `disabled`, `re
|
|
|
194
194
|
|
|
195
195
|
Mount `OverlayHost` once for the imperative hooks (see [Composables](#composables)).
|
|
196
196
|
|
|
197
|
-
| Component | Purpose and when to use it | Main props, models, slots, events
|
|
198
|
-
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
199
|
-
| `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/modal.vue` |
|
|
200
|
-
| `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`). Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`.
|
|
201
|
-
| `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`.
|
|
202
|
-
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None.
|
|
203
|
-
| `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`).
|
|
204
|
-
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`.
|
|
205
|
-
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`.
|
|
206
|
-
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`.
|
|
207
|
-
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`. Slots: default (the trigger), `content`.
|
|
208
|
-
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`.
|
|
209
|
-
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`.
|
|
210
|
-
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `onSelect`), `search(query, signal)`, `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`.
|
|
211
|
-
| `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone).
|
|
197
|
+
| Component | Purpose and when to use it | Main props, models, slots, events | Playground |
|
|
198
|
+
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ |
|
|
199
|
+
| `Modal` | Centered dialog for forms and content. Use `Drawer` for a side panel, `useConfirm` for a yes or no question. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `size` (sm to xl, full, fit, fullscreen), `width`, `minHeight`, `height` (fixed, capped at the viewport), `dismissible`, `hideClose`, `sheet`, `flush`, `fill`, `loading`, `beforeClose(reason)`, `tabs` (tabs in the header), `trail` (breadcrumb title and back button; a long trail stays on one line, the middle crumbs collapse into a "..." menu and the current title truncates), `backLabel`, `guard` (default `true`: closing, or a trail navigation, with a dirty `Form` inside asks to discard first; `beforeClose` runs after), `guardTitle`, `guardMessage`. Slots: default (`{ tab }`), `header`, `actions` (header, before the close button), `toolbar` (a full width row of controls under the title and the description, such as filters), `footer`, `title-trailing`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/modal.vue` |
|
|
200
|
+
| `Drawer` | Panel from the side or bottom for details and edit forms. Use `Modal` for short focused dialogs. | Models: `v-model:open`, `v-model:tab`. Props: `title`, `description`, `side` (left, right, bottom), `size` (sm to xl, full), `dismissible`, `hideClose`, `flush`, `fill` (the body content takes the full height, for a table or a grid), `loading`, `beforeClose(reason)`, `tabs`, `trail`, `backLabel`, `guard`, `guardTitle`, `guardMessage` (as `Modal`). Slots like `Modal`. Events: `open`, `close`, `afterLeave`, `navigate(index)`. Exposes `close()`, `confirmLeave()`, `dirty`. | `overlays/drawer.vue` |
|
|
201
|
+
| `ConfirmDialog` | Declarative confirm dialog. Prefer `useConfirm()`. Use this one only when the dialog state lives in the template. | Model: `v-model:open`. Props: `title`, `description`, `confirmLabel`, `cancelLabel`, `tone`, `icon`, `hideCancel`, `onConfirm`. Events: `resolve(confirmed)`, `cancel`, `afterLeave`. | `overlays/confirm-dialog.vue` |
|
|
202
|
+
| `ConfirmHost` | Renders the dialogs of `useConfirm`, `useAlert`, `usePrompt`. `OverlayHost` includes it. Do not mount it alone. | None. | - |
|
|
203
|
+
| `OverlayHost` | One mount point for toasts, confirm dialogs, programmatic modals and loading indicators. | Props: `toaster` (true or options), `confirm`, `modals`, `loading` (true or `{ bar, delay, label }`). | `overlays/hooks.vue` |
|
|
204
|
+
| `Toaster` | Renders toasts. `OverlayHost` includes it. Use it directly only for custom options. The stack moves out of the way of an open side Drawer (beside it, or above its footer). | Props: `position`, `max`, `duration`, `gap`, `expand`, `progress`, `hotkey`. | `overlays/toast.vue` |
|
|
205
|
+
| `DropdownMenu` | Menu opened by its trigger. Items can have icons, shortcuts, checkboxes, radios, sub menus and links. | Model: `v-model:open`. Props: `items` (`label`, `icon`, `color` (palette name or hex dot, or `muted` for a grey dot of an empty state), `to`, `href`, `tone: danger`, `shortcut`, `disabled`, `disabledReason` (with `disabled`: a tooltip on hover and keyboard focus, linked with `aria-describedby`; the item stays reachable but not selectable), `children`, `onSelect`; also `type`: checkbox, radio, label, separator), `placement`, `offset`, `matchTriggerWidth`, `minWidth`. Slot: default (the trigger). Event: `select`. | `overlays/dropdown-menu.vue` |
|
|
206
|
+
| `ContextMenu` | Menu on right click of the wrapped area. | Model: `v-model:open`. Props: `items` (same as `DropdownMenu`), `disabled`. Slot: default (the area). Event: `select`. | `overlays/context-menu.vue` |
|
|
207
|
+
| `Popover` | Floating panel with any content (a form, filters) opened by its trigger. Use `DropdownMenu` for a list of actions. | Model: `v-model:open`. Props: `placement`, `offset`, `arrow`, `label`, `initialFocus`. Slots: default (the trigger), `content`. | `overlays/popover.vue` |
|
|
208
|
+
| `HoverCard` | Rich preview on hover or focus (user card, link preview). Use `Tooltip` for plain text. | Model: `v-model:open`. Props: `placement`, `openDelay`, `closeDelay`, `arrow`, `disabled`. Slots: default (trigger), `content`. | `overlays/hover-card.vue` |
|
|
209
|
+
| `Tooltip` | Short text on hover or focus. Optional shortcut. `Button` already shows one for icon-only buttons, `tooltip` and `disabledReason`. | Props: `text`, `placement`, `openDelay`, `closeDelay`, `arrow`, `shortcut`, `disabled`. Slots: default (trigger), `content`. | `overlays/tooltip.vue` |
|
|
210
|
+
| `CommandPalette` | Search and command dialog (Cmd+K) with groups, recent items, async search and typed item data. Groups take `icon` (default item icon) and `more` (a last "show all" item). Matching (`matchesSearch`, exported) finds every word in any order, without case or accents. | Models: `v-model:open`, `v-model:query`. Props: `groups` (items with `id`, `label`, `description`, `icon`, `badge`, `shortcut`, `keywords`, `to`, `data`, `onSelect`), `search(query, signal)`, `shortcut`, `trigger`, `recentKey`, `emptyText`, `notice`. Slots: `item`, `empty`, `group-label`, `after-results`. Events: `select`, `open`, `close`. | `overlays/command-palette.vue` |
|
|
211
|
+
| `CommandButton` | A `Button` made from a `CommandItem`: label, icon, `to`, `href`, `disabled`, `disabledReason` (tooltip on the disabled button) and `onSelect` come from the command. | Props: `command`, `label`, `icon`, `iconOnly` (a square button with the icon only, the label as `aria-label` and tooltip), and every `Button` prop (size, variant, tone). | `overlays/command-palette.vue` |
|
|
212
212
|
|
|
213
213
|
## Data
|
|
214
214
|
|
package/README.md
CHANGED
|
@@ -520,7 +520,7 @@ On your own elements, `paletteClass(color)` gives the class of a palette name an
|
|
|
520
520
|
- `FilterPills` can list active filters: options with `removable: true` render as active pills with a remove button (`removeLabel`, a `'Remove {label}'` template). Clicking the pill emits `select(value)`, the button emits `remove(value)` (and drops the value from the model when it is selected); focus moves to the next pill when the removed one disappears.
|
|
521
521
|
- `Calendar` takes `dayText: (iso) => string | undefined`, a short line under each day number that is also added to the day's accessible name (availability, prices). The `#day` slot (`{ date, number, text, selected, unavailable, outOfRange, inMonth }`) replaces the cell content; it is decorative, so announced text still comes from `dayText`. Days before `min` or after `max` get the `is-out-of-range` class (and `is-unavailable`, like days rejected by `isDateDisabled`), so the `--k-calendar-out-of-range-*` tokens style them apart from disabled days.
|
|
522
522
|
- `Separator` takes `description` (or `#description`) under its label, and an `#actions` slot rendered next to them (a small add or edit button). `variant="heading"` (`SeparatorVariant`, `'label' | 'heading'`, default `'label'`) shows the label as a section title on its own (an `h3`, `level` changes it) with the description below and the actions at the end, under one line above instead of the small muted label between two lines. `:lines="false"` (default `true`) hides the lines of either variant. `align` (`SeparatorAlign`, `'start' | 'center'`, default `'start'`) centers the heading title and description. `--k-separator-heading-font-size` (0.9375rem) sizes the heading, `--k-separator-heading-color` (default `--k-text`) colors it, and `--k-separator-label-font-size` (0.75rem) sizes the small label of `variant="label"`, with or without lines.
|
|
523
|
-
- `Modal` takes `width` (any CSS length, overrides `size`), `minHeight` (keeps the height steady while tabs or steps change) and `height` (a fixed height, capped at the viewport: every tab or step has the same size and the body scrolls). The size widths are tokens: `--k-modal-width-sm` (26rem), `--k-modal-width-md` (32rem), `--k-modal-width-lg` (50rem), `--k-modal-width-xl` (64rem).
|
|
523
|
+
- `Modal` takes `width` (any CSS length, overrides `size`), `minHeight` (keeps the height steady while tabs or steps change) and `height` (a fixed height, capped at the viewport: every tab or step has the same size and the body scrolls). The `#toolbar` slot of `Modal` and `Drawer` renders a full width row of controls in the header, under the title and the description (search, filters, a preset select): it stays fixed while the body scrolls. The size widths are tokens: `--k-modal-width-sm` (26rem), `--k-modal-width-md` (32rem), `--k-modal-width-lg` (50rem), `--k-modal-width-xl` (64rem).
|
|
524
524
|
- `Stepper` shows the steps of a wizard: `steps` (`StepperStep[]`: `value`, `label`, `description`, `icon`, `disabled`, `state` `'complete' | 'error'`) and `v-model` for the current value. It renders a `nav` (named by `label`, default "Progress") around an ordered list; the current step has `aria-current="step"`, every step carries a hidden "Step 2 of 4" (`stepper.position`, `positionLabel` overrides it) and its state ("completed", "has errors"). Clickable steps are buttons with one tab stop and arrow keys, Home and End between them. `linear` makes only completed steps (`state: 'complete'` or before the current one) and the current step clickable; `readonly` renders no buttons. `orientation="vertical"` stacks the steps; `size="sm"` is denser. `compact` is `'auto'` by default: below 36rem of container width the labels are visually hidden (still read) and a "Step 2 of 4 Columns" line shows the current step; `true` forces it, `false` turns it off. `:summary="false"` keeps only the numbers in compact mode, without that line (a stepper in a modal header). `select(step)` fires on a click before the model changes.
|
|
525
525
|
|
|
526
526
|
```vue
|
|
@@ -986,7 +986,7 @@ Accessibility related props and defaults:
|
|
|
986
986
|
- A column without a visible header (a photo column) keeps a name for the Columns menu with `headerValueGetter: ({ location }) => (location === 'header' ? '' : 'Photo')`: the menu reads the name for the `columnToolPanel` location.
|
|
987
987
|
- `DataGrid` takes `gridOptions` for any AG Grid option it does not wrap (`rowHeight`, `onCellEditingStopped`, `onFilterChanged`, ...). A prop of `DataGrid` wins only when it is set: `getRowId`, `rowSelection` (when `selectable` is off), `autoSizeStrategy` (also `undefined` to turn it off), `tooltipShowDelay`, `overlayNoRowsTemplate` and `overlayLoadingTemplate` from `gridOptions` are used otherwise; `defaultColDef` and `localeText` are merged over the component defaults, and `context` is merged under the cell context. Handlers from both run.
|
|
988
988
|
- `DataGrid` row ids: `getRowId: (params) => string` (wins), `rowIdKey` (a field of the row), or `gridOptions.getRowId`.
|
|
989
|
-
- `DataGrid` `v-model:selected` (`string[]`) is the selected row ids, two way, for `selectable` grids (also `'single'`, at most one id). It needs row ids (`rowIdKey`, `getRowId` or `gridOptions.getRowId`); a dev warning tells you when they are missing. Leave it unbound for an uncontrolled grid. The header checkbox selects all the filtered rows (`selectAll: 'filtered'`): not the rows hidden by the search or the column filters, and not only the current page. A row hidden by the toolbar search, a column filter or an external filter leaves the selection: the grid deselects it and drops its id from the model when the filter changes, and an id set in the model for a hidden row is dropped too, so a bulk action never acts on rows the user cannot see. `keepHiddenSelected` keeps the old behavior (a hidden row stays selected). Client pagination keeps the selection across pages. A row that disappears from `rows` is dropped from the model, except while `loading` is set or the rows are empty, so a preselected model survives the first load. With `serverPagination` the ids of rows that are not in the current `rows` stay in the model: the selection survives a page change and a re-fetch, the footer counts the whole model, and the header checkbox only selects the rows of the page. The grid cannot see the other pages, so it drops an id that the server filter excludes only when it knows the whole result: once `loading` is off and `rows` holds every row of `total` (or the result is empty), the ids that are not in `rows` leave the model. Rows of the page hidden by a client column filter leave it as in client mode. To drop the ids of other pages when your own filters change, set the model yourself (for example `selected = []` when the query changes). Ids of rows that are not loaded yet stay out of the grid and are selected when the rows arrive. With `serverPagination`, `allIds` (`() => Promise<readonly string[]> | readonly string[]`) adds a footer link "Select all N rows" (`N` is `total`) that shows when every row of the page is selected and the model holds fewer than `total` ids: it calls `allIds`, awaits it and sets the model to the returned ids (a rejected promise keeps the selection and logs an error). When the model holds `total` ids the link becomes "Clear selection". `selectionChange` still emits the selected rows of the grid.
|
|
989
|
+
- `DataGrid` `v-model:selected` (`string[]`) is the selected row ids, two way, for `selectable` grids (also `'single'`, at most one id). It needs row ids (`rowIdKey`, `getRowId` or `gridOptions.getRowId`); a dev warning tells you when they are missing. Leave it unbound for an uncontrolled grid. The header checkbox selects all the filtered rows (`selectAll: 'filtered'`): not the rows hidden by the search or the column filters, and not only the current page. A row hidden by the toolbar search, a column filter or an external filter leaves the selection: the grid deselects it and drops its id from the model when the filter changes, and an id set in the model for a hidden row is dropped too, so a bulk action never acts on rows the user cannot see. `keepHiddenSelected` keeps the old behavior (a hidden row stays selected). Client pagination keeps the selection across pages. A row that disappears from `rows` is dropped from the model, except while `loading` is set or the rows are empty, so a preselected model survives the first load. With `serverPagination` the ids of rows that are not in the current `rows` stay in the model: the selection survives a page change and a re-fetch, the footer counts the whole model, and the header checkbox only selects the rows of the page. The grid cannot see the other pages, so it drops an id that the server filter excludes only when it knows the whole result: once `loading` is off and `rows` holds every row of `total` (or the result is empty), the ids that are not in `rows` leave the model. Rows of the page hidden by a client column filter leave it as in client mode. To drop the ids of other pages when your own filters change, set the model yourself (for example `selected = []` when the query changes). Ids of rows that are not loaded yet stay out of the grid and are selected when the rows arrive. With `serverPagination`, `allIds` (`() => Promise<readonly string[]> | readonly string[]`) adds a footer link "Select all N rows" (`N` is `total`) that shows when every row of the page is selected and the model holds fewer than `total` ids: it calls `allIds`, awaits it and sets the model to the returned ids (a rejected promise keeps the selection and logs an error). When the model holds `total` ids the link becomes "Clear selection". `selectionChange` still emits the selected rows of the grid. The checkbox column has a fixed width from the density (the checkbox and the cell padding); `gridOptions.selectionColumnDef` is merged over it.
|
|
990
990
|
- `DataGrid` template ref methods have a type: `DataGridMethods<Row>` (`api`, `getSelectedRows`, `getSelectedIds`, `selectRows(ids)`, `selectAllRows()` for the filtered rows, `deselectAll`, `resetColumns` and the `GridSpreadsheetMethods`; `selectAll` stays the cell range one of the spreadsheet).
|
|
991
991
|
|
|
992
992
|
```ts
|
package/dist/grid/DataGrid.vue
CHANGED
|
@@ -65,6 +65,7 @@
|
|
|
65
65
|
:overlay-loading-template="gridOptions?.overlayLoadingTemplate ?? loadingTemplate"
|
|
66
66
|
:quick-filter-text="serverPagination ? void 0 : query"
|
|
67
67
|
:row-selection="gridRowSelection"
|
|
68
|
+
:selection-column-def="gridSelectionColumnDef"
|
|
68
69
|
:pagination="paginated && pageSize !== 'all'"
|
|
69
70
|
:pagination-page-size="pageSize === 'all' ? void 0 : pageSize"
|
|
70
71
|
:pagination-page-size-selector="false"
|
|
@@ -164,7 +165,7 @@ import {
|
|
|
164
165
|
registerGridSpreadsheetModules
|
|
165
166
|
} from "./modules";
|
|
166
167
|
import { createGridSpreadsheet } from "./spreadsheet";
|
|
167
|
-
import { getGridTheme } from "./theme";
|
|
168
|
+
import { getGridTheme, selectionColumnWidth } from "./theme";
|
|
168
169
|
registerGridModules();
|
|
169
170
|
const props = defineProps({
|
|
170
171
|
rows: { type: Array, required: false, default: () => [] },
|
|
@@ -355,6 +356,17 @@ const gridRowSelection = computed(() => {
|
|
|
355
356
|
selectAll: "filtered"
|
|
356
357
|
};
|
|
357
358
|
});
|
|
359
|
+
const gridSelectionColumnDef = computed(() => {
|
|
360
|
+
const width = selectionColumnWidth(gridDensity.value);
|
|
361
|
+
return {
|
|
362
|
+
width,
|
|
363
|
+
minWidth: width,
|
|
364
|
+
maxWidth: width,
|
|
365
|
+
resizable: false,
|
|
366
|
+
suppressSizeToFit: true,
|
|
367
|
+
...props.gridOptions?.selectionColumnDef
|
|
368
|
+
};
|
|
369
|
+
});
|
|
358
370
|
const defaultColDef = computed(() => ({
|
|
359
371
|
sortable: true,
|
|
360
372
|
resizable: true,
|
package/dist/grid/theme.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import type { GridDensity } from './types';
|
|
2
|
+
export declare function selectionColumnWidth(density: GridDensity): number;
|
|
2
3
|
export declare function createGridTheme(density: GridDensity, rowHeight?: number): import("ag-grid-community").Theme<import("ag-grid-community").ThemeDefaultParams>;
|
|
3
4
|
export declare function getGridTheme(density: GridDensity, rowHeight?: number): import("ag-grid-community").Theme<import("ag-grid-community").ThemeDefaultParams>;
|
package/dist/grid/theme.mjs
CHANGED
|
@@ -4,6 +4,10 @@ const spacingByDensity = {
|
|
|
4
4
|
normal: 6,
|
|
5
5
|
comfortable: 9
|
|
6
6
|
};
|
|
7
|
+
const CHECKBOX_SIZE = 16;
|
|
8
|
+
export function selectionColumnWidth(density) {
|
|
9
|
+
return CHECKBOX_SIZE + spacingByDensity[density] * 6;
|
|
10
|
+
}
|
|
7
11
|
const themes = /* @__PURE__ */ new Map();
|
|
8
12
|
export function createGridTheme(density, rowHeight) {
|
|
9
13
|
const theme = themeQuartz.withParams({
|
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
@click="onClick"
|
|
13
13
|
>
|
|
14
14
|
<div v-if="present" ref="panelRef" :class="`${prefix}-panel`" tabindex="-1">
|
|
15
|
-
<header
|
|
15
|
+
<header
|
|
16
|
+
v-if="hasHeader"
|
|
17
|
+
:class="[`${prefix}-header`, { 'has-tabs': hasTabs, 'has-toolbar': !!slots.toolbar }]"
|
|
18
|
+
>
|
|
16
19
|
<div v-if="slots.header" :id="headerId" class="k-dialog-header-slot">
|
|
17
20
|
<slot
|
|
18
21
|
name="header"
|
|
@@ -66,6 +69,9 @@
|
|
|
66
69
|
@click="requestClose('close-button')"
|
|
67
70
|
/>
|
|
68
71
|
</div>
|
|
72
|
+
<div v-if="slots.toolbar" :class="`${prefix}-toolbar`">
|
|
73
|
+
<slot name="toolbar" />
|
|
74
|
+
</div>
|
|
69
75
|
<Tabs
|
|
70
76
|
v-if="hasTabs"
|
|
71
77
|
v-model="tab"
|
|
@@ -202,7 +208,7 @@ watch(open, (value) => {
|
|
|
202
208
|
const showClose = computed(() => props.dismissible && !props.hideClose);
|
|
203
209
|
const hasHeader = computed(
|
|
204
210
|
() => Boolean(
|
|
205
|
-
hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || showClose.value || hasTrail.value || hasTabs.value
|
|
211
|
+
hasTitle.value || hasDescription.value || slots["title-trailing"] || slots.header || slots.actions || slots.toolbar || showClose.value || hasTrail.value || hasTabs.value
|
|
206
212
|
)
|
|
207
213
|
);
|
|
208
214
|
const { present, requestClose, onCancel, onClose, onPointerDown, onClick } = useModalDialog({
|
|
@@ -243,6 +243,22 @@
|
|
|
243
243
|
color: var(--k-text-dimmed);
|
|
244
244
|
}
|
|
245
245
|
|
|
246
|
+
.k-modal-header.has-toolbar,
|
|
247
|
+
.k-drawer-header.has-toolbar {
|
|
248
|
+
flex-wrap: wrap;
|
|
249
|
+
row-gap: 0.75rem;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
.k-modal-toolbar,
|
|
253
|
+
.k-drawer-toolbar {
|
|
254
|
+
display: flex;
|
|
255
|
+
flex: 1 0 100%;
|
|
256
|
+
flex-wrap: wrap;
|
|
257
|
+
align-items: center;
|
|
258
|
+
gap: 0.75rem;
|
|
259
|
+
min-width: 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
246
262
|
.k-modal-header.has-tabs,
|
|
247
263
|
.k-drawer-header.has-tabs {
|
|
248
264
|
flex-wrap: wrap;
|
package/package.json
CHANGED