mgv-backoffice 1.37.0 → 1.40.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/README.md +147 -4
- package/dist/components/BaseAuthLayout.vue.d.ts +27 -0
- package/dist/components/BaseBooleanBadge.vue.d.ts +12 -0
- package/dist/components/BaseCard.vue.d.ts +33 -0
- package/dist/components/BaseDetailList.vue.d.ts +13 -0
- package/dist/components/BaseField.vue.d.ts +38 -0
- package/dist/components/BasePageHeader.vue.d.ts +3 -0
- package/dist/components/BaseSearchSelect.vue.d.ts +41 -0
- package/dist/components/BaseStatCard.vue.d.ts +33 -0
- package/dist/components/BaseTable.vue.d.ts +3 -0
- package/dist/components/BaseToggle.vue.d.ts +33 -0
- package/dist/index.d.ts +9 -0
- package/dist/types/detail.d.ts +10 -0
- package/dist/ui-lib.css +1 -1
- package/dist/ui-lib.js +1388 -881
- package/dist/ui-lib.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/components/BaseAuthLayout.test.ts +48 -0
- package/src/components/BaseAuthLayout.vue +50 -0
- package/src/components/BaseBooleanBadge.vue +33 -0
- package/src/components/BaseBreadcrumb.vue +68 -68
- package/src/components/BaseButton.vue +1 -1
- package/src/components/BaseCard.test.ts +55 -0
- package/src/components/BaseCard.vue +48 -0
- package/src/components/BaseDetailList.test.ts +36 -0
- package/src/components/BaseDetailList.vue +43 -0
- package/src/components/BaseField.vue +47 -0
- package/src/components/BaseInput.test.ts +1 -1
- package/src/components/BaseInput.vue +46 -46
- package/src/components/BaseLogo.test.ts +26 -0
- package/src/components/BaseLogo.vue +7 -1
- package/src/components/BasePageHeader.vue +13 -2
- package/src/components/BaseSearchSelect.test.ts +117 -0
- package/src/components/BaseSearchSelect.vue +318 -0
- package/src/components/BaseSelect.test.ts +3 -3
- package/src/components/BaseSelect.vue +62 -46
- package/src/components/BaseStatCard.test.ts +40 -0
- package/src/components/BaseStatCard.vue +103 -0
- package/src/components/BaseTable.test.ts +69 -55
- package/src/components/BaseTable.vue +62 -50
- package/src/components/BaseToggle.test.ts +39 -0
- package/src/components/BaseToggle.vue +73 -0
- package/src/components/Pagination.test.ts +93 -85
- package/src/components/Pagination.vue +87 -82
- package/src/index.ts +9 -0
- package/src/style.css +58 -58
- package/src/types/detail.ts +10 -0
package/README.md
CHANGED
|
@@ -169,7 +169,7 @@ Button with color, size, loading state, and Vue Router integration.
|
|
|
169
169
|
| Prop | Type | Default | Description |
|
|
170
170
|
| ------------- | ----------------------------------- | --------------------- | ------------------------------------ |
|
|
171
171
|
| `description` | `String` | **required** | Button label text |
|
|
172
|
-
| `color` | `String` | `BaseButtonEnum.
|
|
172
|
+
| `color` | `String` | `BaseButtonEnum.GREEN` | Color variant (`BLUE`/`WHITE`/`DARK`/`GREEN`/`EMERALD`/`RED`/`YELLOW`/`PURPLE`/`SKY`/`GRAY`/`AMBER`) |
|
|
173
173
|
| `outline` | `Boolean` | `false` | Outlined/secondary style — transparent fill, coloured text + border, tinted hover (theme-aware) |
|
|
174
174
|
| `ghost` | `Boolean` | `false` | Ghost/borderless style — no border or fill, coloured text + tinted hover (theme-aware). For compact toolbar/action buttons |
|
|
175
175
|
| `to` | `String` | — | Vue Router path (renders `<router-link>`) |
|
|
@@ -1119,6 +1119,7 @@ so icon-less apps get a plain title/subtitle header.
|
|
|
1119
1119
|
| `maxWidthClass` | `String` | `'max-w-4xl'` | Tailwind max-w utility constraining header width. Pass `''` to skip the width wrapper entirely — the header then spans its container. |
|
|
1120
1120
|
| `align` | `String` | `'center'` | Vertical alignment of the title block vs the actions: `'center'` or `'end'` (actions sit on the title baseline). |
|
|
1121
1121
|
| `marginClass` | `String` | `'mb-8'` | Space under the header. Pass `''` when the parent manages vertical rhythm (`space-y-*`). |
|
|
1122
|
+
| `accent` | `Boolean` | `false` | Brand-green gauge bar in front of the title (icon-less headers). |
|
|
1122
1123
|
|
|
1123
1124
|
**Slots:**
|
|
1124
1125
|
|
|
@@ -1522,9 +1523,10 @@ selected one gets the filled treatment and `aria-pressed="true"`.
|
|
|
1522
1523
|
### BaseTable
|
|
1523
1524
|
|
|
1524
1525
|
Styling shell for data tables — **not** a data grid. Owns the table skin
|
|
1525
|
-
(slate header band, `px-4 py-3` header cells,
|
|
1526
|
-
the caller's own `<tr>` markup via the default slot.
|
|
1527
|
-
|
|
1526
|
+
(slate header band, `px-4 py-3` header cells, row dividers + hover, empty-state
|
|
1527
|
+
row); body rows are the caller's own `<tr>` markup via the default slot. Pass
|
|
1528
|
+
`card` for the rounded, bordered, horizontally scrolling card chrome, or wrap
|
|
1529
|
+
it yourself (e.g. a `BaseRow` with `overflow-x-auto`).
|
|
1528
1530
|
|
|
1529
1531
|
**Props:**
|
|
1530
1532
|
|
|
@@ -1533,6 +1535,7 @@ scrolling/card chrome (e.g. a `BaseRow` with `overflow-x-auto`).
|
|
|
1533
1535
|
| `columns` | `TableColumn[]` | **required** | `{ label, align? }`; `align: 'right'` right-aligns the header cell. |
|
|
1534
1536
|
| `empty` | `Boolean` | `false` | True renders the empty-state row spanning every column. |
|
|
1535
1537
|
| `emptyText` | `String` | `'No rows.'` | Fallback empty-state text. |
|
|
1538
|
+
| `card` | `Boolean` | `false` | Wrap in the rounded, bordered, scrolling card. |
|
|
1536
1539
|
|
|
1537
1540
|
**Slots:** `default` — the `<tr>` rows; `empty` — custom empty-state content.
|
|
1538
1541
|
|
|
@@ -1748,6 +1751,146 @@ Extracted from TradeAutomation's variant-stats modal.
|
|
|
1748
1751
|
|
|
1749
1752
|
---
|
|
1750
1753
|
|
|
1754
|
+
### BaseSearchSelect
|
|
1755
|
+
|
|
1756
|
+
Searchable select (combobox): type to filter, pick with the mouse or
|
|
1757
|
+
ArrowUp/ArrowDown + Enter. `multiple` turns it into a tag picker with removable
|
|
1758
|
+
chips (Backspace on an empty search removes the last one). Same field skin as
|
|
1759
|
+
`BaseInput` / `BaseSelect`; Escape and an outside click close the menu.
|
|
1760
|
+
|
|
1761
|
+
**Props:**
|
|
1762
|
+
|
|
1763
|
+
| Prop | Type | Default | Description |
|
|
1764
|
+
| --------------- | ----------------------------- | --------------- | ----------- |
|
|
1765
|
+
| `options` | `DropdownOption[]` | **required** | `{ value, label, title?, disabled? }` per row. |
|
|
1766
|
+
| `modelValue` | `value \| null \| value[]` | `null` | Selected value, or values with `multiple`. |
|
|
1767
|
+
| `multiple` | `Boolean` | `false` | Pick several (chips). |
|
|
1768
|
+
| `placeholder` | `String` | `'Select'` | Shown when nothing is selected. |
|
|
1769
|
+
| `searchable` | `Boolean` | `true` | Typing filters the options. |
|
|
1770
|
+
| `clearable` | `Boolean` | `true` | Show the × clear button while something is selected. |
|
|
1771
|
+
| `block` | `Boolean` | `true` | Full-width. |
|
|
1772
|
+
| `disabled` | `Boolean` | `false` | |
|
|
1773
|
+
| `ariaLabel` | `String` | `''` | Accessible name without a visible label. |
|
|
1774
|
+
| `noResultsText` | `String` | `'No matches.'` | |
|
|
1775
|
+
| `emptyText` | `String` | `'No options.'` | |
|
|
1776
|
+
|
|
1777
|
+
**Emits:** `update:modelValue` — the value (single; `null` when cleared) or the
|
|
1778
|
+
array of values (`multiple`).
|
|
1779
|
+
|
|
1780
|
+
```vue
|
|
1781
|
+
<BaseSearchSelect v-model="userId" :options="users.map(u => ({ value: u.id, label: u.name }))" placeholder="Select User" />
|
|
1782
|
+
<BaseSearchSelect v-model="tags" :options="TAGS" multiple />
|
|
1783
|
+
```
|
|
1784
|
+
|
|
1785
|
+
### BaseCard
|
|
1786
|
+
|
|
1787
|
+
Bordered surface card — the shared chrome for forms, filter/search panels and
|
|
1788
|
+
grouped content.
|
|
1789
|
+
|
|
1790
|
+
**Props:** `title`, `subtitle`, `padding: 'md' | 'sm' | 'none'` (`'md'`).
|
|
1791
|
+
**Slots:** `default` (body), `actions` (header, right), `footer` (bottom, right-aligned — submit/cancel).
|
|
1792
|
+
|
|
1793
|
+
```vue
|
|
1794
|
+
<BaseCard title="Template">
|
|
1795
|
+
<form>…</form>
|
|
1796
|
+
<template #footer><BaseButton type="submit" description="Save" /></template>
|
|
1797
|
+
</BaseCard>
|
|
1798
|
+
```
|
|
1799
|
+
|
|
1800
|
+
### BaseField
|
|
1801
|
+
|
|
1802
|
+
Label + control + message wrapper for forms and filter bars.
|
|
1803
|
+
|
|
1804
|
+
**Props:** `label`, `labelFor` (the control's id), `required`, `error`
|
|
1805
|
+
(red, replaces the hint), `hint`, `compact` (small uppercase filter-bar label),
|
|
1806
|
+
`grow` (takes the free space in a flex row).
|
|
1807
|
+
|
|
1808
|
+
```vue
|
|
1809
|
+
<BaseCard padding="sm">
|
|
1810
|
+
<div class="flex flex-wrap items-end gap-4">
|
|
1811
|
+
<BaseField label="Search symbol" label-for="q" compact grow>
|
|
1812
|
+
<BaseInput id="q" v-model="query" />
|
|
1813
|
+
</BaseField>
|
|
1814
|
+
<BaseField label="Class" compact>
|
|
1815
|
+
<BaseSegmentedControl v-model="cls" :options="CLASSES" />
|
|
1816
|
+
</BaseField>
|
|
1817
|
+
</div>
|
|
1818
|
+
</BaseCard>
|
|
1819
|
+
```
|
|
1820
|
+
|
|
1821
|
+
### BaseStatCard
|
|
1822
|
+
|
|
1823
|
+
Dashboard stat tile in the `EarningsCard` style (dashed accent border, bold
|
|
1824
|
+
title, big value) for any value — counts, labels, pre-formatted numbers.
|
|
1825
|
+
|
|
1826
|
+
**Props:** `title` (required), `value`, `subtitle`,
|
|
1827
|
+
`accent: 'emerald' | 'sky' | 'amber' | 'red' | 'slate'` (`'emerald'`),
|
|
1828
|
+
`to` (router location — makes the whole card a link).
|
|
1829
|
+
**Slots:** `icon` (fills the tinted chip; receives `iconClass`), `default` (extra content).
|
|
1830
|
+
|
|
1831
|
+
```vue
|
|
1832
|
+
<BaseStatCard title="Categories" :value="71" accent="sky" :to="{ name: 'Category List' }">
|
|
1833
|
+
<template #icon="{ iconClass }"><SwatchIcon :class="iconClass" /></template>
|
|
1834
|
+
</BaseStatCard>
|
|
1835
|
+
```
|
|
1836
|
+
|
|
1837
|
+
### BaseToggle
|
|
1838
|
+
|
|
1839
|
+
On/off switch (`role="switch"`). `v-model` is the boolean; `change` fires after
|
|
1840
|
+
every user toggle with the new value.
|
|
1841
|
+
|
|
1842
|
+
**Props:** `modelValue`, `label` (visible label, also the accessible name),
|
|
1843
|
+
`ariaLabel` (when there is no label), `color: 'emerald' | 'red' | 'sky' | 'amber'`
|
|
1844
|
+
(on state, `'emerald'`), `offTone: 'slate' | 'red'` (off track, `'slate'`), `disabled`.
|
|
1845
|
+
**Emits:** `update:modelValue(value)`, `change(value)`.
|
|
1846
|
+
|
|
1847
|
+
```vue
|
|
1848
|
+
<BaseToggle v-model="task.alive" :label="task.name" color="red" @change="save(task)" />
|
|
1849
|
+
<BaseToggle v-model="account.alive" off-tone="red" aria-label="Alive" />
|
|
1850
|
+
```
|
|
1851
|
+
|
|
1852
|
+
### BaseAuthLayout
|
|
1853
|
+
|
|
1854
|
+
Full-page, centred shell for sign-in / sign-up / password-recovery screens:
|
|
1855
|
+
logo on top (defaults to `BaseLogo`), then a bordered card with the title,
|
|
1856
|
+
content and an optional footer.
|
|
1857
|
+
|
|
1858
|
+
**Props:** `title`, `subtitle`, `wide` (max-w-3xl card for multi-column forms; default max-w-md).
|
|
1859
|
+
**Slots:** `default` (form), `logo` (replaces `BaseLogo`), `footer` ("No account? Sign up").
|
|
1860
|
+
|
|
1861
|
+
```vue
|
|
1862
|
+
<BaseAuthLayout title="Forgot password">
|
|
1863
|
+
<form>…</form>
|
|
1864
|
+
<template #footer>No account? <RouterLink to="/register">Sign up</RouterLink></template>
|
|
1865
|
+
</BaseAuthLayout>
|
|
1866
|
+
```
|
|
1867
|
+
|
|
1868
|
+
### BaseBooleanBadge
|
|
1869
|
+
|
|
1870
|
+
Yes/no pill for boolean columns: green check when true, neutral cross when
|
|
1871
|
+
false (so `false` reads as a state, not an error).
|
|
1872
|
+
|
|
1873
|
+
**Props:** `value` (`boolean | null`), `trueLabel` (`'Yes'`), `falseLabel` (`'No'`).
|
|
1874
|
+
|
|
1875
|
+
```vue
|
|
1876
|
+
<BaseBooleanBadge :value="user.hasVerifiedEmail" true-label="Verified" false-label="Not verified" />
|
|
1877
|
+
```
|
|
1878
|
+
|
|
1879
|
+
### BaseDetailList
|
|
1880
|
+
|
|
1881
|
+
Read-only label/value grid for detail pages (the "view" counterpart of a form).
|
|
1882
|
+
Empty values show `emptyText`; `href` renders the value as an external link;
|
|
1883
|
+
`mono` uses the monospace face.
|
|
1884
|
+
|
|
1885
|
+
**Props:** `items: DetailItem[]` (`{ label, value?, href?, mono? }`, required),
|
|
1886
|
+
`columns: 1 | 2 | 3` (`2`, from `sm` up), `emptyText` (`'—'`).
|
|
1887
|
+
|
|
1888
|
+
```vue
|
|
1889
|
+
<BaseCard title="Details">
|
|
1890
|
+
<BaseDetailList :items="[{ label: 'Status', value: post.status }, { label: 'Link', value: post.link, href: post.link }]" />
|
|
1891
|
+
</BaseCard>
|
|
1892
|
+
```
|
|
1893
|
+
|
|
1751
1894
|
## Composables
|
|
1752
1895
|
|
|
1753
1896
|
```ts
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
title?: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
/** max-w-3xl card instead of max-w-md (multi-column forms). */
|
|
5
|
+
wide?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {};
|
|
8
|
+
type __VLS_Slots = {} & {
|
|
9
|
+
logo?: (props: typeof __VLS_1) => any;
|
|
10
|
+
} & {
|
|
11
|
+
default?: (props: typeof __VLS_8) => any;
|
|
12
|
+
} & {
|
|
13
|
+
footer?: (props: typeof __VLS_10) => any;
|
|
14
|
+
};
|
|
15
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
16
|
+
title: string;
|
|
17
|
+
subtitle: string;
|
|
18
|
+
wide: boolean;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
21
|
+
declare const _default: typeof __VLS_export;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
value?: boolean | null;
|
|
3
|
+
trueLabel?: string;
|
|
4
|
+
falseLabel?: string;
|
|
5
|
+
}
|
|
6
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
7
|
+
value: boolean | null;
|
|
8
|
+
trueLabel: string;
|
|
9
|
+
falseLabel: string;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bordered surface card — the shared chrome for forms, filter/search panels
|
|
3
|
+
* and any grouped content. Optional header (title / subtitle / `actions`
|
|
4
|
+
* slot), a padded body (default slot) and an optional `footer` slot for
|
|
5
|
+
* submit / cancel buttons.
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
title?: string;
|
|
9
|
+
subtitle?: string;
|
|
10
|
+
/** Body padding: 'md' (p-5, default), 'sm' (p-4, e.g. filter bars) or 'none'. */
|
|
11
|
+
padding?: 'md' | 'sm' | 'none';
|
|
12
|
+
}
|
|
13
|
+
declare var __VLS_1: {}, __VLS_3: {}, __VLS_5: {};
|
|
14
|
+
type __VLS_Slots = {} & {
|
|
15
|
+
actions?: (props: typeof __VLS_1) => any;
|
|
16
|
+
} & {
|
|
17
|
+
default?: (props: typeof __VLS_3) => any;
|
|
18
|
+
} & {
|
|
19
|
+
footer?: (props: typeof __VLS_5) => any;
|
|
20
|
+
};
|
|
21
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
22
|
+
title: string;
|
|
23
|
+
subtitle: string;
|
|
24
|
+
padding: "md" | "sm" | "none";
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { DetailItem } from '../types/detail';
|
|
2
|
+
interface Props {
|
|
3
|
+
items: readonly DetailItem[];
|
|
4
|
+
/** Columns from `sm` up (1 column on phones). */
|
|
5
|
+
columns?: 1 | 2 | 3;
|
|
6
|
+
emptyText?: string;
|
|
7
|
+
}
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
|
+
emptyText: string;
|
|
10
|
+
columns: 1 | 2 | 3;
|
|
11
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Label + control + message wrapper for forms and filter bars. The control
|
|
3
|
+
* goes in the default slot (BaseInput, BaseSelect, BaseSearchSelect, …).
|
|
4
|
+
* `compact` switches to the small uppercase filter-bar label; `grow` makes
|
|
5
|
+
* the field take the free space in a flex row (filter bars).
|
|
6
|
+
*/
|
|
7
|
+
interface Props {
|
|
8
|
+
label?: string;
|
|
9
|
+
/** id of the control, wired to the label's `for`. */
|
|
10
|
+
labelFor?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
/** Validation message (red); replaces the hint while set. */
|
|
13
|
+
error?: string;
|
|
14
|
+
hint?: string;
|
|
15
|
+
compact?: boolean;
|
|
16
|
+
grow?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare var __VLS_1: {};
|
|
19
|
+
type __VLS_Slots = {} & {
|
|
20
|
+
default?: (props: typeof __VLS_1) => any;
|
|
21
|
+
};
|
|
22
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
23
|
+
compact: boolean;
|
|
24
|
+
label: string;
|
|
25
|
+
required: boolean;
|
|
26
|
+
error: string;
|
|
27
|
+
hint: string;
|
|
28
|
+
labelFor: string;
|
|
29
|
+
grow: boolean;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -6,6 +6,8 @@ type __VLS_Props = {
|
|
|
6
6
|
maxWidthClass?: string;
|
|
7
7
|
align?: 'center' | 'end';
|
|
8
8
|
marginClass?: string;
|
|
9
|
+
/** Brand-green gauge bar in front of the title (icon-less headers). */
|
|
10
|
+
accent?: boolean;
|
|
9
11
|
};
|
|
10
12
|
declare var __VLS_1: {
|
|
11
13
|
iconClass: string;
|
|
@@ -19,6 +21,7 @@ type __VLS_Slots = {} & {
|
|
|
19
21
|
};
|
|
20
22
|
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
21
23
|
subtitle: string;
|
|
24
|
+
accent: boolean;
|
|
22
25
|
maxWidthClass: string;
|
|
23
26
|
iconColor: IconColor;
|
|
24
27
|
align: "center" | "end";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { DropdownOption } from '../types/dropdown';
|
|
2
|
+
type Value = string | number;
|
|
3
|
+
interface Props {
|
|
4
|
+
options: readonly DropdownOption[];
|
|
5
|
+
/** Selected value (single) or values (`multiple`). */
|
|
6
|
+
modelValue?: Value | null | readonly Value[];
|
|
7
|
+
/** Pick several options, shown as removable chips. */
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
/** Allow typing to filter. False makes it a plain (non-typing) picker. */
|
|
11
|
+
searchable?: boolean;
|
|
12
|
+
/** Show the clear (×) button while something is selected. */
|
|
13
|
+
clearable?: boolean;
|
|
14
|
+
/** Full-width (w-full). Set false for an inline field. */
|
|
15
|
+
block?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/** Accessible name when there is no visible label. */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
/** Shown when the search matches nothing. */
|
|
20
|
+
noResultsText?: string;
|
|
21
|
+
/** Shown when there are no options at all. */
|
|
22
|
+
emptyText?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
25
|
+
"update:modelValue": (value: any) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
27
|
+
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
placeholder: string;
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
ariaLabel: string;
|
|
32
|
+
block: boolean;
|
|
33
|
+
emptyText: string;
|
|
34
|
+
multiple: boolean;
|
|
35
|
+
modelValue: Value | null | readonly Value[];
|
|
36
|
+
searchable: boolean;
|
|
37
|
+
clearable: boolean;
|
|
38
|
+
noResultsText: string;
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
type Accent = 'emerald' | 'sky' | 'amber' | 'red' | 'slate';
|
|
3
|
+
interface Props {
|
|
4
|
+
title: string;
|
|
5
|
+
value?: string | number;
|
|
6
|
+
subtitle?: string;
|
|
7
|
+
/** Border / value / subtitle / icon tint. */
|
|
8
|
+
accent?: Accent;
|
|
9
|
+
/** Makes the card a router link. */
|
|
10
|
+
to?: RouteLocationRaw;
|
|
11
|
+
}
|
|
12
|
+
declare var __VLS_8: {}, __VLS_10: {
|
|
13
|
+
iconClass: string;
|
|
14
|
+
};
|
|
15
|
+
type __VLS_Slots = {} & {
|
|
16
|
+
default?: (props: typeof __VLS_8) => any;
|
|
17
|
+
} & {
|
|
18
|
+
icon?: (props: typeof __VLS_10) => any;
|
|
19
|
+
};
|
|
20
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
21
|
+
to: RouteLocationRaw;
|
|
22
|
+
subtitle: string;
|
|
23
|
+
accent: Accent;
|
|
24
|
+
value: string | number;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -5,6 +5,8 @@ interface Props {
|
|
|
5
5
|
empty?: boolean;
|
|
6
6
|
/** Fallback empty-state text; the `empty` slot overrides it. */
|
|
7
7
|
emptyText?: string;
|
|
8
|
+
/** Wrap the table in the rounded, bordered, horizontally scrolling card. */
|
|
9
|
+
card?: boolean;
|
|
8
10
|
}
|
|
9
11
|
declare var __VLS_1: {}, __VLS_3: {};
|
|
10
12
|
type __VLS_Slots = {} & {
|
|
@@ -13,6 +15,7 @@ type __VLS_Slots = {} & {
|
|
|
13
15
|
default?: (props: typeof __VLS_3) => any;
|
|
14
16
|
};
|
|
15
17
|
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
18
|
+
card: boolean;
|
|
16
19
|
emptyText: string;
|
|
17
20
|
empty: boolean;
|
|
18
21
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On/off switch (role="switch"). `v-model` is the boolean; `change` fires
|
|
3
|
+
* after every user toggle with the new value, so callers can persist it.
|
|
4
|
+
* `color` tints the on state; `offTone="red"` shows a red track while off
|
|
5
|
+
* (e.g. "account is down" states).
|
|
6
|
+
*/
|
|
7
|
+
type Color = 'emerald' | 'red' | 'sky' | 'amber';
|
|
8
|
+
interface Props {
|
|
9
|
+
modelValue?: boolean;
|
|
10
|
+
/** Visible label beside the switch (also its accessible name). */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Accessible name when there is no visible label. */
|
|
13
|
+
ariaLabel?: string;
|
|
14
|
+
color?: Color;
|
|
15
|
+
offTone?: 'slate' | 'red';
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
19
|
+
change: (value: boolean) => any;
|
|
20
|
+
"update:modelValue": (value: boolean) => any;
|
|
21
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
22
|
+
onChange?: ((value: boolean) => any) | undefined;
|
|
23
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
color: Color;
|
|
26
|
+
label: string;
|
|
27
|
+
disabled: boolean;
|
|
28
|
+
ariaLabel: string;
|
|
29
|
+
modelValue: boolean;
|
|
30
|
+
offTone: "slate" | "red";
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: typeof __VLS_export;
|
|
33
|
+
export default _default;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,6 +47,15 @@ export { default as BaseBarDistribution } from './components/BaseBarDistribution
|
|
|
47
47
|
export type { CredentialsView, CredentialsUpdate } from './components/BaseCredentialsForm.vue';
|
|
48
48
|
export { default as BaseDateTimePicker } from './components/BaseDateTimePicker.vue';
|
|
49
49
|
export type { DateTimePickerMode } from './components/BaseDateTimePicker.vue';
|
|
50
|
+
export { default as BaseSearchSelect } from './components/BaseSearchSelect.vue';
|
|
51
|
+
export { default as BaseCard } from './components/BaseCard.vue';
|
|
52
|
+
export { default as BaseField } from './components/BaseField.vue';
|
|
53
|
+
export { default as BaseStatCard } from './components/BaseStatCard.vue';
|
|
54
|
+
export { default as BaseToggle } from './components/BaseToggle.vue';
|
|
55
|
+
export { default as BaseAuthLayout } from './components/BaseAuthLayout.vue';
|
|
56
|
+
export { default as BaseBooleanBadge } from './components/BaseBooleanBadge.vue';
|
|
57
|
+
export { default as BaseDetailList } from './components/BaseDetailList.vue';
|
|
58
|
+
export type { DetailItem } from './types/detail';
|
|
50
59
|
export { useTheme, initTheme } from './composables/useTheme';
|
|
51
60
|
export type { UseThemeOptions } from './composables/useTheme';
|
|
52
61
|
export { useThemeClasses } from './composables/useThemeClasses';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One row of a BaseDetailList. `href` renders the value as an external link;
|
|
3
|
+
* `mono` sets it in the monospace face.
|
|
4
|
+
*/
|
|
5
|
+
export interface DetailItem {
|
|
6
|
+
label: string;
|
|
7
|
+
value?: string | number | boolean | null;
|
|
8
|
+
href?: string;
|
|
9
|
+
mono?: boolean;
|
|
10
|
+
}
|