godown 3.4.0 → 3.5.1
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/build/godown+lit.iife.js +2 -2
- package/build/godown+lit.iife.js.map +1 -1
- package/build/godown+lit.js +2 -2
- package/build/godown+lit.js.map +1 -1
- package/build/godown+lit.umd.js +2 -2
- package/build/godown+lit.umd.js.map +1 -1
- package/build/godown.iife.js +5 -5
- package/build/godown.js +4 -4
- package/build/godown.js.map +1 -1
- package/build/godown.umd.js +5 -5
- package/build/godown.umd.js.map +1 -1
- package/components/avatar.d.ts.map +1 -1
- package/components/avatar.js +1 -1
- package/components/avatar.js.map +1 -1
- package/components/badge.js +1 -1
- package/components/badge.js.map +1 -1
- package/components/button.js +1 -1
- package/components/button.js.map +1 -1
- package/components/card.js +1 -1
- package/components/card.js.map +1 -1
- package/components/details.js +1 -1
- package/components/details.js.map +1 -1
- package/components/dialog.js +1 -1
- package/components/dialog.js.map +1 -1
- package/components/divider.d.ts.map +1 -1
- package/components/divider.js +1 -1
- package/components/divider.js.map +1 -1
- package/components/range.d.ts +7 -6
- package/components/range.d.ts.map +1 -1
- package/components/range.js.map +1 -1
- package/components/split.js +1 -1
- package/components/split.js.map +1 -1
- package/components/switch.d.ts +5 -13
- package/components/switch.d.ts.map +1 -1
- package/components/switch.js +1 -1
- package/components/switch.js.map +1 -1
- package/core/global-style.js +1 -1
- package/core/super-input.d.ts +2 -2
- package/core/super-input.d.ts.map +1 -1
- package/core/super-input.js +1 -1
- package/core/super-input.js.map +1 -1
- package/core/super-openable.d.ts +0 -1
- package/core/super-openable.d.ts.map +1 -1
- package/core/super-openable.js +1 -1
- package/core/super-openable.js.map +1 -1
- package/custom-elements.json +1 -1
- package/package.json +6 -18
- package/src/components/avatar.ts +2 -1
- package/src/components/button.ts +2 -3
- package/src/components/card.ts +4 -0
- package/src/components/details.ts +1 -1
- package/src/components/dialog.ts +4 -6
- package/src/components/divider.ts +2 -1
- package/src/components/range.ts +13 -11
- package/src/components/split.ts +2 -1
- package/src/components/switch.ts +43 -60
- package/src/core/global-style.ts +2 -2
- package/src/core/super-input.ts +13 -8
- package/src/core/super-openable.ts +0 -4
- package/tsconfig.json +33 -0
- package/vscode.html-custom-data.json +1 -1
- package/web-types.json +1 -1
- package/dev/alert.d.ts +0 -9
- package/dev/alert.d.ts.map +0 -1
- package/dev/alert.js +0 -5
- package/dev/alert.js.map +0 -1
- package/dev/avatar.d.ts +0 -9
- package/dev/avatar.d.ts.map +0 -1
- package/dev/avatar.js +0 -5
- package/dev/avatar.js.map +0 -1
- package/dev/badge.d.ts +0 -9
- package/dev/badge.d.ts.map +0 -1
- package/dev/badge.js +0 -5
- package/dev/badge.js.map +0 -1
- package/dev/breath.d.ts +0 -9
- package/dev/breath.d.ts.map +0 -1
- package/dev/breath.js +0 -5
- package/dev/breath.js.map +0 -1
- package/dev/button.d.ts +0 -9
- package/dev/button.d.ts.map +0 -1
- package/dev/button.js +0 -5
- package/dev/button.js.map +0 -1
- package/dev/card.d.ts +0 -9
- package/dev/card.d.ts.map +0 -1
- package/dev/card.js +0 -5
- package/dev/card.js.map +0 -1
- package/dev/carousel.d.ts +0 -9
- package/dev/carousel.d.ts.map +0 -1
- package/dev/carousel.js +0 -5
- package/dev/carousel.js.map +0 -1
- package/dev/components/alert.d.ts +0 -55
- package/dev/components/alert.d.ts.map +0 -1
- package/dev/components/alert.js +0 -236
- package/dev/components/alert.js.map +0 -1
- package/dev/components/avatar.d.ts +0 -33
- package/dev/components/avatar.d.ts.map +0 -1
- package/dev/components/avatar.js +0 -118
- package/dev/components/avatar.js.map +0 -1
- package/dev/components/badge.d.ts +0 -31
- package/dev/components/badge.d.ts.map +0 -1
- package/dev/components/badge.js +0 -122
- package/dev/components/badge.js.map +0 -1
- package/dev/components/breath.d.ts +0 -36
- package/dev/components/breath.d.ts.map +0 -1
- package/dev/components/breath.js +0 -135
- package/dev/components/breath.js.map +0 -1
- package/dev/components/button.d.ts +0 -60
- package/dev/components/button.d.ts.map +0 -1
- package/dev/components/button.js +0 -288
- package/dev/components/button.js.map +0 -1
- package/dev/components/card.d.ts +0 -27
- package/dev/components/card.d.ts.map +0 -1
- package/dev/components/card.js +0 -83
- package/dev/components/card.js.map +0 -1
- package/dev/components/carousel.d.ts +0 -39
- package/dev/components/carousel.d.ts.map +0 -1
- package/dev/components/carousel.js +0 -184
- package/dev/components/carousel.js.map +0 -1
- package/dev/components/details.d.ts +0 -24
- package/dev/components/details.d.ts.map +0 -1
- package/dev/components/details.js +0 -124
- package/dev/components/details.js.map +0 -1
- package/dev/components/dialog.d.ts +0 -43
- package/dev/components/dialog.d.ts.map +0 -1
- package/dev/components/dialog.js +0 -154
- package/dev/components/dialog.js.map +0 -1
- package/dev/components/divider.d.ts +0 -17
- package/dev/components/divider.d.ts.map +0 -1
- package/dev/components/divider.js +0 -63
- package/dev/components/divider.js.map +0 -1
- package/dev/components/dragbox.d.ts +0 -42
- package/dev/components/dragbox.d.ts.map +0 -1
- package/dev/components/dragbox.js +0 -126
- package/dev/components/dragbox.js.map +0 -1
- package/dev/components/flex.d.ts +0 -34
- package/dev/components/flex.d.ts.map +0 -1
- package/dev/components/flex.js +0 -73
- package/dev/components/flex.js.map +0 -1
- package/dev/components/form.d.ts +0 -24
- package/dev/components/form.d.ts.map +0 -1
- package/dev/components/form.js +0 -76
- package/dev/components/form.js.map +0 -1
- package/dev/components/grid.d.ts +0 -38
- package/dev/components/grid.d.ts.map +0 -1
- package/dev/components/grid.js +0 -67
- package/dev/components/grid.js.map +0 -1
- package/dev/components/heading.d.ts +0 -31
- package/dev/components/heading.d.ts.map +0 -1
- package/dev/components/heading.js +0 -127
- package/dev/components/heading.js.map +0 -1
- package/dev/components/input.d.ts +0 -23
- package/dev/components/input.d.ts.map +0 -1
- package/dev/components/input.js +0 -99
- package/dev/components/input.js.map +0 -1
- package/dev/components/layout.d.ts +0 -28
- package/dev/components/layout.d.ts.map +0 -1
- package/dev/components/layout.js +0 -96
- package/dev/components/layout.js.map +0 -1
- package/dev/components/link.d.ts +0 -54
- package/dev/components/link.d.ts.map +0 -1
- package/dev/components/link.js +0 -110
- package/dev/components/link.js.map +0 -1
- package/dev/components/progress.d.ts +0 -16
- package/dev/components/progress.d.ts.map +0 -1
- package/dev/components/progress.js +0 -101
- package/dev/components/progress.js.map +0 -1
- package/dev/components/range.d.ts +0 -121
- package/dev/components/range.d.ts.map +0 -1
- package/dev/components/range.js +0 -391
- package/dev/components/range.js.map +0 -1
- package/dev/components/rotate.d.ts +0 -30
- package/dev/components/rotate.d.ts.map +0 -1
- package/dev/components/rotate.js +0 -93
- package/dev/components/rotate.js.map +0 -1
- package/dev/components/router.d.ts +0 -116
- package/dev/components/router.d.ts.map +0 -1
- package/dev/components/router.js +0 -240
- package/dev/components/router.js.map +0 -1
- package/dev/components/select.d.ts +0 -53
- package/dev/components/select.d.ts.map +0 -1
- package/dev/components/select.js +0 -269
- package/dev/components/select.js.map +0 -1
- package/dev/components/skeleton.d.ts +0 -28
- package/dev/components/skeleton.d.ts.map +0 -1
- package/dev/components/skeleton.js +0 -122
- package/dev/components/skeleton.js.map +0 -1
- package/dev/components/split.d.ts +0 -56
- package/dev/components/split.d.ts.map +0 -1
- package/dev/components/split.js +0 -219
- package/dev/components/split.js.map +0 -1
- package/dev/components/switch.d.ts +0 -40
- package/dev/components/switch.d.ts.map +0 -1
- package/dev/components/switch.js +0 -166
- package/dev/components/switch.js.map +0 -1
- package/dev/components/text.d.ts +0 -21
- package/dev/components/text.d.ts.map +0 -1
- package/dev/components/text.js +0 -96
- package/dev/components/text.js.map +0 -1
- package/dev/components/time.d.ts +0 -36
- package/dev/components/time.d.ts.map +0 -1
- package/dev/components/time.js +0 -75
- package/dev/components/time.js.map +0 -1
- package/dev/components/tooltip.d.ts +0 -51
- package/dev/components/tooltip.d.ts.map +0 -1
- package/dev/components/tooltip.js +0 -140
- package/dev/components/tooltip.js.map +0 -1
- package/dev/components/typewriter.d.ts +0 -49
- package/dev/components/typewriter.d.ts.map +0 -1
- package/dev/components/typewriter.js +0 -149
- package/dev/components/typewriter.js.map +0 -1
- package/dev/core/direction.d.ts +0 -27
- package/dev/core/direction.d.ts.map +0 -1
- package/dev/core/direction.js +0 -56
- package/dev/core/direction.js.map +0 -1
- package/dev/core/global-style.d.ts +0 -20
- package/dev/core/global-style.d.ts.map +0 -1
- package/dev/core/global-style.js +0 -82
- package/dev/core/global-style.js.map +0 -1
- package/dev/core/outline.d.ts +0 -20
- package/dev/core/outline.d.ts.map +0 -1
- package/dev/core/outline.js +0 -44
- package/dev/core/outline.js.map +0 -1
- package/dev/core/super-anchor.d.ts +0 -18
- package/dev/core/super-anchor.d.ts.map +0 -1
- package/dev/core/super-anchor.js +0 -60
- package/dev/core/super-anchor.js.map +0 -1
- package/dev/core/super-input.d.ts +0 -43
- package/dev/core/super-input.d.ts.map +0 -1
- package/dev/core/super-input.js +0 -197
- package/dev/core/super-input.js.map +0 -1
- package/dev/core/super-openable.d.ts +0 -16
- package/dev/core/super-openable.d.ts.map +0 -1
- package/dev/core/super-openable.js +0 -36
- package/dev/core/super-openable.js.map +0 -1
- package/dev/details.d.ts +0 -9
- package/dev/details.d.ts.map +0 -1
- package/dev/details.js +0 -5
- package/dev/details.js.map +0 -1
- package/dev/dialog.d.ts +0 -9
- package/dev/dialog.d.ts.map +0 -1
- package/dev/dialog.js +0 -5
- package/dev/dialog.js.map +0 -1
- package/dev/divider.d.ts +0 -9
- package/dev/divider.d.ts.map +0 -1
- package/dev/divider.js +0 -5
- package/dev/divider.js.map +0 -1
- package/dev/dragbox.d.ts +0 -9
- package/dev/dragbox.d.ts.map +0 -1
- package/dev/dragbox.js +0 -5
- package/dev/dragbox.js.map +0 -1
- package/dev/flex.d.ts +0 -9
- package/dev/flex.d.ts.map +0 -1
- package/dev/flex.js +0 -5
- package/dev/flex.js.map +0 -1
- package/dev/form.d.ts +0 -9
- package/dev/form.d.ts.map +0 -1
- package/dev/form.js +0 -5
- package/dev/form.js.map +0 -1
- package/dev/grid.d.ts +0 -9
- package/dev/grid.d.ts.map +0 -1
- package/dev/grid.js +0 -5
- package/dev/grid.js.map +0 -1
- package/dev/heading.d.ts +0 -9
- package/dev/heading.d.ts.map +0 -1
- package/dev/heading.js +0 -5
- package/dev/heading.js.map +0 -1
- package/dev/index.d.ts +0 -31
- package/dev/index.d.ts.map +0 -1
- package/dev/index.js +0 -31
- package/dev/index.js.map +0 -1
- package/dev/input.d.ts +0 -9
- package/dev/input.d.ts.map +0 -1
- package/dev/input.js +0 -5
- package/dev/input.js.map +0 -1
- package/dev/layout.d.ts +0 -9
- package/dev/layout.d.ts.map +0 -1
- package/dev/layout.js +0 -5
- package/dev/layout.js.map +0 -1
- package/dev/link.d.ts +0 -9
- package/dev/link.d.ts.map +0 -1
- package/dev/link.js +0 -5
- package/dev/link.js.map +0 -1
- package/dev/progress.d.ts +0 -9
- package/dev/progress.d.ts.map +0 -1
- package/dev/progress.js +0 -5
- package/dev/progress.js.map +0 -1
- package/dev/range.d.ts +0 -9
- package/dev/range.d.ts.map +0 -1
- package/dev/range.js +0 -5
- package/dev/range.js.map +0 -1
- package/dev/rotate.d.ts +0 -9
- package/dev/rotate.d.ts.map +0 -1
- package/dev/rotate.js +0 -5
- package/dev/rotate.js.map +0 -1
- package/dev/router.d.ts +0 -9
- package/dev/router.d.ts.map +0 -1
- package/dev/router.js +0 -5
- package/dev/router.js.map +0 -1
- package/dev/select.d.ts +0 -9
- package/dev/select.d.ts.map +0 -1
- package/dev/select.js +0 -5
- package/dev/select.js.map +0 -1
- package/dev/skeleton.d.ts +0 -9
- package/dev/skeleton.d.ts.map +0 -1
- package/dev/skeleton.js +0 -5
- package/dev/skeleton.js.map +0 -1
- package/dev/split.d.ts +0 -9
- package/dev/split.d.ts.map +0 -1
- package/dev/split.js +0 -5
- package/dev/split.js.map +0 -1
- package/dev/switch.d.ts +0 -9
- package/dev/switch.d.ts.map +0 -1
- package/dev/switch.js +0 -5
- package/dev/switch.js.map +0 -1
- package/dev/text.d.ts +0 -9
- package/dev/text.d.ts.map +0 -1
- package/dev/text.js +0 -5
- package/dev/text.js.map +0 -1
- package/dev/time.d.ts +0 -9
- package/dev/time.d.ts.map +0 -1
- package/dev/time.js +0 -5
- package/dev/time.js.map +0 -1
- package/dev/tooltip.d.ts +0 -9
- package/dev/tooltip.d.ts.map +0 -1
- package/dev/tooltip.js +0 -5
- package/dev/tooltip.js.map +0 -1
- package/dev/typewriter.d.ts +0 -9
- package/dev/typewriter.d.ts.map +0 -1
- package/dev/typewriter.js +0 -5
- package/dev/typewriter.js.map +0 -1
package/dev/components/range.js
DELETED
@@ -1,391 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { attr, tokenList, godown, isNil, joinProperties, loop, part, styles, Ranger, omit } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { property, queryAll, state } from "lit/decorators.js";
|
5
|
-
import { cssGlobalVars, scopePrefix } from "../core/global-style.js";
|
6
|
-
import { SuperInput } from "../core/super-input.js";
|
7
|
-
const protoName = "range";
|
8
|
-
const cssScope = scopePrefix(protoName);
|
9
|
-
/**
|
10
|
-
* {@linkcode Range} is similar to `<input type="range">`.
|
11
|
-
*
|
12
|
-
* Value accepts number, or array.
|
13
|
-
*
|
14
|
-
* Number has 1 handle, the array has the number of its elements.
|
15
|
-
*
|
16
|
-
* @fires input - Fires when the input value changes.
|
17
|
-
* @fires change - Fires when the input value changes.
|
18
|
-
* @fires range - Fires when the value changes.
|
19
|
-
* @fires focus - Fires when the handle is focused.
|
20
|
-
* @fires blur - Fires when the handle is blurred.
|
21
|
-
* @category input
|
22
|
-
*/
|
23
|
-
let Range = class Range extends SuperInput {
|
24
|
-
constructor() {
|
25
|
-
super(...arguments);
|
26
|
-
/**
|
27
|
-
* Minimum value.
|
28
|
-
*/
|
29
|
-
this.min = 0;
|
30
|
-
/**
|
31
|
-
* Maximum value.
|
32
|
-
*/
|
33
|
-
this.max = 100;
|
34
|
-
/**
|
35
|
-
* Whether to display the range vertically.
|
36
|
-
*/
|
37
|
-
this.vertical = false;
|
38
|
-
this.__focusStack = [];
|
39
|
-
}
|
40
|
-
get range() {
|
41
|
-
return Array.isArray(this.value);
|
42
|
-
}
|
43
|
-
/**
|
44
|
-
* Return values in the form of an array.
|
45
|
-
*/
|
46
|
-
get rangeValue() {
|
47
|
-
return (this.range ? this.value : [this.value]);
|
48
|
-
}
|
49
|
-
/**
|
50
|
-
* Pad the value to the specified length.
|
51
|
-
*/
|
52
|
-
padValue(len, value = 0) {
|
53
|
-
const { rangeValue } = this;
|
54
|
-
const miss = len - rangeValue.length;
|
55
|
-
if (miss > 0) {
|
56
|
-
return new Array(miss).fill(value).concat(rangeValue);
|
57
|
-
}
|
58
|
-
return rangeValue;
|
59
|
-
}
|
60
|
-
attributeChangedCallback(name, _old, value) {
|
61
|
-
super.attributeChangedCallback(name, _old, value);
|
62
|
-
if (name === "max" || name === "min" || name === "step") {
|
63
|
-
this._ranger = new Ranger(this.min, this.max, this.step);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
get observedRecord() {
|
67
|
-
return omit(super.observedRecord, "outline-type");
|
68
|
-
}
|
69
|
-
render() {
|
70
|
-
const rangeValue = this.padValue(2);
|
71
|
-
const from = Math.min(...rangeValue);
|
72
|
-
const to = Math.max(...rangeValue);
|
73
|
-
const gap = this._ranger.diff;
|
74
|
-
return html `
|
75
|
-
<div
|
76
|
-
part="root"
|
77
|
-
${attr(this.observedRecord)}
|
78
|
-
@mousedown="${this.disabled ? null : this._handleMousedownRoot}"
|
79
|
-
style="${joinProperties([
|
80
|
-
["--from", `${((from - this.min) / gap) * 100}%`],
|
81
|
-
["--to", `${((to - this.min) / gap) * 100}%`],
|
82
|
-
...rangeValue.map((value, index) => [`--handle-${index}`, `${((value - this.min) / gap) * 100}%`]),
|
83
|
-
])}"
|
84
|
-
>
|
85
|
-
<div part="track"></div>
|
86
|
-
${loop(this.rangeValue.length, (index) => this._renderHandle(index))}
|
87
|
-
</div>
|
88
|
-
`;
|
89
|
-
}
|
90
|
-
_renderHandle(index) {
|
91
|
-
const { disabled, range, rangeValue } = this;
|
92
|
-
// in single-handle mod (value is a number or an array with length 1),
|
93
|
-
const end = !range || (range && index === rangeValue.length - 1 && rangeValue.length === 1);
|
94
|
-
return html `
|
95
|
-
<i
|
96
|
-
tabindex="0"
|
97
|
-
part="handle"
|
98
|
-
class="${tokenList({ "last-focus": this.lastFocus === index })}"
|
99
|
-
@mousedown="${disabled ? null : this.createMouseDown(index)}"
|
100
|
-
@focus="${disabled ? null : () => this.focusHandle(index)}"
|
101
|
-
@blur="${disabled ? null : this.blurHandle}"
|
102
|
-
style="${joinProperties({
|
103
|
-
"z-index": this.__focusStack.indexOf(index) + 1,
|
104
|
-
"--handle": `var(--${end ? "to" : `handle-${index}`})`,
|
105
|
-
})}"
|
106
|
-
></i>
|
107
|
-
`;
|
108
|
-
}
|
109
|
-
/**
|
110
|
-
* Focuses the handle at the given index, updates the focus stack, and dispatches a "focus" event.
|
111
|
-
* @param index - The index of the handle to focus.
|
112
|
-
*/
|
113
|
-
focusHandle(index) {
|
114
|
-
this.lastFocus = index;
|
115
|
-
const indexOfFocusStack = this.__focusStack.indexOf(index);
|
116
|
-
if (indexOfFocusStack !== -1) {
|
117
|
-
this.__focusStack.splice(indexOfFocusStack, 1);
|
118
|
-
}
|
119
|
-
this.__focusStack.push(index);
|
120
|
-
const handleItem = this._handles.item(index);
|
121
|
-
handleItem?.focus();
|
122
|
-
if (!this.__keydownEvent) {
|
123
|
-
this.__keydownEvent = this.events.add(document, "keydown", this.createKeydownEvent(index));
|
124
|
-
}
|
125
|
-
this.dispatchEvent(new CustomEvent("focus", { detail: index }));
|
126
|
-
}
|
127
|
-
/**
|
128
|
-
* Removes the focus from the currently focused handle and dispatches a "blur" event.
|
129
|
-
*/
|
130
|
-
blurHandle() {
|
131
|
-
this.lastFocus = undefined;
|
132
|
-
this.__keydownEvent = this.events.remove(document, "keydown", this.__keydownEvent);
|
133
|
-
this.dispatchEvent(new CustomEvent("blur"));
|
134
|
-
}
|
135
|
-
/**
|
136
|
-
* Creates a keydown event handler that updates the value of the range based on arrow key presses.
|
137
|
-
* @param index - The index of the handle to update.
|
138
|
-
* @returns A function that handles the keydown event and updates the range value.
|
139
|
-
*/
|
140
|
-
createKeydownEvent(index) {
|
141
|
-
const { rangeValue, step } = this;
|
142
|
-
if (rangeValue.length < 2) {
|
143
|
-
index = 0;
|
144
|
-
}
|
145
|
-
return (e) => {
|
146
|
-
const old = rangeValue[index];
|
147
|
-
if (e.key === "ArrowLeft" || e.key === "ArrowDown") {
|
148
|
-
e.preventDefault();
|
149
|
-
this.createSetValue(index)(old - step);
|
150
|
-
}
|
151
|
-
else if (e.key === "ArrowRight" || e.key === "ArrowUp") {
|
152
|
-
e.preventDefault();
|
153
|
-
this.createSetValue(index)(old + step);
|
154
|
-
}
|
155
|
-
};
|
156
|
-
}
|
157
|
-
/**
|
158
|
-
* Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
|
159
|
-
* @param index - The index of the handle to focus.
|
160
|
-
* @returns A function that handles the mouse down event and updates the range value.
|
161
|
-
*/
|
162
|
-
createMouseDown(index) {
|
163
|
-
return (e) => {
|
164
|
-
this.focusHandle(index);
|
165
|
-
this.createMousedownListener(this.createSetValue(index))(e);
|
166
|
-
};
|
167
|
-
}
|
168
|
-
/**
|
169
|
-
* Creates a function that sets the value of the range at the given index.
|
170
|
-
* @param index - The index of the value to set.
|
171
|
-
* @returns A function that sets the value of the range.
|
172
|
-
*/
|
173
|
-
createSetValue(index) {
|
174
|
-
return (value) => {
|
175
|
-
const normalizeValue = this._ranger.normalize(value);
|
176
|
-
let newValue = normalizeValue;
|
177
|
-
if (this.range) {
|
178
|
-
newValue = [...this.value];
|
179
|
-
newValue[index] = normalizeValue;
|
180
|
-
}
|
181
|
-
this.value = newValue;
|
182
|
-
this.dispatchEvent(new CustomEvent("range", { detail: this.value }));
|
183
|
-
};
|
184
|
-
}
|
185
|
-
/**
|
186
|
-
* Compute value from event.
|
187
|
-
* @returns The value closest to the event client position.
|
188
|
-
*/
|
189
|
-
_computeValue({ clientX, clientY }) {
|
190
|
-
const { top, left, height, width } = this._root.getBoundingClientRect();
|
191
|
-
return this._ranger.present(this.vertical ? (clientY - top) / height : (clientX - left) / width);
|
192
|
-
}
|
193
|
-
/**
|
194
|
-
* Handles the mouse down event on the root element of the range component.
|
195
|
-
* Computes the closest value to the mouse position, sets the value, and focuses the corresponding handle.
|
196
|
-
* @param e - The mouse down event object.
|
197
|
-
*/
|
198
|
-
_handleMousedownRoot(e) {
|
199
|
-
const value = this._computeValue(e);
|
200
|
-
const index = this.range
|
201
|
-
? this.rangeValue.reduce((acc, item, index) => {
|
202
|
-
const diff = Math.abs(value - item);
|
203
|
-
const prevDiff = Math.abs(value - this.rangeValue[acc]);
|
204
|
-
return diff < prevDiff ? index : acc;
|
205
|
-
}, 0)
|
206
|
-
: 0;
|
207
|
-
const set = this.createSetValue(index);
|
208
|
-
set(value);
|
209
|
-
this.createMousedownListener(set)(e);
|
210
|
-
this.focusHandle(index);
|
211
|
-
}
|
212
|
-
/**
|
213
|
-
* Creates a mouse down event handler that focuses the handle at the given index and sets the value of the range.
|
214
|
-
* @param index - The index of the handle to focus.
|
215
|
-
* @returns A function that handles the mouse down event and updates the range value.
|
216
|
-
*/
|
217
|
-
createMousedownListener(mouseMoveCallback) {
|
218
|
-
return (e) => {
|
219
|
-
e.preventDefault();
|
220
|
-
e.stopPropagation();
|
221
|
-
const move = this.createMousemoveListener(mouseMoveCallback);
|
222
|
-
this.events.add(document, "mousemove", move);
|
223
|
-
const stop = () => {
|
224
|
-
this.events.remove(document, "mousemove", move);
|
225
|
-
this.events.remove(document, "mouseup", stop);
|
226
|
-
};
|
227
|
-
this.events.add(document, "mouseup", stop);
|
228
|
-
};
|
229
|
-
}
|
230
|
-
/**
|
231
|
-
* Creates a mouse move event handler that updates the range value based on the mouse position.
|
232
|
-
* @param callback - A function to call with the new value when the mouse is moved.
|
233
|
-
* @returns A function that handles the mouse move event and updates the range value.
|
234
|
-
*/
|
235
|
-
createMousemoveListener(callback) {
|
236
|
-
return (e) => {
|
237
|
-
const value = this._computeValue(e);
|
238
|
-
if (value !== this._ranger.restrict(value)) {
|
239
|
-
return;
|
240
|
-
}
|
241
|
-
callback?.call(this, value);
|
242
|
-
};
|
243
|
-
}
|
244
|
-
_connectedInit() {
|
245
|
-
const gap = this._ranger.diff;
|
246
|
-
this.step ||= gap / 100;
|
247
|
-
if (isNil(this.value)) {
|
248
|
-
if (!isNil(this.default)) {
|
249
|
-
this.value = this.default;
|
250
|
-
}
|
251
|
-
else {
|
252
|
-
this.value = Math.round(gap / 2 / this.step) * this.step;
|
253
|
-
}
|
254
|
-
}
|
255
|
-
this.default ??= this.value;
|
256
|
-
}
|
257
|
-
reset() {
|
258
|
-
this.value = this.default;
|
259
|
-
}
|
260
|
-
sort() {
|
261
|
-
return (this.value = this.toSorted());
|
262
|
-
}
|
263
|
-
toSorted() {
|
264
|
-
if (this.range) {
|
265
|
-
return [...this.value].sort((a, b) => a - b);
|
266
|
-
}
|
267
|
-
return this.value;
|
268
|
-
}
|
269
|
-
};
|
270
|
-
__decorate([
|
271
|
-
property({ type: Number })
|
272
|
-
], Range.prototype, "min", void 0);
|
273
|
-
__decorate([
|
274
|
-
property({ type: Number })
|
275
|
-
], Range.prototype, "max", void 0);
|
276
|
-
__decorate([
|
277
|
-
property({ type: Number })
|
278
|
-
], Range.prototype, "step", void 0);
|
279
|
-
__decorate([
|
280
|
-
property({ type: Boolean, reflect: true })
|
281
|
-
], Range.prototype, "vertical", void 0);
|
282
|
-
__decorate([
|
283
|
-
property({ type: Array })
|
284
|
-
], Range.prototype, "value", void 0);
|
285
|
-
__decorate([
|
286
|
-
property({ type: Array })
|
287
|
-
], Range.prototype, "default", void 0);
|
288
|
-
__decorate([
|
289
|
-
part("root")
|
290
|
-
], Range.prototype, "_root", void 0);
|
291
|
-
__decorate([
|
292
|
-
queryAll("[part=handle]")
|
293
|
-
], Range.prototype, "_handles", void 0);
|
294
|
-
__decorate([
|
295
|
-
state()
|
296
|
-
], Range.prototype, "lastFocus", void 0);
|
297
|
-
Range = __decorate([
|
298
|
-
godown(protoName),
|
299
|
-
styles(css `
|
300
|
-
:host {
|
301
|
-
${cssScope}--handle-active: var(${cssGlobalVars.active});
|
302
|
-
${cssScope}--track-width: .5em;
|
303
|
-
${cssScope}--length: var(${cssGlobalVars.input}-width);
|
304
|
-
background: var(${cssGlobalVars.passive});
|
305
|
-
width: var(${cssScope}--length);
|
306
|
-
display: block;
|
307
|
-
}
|
308
|
-
|
309
|
-
:host([contents]) [part="root"] {
|
310
|
-
width: inherit;
|
311
|
-
}
|
312
|
-
|
313
|
-
:host([vertical]) {
|
314
|
-
height: var(${cssScope}--length);
|
315
|
-
width: fit-content;
|
316
|
-
}
|
317
|
-
|
318
|
-
:host(:not([disabled])) .last-focus {
|
319
|
-
${cssScope}--handle-scale: 1.05;
|
320
|
-
background: var(${cssScope}--handle-active);
|
321
|
-
}
|
322
|
-
|
323
|
-
[part="root"] {
|
324
|
-
min-height: inherit;
|
325
|
-
position: relative;
|
326
|
-
border-radius: inherit;
|
327
|
-
width: 100%;
|
328
|
-
--from: 0%;
|
329
|
-
--to: 50%;
|
330
|
-
height: var(${cssScope}--track-width);
|
331
|
-
}
|
332
|
-
|
333
|
-
[part="track"] {
|
334
|
-
height: 100%;
|
335
|
-
min-height: inherit;
|
336
|
-
display: flex;
|
337
|
-
position: absolute;
|
338
|
-
pointer-events: none;
|
339
|
-
border-radius: inherit;
|
340
|
-
justify-content: space-between;
|
341
|
-
left: min(var(--from), var(--to));
|
342
|
-
background: var(${cssGlobalVars.active});
|
343
|
-
width: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));
|
344
|
-
}
|
345
|
-
|
346
|
-
[part="handle"] {
|
347
|
-
width: 1em;
|
348
|
-
height: 1em;
|
349
|
-
display: flex;
|
350
|
-
align-items: center;
|
351
|
-
justify-content: center;
|
352
|
-
user-select: none;
|
353
|
-
position: absolute;
|
354
|
-
border: 0.1em solid;
|
355
|
-
border-radius: 50%;
|
356
|
-
transform-origin: 0% 25%;
|
357
|
-
transform: scale(var(${cssScope}--handle-scale, 1)) translate(-50%, -25%);
|
358
|
-
background: var(${cssGlobalVars.active});
|
359
|
-
border-color: var(${cssGlobalVars.input}-control);
|
360
|
-
}
|
361
|
-
`, css `
|
362
|
-
[vertical] {
|
363
|
-
height: inherit;
|
364
|
-
width: var(${cssScope}--track-width);
|
365
|
-
}
|
366
|
-
|
367
|
-
[vertical] i {
|
368
|
-
transform: translate(-25%, -50%);
|
369
|
-
}
|
370
|
-
|
371
|
-
[vertical] [part="track"] {
|
372
|
-
width: 100%;
|
373
|
-
height: max(calc(var(--to) - var(--from)), calc(var(--from) - var(--to)));
|
374
|
-
top: min(var(--from), var(--to));
|
375
|
-
left: 0;
|
376
|
-
}
|
377
|
-
`, css `
|
378
|
-
[part="handle"] {
|
379
|
-
left: var(--handle);
|
380
|
-
top: 0;
|
381
|
-
}
|
382
|
-
|
383
|
-
[vertical] [part="handle"] {
|
384
|
-
top: var(--handle);
|
385
|
-
left: 0;
|
386
|
-
}
|
387
|
-
`)
|
388
|
-
], Range);
|
389
|
-
export default Range;
|
390
|
-
export { Range };
|
391
|
-
//# sourceMappingURL=range.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"range.js","sourceRoot":"","sources":["../../src/components/range.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE9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,CAAC,eAAe,CAAC;uCACkB;AAG5C;IADC,KAAK,EAAE;wCACW;AA9Cf,KAAK;IA9FV,MAAM,CAAC,SAAS,CAAC;IACjB,MAAM,CACL,GAAG,CAAA;;QAEG,QAAQ,wBAAwB,aAAa,CAAC,MAAM;QACpD,QAAQ;QACR,QAAQ,iBAAiB,aAAa,CAAC,KAAK;wBAC5B,aAAa,CAAC,OAAO;mBAC1B,QAAQ;;;;;;;;;oBASP,QAAQ;;;;;QAKpB,QAAQ;wBACQ,QAAQ;;;;;;;;;;oBAUZ,QAAQ;;;;;;;;;;;;wBAYJ,aAAa,CAAC,MAAM;;;;;;;;;;;;;;;6BAef,QAAQ;wBACb,aAAa,CAAC,MAAM;0BAClB,aAAa,CAAC,KAAK;;GAE1C,EACD,GAAG,CAAA;;;mBAGc,QAAQ;;;;;;;;;;;;;GAaxB,EACD,GAAG,CAAA;;;;;;;;;;GAUF,CACF;GACK,KAAK,CA+SV;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { type TemplateResult } from "lit";
|
2
|
-
import { GlobalStyle } from "../core/global-style.js";
|
3
|
-
/**
|
4
|
-
* {@linkcode Rotate} Make child elements rotate.
|
5
|
-
*
|
6
|
-
* @category wrapper
|
7
|
-
*/
|
8
|
-
declare class Rotate extends GlobalStyle {
|
9
|
-
protected _root: HTMLElement;
|
10
|
-
protected render(): TemplateResult<1>;
|
11
|
-
reset(): void;
|
12
|
-
protected _handleRotate(e: MouseEvent): void;
|
13
|
-
/**
|
14
|
-
* Compute offset.
|
15
|
-
*
|
16
|
-
* @returns rotateX, rotateY
|
17
|
-
* @example
|
18
|
-
* ```ts
|
19
|
-
* const { rotateX, rotateY } = this._computeOffset(e);
|
20
|
-
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`;
|
21
|
-
* ```
|
22
|
-
*/
|
23
|
-
protected _computeOffset(e: MouseEvent): {
|
24
|
-
rotateX: number;
|
25
|
-
rotateY: number;
|
26
|
-
};
|
27
|
-
}
|
28
|
-
export default Rotate;
|
29
|
-
export { Rotate };
|
30
|
-
//# sourceMappingURL=rotate.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"rotate.d.ts","sourceRoot":"","sources":["../../src/components/rotate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AAKnE;;;;GAIG;AACH,cA+BM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAcrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAM5C;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB;CAUF;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dev/components/rotate.js
DELETED
@@ -1,93 +0,0 @@
|
|
1
|
-
import { __decorate } from "tslib";
|
2
|
-
import { godown, htmlSlot, part, styles } from "@godown/element";
|
3
|
-
import { css, html } from "lit";
|
4
|
-
import { GlobalStyle, scopePrefix } from "../core/global-style.js";
|
5
|
-
const protoName = "rotate";
|
6
|
-
const cssScope = scopePrefix(protoName);
|
7
|
-
/**
|
8
|
-
* {@linkcode Rotate} Make child elements rotate.
|
9
|
-
*
|
10
|
-
* @category wrapper
|
11
|
-
*/
|
12
|
-
let Rotate = class Rotate extends GlobalStyle {
|
13
|
-
render() {
|
14
|
-
return html `
|
15
|
-
<div part="root">
|
16
|
-
<div
|
17
|
-
part="slot"
|
18
|
-
@mousemove="${this._handleRotate}"
|
19
|
-
>
|
20
|
-
${htmlSlot()}
|
21
|
-
</div>
|
22
|
-
<i @mouseleave="${this.reset}"></i>
|
23
|
-
</div>
|
24
|
-
`;
|
25
|
-
}
|
26
|
-
reset() {
|
27
|
-
this._root.style.removeProperty("transform");
|
28
|
-
this._root.style.removeProperty("transition");
|
29
|
-
}
|
30
|
-
_handleRotate(e) {
|
31
|
-
const { rotateX, rotateY } = this._computeOffset(e);
|
32
|
-
this._root.style.setProperty("transform", `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`);
|
33
|
-
this._root.style.setProperty("transition", "0s");
|
34
|
-
}
|
35
|
-
/**
|
36
|
-
* Compute offset.
|
37
|
-
*
|
38
|
-
* @returns rotateX, rotateY
|
39
|
-
* @example
|
40
|
-
* ```ts
|
41
|
-
* const { rotateX, rotateY } = this._computeOffset(e);
|
42
|
-
* `rotateX(${rotateX}rad) rotateY(${rotateY}rad)`;
|
43
|
-
* ```
|
44
|
-
*/
|
45
|
-
_computeOffset(e) {
|
46
|
-
const { left, top, width, height } = this._root.getBoundingClientRect();
|
47
|
-
const { clientX, clientY } = e;
|
48
|
-
const offsetX = clientX - left;
|
49
|
-
const offsetY = clientY - top;
|
50
|
-
const rotateX = -(offsetY - height / 2) / height / 2;
|
51
|
-
const rotateY = (offsetX - width / 2) / width / 2;
|
52
|
-
return { rotateX, rotateY };
|
53
|
-
}
|
54
|
-
};
|
55
|
-
__decorate([
|
56
|
-
part("root")
|
57
|
-
], Rotate.prototype, "_root", void 0);
|
58
|
-
Rotate = __decorate([
|
59
|
-
godown(protoName),
|
60
|
-
styles(css `
|
61
|
-
:host {
|
62
|
-
display: block;
|
63
|
-
width: -moz-fit-content;
|
64
|
-
width: fit-content;
|
65
|
-
transition: all 0.5s ease-in-out;
|
66
|
-
${cssScope}--padding: .75em;
|
67
|
-
${cssScope}--offset: .5em;
|
68
|
-
}
|
69
|
-
|
70
|
-
div {
|
71
|
-
position: relative;
|
72
|
-
transition: inherit;
|
73
|
-
transition-property: transform;
|
74
|
-
}
|
75
|
-
|
76
|
-
i {
|
77
|
-
width: 100%;
|
78
|
-
height: 100%;
|
79
|
-
position: absolute;
|
80
|
-
top: 0;
|
81
|
-
box-sizing: content-box;
|
82
|
-
padding: var(${cssScope}--offset);
|
83
|
-
margin: calc(-1 * var(${cssScope}--offset));
|
84
|
-
}
|
85
|
-
|
86
|
-
[part="slot"] {
|
87
|
-
z-index: 2;
|
88
|
-
}
|
89
|
-
`)
|
90
|
-
], Rotate);
|
91
|
-
export default Rotate;
|
92
|
-
export { Rotate };
|
93
|
-
//# sourceMappingURL=rotate.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"rotate.js","sourceRoot":"","sources":["../../src/components/rotate.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAuB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,SAAS,GAAG,QAAQ,CAAC;AAC3B,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;AAExC;;;;GAIG;AAgCH,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,WAAW;IAIpB,MAAM;QACd,OAAO,IAAI,CAAA;;;;wBAIS,IAAI,CAAC,aAAa;;YAE9B,QAAQ,EAAE;;0BAEI,IAAI,CAAC,KAAK;;KAE/B,CAAC;IACJ,CAAC;IAED,KAAK;QACH,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;QAC7C,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IAChD,CAAC;IAES,aAAa,CAAC,CAAa;QACnC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE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";
|
3
|
-
import { GlobalStyle } from "../core/global-style.js";
|
4
|
-
interface RouteState {
|
5
|
-
pathname: string;
|
6
|
-
params: Record<string, string>;
|
7
|
-
path: string;
|
8
|
-
}
|
9
|
-
interface RouteResult extends RouteState {
|
10
|
-
component: unknown;
|
11
|
-
}
|
12
|
-
interface RouteItem {
|
13
|
-
[key: PropertyKey]: unknown;
|
14
|
-
path: string;
|
15
|
-
render?: (state?: RouteState) => unknown;
|
16
|
-
component?: unknown;
|
17
|
-
}
|
18
|
-
declare const routerTypes: {
|
19
|
-
readonly field: "field";
|
20
|
-
readonly slotted: "slotted";
|
21
|
-
readonly united: "united";
|
22
|
-
};
|
23
|
-
type RouterType = keyof typeof routerTypes;
|
24
|
-
/**
|
25
|
-
* {@linkcode Router} has basic routing control.
|
26
|
-
*
|
27
|
-
* To switch routes, use `router-link component`.
|
28
|
-
*
|
29
|
-
* It has two methods to collect routes.
|
30
|
-
*
|
31
|
-
* 1. From field `routes`, an array, each elements require "path".
|
32
|
-
* 2. From child elements, which have the slot attribute for matching routes.
|
33
|
-
*
|
34
|
-
* If only the method 1 is used, set `type` to `"field"`.
|
35
|
-
*
|
36
|
-
* If only the method 2 is used, set `type` to `"slotted"`.
|
37
|
-
*
|
38
|
-
* `type` defaults to `"united"`, which will try method 1, then method 2.
|
39
|
-
*
|
40
|
-
* If no routes are matched, the default value (no named slot) will be rendered.
|
41
|
-
*
|
42
|
-
* @slot - Display slot when there is no match.
|
43
|
-
* @slot * - Matching slot will be displayed.
|
44
|
-
* @category navigation
|
45
|
-
*/
|
46
|
-
declare class Router extends GlobalStyle {
|
47
|
-
static routerInstances: Set<Router>;
|
48
|
-
private __fieldRouteTree;
|
49
|
-
private __slottedRouteTree;
|
50
|
-
private __cacheRecord;
|
51
|
-
private __routes;
|
52
|
-
/**
|
53
|
-
* Render result.
|
54
|
-
*/
|
55
|
-
component: unknown | TemplateResult;
|
56
|
-
/**
|
57
|
-
* Dynamic parameters record.
|
58
|
-
*/
|
59
|
-
get params(): Record<string, string>;
|
60
|
-
/**
|
61
|
-
* Value of matched path in routes.
|
62
|
-
*/
|
63
|
-
path?: string;
|
64
|
-
/**
|
65
|
-
* Current pathname (equals to location.pathname).
|
66
|
-
*/
|
67
|
-
pathname: string;
|
68
|
-
/**
|
69
|
-
* Rendered content when there is no match.
|
70
|
-
*/
|
71
|
-
default: TemplateResult;
|
72
|
-
/**
|
73
|
-
* The type of routing sources.
|
74
|
-
*
|
75
|
-
* If field, it won't collect the slot attribute of the child elements.
|
76
|
-
*
|
77
|
-
* This property should not be changed after the rendering is complete.
|
78
|
-
*/
|
79
|
-
type: RouterType;
|
80
|
-
/**
|
81
|
-
* Cache accessed records.
|
82
|
-
*
|
83
|
-
* Emptied at each re-collection.
|
84
|
-
*/
|
85
|
-
cache: boolean;
|
86
|
-
set routes(value: RouteItem[]);
|
87
|
-
get routes(): RouteItem[];
|
88
|
-
clear(): void;
|
89
|
-
protected render(): unknown;
|
90
|
-
connectedCallback(): void;
|
91
|
-
disconnectedCallback(): void;
|
92
|
-
useRouter(): RouteResult;
|
93
|
-
protected updated(changedProperties: PropertyValueMap<this>): void;
|
94
|
-
/**
|
95
|
-
* Get component from {@linkcode routes} by query.
|
96
|
-
*/
|
97
|
-
fieldComponent(query?: string): unknown;
|
98
|
-
/**
|
99
|
-
* Get component from slotted elements by query.
|
100
|
-
*/
|
101
|
-
slottedComponent(query?: string): TemplateResult<1>;
|
102
|
-
/**
|
103
|
-
* Reset the route tree, clear cache, collect routes from child elements.
|
104
|
-
*/
|
105
|
-
collectSlottedRoutes(): void;
|
106
|
-
/**
|
107
|
-
* Reset the route tree, clear cache, collect routes from value.
|
108
|
-
*/
|
109
|
-
collectFieldRoutes(value: typeof this.routes): void;
|
110
|
-
static updateAll(): void;
|
111
|
-
search(pathname: string): RouteTree;
|
112
|
-
handlePopstate: () => void;
|
113
|
-
}
|
114
|
-
export default Router;
|
115
|
-
export { Router };
|
116
|
-
//# sourceMappingURL=router.d.ts.map
|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