@frontpanel/vue 0.2.0 → 0.4.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 +3 -1
- package/dist/FpButtonGroup.vue.d.ts +18 -0
- package/dist/FpMenu.vue.d.ts +51 -0
- package/dist/FpMenuItem.vue.d.ts +26 -0
- package/dist/FpMenuSeparator.vue.d.ts +3 -0
- package/dist/FpSwitch.vue.d.ts +28 -0
- package/dist/icons.d.ts +1 -1
- package/dist/index.d.ts +9 -0
- package/dist/index.js +364 -139
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -67,12 +67,14 @@ const playing = ref(false)
|
|
|
67
67
|
| `FpDevice` | The device: a molded body in a liquid-chrome rim on a backdrop. `fit="width"` or `"contain"` draws it at a design `width` and scales it to the room it has; the default `fit="none"` leaves layout to your page |
|
|
68
68
|
| `FpWindow` | A matte module with a chrome title bar: `title`, `level`, `closable` (emits `close`), an `actions` slot, and `sheet` for a phone bottom sheet |
|
|
69
69
|
| `FpButton` | A brushed-chrome push button; `pressed` makes it a toggle |
|
|
70
|
+
| `FpButtonGroup` | Chrome buttons joined into one bezel, as a named group |
|
|
71
|
+
| `FpMenu`, `FpMenuItem`, `FpMenuSeparator` | A faceplate menu that drops from the button in its `trigger` slot; rows emit `select`, or are links with `as="a"` |
|
|
70
72
|
| `FpGelButton` | The glossy gel pill, for the panel's main action |
|
|
71
73
|
| `FpCap` | A molded-plastic cap in `white`, `blue`, `amber`, `graphite` or `berry`; `pressed` holds it down with a ring |
|
|
72
74
|
| `FpLcd`, `FpLcdLine` | LCD glass, and a line of text on it with optional unlit segments (`ghost`, `cells`) and a left-to-right `redraw` |
|
|
73
75
|
| `FpLed` | A `green`, `amber` or `red` LED; `lit`, and `blink` to confirm an action |
|
|
74
76
|
| `FpHousing`, `FpWell`, `FpSilk`, `FpScrew` | A dark housing for LEDs, a recessed well, a silkscreened label, a screw head |
|
|
75
|
-
| `FpIcon` |
|
|
77
|
+
| `FpIcon` | A 21-glyph 16 px pixel icon set (`fpIconNames`) |
|
|
76
78
|
|
|
77
79
|
Element components take Reka's `as` and `asChild`.
|
|
78
80
|
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
2
|
+
export interface FpButtonGroupProps extends PrimitiveProps {
|
|
3
|
+
}
|
|
4
|
+
declare var __VLS_7: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
default?: (props: typeof __VLS_7) => any;
|
|
7
|
+
};
|
|
8
|
+
declare const __VLS_base: import("vue").DefineComponent<FpButtonGroupProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FpButtonGroupProps> & Readonly<{}>, {
|
|
9
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
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
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export interface FpMenuProps {
|
|
2
|
+
/** The side of the trigger the plate drops on. It flips to the other side when there is no room. */
|
|
3
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
4
|
+
/** How the plate lines up with the trigger along that side. */
|
|
5
|
+
align?: 'start' | 'center' | 'end';
|
|
6
|
+
/**
|
|
7
|
+
* Shuts out the rest of the page while the menu is open: pointer events and scrolling outside it
|
|
8
|
+
* are blocked, and assistive tech reads only the menu.
|
|
9
|
+
*/
|
|
10
|
+
modal?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Where the plate is mounted, a selector or an element. It takes the skin of the nearest
|
|
13
|
+
* `data-fp-skin` around the trigger with it; a custom skin set on another selector needs `to`
|
|
14
|
+
* inside that element.
|
|
15
|
+
*/
|
|
16
|
+
to?: string | HTMLElement;
|
|
17
|
+
}
|
|
18
|
+
type __VLS_Props = FpMenuProps;
|
|
19
|
+
type __VLS_Slots = {
|
|
20
|
+
/**
|
|
21
|
+
* The button that opens the menu, such as an `FpButton`. It gets `aria-haspopup` and
|
|
22
|
+
* `aria-expanded`, which hold a chrome button down while the menu is open.
|
|
23
|
+
*/
|
|
24
|
+
trigger?: (props: {
|
|
25
|
+
open: boolean;
|
|
26
|
+
}) => unknown;
|
|
27
|
+
/** The menu's rows: `FpMenuItem` and `FpMenuSeparator`. */
|
|
28
|
+
default?: () => unknown;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_ModelProps = {
|
|
31
|
+
'open'?: boolean;
|
|
32
|
+
};
|
|
33
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
34
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
35
|
+
"update:open": (value: boolean) => any;
|
|
36
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
37
|
+
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
side: "left" | "right" | "bottom" | "top";
|
|
40
|
+
align: "center" | "start" | "end";
|
|
41
|
+
modal: boolean;
|
|
42
|
+
to: string | HTMLElement;
|
|
43
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
45
|
+
declare const _default: typeof __VLS_export;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
48
|
+
new (): {
|
|
49
|
+
$slots: S;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PrimitiveProps } from 'reka-ui';
|
|
2
|
+
export interface FpMenuItemProps extends PrimitiveProps {
|
|
3
|
+
/** Greys the row out; it can't be chosen. */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** The text type-ahead matches, when the row's own text is not what a user would type. */
|
|
6
|
+
textValue?: string;
|
|
7
|
+
}
|
|
8
|
+
declare var __VLS_9: {};
|
|
9
|
+
type __VLS_Slots = {} & {
|
|
10
|
+
default?: (props: typeof __VLS_9) => any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_base: import("vue").DefineComponent<FpMenuItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
13
|
+
select: (event: Event) => any;
|
|
14
|
+
}, string, import("vue").PublicProps, Readonly<FpMenuItemProps> & Readonly<{
|
|
15
|
+
onSelect?: ((event: Event) => any) | undefined;
|
|
16
|
+
}>, {
|
|
17
|
+
as: import("reka-ui").AsTag | import("vue").Component;
|
|
18
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
19
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
20
|
+
declare const _default: typeof __VLS_export;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
23
|
+
new (): {
|
|
24
|
+
$slots: S;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FpLedColor } from './FpLed.vue';
|
|
2
|
+
export interface FpSwitchProps {
|
|
3
|
+
/** A silkscreen label, which also names the switch. Without one, give it an `aria-label`. */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Where the label sits: under the switch, or level with it and before it in the line. */
|
|
6
|
+
labelPlacement?: 'below' | 'start';
|
|
7
|
+
/** Standing up, I at the top; or on its side, I on the right. */
|
|
8
|
+
orientation?: 'vertical' | 'horizontal';
|
|
9
|
+
/** The colour its lamp lights in. */
|
|
10
|
+
color?: FpLedColor;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
type __VLS_Props = FpSwitchProps;
|
|
14
|
+
type __VLS_ModelProps = {
|
|
15
|
+
modelValue?: boolean;
|
|
16
|
+
};
|
|
17
|
+
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
18
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
19
|
+
"update:modelValue": (value: boolean) => any;
|
|
20
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
21
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
color: FpLedColor;
|
|
24
|
+
orientation: "vertical" | "horizontal";
|
|
25
|
+
labelPlacement: "start" | "below";
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: typeof __VLS_export;
|
|
28
|
+
export default _default;
|
package/dist/icons.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FpIconName = 'add' | 'saved' | 'settings' | 'help' | 'home' | 'undo' | 'redo' | 'save' | 'copy' | 'trash' | 'close' | 'grip' | 'left' | 'right' | 'quick' | 'grid' | 'go' | 'menu';
|
|
1
|
+
export type FpIconName = 'add' | 'saved' | 'settings' | 'help' | 'home' | 'undo' | 'redo' | 'save' | 'copy' | 'trash' | 'close' | 'grip' | 'left' | 'right' | 'down' | 'quick' | 'grid' | 'go' | 'play' | 'menu' | 'power';
|
|
2
2
|
/** One path per glyph: every horizontal run of lit pixels becomes a 1 px tall rectangle. */
|
|
3
3
|
export declare function toPath(rows: readonly string[]): string;
|
|
4
4
|
/** Every icon name, in the order the set lists them. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type { FpDeviceFit } from './fit';
|
|
2
2
|
export { default as FpButton } from './FpButton.vue';
|
|
3
3
|
export type { FpButtonProps } from './FpButton.vue';
|
|
4
|
+
export { default as FpButtonGroup } from './FpButtonGroup.vue';
|
|
5
|
+
export type { FpButtonGroupProps } from './FpButtonGroup.vue';
|
|
4
6
|
export { default as FpCap } from './FpCap.vue';
|
|
5
7
|
export type { FpCapColor, FpCapProps } from './FpCap.vue';
|
|
6
8
|
export { default as FpDevice } from './FpDevice.vue';
|
|
@@ -19,6 +21,11 @@ export { default as FpLcdLine } from './FpLcdLine.vue';
|
|
|
19
21
|
export type { FpLcdLineProps } from './FpLcdLine.vue';
|
|
20
22
|
export { default as FpLed } from './FpLed.vue';
|
|
21
23
|
export type { FpLedColor, FpLedProps } from './FpLed.vue';
|
|
24
|
+
export { default as FpMenu } from './FpMenu.vue';
|
|
25
|
+
export type { FpMenuProps } from './FpMenu.vue';
|
|
26
|
+
export { default as FpMenuItem } from './FpMenuItem.vue';
|
|
27
|
+
export type { FpMenuItemProps } from './FpMenuItem.vue';
|
|
28
|
+
export { default as FpMenuSeparator } from './FpMenuSeparator.vue';
|
|
22
29
|
export { default as FpMeter } from './FpMeter.vue';
|
|
23
30
|
export type { FpMeterProps } from './FpMeter.vue';
|
|
24
31
|
export { default as FpReadout } from './FpReadout.vue';
|
|
@@ -28,6 +35,8 @@ export { default as FpSilk } from './FpSilk.vue';
|
|
|
28
35
|
export type { FpSilkProps } from './FpSilk.vue';
|
|
29
36
|
export { default as FpSlider } from './FpSlider.vue';
|
|
30
37
|
export type { FpSliderProps } from './FpSlider.vue';
|
|
38
|
+
export { default as FpSwitch } from './FpSwitch.vue';
|
|
39
|
+
export type { FpSwitchProps } from './FpSwitch.vue';
|
|
31
40
|
export { default as FpWell } from './FpWell.vue';
|
|
32
41
|
export type { FpWellProps } from './FpWell.vue';
|
|
33
42
|
export { default as FpWindow } from './FpWindow.vue';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeStyle as f,
|
|
2
|
-
import { Primitive as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, mergeModels as l, mergeProps as u, normalizeClass as d, normalizeStyle as f, onMounted as p, openBlock as m, ref as h, renderList as g, renderSlot as _, resolveDynamicComponent as v, shallowRef as y, toDisplayString as b, unref as x, useAttrs as S, useId as C, useModel as w, useTemplateRef as T, warn as E, watch as D, withCtx as O } from "vue";
|
|
2
|
+
import { DropdownMenuContent as k, DropdownMenuItem as A, DropdownMenuPortal as j, DropdownMenuRoot as ee, DropdownMenuSeparator as M, DropdownMenuTrigger as N, Primitive as P, SliderRoot as F, SliderThumb as I, SliderTrack as te, SwitchRoot as ne, SwitchThumb as re } from "reka-ui";
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region src/FpButton.vue
|
|
5
|
-
var
|
|
5
|
+
var L = /* @__PURE__ */ c({
|
|
6
6
|
__name: "FpButton",
|
|
7
7
|
props: {
|
|
8
8
|
pressed: {
|
|
@@ -14,14 +14,14 @@ var j = /* @__PURE__ */ c({
|
|
|
14
14
|
},
|
|
15
15
|
setup(e) {
|
|
16
16
|
let t = e;
|
|
17
|
-
return (e, r) => (
|
|
17
|
+
return (e, r) => (m(), n(x(P), {
|
|
18
18
|
as: t.as,
|
|
19
19
|
"as-child": t.asChild,
|
|
20
20
|
class: "fp-chrome-btn",
|
|
21
21
|
type: t.as === "button" && !t.asChild ? "button" : void 0,
|
|
22
22
|
"aria-pressed": t.pressed
|
|
23
23
|
}, {
|
|
24
|
-
default:
|
|
24
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
25
25
|
_: 3
|
|
26
26
|
}, 8, [
|
|
27
27
|
"as",
|
|
@@ -30,7 +30,25 @@ var j = /* @__PURE__ */ c({
|
|
|
30
30
|
"aria-pressed"
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), ie = /* @__PURE__ */ c({
|
|
34
|
+
__name: "FpButtonGroup",
|
|
35
|
+
props: {
|
|
36
|
+
asChild: { type: Boolean },
|
|
37
|
+
as: { default: "div" }
|
|
38
|
+
},
|
|
39
|
+
setup(e) {
|
|
40
|
+
let t = e;
|
|
41
|
+
return (e, r) => (m(), n(x(P), {
|
|
42
|
+
as: t.as,
|
|
43
|
+
"as-child": t.asChild,
|
|
44
|
+
class: "fp-button-group",
|
|
45
|
+
role: "group"
|
|
46
|
+
}, {
|
|
47
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
48
|
+
_: 3
|
|
49
|
+
}, 8, ["as", "as-child"]));
|
|
50
|
+
}
|
|
51
|
+
}), ae = /* @__PURE__ */ c({
|
|
34
52
|
__name: "FpCap",
|
|
35
53
|
props: {
|
|
36
54
|
color: { default: "white" },
|
|
@@ -49,14 +67,14 @@ var j = /* @__PURE__ */ c({
|
|
|
49
67
|
graphite: "fp-cap-graphite",
|
|
50
68
|
berry: "fp-cap-berry"
|
|
51
69
|
};
|
|
52
|
-
return (e, i) => (
|
|
70
|
+
return (e, i) => (m(), n(x(P), {
|
|
53
71
|
as: t.as,
|
|
54
72
|
"as-child": t.asChild,
|
|
55
73
|
class: d(["fp-cap", r[t.color]]),
|
|
56
74
|
type: t.as === "button" && !t.asChild ? "button" : void 0,
|
|
57
75
|
"aria-pressed": t.pressed
|
|
58
76
|
}, {
|
|
59
|
-
default:
|
|
77
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
60
78
|
_: 3
|
|
61
79
|
}, 8, [
|
|
62
80
|
"as",
|
|
@@ -69,7 +87,7 @@ var j = /* @__PURE__ */ c({
|
|
|
69
87
|
});
|
|
70
88
|
//#endregion
|
|
71
89
|
//#region src/fit.ts
|
|
72
|
-
function
|
|
90
|
+
function oe(e, t, n, r) {
|
|
73
91
|
if (t.width <= 0 || n.width <= 0) return null;
|
|
74
92
|
let i = t.width / n.width;
|
|
75
93
|
if (e === "contain") {
|
|
@@ -80,7 +98,7 @@ function ee(e, t, n, r) {
|
|
|
80
98
|
}
|
|
81
99
|
//#endregion
|
|
82
100
|
//#region src/FpDevice.vue?vue&type=script&setup=true&lang.ts
|
|
83
|
-
var
|
|
101
|
+
var R = { class: "fp-device-body" }, z = /* @__PURE__ */ c({
|
|
84
102
|
__name: "FpDevice",
|
|
85
103
|
props: {
|
|
86
104
|
backdrop: {
|
|
@@ -97,14 +115,14 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
97
115
|
maxScale: { default: 1 }
|
|
98
116
|
},
|
|
99
117
|
setup(e) {
|
|
100
|
-
let n = e, r =
|
|
118
|
+
let n = e, r = T("stage"), o = T("device"), s = y({
|
|
101
119
|
width: 0,
|
|
102
120
|
height: 0
|
|
103
|
-
}), c =
|
|
121
|
+
}), c = y(0), l = t(() => n.fit === "none" ? !1 : n.width !== void 0 || (E(`FpDevice: fit="${n.fit}" needs a design width; the device is not scaled.`), !1)), u = t(() => n.height ?? c.value), p = t(() => !l.value || n.fit === "none" ? null : oe(n.fit, s.value, {
|
|
104
122
|
width: n.width,
|
|
105
123
|
height: u.value
|
|
106
124
|
}, n.maxScale));
|
|
107
|
-
function
|
|
125
|
+
function h() {
|
|
108
126
|
if (!r.value || !o.value) return;
|
|
109
127
|
let e = getComputedStyle(r.value), t = (e) => Number.parseFloat(e) || 0;
|
|
110
128
|
s.value = {
|
|
@@ -112,23 +130,23 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
112
130
|
height: r.value.clientHeight - t(e.paddingTop) - t(e.paddingBottom)
|
|
113
131
|
}, c.value = o.value.offsetHeight;
|
|
114
132
|
}
|
|
115
|
-
|
|
133
|
+
D([
|
|
116
134
|
l,
|
|
117
135
|
r,
|
|
118
136
|
o
|
|
119
137
|
], ([e, t, n], r, i) => {
|
|
120
138
|
if (!e || !t || !n || typeof ResizeObserver > "u") return;
|
|
121
|
-
let a = new ResizeObserver(
|
|
139
|
+
let a = new ResizeObserver(h);
|
|
122
140
|
a.observe(t), a.observe(n), i(() => a.disconnect());
|
|
123
141
|
}, {
|
|
124
142
|
flush: "post",
|
|
125
143
|
immediate: !0
|
|
126
144
|
});
|
|
127
|
-
let
|
|
145
|
+
let g = t(() => l.value ? { contain: "inline-size" } : void 0), v = t(() => {
|
|
128
146
|
if (!l.value) return { display: "contents" };
|
|
129
|
-
if (
|
|
130
|
-
width: `${n.width *
|
|
131
|
-
height: `${u.value *
|
|
147
|
+
if (p.value !== null) return {
|
|
148
|
+
width: `${n.width * p.value}px`,
|
|
149
|
+
height: `${u.value * p.value}px`,
|
|
132
150
|
marginInline: "auto"
|
|
133
151
|
};
|
|
134
152
|
}), b = t(() => {
|
|
@@ -136,31 +154,31 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
136
154
|
boxSizing: "border-box",
|
|
137
155
|
width: `${n.width}px`,
|
|
138
156
|
height: n.height === void 0 ? void 0 : `${n.height}px`,
|
|
139
|
-
scale:
|
|
157
|
+
scale: p.value ?? void 0,
|
|
140
158
|
transformOrigin: "0 0",
|
|
141
|
-
visibility:
|
|
159
|
+
visibility: p.value === null ? "hidden" : void 0
|
|
142
160
|
};
|
|
143
161
|
});
|
|
144
|
-
return (e, t) => (
|
|
162
|
+
return (e, t) => (m(), i("div", {
|
|
145
163
|
ref_key: "stage",
|
|
146
164
|
ref: r,
|
|
147
165
|
class: d({ "fp-device-backdrop": n.backdrop }),
|
|
148
|
-
style: f(
|
|
149
|
-
}, [a("div", { style: f(
|
|
166
|
+
style: f(g.value)
|
|
167
|
+
}, [a("div", { style: f(v.value) }, [n.rim ? (m(), i("div", {
|
|
150
168
|
key: 0,
|
|
151
169
|
ref_key: "device",
|
|
152
170
|
ref: o,
|
|
153
171
|
class: "fp-device-rim",
|
|
154
172
|
style: f(b.value)
|
|
155
|
-
}, [a("div",
|
|
173
|
+
}, [a("div", R, [_(e.$slots, "default")])], 4)) : (m(), i("div", {
|
|
156
174
|
key: 1,
|
|
157
175
|
ref_key: "device",
|
|
158
176
|
ref: o,
|
|
159
177
|
class: "fp-device-body",
|
|
160
178
|
style: f(b.value)
|
|
161
|
-
}, [
|
|
179
|
+
}, [_(e.$slots, "default")], 4))], 4)], 6));
|
|
162
180
|
}
|
|
163
|
-
}),
|
|
181
|
+
}), B = /* @__PURE__ */ c({
|
|
164
182
|
__name: "FpGelButton",
|
|
165
183
|
props: {
|
|
166
184
|
asChild: { type: Boolean },
|
|
@@ -168,13 +186,13 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
168
186
|
},
|
|
169
187
|
setup(e) {
|
|
170
188
|
let t = e;
|
|
171
|
-
return (e, r) => (
|
|
189
|
+
return (e, r) => (m(), n(x(P), {
|
|
172
190
|
as: t.as,
|
|
173
191
|
"as-child": t.asChild,
|
|
174
192
|
class: "fp-gel",
|
|
175
193
|
type: t.as === "button" && !t.asChild ? "button" : void 0
|
|
176
194
|
}, {
|
|
177
|
-
default:
|
|
195
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
178
196
|
_: 3
|
|
179
197
|
}, 8, [
|
|
180
198
|
"as",
|
|
@@ -182,7 +200,7 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
182
200
|
"type"
|
|
183
201
|
]));
|
|
184
202
|
}
|
|
185
|
-
}),
|
|
203
|
+
}), V = /* @__PURE__ */ c({
|
|
186
204
|
__name: "FpHousing",
|
|
187
205
|
props: {
|
|
188
206
|
asChild: { type: Boolean },
|
|
@@ -190,16 +208,16 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
190
208
|
},
|
|
191
209
|
setup(e) {
|
|
192
210
|
let t = e;
|
|
193
|
-
return (e, r) => (
|
|
211
|
+
return (e, r) => (m(), n(x(P), {
|
|
194
212
|
as: t.as,
|
|
195
213
|
"as-child": t.asChild,
|
|
196
214
|
class: "fp-housing"
|
|
197
215
|
}, {
|
|
198
|
-
default:
|
|
216
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
199
217
|
_: 3
|
|
200
218
|
}, 8, ["as", "as-child"]));
|
|
201
219
|
}
|
|
202
|
-
}),
|
|
220
|
+
}), H = [
|
|
203
221
|
"................",
|
|
204
222
|
"................",
|
|
205
223
|
".....#..........",
|
|
@@ -216,7 +234,7 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
216
234
|
"................",
|
|
217
235
|
"................",
|
|
218
236
|
"................"
|
|
219
|
-
],
|
|
237
|
+
], U = [
|
|
220
238
|
"................",
|
|
221
239
|
"................",
|
|
222
240
|
".........##.....",
|
|
@@ -233,7 +251,7 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
233
251
|
".........##.....",
|
|
234
252
|
"................",
|
|
235
253
|
"................"
|
|
236
|
-
],
|
|
254
|
+
], W = (e) => e.map((e) => [...e].reverse().join("")), G = {
|
|
237
255
|
add: [
|
|
238
256
|
"................",
|
|
239
257
|
"................",
|
|
@@ -270,8 +288,26 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
270
288
|
"................",
|
|
271
289
|
"................"
|
|
272
290
|
],
|
|
273
|
-
left:
|
|
274
|
-
right:
|
|
291
|
+
left: U,
|
|
292
|
+
right: W(U),
|
|
293
|
+
down: [
|
|
294
|
+
"................",
|
|
295
|
+
"................",
|
|
296
|
+
"................",
|
|
297
|
+
"................",
|
|
298
|
+
"................",
|
|
299
|
+
"..##........##..",
|
|
300
|
+
"..###......###..",
|
|
301
|
+
"...###....###...",
|
|
302
|
+
"....###..###....",
|
|
303
|
+
".....######.....",
|
|
304
|
+
"......####......",
|
|
305
|
+
".......##.......",
|
|
306
|
+
"................",
|
|
307
|
+
"................",
|
|
308
|
+
"................",
|
|
309
|
+
"................"
|
|
310
|
+
],
|
|
275
311
|
go: [
|
|
276
312
|
"................",
|
|
277
313
|
"................",
|
|
@@ -290,8 +326,26 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
290
326
|
"................",
|
|
291
327
|
"................"
|
|
292
328
|
],
|
|
293
|
-
|
|
294
|
-
|
|
329
|
+
play: [
|
|
330
|
+
"................",
|
|
331
|
+
"................",
|
|
332
|
+
"....#...........",
|
|
333
|
+
"....###.........",
|
|
334
|
+
"....####........",
|
|
335
|
+
"....######......",
|
|
336
|
+
"....#######.....",
|
|
337
|
+
"....#########...",
|
|
338
|
+
"....#########...",
|
|
339
|
+
"....#######.....",
|
|
340
|
+
"....######......",
|
|
341
|
+
"....####........",
|
|
342
|
+
"....###.........",
|
|
343
|
+
"....#...........",
|
|
344
|
+
"................",
|
|
345
|
+
"................"
|
|
346
|
+
],
|
|
347
|
+
undo: H,
|
|
348
|
+
redo: W(H),
|
|
295
349
|
home: [
|
|
296
350
|
"................",
|
|
297
351
|
".......##.......",
|
|
@@ -489,9 +543,27 @@ var te = { class: "fp-device-body" }, ne = /* @__PURE__ */ c({
|
|
|
489
543
|
"................",
|
|
490
544
|
"................",
|
|
491
545
|
"................"
|
|
546
|
+
],
|
|
547
|
+
power: [
|
|
548
|
+
"................",
|
|
549
|
+
"................",
|
|
550
|
+
".......##.......",
|
|
551
|
+
".......##.......",
|
|
552
|
+
"...##..##..##...",
|
|
553
|
+
"..###..##..###..",
|
|
554
|
+
"..##...##...##..",
|
|
555
|
+
"..##...##...##..",
|
|
556
|
+
"..##........##..",
|
|
557
|
+
"..##........##..",
|
|
558
|
+
"..###......###..",
|
|
559
|
+
"...###....###...",
|
|
560
|
+
"....########....",
|
|
561
|
+
".....######.....",
|
|
562
|
+
"................",
|
|
563
|
+
"................"
|
|
492
564
|
]
|
|
493
565
|
};
|
|
494
|
-
function
|
|
566
|
+
function K(e) {
|
|
495
567
|
let t = "";
|
|
496
568
|
return e.forEach((e, n) => {
|
|
497
569
|
let r = 0;
|
|
@@ -507,27 +579,27 @@ function ie(e) {
|
|
|
507
579
|
}
|
|
508
580
|
}), t;
|
|
509
581
|
}
|
|
510
|
-
var
|
|
582
|
+
var q = Object.keys(G), se = Object.fromEntries(q.map((e) => [e, K(G[e])])), ce = [
|
|
511
583
|
"role",
|
|
512
584
|
"aria-label",
|
|
513
585
|
"aria-hidden"
|
|
514
|
-
],
|
|
586
|
+
], le = ["d"], J = /* @__PURE__ */ c({
|
|
515
587
|
__name: "FpIcon",
|
|
516
588
|
props: {
|
|
517
589
|
name: {},
|
|
518
590
|
label: {}
|
|
519
591
|
},
|
|
520
592
|
setup(e) {
|
|
521
|
-
let n = e, r = t(() =>
|
|
522
|
-
return (e, t) => (
|
|
593
|
+
let n = e, r = t(() => se[n.name]);
|
|
594
|
+
return (e, t) => (m(), i("svg", {
|
|
523
595
|
viewBox: "0 0 16 16",
|
|
524
596
|
class: "fp-icon",
|
|
525
597
|
role: n.label ? "img" : void 0,
|
|
526
598
|
"aria-label": n.label || void 0,
|
|
527
599
|
"aria-hidden": n.label ? void 0 : "true"
|
|
528
|
-
}, [a("path", { d: r.value }, null, 8,
|
|
600
|
+
}, [a("path", { d: r.value }, null, 8, le)], 8, ce));
|
|
529
601
|
}
|
|
530
|
-
}),
|
|
602
|
+
}), ue = [
|
|
531
603
|
"tabindex",
|
|
532
604
|
"aria-valuemin",
|
|
533
605
|
"aria-valuemax",
|
|
@@ -535,7 +607,7 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
535
607
|
"aria-valuetext",
|
|
536
608
|
"aria-labelledby",
|
|
537
609
|
"aria-disabled"
|
|
538
|
-
],
|
|
610
|
+
], de = ["id"], fe = 200, pe = .1, Y = 270, me = /* @__PURE__ */ c({
|
|
539
611
|
inheritAttrs: !1,
|
|
540
612
|
__name: "FpKnob",
|
|
541
613
|
props: /*@__PURE__*/ l({
|
|
@@ -551,34 +623,34 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
551
623
|
}),
|
|
552
624
|
emits: /*@__PURE__*/ l(["valueCommit"], ["update:modelValue"]),
|
|
553
625
|
setup(e, { emit: n }) {
|
|
554
|
-
let o = e, s = n, c =
|
|
626
|
+
let o = e, s = n, c = w(e, "modelValue"), l = S(), d = t(() => ({
|
|
555
627
|
class: l.class,
|
|
556
628
|
style: l.style
|
|
557
|
-
})),
|
|
629
|
+
})), p = t(() => {
|
|
558
630
|
let { class: e, style: t, ...n } = l;
|
|
559
631
|
return n;
|
|
560
|
-
}), h =
|
|
632
|
+
}), h = C(), g = t(() => (String(o.step).split(".")[1] ?? "").length);
|
|
561
633
|
function _(e) {
|
|
562
634
|
let t = Math.round((e - o.min) / o.step) * o.step + o.min, n = Math.min(o.max, Math.max(o.min, t));
|
|
563
635
|
return Number(n.toFixed(g.value));
|
|
564
636
|
}
|
|
565
|
-
let
|
|
566
|
-
let e = o.max - o.min, t = e > 0 ? (
|
|
567
|
-
return Math.round(t *
|
|
637
|
+
let v = t(() => _(c.value)), y = t(() => {
|
|
638
|
+
let e = o.max - o.min, t = e > 0 ? (v.value - o.min) / e : 0;
|
|
639
|
+
return Math.round(t * Y - Y / 2);
|
|
568
640
|
});
|
|
569
641
|
function T(e) {
|
|
570
642
|
let t = _(e);
|
|
571
|
-
return t !==
|
|
643
|
+
return t !== v.value && (c.value = t, !0);
|
|
572
644
|
}
|
|
573
645
|
function E(e) {
|
|
574
646
|
if (o.disabled) return;
|
|
575
647
|
let t = o.step * 10, n = {
|
|
576
|
-
ArrowUp:
|
|
577
|
-
ArrowRight:
|
|
578
|
-
ArrowDown:
|
|
579
|
-
ArrowLeft:
|
|
580
|
-
PageUp:
|
|
581
|
-
PageDown:
|
|
648
|
+
ArrowUp: v.value + o.step,
|
|
649
|
+
ArrowRight: v.value + o.step,
|
|
650
|
+
ArrowDown: v.value - o.step,
|
|
651
|
+
ArrowLeft: v.value - o.step,
|
|
652
|
+
PageUp: v.value + t,
|
|
653
|
+
PageDown: v.value - t,
|
|
582
654
|
Home: o.min,
|
|
583
655
|
End: o.max
|
|
584
656
|
}[e.key];
|
|
@@ -594,13 +666,13 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
594
666
|
}), D = {
|
|
595
667
|
pointerId: e.pointerId,
|
|
596
668
|
y: e.clientY,
|
|
597
|
-
raw:
|
|
598
|
-
start:
|
|
669
|
+
raw: v.value,
|
|
670
|
+
start: v.value
|
|
599
671
|
};
|
|
600
672
|
}
|
|
601
673
|
function k(e) {
|
|
602
674
|
if (!D || e.pointerId !== D.pointerId) return;
|
|
603
|
-
let t = (o.max - o.min) /
|
|
675
|
+
let t = (o.max - o.min) / fe * (e.shiftKey ? pe : 1);
|
|
604
676
|
D.raw = Math.min(o.max, Math.max(o.min, D.raw + (D.y - e.clientY) * t)), D.y = e.clientY, T(D.raw);
|
|
605
677
|
}
|
|
606
678
|
function A(e) {
|
|
@@ -608,15 +680,15 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
608
680
|
let t = _(D.raw), n = t !== D.start;
|
|
609
681
|
D = void 0, n && s("valueCommit", t);
|
|
610
682
|
}
|
|
611
|
-
return (e, t) => (
|
|
683
|
+
return (e, t) => (m(), i("div", u({ class: "fp-unit" }, d.value), [a("div", u(p.value, {
|
|
612
684
|
class: "fp-knob",
|
|
613
685
|
role: "slider",
|
|
614
686
|
tabindex: o.disabled ? void 0 : 0,
|
|
615
687
|
"aria-valuemin": o.min,
|
|
616
688
|
"aria-valuemax": o.max,
|
|
617
|
-
"aria-valuenow":
|
|
618
|
-
"aria-valuetext": o.valueText?.(
|
|
619
|
-
"aria-labelledby": o.label ?
|
|
689
|
+
"aria-valuenow": v.value,
|
|
690
|
+
"aria-valuetext": o.valueText?.(v.value),
|
|
691
|
+
"aria-labelledby": o.label ? x(h) : void 0,
|
|
620
692
|
"aria-disabled": o.disabled || void 0,
|
|
621
693
|
onKeydown: E,
|
|
622
694
|
onPointerdown: O,
|
|
@@ -625,14 +697,14 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
625
697
|
onPointercancel: A
|
|
626
698
|
}), [a("span", {
|
|
627
699
|
class: "fp-knob-mark",
|
|
628
|
-
style: f({ rotate: `${
|
|
629
|
-
}, null, 4)], 16,
|
|
700
|
+
style: f({ rotate: `${y.value}deg` })
|
|
701
|
+
}, null, 4)], 16, ue), o.label ? (m(), i("span", {
|
|
630
702
|
key: 0,
|
|
631
|
-
id:
|
|
703
|
+
id: x(h),
|
|
632
704
|
class: "fp-silk"
|
|
633
|
-
},
|
|
705
|
+
}, b(o.label), 9, de)) : r("", !0)], 16));
|
|
634
706
|
}
|
|
635
|
-
}),
|
|
707
|
+
}), he = /* @__PURE__ */ c({
|
|
636
708
|
__name: "FpLcd",
|
|
637
709
|
props: {
|
|
638
710
|
asChild: { type: Boolean },
|
|
@@ -640,20 +712,20 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
640
712
|
},
|
|
641
713
|
setup(e) {
|
|
642
714
|
let t = e;
|
|
643
|
-
return (e, r) => (
|
|
715
|
+
return (e, r) => (m(), n(x(P), {
|
|
644
716
|
as: t.as,
|
|
645
717
|
"as-child": t.asChild,
|
|
646
718
|
class: "fp-lcd"
|
|
647
719
|
}, {
|
|
648
|
-
default:
|
|
720
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
649
721
|
_: 3
|
|
650
722
|
}, 8, ["as", "as-child"]));
|
|
651
723
|
}
|
|
652
|
-
}),
|
|
724
|
+
}), ge = {
|
|
653
725
|
key: 0,
|
|
654
726
|
class: "fp-lcd-ghost",
|
|
655
727
|
"aria-hidden": "true"
|
|
656
|
-
},
|
|
728
|
+
}, _e = { key: 2 }, ve = /* @__PURE__ */ c({
|
|
657
729
|
__name: "FpLcdLine",
|
|
658
730
|
props: {
|
|
659
731
|
text: {},
|
|
@@ -665,15 +737,15 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
665
737
|
},
|
|
666
738
|
setup(e) {
|
|
667
739
|
let a = e, o = t(() => "8".repeat(a.cells ?? a.text.length));
|
|
668
|
-
return (e, t) => (
|
|
740
|
+
return (e, t) => (m(), n(x(P), {
|
|
669
741
|
as: a.as,
|
|
670
742
|
"as-child": a.asChild,
|
|
671
743
|
class: "fp-lcd-line"
|
|
672
744
|
}, {
|
|
673
|
-
default:
|
|
745
|
+
default: O(() => [a.ghost ? (m(), i("span", ge, b(o.value), 1)) : r("", !0), a.redraw ? (m(), i("span", {
|
|
674
746
|
key: a.text,
|
|
675
747
|
class: "fp-lcd-redraw"
|
|
676
|
-
},
|
|
748
|
+
}, b(a.text), 1)) : (m(), i("span", _e, b(a.text), 1))]),
|
|
677
749
|
_: 1
|
|
678
750
|
}, 8, ["as", "as-child"]));
|
|
679
751
|
}
|
|
@@ -681,11 +753,11 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
681
753
|
flat: "fp-lens-flat",
|
|
682
754
|
diffused: "fp-lens-diffused",
|
|
683
755
|
clear: "fp-lens-clear"
|
|
684
|
-
},
|
|
756
|
+
}, ye = [
|
|
685
757
|
"role",
|
|
686
758
|
"aria-label",
|
|
687
759
|
"aria-hidden"
|
|
688
|
-
],
|
|
760
|
+
], be = /* @__PURE__ */ c({
|
|
689
761
|
__name: "FpLed",
|
|
690
762
|
props: {
|
|
691
763
|
color: { default: "green" },
|
|
@@ -700,10 +772,10 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
700
772
|
amber: "fp-led-amber",
|
|
701
773
|
red: "fp-led-red"
|
|
702
774
|
};
|
|
703
|
-
return (e, r) => (
|
|
775
|
+
return (e, r) => (m(), i("span", {
|
|
704
776
|
class: d(["fp-led", [
|
|
705
777
|
n[t.color],
|
|
706
|
-
t.lens &&
|
|
778
|
+
t.lens && x(X)[t.lens],
|
|
707
779
|
{
|
|
708
780
|
"fp-led-lit": t.lit,
|
|
709
781
|
"fp-blink-twice": t.lit && t.blink
|
|
@@ -712,16 +784,112 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
712
784
|
role: t.label ? "img" : void 0,
|
|
713
785
|
"aria-label": t.label || void 0,
|
|
714
786
|
"aria-hidden": t.label ? void 0 : "true"
|
|
715
|
-
}, null, 10,
|
|
787
|
+
}, null, 10, ye));
|
|
716
788
|
}
|
|
717
|
-
}),
|
|
789
|
+
}), xe = /* @__PURE__ */ c({
|
|
790
|
+
inheritAttrs: !1,
|
|
791
|
+
__name: "FpMenu",
|
|
792
|
+
props: /*@__PURE__*/ l({
|
|
793
|
+
side: { default: "bottom" },
|
|
794
|
+
align: { default: "start" },
|
|
795
|
+
modal: {
|
|
796
|
+
type: Boolean,
|
|
797
|
+
default: !0
|
|
798
|
+
},
|
|
799
|
+
to: { default: "body" }
|
|
800
|
+
}, {
|
|
801
|
+
open: {
|
|
802
|
+
type: Boolean,
|
|
803
|
+
default: !1
|
|
804
|
+
},
|
|
805
|
+
openModifiers: {}
|
|
806
|
+
}),
|
|
807
|
+
emits: ["update:open"],
|
|
808
|
+
setup(e) {
|
|
809
|
+
let t = e, r = w(e, "open"), i = S(), a = h(), o = h();
|
|
810
|
+
function c() {
|
|
811
|
+
let e = a.value?.$el;
|
|
812
|
+
o.value = e instanceof Element ? e.closest("[data-fp-skin]")?.getAttribute("data-fp-skin") ?? void 0 : void 0;
|
|
813
|
+
}
|
|
814
|
+
return D(r, (e) => {
|
|
815
|
+
e && c();
|
|
816
|
+
}), p(() => {
|
|
817
|
+
r.value && c();
|
|
818
|
+
}), (e, c) => (m(), n(x(ee), {
|
|
819
|
+
open: r.value,
|
|
820
|
+
"onUpdate:open": c[0] ||= (e) => r.value = e,
|
|
821
|
+
modal: t.modal
|
|
822
|
+
}, {
|
|
823
|
+
default: O(() => [s(x(N), {
|
|
824
|
+
ref_key: "trigger",
|
|
825
|
+
ref: a,
|
|
826
|
+
"as-child": ""
|
|
827
|
+
}, {
|
|
828
|
+
default: O(() => [_(e.$slots, "trigger", { open: r.value })]),
|
|
829
|
+
_: 3
|
|
830
|
+
}, 512), s(x(j), { to: t.to }, {
|
|
831
|
+
default: O(() => [s(x(k), u(x(i), {
|
|
832
|
+
class: "fp-menu",
|
|
833
|
+
"data-fp-skin": o.value,
|
|
834
|
+
side: t.side,
|
|
835
|
+
align: t.align,
|
|
836
|
+
"side-offset": 4,
|
|
837
|
+
"collision-padding": 8,
|
|
838
|
+
style: { maxHeight: "var(--reka-dropdown-menu-content-available-height)" }
|
|
839
|
+
}), {
|
|
840
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
841
|
+
_: 3
|
|
842
|
+
}, 16, [
|
|
843
|
+
"data-fp-skin",
|
|
844
|
+
"side",
|
|
845
|
+
"align"
|
|
846
|
+
])]),
|
|
847
|
+
_: 3
|
|
848
|
+
}, 8, ["to"])]),
|
|
849
|
+
_: 3
|
|
850
|
+
}, 8, ["open", "modal"]));
|
|
851
|
+
}
|
|
852
|
+
}), Se = /* @__PURE__ */ c({
|
|
853
|
+
__name: "FpMenuItem",
|
|
854
|
+
props: {
|
|
855
|
+
disabled: { type: Boolean },
|
|
856
|
+
textValue: {},
|
|
857
|
+
asChild: { type: Boolean },
|
|
858
|
+
as: { default: "div" }
|
|
859
|
+
},
|
|
860
|
+
emits: ["select"],
|
|
861
|
+
setup(e, { emit: t }) {
|
|
862
|
+
let r = e, i = t;
|
|
863
|
+
return (e, t) => (m(), n(x(A), {
|
|
864
|
+
as: r.as,
|
|
865
|
+
"as-child": r.asChild,
|
|
866
|
+
disabled: r.disabled,
|
|
867
|
+
"text-value": r.textValue,
|
|
868
|
+
class: "fp-menu-item",
|
|
869
|
+
onSelect: t[0] ||= (e) => i("select", e)
|
|
870
|
+
}, {
|
|
871
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
872
|
+
_: 3
|
|
873
|
+
}, 8, [
|
|
874
|
+
"as",
|
|
875
|
+
"as-child",
|
|
876
|
+
"disabled",
|
|
877
|
+
"text-value"
|
|
878
|
+
]));
|
|
879
|
+
}
|
|
880
|
+
}), Ce = /* @__PURE__ */ c({
|
|
881
|
+
__name: "FpMenuSeparator",
|
|
882
|
+
setup(e) {
|
|
883
|
+
return (e, t) => (m(), n(x(M), { class: "fp-menu-separator" }));
|
|
884
|
+
}
|
|
885
|
+
}), we = [
|
|
718
886
|
"data-orientation",
|
|
719
887
|
"aria-valuemin",
|
|
720
888
|
"aria-valuemax",
|
|
721
889
|
"aria-valuenow",
|
|
722
890
|
"aria-valuetext",
|
|
723
891
|
"aria-labelledby"
|
|
724
|
-
],
|
|
892
|
+
], Te = ["id"], Ee = /* @__PURE__ */ c({
|
|
725
893
|
inheritAttrs: !1,
|
|
726
894
|
__name: "FpMeter",
|
|
727
895
|
props: {
|
|
@@ -737,44 +905,44 @@ var R = Object.keys(L), z = Object.fromEntries(R.map((e) => [e, ie(L[e])])), B =
|
|
|
737
905
|
valueText: {}
|
|
738
906
|
},
|
|
739
907
|
setup(e) {
|
|
740
|
-
let n = e, o =
|
|
908
|
+
let n = e, o = S(), s = t(() => ({
|
|
741
909
|
class: o.class,
|
|
742
910
|
style: o.style
|
|
743
911
|
})), c = t(() => {
|
|
744
912
|
let { class: e, style: t, ...n } = o;
|
|
745
913
|
return n;
|
|
746
|
-
}), l =
|
|
914
|
+
}), l = C(), d = t(() => Math.min(n.max, Math.max(n.min, n.value)));
|
|
747
915
|
function f(e) {
|
|
748
916
|
let t = n.max - n.min;
|
|
749
917
|
return t > 0 ? Math.min(1, Math.max(0, (e - n.min) / t)) : 0;
|
|
750
918
|
}
|
|
751
|
-
function
|
|
919
|
+
function p(e, t) {
|
|
752
920
|
return t(f(e) * n.segments + 1e-9) / n.segments;
|
|
753
921
|
}
|
|
754
922
|
let h = t(() => {
|
|
755
923
|
let e = n.max - n.min;
|
|
756
924
|
return {
|
|
757
|
-
"--fp-meter-level": String(
|
|
925
|
+
"--fp-meter-level": String(p(d.value, Math.floor)),
|
|
758
926
|
"--fp-meter-segments": String(n.segments),
|
|
759
|
-
"--fp-meter-amber": String(
|
|
760
|
-
"--fp-meter-red": String(
|
|
927
|
+
"--fp-meter-amber": String(p(n.amberAt ?? n.min + e * .7, Math.round)),
|
|
928
|
+
"--fp-meter-red": String(p(n.redAt ?? n.min + e * .9, Math.round))
|
|
761
929
|
};
|
|
762
930
|
});
|
|
763
|
-
return (e, t) => (
|
|
764
|
-
class: ["fp-meter", n.lens &&
|
|
931
|
+
return (e, t) => (m(), i("div", u({ class: "fp-unit" }, s.value), [a("div", u(c.value, {
|
|
932
|
+
class: ["fp-meter", n.lens && x(X)[n.lens]],
|
|
765
933
|
role: "meter",
|
|
766
934
|
"data-orientation": n.orientation,
|
|
767
935
|
"aria-valuemin": n.min,
|
|
768
936
|
"aria-valuemax": n.max,
|
|
769
937
|
"aria-valuenow": d.value,
|
|
770
938
|
"aria-valuetext": n.valueText?.(d.value),
|
|
771
|
-
"aria-labelledby": n.label ?
|
|
939
|
+
"aria-labelledby": n.label ? x(l) : void 0,
|
|
772
940
|
style: h.value
|
|
773
|
-
}), null, 16,
|
|
941
|
+
}), null, 16, we), n.label ? (m(), i("span", {
|
|
774
942
|
key: 0,
|
|
775
|
-
id:
|
|
943
|
+
id: x(l),
|
|
776
944
|
class: "fp-silk"
|
|
777
|
-
},
|
|
945
|
+
}, b(n.label), 9, Te)) : r("", !0)], 16));
|
|
778
946
|
}
|
|
779
947
|
}), Z = {
|
|
780
948
|
0: "abcdef",
|
|
@@ -820,10 +988,10 @@ function Q(e) {
|
|
|
820
988
|
}
|
|
821
989
|
//#endregion
|
|
822
990
|
//#region src/FpReadout.vue?vue&type=script&setup=true&lang.ts
|
|
823
|
-
var
|
|
991
|
+
var De = { class: "fp-readout-text" }, Oe = ["data-colon"], ke = { class: "fp-readout-lit" }, Ae = ["data-segment"], je = {
|
|
824
992
|
key: 0,
|
|
825
993
|
"data-segment": "dp"
|
|
826
|
-
},
|
|
994
|
+
}, Me = /* @__PURE__ */ c({
|
|
827
995
|
__name: "FpReadout",
|
|
828
996
|
props: {
|
|
829
997
|
value: {},
|
|
@@ -858,25 +1026,25 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
858
1026
|
dot: !1
|
|
859
1027
|
})), ...e];
|
|
860
1028
|
});
|
|
861
|
-
return (t, n) => (
|
|
1029
|
+
return (t, n) => (m(), i("span", { class: d(["fp-readout", [s[o.color], o.lens && x(X)[o.lens]]]) }, [a("span", De, b(o.valueText ? o.valueText(c.value) : c.value), 1), (m(!0), i(e, null, g(l.value, (t, o) => (m(), i("span", {
|
|
862
1030
|
key: o,
|
|
863
1031
|
class: "fp-readout-cell",
|
|
864
1032
|
"data-colon": t.colon ? "" : void 0,
|
|
865
1033
|
"aria-hidden": "true"
|
|
866
|
-
}, [a("span",
|
|
1034
|
+
}, [a("span", ke, [t.colon ? (m(), i(e, { key: 0 }, [n[0] ||= a("span", { "data-segment": "colon-upper" }, null, -1), n[1] ||= a("span", { "data-segment": "colon-lower" }, null, -1)], 64)) : (m(), i(e, { key: 1 }, [(m(!0), i(e, null, g(t.lit, (e) => (m(), i("span", {
|
|
867
1035
|
key: e,
|
|
868
1036
|
"data-segment": e
|
|
869
|
-
}, null, 8,
|
|
1037
|
+
}, null, 8, Ae))), 128)), t.dot ? (m(), i("span", je)) : r("", !0)], 64))])], 8, Oe))), 128))], 2));
|
|
870
1038
|
}
|
|
871
|
-
}),
|
|
1039
|
+
}), Ne = {
|
|
872
1040
|
class: "fp-screw",
|
|
873
1041
|
"aria-hidden": "true"
|
|
874
|
-
},
|
|
1042
|
+
}, Pe = /* @__PURE__ */ c({
|
|
875
1043
|
__name: "FpScrew",
|
|
876
1044
|
setup(e) {
|
|
877
|
-
return (e, t) => (
|
|
1045
|
+
return (e, t) => (m(), i("span", Ne));
|
|
878
1046
|
}
|
|
879
|
-
}),
|
|
1047
|
+
}), $ = /* @__PURE__ */ c({
|
|
880
1048
|
__name: "FpSilk",
|
|
881
1049
|
props: {
|
|
882
1050
|
asChild: { type: Boolean },
|
|
@@ -884,16 +1052,16 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
884
1052
|
},
|
|
885
1053
|
setup(e) {
|
|
886
1054
|
let t = e;
|
|
887
|
-
return (e, r) => (
|
|
1055
|
+
return (e, r) => (m(), n(x(P), {
|
|
888
1056
|
as: t.as,
|
|
889
1057
|
"as-child": t.asChild,
|
|
890
1058
|
class: "fp-silk"
|
|
891
1059
|
}, {
|
|
892
|
-
default:
|
|
1060
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
893
1061
|
_: 3
|
|
894
1062
|
}, 8, ["as", "as-child"]));
|
|
895
1063
|
}
|
|
896
|
-
}),
|
|
1064
|
+
}), Fe = ["id"], Ie = /* @__PURE__ */ c({
|
|
897
1065
|
inheritAttrs: !1,
|
|
898
1066
|
__name: "FpSlider",
|
|
899
1067
|
props: /*@__PURE__*/ l({
|
|
@@ -910,31 +1078,31 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
910
1078
|
}),
|
|
911
1079
|
emits: /*@__PURE__*/ l(["valueCommit"], ["update:modelValue"]),
|
|
912
1080
|
setup(e, { emit: n }) {
|
|
913
|
-
let a = e, o = n, c =
|
|
1081
|
+
let a = e, o = n, c = w(e, "modelValue"), l = S(), d = t(() => ({
|
|
914
1082
|
class: l.class,
|
|
915
1083
|
style: l.style
|
|
916
1084
|
})), f = t(() => {
|
|
917
1085
|
let { class: e, style: t, ...n } = l;
|
|
918
1086
|
return n;
|
|
919
|
-
}),
|
|
1087
|
+
}), p = C(), h = t(() => [c.value]);
|
|
920
1088
|
function g(e) {
|
|
921
1089
|
e?.[0] !== void 0 && (c.value = e[0]);
|
|
922
1090
|
}
|
|
923
|
-
let _ =
|
|
924
|
-
function
|
|
1091
|
+
let _ = T("unit");
|
|
1092
|
+
function v(e) {
|
|
925
1093
|
a.disabled || e.button !== 0 || _.value?.querySelector("[role=\"slider\"]")?.focus({
|
|
926
1094
|
preventScroll: !0,
|
|
927
1095
|
focusVisible: !1
|
|
928
1096
|
});
|
|
929
1097
|
}
|
|
930
|
-
function
|
|
1098
|
+
function y(e) {
|
|
931
1099
|
e[0] !== void 0 && o("valueCommit", e[0]);
|
|
932
1100
|
}
|
|
933
|
-
return (e, t) => (
|
|
1101
|
+
return (e, t) => (m(), i("div", u({
|
|
934
1102
|
ref_key: "unit",
|
|
935
1103
|
ref: _,
|
|
936
1104
|
class: "fp-unit"
|
|
937
|
-
}, d.value, { onPointerdownCapture:
|
|
1105
|
+
}, d.value, { onPointerdownCapture: v }), [s(x(F), {
|
|
938
1106
|
class: "fp-fader",
|
|
939
1107
|
"model-value": h.value,
|
|
940
1108
|
min: a.min,
|
|
@@ -943,12 +1111,12 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
943
1111
|
orientation: a.orientation,
|
|
944
1112
|
disabled: a.disabled,
|
|
945
1113
|
"onUpdate:modelValue": g,
|
|
946
|
-
onValueCommit:
|
|
1114
|
+
onValueCommit: y
|
|
947
1115
|
}, {
|
|
948
|
-
default:
|
|
1116
|
+
default: O(() => [s(x(te), { class: "fp-fader-slot" }), s(x(I), u(f.value, {
|
|
949
1117
|
class: "fp-fader-cap",
|
|
950
1118
|
"aria-valuetext": a.valueText?.(c.value),
|
|
951
|
-
"aria-labelledby": a.label ?
|
|
1119
|
+
"aria-labelledby": a.label ? x(p) : void 0,
|
|
952
1120
|
"aria-disabled": a.disabled || void 0
|
|
953
1121
|
}), null, 16, [
|
|
954
1122
|
"aria-valuetext",
|
|
@@ -963,13 +1131,70 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
963
1131
|
"step",
|
|
964
1132
|
"orientation",
|
|
965
1133
|
"disabled"
|
|
966
|
-
]), a.label ? (
|
|
1134
|
+
]), a.label ? (m(), i("span", {
|
|
967
1135
|
key: 0,
|
|
968
|
-
id:
|
|
1136
|
+
id: x(p),
|
|
969
1137
|
class: "fp-silk"
|
|
970
|
-
},
|
|
1138
|
+
}, b(a.label), 9, Fe)) : r("", !0)], 16));
|
|
971
1139
|
}
|
|
972
|
-
}),
|
|
1140
|
+
}), Le = ["data-label-placement"], Re = ["id"], ze = /* @__PURE__ */ c({
|
|
1141
|
+
inheritAttrs: !1,
|
|
1142
|
+
__name: "FpSwitch",
|
|
1143
|
+
props: /*@__PURE__*/ l({
|
|
1144
|
+
label: {},
|
|
1145
|
+
labelPlacement: { default: "below" },
|
|
1146
|
+
orientation: { default: "vertical" },
|
|
1147
|
+
color: { default: "red" },
|
|
1148
|
+
disabled: { type: Boolean }
|
|
1149
|
+
}, {
|
|
1150
|
+
modelValue: {
|
|
1151
|
+
type: Boolean,
|
|
1152
|
+
default: !1
|
|
1153
|
+
},
|
|
1154
|
+
modelModifiers: {}
|
|
1155
|
+
}),
|
|
1156
|
+
emits: ["update:modelValue"],
|
|
1157
|
+
setup(e) {
|
|
1158
|
+
let n = e, o = {
|
|
1159
|
+
green: "fp-led-green",
|
|
1160
|
+
amber: "fp-led-amber",
|
|
1161
|
+
red: "fp-led-red"
|
|
1162
|
+
}, c = w(e, "modelValue"), l = C(), d = S(), f = t(() => ({
|
|
1163
|
+
class: d.class,
|
|
1164
|
+
style: d.style
|
|
1165
|
+
})), p = t(() => {
|
|
1166
|
+
let { class: e, style: t, ...n } = d;
|
|
1167
|
+
return n;
|
|
1168
|
+
});
|
|
1169
|
+
return (e, t) => (m(), i("div", u({
|
|
1170
|
+
class: "fp-unit",
|
|
1171
|
+
"data-label-placement": n.labelPlacement
|
|
1172
|
+
}, f.value), [s(x(ne), u(p.value, {
|
|
1173
|
+
modelValue: c.value,
|
|
1174
|
+
"onUpdate:modelValue": t[0] ||= (e) => c.value = e,
|
|
1175
|
+
class: ["fp-switch", o[n.color]],
|
|
1176
|
+
"data-orientation": n.orientation,
|
|
1177
|
+
disabled: n.disabled,
|
|
1178
|
+
"aria-labelledby": n.label ? x(l) : void 0
|
|
1179
|
+
}), {
|
|
1180
|
+
default: O(() => [s(x(re), { class: "fp-switch-rocker" }, {
|
|
1181
|
+
default: O(() => [...t[1] ||= [a("span", { class: "fp-switch-lamp" }, null, -1), a("span", { class: "fp-switch-face" }, null, -1)]]),
|
|
1182
|
+
_: 1
|
|
1183
|
+
})]),
|
|
1184
|
+
_: 1
|
|
1185
|
+
}, 16, [
|
|
1186
|
+
"modelValue",
|
|
1187
|
+
"class",
|
|
1188
|
+
"data-orientation",
|
|
1189
|
+
"disabled",
|
|
1190
|
+
"aria-labelledby"
|
|
1191
|
+
]), n.label ? (m(), i("span", {
|
|
1192
|
+
key: 0,
|
|
1193
|
+
id: x(l),
|
|
1194
|
+
class: "fp-silk"
|
|
1195
|
+
}, b(n.label), 9, Re)) : r("", !0)], 16, Le));
|
|
1196
|
+
}
|
|
1197
|
+
}), Be = /* @__PURE__ */ c({
|
|
973
1198
|
__name: "FpWell",
|
|
974
1199
|
props: {
|
|
975
1200
|
asChild: { type: Boolean },
|
|
@@ -977,16 +1202,16 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
977
1202
|
},
|
|
978
1203
|
setup(e) {
|
|
979
1204
|
let t = e;
|
|
980
|
-
return (e, r) => (
|
|
1205
|
+
return (e, r) => (m(), n(x(P), {
|
|
981
1206
|
as: t.as,
|
|
982
1207
|
"as-child": t.asChild,
|
|
983
1208
|
class: "fp-well"
|
|
984
1209
|
}, {
|
|
985
|
-
default:
|
|
1210
|
+
default: O(() => [_(e.$slots, "default")]),
|
|
986
1211
|
_: 3
|
|
987
1212
|
}, 8, ["as", "as-child"]));
|
|
988
1213
|
}
|
|
989
|
-
}),
|
|
1214
|
+
}), Ve = { class: "fp-module-title" }, He = /* @__PURE__ */ c({
|
|
990
1215
|
__name: "FpWindow",
|
|
991
1216
|
props: {
|
|
992
1217
|
as: { default: "section" },
|
|
@@ -999,30 +1224,30 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
999
1224
|
},
|
|
1000
1225
|
emits: ["close"],
|
|
1001
1226
|
setup(e, { emit: t }) {
|
|
1002
|
-
let i = e, c = t, l =
|
|
1003
|
-
return (e, t) => (
|
|
1227
|
+
let i = e, c = t, l = C();
|
|
1228
|
+
return (e, t) => (m(), n(x(P), {
|
|
1004
1229
|
as: i.as,
|
|
1005
1230
|
class: d(["fp-window", [i.sheet ? "fp-sheet-panel" : "fp-module"]]),
|
|
1006
|
-
"aria-labelledby":
|
|
1231
|
+
"aria-labelledby": x(l)
|
|
1007
1232
|
}, {
|
|
1008
|
-
default:
|
|
1009
|
-
(
|
|
1010
|
-
id:
|
|
1233
|
+
default: O(() => [a("div", Ve, [
|
|
1234
|
+
(m(), n(v(`h${i.level}`), {
|
|
1235
|
+
id: x(l),
|
|
1011
1236
|
class: "fp-silk fp-window-title"
|
|
1012
1237
|
}, {
|
|
1013
|
-
default:
|
|
1238
|
+
default: O(() => [o(b(i.title), 1)]),
|
|
1014
1239
|
_: 1
|
|
1015
1240
|
}, 8, ["id"])),
|
|
1016
|
-
|
|
1017
|
-
i.closable ? (
|
|
1241
|
+
_(e.$slots, "actions"),
|
|
1242
|
+
i.closable ? (m(), n(L, {
|
|
1018
1243
|
key: 0,
|
|
1019
1244
|
"aria-label": i.closeLabel ?? `Close ${i.title}`,
|
|
1020
1245
|
onClick: t[0] ||= (e) => c("close")
|
|
1021
1246
|
}, {
|
|
1022
|
-
default:
|
|
1247
|
+
default: O(() => [s(J, { name: "close" })]),
|
|
1023
1248
|
_: 1
|
|
1024
1249
|
}, 8, ["aria-label"])) : r("", !0)
|
|
1025
|
-
]), a("div", { class: d(i.flush ? void 0 : "fp-window-body") }, [
|
|
1250
|
+
]), a("div", { class: d(i.flush ? void 0 : "fp-window-body") }, [_(e.$slots, "default")], 2)]),
|
|
1026
1251
|
_: 3
|
|
1027
1252
|
}, 8, [
|
|
1028
1253
|
"as",
|
|
@@ -1032,4 +1257,4 @@ var pe = { class: "fp-readout-text" }, me = ["data-colon"], he = { class: "fp-re
|
|
|
1032
1257
|
}
|
|
1033
1258
|
});
|
|
1034
1259
|
//#endregion
|
|
1035
|
-
export {
|
|
1260
|
+
export { L as FpButton, ie as FpButtonGroup, ae as FpCap, z as FpDevice, B as FpGelButton, V as FpHousing, J as FpIcon, me as FpKnob, he as FpLcd, ve as FpLcdLine, be as FpLed, xe as FpMenu, Se as FpMenuItem, Ce as FpMenuSeparator, Ee as FpMeter, Me as FpReadout, Pe as FpScrew, $ as FpSilk, Ie as FpSlider, ze as FpSwitch, Be as FpWell, He as FpWindow, q as fpIconNames, Q as fpReadoutGlyph };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontpanel/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.4.0",
|
|
5
5
|
"description": "Vue 3 components for the Frontpanel early-2000s hardware skin: a scale-to-fit device frame, windows, chrome and gel buttons, caps, LCDs and LEDs, built on Reka UI.",
|
|
6
6
|
"author": "Dulan Katukurundage",
|
|
7
7
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"reka-ui": "^2.11.0",
|
|
39
|
-
"@frontpanel/css": "^0.
|
|
39
|
+
"@frontpanel/css": "^0.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@tailwindcss/oxide": "^4.3.3",
|