@stonecrop/beam 0.4.1 → 0.4.3
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/dist/assets/index.css +1 -1
- package/dist/beam.d.ts +3 -0
- package/dist/beam.js +561 -540
- package/dist/beam.js.map +1 -1
- package/dist/beam.umd.cjs +7 -7
- package/dist/beam.umd.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/types/index.d.ts +7 -0
- package/dist/src/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/components/SegmentedDisplay.vue +52 -0
- package/src/index.ts +3 -0
- package/src/types/index.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ import ListItem from './components/ListItem.vue';
|
|
|
18
18
|
import ListView from './components/ListView.vue';
|
|
19
19
|
import Navbar from './components/Navbar.vue';
|
|
20
20
|
import ScanInput from './components/ScanInput.vue';
|
|
21
|
+
import SegmentedDisplay from './components/SegmentedDisplay.vue';
|
|
21
22
|
import SplitColumn from './components/SplitColumn.vue';
|
|
22
23
|
import ToggleArrow from './components/ToggleArrow.vue';
|
|
23
24
|
import { useMqttStream } from './composables/mqtt';
|
|
@@ -48,7 +49,8 @@ function install(app /* options */) {
|
|
|
48
49
|
app.component('ListView', ListView);
|
|
49
50
|
app.component('Navbar', Navbar);
|
|
50
51
|
app.component('ScanInput', ScanInput);
|
|
52
|
+
app.component('SegmentedDisplay', SegmentedDisplay);
|
|
51
53
|
app.component('SplitColumn', SplitColumn);
|
|
52
54
|
app.component('ToggleArrow', ToggleArrow);
|
|
53
55
|
}
|
|
54
|
-
export { ActionFooter, BeamArrow, BeamBtn, BeamDayDivider, BeamFilter, BeamFilterOption, BeamHeading, BeamMetadata, BeamModal, BeamModalOutlet, BeamProgress, Confirm, FixedTop, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, SplitColumn, ToggleArrow, install, useMqttStream, };
|
|
56
|
+
export { ActionFooter, BeamArrow, BeamBtn, BeamDayDivider, BeamFilter, BeamFilterOption, BeamHeading, BeamMetadata, BeamModal, BeamModalOutlet, BeamProgress, Confirm, FixedTop, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, SegmentedDisplay, SplitColumn, ToggleArrow, install, useMqttStream, };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import ListItem from './components/ListItem.vue';
|
|
|
19
19
|
import ListView from './components/ListView.vue';
|
|
20
20
|
import Navbar from './components/Navbar.vue';
|
|
21
21
|
import ScanInput from './components/ScanInput.vue';
|
|
22
|
+
import SegmentedDisplay from './components/SegmentedDisplay.vue';
|
|
22
23
|
import SplitColumn from './components/SplitColumn.vue';
|
|
23
24
|
import ToggleArrow from './components/ToggleArrow.vue';
|
|
24
25
|
import { useMqttStream } from './composables/mqtt';
|
|
@@ -30,5 +31,5 @@ import '../themes/beam.css';
|
|
|
30
31
|
* @public
|
|
31
32
|
*/
|
|
32
33
|
declare function install(app: App): void;
|
|
33
|
-
export { ActionFooter, BeamArrow, BeamBtn, BeamDayDivider, BeamFilter, BeamFilterOption, BeamHeading, BeamMetadata, BeamModal, BeamModalOutlet, BeamProgress, Confirm, FixedTop, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, SplitColumn, ToggleArrow, install, useMqttStream, };
|
|
34
|
+
export { ActionFooter, BeamArrow, BeamBtn, BeamDayDivider, BeamFilter, BeamFilterOption, BeamHeading, BeamMetadata, BeamModal, BeamModalOutlet, BeamProgress, Confirm, FixedTop, ItemCheck, ItemCount, ListAnchor, ListItem, ListView, Navbar, ScanInput, SegmentedDisplay, SplitColumn, ToggleArrow, install, useMqttStream, };
|
|
34
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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Z,SAAS,EACT,eAAe,EACf,YAAY,EACZ,OAAO,EACP,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,OAAO,EACP,aAAa,GACb,CAAA"}
|
|
@@ -17,6 +17,12 @@ export type ListViewItem = {
|
|
|
17
17
|
linkComponent?: string;
|
|
18
18
|
route?: string;
|
|
19
19
|
};
|
|
20
|
+
type RGB = `rgb(${number}, ${number}, ${number})`;
|
|
21
|
+
type HSL = `hsl(${number}, ${number}%, ${number}%)`;
|
|
22
|
+
type HSLA = `hsl(${number}, ${number}%, ${number}%), ${number}`;
|
|
23
|
+
type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
|
|
24
|
+
type HEX = `#${string}`;
|
|
25
|
+
export type Color = RGB | RGBA | HEX | HSL | HSLA | string;
|
|
20
26
|
/**
|
|
21
27
|
* MQTT stream options
|
|
22
28
|
* @public
|
|
@@ -24,4 +30,5 @@ export type ListViewItem = {
|
|
|
24
30
|
export interface IMqttStream extends IClientOptions {
|
|
25
31
|
topics?: string[];
|
|
26
32
|
}
|
|
33
|
+
export {};
|
|
27
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,MAAM,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,MAAM,CAAA;IAEb,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,KAAK,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAA;QACb,EAAE,EAAE,MAAM,CAAA;QACV,GAAG,EAAE,MAAM,CAAA;KACX,CAAA;IACD,IAAI,CAAC,EAAE,MAA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AK,GAAG,GAAG,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,IAAI,GAAG,MAAM,CAAA;AAC1D;;;GAGG;AACH,MAAM,WAAW,WAAY,SAAQ,cAAc;IAClD,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CACjB"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="segmented-display" :style="{ background: getColor(displayColor) }">
|
|
3
|
+
<h1 class="segmented-display-output" :style="{ color: getColor(textColor) }">{{ getOutput }}</h1>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
<script setup lang="ts">
|
|
7
|
+
import { ref, defineProps, computed } from 'vue'
|
|
8
|
+
|
|
9
|
+
const {
|
|
10
|
+
displayInput = 120.2568,
|
|
11
|
+
decimalPlaces = 2,
|
|
12
|
+
displayColor = 'gray',
|
|
13
|
+
textColor = 'white',
|
|
14
|
+
} = defineProps<{
|
|
15
|
+
displayInput?: number
|
|
16
|
+
decimalPlaces?: number
|
|
17
|
+
displayColor?: Color
|
|
18
|
+
textColor?: Color
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const getOutput = computed(() => {
|
|
22
|
+
if (displayInput.length == 0) return Number(0).toFixed(decimalPlaces)
|
|
23
|
+
return displayInput.toFixed(decimalPlaces)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
const getColor = color => {
|
|
27
|
+
return color.substr(0, 2) == '--' ? `var(${color})` : color
|
|
28
|
+
}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.segmented-display {
|
|
33
|
+
width: 100%;
|
|
34
|
+
padding: 1rem;
|
|
35
|
+
box-sizing: border-box;
|
|
36
|
+
display: flex;
|
|
37
|
+
background: var(--sc-segmented-display-background);
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: flex-end;
|
|
40
|
+
}
|
|
41
|
+
.segmented-display-output {
|
|
42
|
+
text-align: right;
|
|
43
|
+
font-family: Segment7, Arimo, sans-serif;
|
|
44
|
+
font-weight: normal;
|
|
45
|
+
font-size: var(--sc-segemented-display-font-size);
|
|
46
|
+
padding: 0;
|
|
47
|
+
margin: 0;
|
|
48
|
+
letter-spacing: 0.3rem;
|
|
49
|
+
margin-bottom: -0.7rem;
|
|
50
|
+
color: var(--sc-segmented-display-color);
|
|
51
|
+
}
|
|
52
|
+
</style>
|
package/src/index.ts
CHANGED
|
@@ -20,6 +20,7 @@ import ListItem from './components/ListItem.vue'
|
|
|
20
20
|
import ListView from './components/ListView.vue'
|
|
21
21
|
import Navbar from './components/Navbar.vue'
|
|
22
22
|
import ScanInput from './components/ScanInput.vue'
|
|
23
|
+
import SegmentedDisplay from './components/SegmentedDisplay.vue'
|
|
23
24
|
import SplitColumn from './components/SplitColumn.vue'
|
|
24
25
|
import ToggleArrow from './components/ToggleArrow.vue'
|
|
25
26
|
import { useMqttStream } from './composables/mqtt'
|
|
@@ -52,6 +53,7 @@ function install(app: App /* options */) {
|
|
|
52
53
|
app.component('ListView', ListView)
|
|
53
54
|
app.component('Navbar', Navbar)
|
|
54
55
|
app.component('ScanInput', ScanInput)
|
|
56
|
+
app.component('SegmentedDisplay', SegmentedDisplay)
|
|
55
57
|
app.component('SplitColumn', SplitColumn)
|
|
56
58
|
app.component('ToggleArrow', ToggleArrow)
|
|
57
59
|
}
|
|
@@ -77,6 +79,7 @@ export {
|
|
|
77
79
|
ListView,
|
|
78
80
|
Navbar,
|
|
79
81
|
ScanInput,
|
|
82
|
+
SegmentedDisplay,
|
|
80
83
|
SplitColumn,
|
|
81
84
|
ToggleArrow,
|
|
82
85
|
install,
|
package/src/types/index.ts
CHANGED
|
@@ -20,6 +20,13 @@ export type ListViewItem = {
|
|
|
20
20
|
route?: string
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
type RGB = `rgb(${number}, ${number}, ${number})`
|
|
24
|
+
type HSL = `hsl(${number}, ${number}%, ${number}%)`
|
|
25
|
+
type HSLA = `hsl(${number}, ${number}%, ${number}%), ${number}`
|
|
26
|
+
type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`
|
|
27
|
+
type HEX = `#${string}`
|
|
28
|
+
|
|
29
|
+
export type Color = RGB | RGBA | HEX | HSL | HSLA | string
|
|
23
30
|
/**
|
|
24
31
|
* MQTT stream options
|
|
25
32
|
* @public
|