mgv-backoffice 1.37.0 → 1.38.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 CHANGED
@@ -1522,9 +1522,10 @@ selected one gets the filled treatment and `aria-pressed="true"`.
1522
1522
  ### BaseTable
1523
1523
 
1524
1524
  Styling shell for data tables — **not** a data grid. Owns the table skin
1525
- (slate header band, `px-4 py-3` header cells, empty-state row); body rows are
1526
- the caller's own `<tr>` markup via the default slot. Wrap it yourself for
1527
- scrolling/card chrome (e.g. a `BaseRow` with `overflow-x-auto`).
1525
+ (slate header band, `px-4 py-3` header cells, row dividers + hover, empty-state
1526
+ row); body rows are the caller's own `<tr>` markup via the default slot. Pass
1527
+ `card` for the rounded, bordered, horizontally scrolling card chrome, or wrap
1528
+ it yourself (e.g. a `BaseRow` with `overflow-x-auto`).
1528
1529
 
1529
1530
  **Props:**
1530
1531
 
@@ -1533,6 +1534,7 @@ scrolling/card chrome (e.g. a `BaseRow` with `overflow-x-auto`).
1533
1534
  | `columns` | `TableColumn[]` | **required** | `{ label, align? }`; `align: 'right'` right-aligns the header cell. |
1534
1535
  | `empty` | `Boolean` | `false` | True renders the empty-state row spanning every column. |
1535
1536
  | `emptyText` | `String` | `'No rows.'` | Fallback empty-state text. |
1537
+ | `card` | `Boolean` | `false` | Wrap in the rounded, bordered, scrolling card. |
1536
1538
 
1537
1539
  **Slots:** `default` — the `<tr>` rows; `empty` — custom empty-state content.
1538
1540
 
@@ -1748,6 +1750,89 @@ Extracted from TradeAutomation's variant-stats modal.
1748
1750
 
1749
1751
  ---
1750
1752
 
1753
+ ### BaseSearchSelect
1754
+
1755
+ Searchable select (combobox): type to filter, pick with the mouse or
1756
+ ArrowUp/ArrowDown + Enter. `multiple` turns it into a tag picker with removable
1757
+ chips (Backspace on an empty search removes the last one). Same field skin as
1758
+ `BaseInput` / `BaseSelect`; Escape and an outside click close the menu.
1759
+
1760
+ **Props:**
1761
+
1762
+ | Prop | Type | Default | Description |
1763
+ | --------------- | ----------------------------- | --------------- | ----------- |
1764
+ | `options` | `DropdownOption[]` | **required** | `{ value, label, title?, disabled? }` per row. |
1765
+ | `modelValue` | `value \| null \| value[]` | `null` | Selected value, or values with `multiple`. |
1766
+ | `multiple` | `Boolean` | `false` | Pick several (chips). |
1767
+ | `placeholder` | `String` | `'Select'` | Shown when nothing is selected. |
1768
+ | `searchable` | `Boolean` | `true` | Typing filters the options. |
1769
+ | `clearable` | `Boolean` | `true` | Show the × clear button while something is selected. |
1770
+ | `block` | `Boolean` | `true` | Full-width. |
1771
+ | `disabled` | `Boolean` | `false` | |
1772
+ | `ariaLabel` | `String` | `''` | Accessible name without a visible label. |
1773
+ | `noResultsText` | `String` | `'No matches.'` | |
1774
+ | `emptyText` | `String` | `'No options.'` | |
1775
+
1776
+ **Emits:** `update:modelValue` — the value (single; `null` when cleared) or the
1777
+ array of values (`multiple`).
1778
+
1779
+ ```vue
1780
+ <BaseSearchSelect v-model="userId" :options="users.map(u => ({ value: u.id, label: u.name }))" placeholder="Select User" />
1781
+ <BaseSearchSelect v-model="tags" :options="TAGS" multiple />
1782
+ ```
1783
+
1784
+ ### BaseCard
1785
+
1786
+ Bordered surface card — the shared chrome for forms, filter/search panels and
1787
+ grouped content.
1788
+
1789
+ **Props:** `title`, `subtitle`, `padding: 'md' | 'sm' | 'none'` (`'md'`).
1790
+ **Slots:** `default` (body), `actions` (header, right), `footer` (bottom, right-aligned — submit/cancel).
1791
+
1792
+ ```vue
1793
+ <BaseCard title="Template">
1794
+ <form>…</form>
1795
+ <template #footer><BaseButton type="submit" description="Save" /></template>
1796
+ </BaseCard>
1797
+ ```
1798
+
1799
+ ### BaseField
1800
+
1801
+ Label + control + message wrapper for forms and filter bars.
1802
+
1803
+ **Props:** `label`, `labelFor` (the control's id), `required`, `error`
1804
+ (red, replaces the hint), `hint`, `compact` (small uppercase filter-bar label),
1805
+ `grow` (takes the free space in a flex row).
1806
+
1807
+ ```vue
1808
+ <BaseCard padding="sm">
1809
+ <div class="flex flex-wrap items-end gap-4">
1810
+ <BaseField label="Search symbol" label-for="q" compact grow>
1811
+ <BaseInput id="q" v-model="query" />
1812
+ </BaseField>
1813
+ <BaseField label="Class" compact>
1814
+ <BaseSegmentedControl v-model="cls" :options="CLASSES" />
1815
+ </BaseField>
1816
+ </div>
1817
+ </BaseCard>
1818
+ ```
1819
+
1820
+ ### BaseStatCard
1821
+
1822
+ Dashboard stat tile in the `EarningsCard` style (dashed accent border, bold
1823
+ title, big value) for any value — counts, labels, pre-formatted numbers.
1824
+
1825
+ **Props:** `title` (required), `value`, `subtitle`,
1826
+ `accent: 'emerald' | 'sky' | 'amber' | 'red' | 'slate'` (`'emerald'`),
1827
+ `to` (router location — makes the whole card a link).
1828
+ **Slots:** `icon` (fills the tinted chip; receives `iconClass`), `default` (extra content).
1829
+
1830
+ ```vue
1831
+ <BaseStatCard title="Categories" :value="71" accent="sky" :to="{ name: 'Category List' }">
1832
+ <template #icon="{ iconClass }"><SwatchIcon :class="iconClass" /></template>
1833
+ </BaseStatCard>
1834
+ ```
1835
+
1751
1836
  ## Composables
1752
1837
 
1753
1838
  ```ts
@@ -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,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
+ };
@@ -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>;
package/dist/index.d.ts CHANGED
@@ -47,6 +47,10 @@ 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';
50
54
  export { useTheme, initTheme } from './composables/useTheme';
51
55
  export type { UseThemeOptions } from './composables/useTheme';
52
56
  export { useThemeClasses } from './composables/useThemeClasses';