@m3ui-vue/m3ui-vue 0.6.0 → 0.6.2
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 +13 -1
- package/dist/MIcon-CaEooCmZ.js.map +1 -1
- package/dist/{MMenuItem-DbbrJhFE.js → MMenuItem-C7jKU-Qh.js} +13 -13
- package/dist/{MMenuItem-DbbrJhFE.js.map → MMenuItem-C7jKU-Qh.js.map} +1 -1
- package/dist/barcode.js.map +1 -1
- package/dist/chart.js +1 -1
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +1 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/{common-VrOaLkjh.js → common-0dgrgaPL.js} +287 -213
- package/dist/common-0dgrgaPL.js.map +1 -0
- package/dist/components/MBar.vue.d.ts +58 -0
- package/dist/components/MLightbox.vue.d.ts +53 -0
- package/dist/components/MPageProgress.vue.d.ts +15 -0
- package/dist/components/MSlider.vue.d.ts +6 -0
- package/dist/components/MWindow.vue.d.ts +1 -1
- package/dist/composables/useColorPalette.d.ts +9 -0
- package/dist/composables/usePageProgress.d.ts +19 -0
- package/dist/{dist-Dsrzt6J5.js → dist-CrjSW5DN.js} +248 -241
- package/dist/{dist-Dsrzt6J5.js.map → dist-CrjSW5DN.js.map} +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +3117 -2593
- package/dist/m3ui.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/plugin.d.ts +9 -0
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +1 -1
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/terminal.js.map +1 -1
- package/package.json +26 -26
- package/src/__tests__/MLightbox.test.ts +195 -0
- package/src/__tests__/plugin.test.ts +20 -1
- package/src/__tests__/useColorPalette.test.ts +22 -0
- package/src/__tests__/usePageProgress.test.ts +52 -0
- package/src/components/MBar.vue +158 -0
- package/src/components/MLightbox.vue +405 -0
- package/src/components/MPageProgress.vue +62 -0
- package/src/components/MSlider.vue +174 -52
- package/src/composables/useColorPalette.ts +29 -2
- package/src/composables/usePageProgress.ts +49 -0
- package/src/index.ts +5 -0
- package/src/plugin.ts +16 -4
- package/dist/common-VrOaLkjh.js.map +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
title?: string;
|
|
3
|
+
/** Material Symbol name, or an image src (URL, data URI, or a path with a file extension) — detected automatically. */
|
|
4
|
+
icon?: string;
|
|
5
|
+
titleAlign?: 'start' | 'center';
|
|
6
|
+
/** Show the minimize/maximize/close buttons as a group. Defaults to `true`, except on `platform="macos"` where the OS draws native traffic lights instead. */
|
|
7
|
+
controls?: boolean;
|
|
8
|
+
/** Individually hide one control while keeping the others — e.g. a fixed-size window with no maximize button. */
|
|
9
|
+
minimizable?: boolean;
|
|
10
|
+
maximizable?: boolean;
|
|
11
|
+
closable?: boolean;
|
|
12
|
+
/** Reflects the real window state — the bar has no way to know it itself, the host app must read it from its Electron main process and pass it down. */
|
|
13
|
+
maximized?: boolean;
|
|
14
|
+
platform?: 'windows' | 'macos';
|
|
15
|
+
/** Bar height in px. */
|
|
16
|
+
height?: number;
|
|
17
|
+
/** Double-clicking empty drag space toggles maximize, matching native title bar behavior. */
|
|
18
|
+
doubleClickMaximize?: boolean;
|
|
19
|
+
};
|
|
20
|
+
declare var __VLS_1: {}, __VLS_8: {}, __VLS_10: {}, __VLS_12: {}, __VLS_14: {};
|
|
21
|
+
type __VLS_Slots = {} & {
|
|
22
|
+
icon?: (props: typeof __VLS_1) => any;
|
|
23
|
+
} & {
|
|
24
|
+
title?: (props: typeof __VLS_8) => any;
|
|
25
|
+
} & {
|
|
26
|
+
title?: (props: typeof __VLS_10) => any;
|
|
27
|
+
} & {
|
|
28
|
+
default?: (props: typeof __VLS_12) => any;
|
|
29
|
+
} & {
|
|
30
|
+
trailing?: (props: typeof __VLS_14) => any;
|
|
31
|
+
};
|
|
32
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
33
|
+
close: () => any;
|
|
34
|
+
minimize: () => any;
|
|
35
|
+
maximize: () => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
37
|
+
onClose?: (() => any) | undefined;
|
|
38
|
+
onMinimize?: (() => any) | undefined;
|
|
39
|
+
onMaximize?: (() => any) | undefined;
|
|
40
|
+
}>, {
|
|
41
|
+
height: number;
|
|
42
|
+
closable: boolean;
|
|
43
|
+
titleAlign: "start" | "center";
|
|
44
|
+
controls: boolean;
|
|
45
|
+
minimizable: boolean;
|
|
46
|
+
maximizable: boolean;
|
|
47
|
+
maximized: boolean;
|
|
48
|
+
platform: "windows" | "macos";
|
|
49
|
+
doubleClickMaximize: boolean;
|
|
50
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
51
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
52
|
+
declare const _default: typeof __VLS_export;
|
|
53
|
+
export default _default;
|
|
54
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
55
|
+
new (): {
|
|
56
|
+
$slots: S;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface LightboxItem {
|
|
2
|
+
src: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
caption?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
modelValue?: boolean;
|
|
8
|
+
/** Explicit gallery. Omit it to auto-detect `<img>` elements rendered in the default slot instead. */
|
|
9
|
+
items?: LightboxItem[];
|
|
10
|
+
index?: number;
|
|
11
|
+
loop?: boolean;
|
|
12
|
+
closeLabel?: string;
|
|
13
|
+
/** Show a row of clickable thumbnails at the bottom for jumping directly to an image. */
|
|
14
|
+
showThumbnails?: boolean;
|
|
15
|
+
/** Round the corners of the main opened image (the thumbnail strip keeps its own fixed rounding). */
|
|
16
|
+
rounded?: boolean;
|
|
17
|
+
};
|
|
18
|
+
declare function open(i?: number, sourceEl?: HTMLElement): void;
|
|
19
|
+
declare function close(): void;
|
|
20
|
+
declare function next(): void;
|
|
21
|
+
declare function prev(): void;
|
|
22
|
+
declare var __VLS_1: {};
|
|
23
|
+
type __VLS_Slots = {} & {
|
|
24
|
+
default?: (props: typeof __VLS_1) => any;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {
|
|
27
|
+
open: typeof open;
|
|
28
|
+
close: typeof close;
|
|
29
|
+
next: typeof next;
|
|
30
|
+
prev: typeof prev;
|
|
31
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
32
|
+
"update:modelValue": (args_0: boolean) => any;
|
|
33
|
+
change: (index: number) => any;
|
|
34
|
+
"update:index": (args_0: number) => any;
|
|
35
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
36
|
+
"onUpdate:modelValue"?: ((args_0: boolean) => any) | undefined;
|
|
37
|
+
onChange?: ((index: number) => any) | undefined;
|
|
38
|
+
"onUpdate:index"?: ((args_0: number) => any) | undefined;
|
|
39
|
+
}>, {
|
|
40
|
+
modelValue: boolean;
|
|
41
|
+
rounded: boolean;
|
|
42
|
+
index: number;
|
|
43
|
+
loop: boolean;
|
|
44
|
+
showThumbnails: boolean;
|
|
45
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
46
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
47
|
+
declare const _default: typeof __VLS_export;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
50
|
+
new (): {
|
|
51
|
+
$slots: S;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
color?: "primary" | "secondary" | "tertiary" | "error";
|
|
3
|
+
thickness?: number;
|
|
4
|
+
/** Auto-wire to vue-router's navigation guards when a router is detected. Set to `false` to drive it entirely by hand via `usePageProgress()`. */
|
|
5
|
+
auto?: boolean;
|
|
6
|
+
position?: "top" | "bottom";
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
9
|
+
color: "primary" | "secondary" | "tertiary" | "error";
|
|
10
|
+
auto: boolean;
|
|
11
|
+
position: "top" | "bottom";
|
|
12
|
+
thickness: number;
|
|
13
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
14
|
+
declare const _default: typeof __VLS_export;
|
|
15
|
+
export default _default;
|
|
@@ -13,6 +13,12 @@ type __VLS_Props = {
|
|
|
13
13
|
stops?: boolean;
|
|
14
14
|
icon?: string;
|
|
15
15
|
color?: 'primary' | 'secondary' | 'tertiary' | 'error';
|
|
16
|
+
/** Custom color (hex, rgb(), a CSS var, etc.) for the filled/active portion of the track and the corner dot. Defaults to `color`'s M3 token. */
|
|
17
|
+
fillColor?: string;
|
|
18
|
+
/** Replaces the draggable bar thumb with an icon. */
|
|
19
|
+
thumbIcon?: string;
|
|
20
|
+
/** Custom color (hex, rgb(), a CSS var, etc.) for the thumb (bar or icon). Defaults to `color`'s M3 token. */
|
|
21
|
+
thumbColor?: string;
|
|
16
22
|
};
|
|
17
23
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
18
24
|
"update:modelValue": (args_0: number | [number, number]) => any;
|
|
@@ -39,10 +39,10 @@ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {},
|
|
|
39
39
|
closable: boolean;
|
|
40
40
|
y: number;
|
|
41
41
|
x: number;
|
|
42
|
+
minimizable: boolean;
|
|
42
43
|
minWidth: number;
|
|
43
44
|
draggable: boolean;
|
|
44
45
|
resizable: boolean;
|
|
45
|
-
minimizable: boolean;
|
|
46
46
|
resetPosition: boolean;
|
|
47
47
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
48
48
|
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
@@ -8,4 +8,13 @@ export declare function useColorPalette(): {
|
|
|
8
8
|
palette: import("vue").Ref<string, string>;
|
|
9
9
|
palettes: Palette[];
|
|
10
10
|
set: (id: string) => void;
|
|
11
|
+
persistPalette: import("vue").Ref<boolean, boolean>;
|
|
12
|
+
setPersistPalette: (enabled: boolean) => void;
|
|
11
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Internal: used by `createM3UI({ palette, persistPalette: false })` to force a palette on boot,
|
|
16
|
+
* bypassing whatever is already in localStorage, without waiting for a component to call
|
|
17
|
+
* `useColorPalette()` (which is what actually reacts to `current` via the watchEffect above).
|
|
18
|
+
* Not exported from the package's public entry points.
|
|
19
|
+
*/
|
|
20
|
+
export declare function __forcePalette(id: string, persist: boolean): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Starts (or restarts) the bar and trickles it toward 90% while the real work finishes. */
|
|
2
|
+
declare function start(): void;
|
|
3
|
+
/** Sets an explicit percentage, for callers that know real progress (e.g. an upload). */
|
|
4
|
+
declare function set(pct: number): void;
|
|
5
|
+
/** Completes the bar and fades it out. */
|
|
6
|
+
declare function done(): void;
|
|
7
|
+
/**
|
|
8
|
+
* Shared page-loading progress state (e.g. for a top progress bar between route
|
|
9
|
+
* navigations). Module-level so any number of callers/components stay in sync —
|
|
10
|
+
* call `start()`/`done()` from a router guard, a fetch wrapper, or by hand.
|
|
11
|
+
*/
|
|
12
|
+
export declare function usePageProgress(): {
|
|
13
|
+
progress: import("vue").Ref<number, number>;
|
|
14
|
+
isActive: import("vue").Ref<boolean, boolean>;
|
|
15
|
+
start: typeof start;
|
|
16
|
+
set: typeof set;
|
|
17
|
+
done: typeof done;
|
|
18
|
+
};
|
|
19
|
+
export {};
|