vue-pane 0.0.0 → 0.7.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 +13 -374
- package/dist/src/components/PCheckbox.vue.d.ts +6 -3
- package/dist/src/components/PColor.vue.d.ts +6 -3
- package/dist/src/components/PGraph.vue.d.ts +4 -1
- package/dist/src/components/PMonitor.vue.d.ts +3 -1
- package/dist/src/components/{PMonitorMulti.vue.d.ts → PMonitorMultiline.vue.d.ts} +3 -1
- package/dist/src/components/PNumber.vue.d.ts +6 -3
- package/dist/src/components/PPoint2d.vue.d.ts +9 -3
- package/dist/src/components/PSelect.vue.d.ts +6 -3
- package/dist/src/components/PSlider.vue.d.ts +6 -3
- package/dist/src/components/PText.vue.d.ts +6 -3
- package/dist/src/composables/pollingRef.d.ts +9 -0
- package/dist/src/composables/useFoldable.d.ts +4 -1
- package/dist/src/composables/usePolling.d.ts +4 -0
- package/dist/src/index.d.ts +13 -11
- package/dist/vue-pane.css +1 -1
- package/dist/vue-pane.js +1334 -1206
- package/dist/vue-pane.umd.cjs +1 -1
- package/package.json +13 -13
- package/src/components/PButton.vue +1 -1
- package/src/components/PCheckbox.vue +18 -3
- package/src/components/PColor.vue +18 -3
- package/src/components/PFolder.vue +6 -4
- package/src/components/PGraph.vue +31 -7
- package/src/components/PMonitor.vue +15 -2
- package/src/components/PMonitorMultiline.vue +43 -0
- package/src/components/PNumber.vue +12 -2
- package/src/components/PPoint2d.vue +19 -3
- package/src/components/PSelect.vue +18 -3
- package/src/components/PSlider.vue +16 -3
- package/src/components/PText.vue +14 -2
- package/src/components/VPane.vue +4 -2
- package/src/composables/pollingRef.ts +66 -0
- package/src/composables/useFoldable.ts +13 -2
- package/src/composables/usePickerFold.ts +1 -1
- package/src/composables/usePolling.ts +41 -0
- package/src/composables/useTooltip.ts +1 -1
- package/src/index.ts +17 -11
- package/src/styles/common/_defs.scss +35 -35
- package/src/styles/view/_button.scss +8 -7
- package/src/styles/view/_checkbox.scss +65 -50
- package/src/styles/view/_color.scss +78 -53
- package/src/styles/view/_folder.scss +78 -66
- package/src/styles/view/_graph.scss +17 -7
- package/src/styles/view/_label.scss +35 -31
- package/src/styles/view/_list.scss +20 -10
- package/src/styles/view/_log.scss +9 -8
- package/src/styles/view/_monitor-multi.scss +14 -13
- package/src/styles/view/_number.scss +109 -99
- package/src/styles/view/_point-2d.scss +99 -56
- package/src/styles/view/_root.scss +130 -114
- package/src/styles/view/_separator.scss +12 -11
- package/src/styles/view/_slider.scss +75 -27
- package/src/styles/view/_tab.scss +137 -129
- package/src/styles/view/_text.scss +26 -18
- package/src/styles/view/_tooltip.scss +13 -13
- package/src/styles/view/placeholder/_button.scss +26 -23
- package/src/styles/view/placeholder/_container.scss +60 -60
- package/src/styles/view/placeholder/_folder.scss +79 -79
- package/src/styles/view/placeholder/_input.scss +24 -21
- package/src/styles/view/placeholder/_list.scss +22 -22
- package/src/styles/view/placeholder/_monitor.scss +23 -21
- package/src/styles/view/placeholder/_texts.scss +5 -5
- package/src/styles/view/placeholder/_theme.scss +94 -94
- package/src/vite-env.d.ts +1 -0
- package/src/components/PMonitorMulti.vue +0 -30
package/README.md
CHANGED
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
Compact debug panel components for Vue 3. A spiritual replacement for [Tweakpane](https://tweakpane.github.io/docs/) — same visual style, Vue-native API.
|
|
4
4
|
|
|
5
|
+
**[Documentation](https://unstoppablecarl.github.io/vue-pane/)**
|
|
6
|
+
|
|
5
7
|
## Features
|
|
6
8
|
|
|
7
9
|
- Inputs: text, number (drag-to-change), slider, checkbox, select, color picker, 2D point
|
|
8
|
-
- Display: single-line monitor,
|
|
10
|
+
- Display: single-line monitor, multiline monitor, graph/sparkline
|
|
9
11
|
- Layout: collapsible pane, collapsible folders, tabs, separator
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- TypeScript throughout
|
|
12
|
+
- Pane and folder state persisted to `localStorage` via the `id` prop
|
|
13
|
+
- Polling: `pollingRef` reads plain (non-reactive) JS objects on an interval — pauses automatically when the pane is collapsed
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -25,10 +26,10 @@ import 'vue-pane/dist/vue-pane.css'
|
|
|
25
26
|
|
|
26
27
|
### Nuxt / source-first bundlers
|
|
27
28
|
|
|
28
|
-
The package exposes a `"source"` export condition pointing at the raw `.vue` and `.scss` files. Bundlers that understand this condition (Nuxt, Vite with explicit `resolve.conditions: ['source']`) will process the source directly — no CSS import needed
|
|
29
|
+
The package exposes a `"source"` export condition pointing at the raw `.vue` and `.scss` files. Bundlers that understand this condition (Nuxt, Vite with explicit `resolve.conditions: ['source']`) will process the source directly — no CSS import needed.
|
|
29
30
|
|
|
30
31
|
```ts
|
|
31
|
-
// vite.config.ts
|
|
32
|
+
// vite.config.ts
|
|
32
33
|
export default defineConfig({
|
|
33
34
|
resolve: { conditions: ['source'] },
|
|
34
35
|
})
|
|
@@ -37,9 +38,9 @@ export default defineConfig({
|
|
|
37
38
|
## Quick start
|
|
38
39
|
|
|
39
40
|
```vue
|
|
40
|
-
<script setup
|
|
41
|
+
<script setup>
|
|
41
42
|
import { ref } from 'vue'
|
|
42
|
-
import { VPane,
|
|
43
|
+
import { VPane, PNumber, PCheckbox, PMonitor, pollingRef } from 'vue-pane'
|
|
43
44
|
|
|
44
45
|
const speed = ref(1)
|
|
45
46
|
const enabled = ref(true)
|
|
@@ -47,376 +48,14 @@ const enabled = ref(true)
|
|
|
47
48
|
|
|
48
49
|
<template>
|
|
49
50
|
<VPane title="Controls" style="width: 280px">
|
|
50
|
-
<
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
<VPFolder title="Advanced" name="advanced">
|
|
55
|
-
<VPNumber v-model="speed" label="Fine" :step="0.01" />
|
|
56
|
-
</VPFolder>
|
|
51
|
+
<PNumber v-model="speed" label="Speed" :min="0" :max="10" :step="0.1" />
|
|
52
|
+
<PCheckbox v-model="enabled" label="Enabled" />
|
|
53
|
+
<PMonitor :value="speed" label="Speed" />
|
|
57
54
|
</VPane>
|
|
58
55
|
</template>
|
|
59
56
|
```
|
|
60
57
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
## Component reference
|
|
64
|
-
|
|
65
|
-
### `VPane`
|
|
66
|
-
|
|
67
|
-
Root container. Applies theming (font, colors, shadow, border-radius) to all children.
|
|
68
|
-
|
|
69
|
-
```vue
|
|
70
|
-
<VPane title="My Panel" :expanded="true" style="width: 300px">
|
|
71
|
-
<!-- components -->
|
|
72
|
-
</VPane>
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
| Prop | Type | Default | Description |
|
|
76
|
-
|---|---|---|---|
|
|
77
|
-
| `title` | `string` | — | Title text. If omitted the header button is hidden and the pane is always open. |
|
|
78
|
-
| `expanded` | `boolean` | `true` | Initial open/closed state. Only applies when `title` is set. |
|
|
79
|
-
| `disabled` | `boolean` | — | Applies `vp--disabled` — disables pointer events. |
|
|
80
|
-
| `hidden` | `boolean` | — | Applies `vp--hidden` — `display: none`. |
|
|
81
|
-
|
|
82
|
-
---
|
|
83
|
-
|
|
84
|
-
### `VPFolder`
|
|
85
|
-
|
|
86
|
-
Collapsible folder. Expanded state is saved to `localStorage` when `name` is provided.
|
|
87
|
-
|
|
88
|
-
```vue
|
|
89
|
-
<VPFolder title="Transform" name="transform">
|
|
90
|
-
<!-- components -->
|
|
91
|
-
</VPFolder>
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
| Prop | Type | Default | Description |
|
|
95
|
-
|---|---|---|---|
|
|
96
|
-
| `title` | `string` | **required** | Folder title. |
|
|
97
|
-
| `name` | `string` | — | localStorage key (`vp-folder-{name}`). Without it, state is not persisted. |
|
|
98
|
-
| `expanded` | `boolean` | `true` | Initial open/closed state (overridden by localStorage when `name` is set). |
|
|
99
|
-
| `disabled` | `boolean` | — | Disables pointer events on the folder. |
|
|
100
|
-
| `hidden` | `boolean` | — | Hides the folder. |
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
### `VPText`
|
|
105
|
-
|
|
106
|
-
Plain text input.
|
|
107
|
-
|
|
108
|
-
```vue
|
|
109
|
-
<VPText v-model="name" label="Name" />
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
| Prop | Type | Description |
|
|
113
|
-
|---|---|---|
|
|
114
|
-
| `modelValue` | `string` | **required** |
|
|
115
|
-
| `label` | `string` | Label text. Omit for full-width input. |
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
### `VPNumber`
|
|
120
|
-
|
|
121
|
-
Number input with a drag-to-change knob on the left edge. Keyboard: `↑`/`↓` steps by `step`; `Shift+↑`/`↓` steps by `step × 10`.
|
|
122
|
-
|
|
123
|
-
```vue
|
|
124
|
-
<VPNumber v-model="count" label="Count" :min="0" :max="100" :step="1" />
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
| Prop | Type | Default | Description |
|
|
128
|
-
|---|---|---|---|
|
|
129
|
-
| `modelValue` | `number` | **required** | |
|
|
130
|
-
| `label` | `string` | — | |
|
|
131
|
-
| `min` | `number` | — | Clamp minimum. |
|
|
132
|
-
| `max` | `number` | — | Clamp maximum. |
|
|
133
|
-
| `step` | `number` | `1` | Drag and arrow key increment. |
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### `VPSlider`
|
|
138
|
-
|
|
139
|
-
Horizontal track-and-knob slider.
|
|
140
|
-
|
|
141
|
-
```vue
|
|
142
|
-
<VPSlider v-model="opacity" label="Opacity" :min="0" :max="1" :step="0.01" />
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
| Prop | Type | Default | Description |
|
|
146
|
-
|---|---|---|---|
|
|
147
|
-
| `modelValue` | `number` | **required** | |
|
|
148
|
-
| `label` | `string` | — | |
|
|
149
|
-
| `min` | `number` | `0` | |
|
|
150
|
-
| `max` | `number` | `1` | |
|
|
151
|
-
| `step` | `number` | `0.01` | |
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
### `VPCheckbox`
|
|
156
|
-
|
|
157
|
-
Boolean toggle.
|
|
158
|
-
|
|
159
|
-
```vue
|
|
160
|
-
<VPCheckbox v-model="visible" label="Visible" />
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
| Prop | Type | Description |
|
|
164
|
-
|---|---|---|
|
|
165
|
-
| `modelValue` | `boolean` | **required** |
|
|
166
|
-
| `label` | `string` | |
|
|
167
|
-
|
|
168
|
-
---
|
|
169
|
-
|
|
170
|
-
### `VPSelect`
|
|
171
|
-
|
|
172
|
-
Dropdown list.
|
|
173
|
-
|
|
174
|
-
```vue
|
|
175
|
-
<VPSelect v-model="mode" :options="options" label="Mode" />
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
```ts
|
|
179
|
-
const options = [
|
|
180
|
-
{ value: 'linear', label: 'Linear' },
|
|
181
|
-
{ value: 'ease', label: 'Ease' },
|
|
182
|
-
]
|
|
183
|
-
```
|
|
184
|
-
|
|
185
|
-
| Prop | Type | Description |
|
|
186
|
-
|---|---|---|
|
|
187
|
-
| `modelValue` | `string \| number` | **required** |
|
|
188
|
-
| `options` | `{ value: string \| number; label: string }[]` | **required** |
|
|
189
|
-
| `label` | `string` | |
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
### `VPColor`
|
|
194
|
-
|
|
195
|
-
Color picker. Clicking the swatch opens an inline HSV palette with a hue slider and RGB inputs.
|
|
196
|
-
|
|
197
|
-
```vue
|
|
198
|
-
<VPColor v-model="fill" label="Fill" />
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
| Prop | Type | Default | Description |
|
|
202
|
-
|---|---|---|---|
|
|
203
|
-
| `modelValue` | `string` | **required** | Hex color string, e.g. `#ff5500`. |
|
|
204
|
-
| `label` | `string` | — | |
|
|
205
|
-
| `alpha` | `boolean` | `false` | Show alpha channel controls. |
|
|
206
|
-
|
|
207
|
-
---
|
|
208
|
-
|
|
209
|
-
### `VPPoint2d`
|
|
210
|
-
|
|
211
|
-
Two-axis coordinate input. Click the crosshair button to open an interactive 2D canvas picker.
|
|
212
|
-
|
|
213
|
-
```vue
|
|
214
|
-
<VPPoint2d v-model="position" label="Position" :min="-1" :max="1" />
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
| Prop | Type | Default | Description |
|
|
218
|
-
|---|---|---|---|
|
|
219
|
-
| `modelValue` | `{ x: number; y: number }` | **required** | |
|
|
220
|
-
| `label` | `string` | — | |
|
|
221
|
-
| `min` | `number` | `-1` | Range minimum for both axes. |
|
|
222
|
-
| `max` | `number` | `1` | Range maximum for both axes. |
|
|
223
|
-
|
|
224
|
-
---
|
|
225
|
-
|
|
226
|
-
### `VPButton`
|
|
227
|
-
|
|
228
|
-
Clickable action button.
|
|
229
|
-
|
|
230
|
-
```vue
|
|
231
|
-
<VPButton label="Apply" @click="apply" />
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
| Prop | Type | Description |
|
|
235
|
-
|---|---|---|
|
|
236
|
-
| `label` | `string` | **required** |
|
|
237
|
-
|
|
238
|
-
| Event | Description |
|
|
239
|
-
|---|---|
|
|
240
|
-
| `click` | Emitted on button press. |
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
### `VPSeparator`
|
|
245
|
-
|
|
246
|
-
Horizontal rule for visual grouping.
|
|
247
|
-
|
|
248
|
-
```vue
|
|
249
|
-
<VPSeparator />
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
---
|
|
253
|
-
|
|
254
|
-
### `VPTab`
|
|
255
|
-
|
|
256
|
-
Tab container with named slots per tab. Slot names match the strings in the `tabs` array.
|
|
257
|
-
|
|
258
|
-
```vue
|
|
259
|
-
<VPTab :tabs="['Settings', 'Info']" v-model="activeTab">
|
|
260
|
-
<template #Settings>
|
|
261
|
-
<VPNumber v-model="speed" label="Speed" />
|
|
262
|
-
</template>
|
|
263
|
-
<template #Info>
|
|
264
|
-
<VPMonitor :value="speed" label="Speed" />
|
|
265
|
-
</template>
|
|
266
|
-
</VPTab>
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
| Prop | Type | Default | Description |
|
|
270
|
-
|---|---|---|---|
|
|
271
|
-
| `tabs` | `string[]` | **required** | Tab labels (also the slot names). |
|
|
272
|
-
| `modelValue` | `number` | `0` | Active tab index. |
|
|
273
|
-
|
|
274
|
-
---
|
|
275
|
-
|
|
276
|
-
### `VPMonitor`
|
|
277
|
-
|
|
278
|
-
Read-only single-line display.
|
|
279
|
-
|
|
280
|
-
```vue
|
|
281
|
-
<VPMonitor :value="fps" label="FPS" />
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
| Prop | Type | Description |
|
|
285
|
-
|---|---|---|
|
|
286
|
-
| `value` | `unknown` | **required** — rendered with `{{ value }}`. |
|
|
287
|
-
| `label` | `string` | |
|
|
288
|
-
|
|
289
|
-
---
|
|
290
|
-
|
|
291
|
-
### `VPMonitorMulti`
|
|
292
|
-
|
|
293
|
-
Read-only multi-line display (3 rows).
|
|
294
|
-
|
|
295
|
-
```vue
|
|
296
|
-
<VPMonitorMulti :value="`x: ${pos.x}\ny: ${pos.y}`" label="Position" />
|
|
297
|
-
```
|
|
298
|
-
|
|
299
|
-
| Prop | Type | Description |
|
|
300
|
-
|---|---|---|
|
|
301
|
-
| `value` | `unknown` | Rendered verbatim. Use `\n` for line breaks. |
|
|
302
|
-
| `label` | `string` | |
|
|
303
|
-
|
|
304
|
-
---
|
|
305
|
-
|
|
306
|
-
### `VPGraph`
|
|
307
|
-
|
|
308
|
-
Sparkline chart. Pass a rolling array of numbers; the component normalises the range automatically.
|
|
309
|
-
|
|
310
|
-
```vue
|
|
311
|
-
<VPGraph :values="history" label="FPS" />
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
| Prop | Type | Description |
|
|
315
|
-
|---|---|---|
|
|
316
|
-
| `values` | `number[]` | **required** |
|
|
317
|
-
| `label` | `string` | |
|
|
318
|
-
| `min` | `number` | Auto from data. |
|
|
319
|
-
| `max` | `number` | Auto from data. |
|
|
320
|
-
|
|
321
|
-
---
|
|
322
|
-
|
|
323
|
-
### `VPLabel`
|
|
324
|
-
|
|
325
|
-
Layout primitive that pairs a label with any arbitrary content. Used internally by all inputs — available for custom components.
|
|
326
|
-
|
|
327
|
-
```vue
|
|
328
|
-
<VPLabel label="Custom">
|
|
329
|
-
<MyWidget />
|
|
330
|
-
</VPLabel>
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
| Prop | Type | Description |
|
|
334
|
-
|---|---|---|
|
|
335
|
-
| `label` | `string` | Omit for full-width (no-label) layout. |
|
|
336
|
-
|
|
337
|
-
---
|
|
338
|
-
|
|
339
|
-
## Theming
|
|
340
|
-
|
|
341
|
-
Override the default dark theme by setting CSS custom properties on any ancestor element (or `:root`).
|
|
342
|
-
|
|
343
|
-
```css
|
|
344
|
-
.my-app {
|
|
345
|
-
--vp-base-background-color: #1e1e2e;
|
|
346
|
-
--vp-container-foreground-color: #cdd6f4;
|
|
347
|
-
--vp-input-background-color: rgba(205, 214, 244, 0.06);
|
|
348
|
-
--vp-blade-value-width: 180px;
|
|
349
|
-
--vp-container-unit-size: 22px;
|
|
350
|
-
}
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
### Full variable reference
|
|
354
|
-
|
|
355
|
-
| Variable | Default | Description |
|
|
356
|
-
|---|---|---|
|
|
357
|
-
| `--vp-base-background-color` | `#28292e` | Pane background |
|
|
358
|
-
| `--vp-base-border-radius` | `6px` | Pane corner radius |
|
|
359
|
-
| `--vp-base-font-family` | `Roboto Mono, monospace` | Font stack |
|
|
360
|
-
| `--vp-base-shadow-color` | `rgba(0,0,0,0.2)` | Drop shadow |
|
|
361
|
-
| `--vp-blade-border-radius` | `2px` | Input element corner radius |
|
|
362
|
-
| `--vp-blade-horizontal-padding` | `4px` | Input horizontal padding |
|
|
363
|
-
| `--vp-blade-value-width` | `160px` | Width of the value column |
|
|
364
|
-
| `--vp-button-background-color` | `#adafb8` | Button fill |
|
|
365
|
-
| `--vp-button-foreground-color` | `#28292e` | Button text |
|
|
366
|
-
| `--vp-container-background-color` | `rgba(...)` | Folder/tab header fill |
|
|
367
|
-
| `--vp-container-foreground-color` | `#bbbcc4` | Folder/tab header text |
|
|
368
|
-
| `--vp-container-unit-size` | `20px` | Row height |
|
|
369
|
-
| `--vp-container-unit-spacing` | `4px` | Gap between rows |
|
|
370
|
-
| `--vp-container-vertical-padding` | `4px` | Folder content top/bottom padding |
|
|
371
|
-
| `--vp-input-background-color` | `rgba(...)` | Input fill |
|
|
372
|
-
| `--vp-input-foreground-color` | `#bbbcc4` | Input text |
|
|
373
|
-
| `--vp-label-foreground-color` | `rgba(...)` | Label text (slightly dimmed) |
|
|
374
|
-
| `--vp-monitor-background-color` | `rgba(...)` | Monitor/display fill |
|
|
375
|
-
| `--vp-monitor-foreground-color` | `rgba(...)` | Monitor text |
|
|
376
|
-
| `--vp-groove-foreground-color` | `rgba(...)` | Separator line colour |
|
|
377
|
-
|
|
378
|
-
---
|
|
379
|
-
|
|
380
|
-
## TypeScript
|
|
381
|
-
|
|
382
|
-
All components are typed. Named exports only — import what you need:
|
|
383
|
-
|
|
384
|
-
```ts
|
|
385
|
-
import type { } from 'vue-pane' // no public types beyond the components themselves
|
|
386
|
-
import { VPane, VPNumber, VPColor } from 'vue-pane'
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
---
|
|
390
|
-
|
|
391
|
-
## CSS class names
|
|
392
|
-
|
|
393
|
-
Classes follow BEM with a `vp-` prefix. Useful for targeted overrides:
|
|
394
|
-
|
|
395
|
-
```css
|
|
396
|
-
/* make all labels uppercase */
|
|
397
|
-
.vp-label__text { text-transform: uppercase; }
|
|
398
|
-
|
|
399
|
-
/* widen value column in one pane only */
|
|
400
|
-
#my-pane { --vp-blade-value-width: 200px; }
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
Global state classes applied automatically:
|
|
404
|
-
|
|
405
|
-
| Class | Description |
|
|
406
|
-
|---|---|
|
|
407
|
-
| `vp--disabled` | Pointer events off, element dimmed |
|
|
408
|
-
| `vp--hidden` | `display: none` |
|
|
409
|
-
| `vp--first` | First visible child in a container |
|
|
410
|
-
| `vp--last` | Last visible child |
|
|
411
|
-
|
|
412
|
-
---
|
|
413
|
-
|
|
414
|
-
## Monorepo
|
|
415
|
-
|
|
416
|
-
```
|
|
417
|
-
packages/vue-pane/ ← npm package
|
|
418
|
-
apps/example/ ← development example app
|
|
419
|
-
```
|
|
58
|
+
## Development
|
|
420
59
|
|
|
421
60
|
```sh
|
|
422
61
|
pnpm dev # start the example app (resolves vue-pane from source, no build needed)
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<boolean>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
6
|
+
readonly?: boolean;
|
|
4
7
|
};
|
|
5
8
|
type __VLS_ModelProps = {
|
|
6
|
-
modelValue
|
|
9
|
+
modelValue?: boolean;
|
|
7
10
|
};
|
|
8
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
12
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
-
"update:modelValue": (value: boolean) => any;
|
|
13
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
11
14
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
-
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
13
16
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
17
|
declare const _default: typeof __VLS_export;
|
|
15
18
|
export default _default;
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<string>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
4
6
|
alpha?: boolean;
|
|
7
|
+
readonly?: boolean;
|
|
5
8
|
};
|
|
6
9
|
type __VLS_ModelProps = {
|
|
7
|
-
modelValue
|
|
10
|
+
modelValue?: string;
|
|
8
11
|
};
|
|
9
12
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
10
13
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
-
"update:modelValue": (value: string) => any;
|
|
14
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
12
15
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
13
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
16
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
14
17
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
15
18
|
declare const _default: typeof __VLS_export;
|
|
16
19
|
export default _default;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<number>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
4
6
|
min?: number;
|
|
5
7
|
max?: number;
|
|
6
8
|
step?: number;
|
|
9
|
+
readonly?: boolean;
|
|
7
10
|
};
|
|
8
11
|
type __VLS_ModelProps = {
|
|
9
|
-
modelValue
|
|
12
|
+
modelValue?: number;
|
|
10
13
|
};
|
|
11
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
15
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
-
"update:modelValue": (value: number) => any;
|
|
16
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
14
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
18
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
16
19
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
20
|
declare const _default: typeof __VLS_export;
|
|
18
21
|
export default _default;
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<{
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
}>;
|
|
2
7
|
label?: string;
|
|
3
8
|
tooltip?: string;
|
|
4
9
|
min?: number;
|
|
5
10
|
max?: number;
|
|
11
|
+
readonly?: boolean;
|
|
6
12
|
};
|
|
7
13
|
type __VLS_ModelProps = {
|
|
8
|
-
modelValue
|
|
14
|
+
modelValue?: {
|
|
9
15
|
x: number;
|
|
10
16
|
y: number;
|
|
11
17
|
};
|
|
@@ -15,12 +21,12 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {},
|
|
|
15
21
|
"update:modelValue": (value: {
|
|
16
22
|
x: number;
|
|
17
23
|
y: number;
|
|
18
|
-
}) => any;
|
|
24
|
+
} | undefined) => any;
|
|
19
25
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
26
|
"onUpdate:modelValue"?: ((value: {
|
|
21
27
|
x: number;
|
|
22
28
|
y: number;
|
|
23
|
-
}) => any) | undefined;
|
|
29
|
+
} | undefined) => any) | undefined;
|
|
24
30
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
25
31
|
declare const _default: typeof __VLS_export;
|
|
26
32
|
export default _default;
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<string | number>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
4
6
|
options: {
|
|
5
7
|
value: string | number;
|
|
6
8
|
label: string;
|
|
7
9
|
}[];
|
|
10
|
+
readonly?: boolean;
|
|
8
11
|
};
|
|
9
12
|
type __VLS_ModelProps = {
|
|
10
|
-
modelValue
|
|
13
|
+
modelValue?: string | number;
|
|
11
14
|
};
|
|
12
15
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
13
16
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
14
|
-
"update:modelValue": (value: string | number) => any;
|
|
17
|
+
"update:modelValue": (value: string | number | undefined) => any;
|
|
15
18
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
16
|
-
"onUpdate:modelValue"?: ((value: string | number) => any) | undefined;
|
|
19
|
+
"onUpdate:modelValue"?: ((value: string | number | undefined) => any) | undefined;
|
|
17
20
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
21
|
declare const _default: typeof __VLS_export;
|
|
19
22
|
export default _default;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<number>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
4
6
|
min?: number;
|
|
5
7
|
max?: number;
|
|
6
8
|
step?: number | null;
|
|
9
|
+
readonly?: boolean;
|
|
7
10
|
};
|
|
8
11
|
type __VLS_ModelProps = {
|
|
9
|
-
modelValue
|
|
12
|
+
modelValue?: number;
|
|
10
13
|
};
|
|
11
14
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
12
15
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
13
|
-
"update:modelValue": (value: number) => any;
|
|
16
|
+
"update:modelValue": (value: number | undefined) => any;
|
|
14
17
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
15
|
-
"onUpdate:modelValue"?: ((value: number) => any) | undefined;
|
|
18
|
+
"onUpdate:modelValue"?: ((value: number | undefined) => any) | undefined;
|
|
16
19
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
17
20
|
declare const _default: typeof __VLS_export;
|
|
18
21
|
export default _default;
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
+
import { PollingRef } from '../composables/pollingRef';
|
|
1
2
|
type __VLS_Props = {
|
|
3
|
+
poll?: PollingRef<string>;
|
|
2
4
|
label?: string;
|
|
3
5
|
tooltip?: string;
|
|
6
|
+
readonly?: boolean;
|
|
4
7
|
};
|
|
5
8
|
type __VLS_ModelProps = {
|
|
6
|
-
modelValue
|
|
9
|
+
modelValue?: string;
|
|
7
10
|
};
|
|
8
11
|
type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
|
|
9
12
|
declare const __VLS_export: import('vue').DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
-
"update:modelValue": (value: string) => any;
|
|
13
|
+
"update:modelValue": (value: string | undefined) => any;
|
|
11
14
|
}, string, import('vue').PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
12
|
-
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: string | undefined) => any) | undefined;
|
|
13
16
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
17
|
declare const _default: typeof __VLS_export;
|
|
15
18
|
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export declare const POLLING_REF: unique symbol;
|
|
3
|
+
export interface PollingRef<T> extends Ref<T> {
|
|
4
|
+
readonly [POLLING_REF]: true;
|
|
5
|
+
subscribe(): void;
|
|
6
|
+
unsubscribe(): void;
|
|
7
|
+
}
|
|
8
|
+
export declare function pollingRef<O extends object, K extends keyof O>(obj: O, key: K, interval?: number): PollingRef<O[K]>;
|
|
9
|
+
export declare function isPollingRef<T>(r: Ref<T> | unknown): r is PollingRef<T>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import { Ref } from 'vue';
|
|
1
|
+
import { InjectionKey, Ref } from 'vue';
|
|
2
2
|
export declare function useFoldable(containerRef: Ref<HTMLElement | null>, expandedRef: Ref<boolean>, storageKey?: string, expandedClass?: string): {
|
|
3
3
|
isExpanded: Ref<boolean>;
|
|
4
4
|
toggle: () => void;
|
|
5
5
|
};
|
|
6
|
+
export declare const EXPANDED_KEY: InjectionKey<Ref<boolean>>;
|
|
7
|
+
export declare function getPaneExpanded(): Ref<boolean>;
|
|
8
|
+
export declare function cascadeExpanded(isExpanded: Ref<boolean>): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { PollingRef } from './pollingRef';
|
|
3
|
+
export declare function usePolling(r: PollingRef<any>, visible?: Ref<boolean, boolean>): void;
|
|
4
|
+
export declare function usePollingOrModel<T, S = T>(poll: PollingRef<T> | undefined, modelValue: Ref<T, S>, visible?: Ref<boolean, boolean>): Ref<NonNullable<T>, NonNullable<S>>;
|