mgv-backoffice 1.36.3 → 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
@@ -1465,6 +1465,38 @@ it.
1465
1465
  />
1466
1466
  ```
1467
1467
 
1468
+ ### BaseDateTimePicker
1469
+
1470
+ Date / date-time / time picker built on
1471
+ [@vuepic/vue-datepicker](https://vue3datepicker.com). The package is a regular
1472
+ dependency of this lib (installed automatically) and its CSS ships inside
1473
+ `ui-lib.css`, so consumers install and import nothing extra. Dark mode follows
1474
+ `useTheme()`; the skin matches BaseInput (slate surfaces, emerald accent).
1475
+
1476
+ **Props:**
1477
+
1478
+ | Prop | Type | Default | Description |
1479
+ | ------------ | ------------------ | ------------ | ----------- |
1480
+ | `modelValue` | `ModelValue` | `null` | `v-model` value — `Date`, `Date[]` for ranges, a time object in `'time'` mode, or a string/number with `model-type`. |
1481
+ | `mode` | `'date' \| 'datetime' \| 'time'` | `'datetime'` | Calendar only, calendar + time, or time only. |
1482
+ | `format` | `String` | per mode | date-fns input pattern. Defaults: `dd/MM/yyyy`, `dd/MM/yyyy HH:mm`, `HH:mm` (`hh:mm a` when `is24` is false). |
1483
+ | `is24` | `Boolean` | `true` | 24-hour clock. |
1484
+ | `autoApply` | `Boolean` | `false` | Select on click, without the Cancel/Select row. |
1485
+ | `teleport` | `Boolean \| String \| HTMLElement` | `true` | Menu mount target; `true` = body, so modals don't clip it. |
1486
+ | `timeConfig` | `Partial<TimeConfig>` | — | Extra time options (seconds, increments…), merged over the defaults. |
1487
+
1488
+ Every other VueDatePicker prop (`range`, `min-date`, `max-date`,
1489
+ `disabled-dates`, `placeholder`, `model-type`, …), event and slot is passed
1490
+ straight through.
1491
+
1492
+ **Emits:** `update:modelValue(value)`.
1493
+
1494
+ ```vue
1495
+ <BaseDateTimePicker v-model="startsAt" placeholder="Start" />
1496
+ <BaseDateTimePicker v-model="day" mode="date" :min-date="new Date()" auto-apply />
1497
+ <BaseDateTimePicker v-model="period" mode="date" range />
1498
+ ```
1499
+
1468
1500
  ### BaseSegmentedControl
1469
1501
 
1470
1502
  Segmented button group ("All | Stock | Crypto"). One button per option; the
@@ -1490,9 +1522,10 @@ selected one gets the filled treatment and `aria-pressed="true"`.
1490
1522
  ### BaseTable
1491
1523
 
1492
1524
  Styling shell for data tables — **not** a data grid. Owns the table skin
1493
- (slate header band, `px-4 py-3` header cells, empty-state row); body rows are
1494
- the caller's own `<tr>` markup via the default slot. Wrap it yourself for
1495
- 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`).
1496
1529
 
1497
1530
  **Props:**
1498
1531
 
@@ -1501,6 +1534,7 @@ scrolling/card chrome (e.g. a `BaseRow` with `overflow-x-auto`).
1501
1534
  | `columns` | `TableColumn[]` | **required** | `{ label, align? }`; `align: 'right'` right-aligns the header cell. |
1502
1535
  | `empty` | `Boolean` | `false` | True renders the empty-state row spanning every column. |
1503
1536
  | `emptyText` | `String` | `'No rows.'` | Fallback empty-state text. |
1537
+ | `card` | `Boolean` | `false` | Wrap in the rounded, bordered, scrolling card. |
1504
1538
 
1505
1539
  **Slots:** `default` — the `<tr>` rows; `empty` — custom empty-state content.
1506
1540
 
@@ -1716,6 +1750,89 @@ Extracted from TradeAutomation's variant-stats modal.
1716
1750
 
1717
1751
  ---
1718
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
+
1719
1836
  ## Composables
1720
1837
 
1721
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,49 @@
1
+ import { ModelValue, TimeConfig } from '@vuepic/vue-datepicker';
2
+ export type DateTimePickerMode = 'date' | 'datetime' | 'time';
3
+ interface Props {
4
+ /** v-model value — Date, Date[] (range), time object, or string with `model-type`. */
5
+ modelValue?: ModelValue;
6
+ /** 'date' = calendar only; 'datetime' = calendar + time (default); 'time' = time only. */
7
+ mode?: DateTimePickerMode;
8
+ /**
9
+ * date-fns pattern for the input text. Defaults per mode:
10
+ * 'dd/MM/yyyy', 'dd/MM/yyyy HH:mm' (12h: 'hh:mm a'), 'HH:mm'.
11
+ */
12
+ format?: string;
13
+ /** 24-hour clock. */
14
+ is24?: boolean;
15
+ /** Select on click without the Cancel/Select action row. */
16
+ autoApply?: boolean;
17
+ /**
18
+ * Where the menu renders. Defaults to `true` (body) so it isn't clipped by
19
+ * modals or overflow-hidden containers.
20
+ */
21
+ teleport?: boolean | string | HTMLElement;
22
+ /** Extra time options, merged over the mode-derived defaults. */
23
+ timeConfig?: Partial<TimeConfig>;
24
+ }
25
+ declare var __VLS_12: string, __VLS_13: any;
26
+ type __VLS_Slots = {} & {
27
+ [K in NonNullable<typeof __VLS_12>]?: (props: typeof __VLS_13) => any;
28
+ };
29
+ declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
30
+ "update:modelValue": (value: ModelValue) => any;
31
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
32
+ "onUpdate:modelValue"?: ((value: ModelValue) => any) | undefined;
33
+ }>, {
34
+ mode: DateTimePickerMode;
35
+ modelValue: string | number | Date | string[] | number[] | Date[] | import('@vuepic/vue-datepicker').TimeModel | import('@vuepic/vue-datepicker').TimeModel[] | import('@vuepic/vue-datepicker').MonthModel | import('@vuepic/vue-datepicker').MonthModel[] | null;
36
+ format: string;
37
+ is24: boolean;
38
+ autoApply: boolean;
39
+ teleport: boolean | string | HTMLElement;
40
+ timeConfig: Partial<TimeConfig>;
41
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
42
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
43
+ declare const _default: typeof __VLS_export;
44
+ export default _default;
45
+ type __VLS_WithSlots<T, S> = T & {
46
+ new (): {
47
+ $slots: S;
48
+ };
49
+ };
@@ -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
@@ -45,6 +45,12 @@ export { default as BaseCredentialsForm } from './components/BaseCredentialsForm
45
45
  export { default as BasePillPickerModal } from './components/BasePillPickerModal.vue';
46
46
  export { default as BaseBarDistribution } from './components/BaseBarDistribution.vue';
47
47
  export type { CredentialsView, CredentialsUpdate } from './components/BaseCredentialsForm.vue';
48
+ export { default as BaseDateTimePicker } from './components/BaseDateTimePicker.vue';
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';
48
54
  export { useTheme, initTheme } from './composables/useTheme';
49
55
  export type { UseThemeOptions } from './composables/useTheme';
50
56
  export { useThemeClasses } from './composables/useThemeClasses';