godown 1.1.4 → 1.1.6
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/README.md +35 -35
- package/conf.d.ts +18 -18
- package/conf.js +22 -22
- package/deps.d.ts +7 -7
- package/deps.js +7 -7
- package/effect/index.d.ts +3 -3
- package/effect/index.js +3 -3
- package/effect/ov-effect.d.ts +23 -23
- package/effect/ov-effect.d.ts.map +1 -1
- package/effect/ov-effect.js +299 -275
- package/effect/ro-effect.d.ts +19 -19
- package/effect/ro-effect.d.ts.map +1 -1
- package/effect/ro-effect.js +125 -120
- package/effect/std.d.ts +3 -3
- package/effect/std.d.ts.map +1 -1
- package/effect/std.js +3 -3
- package/effect/tw-effect.d.ts +21 -21
- package/effect/tw-effect.d.ts.map +1 -1
- package/effect/tw-effect.js +108 -107
- package/glob.d.ts +8 -8
- package/glob.d.ts.map +1 -1
- package/glob.js +25 -24
- package/group/avatar-group.d.ts +20 -20
- package/group/avatar-group.d.ts.map +1 -1
- package/group/avatar-group.js +112 -88
- package/group/button-group.d.ts +12 -12
- package/group/button-group.d.ts.map +1 -1
- package/group/button-group.js +79 -74
- package/group/details-group.d.ts +16 -16
- package/group/details-group.d.ts.map +1 -1
- package/group/details-group.js +55 -53
- package/group/index.d.ts +3 -3
- package/group/index.js +3 -3
- package/group/std.d.ts +3 -3
- package/group/std.d.ts.map +1 -1
- package/group/std.js +3 -3
- package/index.d.ts +7 -7
- package/index.js +7 -7
- package/input-form/base-input.d.ts +32 -32
- package/input-form/base-input.d.ts.map +1 -1
- package/input-form/base-input.js +229 -226
- package/input-form/exp-input.d.ts +22 -22
- package/input-form/exp-input.d.ts.map +1 -1
- package/input-form/exp-input.js +218 -205
- package/input-form/index.d.ts +8 -8
- package/input-form/index.js +8 -8
- package/input-form/label-input.d.ts +21 -21
- package/input-form/label-input.d.ts.map +1 -1
- package/input-form/label-input.js +150 -137
- package/input-form/search-input.d.ts +36 -36
- package/input-form/search-input.d.ts.map +1 -1
- package/input-form/search-input.js +311 -297
- package/input-form/select-input.d.ts +31 -31
- package/input-form/select-input.d.ts.map +1 -1
- package/input-form/select-input.js +354 -330
- package/input-form/sign-form.d.ts +25 -23
- package/input-form/sign-form.d.ts.map +1 -1
- package/input-form/sign-form.js +165 -160
- package/input-form/split-input.d.ts +26 -26
- package/input-form/split-input.d.ts.map +1 -1
- package/input-form/split-input.js +181 -173
- package/input-form/std.d.ts +19 -19
- package/input-form/std.d.ts.map +1 -1
- package/input-form/std.js +72 -68
- package/input-form/switch-input.d.ts +22 -22
- package/input-form/switch-input.d.ts.map +1 -1
- package/input-form/switch-input.js +181 -175
- package/items/alert-item.d.ts +16 -16
- package/items/alert-item.d.ts.map +1 -1
- package/items/alert-item.js +143 -142
- package/items/avatar-anchor.d.ts +19 -19
- package/items/avatar-anchor.d.ts.map +1 -1
- package/items/avatar-anchor.js +150 -148
- package/items/base-button.d.ts +16 -16
- package/items/base-button.d.ts.map +1 -1
- package/items/base-button.js +170 -167
- package/items/dialog-item.d.ts +24 -24
- package/items/dialog-item.d.ts.map +1 -1
- package/items/dialog-item.js +157 -156
- package/items/index.d.ts +7 -7
- package/items/index.js +7 -7
- package/items/link-a.d.ts +19 -19
- package/items/link-a.d.ts.map +1 -1
- package/items/link-a.js +98 -97
- package/items/load-track.d.ts +20 -20
- package/items/load-track.d.ts.map +1 -1
- package/items/load-track.js +115 -109
- package/items/std.d.ts +3 -3
- package/items/std.d.ts.map +1 -1
- package/items/std.js +3 -3
- package/items/super-a.d.ts +15 -15
- package/items/super-a.d.ts.map +1 -1
- package/items/super-a.js +99 -88
- package/layout/div-line.d.ts +15 -15
- package/layout/div-line.d.ts.map +1 -1
- package/layout/div-line.js +71 -65
- package/layout/drag-box.d.ts +25 -25
- package/layout/drag-box.d.ts.map +1 -1
- package/layout/drag-box.js +95 -94
- package/layout/flex-flow.d.ts +13 -13
- package/layout/flex-flow.d.ts.map +1 -1
- package/layout/flex-flow.js +39 -34
- package/layout/index.d.ts +5 -5
- package/layout/index.js +5 -5
- package/layout/nav-aside.d.ts +13 -13
- package/layout/nav-aside.d.ts.map +1 -1
- package/layout/nav-aside.js +61 -54
- package/layout/nav-layout.d.ts +16 -16
- package/layout/nav-layout.d.ts.map +1 -1
- package/layout/nav-layout.js +167 -146
- package/layout/std.d.ts +4 -4
- package/layout/std.d.ts.map +1 -1
- package/layout/std.js +10 -8
- package/package.json +48 -40
- package/react/effect.d.ts +9 -9
- package/react/effect.d.ts.map +1 -1
- package/react/effect.js +33 -33
- package/react/group.d.ts +4 -4
- package/react/group.d.ts.map +1 -1
- package/react/group.js +19 -19
- package/react/index.d.ts +7 -7
- package/react/index.d.ts.map +1 -1
- package/react/index.js +7 -7
- package/react/input-form.d.ts +32 -32
- package/react/input-form.d.ts.map +1 -1
- package/react/input-form.js +65 -65
- package/react/items.d.ts +8 -8
- package/react/items.d.ts.map +1 -1
- package/react/items.js +39 -39
- package/react/layout.d.ts +6 -6
- package/react/layout.d.ts.map +1 -1
- package/react/layout.js +29 -29
- package/react/view.d.ts +6 -6
- package/react/view.d.ts.map +1 -1
- package/react/view.js +29 -29
- package/view/details-expand.d.ts +18 -18
- package/view/details-expand.d.ts.map +1 -1
- package/view/details-expand.js +85 -80
- package/view/down-drop.d.ts +18 -18
- package/view/down-drop.d.ts.map +1 -1
- package/view/down-drop.js +98 -94
- package/view/index.d.ts +5 -5
- package/view/index.js +5 -5
- package/view/menu-list.d.ts +16 -16
- package/view/menu-list.d.ts.map +1 -1
- package/view/menu-list.js +77 -72
- package/view/route-view.d.ts +57 -57
- package/view/route-view.d.ts.map +1 -1
- package/view/route-view.js +261 -258
- package/view/scroll-x.d.ts +14 -14
- package/view/scroll-x.d.ts.map +1 -1
- package/view/scroll-x.js +77 -72
- package/view/std.d.ts +4 -4
- package/view/std.d.ts.map +1 -1
- package/view/std.js +37 -37
- package/with.d.ts +27 -27
- package/with.d.ts.map +1 -1
- package/with.js +77 -78
- package/view/react/effect.d.ts +0 -10
- package/view/react/effect.d.ts.map +0 -1
- package/view/react/effect.js +0 -32
- package/view/react/group.d.ts +0 -5
- package/view/react/group.d.ts.map +0 -1
- package/view/react/group.js +0 -18
- package/view/react/index.d.ts +0 -7
- package/view/react/index.d.ts.map +0 -1
- package/view/react/index.js +0 -6
- package/view/react/input-form.d.ts +0 -33
- package/view/react/input-form.d.ts.map +0 -1
- package/view/react/input-form.js +0 -64
- package/view/react/items.d.ts +0 -9
- package/view/react/items.d.ts.map +0 -1
- package/view/react/items.js +0 -38
- package/view/react/layout.d.ts +0 -7
- package/view/react/layout.d.ts.map +0 -1
- package/view/react/layout.js +0 -28
- package/view/react/view.d.ts +0 -7
- package/view/react/view.d.ts.map +0 -1
- package/view/react/view.js +0 -28
package/effect/ro-effect.js
CHANGED
@@ -1,120 +1,125 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import { css, define, html, property } from "../deps.js";
|
8
|
-
import STD from "./std.js";
|
9
|
-
let ROPort = class ROPort extends STD {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.index = 0;
|
13
|
-
this.autochange = 0;
|
14
|
-
this.current = 0;
|
15
|
-
}
|
16
|
-
get assigned() {
|
17
|
-
return this.shadowRoot.querySelector("slot").assignedElements();
|
18
|
-
}
|
19
|
-
render() {
|
20
|
-
return html `<div>
|
21
|
-
<a @click=${this.prev} prev
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
}
|
34
|
-
this.
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
e.style.width =
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { css, define, html, property } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let ROPort = class ROPort extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.index = 0;
|
13
|
+
this.autochange = 0;
|
14
|
+
this.current = 0;
|
15
|
+
}
|
16
|
+
get assigned() {
|
17
|
+
return this.shadowRoot.querySelector("slot").assignedElements();
|
18
|
+
}
|
19
|
+
render() {
|
20
|
+
return html `<div>
|
21
|
+
<a @click=${this.prev} prev>
|
22
|
+
<svg viewBox="0 0 48 48" fill="none"><path d="M31 36L19 24L31 12" stroke="#1e293b" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
23
|
+
</a>
|
24
|
+
<section><slot></slot></section>
|
25
|
+
<a @click=${this.next} next
|
26
|
+
><svg viewBox="0 0 48 48" fill="none"><path d="M19 12L31 24L19 36" stroke="#1e293b" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" /></svg>
|
27
|
+
</a>
|
28
|
+
</div>`;
|
29
|
+
}
|
30
|
+
firstUpdated() {
|
31
|
+
if (this.assigned.length == 0)
|
32
|
+
return;
|
33
|
+
this.shadowRoot.querySelector("div").style.width = `${this.assigned[0].offsetWidth}px`;
|
34
|
+
this.assigned.forEach((e) => {
|
35
|
+
e.style.overflowX = "hidden";
|
36
|
+
e.style.transition = "width 0s";
|
37
|
+
});
|
38
|
+
this.show(this.index);
|
39
|
+
if (this.autochange)
|
40
|
+
setInterval(() => {
|
41
|
+
this.index++;
|
42
|
+
if (this.index >= this.assigned.length)
|
43
|
+
this.index = 0;
|
44
|
+
this.show(this.index);
|
45
|
+
}, this.autochange);
|
46
|
+
}
|
47
|
+
show(i) {
|
48
|
+
this.shadowRoot.querySelector("section").style.width = "100%";
|
49
|
+
this.assigned.forEach((e, index) => {
|
50
|
+
if (index == i) {
|
51
|
+
e.style.width = "100%";
|
52
|
+
e.style.transition = "";
|
53
|
+
}
|
54
|
+
else {
|
55
|
+
e.style.width = 0;
|
56
|
+
}
|
57
|
+
});
|
58
|
+
this.current = i;
|
59
|
+
}
|
60
|
+
next() {
|
61
|
+
this.index++;
|
62
|
+
if (this.index >= this.assigned.length)
|
63
|
+
this.index = 0;
|
64
|
+
this.show(this.index);
|
65
|
+
}
|
66
|
+
prev() {
|
67
|
+
this.index--;
|
68
|
+
if (this.index < 0)
|
69
|
+
this.index = this.assigned.length - 1;
|
70
|
+
this.show(this.index);
|
71
|
+
}
|
72
|
+
};
|
73
|
+
ROPort.styles = css `
|
74
|
+
:host {
|
75
|
+
display: block;
|
76
|
+
}
|
77
|
+
div,
|
78
|
+
section {
|
79
|
+
display: flex;
|
80
|
+
position: relative;
|
81
|
+
}
|
82
|
+
div {
|
83
|
+
min-width: 5.8em;
|
84
|
+
overflow: hidden;
|
85
|
+
}
|
86
|
+
a {
|
87
|
+
position: absolute;
|
88
|
+
height: 100%;
|
89
|
+
width: 1.4em;
|
90
|
+
z-index: 1;
|
91
|
+
transition: all 0.3s;
|
92
|
+
}
|
93
|
+
a:hover {
|
94
|
+
background-color: #0000000f;
|
95
|
+
padding: 0 0.05em;
|
96
|
+
}
|
97
|
+
a[prev] {
|
98
|
+
left: 0;
|
99
|
+
}
|
100
|
+
a[next] {
|
101
|
+
right: 0;
|
102
|
+
}
|
103
|
+
:host(:hover) a[prev] {
|
104
|
+
margin-left: 0.05em;
|
105
|
+
}
|
106
|
+
:host(:hover) a[next] {
|
107
|
+
margin-right: 0.05em;
|
108
|
+
}
|
109
|
+
svg {
|
110
|
+
display: flex;
|
111
|
+
height: 100%;
|
112
|
+
width: 1.4em;
|
113
|
+
}
|
114
|
+
`;
|
115
|
+
__decorate([
|
116
|
+
property({ type: Number })
|
117
|
+
], ROPort.prototype, "index", void 0);
|
118
|
+
__decorate([
|
119
|
+
property({ type: Number })
|
120
|
+
], ROPort.prototype, "autochange", void 0);
|
121
|
+
ROPort = __decorate([
|
122
|
+
define("ro-port")
|
123
|
+
], ROPort);
|
124
|
+
export { ROPort };
|
125
|
+
export default ROPort;
|
package/effect/std.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { GLOBSTD } from "../deps.js";
|
2
|
-
export default class EffectSTD extends GLOBSTD {
|
3
|
-
}
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class EffectSTD extends GLOBSTD {
|
3
|
+
}
|
4
4
|
//# sourceMappingURL=std.d.ts.map
|
package/effect/std.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../src/effect/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;
|
1
|
+
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../src/effect/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;CAAG"}
|
package/effect/std.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import { GLOBSTD } from "../deps.js";
|
2
|
-
export default class EffectSTD extends GLOBSTD {
|
3
|
-
}
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class EffectSTD extends GLOBSTD {
|
3
|
+
}
|
package/effect/tw-effect.d.ts
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
import STD from "./std.js";
|
2
|
-
export declare class TWText extends STD {
|
3
|
-
text: string;
|
4
|
-
stopped: boolean;
|
5
|
-
autochange: number;
|
6
|
-
max: number;
|
7
|
-
min: number;
|
8
|
-
len: number;
|
9
|
-
_timer: any[];
|
10
|
-
static styles: import("lit").CSSResult;
|
11
|
-
render(): import("lit").TemplateResult<1>;
|
12
|
-
firstUpdated(): void;
|
13
|
-
rewrite(): void;
|
14
|
-
stop(): void;
|
15
|
-
}
|
16
|
-
export default TWText;
|
17
|
-
declare global {
|
18
|
-
interface HTMLElementTagNameMap {
|
19
|
-
"tw-text": TWText;
|
20
|
-
}
|
21
|
-
}
|
1
|
+
import STD from "./std.js";
|
2
|
+
export declare class TWText extends STD {
|
3
|
+
text: string;
|
4
|
+
stopped: boolean;
|
5
|
+
autochange: number;
|
6
|
+
max: number;
|
7
|
+
min: number;
|
8
|
+
len: number;
|
9
|
+
_timer: any[];
|
10
|
+
static styles: import("lit").CSSResult;
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
12
|
+
firstUpdated(): void;
|
13
|
+
rewrite(): void;
|
14
|
+
stop(): void;
|
15
|
+
}
|
16
|
+
export default TWText;
|
17
|
+
declare global {
|
18
|
+
interface HTMLElementTagNameMap {
|
19
|
+
"tw-text": TWText;
|
20
|
+
}
|
21
|
+
}
|
22
22
|
//# sourceMappingURL=tw-effect.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tw-effect.d.ts","sourceRoot":"","sources":["../../src/effect/tw-effect.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,MAAO,SAAQ,GAAG;IACjB,IAAI,EAAE,MAAM,CAAa;IACR,OAAO,UAAS;IACjB,UAAU,SAAK;IACf,GAAG,SAAM;IACT,GAAG,SAAO;IAC7B,GAAG,SAAK;IACR,MAAM,QAAM;IACrB,MAAM,CAAC,MAAM,
|
1
|
+
{"version":3,"file":"tw-effect.d.ts","sourceRoot":"","sources":["../../src/effect/tw-effect.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,MAAO,SAAQ,GAAG;IACjB,IAAI,EAAE,MAAM,CAAa;IACR,OAAO,UAAS;IACjB,UAAU,SAAK;IACf,GAAG,SAAM;IACT,GAAG,SAAO;IAC7B,GAAG,SAAK;IACR,MAAM,QAAM;IACrB,MAAM,CAAC,MAAM,0BAkBX;IACF,MAAM;IAGN,YAAY;IAKZ,OAAO;IAyBP,IAAI;CAML;AAID,eAAe,MAAM,CAAC;AACtB,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,MAAM,CAAC;KACnB;CACF"}
|
package/effect/tw-effect.js
CHANGED
@@ -1,107 +1,108 @@
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
-
};
|
7
|
-
import { css, define, html, property, state } from "../deps.js";
|
8
|
-
import STD from "./std.js";
|
9
|
-
let TWText = class TWText extends STD {
|
10
|
-
constructor() {
|
11
|
-
super(...arguments);
|
12
|
-
this.text = undefined;
|
13
|
-
this.stopped = false;
|
14
|
-
this.autochange = 0;
|
15
|
-
this.max = 50;
|
16
|
-
this.min = 500;
|
17
|
-
this.len = 0;
|
18
|
-
this._timer = [];
|
19
|
-
}
|
20
|
-
render() {
|
21
|
-
return html `<slot></slot><i></i>`;
|
22
|
-
}
|
23
|
-
firstUpdated() {
|
24
|
-
var _a;
|
25
|
-
if (!this.text)
|
26
|
-
this.text = ((_a = this.shadowRoot.querySelector("slot").assignedNodes()[0]) === null || _a === void 0 ? void 0 : _a.textContent.trim()) || "";
|
27
|
-
this.len = this.text.length;
|
28
|
-
if (!this.stopped && this.len)
|
29
|
-
this.rewrite();
|
30
|
-
}
|
31
|
-
rewrite() {
|
32
|
-
for (const timer of this._timer) {
|
33
|
-
clearTimeout(timer);
|
34
|
-
}
|
35
|
-
this._timer = [];
|
36
|
-
const text = this.shadowRoot.querySelector("slot").assignedNodes()[0];
|
37
|
-
text.textContent = "";
|
38
|
-
let delay = 0;
|
39
|
-
let autochange = this.autochange ? this.autochange : random(this.min, this.max);
|
40
|
-
this.text.split("").forEach((char) => {
|
41
|
-
this._timer.push(setTimeout(() => {
|
42
|
-
text.textContent += char;
|
43
|
-
this.dispatchEvent(new CustomEvent("change"));
|
44
|
-
if (this.len === text.textContent.length) {
|
45
|
-
this.dispatchEvent(new CustomEvent("done", { detail: delay }));
|
46
|
-
}
|
47
|
-
}, delay));
|
48
|
-
delay += autochange;
|
49
|
-
if (!this.autochange) {
|
50
|
-
autochange = random(this.min, this.max);
|
51
|
-
}
|
52
|
-
});
|
53
|
-
}
|
54
|
-
stop() {
|
55
|
-
for (const timer of this._timer) {
|
56
|
-
clearTimeout(timer);
|
57
|
-
}
|
58
|
-
this._timer = [];
|
59
|
-
}
|
60
|
-
};
|
61
|
-
TWText.styles = css `
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
TWText
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { css, define, html, property, state } from "../deps.js";
|
8
|
+
import STD from "./std.js";
|
9
|
+
let TWText = class TWText extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.text = undefined;
|
13
|
+
this.stopped = false;
|
14
|
+
this.autochange = 0;
|
15
|
+
this.max = 50;
|
16
|
+
this.min = 500;
|
17
|
+
this.len = 0;
|
18
|
+
this._timer = [];
|
19
|
+
}
|
20
|
+
render() {
|
21
|
+
return html `<slot></slot><i></i>`;
|
22
|
+
}
|
23
|
+
firstUpdated() {
|
24
|
+
var _a;
|
25
|
+
if (!this.text)
|
26
|
+
this.text = ((_a = this.shadowRoot.querySelector("slot").assignedNodes()[0]) === null || _a === void 0 ? void 0 : _a.textContent.trim()) || "";
|
27
|
+
this.len = this.text.length;
|
28
|
+
if (!this.stopped && this.len)
|
29
|
+
this.rewrite();
|
30
|
+
}
|
31
|
+
rewrite() {
|
32
|
+
for (const timer of this._timer) {
|
33
|
+
clearTimeout(timer);
|
34
|
+
}
|
35
|
+
this._timer = [];
|
36
|
+
const text = this.shadowRoot.querySelector("slot").assignedNodes()[0];
|
37
|
+
text.textContent = "";
|
38
|
+
let delay = 0;
|
39
|
+
let autochange = this.autochange ? this.autochange : random(this.min, this.max);
|
40
|
+
this.text.split("").forEach((char) => {
|
41
|
+
this._timer.push(setTimeout(() => {
|
42
|
+
text.textContent += char;
|
43
|
+
this.dispatchEvent(new CustomEvent("change"));
|
44
|
+
if (this.len === text.textContent.length) {
|
45
|
+
this.dispatchEvent(new CustomEvent("done", { detail: delay }));
|
46
|
+
}
|
47
|
+
}, delay));
|
48
|
+
delay += autochange;
|
49
|
+
if (!this.autochange) {
|
50
|
+
autochange = random(this.min, this.max);
|
51
|
+
}
|
52
|
+
});
|
53
|
+
}
|
54
|
+
stop() {
|
55
|
+
for (const timer of this._timer) {
|
56
|
+
clearTimeout(timer);
|
57
|
+
}
|
58
|
+
this._timer = [];
|
59
|
+
}
|
60
|
+
};
|
61
|
+
TWText.styles = css `
|
62
|
+
:host {
|
63
|
+
font-family: monospace;
|
64
|
+
white-space: nowrap;
|
65
|
+
}
|
66
|
+
i {
|
67
|
+
border-right: 1px solid;
|
68
|
+
margin: 1px;
|
69
|
+
animation: s 1.5s steps(1) infinite;
|
70
|
+
}
|
71
|
+
@keyframes s {
|
72
|
+
0% {
|
73
|
+
border-color: currentColor;
|
74
|
+
}
|
75
|
+
50% {
|
76
|
+
border-color: transparent;
|
77
|
+
}
|
78
|
+
}
|
79
|
+
`;
|
80
|
+
__decorate([
|
81
|
+
property()
|
82
|
+
], TWText.prototype, "text", void 0);
|
83
|
+
__decorate([
|
84
|
+
property({ type: Boolean })
|
85
|
+
], TWText.prototype, "stopped", void 0);
|
86
|
+
__decorate([
|
87
|
+
property({ type: Number })
|
88
|
+
], TWText.prototype, "autochange", void 0);
|
89
|
+
__decorate([
|
90
|
+
property({ type: Number })
|
91
|
+
], TWText.prototype, "max", void 0);
|
92
|
+
__decorate([
|
93
|
+
property({ type: Number })
|
94
|
+
], TWText.prototype, "min", void 0);
|
95
|
+
__decorate([
|
96
|
+
state()
|
97
|
+
], TWText.prototype, "len", void 0);
|
98
|
+
__decorate([
|
99
|
+
state()
|
100
|
+
], TWText.prototype, "_timer", void 0);
|
101
|
+
TWText = __decorate([
|
102
|
+
define("tw-text")
|
103
|
+
], TWText);
|
104
|
+
export { TWText };
|
105
|
+
function random(m = 0, n = 1) {
|
106
|
+
return Math.random() * (n - m) + m;
|
107
|
+
}
|
108
|
+
export default TWText;
|
package/glob.d.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
import { CSSResultGroup, LitElement } from "lit";
|
2
|
-
/**
|
3
|
-
* Custom CSS variable,join with "--" ,only allow `a-Z,0-9,-`
|
4
|
-
*/
|
5
|
-
export declare const cssvar: import("lit").CSSResult;
|
6
|
-
export declare class GLOBSTD extends LitElement {
|
7
|
-
static styles: CSSResultGroup;
|
8
|
-
}
|
1
|
+
import { CSSResultGroup, LitElement } from "lit";
|
2
|
+
/**
|
3
|
+
* Custom CSS variable,join with "--" ,only allow `a-Z,0-9,-`
|
4
|
+
*/
|
5
|
+
export declare const cssvar: import("lit").CSSResult;
|
6
|
+
export declare class GLOBSTD extends LitElement {
|
7
|
+
static styles: CSSResultGroup;
|
8
|
+
}
|
9
9
|
//# sourceMappingURL=glob.d.ts.map
|
package/glob.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,MAAM,
|
1
|
+
{"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAC;AACjE;;GAEG;AACH,eAAO,MAAM,MAAM,yBAAgE,CAAC;AACpF,qBAAa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,iBAgBO;CACrB"}
|
package/glob.js
CHANGED
@@ -1,24 +1,25 @@
|
|
1
|
-
import { conf } from "./conf.js";
|
2
|
-
import { LitElement, css, unsafeCSS } from "lit";
|
3
|
-
/**
|
4
|
-
* Custom CSS variable,join with "--" ,only allow `a-Z,0-9,-`
|
5
|
-
*/
|
6
|
-
export const cssvar = unsafeCSS("--" + conf.cssvar.replace(/[^a-zA-Z0-9
|
7
|
-
export class GLOBSTD extends LitElement {
|
8
|
-
}
|
9
|
-
GLOBSTD.styles = css `
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
import { conf } from "./conf.js";
|
2
|
+
import { LitElement, css, unsafeCSS } from "lit";
|
3
|
+
/**
|
4
|
+
* Custom CSS variable,join with "--" ,only allow `a-Z,0-9,-`
|
5
|
+
*/
|
6
|
+
export const cssvar = unsafeCSS("--" + conf.cssvar.replace(/[^a-zA-Z0-9\\-]/g, ""));
|
7
|
+
export class GLOBSTD extends LitElement {
|
8
|
+
}
|
9
|
+
GLOBSTD.styles = css `
|
10
|
+
:host {
|
11
|
+
${cssvar}--text-selection: rgb(80 255 255);
|
12
|
+
${cssvar}--text-selection-background: rgb(0 0 0 / 10%);
|
13
|
+
}
|
14
|
+
* {
|
15
|
+
font-size: 100%;
|
16
|
+
color: inherit;
|
17
|
+
box-sizing: border-box;
|
18
|
+
margin: 0;
|
19
|
+
padding: 0;
|
20
|
+
}
|
21
|
+
::selection {
|
22
|
+
color: var(${cssvar}--text-selection);
|
23
|
+
background: var(${cssvar}--text-selection-background);
|
24
|
+
}
|
25
|
+
`;
|
package/group/avatar-group.d.ts
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
import STD from "./std.js";
|
2
|
-
export declare class AvatarGroup extends STD {
|
3
|
-
rank: boolean;
|
4
|
-
max: number;
|
5
|
-
more: number;
|
6
|
-
usefresh: () => Promise<void>;
|
7
|
-
static styles: import("lit").CSSResult;
|
8
|
-
get assigned(): HTMLElement[];
|
9
|
-
render(): import("lit").TemplateResult<1>;
|
10
|
-
firstUpdated(): void;
|
11
|
-
append(args?: string): void;
|
12
|
-
subtract(): void;
|
13
|
-
fresh(): Promise<void>;
|
14
|
-
}
|
15
|
-
export default AvatarGroup;
|
16
|
-
declare global {
|
17
|
-
interface HTMLElementTagNameMap {
|
18
|
-
"avatar-group": AvatarGroup;
|
19
|
-
}
|
20
|
-
}
|
1
|
+
import STD from "./std.js";
|
2
|
+
export declare class AvatarGroup extends STD {
|
3
|
+
rank: boolean;
|
4
|
+
max: number;
|
5
|
+
more: number;
|
6
|
+
usefresh: () => Promise<void>;
|
7
|
+
static styles: import("lit").CSSResult;
|
8
|
+
get assigned(): HTMLElement[];
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
10
|
+
firstUpdated(): void;
|
11
|
+
append(args?: string): void;
|
12
|
+
subtract(): void;
|
13
|
+
fresh(): Promise<void>;
|
14
|
+
}
|
15
|
+
export default AvatarGroup;
|
16
|
+
declare global {
|
17
|
+
interface HTMLElementTagNameMap {
|
18
|
+
"avatar-group": AvatarGroup;
|
19
|
+
}
|
20
|
+
}
|
21
21
|
//# sourceMappingURL=avatar-group.d.ts.map
|