@bluerobotics/bluevue 0.1.1 → 0.2.1
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 +97 -18
- package/bin/create-blueos-extension.mjs +72 -0
- package/dist/bluevue.js +2464 -778
- package/dist/components/BlueApp.vue.d.ts +50 -0
- package/dist/components/BlueBanner.vue.d.ts +49 -0
- package/dist/components/BlueBannerGroup.vue.d.ts +20 -0
- package/dist/components/BlueButton.vue.d.ts +59 -0
- package/dist/components/BlueCard.vue.d.ts +45 -0
- package/dist/components/BlueCheckbox.vue.d.ts +34 -0
- package/dist/components/BlueChip.vue.d.ts +47 -0
- package/dist/components/BlueConfirmDialog.vue.d.ts +193 -0
- package/dist/components/BlueDialog.vue.d.ts +60 -0
- package/dist/components/BlueFileDrop.vue.d.ts +32 -0
- package/dist/components/BlueIcon.vue.d.ts +26 -0
- package/dist/components/BlueInput.vue.d.ts +1 -0
- package/dist/components/BlueProgressBar.vue.d.ts +28 -0
- package/dist/components/BlueRadioGroup.vue.d.ts +40 -0
- package/dist/components/BlueSection.vue.d.ts +36 -0
- package/dist/components/BlueSnackbar.vue.d.ts +19 -0
- package/dist/components/BlueSpinner.vue.d.ts +25 -0
- package/dist/components/BlueStat.vue.d.ts +21 -0
- package/dist/components/BlueStepsDialog.vue.d.ts +62 -0
- package/dist/components/BlueTable.vue.d.ts +62 -0
- package/dist/components/BlueTabs.vue.d.ts +37 -0
- package/dist/components/BlueTextarea.vue.d.ts +40 -0
- package/dist/components/BlueTooltip.vue.d.ts +44 -0
- package/dist/components/BlueWindRose.vue.d.ts +37 -0
- package/dist/composables/useBlueLoading.d.ts +22 -0
- package/dist/composables/useBlueOs.d.ts +39 -0
- package/dist/composables/useBlueSnackbar.d.ts +30 -0
- package/dist/index.d.ts +30 -0
- package/dist/services/blueos.d.ts +37 -0
- package/dist/style.css +1 -1
- package/dist/types/banner.d.ts +16 -0
- package/dist/utils/files.d.ts +13 -0
- package/dist/utils/theme.d.ts +22 -0
- package/package.json +8 -2
- package/src/components/BlueApp.vue +84 -0
- package/src/components/BlueBanner.vue +196 -0
- package/src/components/BlueBannerGroup.vue +47 -0
- package/src/components/BlueButton.vue +134 -0
- package/src/components/BlueButtonGroup.vue +28 -26
- package/src/components/BlueCard.vue +62 -0
- package/src/components/BlueCheckbox.vue +100 -0
- package/src/components/BlueChip.vue +77 -0
- package/src/components/BlueConfirmDialog.vue +73 -0
- package/src/components/BlueDialog.vue +135 -0
- package/src/components/BlueFileDrop.vue +94 -0
- package/src/components/BlueIcon.vue +37 -0
- package/src/components/BlueInput.vue +23 -13
- package/src/components/BlueLoadingDialog.vue +22 -53
- package/src/components/BlueProgressBar.vue +46 -0
- package/src/components/BluePromptDialog.vue +51 -99
- package/src/components/BlueRadioGroup.vue +104 -0
- package/src/components/BlueSection.vue +33 -0
- package/src/components/BlueSelect.vue +13 -11
- package/src/components/BlueSlider.vue +1 -3
- package/src/components/BlueSnackbar.vue +79 -0
- package/src/components/BlueSpinner.vue +37 -0
- package/src/components/BlueStat.vue +26 -0
- package/src/components/BlueStepsDialog.vue +180 -0
- package/src/components/BlueSwitch.vue +18 -15
- package/src/components/BlueTable.vue +154 -0
- package/src/components/BlueTabs.vue +77 -0
- package/src/components/BlueTextarea.vue +102 -0
- package/src/components/BlueTooltip.vue +88 -0
- package/src/components/BlueWindRose.vue +269 -0
- package/src/composables/useBlueLoading.ts +38 -0
- package/src/composables/useBlueOs.ts +154 -0
- package/src/composables/useBlueSnackbar.ts +89 -0
- package/src/index.ts +40 -0
- package/src/services/blueos.ts +95 -0
- package/src/styles/bluevue.css +144 -0
- package/src/types/banner.ts +17 -0
- package/src/utils/files.ts +44 -0
- package/src/utils/theme.ts +37 -0
- package/templates/extension/.github/workflows/deploy.yml +23 -0
- package/templates/extension/Dockerfile +56 -0
- package/templates/extension/README.md +35 -0
- package/templates/extension/backend/main.py +45 -0
- package/templates/extension/backend/requirements.txt +2 -0
- package/templates/extension/frontend/.eslintrc.cjs +20 -0
- package/templates/extension/frontend/env.d.ts +7 -0
- package/templates/extension/frontend/index.html +12 -0
- package/templates/extension/frontend/package.json +30 -0
- package/templates/extension/frontend/src/App.vue +51 -0
- package/templates/extension/frontend/src/main.ts +8 -0
- package/templates/extension/frontend/src/styles/global.css +11 -0
- package/templates/extension/frontend/tsconfig.json +25 -0
- package/templates/extension/frontend/tsconfig.node.json +11 -0
- package/templates/extension/frontend/vite.config.ts +24 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/** One of the choices in the group. */
|
|
2
|
+
export interface BlueRadioItem {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string | number;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
/** Why the choice is what it sounds like, or why it is out of reach. */
|
|
7
|
+
hint?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* One choice out of a few, each spelled out. Where a BlueButtonGroup packs the options into a
|
|
11
|
+
* track, this gives every one of them a line of its own, which is what a choice needing an
|
|
12
|
+
* explanation apiece wants.
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
modelValue: string | number | null;
|
|
16
|
+
items: BlueRadioItem[];
|
|
17
|
+
/** Name of the group, which is what makes the choices exclusive. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** Label above the choices. */
|
|
20
|
+
label?: string;
|
|
21
|
+
/** Lays the choices out along a row instead of down a column. */
|
|
22
|
+
inline?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
theme?: 'light' | 'dark';
|
|
25
|
+
};
|
|
26
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (value: string | number) => void;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
29
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
30
|
+
}, {}, {}>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A subject inside a panel: a quiet heading over a stack of rows. Smaller than a
|
|
3
|
+
* BlueExpansiblePanel, which is a section of the page rather than a part of one, and not foldable.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
title: string;
|
|
7
|
+
/** Space between the rows, in pixels (default 12). */
|
|
8
|
+
gap?: number;
|
|
9
|
+
};
|
|
10
|
+
declare function __VLS_template(): {
|
|
11
|
+
attrs: Partial<{}>;
|
|
12
|
+
slots: {
|
|
13
|
+
notes?(_: {}): any;
|
|
14
|
+
default?(_: {}): any;
|
|
15
|
+
};
|
|
16
|
+
refs: {};
|
|
17
|
+
rootEl: HTMLElement;
|
|
18
|
+
};
|
|
19
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
21
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
24
|
+
type __VLS_TypePropsToOption<T> = {
|
|
25
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
26
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
27
|
+
} : {
|
|
28
|
+
type: import('vue').PropType<T[K]>;
|
|
29
|
+
required: true;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Puts the application's notices on screen, newest nearest the edge. Mount it once, at the root;
|
|
3
|
+
* BlueApp already does. Raising a notice is useBlueSnackbar's job, from wherever it happened.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
/** Which corner they gather in (default 'bottom-right'). */
|
|
7
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToOption<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A turning ring, for a wait with no measure to it. A wait that does have one belongs in a
|
|
3
|
+
* BlueProgressBar, and one that blocks the whole page in a BlueLoadingDialog.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
/** Diameter, in pixels when given as a number (default 20). */
|
|
7
|
+
size?: number | string;
|
|
8
|
+
/** The colour of the arc that turns (default the accent token). */
|
|
9
|
+
color?: string;
|
|
10
|
+
/** Ring thickness in pixels (default 2). */
|
|
11
|
+
width?: number;
|
|
12
|
+
/** What is being waited for, read out by assistive technology. */
|
|
13
|
+
label?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
16
|
+
export default _default;
|
|
17
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
18
|
+
type __VLS_TypePropsToOption<T> = {
|
|
19
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
20
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
21
|
+
} : {
|
|
22
|
+
type: import('vue').PropType<T[K]>;
|
|
23
|
+
required: true;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One read-only fact about the vehicle: a quiet label over its value. Meant to sit in a row of
|
|
3
|
+
* them, each taking an equal share of the width and wrapping to the next line when there is none.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
label: string;
|
|
7
|
+
value?: string | number | null;
|
|
8
|
+
/** What to show when there is no value yet (default an em dash). */
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
12
|
+
export default _default;
|
|
13
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
|
+
type __VLS_TypePropsToOption<T> = {
|
|
15
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
16
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
17
|
+
} : {
|
|
18
|
+
type: import('vue').PropType<T[K]>;
|
|
19
|
+
required: true;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** One stage of the work, in the order it runs. */
|
|
2
|
+
export interface BlueStep {
|
|
3
|
+
key: string;
|
|
4
|
+
title: string;
|
|
5
|
+
state: 'pending' | 'running' | 'done' | 'failed' | 'skipped';
|
|
6
|
+
/** What the step is doing, or why it failed. */
|
|
7
|
+
detail?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Reports on work with stages to it: installing firmware, writing parameters, restarting. The
|
|
11
|
+
* dialog holds the page while the work is running and lets go the moment it is not, so a run that
|
|
12
|
+
* ends in a failure can be read, retried or skipped from the footer.
|
|
13
|
+
*/
|
|
14
|
+
type __VLS_Props = {
|
|
15
|
+
modelValue: boolean;
|
|
16
|
+
title: string;
|
|
17
|
+
/** What the current stage is doing, under the title. */
|
|
18
|
+
subtitle?: string;
|
|
19
|
+
/** Running holds the page; the other two release it. */
|
|
20
|
+
state: 'running' | 'failed' | 'done';
|
|
21
|
+
steps: BlueStep[];
|
|
22
|
+
/** The line above the bar, naming what is being worked through. */
|
|
23
|
+
progressLabel?: string;
|
|
24
|
+
/** Percentage of the current stage, when the stage can count itself. */
|
|
25
|
+
progress?: number;
|
|
26
|
+
/** For a stage that can only say it is waiting, such as a restart. */
|
|
27
|
+
indeterminate?: boolean;
|
|
28
|
+
};
|
|
29
|
+
declare function __VLS_template(): {
|
|
30
|
+
attrs: Partial<{}>;
|
|
31
|
+
slots: {
|
|
32
|
+
badges?(_: {}): any;
|
|
33
|
+
log?(_: {}): any;
|
|
34
|
+
footer?(_: {}): any;
|
|
35
|
+
};
|
|
36
|
+
refs: {
|
|
37
|
+
logRef: HTMLDivElement;
|
|
38
|
+
};
|
|
39
|
+
rootEl: any;
|
|
40
|
+
};
|
|
41
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
42
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
"update:modelValue": (value: boolean) => void;
|
|
44
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
45
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
46
|
+
}, {}, {}>;
|
|
47
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
50
|
+
type __VLS_TypePropsToOption<T> = {
|
|
51
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
52
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
53
|
+
} : {
|
|
54
|
+
type: import('vue').PropType<T[K]>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** One column of the table. */
|
|
2
|
+
export interface BlueColumn {
|
|
3
|
+
/** The field it reads from each row, and the name of its cell slot. */
|
|
4
|
+
key: string;
|
|
5
|
+
title: string;
|
|
6
|
+
width?: string;
|
|
7
|
+
align?: 'start' | 'center' | 'end';
|
|
8
|
+
/** Lets the header be pressed to order the rows by this column. */
|
|
9
|
+
sortable?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Rows of records under a header that stays put while they scroll. Sorting is its own, so a
|
|
13
|
+
* consumer hands it a list and gets an ordered table without keeping the order itself.
|
|
14
|
+
*/
|
|
15
|
+
type __VLS_Props = {
|
|
16
|
+
columns: BlueColumn[];
|
|
17
|
+
rows: Record<string, unknown>[];
|
|
18
|
+
/** The field that identifies a row. Falls back to the row's place in the list. */
|
|
19
|
+
rowKey?: string;
|
|
20
|
+
/** Column to order by before anyone presses a header. */
|
|
21
|
+
sortBy?: string;
|
|
22
|
+
/** How tall the body may get before it scrolls under its header. */
|
|
23
|
+
maxHeight?: string;
|
|
24
|
+
/** Tighter rows, for a table of many short ones. */
|
|
25
|
+
dense?: boolean;
|
|
26
|
+
/** What to say instead of an empty body. */
|
|
27
|
+
emptyText?: string;
|
|
28
|
+
theme?: 'light' | 'dark';
|
|
29
|
+
};
|
|
30
|
+
declare function __VLS_template(): {
|
|
31
|
+
attrs: Partial<{}>;
|
|
32
|
+
slots: Partial<Record<`cell-${string}`, (_: {
|
|
33
|
+
row: Record<string, unknown>;
|
|
34
|
+
value: unknown;
|
|
35
|
+
}) => any>> & {
|
|
36
|
+
empty?(_: {}): any;
|
|
37
|
+
};
|
|
38
|
+
refs: {};
|
|
39
|
+
rootEl: HTMLDivElement;
|
|
40
|
+
};
|
|
41
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
42
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
"row-click": (row: Record<string, unknown>) => void;
|
|
44
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
45
|
+
"onRow-click"?: ((row: Record<string, unknown>) => any) | undefined;
|
|
46
|
+
}, {}, {}>;
|
|
47
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
48
|
+
export default _default;
|
|
49
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
50
|
+
type __VLS_TypePropsToOption<T> = {
|
|
51
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
52
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
53
|
+
} : {
|
|
54
|
+
type: import('vue').PropType<T[K]>;
|
|
55
|
+
required: true;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
59
|
+
new (): {
|
|
60
|
+
$slots: S;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** One tab in the strip. */
|
|
2
|
+
export interface BlueTab {
|
|
3
|
+
/** What comes back through v-model when it is chosen. */
|
|
4
|
+
value: string | number;
|
|
5
|
+
label: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** A count beside the label, such as how many things the tab holds. */
|
|
9
|
+
badge?: string | number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* The strip that switches between the pages of a view. It reports which tab is current and
|
|
13
|
+
* nothing else: what each one shows is the consumer's, since a tab that renders its page only
|
|
14
|
+
* when it is current is what keeps the ones behind it from doing work.
|
|
15
|
+
*/
|
|
16
|
+
type __VLS_Props = {
|
|
17
|
+
modelValue: string | number;
|
|
18
|
+
tabs: BlueTab[];
|
|
19
|
+
/** Fills the width it is given, each tab taking an equal share. */
|
|
20
|
+
stretch?: boolean;
|
|
21
|
+
theme?: 'light' | 'dark';
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: string | number) => void;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
26
|
+
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToOption<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A BlueInput with room for several lines: the same well cut into the panel, for a note, a
|
|
3
|
+
* description, or a block of parameters pasted in.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
modelValue: string | null;
|
|
7
|
+
/** Label above the field, since a multi-line field beside its label leaves the label floating. */
|
|
8
|
+
label?: string;
|
|
9
|
+
/** Name and id, tying the label to the field. */
|
|
10
|
+
name?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
/** Lines of room it starts with (default 4). */
|
|
13
|
+
rows?: number;
|
|
14
|
+
/** Grows with its content instead of scrolling, up to maxRows. */
|
|
15
|
+
autoGrow?: boolean;
|
|
16
|
+
/** How far autoGrow goes before the field starts scrolling (default 12). */
|
|
17
|
+
maxRows?: number;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
/** Validation messages, which also outline the field. */
|
|
20
|
+
errorMessages?: string[];
|
|
21
|
+
/** A hint behind an info icon beside the label. */
|
|
22
|
+
infoTooltip?: string;
|
|
23
|
+
width?: string;
|
|
24
|
+
theme?: 'light' | 'dark';
|
|
25
|
+
};
|
|
26
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
27
|
+
"update:modelValue": (value: string) => void;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
29
|
+
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
30
|
+
}, {}, {}>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
33
|
+
type __VLS_TypePropsToOption<T> = {
|
|
34
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
35
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
36
|
+
} : {
|
|
37
|
+
type: import('vue').PropType<T[K]>;
|
|
38
|
+
required: true;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Placement } from '@floating-ui/vue';
|
|
2
|
+
/**
|
|
3
|
+
* A label for whatever it wraps, shown on hover and on keyboard focus. It opens in the top layer,
|
|
4
|
+
* so a panel that clips its own overflow cannot cut it off.
|
|
5
|
+
*/
|
|
6
|
+
type __VLS_Props = {
|
|
7
|
+
text: string;
|
|
8
|
+
/** Which side it hangs off (default 'top'). */
|
|
9
|
+
placement?: Placement;
|
|
10
|
+
/** How long the pointer has to rest before it appears, in ms (default 300). */
|
|
11
|
+
openDelay?: number;
|
|
12
|
+
/** Wraps its content and shows nothing, for a hint that only applies sometimes. */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
theme?: 'light' | 'dark';
|
|
15
|
+
};
|
|
16
|
+
declare function __VLS_template(): {
|
|
17
|
+
attrs: Partial<{}>;
|
|
18
|
+
slots: {
|
|
19
|
+
default?(_: {}): any;
|
|
20
|
+
};
|
|
21
|
+
refs: {
|
|
22
|
+
anchorRef: HTMLSpanElement;
|
|
23
|
+
popoverRef: HTMLDivElement;
|
|
24
|
+
};
|
|
25
|
+
rootEl: HTMLSpanElement;
|
|
26
|
+
};
|
|
27
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
28
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>>, {}, {}>;
|
|
29
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
30
|
+
export default _default;
|
|
31
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
32
|
+
type __VLS_TypePropsToOption<T> = {
|
|
33
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
34
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
35
|
+
} : {
|
|
36
|
+
type: import('vue').PropType<T[K]>;
|
|
37
|
+
required: true;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
41
|
+
new (): {
|
|
42
|
+
$slots: S;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A heading around a circle: typed in the field, or pointed on the rose that opens from the
|
|
3
|
+
* compass beside it. The value wraps at the ends, so 360° and 0° are the same direction.
|
|
4
|
+
*/
|
|
5
|
+
type __VLS_Props = {
|
|
6
|
+
modelValue: number | null;
|
|
7
|
+
label?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
/** Start of the circle (default 0). */
|
|
10
|
+
min?: number;
|
|
11
|
+
/** End of the circle, wrapping back to min (default 360). */
|
|
12
|
+
max?: number;
|
|
13
|
+
step?: number;
|
|
14
|
+
suffix?: string;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
theme?: 'light' | 'dark';
|
|
18
|
+
height?: string;
|
|
19
|
+
width?: string;
|
|
20
|
+
infoTooltip?: string;
|
|
21
|
+
errorMessages?: string[];
|
|
22
|
+
};
|
|
23
|
+
declare const _default: import('vue').DefineComponent<__VLS_TypePropsToOption<__VLS_Props>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
"update:modelValue": (value: number) => void;
|
|
25
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToOption<__VLS_Props>>> & {
|
|
26
|
+
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
27
|
+
}, {}, {}>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToOption<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface BlueLoadingState {
|
|
3
|
+
show: boolean;
|
|
4
|
+
message: string;
|
|
5
|
+
dismissible: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface BlueLoadingApi {
|
|
8
|
+
loading: Readonly<Ref<BlueLoadingState>>;
|
|
9
|
+
/**
|
|
10
|
+
* Raises the overlay. Leave it blocking for anything that is writing to a vehicle: dismissing it
|
|
11
|
+
* would leave the page live over a change still in flight. A wait that only delays information,
|
|
12
|
+
* such as the first read of a vehicle, can be dismissible.
|
|
13
|
+
*/
|
|
14
|
+
showLoading: (message?: string, dismissible?: boolean) => void;
|
|
15
|
+
hideLoading: () => void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The application's blocking wait, which BlueApp renders as a BlueLoadingDialog.
|
|
19
|
+
* @returns {BlueLoadingApi} The state, and the ways to raise and lower it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useBlueLoading(): BlueLoadingApi;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { BlueOsError } from '../services/blueos';
|
|
3
|
+
export interface BlueOsHost {
|
|
4
|
+
/** What the vehicle is called, which is what an extension should call it too. */
|
|
5
|
+
vehicleName: Ref<string | null>;
|
|
6
|
+
/** The address the vehicle answers to, without the .local suffix. */
|
|
7
|
+
hostname: Ref<string | null>;
|
|
8
|
+
/** The BlueOS image currently running, as its docker tag. */
|
|
9
|
+
version: Ref<string | null>;
|
|
10
|
+
/** The vehicle's primary colour, as #RRGGBB. Null until it arrives, and when it cannot. */
|
|
11
|
+
primaryColor: Ref<string | null>;
|
|
12
|
+
/** Whether BlueOS itself is in dark mode. Extensions are drawn dark either way. */
|
|
13
|
+
isDarkTheme: Ref<boolean>;
|
|
14
|
+
/** Whether BlueOS is in pirate mode, which is what hides or shows developer-only controls. */
|
|
15
|
+
isPirateMode: Ref<boolean>;
|
|
16
|
+
/** Whether BlueOS is serving this page, as opposed to a development server. */
|
|
17
|
+
embedded: boolean;
|
|
18
|
+
/** Why the last identity read failed, or null while the vehicle answered. */
|
|
19
|
+
error: Ref<BlueOsError | null>;
|
|
20
|
+
/** Reads everything again, which a page does after something else may have changed it. */
|
|
21
|
+
refresh: () => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* What the vehicle running this extension says about itself. Read once when the first consumer
|
|
25
|
+
* mounts, and again whenever it is asked for, since none of it changes on its own. Each field
|
|
26
|
+
* stays at its default when that particular call fails, so a page opened off the vehicle still
|
|
27
|
+
* renders.
|
|
28
|
+
* @returns {BlueOsHost} The vehicle's name, address, version and look, and the means to read them again.
|
|
29
|
+
*/
|
|
30
|
+
export declare const useBlueOs: () => BlueOsHost;
|
|
31
|
+
/**
|
|
32
|
+
* A value kept on the vehicle rather than in this browser, so an extension is configured once and
|
|
33
|
+
* found configured from every machine that opens it. It reads as the fallback until the stored
|
|
34
|
+
* value arrives, and writes itself back, at most twice a second, whenever it is changed.
|
|
35
|
+
* @param {string} path Where it is kept, as 'extension-name/setting'. Slashes nest.
|
|
36
|
+
* @param {T} fallback What it reads as while there is nothing stored, and if the read fails.
|
|
37
|
+
* @returns {Ref<T>} The value, which is written back on assignment.
|
|
38
|
+
*/
|
|
39
|
+
export declare const useBlueOsSetting: <T>(path: string, fallback: T) => Ref<T>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export type BlueNoticeSeverity = 'success' | 'error' | 'warning' | 'info';
|
|
3
|
+
export interface BlueNotice {
|
|
4
|
+
id: number;
|
|
5
|
+
text: string;
|
|
6
|
+
severity: BlueNoticeSeverity;
|
|
7
|
+
/** How many of the same message arrived in a row, so a repeat counts rather than stacks. */
|
|
8
|
+
repeats: number;
|
|
9
|
+
}
|
|
10
|
+
interface BlueNoticeOptions {
|
|
11
|
+
/** Default 'info'. */
|
|
12
|
+
severity?: BlueNoticeSeverity;
|
|
13
|
+
/** How long it stays, in ms. 0 keeps it until it is dismissed, which errors do by default. */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
interface BlueSnackbarApi {
|
|
17
|
+
notices: Readonly<Ref<readonly BlueNotice[]>>;
|
|
18
|
+
/** Says something happened. Returns the notice's id, for dismissing it early. */
|
|
19
|
+
notify: (text: string, options?: BlueNoticeOptions) => number;
|
|
20
|
+
/** Says a request failed, in whatever terms the failure came back in. */
|
|
21
|
+
notifyError: (error: unknown, fallback?: string) => number;
|
|
22
|
+
dismiss: (id: number) => void;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The application's notices. Raise them from anywhere; BlueSnackbar, which BlueApp mounts for you,
|
|
26
|
+
* is what puts them on screen.
|
|
27
|
+
* @returns {BlueSnackbarApi} The queue, and the ways to add to and remove from it.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useBlueSnackbar(): BlueSnackbarApi;
|
|
30
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
|
+
export { default as BlueApp } from './components/BlueApp.vue';
|
|
2
|
+
export { default as BlueBanner } from './components/BlueBanner.vue';
|
|
3
|
+
export { default as BlueBannerGroup } from './components/BlueBannerGroup.vue';
|
|
4
|
+
export { default as BlueButton } from './components/BlueButton.vue';
|
|
1
5
|
export { default as BlueButtonGroup } from './components/BlueButtonGroup.vue';
|
|
6
|
+
export { default as BlueCard } from './components/BlueCard.vue';
|
|
7
|
+
export { default as BlueCheckbox } from './components/BlueCheckbox.vue';
|
|
8
|
+
export { default as BlueChip } from './components/BlueChip.vue';
|
|
9
|
+
export { default as BlueConfirmDialog } from './components/BlueConfirmDialog.vue';
|
|
10
|
+
export { default as BlueDialog } from './components/BlueDialog.vue';
|
|
2
11
|
export { default as BlueExpansiblePanel } from './components/BlueExpansiblePanel.vue';
|
|
12
|
+
export { default as BlueFileDrop } from './components/BlueFileDrop.vue';
|
|
13
|
+
export { default as BlueIcon } from './components/BlueIcon.vue';
|
|
3
14
|
export { default as BlueInput } from './components/BlueInput.vue';
|
|
15
|
+
export { default as BlueStepsDialog, type BlueStep } from './components/BlueStepsDialog.vue';
|
|
4
16
|
export { default as BlueLoadingDialog } from './components/BlueLoadingDialog.vue';
|
|
5
17
|
export { default as BlueMenu, type BlueMenuItem } from './components/BlueMenu.vue';
|
|
18
|
+
export { default as BlueProgressBar } from './components/BlueProgressBar.vue';
|
|
6
19
|
export { default as BluePromptDialog } from './components/BluePromptDialog.vue';
|
|
20
|
+
export { default as BlueRadioGroup, type BlueRadioItem } from './components/BlueRadioGroup.vue';
|
|
21
|
+
export { default as BlueSection } from './components/BlueSection.vue';
|
|
7
22
|
export { default as BlueSelect } from './components/BlueSelect.vue';
|
|
8
23
|
export { default as BlueSlider } from './components/BlueSlider.vue';
|
|
24
|
+
export { default as BlueSnackbar } from './components/BlueSnackbar.vue';
|
|
25
|
+
export { default as BlueSpinner } from './components/BlueSpinner.vue';
|
|
26
|
+
export { default as BlueStat } from './components/BlueStat.vue';
|
|
9
27
|
export { default as BlueSwitch } from './components/BlueSwitch.vue';
|
|
28
|
+
export { default as BlueTable, type BlueColumn } from './components/BlueTable.vue';
|
|
29
|
+
export { default as BlueTabs, type BlueTab } from './components/BlueTabs.vue';
|
|
30
|
+
export { default as BlueTextarea } from './components/BlueTextarea.vue';
|
|
31
|
+
export { default as BlueTooltip } from './components/BlueTooltip.vue';
|
|
32
|
+
export { default as BlueWindRose } from './components/BlueWindRose.vue';
|
|
33
|
+
export { type BlueLoadingState, useBlueLoading } from './composables/useBlueLoading';
|
|
34
|
+
export { type BlueOsHost, useBlueOs, useBlueOsSetting } from './composables/useBlueOs';
|
|
10
35
|
export { useBluePopover } from './composables/useBluePopover';
|
|
36
|
+
export { type BlueNotice, type BlueNoticeSeverity, useBlueSnackbar } from './composables/useBlueSnackbar';
|
|
37
|
+
export type { BannerContent, BannerSeverity } from './types/banner';
|
|
38
|
+
export { BlueOsError, type BlueOsService, blueOsService, type BlueOsServiceOptions, isBlueOsExtension, setBlueOsHost, } from './services/blueos';
|
|
39
|
+
export { downloadJson, pickJsonFile } from './utils/files';
|
|
40
|
+
export { applyBlueTheme, type BlueTheme } from './utils/theme';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** What a BlueOS service answered when it did not answer with the thing that was asked for. */
|
|
2
|
+
export declare class BlueOsError extends Error {
|
|
3
|
+
readonly url: string;
|
|
4
|
+
/** The HTTP status, or 0 when the service could not be reached at all. */
|
|
5
|
+
readonly status: number;
|
|
6
|
+
constructor(message: string, url: string,
|
|
7
|
+
/** The HTTP status, or 0 when the service could not be reached at all. */
|
|
8
|
+
status: number);
|
|
9
|
+
}
|
|
10
|
+
export interface BlueOsServiceOptions {
|
|
11
|
+
/** The API version the service is versioned under. Pass null for the few that are not. */
|
|
12
|
+
version?: string | null;
|
|
13
|
+
/** How long a call may take before it is given up on, in milliseconds. */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface BlueOsService {
|
|
17
|
+
/** The absolute path a call would be made to, for a request this wrapper does not cover. */
|
|
18
|
+
url: (path: string) => string;
|
|
19
|
+
get: <T>(path: string, init?: RequestInit) => Promise<T>;
|
|
20
|
+
post: <T>(path: string, body?: unknown, init?: RequestInit) => Promise<T>;
|
|
21
|
+
delete: <T>(path: string, init?: RequestInit) => Promise<T>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Points the services at a BlueOS that is not the origin serving this page, which is what a page
|
|
25
|
+
* running on a development server needs.
|
|
26
|
+
* @param {string} url The vehicle's address, such as 'http://blueos.local'. Empty means the origin.
|
|
27
|
+
*/
|
|
28
|
+
export declare const setBlueOsHost: (url: string) => void;
|
|
29
|
+
/** Whether this page is being served by BlueOS as an extension, rather than run on its own. */
|
|
30
|
+
export declare const isBlueOsExtension: () => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* A wrapper around one of BlueOS's services, reachable by name.
|
|
33
|
+
* @param {string} name The service as nginx exposes it, such as 'beacon', 'bag' or 'kraken'.
|
|
34
|
+
* @param {BlueOsServiceOptions} options The API version to address and how long to wait.
|
|
35
|
+
* @returns {BlueOsService} Its verbs, each parsing JSON and raising BlueOsError on anything else.
|
|
36
|
+
*/
|
|
37
|
+
export declare const blueOsService: (name: string, options?: BlueOsServiceOptions) => BlueOsService;
|