vintage-frames 0.3.0 → 0.5.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 +181 -32
- package/dist/components/vf-button.js +25 -25
- package/dist/components/vf-checkbox.js +15 -15
- package/dist/components/vf-container.d.ts +37 -3
- package/dist/components/vf-container.js +32 -10
- package/dist/components/vf-desktop.d.ts +103 -22
- package/dist/components/vf-desktop.js +100 -121
- package/dist/components/vf-dialog.d.ts +19 -15
- package/dist/components/vf-dialog.js +45 -53
- 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-progress-bar.js +3 -3
- 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 +32 -32
- package/dist/components/vf-window.js +69 -69
- package/dist/index.d.ts +14 -0
- package/dist/index.js +73 -71
- package/dist/modal-dialog.js +21 -21
- package/dist/pattern-fill.d.ts +91 -0
- package/dist/pattern-fill.js +74 -0
- package/dist/patterns.d.ts +80 -0
- package/dist/patterns.js +477 -0
- package/dist/scroll-rail.js +37 -37
- package/dist/styles/recipes/pattern.d.ts +2 -12
- package/dist/styles/recipes/pattern.js +11 -15
- package/dist/styles/recipes/scroll-rail.d.ts +3 -12
- package/dist/styles/recipes/scroll-rail.js +7 -15
- package/dist/styles/recipes/surface.d.ts +18 -7
- package/dist/styles/recipes/surface.js +15 -0
- package/dist/text-control.js +11 -11
- package/dist/tile-grid.d.ts +4 -2
- package/dist/tile-grid.js +3 -3
- package/dist/toggle-control.js +5 -5
- package/dist/track-width.d.ts +7 -0
- package/dist/track-width.js +6 -3
- package/docs/SPEC.md +14 -10
- package/editor/vscode.html-custom-data.json +14 -4
- package/editor/web-types.json +46 -8
- package/package.json +3 -1
|
@@ -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 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import t from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { emitNative as e } from "../events.js";
|
|
2
|
+
import { vfElement as t } from "../define.js";
|
|
3
|
+
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
4
|
+
import { VfPositioned as r } from "../position.js";
|
|
5
|
+
import { vfBase as i } from "../styles/recipes/host.js";
|
|
6
|
+
import { vfField as a } from "../styles/recipes/field.js";
|
|
7
7
|
import { STEPPER as o, STEPPER_DOWN_FILL as s, STEPPER_UP_FILL as c } from "../glyphs.js";
|
|
8
8
|
import { VfTextControlBase as l } from "../text-control.js";
|
|
9
9
|
import { decimalsOf as u } from "../number.js";
|
|
@@ -12,9 +12,9 @@ import { property as m, query as h, state as g } from "lit/decorators.js";
|
|
|
12
12
|
import { classMap as _ } from "lit/directives/class-map.js";
|
|
13
13
|
import { live as v } from "lit/directives/live.js";
|
|
14
14
|
//#region src/components/vf-number-field.ts
|
|
15
|
-
var y = class extends
|
|
16
|
-
constructor(...
|
|
17
|
-
super(...
|
|
15
|
+
var y = class extends r(l) {
|
|
16
|
+
constructor(...t) {
|
|
17
|
+
super(...t), this.step = 1, this.pressed = null, this.#l = (e) => {
|
|
18
18
|
if (this.isDisabled || this.readonly) return;
|
|
19
19
|
let t = e.currentTarget.classList.contains("up") ? 1 : -1;
|
|
20
20
|
e.preventDefault();
|
|
@@ -46,15 +46,15 @@ var y = class extends n(l) {
|
|
|
46
46
|
}
|
|
47
47
|
}, this.#f = (e) => {
|
|
48
48
|
this.value = e.target.value, this.#o("vf-input");
|
|
49
|
-
}, this.#p = (
|
|
50
|
-
let
|
|
51
|
-
this.value = Number.isNaN(
|
|
49
|
+
}, this.#p = (t) => {
|
|
50
|
+
let n = t.target.value, r = parseFloat(n);
|
|
51
|
+
this.value = Number.isNaN(r) ? n : String(Number(this.#r(r).toFixed(u(this.step)))), this.#o("vf-change"), e(this, "change");
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
static {
|
|
55
55
|
this.styles = [
|
|
56
|
-
r,
|
|
57
56
|
i,
|
|
57
|
+
a,
|
|
58
58
|
d`
|
|
59
59
|
:host {
|
|
60
60
|
display: inline-flex;
|
|
@@ -151,9 +151,9 @@ var y = class extends n(l) {
|
|
|
151
151
|
#r(e) {
|
|
152
152
|
return this.min != null && e < this.min ? this.min : this.max != null && e > this.max ? this.max : e;
|
|
153
153
|
}
|
|
154
|
-
#i(
|
|
155
|
-
let
|
|
156
|
-
|
|
154
|
+
#i(t) {
|
|
155
|
+
let n = String(Number(this.#r(t).toFixed(u(this.step))));
|
|
156
|
+
n !== this.value && (this.value = n, this.#o("vf-change"), e(this, "input"), e(this, "change"));
|
|
157
157
|
}
|
|
158
158
|
#a(e) {
|
|
159
159
|
if (this.isDisabled || this.readonly) return;
|
|
@@ -243,6 +243,6 @@ var y = class extends n(l) {
|
|
|
243
243
|
`;
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
|
|
246
|
+
n([m({ type: Number })], y.prototype, "min", void 0), n([m({ type: Number })], y.prototype, "max", void 0), n([m({ type: Number })], y.prototype, "step", void 0), n([g()], y.prototype, "pressed", void 0), n([h("input")], y.prototype, "input", void 0), y = n([t("vf-number-field")], y);
|
|
247
247
|
//#endregion
|
|
248
248
|
export { y as VfNumberField };
|
|
@@ -5,8 +5,8 @@ import { VfPositioned as o } from "../position.js";
|
|
|
5
5
|
import { vfBase as s } from "../styles/recipes/host.js";
|
|
6
6
|
import { tileImage as c, tileRects as l, tileSpan as u, vfTileMaskSize as d } from "../styles/recipes/tile.js";
|
|
7
7
|
import { TileRasterCache as f, patternOverride as p, tileGrid as m, vfTileGrid as h } from "../tile-grid.js";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { TrackWidthController as g } from "../track-width.js";
|
|
9
|
+
import { GridSnapController as _ } from "../grid-snap.js";
|
|
10
10
|
import { LitElement as v, css as y, html as b, unsafeCSS as x } from "lit";
|
|
11
11
|
import { property as S, query as C } from "lit/decorators.js";
|
|
12
12
|
//#region src/components/vf-progress-bar.ts
|
|
@@ -220,7 +220,7 @@ var w = 12, T = [
|
|
|
220
220
|
#e;
|
|
221
221
|
#t;
|
|
222
222
|
constructor() {
|
|
223
|
-
super(), this.scale = new t(this), this.gridSnap = new
|
|
223
|
+
super(), this.scale = new t(this), this.gridSnap = new _(this), this.value = 0, this.max = 100, this.indeterminate = !1, this.label = "", this.trackSize = new g(this, () => this.track), this._pattern = "", this.#e = new f(), this.#t = this.attachInternals(), this.#t.role = "progressbar", this.#t.ariaValueMin = "0";
|
|
224
224
|
}
|
|
225
225
|
get effectiveMax() {
|
|
226
226
|
return this.max > 0 ? this.max : 100;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { emit as e, emitNative 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 { vfBase as o } from "../styles/recipes/host.js";
|
|
7
7
|
import { VfFormControl as s } from "../form-control.js";
|
|
8
8
|
import { VfRadio as c } from "./vf-radio.js";
|
|
9
9
|
import { css as l, html as u } from "lit";
|
|
10
10
|
import { property as d } from "lit/decorators.js";
|
|
11
11
|
//#region src/components/vf-radio-group.ts
|
|
12
|
-
var f = class extends
|
|
12
|
+
var f = class extends a(s) {
|
|
13
13
|
static {
|
|
14
|
-
this.styles = [
|
|
14
|
+
this.styles = [o, l`
|
|
15
15
|
:host {
|
|
16
16
|
display: block;
|
|
17
17
|
}
|
|
@@ -30,7 +30,7 @@ var f = class extends r(s) {
|
|
|
30
30
|
return "Please select one of these options.";
|
|
31
31
|
}
|
|
32
32
|
constructor() {
|
|
33
|
-
super(), this.value = "", this.name = "", this.label = "", this.scale = new
|
|
33
|
+
super(), this.value = "", this.name = "", this.label = "", this.scale = new r(this), this.mutationObserver = null, this.syncedKey = null, this.handleRadioChange = (e) => {
|
|
34
34
|
let t = e.target;
|
|
35
35
|
t === this || !(t instanceof c) || t.closest("vf-radio-group") === this && (this.isDisabled || t.disabled || this.selectRadio(t, !1));
|
|
36
36
|
}, this.handleKeydown = (e) => {
|
|
@@ -90,9 +90,9 @@ var f = class extends r(s) {
|
|
|
90
90
|
focus(e) {
|
|
91
91
|
this.radios.find((e) => e.tabIndex === 0)?.focus(e);
|
|
92
92
|
}
|
|
93
|
-
selectRadio(
|
|
94
|
-
let
|
|
95
|
-
this.value =
|
|
93
|
+
selectRadio(n, r) {
|
|
94
|
+
let i = this.value !== n.value;
|
|
95
|
+
this.value = n.value, this.syncRadios(), r && n.focus(), i && (e(this, "vf-change", { value: this.value }), t(this, "input"), t(this, "change"));
|
|
96
96
|
}
|
|
97
97
|
adoptPreChecked() {
|
|
98
98
|
if (this.value !== "") return;
|
|
@@ -100,6 +100,6 @@ var f = class extends r(s) {
|
|
|
100
100
|
e && e.value !== "" && (this.value = e.value, this.latchFormDefault(this.value));
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
|
|
103
|
+
i([d()], f.prototype, "value", void 0), i([d({ reflect: !0 })], f.prototype, "name", void 0), i([d()], f.prototype, "label", void 0), f = i([n("vf-radio-group")], f);
|
|
104
104
|
//#endregion
|
|
105
105
|
export { f as VfRadioGroup };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import t from "../
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { emit as e } from "../events.js";
|
|
2
|
+
import { vfElement as t } from "../define.js";
|
|
3
|
+
import n from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
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 { vfFocusUnderline as o } from "../styles/recipes/focus.js";
|
|
8
|
+
import { vfToggle as s } from "../styles/recipes/toggle.js";
|
|
9
9
|
import { RADIO_DOT as c, RADIO_FACE as l, RADIO_RING as u, RADIO_RING_PRESSED as d } from "../glyphs.js";
|
|
10
10
|
import { VfToggleControl as f } from "../toggle-control.js";
|
|
11
11
|
import { LitElement as p, css as m, html as h } from "lit";
|
|
12
12
|
import { property as g, state as _ } from "lit/decorators.js";
|
|
13
13
|
import { classMap as v } from "lit/directives/class-map.js";
|
|
14
14
|
//#region src/components/vf-radio.ts
|
|
15
|
-
var y = class extends
|
|
15
|
+
var y = class extends r(f(p)) {
|
|
16
16
|
static {
|
|
17
17
|
this.styles = [
|
|
18
|
+
a,
|
|
18
19
|
i,
|
|
19
|
-
|
|
20
|
-
o,
|
|
20
|
+
s,
|
|
21
21
|
m`
|
|
22
22
|
/* Keyboard focus underlines the circle itself — not the label, and not a
|
|
23
23
|
ring around either (see vfFocusUnderline). One blank row below the
|
|
@@ -29,7 +29,7 @@ var y = class extends n(f(p)) {
|
|
|
29
29
|
sprite. */
|
|
30
30
|
:host(:focus-visible) .circle::after {
|
|
31
31
|
--vf-focus-underline-offset: -2px;
|
|
32
|
-
${
|
|
32
|
+
${o}
|
|
33
33
|
/* …and narrower than the well, because the shape above it is round:
|
|
34
34
|
a full-width rule reads as wider than the circle it marks. 9 of the
|
|
35
35
|
13px (5 dashes) is the closest to two thirds that still insets by a
|
|
@@ -126,15 +126,15 @@ var y = class extends n(f(p)) {
|
|
|
126
126
|
this._hasLabel = t.assignedNodes({ flatten: !0 }).some((e) => e.nodeType === Node.ELEMENT_NODE || !!e.textContent?.trim());
|
|
127
127
|
}
|
|
128
128
|
activate() {
|
|
129
|
-
this.checked || (this.externallyCoordinated || (this.checked = !0), this.focus(),
|
|
129
|
+
this.checked || (this.externallyCoordinated || (this.checked = !0), this.focus(), e(this, "vf-change", { value: this.value }));
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
|
|
132
|
+
n([g({
|
|
133
133
|
type: Boolean,
|
|
134
134
|
reflect: !0
|
|
135
|
-
})], y.prototype, "checked", void 0),
|
|
135
|
+
})], y.prototype, "checked", void 0), n([g({
|
|
136
136
|
type: Boolean,
|
|
137
137
|
reflect: !0
|
|
138
|
-
})], y.prototype, "disabled", void 0),
|
|
138
|
+
})], y.prototype, "disabled", void 0), n([g()], y.prototype, "value", void 0), n([g({ attribute: !1 })], y.prototype, "groupDisabled", void 0), n([_()], y.prototype, "_hasLabel", void 0), y = n([t("vf-radio")], y);
|
|
139
139
|
//#endregion
|
|
140
140
|
export { y as VfRadio };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import r from "../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
1
|
+
import { emit as e, emitNative as t } from "../events.js";
|
|
2
|
+
import { vfElement as n } from "../define.js";
|
|
3
|
+
import { ScaleController as r, sys as i } from "../scale.js";
|
|
4
|
+
import a from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
|
|
5
|
+
import { VfPositioned as o } from "../position.js";
|
|
6
|
+
import { vfDisplay as s } from "../styles/recipes/display-face.js";
|
|
7
|
+
import { vfBase as c } from "../styles/recipes/host.js";
|
|
8
|
+
import { vfPanel as l } from "../styles/recipes/surface.js";
|
|
9
|
+
import { vfFocusUnderline as u } from "../styles/recipes/focus.js";
|
|
10
|
+
import { GridSnapController as d } from "../grid-snap.js";
|
|
11
|
+
import { DocumentListenersController as f } from "../document-listeners.js";
|
|
12
12
|
import { runSelectionBlink as p } from "../motion.js";
|
|
13
13
|
import { CARET_DOWN as m, CARET_UP as h, glyphSvg as g } from "../glyphs.js";
|
|
14
14
|
import { VfShadowRoleControl as _ } from "../form-control.js";
|
|
@@ -20,7 +20,7 @@ import { css as E, html as D, nothing as O } from "lit";
|
|
|
20
20
|
import { property as k, query as A, queryAssignedElements as j, state as M } from "lit/decorators.js";
|
|
21
21
|
import { classMap as N } from "lit/directives/class-map.js";
|
|
22
22
|
//#region src/components/vf-select.ts
|
|
23
|
-
var P, F = class extends
|
|
23
|
+
var P, F = class extends o(_) {
|
|
24
24
|
static {
|
|
25
25
|
P = this;
|
|
26
26
|
}
|
|
@@ -29,9 +29,9 @@ var P, F = class extends i(_) {
|
|
|
29
29
|
}
|
|
30
30
|
static {
|
|
31
31
|
this.styles = [
|
|
32
|
-
|
|
33
|
-
a,
|
|
32
|
+
c,
|
|
34
33
|
s,
|
|
34
|
+
l,
|
|
35
35
|
E`
|
|
36
36
|
:host {
|
|
37
37
|
/* A popup menu is sized to its widest option — never stretched to fill
|
|
@@ -96,7 +96,7 @@ var P, F = class extends i(_) {
|
|
|
96
96
|
}
|
|
97
97
|
.control.vf-focus-rule::after {
|
|
98
98
|
--vf-focus-underline-offset: -4px;
|
|
99
|
-
${
|
|
99
|
+
${u}
|
|
100
100
|
left: calc(var(--vf-scale, 1) * -1px);
|
|
101
101
|
right: calc(var(--vf-scale, 1) * -1px);
|
|
102
102
|
}
|
|
@@ -242,7 +242,7 @@ var P, F = class extends i(_) {
|
|
|
242
242
|
return this.rowScroll < this.optionItems.length - this.visibleSlots;
|
|
243
243
|
}
|
|
244
244
|
constructor() {
|
|
245
|
-
super(), this.value = "", this.name = "", this.label = "", this.open = !1, this.cachedOptions = [], this.scale = new
|
|
245
|
+
super(), this.value = "", this.name = "", this.label = "", this.open = !1, this.cachedOptions = [], this.scale = new r(this), this.gridSnap = new d(this), this.focusRule = new v(this), this.panelListeners = new f(this, () => [
|
|
246
246
|
[
|
|
247
247
|
document,
|
|
248
248
|
"pointerdown",
|
|
@@ -260,7 +260,7 @@ var P, F = class extends i(_) {
|
|
|
260
260
|
"resize",
|
|
261
261
|
this.handleWindowResize
|
|
262
262
|
]
|
|
263
|
-
]), this.pressListeners = new
|
|
263
|
+
]), this.pressListeners = new f(this, () => [
|
|
264
264
|
[
|
|
265
265
|
document,
|
|
266
266
|
"pointermove",
|
|
@@ -431,17 +431,17 @@ var P, F = class extends i(_) {
|
|
|
431
431
|
e === -1 && (e = this.firstEnabledIndex()), this.positionPanel(Math.max(e, 0)), e !== -1 && this.setActive(e);
|
|
432
432
|
}
|
|
433
433
|
positionPanel(e) {
|
|
434
|
-
let t = this.controlEl,
|
|
435
|
-
if (!t || !
|
|
436
|
-
let
|
|
437
|
-
idealTop:
|
|
434
|
+
let t = this.controlEl, n = this.panelEl;
|
|
435
|
+
if (!t || !n) return;
|
|
436
|
+
let r = t.getBoundingClientRect(), a = this.optionItems[0]?.getBoundingClientRect()?.height || i(P.ITEM_HEIGHT, this), o = getComputedStyle(n), s = parseFloat(o.borderTopWidth) || 0, c = (e) => i(parseFloat(o.getPropertyValue(e)) || 0, this), l = w({
|
|
437
|
+
idealTop: r.top - e * a,
|
|
438
438
|
rowHeight: a,
|
|
439
439
|
border: s,
|
|
440
440
|
rowCount: this.optionItems.length,
|
|
441
441
|
viewTop: c("--vf-popup-clamp-top"),
|
|
442
442
|
viewBottom: window.innerHeight - c("--vf-popup-clamp-bottom")
|
|
443
|
-
}), u =
|
|
444
|
-
|
|
443
|
+
}), u = r.left;
|
|
444
|
+
n.style.minWidth = `${r.width}px`, n.style.top = `${l.panelTop}px`, n.style.left = `${u}px`, n.style.height = `${l.panelHeight}px`, this.rowHeight = a, this.visibleSlots = l.visibleSlots, this.rowScroll = l.initialScroll, this.applyScroll();
|
|
445
445
|
}
|
|
446
446
|
closePanel(e) {
|
|
447
447
|
this.open && (this.open = !1, this.cancelBlink(), this.stopArrowScroll(), this.endPress(), this.clearActive(), this.typeAhead.reset(), this.panelListeners.detach(), e && this.controlEl?.focus());
|
|
@@ -541,10 +541,10 @@ var P, F = class extends i(_) {
|
|
|
541
541
|
cancelBlink() {
|
|
542
542
|
this.blinkHandle?.cancel(), this.blinkHandle = void 0, this.blinking = !1;
|
|
543
543
|
}
|
|
544
|
-
commit(
|
|
544
|
+
commit(n) {
|
|
545
545
|
this.closePanel(!0);
|
|
546
|
-
let
|
|
547
|
-
this.value =
|
|
546
|
+
let r = this.optionValue(n);
|
|
547
|
+
this.value = r, e(this, "vf-change", { value: r }), t(this, "input"), t(this, "change");
|
|
548
548
|
}
|
|
549
549
|
optionFromEvent(e) {
|
|
550
550
|
return e.composedPath().find((e) => e instanceof y);
|
|
@@ -653,6 +653,6 @@ var P, F = class extends i(_) {
|
|
|
653
653
|
`;
|
|
654
654
|
}
|
|
655
655
|
};
|
|
656
|
-
|
|
656
|
+
a([k()], F.prototype, "value", void 0), a([k({ reflect: !0 })], F.prototype, "name", void 0), a([k()], F.prototype, "label", void 0), a([M()], F.prototype, "open", void 0), a([A(".control")], F.prototype, "controlEl", void 0), a([A(".panel")], F.prototype, "panelEl", void 0), a([A(".rows")], F.prototype, "rowsEl", void 0), a([A(".arrow-slot.up")], F.prototype, "upArrowEl", void 0), a([A(".arrow-slot.down")], F.prototype, "downArrowEl", void 0), a([j({ selector: "vf-option" })], F.prototype, "assignedOptions", void 0), a([M()], F.prototype, "cachedOptions", void 0), F = P = a([n("vf-select")], F);
|
|
657
657
|
//#endregion
|
|
658
658
|
export { F as VfSelect };
|