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.
@@ -1,9 +1,9 @@
1
- import { vfElement as e } from "../define.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
3
- import { VfPositioned as n } from "../position.js";
4
- import { vfBase as r } from "../styles/recipes/host.js";
5
- import { vfField as i } from "../styles/recipes/field.js";
6
- import { emitNative as a } from "../events.js";
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 n(l) {
16
- constructor(...e) {
17
- super(...e), this.step = 1, this.pressed = null, this.#l = (e) => {
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 = (e) => {
50
- let t = e.target.value, n = parseFloat(t);
51
- this.value = Number.isNaN(n) ? t : String(Number(this.#r(n).toFixed(u(this.step)))), this.#o("vf-change"), a(this, "change");
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(e) {
155
- let t = String(Number(this.#r(e).toFixed(u(this.step))));
156
- t !== this.value && (this.value = t, this.#o("vf-change"), a(this, "input"), a(this, "change"));
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
- t([m({ type: Number })], y.prototype, "min", void 0), t([m({ type: Number })], y.prototype, "max", void 0), t([m({ type: Number })], y.prototype, "step", void 0), t([g()], y.prototype, "pressed", void 0), t([h("input")], y.prototype, "input", void 0), y = t([e("vf-number-field")], y);
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 };
@@ -1,17 +1,17 @@
1
- import { vfElement as e } from "../define.js";
2
- import { ScaleController as t } from "../scale.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 { emit as a, emitNative as o } from "../events.js";
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 r(s) {
12
+ var f = class extends a(s) {
13
13
  static {
14
- this.styles = [i, l`
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 t(this), this.mutationObserver = null, this.syncedKey = null, this.handleRadioChange = (e) => {
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(e, t) {
94
- let n = this.value !== e.value;
95
- this.value = e.value, this.syncRadios(), t && e.focus(), n && (a(this, "vf-change", { value: this.value }), o(this, "input"), o(this, "change"));
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
- n([d()], f.prototype, "value", void 0), n([d({ reflect: !0 })], f.prototype, "name", void 0), n([d()], f.prototype, "label", void 0), f = n([e("vf-radio-group")], f);
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 { vfElement as e } from "../define.js";
2
- import t from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
3
- import { VfPositioned as n } from "../position.js";
4
- import { vfDisplay as r } from "../styles/recipes/display-face.js";
5
- import { vfBase as i } from "../styles/recipes/host.js";
6
- import { vfFocusUnderline as a } from "../styles/recipes/focus.js";
7
- import { vfToggle as o } from "../styles/recipes/toggle.js";
8
- import { emit as s } from "../events.js";
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 n(f(p)) {
15
+ var y = class extends r(f(p)) {
16
16
  static {
17
17
  this.styles = [
18
+ a,
18
19
  i,
19
- r,
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
- ${a}
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(), s(this, "vf-change", { value: this.value }));
129
+ this.checked || (this.externallyCoordinated || (this.checked = !0), this.focus(), e(this, "vf-change", { value: this.value }));
130
130
  }
131
131
  };
132
- t([g({
132
+ n([g({
133
133
  type: Boolean,
134
134
  reflect: !0
135
- })], y.prototype, "checked", void 0), t([g({
135
+ })], y.prototype, "checked", void 0), n([g({
136
136
  type: Boolean,
137
137
  reflect: !0
138
- })], y.prototype, "disabled", void 0), t([g()], y.prototype, "value", void 0), t([g({ attribute: !1 })], y.prototype, "groupDisabled", void 0), t([_()], y.prototype, "_hasLabel", void 0), y = t([e("vf-radio")], y);
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 { vfElement as e } from "../define.js";
2
- import { ScaleController as t, sys as n } from "../scale.js";
3
- import r from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
4
- import { VfPositioned as i } from "../position.js";
5
- import { vfDisplay as a } from "../styles/recipes/display-face.js";
6
- import { vfBase as o } from "../styles/recipes/host.js";
7
- import { vfPanel as s } from "../styles/recipes/surface.js";
8
- import { vfFocusUnderline as c } from "../styles/recipes/focus.js";
9
- import { GridSnapController as l } from "../grid-snap.js";
10
- import { DocumentListenersController as u } from "../document-listeners.js";
11
- import { emit as d, emitNative as f } from "../events.js";
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 i(_) {
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
- o,
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
- ${c}
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 t(this), this.gridSnap = new l(this), this.focusRule = new v(this), this.panelListeners = new u(this, () => [
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 u(this, () => [
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, r = this.panelEl;
435
- if (!t || !r) return;
436
- let i = t.getBoundingClientRect(), a = this.optionItems[0]?.getBoundingClientRect()?.height || n(P.ITEM_HEIGHT, this), o = getComputedStyle(r), s = parseFloat(o.borderTopWidth) || 0, c = (e) => n(parseFloat(o.getPropertyValue(e)) || 0, this), l = w({
437
- idealTop: i.top - e * a,
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 = i.left;
444
- r.style.minWidth = `${i.width}px`, r.style.top = `${l.panelTop}px`, r.style.left = `${u}px`, r.style.height = `${l.panelHeight}px`, this.rowHeight = a, this.visibleSlots = l.visibleSlots, this.rowScroll = l.initialScroll, this.applyScroll();
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(e) {
544
+ commit(n) {
545
545
  this.closePanel(!0);
546
- let t = this.optionValue(e);
547
- this.value = t, d(this, "vf-change", { value: t }), f(this, "input"), f(this, "change");
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
- r([k()], F.prototype, "value", void 0), r([k({ reflect: !0 })], F.prototype, "name", void 0), r([k()], F.prototype, "label", void 0), r([M()], F.prototype, "open", void 0), r([A(".control")], F.prototype, "controlEl", void 0), r([A(".panel")], F.prototype, "panelEl", void 0), r([A(".rows")], F.prototype, "rowsEl", void 0), r([A(".arrow-slot.up")], F.prototype, "upArrowEl", void 0), r([A(".arrow-slot.down")], F.prototype, "downArrowEl", void 0), r([j({ selector: "vf-option" })], F.prototype, "assignedOptions", void 0), r([M()], F.prototype, "cachedOptions", void 0), F = P = r([e("vf-select")], F);
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 };
@@ -1,11 +1,11 @@
1
- import { vfElement as e } from "../define.js";
2
- import { ScaleController as t, sys as n, toSys as r } from "../scale.js";
3
- import i from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
4
- import { VfPositioned as a } from "../position.js";
5
- import { vfBase as o } from "../styles/recipes/host.js";
6
- import { vfFocusUnderline as s } from "../styles/recipes/focus.js";
7
- import { GridSnapController as c } from "../grid-snap.js";
8
- import { emit as l, emitNative as u } from "../events.js";
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, toSys as a } from "../scale.js";
4
+ import o from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
5
+ import { VfPositioned as s } from "../position.js";
6
+ import { vfBase as c } from "../styles/recipes/host.js";
7
+ import { vfFocusUnderline as l } from "../styles/recipes/focus.js";
8
+ import { GridSnapController as u } from "../grid-snap.js";
9
9
  import { SLIDER_THUMB as d, SLIDER_THUMB_FACE as f } from "../glyphs.js";
10
10
  import { VfFormControl as p } from "../form-control.js";
11
11
  import { FocusRuleController as m } from "../focus-modality.js";
@@ -21,9 +21,9 @@ function D(e, t) {
21
21
  };
22
22
  return r(1, 0, e - 2, 1), r(1, 3, e - 2, 1), r(0, 1, 1, 2), r(e - 1, 1, 1, 2), r(1, 1, Math.min(Math.max(t, 0), e - 1) - 1, 2), n.join("");
23
23
  }
24
- var O = class extends a(p) {
24
+ var O = class extends s(p) {
25
25
  static {
26
- this.styles = [o, _`
26
+ this.styles = [c, _`
27
27
  :host {
28
28
  /* Padding just leaves room for the thumb's focus ring; the thumb itself
29
29
  stays within the rail (its travel is inset by half its width). */
@@ -102,7 +102,7 @@ var O = class extends a(p) {
102
102
  }
103
103
  .track.vf-focus-rule::after {
104
104
  --vf-focus-underline-offset: ${3}px;
105
- ${s}
105
+ ${l}
106
106
  }
107
107
  `];
108
108
  }
@@ -110,7 +110,7 @@ var O = class extends a(p) {
110
110
  #t;
111
111
  #n;
112
112
  constructor() {
113
- super(), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.name = "", this.label = "", this.trackSize = new g(this, () => this.track), this.scale = new t(this), this.gridSnap = new c(this), this.selfManagedTabIndex = !1, this.#e = new m(this), this.#t = 0, this.#n = !1, this.#f = (e) => {
113
+ super(), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.name = "", this.label = "", this.trackSize = new g(this, () => this.track), this.scale = new r(this), this.gridSnap = new u(this), this.selfManagedTabIndex = !1, this.#e = new m(this), this.#t = 0, this.#n = !1, this.#f = (e) => {
114
114
  if (!(this.isDisabled || e.button !== 0)) {
115
115
  e.preventDefault(), this.#e.suppress(), this.focus(), this.#n = !0, this.#t = this.value;
116
116
  try {
@@ -193,16 +193,16 @@ var O = class extends a(p) {
193
193
  #l(e) {
194
194
  e !== this.value && (this.value = e, this.#u("vf-input"));
195
195
  }
196
- #u(e) {
197
- l(this, e, { value: this.value }), u(this, e === "vf-input" ? "input" : "change");
196
+ #u(n) {
197
+ e(this, n, { value: this.value }), t(this, n === "vf-input" ? "input" : "change");
198
198
  }
199
199
  #d(e) {
200
200
  let t = this.track?.getBoundingClientRect();
201
201
  if (!t) return this.value;
202
- let r = t.width - n(x, this);
203
- if (r <= 0) return this.value;
204
- let i = Math.min(Math.max((e - t.left - n(w, this)) / r, 0), 1);
205
- return this.#o(this.min + i * this.#r);
202
+ let n = t.width - i(x, this);
203
+ if (n <= 0) return this.value;
204
+ let r = Math.min(Math.max((e - t.left - i(w, this)) / n, 0), 1);
205
+ return this.#o(this.min + r * this.#r);
206
206
  }
207
207
  #f;
208
208
  #p;
@@ -213,7 +213,7 @@ var O = class extends a(p) {
213
213
  (n || t) && this.syncFormValue(String(this.#s)), e.has("min") && (this.internals.ariaValueMin = String(this.min)), e.has("max") && (this.internals.ariaValueMax = String(this.max)), n && (this.internals.ariaValueNow = String(this.#s)), e.has("label") && (this.internals.ariaLabel = this.label || null), t && (this.internals.ariaDisabled = this.isDisabled ? "true" : "false", this.selfManagedTabIndex && (this.tabIndex = this.isDisabled ? -1 : 0));
214
214
  }
215
215
  render() {
216
- let e = r(this.trackSize.width, this), t = Math.round(this.#c * Math.max(0, e - x)), i = n(t, this), a = t + C;
216
+ let e = a(this.trackSize.width, this), t = Math.round(this.#c * Math.max(0, e - x)), n = i(t, this), r = t + C;
217
217
  return v`
218
218
  <div
219
219
  class="track vf-snap ${this.#e.marked ? "vf-focus-rule" : ""} ${this.isDisabled ? "disabled" : ""}"
@@ -227,15 +227,15 @@ var O = class extends a(p) {
227
227
  ${e >= 2 ? v`<svg
228
228
  class="rail"
229
229
  part="rail"
230
- width=${n(e, this)}
231
- height=${n(T, this)}
230
+ width=${i(e, this)}
231
+ height=${i(T, this)}
232
232
  viewBox="0 0 ${e} ${T}"
233
233
  shape-rendering="crispEdges"
234
234
  aria-hidden="true"
235
235
  >
236
- <path d=${D(e, a)}></path>
236
+ <path d=${D(e, r)}></path>
237
237
  </svg>` : null}
238
- <span class="thumb" part="thumb" style="left: ${i}px">
238
+ <span class="thumb" part="thumb" style="left: ${n}px">
239
239
  <svg
240
240
  class="thumb-glyph"
241
241
  viewBox="0 0 ${x} ${S}"
@@ -250,6 +250,6 @@ var O = class extends a(p) {
250
250
  `;
251
251
  }
252
252
  };
253
- i([y({ type: Number })], O.prototype, "value", void 0), i([y({ type: Number })], O.prototype, "min", void 0), i([y({ type: Number })], O.prototype, "max", void 0), i([y({ type: Number })], O.prototype, "step", void 0), i([y({ reflect: !0 })], O.prototype, "name", void 0), i([y()], O.prototype, "label", void 0), i([b(".track")], O.prototype, "track", void 0), O = i([e("vf-slider")], O);
253
+ o([y({ type: Number })], O.prototype, "value", void 0), o([y({ type: Number })], O.prototype, "min", void 0), o([y({ type: Number })], O.prototype, "max", void 0), o([y({ type: Number })], O.prototype, "step", void 0), o([y({ reflect: !0 })], O.prototype, "name", void 0), o([y()], O.prototype, "label", void 0), o([b(".track")], O.prototype, "track", void 0), O = o([n("vf-slider")], O);
254
254
  //#endregion
255
255
  export { O as VfSlider };
@@ -1,45 +1,45 @@
1
- import { vfElement as e } from "../define.js";
2
- import { ScaleController as t, snapSys as n, sysLength as r, toSysExact as i } from "../scale.js";
3
- import a from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
4
- import { PlacementController as o, VfPositioned as s, warnMovableContract as c } from "../position.js";
5
- import { vfBase as l } from "../styles/recipes/host.js";
6
- import { DOT_RECTS as u, DOT_SPAN as d, vfDots as f, vfStripes as p } from "../styles/recipes/pattern.js";
7
- import { vfChromeFrame as m } from "../styles/recipes/surface.js";
8
- import { vfTitleBar as h, vfWindowWidgets as g } from "../styles/recipes/title-bar.js";
9
- import { vfFocus as _ } from "../styles/recipes/focus.js";
10
- import { TileRasterCache as v, patternOverride as y, tileGrid as b, vfTileGrid as x } from "../tile-grid.js";
11
- import { GridSnapController as S } from "../grid-snap.js";
12
- import { VfSized as C } from "../size.js";
13
- import { DragController as w } from "../drag.js";
14
- import { TitleCenterController as T, chromeTitleBar as E, closeBox as D, widgetLabel as O, zoomBox as k } from "../chrome.js";
15
- import { emit as A } from "../events.js";
1
+ import { emit as e } from "../events.js";
2
+ import { vfElement as t } from "../define.js";
3
+ import { ScaleController as n, snapSys as r, sysLength as i, toSysExact as a } from "../scale.js";
4
+ import o from "../_virtual/_@oxc-project_runtime@0.143.0/helpers/esm/decorate.js";
5
+ import { PlacementController as s, VfPositioned as c, warnMovableContract as l } from "../position.js";
6
+ import { vfBase as u } from "../styles/recipes/host.js";
7
+ import { DOT_RECTS as d, DOT_SPAN as f, vfDots as p, vfStripes as m } from "../styles/recipes/pattern.js";
8
+ import { vfChromeFrame as h } from "../styles/recipes/surface.js";
9
+ import { vfTitleBar as g, vfWindowWidgets as _ } from "../styles/recipes/title-bar.js";
10
+ import { vfFocus as v } from "../styles/recipes/focus.js";
11
+ import { TileRasterCache as y, patternOverride as b, tileGrid as x, vfTileGrid as S } from "../tile-grid.js";
12
+ import { GridSnapController as C } from "../grid-snap.js";
13
+ import { VfSized as w } from "../size.js";
14
+ import { DragController as T } from "../drag.js";
15
+ import { TitleCenterController as E, chromeTitleBar as D, closeBox as O, widgetLabel as k, zoomBox as A } from "../chrome.js";
16
16
  import "./vf-scroll-area.js";
17
17
  import { LitElement as j, css as M, html as N, nothing as P } from "lit";
18
18
  import { property as F, state as I } from "lit/decorators.js";
19
19
  //#region src/components/vf-window.ts
20
- var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
20
+ var L = 80, R = 54, z = 24, B = 8, V = class extends w(c(j)) {
21
21
  constructor(...e) {
22
- super(...e), this.heading = "", this.active = !0, this.closable = !0, this.zoomable = !1, this.movable = !1, this.resizable = !1, this.flush = !1, this._hasStatus = !1, this.scale = new t(this), this.gridSnap = new S(this), this.titleCenter = new T(this), this._dotsPattern = "", this.#e = new v(), this.#t = (e, t, n) => {
23
- let r = i(this.offsetWidth, this);
22
+ super(...e), this.heading = "", this.active = !0, this.closable = !0, this.zoomable = !1, this.movable = !1, this.resizable = !1, this.flush = !1, this._hasStatus = !1, this.scale = new n(this), this.gridSnap = new C(this), this.titleCenter = new E(this), this._dotsPattern = "", this.#e = new y(), this.#t = (e, t, n) => {
23
+ let r = a(this.offsetWidth, this);
24
24
  return {
25
25
  x: Math.min(Math.max(e, z - r), n.width - z),
26
26
  y: Math.min(Math.max(t, 0), Math.max(0, n.height - z))
27
27
  };
28
- }, this._placement = new o(this, (e, t, n) => this.#t(e, t, n)), this._drag = new w(this, {
28
+ }, this._placement = new s(this, (e, t, n) => this.#t(e, t, n)), this._drag = new T(this, {
29
29
  onDragStart: (e) => !this.movable || e.button !== 0 || e.composedPath().some((e) => e instanceof HTMLElement && e.classList.contains("box")) ? null : (this.#i(), this._placement.seed()),
30
30
  onDrag: (e, t) => this._placement.moveTo(e, t)
31
31
  }), this._resizeState = null, this.#n = !1, this.#r = !1;
32
32
  }
33
33
  static {
34
34
  this.styles = [
35
- l,
36
- p,
37
- f,
38
- x,
39
- _,
35
+ u,
40
36
  m,
37
+ p,
38
+ S,
39
+ v,
41
40
  h,
42
41
  g,
42
+ _,
43
43
  M`
44
44
  :host {
45
45
  display: block;
@@ -281,27 +281,27 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
281
281
  }
282
282
  #e;
283
283
  willUpdate(e) {
284
- super.willUpdate(e), this.variant === "utility" && (this._dotsPattern = y(this, "--vf-dots-pattern"));
284
+ super.willUpdate(e), this.variant === "utility" && (this._dotsPattern = b(this, "--vf-dots-pattern"));
285
285
  }
286
286
  _dotsTexture() {
287
287
  if (this.width == null) return;
288
288
  let e = Math.max(1, this.width - 2);
289
- if (this._dotsPattern) return b({
290
- cols: Math.ceil(e / d),
289
+ if (this._dotsPattern) return x({
290
+ cols: Math.ceil(e / f),
291
291
  rows: 1,
292
- tile: d
292
+ tile: f
293
293
  });
294
- let t = Math.ceil((e + 2) / d) * d, n = B + 2;
294
+ let t = Math.ceil((e + 2) / f) * f, n = B + 2;
295
295
  return N`<div
296
296
  class="vf-tile-raster"
297
- style="width:${r(t)};height:${r(n)};background-image:${this.#e.for(2, 2, u, t, n)}"
297
+ style="width:${i(t)};height:${i(n)};background-image:${this.#e.for(2, 2, d, t, n)}"
298
298
  ></div>`;
299
299
  }
300
300
  #t;
301
301
  updated() {
302
302
  this.#a();
303
- let e = this._resizeState;
304
- e?.emitPending && (e.emitPending = !1, A(this, "vf-resize", {
303
+ let t = this._resizeState;
304
+ t?.emitPending && (t.emitPending = !1, e(this, "vf-resize", {
305
305
  width: this.width,
306
306
  height: this.height,
307
307
  commit: !1
@@ -310,7 +310,7 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
310
310
  #n;
311
311
  #r;
312
312
  #i() {
313
- this.#r ||= c(this, `vf-window${this.heading ? ` ("${this.heading}")` : ""}`, "<vf-window movable top=\"30\" left=\"40\" width=\"240\" height=\"176\">");
313
+ this.#r ||= l(this, `vf-window${this.heading ? ` ("${this.heading}")` : ""}`, "<vf-window movable top=\"30\" left=\"40\" width=\"240\" height=\"176\">");
314
314
  }
315
315
  #a() {
316
316
  if (this.#n) return;
@@ -325,10 +325,10 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
325
325
  this._hasStatus = t.assignedElements().length > 0;
326
326
  }
327
327
  _onCloseClick() {
328
- A(this, "vf-close", { reason: "close" });
328
+ e(this, "vf-close", { reason: "close" });
329
329
  }
330
330
  _onZoomClick() {
331
- A(this, "vf-zoom", {});
331
+ e(this, "vf-zoom", {});
332
332
  }
333
333
  _onGrowPointerDown(e) {
334
334
  if (!this.resizable || e.button !== 0) return;
@@ -337,8 +337,8 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
337
337
  pointerId: e.pointerId,
338
338
  startX: e.clientX,
339
339
  startY: e.clientY,
340
- baseWidth: i(t.width, this),
341
- baseHeight: i(t.height, this),
340
+ baseWidth: a(t.width, this),
341
+ baseHeight: a(t.height, this),
342
342
  emitPending: !1,
343
343
  resized: !1
344
344
  }, e.currentTarget.setPointerCapture(e.pointerId), e.preventDefault();
@@ -346,15 +346,15 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
346
346
  _onGrowPointerMove(e) {
347
347
  let t = this._resizeState;
348
348
  if (!t || e.pointerId !== t.pointerId) return;
349
- let r = n(Math.max(L, t.baseWidth + i(e.clientX - t.startX, this)), this), a = n(Math.max(R, t.baseHeight + i(e.clientY - t.startY, this)), this);
350
- (r !== this.width || a !== this.height) && (t.emitPending = !0, t.resized = !0), this.width = r, this.height = a;
349
+ let n = r(Math.max(L, t.baseWidth + a(e.clientX - t.startX, this)), this), i = r(Math.max(R, t.baseHeight + a(e.clientY - t.startY, this)), this);
350
+ (n !== this.width || i !== this.height) && (t.emitPending = !0, t.resized = !0), this.width = n, this.height = i;
351
351
  }
352
- _onGrowPointerEnd(e) {
353
- let t = this._resizeState;
354
- if (!t || e.pointerId !== t.pointerId) return;
352
+ _onGrowPointerEnd(t) {
353
+ let n = this._resizeState;
354
+ if (!n || t.pointerId !== n.pointerId) return;
355
355
  this._resizeState = null;
356
- let n = e.currentTarget;
357
- n.hasPointerCapture(e.pointerId) && n.releasePointerCapture(e.pointerId), t.resized && A(this, "vf-resize", {
356
+ let r = t.currentTarget;
357
+ r.hasPointerCapture(t.pointerId) && r.releasePointerCapture(t.pointerId), n.resized && e(this, "vf-resize", {
358
358
  width: this.width,
359
359
  height: this.height,
360
360
  commit: !0
@@ -368,10 +368,10 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
368
368
  role="group"
369
369
  aria-labelledby=${this.heading ? "title" : P}
370
370
  >
371
- ${E(this._drag, N`
372
- ${this.closable ? D(O("Close", this.heading), this._onCloseClick) : P}
371
+ ${D(this._drag, N`
372
+ ${this.closable ? O(k("Close", this.heading), this._onCloseClick) : P}
373
373
  <span class="vf-title" part="title" id="title">${this.heading}</span>
374
- ${this.zoomable ? k(O("Zoom", this.heading), this._onZoomClick) : P}
374
+ ${this.zoomable ? A(k("Zoom", this.heading), this._onZoomClick) : P}
375
375
  `, this.variant === "utility" ? "vf-dots" : "vf-stripes", this.variant === "utility" ? this._dotsTexture() : void 0)}
376
376
  <div class="body" part="body">
377
377
  ${this.scrollbars ? N`
@@ -403,24 +403,24 @@ var L = 80, R = 54, z = 24, B = 8, V = class extends C(s(j)) {
403
403
  `;
404
404
  }
405
405
  };
406
- a([F({ reflect: !0 })], V.prototype, "variant", void 0), a([F()], V.prototype, "heading", void 0), a([F({
406
+ o([F({ reflect: !0 })], V.prototype, "variant", void 0), o([F()], V.prototype, "heading", void 0), o([F({
407
407
  type: Boolean,
408
408
  reflect: !0
409
- })], V.prototype, "active", void 0), a([F({
409
+ })], V.prototype, "active", void 0), o([F({
410
410
  type: Boolean,
411
411
  reflect: !0
412
- })], V.prototype, "closable", void 0), a([F({
412
+ })], V.prototype, "closable", void 0), o([F({
413
413
  type: Boolean,
414
414
  reflect: !0
415
- })], V.prototype, "zoomable", void 0), a([F({
415
+ })], V.prototype, "zoomable", void 0), o([F({
416
416
  type: Boolean,
417
417
  reflect: !0
418
- })], V.prototype, "movable", void 0), a([F({
418
+ })], V.prototype, "movable", void 0), o([F({
419
419
  type: Boolean,
420
420
  reflect: !0
421
- })], V.prototype, "resizable", void 0), a([F({
421
+ })], V.prototype, "resizable", void 0), o([F({
422
422
  type: Boolean,
423
423
  reflect: !0
424
- })], V.prototype, "flush", void 0), a([F({ reflect: !0 })], V.prototype, "scrollbars", void 0), a([I()], V.prototype, "_hasStatus", void 0), V = a([e("vf-window")], V);
424
+ })], V.prototype, "flush", void 0), o([F({ reflect: !0 })], V.prototype, "scrollbars", void 0), o([I()], V.prototype, "_hasStatus", void 0), V = o([t("vf-window")], V);
425
425
  //#endregion
426
426
  export { V as VfWindow };