mgv-backoffice 1.47.0 → 1.49.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 +2099 -2072
- package/dist/components/BaseBooleanIcon.vue.d.ts +14 -0
- package/dist/components/BaseDetailList.vue.d.ts +13 -1
- package/dist/components/BasePageHeader.vue.d.ts +1 -1
- package/dist/components/BasePhotoViewer.vue.d.ts +24 -0
- package/dist/components/BaseRating.vue.d.ts +9 -0
- package/dist/components/BaseRowButton.vue.d.ts +18 -0
- package/dist/components/BaseSelect.vue.d.ts +15 -3
- package/dist/components/BaseSidebarUser.vue.d.ts +3 -0
- package/dist/components/BaseStatCard.vue.d.ts +6 -4
- package/dist/components/BaseTextarea.vue.d.ts +12 -0
- package/dist/composables/useRefreshOnReturn.d.ts +7 -0
- package/dist/index.d.ts +8 -1
- package/dist/types/photoViewer.d.ts +6 -0
- package/dist/ui-lib.css +1 -1
- package/dist/ui-lib.js +1050 -851
- package/dist/ui-lib.umd.cjs +1 -1
- package/dist/utils/format.d.ts +9 -0
- package/package.json +1 -1
- package/src/components/BaseBadge.vue +7 -7
- package/src/components/BaseBooleanIcon.vue +22 -0
- package/src/components/BaseDetailList.vue +50 -47
- package/src/components/BaseField.label.test.ts +30 -0
- package/src/components/BaseField.vue +19 -3
- package/src/components/BasePageHeader.test.ts +29 -0
- package/src/components/BasePageHeader.vue +137 -131
- package/src/components/BasePhotoViewer.test.ts +22 -0
- package/src/components/BasePhotoViewer.vue +93 -0
- package/src/components/BaseRating.test.ts +19 -0
- package/src/components/BaseRating.vue +21 -0
- package/src/components/BaseRowButton.vue +24 -0
- package/src/components/BaseSelect.vue +4 -2
- package/src/components/BaseSidebarUser.vue +85 -75
- package/src/components/BaseStatCard.vue +11 -3
- package/src/components/BaseTextarea.test.ts +17 -0
- package/src/components/BaseTextarea.vue +24 -0
- package/src/composables/useRefreshOnReturn.test.ts +47 -0
- package/src/composables/useRefreshOnReturn.ts +24 -0
- package/src/index.ts +10 -0
- package/src/style.css +132 -36
- package/src/types/photoViewer.ts +6 -0
- package/src/utils/format.test.ts +342 -322
- package/src/utils/format.ts +23 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
value?: boolean | null;
|
|
3
|
+
trueLabel?: string;
|
|
4
|
+
falseLabel?: string;
|
|
5
|
+
emptyText?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
|
+
value: boolean | null;
|
|
9
|
+
emptyText: string;
|
|
10
|
+
trueLabel: string;
|
|
11
|
+
falseLabel: string;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
14
|
+
export default _default;
|
|
@@ -5,9 +5,21 @@ interface Props {
|
|
|
5
5
|
columns?: 1 | 2 | 3;
|
|
6
6
|
emptyText?: string;
|
|
7
7
|
}
|
|
8
|
-
declare
|
|
8
|
+
declare var __VLS_1: {
|
|
9
|
+
item: DetailItem;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
value?: (props: typeof __VLS_1) => any;
|
|
13
|
+
};
|
|
14
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
15
|
emptyText: string;
|
|
10
16
|
columns: 1 | 2 | 3;
|
|
11
17
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
19
|
declare const _default: typeof __VLS_export;
|
|
13
20
|
export default _default;
|
|
21
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
22
|
+
new (): {
|
|
23
|
+
$slots: S;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -6,7 +6,7 @@ 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
|
|
9
|
+
/** Brand-green gauge bar in front of the title. Defaults to on when there is no icon. */
|
|
10
10
|
accent?: boolean;
|
|
11
11
|
};
|
|
12
12
|
declare var __VLS_1: {
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ViewerPhoto } from '../types/photoViewer';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
photos: ViewerPhoto[];
|
|
4
|
+
closeLabel?: string;
|
|
5
|
+
previousLabel?: string;
|
|
6
|
+
nextLabel?: string;
|
|
7
|
+
};
|
|
8
|
+
type __VLS_ModelProps = {
|
|
9
|
+
modelValue: number;
|
|
10
|
+
};
|
|
11
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
+
close: () => any;
|
|
14
|
+
"update:modelValue": (value: number) => any;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
18
|
+
}>, {
|
|
19
|
+
closeLabel: string;
|
|
20
|
+
previousLabel: string;
|
|
21
|
+
nextLabel: string;
|
|
22
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
|
+
declare const _default: typeof __VLS_export;
|
|
24
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
rating: number;
|
|
3
|
+
count?: number | null;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
6
|
+
count: number | null;
|
|
7
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
variant?: 'outline' | 'primary' | 'danger';
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_1) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
variant: "outline" | "primary" | "danger";
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface Props {
|
|
2
|
-
modelValue?: string | null;
|
|
2
|
+
modelValue?: string | number | null;
|
|
3
3
|
/** 'sm' = px-2 py-1.5 (default, the usual select height); 'md' = px-3 py-2. */
|
|
4
4
|
size?: 'sm' | 'md';
|
|
5
5
|
/** Full-width (w-full). Set false for inline selects. */
|
|
@@ -7,15 +7,27 @@ interface Props {
|
|
|
7
7
|
/** Render underscores in option text as spaces (BLUE_SKY → BLUE SKY). Values are untouched. */
|
|
8
8
|
humanize?: boolean;
|
|
9
9
|
}
|
|
10
|
-
declare
|
|
10
|
+
declare var __VLS_6: {
|
|
11
|
+
iconClass: string;
|
|
12
|
+
};
|
|
13
|
+
type __VLS_Slots = {} & {
|
|
14
|
+
icon?: (props: typeof __VLS_6) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
11
17
|
"update:modelValue": (value: any) => any;
|
|
12
18
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
13
19
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
14
20
|
}>, {
|
|
15
21
|
size: "sm" | "md";
|
|
16
22
|
block: boolean;
|
|
17
|
-
modelValue: string | null;
|
|
23
|
+
modelValue: string | number | null;
|
|
18
24
|
humanize: boolean;
|
|
19
25
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
26
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
27
|
declare const _default: typeof __VLS_export;
|
|
21
28
|
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -2,6 +2,8 @@ import { RouteLocationRaw } from 'vue-router';
|
|
|
2
2
|
interface Props {
|
|
3
3
|
name: string;
|
|
4
4
|
email?: string;
|
|
5
|
+
/** Photo shown instead of the initials. */
|
|
6
|
+
avatarUrl?: string | null;
|
|
5
7
|
/** Profile route; makes the name/email block a link. */
|
|
6
8
|
to?: RouteLocationRaw;
|
|
7
9
|
showLogout?: boolean;
|
|
@@ -15,6 +17,7 @@ declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {},
|
|
|
15
17
|
}>, {
|
|
16
18
|
email: string;
|
|
17
19
|
to: RouteLocationRaw;
|
|
20
|
+
avatarUrl: string | null;
|
|
18
21
|
showLogout: boolean;
|
|
19
22
|
logoutLabel: string;
|
|
20
23
|
profileLabel: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RouteLocationRaw } from 'vue-router';
|
|
2
|
-
type Accent = 'emerald' | 'sky' | 'amber' | 'red' | 'slate';
|
|
2
|
+
type Accent = 'emerald' | 'sky' | 'amber' | 'violet' | 'red' | 'slate';
|
|
3
3
|
interface Props {
|
|
4
4
|
title: string;
|
|
5
5
|
value?: string | number;
|
|
@@ -9,13 +9,15 @@ interface Props {
|
|
|
9
9
|
/** Makes the card a router link. */
|
|
10
10
|
to?: RouteLocationRaw;
|
|
11
11
|
}
|
|
12
|
-
declare var __VLS_8: {}, __VLS_10: {
|
|
12
|
+
declare var __VLS_8: {}, __VLS_10: {}, __VLS_12: {
|
|
13
13
|
iconClass: string;
|
|
14
14
|
};
|
|
15
15
|
type __VLS_Slots = {} & {
|
|
16
|
-
|
|
16
|
+
value?: (props: typeof __VLS_8) => any;
|
|
17
17
|
} & {
|
|
18
|
-
|
|
18
|
+
default?: (props: typeof __VLS_10) => any;
|
|
19
|
+
} & {
|
|
20
|
+
icon?: (props: typeof __VLS_12) => any;
|
|
19
21
|
};
|
|
20
22
|
declare const __VLS_base: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
21
23
|
to: RouteLocationRaw;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
modelValue?: string | null;
|
|
3
|
+
}
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
5
|
+
"update:modelValue": (value: string) => any;
|
|
6
|
+
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
7
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
8
|
+
}>, {
|
|
9
|
+
modelValue: string | null;
|
|
10
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const _default: typeof __VLS_export;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How long the tab must be hidden before coming back reloads the page's data; quick switches keep it. */
|
|
2
|
+
export declare const REFRESH_AFTER_AWAY_MS = 30000;
|
|
3
|
+
/**
|
|
4
|
+
* Calls `refresh` when the browser tab becomes visible again after `afterMs` or more hidden, since server data
|
|
5
|
+
* changes while the user is elsewhere. The first load is left to the component.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useRefreshOnReturn(refresh: () => unknown, afterMs?: number): void;
|
package/dist/index.d.ts
CHANGED
|
@@ -59,6 +59,13 @@ export { default as BaseSidebarUser } from './components/BaseSidebarUser.vue';
|
|
|
59
59
|
export { default as BaseAuthLayout } from './components/BaseAuthLayout.vue';
|
|
60
60
|
export { default as BaseBooleanBadge } from './components/BaseBooleanBadge.vue';
|
|
61
61
|
export { default as BaseDetailList } from './components/BaseDetailList.vue';
|
|
62
|
+
export { default as BaseTextarea } from './components/BaseTextarea.vue';
|
|
63
|
+
export { default as BaseRating } from './components/BaseRating.vue';
|
|
64
|
+
export { default as BaseRowButton } from './components/BaseRowButton.vue';
|
|
65
|
+
export { default as BaseBooleanIcon } from './components/BaseBooleanIcon.vue';
|
|
66
|
+
export { default as BasePhotoViewer } from './components/BasePhotoViewer.vue';
|
|
67
|
+
export type { ViewerPhoto } from './types/photoViewer';
|
|
68
|
+
export { useRefreshOnReturn, REFRESH_AFTER_AWAY_MS } from './composables/useRefreshOnReturn';
|
|
62
69
|
export type { DetailItem } from './types/detail';
|
|
63
70
|
export { useTheme, initTheme } from './composables/useTheme';
|
|
64
71
|
export type { UseThemeOptions } from './composables/useTheme';
|
|
@@ -107,7 +114,7 @@ export { methodBadgeSolid, methodBadgeBright, methodBadgeTinted, statusBadgeSoli
|
|
|
107
114
|
export { rowKeyMissing, rowValueMissing } from './utils/kvRows';
|
|
108
115
|
export type { KeyValueRowLike } from './utils/kvRows';
|
|
109
116
|
export { sanitizeHtml, isSafeHref } from './utils/sanitizeHtml';
|
|
110
|
-
export { fmtNumber, fmtDate, fmtDateTime, fmtDateTimeMs, fmtDateShort, fmtCalendarDate, fmtCalendarDateTime, fmtMsAsSeconds, fmtBytes, fmtPrice, fmtPct, fmtUsd, fmtMoney, currencySymbol, fmtCurrencyAmount, fmtDuration, formatJson, stringifyValue, } from './utils/format';
|
|
117
|
+
export { fmtNumber, fmtDate, fmtDateTime, fmtDateTimeMs, fmtDateShort, fmtCalendarDate, fmtCalendarDateTime, fmtMsAsSeconds, fmtBytes, fmtPrice, fmtPct, fmtUsd, fmtMoney, currencySymbol, fmtCurrencyAmount, fmtDuration, formatJson, fmtTime, toLocalInput, fromLocalInput, stringifyValue, } from './utils/format';
|
|
111
118
|
export { isValidAbsoluteUrl, isValidJson, isValidXml, isValidBase64, } from './utils/validate';
|
|
112
119
|
export { buildSpecParams, firstInvalidNumericSpec } from './utils/specForm';
|
|
113
120
|
export { humanizeEnum, humanizeTextVNodes } from './utils/humanize';
|