vintage-frames 0.3.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/custom-elements.json +48 -3
- package/dist/components/vf-button.js +25 -25
- package/dist/components/vf-checkbox.js +15 -15
- package/dist/components/vf-desktop.d.ts +51 -3
- package/dist/components/vf-desktop.js +57 -48
- package/dist/components/vf-icon.js +56 -56
- package/dist/components/vf-list-item.js +16 -16
- package/dist/components/vf-list.js +26 -26
- package/dist/components/vf-menu-item.js +24 -24
- package/dist/components/vf-menu.js +27 -27
- package/dist/components/vf-number-field.js +17 -17
- package/dist/components/vf-radio-group.js +13 -13
- package/dist/components/vf-radio.js +16 -16
- package/dist/components/vf-select.js +27 -27
- package/dist/components/vf-slider.js +24 -24
- package/dist/components/vf-window.js +54 -54
- package/dist/index.js +29 -29
- package/dist/modal-dialog.js +21 -21
- package/dist/text-control.js +11 -11
- package/dist/toggle-control.js +5 -5
- package/docs/SPEC.md +3 -1
- package/editor/vscode.html-custom-data.json +1 -1
- package/editor/web-types.json +19 -4
- package/package.json +2 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import i from "../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { emit as e } from "../events.js";
|
|
2
|
+
import { vfElement as t } from "../define.js";
|
|
3
|
+
import { ScaleController as n, effectiveScale as r, toSysExact as i } from "../scale.js";
|
|
4
|
+
import a from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { PlacementController as o, VfPositioned as s, warnMovableContract as c } from "../position.js";
|
|
6
|
+
import { vfBodyDecls as l } from "../styles/recipes/body-face.js";
|
|
7
|
+
import { vfBase as u } from "../styles/recipes/host.js";
|
|
8
|
+
import { vfFocusUnderline as d } from "../styles/recipes/focus.js";
|
|
9
|
+
import { GridSnapController as f } from "../grid-snap.js";
|
|
10
|
+
import { DocumentListenersController as p } from "../document-listeners.js";
|
|
11
|
+
import { DragController as m } from "../drag.js";
|
|
12
12
|
import "../motion.js";
|
|
13
13
|
import { FocusRuleController as h } from "../focus-modality.js";
|
|
14
14
|
import { deriveOpenArt as g } from "../open-art.js";
|
|
@@ -18,20 +18,20 @@ import { property as x, state as S } from "lit/decorators.js";
|
|
|
18
18
|
var C = {
|
|
19
19
|
large: 32,
|
|
20
20
|
small: 16
|
|
21
|
-
}, w = 1, T = 8, E = (e, t) => t <= 0 ? Math.max(e, 0) : Math.min(Math.max(e, 0), t), D = class extends
|
|
22
|
-
constructor(...
|
|
23
|
-
super(...
|
|
21
|
+
}, w = 1, T = 8, E = (e, t) => t <= 0 ? Math.max(e, 0) : Math.min(Math.max(e, 0), t), D = class extends s(_) {
|
|
22
|
+
constructor(...t) {
|
|
23
|
+
super(...t), this.label = "", this.size = "large", this.selectable = !1, this.selected = !1, this.color = !1, this.open = !1, this.movable = !1, this.editable = !1, this.maxlength = 31, this.scale = new n(this), this.gridSnap = new f(this), this.focusRule = new h(this), this._editing = !1, this._draft = "", this.#e = 0, this._ghost = null, this.#t = null, this.#n = this.attachInternals(), this.#i = "", this.#a = "", this.#o = 0, this.#s = -Infinity, this.#c = new p(this, () => [[
|
|
24
24
|
document,
|
|
25
25
|
"pointerdown",
|
|
26
26
|
this.#A,
|
|
27
27
|
!0
|
|
28
28
|
]]), this.#l = (e, t, n) => ({
|
|
29
|
-
x: E(e, n.width -
|
|
30
|
-
y: E(t, n.height -
|
|
31
|
-
}), this.#u = new
|
|
29
|
+
x: E(e, n.width - i(this.offsetWidth, this)),
|
|
30
|
+
y: E(t, n.height - i(this.offsetHeight, this))
|
|
31
|
+
}), this.#u = new o(this, (e, t, n) => this.#l(e, t, n)), this.#d = {
|
|
32
32
|
x: 0,
|
|
33
33
|
y: 0
|
|
34
|
-
}, this.#f = new
|
|
34
|
+
}, this.#f = new m(this, {
|
|
35
35
|
onDragStart: (e) => !this.movable || e.button !== 0 || this._editing ? null : (this.#m(), this.#d = this.#u.seed()),
|
|
36
36
|
onDrag: (e, t) => {
|
|
37
37
|
(e !== this.#d.x || t !== this.#d.y) && this.#S(), this.#u.moveTo(e, t);
|
|
@@ -45,7 +45,7 @@ var C = {
|
|
|
45
45
|
let t = e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("label")), n = this.selected, r = e.timeStamp - this.#s < 800;
|
|
46
46
|
this.#s = e.timeStamp, this.#S(), this.selectable && (e.shiftKey || e.metaKey ? this.#D(!this.selected) : this.#D(!0)), this.editable && t && n && !r && !e.shiftKey && !e.metaKey && this.#x(), this.#T && (this.focus({ preventScroll: !0 }), this.focusRule.suppress()), this.#f.onPointerDown(e);
|
|
47
47
|
}, this.#k = () => {
|
|
48
|
-
this._editing ||
|
|
48
|
+
this._editing || e(this, "vf-open", {});
|
|
49
49
|
}, this.#A = (e) => {
|
|
50
50
|
e.composedPath().includes(this) || (this.#S(), !(e.shiftKey || e.metaKey) && this.#D(!1));
|
|
51
51
|
}, this.#j = (e) => {
|
|
@@ -62,28 +62,28 @@ var C = {
|
|
|
62
62
|
this._draft = t.value;
|
|
63
63
|
}, this.#P = (e) => {
|
|
64
64
|
e.key === "Enter" ? (e.preventDefault(), this.commitEditing(), this.focus()) : e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), this.cancelEditing(), this.focus());
|
|
65
|
-
}, this.#F = (
|
|
66
|
-
if (this.#S(), !(this._editing ||
|
|
67
|
-
if ((
|
|
68
|
-
|
|
65
|
+
}, this.#F = (t) => {
|
|
66
|
+
if (this.#S(), !(this._editing || t.defaultPrevented)) {
|
|
67
|
+
if ((t.metaKey || t.ctrlKey) && !t.altKey && (t.key.toLowerCase() === "o" || t.key === "ArrowDown")) {
|
|
68
|
+
t.preventDefault(), e(this, "vf-open", {});
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
switch (
|
|
71
|
+
switch (t.key) {
|
|
72
72
|
case "Enter":
|
|
73
73
|
if (!this.editable) return;
|
|
74
|
-
|
|
74
|
+
t.preventDefault(), this.startEditing();
|
|
75
75
|
return;
|
|
76
76
|
case " ":
|
|
77
77
|
if (!this.selectable) return;
|
|
78
|
-
|
|
78
|
+
t.preventDefault(), this.focusRule.reveal(), this.#D(!this.selected);
|
|
79
79
|
return;
|
|
80
80
|
case "ArrowLeft":
|
|
81
81
|
case "ArrowRight":
|
|
82
82
|
case "ArrowUp":
|
|
83
83
|
case "ArrowDown": {
|
|
84
84
|
if (!this.movable) return;
|
|
85
|
-
|
|
86
|
-
let
|
|
85
|
+
t.preventDefault(), this.focusRule.reveal();
|
|
86
|
+
let e = t.shiftKey ? T : w, n = t.key === "ArrowLeft" ? -e : t.key === "ArrowRight" ? e : 0, r = t.key === "ArrowUp" ? -e : t.key === "ArrowDown" ? e : 0;
|
|
87
87
|
this.#m();
|
|
88
88
|
let i = this.#u.seed();
|
|
89
89
|
this.#u.moveTo(i.x + n, i.y + r);
|
|
@@ -93,7 +93,7 @@ var C = {
|
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
95
|
static {
|
|
96
|
-
this.styles = [
|
|
96
|
+
this.styles = [u, v`
|
|
97
97
|
:host {
|
|
98
98
|
display: inline-block;
|
|
99
99
|
cursor: var(--vf-cursor, default);
|
|
@@ -161,7 +161,7 @@ var C = {
|
|
|
161
161
|
margin-top: calc(var(--vf-scale, 1) * var(--vf-icon-gap, 2px));
|
|
162
162
|
}
|
|
163
163
|
.label {
|
|
164
|
-
${
|
|
164
|
+
${l}
|
|
165
165
|
font-weight: var(--vf-font-weight, 700);
|
|
166
166
|
/* Whole system px, never a ratio — layout contract rule 2. 12, not
|
|
167
167
|
the face's 16px em: the Finder's plate is 12 system px tall, and
|
|
@@ -249,7 +249,7 @@ var C = {
|
|
|
249
249
|
selection paint at this edge, which is the whole reason it has no
|
|
250
250
|
border of its own (see .rename-box). */
|
|
251
251
|
height: calc(var(--vf-scale, 1) * var(--vf-icon-label-height, 12px));
|
|
252
|
-
${
|
|
252
|
+
${l}
|
|
253
253
|
font-weight: var(--vf-font-weight, 700);
|
|
254
254
|
line-height: calc(
|
|
255
255
|
var(--vf-scale, 1) * var(--vf-icon-label-height, 12px)
|
|
@@ -292,12 +292,12 @@ var C = {
|
|
|
292
292
|
as a visible focus (see focus-modality.ts). */
|
|
293
293
|
.caption.focus-rule .label::after {
|
|
294
294
|
--vf-focus-underline-offset: -2px;
|
|
295
|
-
${
|
|
295
|
+
${d}
|
|
296
296
|
}
|
|
297
297
|
/* No name, no plate — the rule falls back to the art cell. */
|
|
298
298
|
.art.focus-rule::after {
|
|
299
299
|
--vf-focus-underline-offset: -2px;
|
|
300
|
-
${
|
|
300
|
+
${d}
|
|
301
301
|
}
|
|
302
302
|
:host(:focus) {
|
|
303
303
|
outline: none;
|
|
@@ -334,7 +334,7 @@ var C = {
|
|
|
334
334
|
}
|
|
335
335
|
#p;
|
|
336
336
|
#m() {
|
|
337
|
-
this.#p ||=
|
|
337
|
+
this.#p ||= c(this, `vf-icon${this.label ? ` ("${this.label}")` : ""}`, "<vf-icon movable label=\"Read Me\" width=\"64\" top=\"16\" left=\"16\">");
|
|
338
338
|
}
|
|
339
339
|
firstUpdated() {
|
|
340
340
|
document.fonts.ready.then(() => this.#h());
|
|
@@ -350,7 +350,7 @@ var C = {
|
|
|
350
350
|
let n = document.createRange();
|
|
351
351
|
n.selectNodeContents(e), t = n.getBoundingClientRect().width, n.detach();
|
|
352
352
|
}
|
|
353
|
-
let
|
|
353
|
+
let n = t / r(this) + 2, i = Math.max(2, Math.ceil(n / 2) * 2);
|
|
354
354
|
this.#e = this._editing && t === 0 ? Math.max(i, C[this.size]) : i, e.style.width = this.#g;
|
|
355
355
|
}
|
|
356
356
|
get #g() {
|
|
@@ -399,18 +399,18 @@ var C = {
|
|
|
399
399
|
commitEditing() {
|
|
400
400
|
if (!this._editing) return;
|
|
401
401
|
this._editing = !1;
|
|
402
|
-
let
|
|
403
|
-
if (
|
|
404
|
-
this._draft =
|
|
405
|
-
attempted:
|
|
406
|
-
kept:
|
|
402
|
+
let t = this.#a, n = this._draft;
|
|
403
|
+
if (n.trim() === "") {
|
|
404
|
+
this._draft = t, n !== t && e(this, "vf-name-rejected", {
|
|
405
|
+
attempted: n,
|
|
406
|
+
kept: t,
|
|
407
407
|
reason: "empty"
|
|
408
408
|
});
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
411
|
-
|
|
412
|
-
label:
|
|
413
|
-
previous:
|
|
411
|
+
n !== t && (this.label = n, e(this, "vf-change", {
|
|
412
|
+
label: n,
|
|
413
|
+
previous: t
|
|
414
414
|
}));
|
|
415
415
|
}
|
|
416
416
|
cancelEditing() {
|
|
@@ -476,42 +476,42 @@ var C = {
|
|
|
476
476
|
#E() {
|
|
477
477
|
this.hasAttribute("tabindex") || (this.#T ? this.tabIndex = 0 : this.removeAttribute("tabindex"));
|
|
478
478
|
}
|
|
479
|
-
#D(
|
|
480
|
-
|
|
479
|
+
#D(t) {
|
|
480
|
+
t !== this.selected && (this.selected = t, e(this, "vf-select", { selected: t }));
|
|
481
481
|
}
|
|
482
482
|
#O;
|
|
483
483
|
#k;
|
|
484
484
|
#A;
|
|
485
485
|
#j;
|
|
486
486
|
#M;
|
|
487
|
-
#N(
|
|
488
|
-
|
|
489
|
-
attempted:
|
|
490
|
-
accepted:
|
|
487
|
+
#N(t) {
|
|
488
|
+
e(this, "vf-name-too-long", {
|
|
489
|
+
attempted: t,
|
|
490
|
+
accepted: t.slice(0, this.maxlength),
|
|
491
491
|
limit: this.maxlength
|
|
492
492
|
});
|
|
493
493
|
}
|
|
494
494
|
#P;
|
|
495
495
|
#F;
|
|
496
496
|
};
|
|
497
|
-
|
|
497
|
+
a([x()], D.prototype, "label", void 0), a([x({ reflect: !0 })], D.prototype, "size", void 0), a([x({
|
|
498
498
|
type: Boolean,
|
|
499
499
|
reflect: !0
|
|
500
|
-
})], D.prototype, "selectable", void 0),
|
|
500
|
+
})], D.prototype, "selectable", void 0), a([x({
|
|
501
501
|
type: Boolean,
|
|
502
502
|
reflect: !0
|
|
503
|
-
})], D.prototype, "selected", void 0),
|
|
503
|
+
})], D.prototype, "selected", void 0), a([x({
|
|
504
504
|
type: Boolean,
|
|
505
505
|
reflect: !0
|
|
506
|
-
})], D.prototype, "color", void 0),
|
|
506
|
+
})], D.prototype, "color", void 0), a([x({
|
|
507
507
|
type: Boolean,
|
|
508
508
|
reflect: !0
|
|
509
|
-
})], D.prototype, "open", void 0),
|
|
509
|
+
})], D.prototype, "open", void 0), a([x({
|
|
510
510
|
type: Boolean,
|
|
511
511
|
reflect: !0
|
|
512
|
-
})], D.prototype, "movable", void 0),
|
|
512
|
+
})], D.prototype, "movable", void 0), a([x({
|
|
513
513
|
type: Boolean,
|
|
514
514
|
reflect: !0
|
|
515
|
-
})], D.prototype, "editable", void 0),
|
|
515
|
+
})], D.prototype, "editable", void 0), a([x({ type: Number })], D.prototype, "width", void 0), a([x({ type: Number })], D.prototype, "maxlength", void 0), a([S()], D.prototype, "_editing", void 0), a([S()], D.prototype, "_draft", void 0), a([S()], D.prototype, "_ghost", void 0), D = a([t("vf-icon")], D);
|
|
516
516
|
//#endregion
|
|
517
517
|
export { D as VfIcon };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import n from "../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { emit as e } from "../events.js";
|
|
2
|
+
import { vfElement as t } from "../define.js";
|
|
3
|
+
import { ScaleController as n } from "../scale.js";
|
|
4
|
+
import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { VfPositioned as i } from "../position.js";
|
|
6
|
+
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
+
import { vfFocusRing as o } from "../styles/recipes/focus.js";
|
|
8
8
|
import { LitElement as s, css as c, html as l } from "lit";
|
|
9
9
|
import { property as u } from "lit/decorators.js";
|
|
10
10
|
//#region src/components/vf-list-item.ts
|
|
11
|
-
var d = class extends
|
|
11
|
+
var d = class extends i(s) {
|
|
12
12
|
static {
|
|
13
|
-
this.styles = [
|
|
13
|
+
this.styles = [a, c`
|
|
14
14
|
:host {
|
|
15
15
|
display: flex;
|
|
16
16
|
align-items: center;
|
|
@@ -48,7 +48,7 @@ var d = class extends r(s) {
|
|
|
48
48
|
across selected rows while Space still acts on it. */
|
|
49
49
|
:host(:focus) {
|
|
50
50
|
--vf-focus-offset: -1px;
|
|
51
|
-
${
|
|
51
|
+
${o}
|
|
52
52
|
}
|
|
53
53
|
:host([selected]) {
|
|
54
54
|
background: var(--vf-highlight, #000);
|
|
@@ -75,25 +75,25 @@ var d = class extends r(s) {
|
|
|
75
75
|
}
|
|
76
76
|
#e;
|
|
77
77
|
constructor() {
|
|
78
|
-
super(), this.scale = new
|
|
78
|
+
super(), this.scale = new n(this), this.value = "", this.selected = !1, this.disabled = !1, this.listDisabled = !1, this.#e = this.attachInternals(), this.#e.role = "option";
|
|
79
79
|
}
|
|
80
80
|
connectedCallback() {
|
|
81
81
|
super.connectedCallback(), this.hasAttribute("tabindex") || (this.tabIndex = -1);
|
|
82
82
|
}
|
|
83
|
-
updated(
|
|
84
|
-
|
|
83
|
+
updated(t) {
|
|
84
|
+
t.has("selected") && (this.#e.ariaSelected = this.selected ? "true" : "false"), (t.has("disabled") || t.has("listDisabled")) && (this.#e.ariaDisabled = this.disabled || this.listDisabled ? "true" : null), t.has("disabled") && t.get("disabled") !== void 0 && e(this, "vf-list-item-disabled-change", { item: this }, { composed: !1 });
|
|
85
85
|
}
|
|
86
86
|
render() {
|
|
87
87
|
return l`<slot name="icon"></slot
|
|
88
88
|
><span class="text" part="text"><slot></slot></span>`;
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
|
-
|
|
91
|
+
r([u()], d.prototype, "value", void 0), r([u({
|
|
92
92
|
type: Boolean,
|
|
93
93
|
reflect: !0
|
|
94
|
-
})], d.prototype, "selected", void 0),
|
|
94
|
+
})], d.prototype, "selected", void 0), r([u({
|
|
95
95
|
type: Boolean,
|
|
96
96
|
reflect: !0
|
|
97
|
-
})], d.prototype, "disabled", void 0),
|
|
97
|
+
})], d.prototype, "disabled", void 0), r([u({ attribute: !1 })], d.prototype, "listDisabled", void 0), d = r([t("vf-list-item")], d);
|
|
98
98
|
//#endregion
|
|
99
99
|
export { d as VfListItem };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import n from "../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { emit as e } from "../events.js";
|
|
2
|
+
import { vfElement as t } from "../define.js";
|
|
3
|
+
import { ScaleController as n } from "../scale.js";
|
|
4
|
+
import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { VfPositioned as i } from "../position.js";
|
|
6
|
+
import { vfBase as a } from "../styles/recipes/host.js";
|
|
7
|
+
import { vfFocusRing as o } from "../styles/recipes/focus.js";
|
|
8
|
+
import { vfScrollRail as s } from "../styles/recipes/scroll-rail.js";
|
|
9
|
+
import { GridSnapController as c } from "../grid-snap.js";
|
|
10
10
|
import { ScrollStateController as l } from "../scroll-state.js";
|
|
11
11
|
import { ScrollRailController as u, renderScrollRail as d } from "../scroll-rail.js";
|
|
12
12
|
import { TypeAheadBuffer as f } from "../type-ahead.js";
|
|
13
13
|
import { LitElement as p, css as m, html as h, nothing as g } from "lit";
|
|
14
14
|
import { property as _, query as v, queryAssignedElements as y, state as b } from "lit/decorators.js";
|
|
15
15
|
//#region src/components/vf-list.ts
|
|
16
|
-
var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = class extends
|
|
16
|
+
var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = class extends i(p) {
|
|
17
17
|
static {
|
|
18
18
|
this.styles = [
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
a,
|
|
20
|
+
s,
|
|
21
21
|
m`
|
|
22
22
|
:host {
|
|
23
23
|
display: block;
|
|
@@ -66,7 +66,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
66
66
|
render()); the ring keeps that stop visible, inset to stay in-box. */
|
|
67
67
|
.list:focus-visible {
|
|
68
68
|
--vf-focus-offset: -2px;
|
|
69
|
-
${
|
|
69
|
+
${o}
|
|
70
70
|
}
|
|
71
71
|
`
|
|
72
72
|
];
|
|
@@ -77,7 +77,7 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
77
77
|
#r;
|
|
78
78
|
#i;
|
|
79
79
|
constructor() {
|
|
80
|
-
super(), this.scale = new
|
|
80
|
+
super(), this.scale = new n(this), this.gridSnap = new c(this), this.scrollState = new l(this, () => this.viewport, () => this.content, (e) => {
|
|
81
81
|
this._scrollable = e.x || e.y;
|
|
82
82
|
}), this.rail = new u(this, {
|
|
83
83
|
getScroll: () => this.viewport,
|
|
@@ -192,15 +192,15 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
192
192
|
this.#s(e, !1);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
#s(
|
|
196
|
-
let
|
|
197
|
-
for (let e of
|
|
198
|
-
let
|
|
199
|
-
this.#r = [...
|
|
200
|
-
let
|
|
201
|
-
this.value !==
|
|
195
|
+
#s(t, n) {
|
|
196
|
+
let r = this._items, i = this.multiple ? t : t.slice(0, 1), a = r.filter((e) => e.selected).map((e) => e.value);
|
|
197
|
+
for (let e of r) e.selected = i.includes(e.value) && !e.disabled;
|
|
198
|
+
let o = r.filter((e) => e.selected).map((e) => e.value);
|
|
199
|
+
this.#r = [...o];
|
|
200
|
+
let s = o[0] ?? "";
|
|
201
|
+
this.value !== s && (this.value = s), x(this.values, o) || (this.values = o), this.#c(), n && !x(a, o) && e(this, "vf-change", {
|
|
202
202
|
value: this.value,
|
|
203
|
-
values: [...
|
|
203
|
+
values: [...o]
|
|
204
204
|
});
|
|
205
205
|
}
|
|
206
206
|
#c() {
|
|
@@ -242,15 +242,15 @@ var x = (e, t) => e.length === t.length && e.every((e, n) => e === t[n]), S = cl
|
|
|
242
242
|
!t || t.disabled || (t.focus(), t.scrollIntoView({ block: "nearest" }));
|
|
243
243
|
}
|
|
244
244
|
};
|
|
245
|
-
|
|
245
|
+
r([v(".list")], S.prototype, "viewport", void 0), r([v(".list-content")], S.prototype, "content", void 0), r([b()], S.prototype, "_scrollable", void 0), r([_({
|
|
246
246
|
type: Boolean,
|
|
247
247
|
reflect: !0
|
|
248
|
-
})], S.prototype, "multiple", void 0),
|
|
248
|
+
})], S.prototype, "multiple", void 0), r([_()], S.prototype, "value", void 0), r([_({ attribute: !1 })], S.prototype, "values", void 0), r([_({
|
|
249
249
|
type: Boolean,
|
|
250
250
|
reflect: !0
|
|
251
|
-
})], S.prototype, "disabled", void 0),
|
|
251
|
+
})], S.prototype, "disabled", void 0), r([_()], S.prototype, "label", void 0), r([y({
|
|
252
252
|
selector: "vf-list-item",
|
|
253
253
|
flatten: !0
|
|
254
|
-
})], S.prototype, "_items", void 0), S =
|
|
254
|
+
})], S.prototype, "_items", void 0), S = r([t("vf-list")], S);
|
|
255
255
|
//#endregion
|
|
256
256
|
export { S as VfList };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { deferActivation as e, emit as t } from "../events.js";
|
|
2
|
+
import { vfElement as n } from "../define.js";
|
|
3
|
+
import { ScaleController as r } from "../scale.js";
|
|
4
|
+
import i from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { VfPositioned as a } from "../position.js";
|
|
6
|
+
import { vfDisplay as o } from "../styles/recipes/display-face.js";
|
|
7
|
+
import { vfBase as s } from "../styles/recipes/host.js";
|
|
8
|
+
import { releaseAfterGesture as c } from "../document-listeners.js";
|
|
9
9
|
import { runSelectionBlink as l } from "../motion.js";
|
|
10
10
|
import { CHECKMARK as u, glyphSvg as d } from "../glyphs.js";
|
|
11
11
|
import { LitElement as f, css as p, html as m, nothing as h } from "lit";
|
|
@@ -37,11 +37,11 @@ function x(e, t) {
|
|
|
37
37
|
let a = r.Meta ? e.metaKey || e.ctrlKey : !e.metaKey, o = r.Control ? e.ctrlKey : r.Meta || !e.ctrlKey;
|
|
38
38
|
return a && o && e.altKey === r.Alt && e.shiftKey === r.Shift && e.key.toLowerCase() === i.toLowerCase();
|
|
39
39
|
}
|
|
40
|
-
var S = class extends
|
|
40
|
+
var S = class extends a(f) {
|
|
41
41
|
static {
|
|
42
42
|
this.styles = [
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
s,
|
|
44
|
+
o,
|
|
45
45
|
p`
|
|
46
46
|
:host {
|
|
47
47
|
display: block;
|
|
@@ -174,8 +174,8 @@ var S = class extends r(f) {
|
|
|
174
174
|
#r;
|
|
175
175
|
#i;
|
|
176
176
|
constructor() {
|
|
177
|
-
super(), this.scale = new
|
|
178
|
-
e.defaultPrevented || e.isComposing || this.disabled || !this.shortcut || this.closest("vf-menu[shortcuts], vf-menu-bar[shortcuts]") && x(e, this.shortcut) && (e.preventDefault(), !(e.repeat || this.#t) && (
|
|
177
|
+
super(), this.scale = new r(this), this.disabled = !1, this.checked = !1, this.active = !1, this.checkable = !1, this.shortcut = "", this._blinkPhase = null, this.#t = !1, this.#n = !1, this.#r = this.attachInternals(), this.#i = !1, this.#d = (e) => {
|
|
178
|
+
e.defaultPrevented || e.isComposing || this.disabled || !this.shortcut || this.closest("vf-menu[shortcuts], vf-menu-bar[shortcuts]") && x(e, this.shortcut) && (e.preventDefault(), !(e.repeat || this.#t) && (t(this, "vf-menu-flash-request", { item: this }, { composed: !1 }), this.activate()));
|
|
179
179
|
}, this.addEventListener("keydown", this.#u), this.addEventListener("pointerdown", this.#c), this.addEventListener("click", this.#l);
|
|
180
180
|
}
|
|
181
181
|
get #a() {
|
|
@@ -216,16 +216,16 @@ var S = class extends r(f) {
|
|
|
216
216
|
`;
|
|
217
217
|
}
|
|
218
218
|
#c() {
|
|
219
|
-
this.#i = this.closest("vf-menu") !== null, this.#i &&
|
|
219
|
+
this.#i = this.closest("vf-menu") !== null, this.#i && c(() => {
|
|
220
220
|
this.#i = !1;
|
|
221
221
|
});
|
|
222
222
|
}
|
|
223
|
-
#l(
|
|
223
|
+
#l(t) {
|
|
224
224
|
if (this.#i) {
|
|
225
225
|
this.#i = !1;
|
|
226
226
|
return;
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
e(this, t, () => this.activate());
|
|
229
229
|
}
|
|
230
230
|
#u(e) {
|
|
231
231
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), this.activate());
|
|
@@ -246,26 +246,26 @@ var S = class extends r(f) {
|
|
|
246
246
|
}
|
|
247
247
|
#p() {
|
|
248
248
|
let e = this.value ?? (this.textContent ?? "").trim();
|
|
249
|
-
|
|
249
|
+
t(this, "vf-menu-select", {
|
|
250
250
|
value: e,
|
|
251
251
|
item: this
|
|
252
252
|
});
|
|
253
|
-
let
|
|
254
|
-
(!
|
|
253
|
+
let n = this.closest("vf-menu");
|
|
254
|
+
(!n || n.hasAttribute("open")) && t(this, "vf-menu-close-request", { item: this }, { composed: !1 });
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
|
-
|
|
257
|
+
i([g({
|
|
258
258
|
type: Boolean,
|
|
259
259
|
reflect: !0
|
|
260
|
-
})], S.prototype, "disabled", void 0),
|
|
260
|
+
})], S.prototype, "disabled", void 0), i([g({
|
|
261
261
|
type: Boolean,
|
|
262
262
|
reflect: !0
|
|
263
|
-
})], S.prototype, "checked", void 0),
|
|
263
|
+
})], S.prototype, "checked", void 0), i([g({
|
|
264
264
|
type: Boolean,
|
|
265
265
|
reflect: !0
|
|
266
|
-
})], S.prototype, "active", void 0),
|
|
266
|
+
})], S.prototype, "active", void 0), i([g({
|
|
267
267
|
type: Boolean,
|
|
268
268
|
reflect: !0
|
|
269
|
-
})], S.prototype, "checkable", void 0),
|
|
269
|
+
})], S.prototype, "checkable", void 0), i([g()], S.prototype, "shortcut", void 0), i([g()], S.prototype, "value", void 0), i([_()], S.prototype, "_blinkPhase", void 0), S = i([n("vf-menu-item")], S);
|
|
270
270
|
//#endregion
|
|
271
271
|
export { S as VfMenuItem };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { deferActivation as e, emit as t } from "../events.js";
|
|
2
|
+
import { vfElement as n } from "../define.js";
|
|
3
|
+
import { ScaleController as r } from "../scale.js";
|
|
4
|
+
import i from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { VfPositioned as a } from "../position.js";
|
|
6
|
+
import { vfDisplay as o } from "../styles/recipes/display-face.js";
|
|
7
|
+
import { vfBase as s } from "../styles/recipes/host.js";
|
|
8
|
+
import { vfPanel as c } from "../styles/recipes/surface.js";
|
|
9
|
+
import { vfFocusUnderline as l } from "../styles/recipes/focus.js";
|
|
10
|
+
import { GridSnapController as u } from "../grid-snap.js";
|
|
11
|
+
import { DocumentListenersController as d, releaseAfterGesture as f } from "../document-listeners.js";
|
|
12
12
|
import { runSelectionBlink as p } from "../motion.js";
|
|
13
13
|
import { FocusRuleController as m } from "../focus-modality.js";
|
|
14
14
|
import { TypeAheadBuffer as h } from "../type-ahead.js";
|
|
@@ -16,9 +16,9 @@ import { MenuPressController as g } from "../menu-press.js";
|
|
|
16
16
|
import { LitElement as _, css as v, html as y, nothing as b } from "lit";
|
|
17
17
|
import { property as x, query as S, queryAssignedElements as C, state as w } from "lit/decorators.js";
|
|
18
18
|
//#region src/components/vf-menu.ts
|
|
19
|
-
var T = class extends
|
|
19
|
+
var T = class extends a(_) {
|
|
20
20
|
constructor(...e) {
|
|
21
|
-
super(...e), this.scale = new
|
|
21
|
+
super(...e), this.scale = new r(this), this.gridSnap = new u(this), this.#e = new m(this), this.label = "", this.open = !1, this.shortcuts = !1, this.barTabIndex = 0, this.#t = new g(this, {
|
|
22
22
|
menus: () => [this],
|
|
23
23
|
open: (e) => {
|
|
24
24
|
e.open = !0;
|
|
@@ -66,7 +66,7 @@ var T = class extends r(_) {
|
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
|
-
}, this.#p = new
|
|
69
|
+
}, this.#p = new d(this, () => [[
|
|
70
70
|
document,
|
|
71
71
|
"pointerdown",
|
|
72
72
|
this.#u,
|
|
@@ -86,9 +86,9 @@ var T = class extends r(_) {
|
|
|
86
86
|
}
|
|
87
87
|
static {
|
|
88
88
|
this.styles = [
|
|
89
|
-
|
|
90
|
-
i,
|
|
89
|
+
s,
|
|
91
90
|
o,
|
|
91
|
+
c,
|
|
92
92
|
v`
|
|
93
93
|
:host {
|
|
94
94
|
display: inline-block;
|
|
@@ -181,7 +181,7 @@ var T = class extends r(_) {
|
|
|
181
181
|
}
|
|
182
182
|
:host(:not([open])) .label.vf-focus-rule .title::after {
|
|
183
183
|
--vf-focus-underline-offset: -2px;
|
|
184
|
-
${
|
|
184
|
+
${l}
|
|
185
185
|
}
|
|
186
186
|
.panel {
|
|
187
187
|
position: absolute;
|
|
@@ -319,25 +319,25 @@ var T = class extends r(_) {
|
|
|
319
319
|
this.open = !this.open;
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
|
|
322
|
+
t(this, "vf-menu-toggle-request", { menu: this }, {
|
|
323
323
|
cancelable: !0,
|
|
324
324
|
composed: !1
|
|
325
325
|
}) && (this.open = !this.open);
|
|
326
326
|
}
|
|
327
327
|
#v() {
|
|
328
|
-
this.#a = !0,
|
|
328
|
+
this.#a = !0, f(() => {
|
|
329
329
|
this.#a = !1;
|
|
330
330
|
});
|
|
331
331
|
}
|
|
332
|
-
#y(
|
|
332
|
+
#y(t) {
|
|
333
333
|
if (this.#a) {
|
|
334
334
|
this.#a = !1;
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
|
-
|
|
337
|
+
e(this, t, () => this.#_());
|
|
338
338
|
}
|
|
339
339
|
#b() {
|
|
340
|
-
|
|
340
|
+
t(this, "vf-menu-hover", { menu: this }, { composed: !1 });
|
|
341
341
|
}
|
|
342
342
|
#x(e) {
|
|
343
343
|
if (e.key === "Enter" || e.key === " ") {
|
|
@@ -350,18 +350,18 @@ var T = class extends r(_) {
|
|
|
350
350
|
await this.updateComplete, this.items[0]?.focus();
|
|
351
351
|
}
|
|
352
352
|
};
|
|
353
|
-
|
|
353
|
+
i([x()], T.prototype, "label", void 0), i([x({
|
|
354
354
|
type: Boolean,
|
|
355
355
|
reflect: !0
|
|
356
|
-
})], T.prototype, "open", void 0),
|
|
356
|
+
})], T.prototype, "open", void 0), i([x({
|
|
357
357
|
type: Boolean,
|
|
358
358
|
reflect: !0
|
|
359
|
-
})], T.prototype, "shortcuts", void 0),
|
|
359
|
+
})], T.prototype, "shortcuts", void 0), i([x({
|
|
360
360
|
type: Number,
|
|
361
361
|
attribute: !1
|
|
362
|
-
})], T.prototype, "barTabIndex", void 0),
|
|
362
|
+
})], T.prototype, "barTabIndex", void 0), i([S(".label")], T.prototype, "_labelEl", void 0), i([C({
|
|
363
363
|
selector: "vf-menu-item",
|
|
364
364
|
flatten: !0
|
|
365
|
-
})], T.prototype, "_assignedItems", void 0),
|
|
365
|
+
})], T.prototype, "_assignedItems", void 0), i([w()], T.prototype, "_flashOn", void 0), T = i([n("vf-menu")], T);
|
|
366
366
|
//#endregion
|
|
367
367
|
export { T as VfMenu };
|