vintage-frames 0.1.1 → 0.2.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/custom-elements.json +290 -38
- package/dist/components/vf-button.d.ts +1 -1
- package/dist/components/vf-container.d.ts +2 -2
- package/dist/components/vf-desktop.d.ts +1 -1
- package/dist/components/vf-fieldset.d.ts +1 -1
- package/dist/components/vf-fieldset.js +6 -1
- package/dist/components/vf-grid.d.ts +1 -1
- package/dist/components/vf-icon.d.ts +1 -1
- package/dist/components/vf-img.d.ts +1 -1
- package/dist/components/vf-label.d.ts +1 -1
- package/dist/components/vf-list-item.d.ts +9 -1
- package/dist/components/vf-list-item.js +15 -14
- package/dist/components/vf-list.d.ts +1 -1
- package/dist/components/vf-menu-bar.d.ts +1 -1
- package/dist/components/vf-menu-item.d.ts +10 -1
- package/dist/components/vf-menu-item.js +35 -34
- package/dist/components/vf-menu.d.ts +11 -2
- package/dist/components/vf-menu.js +33 -32
- package/dist/components/vf-option.d.ts +11 -1
- package/dist/components/vf-option.js +16 -15
- package/dist/components/vf-paragraph.d.ts +3 -3
- package/dist/components/vf-progress-bar.d.ts +1 -1
- package/dist/components/vf-scroll-area.d.ts +1 -1
- package/dist/components/vf-select.d.ts +1 -1
- package/dist/components/vf-separator.d.ts +1 -1
- package/dist/components/vf-slider.d.ts +1 -1
- package/dist/components/vf-stack.d.ts +27 -9
- package/dist/components/vf-stack.js +30 -8
- package/dist/components/vf-swatch.d.ts +1 -1
- package/dist/components/vf-window.d.ts +1 -1
- package/dist/cross-center.d.ts +76 -0
- package/dist/cross-center.js +69 -0
- package/dist/define.d.ts +2 -2
- package/dist/define.js +1 -1
- package/dist/grid-snap.d.ts +2 -24
- package/dist/grid-snap.js +7 -33
- package/dist/index.d.ts +5 -5
- package/dist/index.js +50 -50
- package/dist/position.d.ts +11 -2
- package/dist/styles/recipes/host.js +14 -1
- package/dist/styles/recipes/toggle.js +16 -0
- package/dist/text-control.d.ts +1 -1
- package/docs/SPEC.md +10 -9
- package/editor/vscode.html-custom-data.json +48 -8
- package/editor/web-types.json +92 -12
- package/package.json +1 -3
|
@@ -93,7 +93,7 @@ export declare class VfButton extends VfButton_base {
|
|
|
93
93
|
formTarget: string;
|
|
94
94
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
95
95
|
private readonly scale;
|
|
96
|
-
/** Device-pixel grid snapping
|
|
96
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
97
97
|
private readonly gridSnap;
|
|
98
98
|
private buttonEl;
|
|
99
99
|
/**
|
|
@@ -48,7 +48,7 @@ declare const VfContainer_base: (new (...args: any[]) => import("../size.js").Vf
|
|
|
48
48
|
* A container's box is itself the consumer's coordinate system, including for
|
|
49
49
|
* non-`vf` content that cannot correct itself, so the box is the thing to
|
|
50
50
|
* hold on the grid. The shadow box below owns the `position: relative` anchor
|
|
51
|
-
* and the `vf-snap` class together, so
|
|
51
|
+
* and the `vf-snap` class together, so the correction
|
|
52
52
|
* moves the whole coordinate system — everything placed against it rides
|
|
53
53
|
* along instead of being re-corrected child by child. (`vf-stack` shipped
|
|
54
54
|
* without a controller on the theory that slotted `vf-*` children correct
|
|
@@ -80,7 +80,7 @@ export declare class VfContainer extends VfContainer_base {
|
|
|
80
80
|
*/
|
|
81
81
|
private readonly scale;
|
|
82
82
|
/**
|
|
83
|
-
* Hold the box on the device-pixel grid
|
|
83
|
+
* Hold the box on the device-pixel grid — see the
|
|
84
84
|
* class doc. The host is what gets measured; `.box` (vf-snap) is where the
|
|
85
85
|
* correction lands.
|
|
86
86
|
*/
|
|
@@ -97,7 +97,7 @@ export declare class VfDesktop extends VfDesktop_base {
|
|
|
97
97
|
private _windows;
|
|
98
98
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
99
99
|
private readonly scale;
|
|
100
|
-
/** Device-pixel grid snapping
|
|
100
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
101
101
|
private readonly gridSnap;
|
|
102
102
|
/**
|
|
103
103
|
* The consumer's `--vf-desktop-pattern` override, or `''` for the kit
|
|
@@ -18,7 +18,7 @@ export declare class VfFieldset extends VfFieldset_base {
|
|
|
18
18
|
#private;
|
|
19
19
|
static styles: import("lit").CSSResult[];
|
|
20
20
|
private readonly scale;
|
|
21
|
-
/** Device-pixel grid snapping
|
|
21
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
22
22
|
private readonly gridSnap;
|
|
23
23
|
/** Legend text shown on the top border. */
|
|
24
24
|
legend: string;
|
|
@@ -29,7 +29,12 @@ var m = class extends r(s) {
|
|
|
29
29
|
/* Chicago-style legend (chrome); grouped content keeps the body face. */
|
|
30
30
|
${i}
|
|
31
31
|
position: absolute;
|
|
32
|
-
|
|
32
|
+
/* Whole system px like every other length here. Authored as -0.7em
|
|
33
|
+
this was 11.2px against the 16px display face — off the device grid
|
|
34
|
+
at every scale, and it took a slotted legend with it (verify:grid).
|
|
35
|
+
11 keeps the legend straddling the border, a fifth of a system px
|
|
36
|
+
lower. */
|
|
37
|
+
top: calc(var(--vf-scale, 1) * -11px);
|
|
33
38
|
left: calc(var(--vf-scale, 1) * 8px);
|
|
34
39
|
padding: 0 calc(var(--vf-scale, 1) * 5px);
|
|
35
40
|
/* Punches through the border, matching the surface behind it. */
|
|
@@ -112,7 +112,7 @@ export declare class VfGrid extends VfGrid_base {
|
|
|
112
112
|
collapse: boolean;
|
|
113
113
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
114
114
|
private readonly scale;
|
|
115
|
-
/** Device-pixel grid snapping
|
|
115
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
116
116
|
private readonly gridSnap;
|
|
117
117
|
protected render(): import("lit-html").TemplateResult<1>;
|
|
118
118
|
}
|
|
@@ -314,7 +314,7 @@ export declare class VfIcon extends VfIcon_base {
|
|
|
314
314
|
maxlength: number;
|
|
315
315
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
316
316
|
private readonly scale;
|
|
317
|
-
/** Device-pixel grid snapping
|
|
317
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
318
318
|
private readonly gridSnap;
|
|
319
319
|
/** Whether to wear the dashed focus rule; see src/focus-modality.ts. */
|
|
320
320
|
private readonly focusRule;
|
|
@@ -37,7 +37,7 @@ export declare class VfImg extends VfImg_base {
|
|
|
37
37
|
static styles: import("lit").CSSResult[];
|
|
38
38
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
39
39
|
private readonly scale;
|
|
40
|
-
/** Device-pixel grid snapping
|
|
40
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
41
41
|
private readonly gridSnap;
|
|
42
42
|
/**
|
|
43
43
|
* The displayed width in system px — a whole number. Defaults to the slotted
|
|
@@ -54,7 +54,7 @@ export declare class VfLabel extends VfLabel_base {
|
|
|
54
54
|
static styles: import("lit").CSSResult[];
|
|
55
55
|
/** Default-on display scaling (true 72dpi size); see src/scale.ts. */
|
|
56
56
|
private readonly scale;
|
|
57
|
-
/** Device-pixel grid snapping
|
|
57
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
58
58
|
private readonly gridSnap;
|
|
59
59
|
/**
|
|
60
60
|
* The id of the control this caption names, resolved in the label's own tree
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
declare const VfListItem_base: (new (...args: any[]) => import("../position.js").VfPositionedInterface) & typeof LitElement;
|
|
2
3
|
/**
|
|
3
4
|
* `<vf-list-item>` — a row inside a `<vf-list>` list box.
|
|
4
5
|
*
|
|
@@ -16,8 +17,14 @@ import { LitElement } from 'lit';
|
|
|
16
17
|
* the row's words. On a selected row the graphic rides the inverted bar
|
|
17
18
|
* as-is — System 7 left color icons unfiltered on the highlight.
|
|
18
19
|
* @csspart text - The text span beside the icon gutter (ellipsizes).
|
|
20
|
+
*
|
|
21
|
+
* Takes `top`/`left` like every other element ({@link VfPositioned}), for the
|
|
22
|
+
* consumer who wants a row somewhere other than a list. Inside its parent
|
|
23
|
+
* `<vf-list>` the rows stack in flow, so stating an origin lifts that row out
|
|
24
|
+
* of the stack and the ones below it close the gap — the placement doing what
|
|
25
|
+
* it says, but not how a list box is laid out.
|
|
19
26
|
*/
|
|
20
|
-
export declare class VfListItem extends
|
|
27
|
+
export declare class VfListItem extends VfListItem_base {
|
|
21
28
|
#private;
|
|
22
29
|
static styles: import("lit").CSSResult[];
|
|
23
30
|
private readonly scale;
|
|
@@ -46,3 +53,4 @@ declare global {
|
|
|
46
53
|
'vf-list-item': VfListItem;
|
|
47
54
|
}
|
|
48
55
|
}
|
|
56
|
+
export {};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { vfElement as e } from "../define.js";
|
|
2
2
|
import { ScaleController as t } from "../scale.js";
|
|
3
3
|
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
4
|
+
import { VfPositioned as r } from "../position.js";
|
|
5
|
+
import { vfBase as i } from "../styles/recipes/host.js";
|
|
6
|
+
import { vfFocusRing as a } from "../styles/recipes/focus.js";
|
|
7
|
+
import { emit as o } from "../events.js";
|
|
8
|
+
import { LitElement as s, css as c, html as l } from "lit";
|
|
9
|
+
import { property as u } from "lit/decorators.js";
|
|
9
10
|
//#region src/components/vf-list-item.ts
|
|
10
|
-
var
|
|
11
|
+
var d = class extends r(s) {
|
|
11
12
|
static {
|
|
12
|
-
this.styles = [
|
|
13
|
+
this.styles = [i, c`
|
|
13
14
|
:host {
|
|
14
15
|
display: flex;
|
|
15
16
|
align-items: center;
|
|
@@ -47,7 +48,7 @@ var u = class extends o {
|
|
|
47
48
|
across selected rows while Space still acts on it. */
|
|
48
49
|
:host(:focus) {
|
|
49
50
|
--vf-focus-offset: -1px;
|
|
50
|
-
${
|
|
51
|
+
${a}
|
|
51
52
|
}
|
|
52
53
|
:host([selected]) {
|
|
53
54
|
background: var(--vf-highlight, #000);
|
|
@@ -80,19 +81,19 @@ var u = class extends o {
|
|
|
80
81
|
super.connectedCallback(), this.hasAttribute("tabindex") || (this.tabIndex = -1);
|
|
81
82
|
}
|
|
82
83
|
updated(e) {
|
|
83
|
-
e.has("selected") && (this.#e.ariaSelected = this.selected ? "true" : "false"), (e.has("disabled") || e.has("listDisabled")) && (this.#e.ariaDisabled = this.disabled || this.listDisabled ? "true" : null), e.has("disabled") && e.get("disabled") !== void 0 &&
|
|
84
|
+
e.has("selected") && (this.#e.ariaSelected = this.selected ? "true" : "false"), (e.has("disabled") || e.has("listDisabled")) && (this.#e.ariaDisabled = this.disabled || this.listDisabled ? "true" : null), e.has("disabled") && e.get("disabled") !== void 0 && o(this, "vf-list-item-disabled-change", { item: this }, { composed: !1 });
|
|
84
85
|
}
|
|
85
86
|
render() {
|
|
86
|
-
return
|
|
87
|
+
return l`<slot name="icon"></slot
|
|
87
88
|
><span class="text" part="text"><slot></slot></span>`;
|
|
88
89
|
}
|
|
89
90
|
};
|
|
90
|
-
n([
|
|
91
|
+
n([u()], d.prototype, "value", void 0), n([u({
|
|
91
92
|
type: Boolean,
|
|
92
93
|
reflect: !0
|
|
93
|
-
})],
|
|
94
|
+
})], d.prototype, "selected", void 0), n([u({
|
|
94
95
|
type: Boolean,
|
|
95
96
|
reflect: !0
|
|
96
|
-
})],
|
|
97
|
+
})], d.prototype, "disabled", void 0), n([u({ attribute: !1 })], d.prototype, "listDisabled", void 0), d = n([e("vf-list-item")], d);
|
|
97
98
|
//#endregion
|
|
98
|
-
export {
|
|
99
|
+
export { d as VfListItem };
|
|
@@ -29,7 +29,7 @@ export declare class VfList extends VfList_base {
|
|
|
29
29
|
#private;
|
|
30
30
|
static styles: import("lit").CSSResult[];
|
|
31
31
|
private readonly scale;
|
|
32
|
-
/** Device-pixel grid snapping
|
|
32
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
33
33
|
private readonly gridSnap;
|
|
34
34
|
private viewport;
|
|
35
35
|
private content;
|
|
@@ -25,7 +25,7 @@ export declare class VfMenuBar extends VfMenuBar_base {
|
|
|
25
25
|
#private;
|
|
26
26
|
static styles: import("lit").CSSResult[];
|
|
27
27
|
private readonly scale;
|
|
28
|
-
/** Device-pixel grid snapping
|
|
28
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
29
29
|
private readonly gridSnap;
|
|
30
30
|
/**
|
|
31
31
|
* Accessible name for the bar, applied as `aria-label` on the host (which
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
declare const VfMenuItem_base: (new (...args: any[]) => import("../position.js").VfPositionedInterface) & typeof LitElement;
|
|
2
3
|
/**
|
|
3
4
|
* `<vf-menu-item>` — a single command inside a `<vf-menu>` panel.
|
|
4
5
|
*
|
|
@@ -9,6 +10,13 @@ import { LitElement } from 'lit';
|
|
|
9
10
|
* 3-blink inversion (~250ms), then dispatches `vf-menu-select` and asks its
|
|
10
11
|
* ancestors to close the menu.
|
|
11
12
|
*
|
|
13
|
+
* Takes `top`/`left` like every other element ({@link VfPositioned}), for the
|
|
14
|
+
* consumer who wants a row somewhere other than a pulldown. Inside its parent
|
|
15
|
+
* `<vf-menu>` the panel is as wide as its widest row and stacks them in flow,
|
|
16
|
+
* so stating an origin takes that row out of both: it no longer contributes to
|
|
17
|
+
* the panel's width and the rows below close the gap. The placement doing what
|
|
18
|
+
* it says — but not how a pulldown is laid out.
|
|
19
|
+
*
|
|
12
20
|
* @slot - The item label.
|
|
13
21
|
* @csspart item - The row container.
|
|
14
22
|
* @csspart check - The ✓ checkmark glyph (rendered when `checked`).
|
|
@@ -29,7 +37,7 @@ import { LitElement } from 'lit';
|
|
|
29
37
|
* / `vf-option` + `vf-menu-item` ✓ column (shared so the value doesn't shift
|
|
30
38
|
* on open)
|
|
31
39
|
*/
|
|
32
|
-
export declare class VfMenuItem extends
|
|
40
|
+
export declare class VfMenuItem extends VfMenuItem_base {
|
|
33
41
|
#private;
|
|
34
42
|
static styles: import("lit").CSSResult[];
|
|
35
43
|
private readonly scale;
|
|
@@ -89,3 +97,4 @@ declare global {
|
|
|
89
97
|
'vf-menu-item': VfMenuItem;
|
|
90
98
|
}
|
|
91
99
|
}
|
|
100
|
+
export {};
|
|
@@ -1,34 +1,35 @@
|
|
|
1
1
|
import { vfElement as e } from "../define.js";
|
|
2
2
|
import { ScaleController as t } from "../scale.js";
|
|
3
3
|
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
4
|
+
import { VfPositioned as r } from "../position.js";
|
|
5
|
+
import { vfDisplay as i } from "../styles/recipes/display-face.js";
|
|
6
|
+
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
+
import { releaseAfterGesture as o } from "../document-listeners.js";
|
|
8
|
+
import { deferActivation as s, emit as c } from "../events.js";
|
|
9
|
+
import { runSelectionBlink as l } from "../motion.js";
|
|
10
|
+
import { CHECKMARK as u, glyphSvg as d } from "../glyphs.js";
|
|
11
|
+
import { LitElement as f, css as p, html as m, nothing as h } from "lit";
|
|
12
|
+
import { property as g, state as _ } from "lit/decorators.js";
|
|
13
|
+
import { classMap as v } from "lit/directives/class-map.js";
|
|
13
14
|
//#region src/components/vf-menu-item.ts
|
|
14
|
-
var
|
|
15
|
+
var y = /* @__PURE__ */ new Map([
|
|
15
16
|
["⌃", "Control"],
|
|
16
17
|
["⌥", "Alt"],
|
|
17
18
|
["⇧", "Shift"],
|
|
18
19
|
["⌘", "Meta"]
|
|
19
20
|
]);
|
|
20
|
-
function
|
|
21
|
+
function b(e) {
|
|
21
22
|
let t = [...e.trim()], n = [];
|
|
22
|
-
for (; t.length > 0 &&
|
|
23
|
+
for (; t.length > 0 && y.has(t[0]);) n.push(y.get(t.shift()));
|
|
23
24
|
let r = t.join("");
|
|
24
25
|
return r ? [...n, r].join("+") : "";
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
+
var x = class extends r(f) {
|
|
27
28
|
static {
|
|
28
29
|
this.styles = [
|
|
30
|
+
a,
|
|
29
31
|
i,
|
|
30
|
-
|
|
31
|
-
f`
|
|
32
|
+
p`
|
|
32
33
|
:host {
|
|
33
34
|
display: block;
|
|
34
35
|
cursor: var(--vf-cursor, default);
|
|
@@ -175,7 +176,7 @@ var b = class extends d {
|
|
|
175
176
|
e.has("disabled") && (this.#r.ariaDisabled = this.disabled ? "true" : null, this.disabled && this.#d()), e.has("checked") && this.checked && (this.#n = !0), (e.has("checked") || e.has("checkable")) && this.#s(), e.has("shortcut") && this.#o();
|
|
176
177
|
}
|
|
177
178
|
#o() {
|
|
178
|
-
this.#r.ariaKeyShortcuts =
|
|
179
|
+
this.#r.ariaKeyShortcuts = b(this.shortcut) || null;
|
|
179
180
|
}
|
|
180
181
|
#s() {
|
|
181
182
|
this.#a ? (this.#r.role = "menuitemcheckbox", this.#r.ariaChecked = this.checked ? "true" : "false") : (this.#r.role = "menuitem", this.#r.ariaChecked = null);
|
|
@@ -187,20 +188,20 @@ var b = class extends d {
|
|
|
187
188
|
"blink-on": this._blinkPhase === "on",
|
|
188
189
|
"blink-off": this._blinkPhase === "off"
|
|
189
190
|
};
|
|
190
|
-
return
|
|
191
|
-
<div class=${
|
|
192
|
-
${this.checked ?
|
|
193
|
-
>${u
|
|
194
|
-
>` :
|
|
191
|
+
return m`
|
|
192
|
+
<div class=${v(e)} part="item">
|
|
193
|
+
${this.checked ? m`<span class="check" part="check" aria-hidden="true"
|
|
194
|
+
>${d(u, "checkmark")}</span
|
|
195
|
+
>` : h}
|
|
195
196
|
<span class="label" part="label"><slot></slot></span>
|
|
196
|
-
${this.shortcut ?
|
|
197
|
+
${this.shortcut ? m`<span class="shortcut" part="shortcut" aria-hidden="true"
|
|
197
198
|
>${this.shortcut}</span
|
|
198
|
-
>` :
|
|
199
|
+
>` : h}
|
|
199
200
|
</div>
|
|
200
201
|
`;
|
|
201
202
|
}
|
|
202
203
|
#c() {
|
|
203
|
-
this.#i = this.closest("vf-menu") !== null, this.#i &&
|
|
204
|
+
this.#i = this.closest("vf-menu") !== null, this.#i && o(() => {
|
|
204
205
|
this.#i = !1;
|
|
205
206
|
});
|
|
206
207
|
}
|
|
@@ -209,7 +210,7 @@ var b = class extends d {
|
|
|
209
210
|
this.#i = !1;
|
|
210
211
|
return;
|
|
211
212
|
}
|
|
212
|
-
|
|
213
|
+
s(this, e, () => this.activate());
|
|
213
214
|
}
|
|
214
215
|
#u(e) {
|
|
215
216
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), this.activate());
|
|
@@ -217,7 +218,7 @@ var b = class extends d {
|
|
|
217
218
|
activate() {
|
|
218
219
|
if (this.disabled || this.#t) return;
|
|
219
220
|
this.#t = !0;
|
|
220
|
-
let e =
|
|
221
|
+
let e = l((e) => {
|
|
221
222
|
this._blinkPhase = e ? "on" : "off";
|
|
222
223
|
}, () => {
|
|
223
224
|
this._blinkPhase = null, this.#t = !1, this.#e = void 0, this.#f();
|
|
@@ -229,24 +230,24 @@ var b = class extends d {
|
|
|
229
230
|
}
|
|
230
231
|
#f() {
|
|
231
232
|
let e = this.value ?? (this.textContent ?? "").trim();
|
|
232
|
-
|
|
233
|
+
c(this, "vf-menu-select", {
|
|
233
234
|
value: e,
|
|
234
235
|
item: this
|
|
235
|
-
}),
|
|
236
|
+
}), c(this, "vf-menu-close-request", { item: this }, { composed: !1 });
|
|
236
237
|
}
|
|
237
238
|
};
|
|
238
|
-
n([
|
|
239
|
+
n([g({
|
|
239
240
|
type: Boolean,
|
|
240
241
|
reflect: !0
|
|
241
|
-
})],
|
|
242
|
+
})], x.prototype, "disabled", void 0), n([g({
|
|
242
243
|
type: Boolean,
|
|
243
244
|
reflect: !0
|
|
244
|
-
})],
|
|
245
|
+
})], x.prototype, "checked", void 0), n([g({
|
|
245
246
|
type: Boolean,
|
|
246
247
|
reflect: !0
|
|
247
|
-
})],
|
|
248
|
+
})], x.prototype, "active", void 0), n([g({
|
|
248
249
|
type: Boolean,
|
|
249
250
|
reflect: !0
|
|
250
|
-
})],
|
|
251
|
+
})], x.prototype, "checkable", void 0), n([g()], x.prototype, "shortcut", void 0), n([g()], x.prototype, "value", void 0), n([_()], x.prototype, "_blinkPhase", void 0), x = n([e("vf-menu-item")], x);
|
|
251
252
|
//#endregion
|
|
252
|
-
export {
|
|
253
|
+
export { x as VfMenuItem };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import type { VfMenuItem } from './vf-menu-item.js';
|
|
3
|
+
declare const VfMenu_base: (new (...args: any[]) => import("../position.js").VfPositionedInterface) & typeof LitElement;
|
|
3
4
|
/**
|
|
4
5
|
* `<vf-menu>` — a pull-down menu: a bar label plus a dropped panel of
|
|
5
6
|
* `<vf-menu-item>` / `<vf-separator>` children.
|
|
@@ -16,6 +17,13 @@ import type { VfMenuItem } from './vf-menu-item.js';
|
|
|
16
17
|
* onto a command, release over it) and a modern quick tap that leaves the menu
|
|
17
18
|
* dropped for a second click.
|
|
18
19
|
*
|
|
20
|
+
* Takes `top`/`left` like every other element ({@link VfPositioned}) — the
|
|
21
|
+
* natural fit being a standalone menu, which is a free-standing menu button and
|
|
22
|
+
* places like any other control. The panel is anchored to the host's own box
|
|
23
|
+
* (`top: 100%`), so it follows a placed menu down without any further work.
|
|
24
|
+
* Inside a `<vf-menu-bar>`, the bar lays its titles out in flow — placing one
|
|
25
|
+
* lifts it off the bar and the titles beside it close the gap.
|
|
26
|
+
*
|
|
19
27
|
* @slot - Menu contents: `vf-menu-item` and `vf-separator` elements.
|
|
20
28
|
* @slot label - Replaces the `label` text in the bar — e.g. a `vf-img` apple
|
|
21
29
|
* icon for the Apple menu. Keep the `label` attribute set too: it stays the
|
|
@@ -28,11 +36,11 @@ import type { VfMenuItem } from './vf-menu-item.js';
|
|
|
28
36
|
* also spends one of these on every slotted `vf-separator`, the full row the
|
|
29
37
|
* MDEF gave a divider (rule 8px into it — see the panel CSS)
|
|
30
38
|
*/
|
|
31
|
-
export declare class VfMenu extends
|
|
39
|
+
export declare class VfMenu extends VfMenu_base {
|
|
32
40
|
#private;
|
|
33
41
|
static styles: import("lit").CSSResult[];
|
|
34
42
|
private readonly scale;
|
|
35
|
-
/** Device-pixel grid snapping
|
|
43
|
+
/** Device-pixel grid snapping; see src/grid-snap.ts. */
|
|
36
44
|
private readonly gridSnap;
|
|
37
45
|
/**
|
|
38
46
|
* The menu title shown in the bar, and the menu's accessible name. Slotted
|
|
@@ -93,3 +101,4 @@ declare global {
|
|
|
93
101
|
'vf-menu': VfMenu;
|
|
94
102
|
}
|
|
95
103
|
}
|
|
104
|
+
export {};
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { vfElement as e } from "../define.js";
|
|
2
2
|
import { ScaleController as t } from "../scale.js";
|
|
3
3
|
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
4
|
+
import { VfPositioned as r } from "../position.js";
|
|
5
|
+
import { vfDisplay as i } from "../styles/recipes/display-face.js";
|
|
6
|
+
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
+
import { vfPanel as o } from "../styles/recipes/surface.js";
|
|
8
|
+
import { vfFocusUnderline as s } from "../styles/recipes/focus.js";
|
|
9
|
+
import { GridSnapController as c } from "../grid-snap.js";
|
|
10
|
+
import { DocumentListenersController as l, releaseAfterGesture as u } from "../document-listeners.js";
|
|
11
|
+
import { deferActivation as d, emit as f } from "../events.js";
|
|
12
|
+
import { FocusRuleController as p } from "../focus-modality.js";
|
|
13
|
+
import { TypeAheadBuffer as m } from "../type-ahead.js";
|
|
14
|
+
import { MenuPressController as h } from "../menu-press.js";
|
|
15
|
+
import { LitElement as g, css as _, html as v, nothing as y } from "lit";
|
|
16
|
+
import { property as b, query as x, queryAssignedElements as S } from "lit/decorators.js";
|
|
16
17
|
//#region src/components/vf-menu.ts
|
|
17
|
-
var
|
|
18
|
+
var C = class extends r(g) {
|
|
18
19
|
constructor(...e) {
|
|
19
|
-
super(...e), this.scale = new t(this), this.gridSnap = new
|
|
20
|
+
super(...e), this.scale = new t(this), this.gridSnap = new c(this), this.#e = new p(this), this.label = "", this.open = !1, this.barTabIndex = 0, this.#t = new h(this, {
|
|
20
21
|
menus: () => [this],
|
|
21
22
|
open: (e) => {
|
|
22
23
|
e.open = !0;
|
|
@@ -24,7 +25,7 @@ var S = class extends h {
|
|
|
24
25
|
close: () => {
|
|
25
26
|
this.open = !1;
|
|
26
27
|
}
|
|
27
|
-
}), this.#r = this.attachInternals(), this.#i = new
|
|
28
|
+
}), this.#r = this.attachInternals(), this.#i = new m(), this.#a = !1, this.#o = () => {
|
|
28
29
|
this.#n || this.focus(), this.open = !1;
|
|
29
30
|
}, this.#s = (e) => {
|
|
30
31
|
e.composedPath().includes(this) || (this.open = !1);
|
|
@@ -58,7 +59,7 @@ var S = class extends h {
|
|
|
58
59
|
break;
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
|
-
}, this.#u = new
|
|
62
|
+
}, this.#u = new l(this, () => [[
|
|
62
63
|
document,
|
|
63
64
|
"pointerdown",
|
|
64
65
|
this.#s,
|
|
@@ -78,10 +79,10 @@ var S = class extends h {
|
|
|
78
79
|
}
|
|
79
80
|
static {
|
|
80
81
|
this.styles = [
|
|
81
|
-
i,
|
|
82
|
-
r,
|
|
83
82
|
a,
|
|
84
|
-
|
|
83
|
+
i,
|
|
84
|
+
o,
|
|
85
|
+
_`
|
|
85
86
|
:host {
|
|
86
87
|
display: inline-block;
|
|
87
88
|
position: relative;
|
|
@@ -168,7 +169,7 @@ var S = class extends h {
|
|
|
168
169
|
}
|
|
169
170
|
:host(:not([open])) .label.vf-focus-rule .title::after {
|
|
170
171
|
--vf-focus-underline-offset: -2px;
|
|
171
|
-
${
|
|
172
|
+
${s}
|
|
172
173
|
}
|
|
173
174
|
.panel {
|
|
174
175
|
position: absolute;
|
|
@@ -270,7 +271,7 @@ var S = class extends h {
|
|
|
270
271
|
this.focus();
|
|
271
272
|
}
|
|
272
273
|
render() {
|
|
273
|
-
return
|
|
274
|
+
return v`
|
|
274
275
|
<div
|
|
275
276
|
class="label vf-snap ${this.#e.marked ? "vf-focus-rule" : ""}"
|
|
276
277
|
part="label"
|
|
@@ -278,7 +279,7 @@ var S = class extends h {
|
|
|
278
279
|
tabindex=${this.barTabIndex}
|
|
279
280
|
aria-haspopup="menu"
|
|
280
281
|
aria-expanded=${this.open ? "true" : "false"}
|
|
281
|
-
aria-label=${this.label ||
|
|
282
|
+
aria-label=${this.label || y}
|
|
282
283
|
@pointerdown=${this.#h}
|
|
283
284
|
@click=${this.#g}
|
|
284
285
|
@pointerenter=${this.#_}
|
|
@@ -290,7 +291,7 @@ var S = class extends h {
|
|
|
290
291
|
class="panel vf-panel"
|
|
291
292
|
part="panel"
|
|
292
293
|
role="menu"
|
|
293
|
-
aria-label=${this.label ||
|
|
294
|
+
aria-label=${this.label || y}
|
|
294
295
|
>
|
|
295
296
|
<slot></slot>
|
|
296
297
|
</div>
|
|
@@ -301,13 +302,13 @@ var S = class extends h {
|
|
|
301
302
|
this.open = !this.open;
|
|
302
303
|
return;
|
|
303
304
|
}
|
|
304
|
-
|
|
305
|
+
f(this, "vf-menu-toggle-request", { menu: this }, {
|
|
305
306
|
cancelable: !0,
|
|
306
307
|
composed: !1
|
|
307
308
|
}) && (this.open = !this.open);
|
|
308
309
|
}
|
|
309
310
|
#h() {
|
|
310
|
-
this.#a = !0,
|
|
311
|
+
this.#a = !0, u(() => {
|
|
311
312
|
this.#a = !1;
|
|
312
313
|
});
|
|
313
314
|
}
|
|
@@ -316,10 +317,10 @@ var S = class extends h {
|
|
|
316
317
|
this.#a = !1;
|
|
317
318
|
return;
|
|
318
319
|
}
|
|
319
|
-
|
|
320
|
+
d(this, e, () => this.#m());
|
|
320
321
|
}
|
|
321
322
|
#_() {
|
|
322
|
-
|
|
323
|
+
f(this, "vf-menu-hover", { menu: this }, { composed: !1 });
|
|
323
324
|
}
|
|
324
325
|
#v(e) {
|
|
325
326
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -332,15 +333,15 @@ var S = class extends h {
|
|
|
332
333
|
await this.updateComplete, this.items[0]?.focus();
|
|
333
334
|
}
|
|
334
335
|
};
|
|
335
|
-
n([
|
|
336
|
+
n([b()], C.prototype, "label", void 0), n([b({
|
|
336
337
|
type: Boolean,
|
|
337
338
|
reflect: !0
|
|
338
|
-
})],
|
|
339
|
+
})], C.prototype, "open", void 0), n([b({
|
|
339
340
|
type: Number,
|
|
340
341
|
attribute: !1
|
|
341
|
-
})],
|
|
342
|
+
})], C.prototype, "barTabIndex", void 0), n([x(".label")], C.prototype, "_labelEl", void 0), n([S({
|
|
342
343
|
selector: "vf-menu-item",
|
|
343
344
|
flatten: !0
|
|
344
|
-
})],
|
|
345
|
+
})], C.prototype, "_assignedItems", void 0), C = n([e("vf-menu")], C);
|
|
345
346
|
//#endregion
|
|
346
|
-
export {
|
|
347
|
+
export { C as VfMenu };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import type { PropertyValues } from 'lit';
|
|
3
|
+
declare const VfOption_base: (new (...args: any[]) => import("../position.js").VfPositionedInterface) & typeof LitElement;
|
|
3
4
|
/**
|
|
4
5
|
* `<vf-option>` — a single choice inside a `<vf-select>` popup menu.
|
|
5
6
|
*
|
|
@@ -12,6 +13,14 @@ import type { PropertyValues } from 'lit';
|
|
|
12
13
|
*
|
|
13
14
|
* The host carries `role="option"` with `aria-selected`/`aria-disabled`.
|
|
14
15
|
*
|
|
16
|
+
* Takes `top`/`left` like every other element ({@link VfPositioned}), for the
|
|
17
|
+
* consumer who wants one somewhere other than a popup row. Inside its parent
|
|
18
|
+
* `<vf-select>` it is a row the panel measures and scrolls in flow, so stating
|
|
19
|
+
* an origin there takes it out of that measurement: the panel stops counting it
|
|
20
|
+
* toward its own width and its scroll clamp, and the rows below close the gap.
|
|
21
|
+
* That is the placement doing exactly what it says — not a bug — but it is not
|
|
22
|
+
* how a popup is laid out.
|
|
23
|
+
*
|
|
15
24
|
* @csspart check - The ✓ checkmark shown in the left gutter when selected.
|
|
16
25
|
* @cssprop [--vf-popup-height=18px] - `vf-select` pill (border box; its 1px
|
|
17
26
|
* hard shadow makes the sheet's 157×19 ink box)
|
|
@@ -19,7 +28,7 @@ import type { PropertyValues } from 'lit';
|
|
|
19
28
|
* / `vf-option` + `vf-menu-item` ✓ column (shared so the value doesn't shift
|
|
20
29
|
* on open)
|
|
21
30
|
*/
|
|
22
|
-
export declare class VfOption extends
|
|
31
|
+
export declare class VfOption extends VfOption_base {
|
|
23
32
|
#private;
|
|
24
33
|
static styles: import("lit").CSSResult[];
|
|
25
34
|
private readonly scale;
|
|
@@ -47,3 +56,4 @@ declare global {
|
|
|
47
56
|
'vf-option': VfOption;
|
|
48
57
|
}
|
|
49
58
|
}
|
|
59
|
+
export {};
|