godown 1.0.42 → 1.0.44
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/conf.ts +35 -0
- package/out/conf.d.ts +18 -0
- package/out/conf.d.ts.map +1 -0
- package/out/conf.js +21 -0
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -1
- package/out/react/items.d.ts +1 -0
- package/out/react/items.d.ts.map +1 -1
- package/out/react/items.js +5 -0
- package/out/react/view.d.ts +1 -0
- package/out/react/view.d.ts.map +1 -1
- package/out/react/view.js +5 -0
- package/out/src/deps.d.ts +3 -3
- package/out/src/deps.d.ts.map +1 -1
- package/out/src/deps.js +3 -3
- package/out/src/effect/std.d.ts +2 -2
- package/out/src/effect/std.d.ts.map +1 -1
- package/out/src/effect/std.js +2 -2
- package/out/src/glob.d.ts +1 -1
- package/out/src/glob.d.ts.map +1 -1
- package/out/src/glob.js +3 -3
- package/out/src/group/std.d.ts +2 -2
- package/out/src/group/std.d.ts.map +1 -1
- package/out/src/group/std.js +2 -2
- package/out/src/input-form/base-input.d.ts +1 -1
- package/out/src/input-form/base-input.d.ts.map +1 -1
- package/out/src/input-form/base-input.js +5 -0
- package/out/src/input-form/exp-input.d.ts +1 -2
- package/out/src/input-form/exp-input.d.ts.map +1 -1
- package/out/src/input-form/exp-input.js +4 -3
- package/out/src/input-form/label-input.d.ts +1 -2
- package/out/src/input-form/label-input.d.ts.map +1 -1
- package/out/src/input-form/label-input.js +4 -3
- package/out/src/input-form/search-input.d.ts +1 -1
- package/out/src/input-form/search-input.d.ts.map +1 -1
- package/out/src/input-form/search-input.js +4 -3
- package/out/src/input-form/select-input.d.ts +6 -6
- package/out/src/input-form/select-input.d.ts.map +1 -1
- package/out/src/input-form/select-input.js +54 -45
- package/out/src/input-form/split-input.d.ts +3 -1
- package/out/src/input-form/split-input.d.ts.map +1 -1
- package/out/src/input-form/split-input.js +11 -3
- package/out/src/input-form/std.d.ts +7 -3
- package/out/src/input-form/std.d.ts.map +1 -1
- package/out/src/input-form/std.js +18 -5
- package/out/src/items/index.d.ts +1 -0
- package/out/src/items/index.d.ts.map +1 -1
- package/out/src/items/index.js +1 -0
- package/out/src/items/link-a.d.ts +19 -0
- package/out/src/items/link-a.d.ts.map +1 -0
- package/out/src/items/link-a.js +96 -0
- package/out/src/items/std.d.ts +2 -2
- package/out/src/items/std.d.ts.map +1 -1
- package/out/src/items/std.js +2 -2
- package/out/src/items/super-a.d.ts +0 -2
- package/out/src/items/super-a.d.ts.map +1 -1
- package/out/src/items/super-a.js +4 -14
- package/out/src/layout/nav-layout.js +1 -1
- package/out/src/layout/std.d.ts +2 -2
- package/out/src/layout/std.d.ts.map +1 -1
- package/out/src/layout/std.js +2 -2
- package/out/src/view/index.d.ts +1 -0
- package/out/src/view/index.d.ts.map +1 -1
- package/out/src/view/index.js +1 -0
- package/out/src/view/route-view.d.ts +33 -0
- package/out/src/view/route-view.d.ts.map +1 -0
- package/out/src/view/route-view.js +239 -0
- package/out/src/view/std.d.ts +2 -2
- package/out/src/view/std.d.ts.map +1 -1
- package/out/src/view/std.js +2 -2
- package/out/src/with.d.ts.map +1 -1
- package/out/src/with.js +6 -5
- package/package.json +2 -1
@@ -6,28 +6,27 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
6
6
|
};
|
7
7
|
import { html, css, property, query, state, define, conf, cssvar } from '../deps.js';
|
8
8
|
import STD from './std.js';
|
9
|
-
const selcls = `${conf.tag('select-input')}-selected`;
|
10
9
|
let SelectInput = class SelectInput extends STD {
|
11
10
|
constructor() {
|
12
11
|
super(...arguments);
|
13
|
-
this.
|
12
|
+
this.open = false;
|
13
|
+
this.selcls = `${conf.tag('select-input')}-selected`;
|
14
14
|
this.pla = undefined;
|
15
|
-
this.
|
15
|
+
this.only = false;
|
16
16
|
this.def = "";
|
17
|
-
this.autofocus = false;
|
18
17
|
this.value = [];
|
19
|
-
this.name = "";
|
18
|
+
this.name = "select";
|
20
19
|
this.text = [];
|
20
|
+
this.autofocus = false;
|
21
21
|
}
|
22
22
|
get assigned() {
|
23
23
|
return this.shadowRoot.querySelector('slot').assignedElements();
|
24
24
|
}
|
25
25
|
render() {
|
26
|
-
return html `<div>
|
27
|
-
<
|
28
|
-
<input id="input" @focus=${this.focus} @input=${this._handleInput} placeholder=${this.pla}/>
|
26
|
+
return html `<div><section>${this.lists()}</section>
|
27
|
+
<input id="input" @focus=${() => { this.open = true; }} @input=${this._handleInput} placeholder=${this.pla}/>
|
29
28
|
<label for="input"><svg viewBox="0 0 48 48" fill="none"><path d="M36 19L24 31L12 19H36Z" fill="currentColor" stroke="currentColor" stroke-width="3" stroke-linejoin="round"/></svg></label>
|
30
|
-
<aside><slot></slot></aside>
|
29
|
+
<aside ?open=${this.open}><slot></slot></aside>
|
31
30
|
</div>`;
|
32
31
|
}
|
33
32
|
lists() {
|
@@ -38,11 +37,22 @@ let SelectInput = class SelectInput extends STD {
|
|
38
37
|
<svg @click=${() => { this.select(this.value[i]); }} t="1678769821062" viewBox="0 0 1024 1024" version="1.1" p-id="2770"><path d="M960 512c0-249.6-198.4-448-448-448S64 262.4 64 512s198.4 448 448 448 448-198.4 448-448zM691.2 736L512 556.8 332.8 736c-12.8 12.8-32 12.8-44.8 0-12.8-12.8-12.8-32 0-44.8L467.2 512 288 332.8c-12.8-12.8-12.8-32 0-44.8 12.8-12.8 32-12.8 44.8 0L512 467.2 691.2 288c12.8-12.8 32-12.8 44.8 0 12.8 12.8 12.8 32 0 44.8L556.8 512 736 691.2c12.8 12.8 12.8 32 0 44.8-12.8 12.8-32 12.8-44.8 0z" fill="currentColor" p-id="2771"></path></svg>
|
39
38
|
</i>`);
|
40
39
|
}
|
41
|
-
return
|
40
|
+
return itemTemplates;
|
41
|
+
}
|
42
|
+
_focusCheck() {
|
43
|
+
var _a;
|
44
|
+
if (this.autofocus) {
|
45
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus();
|
46
|
+
this.open = true;
|
47
|
+
}
|
48
|
+
}
|
49
|
+
focus(options) {
|
50
|
+
var _a;
|
51
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus(options);
|
52
|
+
this.open = true;
|
42
53
|
}
|
43
54
|
firstUpdated() {
|
44
|
-
|
45
|
-
this.focus();
|
55
|
+
this._focusCheck();
|
46
56
|
this.assigned.forEach((option) => {
|
47
57
|
if (option.value) {
|
48
58
|
option.addEventListener("click", () => {
|
@@ -57,14 +67,17 @@ let SelectInput = class SelectInput extends STD {
|
|
57
67
|
});
|
58
68
|
}
|
59
69
|
});
|
70
|
+
this.addEventListener("change", (e) => {
|
71
|
+
this.open = !this.only;
|
72
|
+
});
|
60
73
|
document.addEventListener("click", (e) => {
|
61
|
-
if (!this.
|
62
|
-
this.
|
74
|
+
if (!this.contains(e.target)) {
|
75
|
+
this.open = false;
|
63
76
|
}
|
64
77
|
});
|
65
78
|
}
|
66
79
|
select(value, text) {
|
67
|
-
if (text === undefined) {
|
80
|
+
if (text === undefined || text === null) {
|
68
81
|
this.assigned.forEach((option) => {
|
69
82
|
if (option.value) {
|
70
83
|
if (option.value == value) {
|
@@ -81,7 +94,7 @@ let SelectInput = class SelectInput extends STD {
|
|
81
94
|
});
|
82
95
|
}
|
83
96
|
if (this.value.includes(value)) {
|
84
|
-
if (this.
|
97
|
+
if (!this.only) {
|
85
98
|
this.value = this.value.filter(v => v != value);
|
86
99
|
this.text = this.text.filter(v => v != text);
|
87
100
|
}
|
@@ -91,7 +104,7 @@ let SelectInput = class SelectInput extends STD {
|
|
91
104
|
}
|
92
105
|
}
|
93
106
|
else {
|
94
|
-
if (this.
|
107
|
+
if (!this.only) {
|
95
108
|
this.value.push(value);
|
96
109
|
this.text.push(text);
|
97
110
|
}
|
@@ -103,40 +116,30 @@ let SelectInput = class SelectInput extends STD {
|
|
103
116
|
this.assigned.forEach((option) => {
|
104
117
|
if (option.value) {
|
105
118
|
if (this.value.includes(option.value)) {
|
106
|
-
option.classList.add(selcls);
|
119
|
+
option.classList.add(this.selcls);
|
107
120
|
}
|
108
121
|
else {
|
109
|
-
option.classList.remove(selcls);
|
122
|
+
option.classList.remove(this.selcls);
|
110
123
|
}
|
111
124
|
}
|
112
125
|
else if (option.children) {
|
113
126
|
[...option.children].forEach(option => {
|
114
127
|
if (this.value.includes(option.value)) {
|
115
|
-
option.classList.add(selcls);
|
128
|
+
option.classList.add(this.selcls);
|
116
129
|
}
|
117
130
|
else {
|
118
|
-
option.classList.remove(selcls);
|
131
|
+
option.classList.remove(this.selcls);
|
119
132
|
}
|
120
133
|
});
|
121
134
|
}
|
122
135
|
});
|
123
136
|
this._input.value = "";
|
124
|
-
this.requestUpdate();
|
125
137
|
this.dispatchEvent(new CustomEvent("change", { detail: this.namevalue() }));
|
126
|
-
|
127
|
-
focus() {
|
128
|
-
this._input.focus();
|
129
|
-
this.open();
|
130
|
-
}
|
131
|
-
close() {
|
132
|
-
this._aside.style.visibility = "hidden";
|
133
|
-
}
|
134
|
-
open() {
|
135
|
-
this._aside.style.visibility = "visible";
|
138
|
+
this.requestUpdate();
|
136
139
|
}
|
137
140
|
_handleInput() {
|
138
141
|
let value = this._input.value.trim();
|
139
|
-
if (this.
|
142
|
+
if (!this.only && value.includes(";")) {
|
140
143
|
value = value.split(";").pop().trim();
|
141
144
|
}
|
142
145
|
this.assigned.forEach(option => {
|
@@ -178,7 +181,7 @@ let SelectInput = class SelectInput extends STD {
|
|
178
181
|
this.dispatchEvent(new CustomEvent("input", { detail: this.namevalue() }));
|
179
182
|
}
|
180
183
|
namevalue() {
|
181
|
-
if (this.
|
184
|
+
if (!this.only) {
|
182
185
|
return [this.name, this.value];
|
183
186
|
}
|
184
187
|
return [this.name, this.value[0]];
|
@@ -189,24 +192,24 @@ let SelectInput = class SelectInput extends STD {
|
|
189
192
|
this._input.value = "";
|
190
193
|
this.assigned.forEach((option) => {
|
191
194
|
if (option.value) {
|
192
|
-
option.classList.remove(selcls);
|
195
|
+
option.classList.remove(this.selcls);
|
193
196
|
}
|
194
197
|
else if (option.children) {
|
195
198
|
[...option.children].forEach(option => {
|
196
|
-
option.classList.remove(selcls);
|
199
|
+
option.classList.remove(this.selcls);
|
197
200
|
});
|
198
201
|
}
|
199
202
|
});
|
200
203
|
if (this.def) {
|
201
|
-
if (this.
|
204
|
+
if (!this.only) {
|
202
205
|
this.def.split(";").forEach(def => {
|
203
206
|
if (def.trim())
|
204
|
-
this.select(def.trim(),
|
207
|
+
this.select(def.trim(), null);
|
205
208
|
});
|
206
209
|
}
|
207
210
|
else {
|
208
211
|
if (this.def.split(";")[0].trim())
|
209
|
-
this.select(this.def.split(";")[0].trim(),
|
212
|
+
this.select(this.def.split(";")[0].trim(), null);
|
210
213
|
}
|
211
214
|
}
|
212
215
|
}
|
@@ -221,7 +224,7 @@ SelectInput.styles = [STD.styles, css `
|
|
221
224
|
height: 1.5em;
|
222
225
|
width: var(${cssvar}--input-width);
|
223
226
|
}
|
224
|
-
:host(
|
227
|
+
:host([open]){
|
225
228
|
outline-color: var(${cssvar}--input-outline);
|
226
229
|
}
|
227
230
|
input{
|
@@ -272,7 +275,7 @@ SelectInput.styles = [STD.styles, css `
|
|
272
275
|
font-style: normal;
|
273
276
|
align-items: center;
|
274
277
|
padding-left: .1em;
|
275
|
-
margin-left: 0.
|
278
|
+
margin-left: 0.065em;
|
276
279
|
}
|
277
280
|
i:first-child{
|
278
281
|
margin-left: 0;
|
@@ -283,7 +286,13 @@ SelectInput.styles = [STD.styles, css `
|
|
283
286
|
height:.8em;
|
284
287
|
pointer-events: all;
|
285
288
|
}
|
289
|
+
aside[open]{
|
290
|
+
visibility: visible;
|
291
|
+
}
|
286
292
|
`];
|
293
|
+
__decorate([
|
294
|
+
property({ type: Boolean, reflect: true })
|
295
|
+
], SelectInput.prototype, "open", void 0);
|
287
296
|
__decorate([
|
288
297
|
property()
|
289
298
|
], SelectInput.prototype, "selcls", void 0);
|
@@ -292,13 +301,10 @@ __decorate([
|
|
292
301
|
], SelectInput.prototype, "pla", void 0);
|
293
302
|
__decorate([
|
294
303
|
property({ type: Boolean })
|
295
|
-
], SelectInput.prototype, "
|
304
|
+
], SelectInput.prototype, "only", void 0);
|
296
305
|
__decorate([
|
297
306
|
property()
|
298
307
|
], SelectInput.prototype, "def", void 0);
|
299
|
-
__decorate([
|
300
|
-
property()
|
301
|
-
], SelectInput.prototype, "autofocus", void 0);
|
302
308
|
__decorate([
|
303
309
|
property({ type: Array })
|
304
310
|
], SelectInput.prototype, "value", void 0);
|
@@ -308,6 +314,9 @@ __decorate([
|
|
308
314
|
__decorate([
|
309
315
|
state()
|
310
316
|
], SelectInput.prototype, "text", void 0);
|
317
|
+
__decorate([
|
318
|
+
property({ type: Boolean })
|
319
|
+
], SelectInput.prototype, "autofocus", void 0);
|
311
320
|
__decorate([
|
312
321
|
query('input')
|
313
322
|
], SelectInput.prototype, "_input", void 0);
|
@@ -5,6 +5,7 @@ export declare class SplitInput extends STD {
|
|
5
5
|
value: string;
|
6
6
|
max: number;
|
7
7
|
index: number;
|
8
|
+
autofocus: boolean;
|
8
9
|
_input: HTMLInputElement;
|
9
10
|
_spans: NodeListOf<HTMLSpanElement>;
|
10
11
|
current: number;
|
@@ -12,7 +13,8 @@ export declare class SplitInput extends STD {
|
|
12
13
|
render(): import("lit-html").TemplateResult<1>;
|
13
14
|
firstUpdated(): void;
|
14
15
|
_handleInput(e: InputEvent): void;
|
15
|
-
|
16
|
+
focus(): void;
|
17
|
+
focusOne(i?: number): void;
|
16
18
|
blur(i?: number): void;
|
17
19
|
reset(): void;
|
18
20
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"split-input.d.ts","sourceRoot":"","sources":["../../../src/input-form/split-input.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,UAAW,SAAQ,GAAG;IACjC,MAAM,CAAC,MAAM,yFA4CP;IACM,IAAI,SAAM;IACV,KAAK,SAAM;IACK,GAAG,SAAK;IACxB,KAAK,SAAM;
|
1
|
+
{"version":3,"file":"split-input.d.ts","sourceRoot":"","sources":["../../../src/input-form/split-input.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,UAAW,SAAQ,GAAG;IACjC,MAAM,CAAC,MAAM,yFA4CP;IACM,IAAI,SAAM;IACV,KAAK,SAAM;IACK,GAAG,SAAK;IACxB,KAAK,SAAM;IACM,SAAS,UAAS;IAC/B,MAAM,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC,eAAe,CAAC,CAAC;IACtD,OAAO,EAAE,MAAM,CAAK;IACpB,YAAY,EAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC,CAAM;IACxC,MAAM;IAMN,YAAY;IAiBZ,YAAY,CAAC,CAAC,EAAE,UAAU;IA4B1B,KAAK;IAGL,QAAQ,CAAC,CAAC,SAAe;IAOzB,IAAI,CAAC,CAAC,SAAe;IAIrB,KAAK;CASN;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
|
@@ -13,6 +13,7 @@ let SplitInput = class SplitInput extends STD {
|
|
13
13
|
this.value = "";
|
14
14
|
this.max = 6;
|
15
15
|
this.index = -1;
|
16
|
+
this.autofocus = false;
|
16
17
|
this.current = 0;
|
17
18
|
this.currentValue = [];
|
18
19
|
}
|
@@ -23,12 +24,13 @@ let SplitInput = class SplitInput extends STD {
|
|
23
24
|
</div></main>`;
|
24
25
|
}
|
25
26
|
firstUpdated() {
|
27
|
+
this._focusCheck();
|
26
28
|
this.currentValue = this.value.split('').concat(Array(this.max - this.value.length).fill(null));
|
27
29
|
this.current = (this.index < 0 || this.index > this.max) ? this.currentValue.indexOf(null) : this.index;
|
28
30
|
this._spans.forEach((span, index) => {
|
29
31
|
span.addEventListener('click', () => {
|
30
32
|
this.current = index;
|
31
|
-
this.
|
33
|
+
this.focusOne();
|
32
34
|
this._input.focus();
|
33
35
|
});
|
34
36
|
});
|
@@ -61,7 +63,7 @@ let SplitInput = class SplitInput extends STD {
|
|
61
63
|
this.current += 1;
|
62
64
|
}
|
63
65
|
}
|
64
|
-
this.
|
66
|
+
this.focus();
|
65
67
|
this._spans.forEach((span, index) => {
|
66
68
|
span.querySelector('i').innerText = this.currentValue[index] || '';
|
67
69
|
});
|
@@ -69,7 +71,10 @@ let SplitInput = class SplitInput extends STD {
|
|
69
71
|
this.dispatchEvent(new CustomEvent('input', { detail: this.value, bubbles: true, composed: true }));
|
70
72
|
this.dispatchEvent(new CustomEvent('change', { detail: this.value, composed: true }));
|
71
73
|
}
|
72
|
-
|
74
|
+
focus() {
|
75
|
+
this.focusOne();
|
76
|
+
}
|
77
|
+
focusOne(i = this.current) {
|
73
78
|
var _a;
|
74
79
|
this._spans.forEach((span) => {
|
75
80
|
span.classList.remove('focus');
|
@@ -149,6 +154,9 @@ __decorate([
|
|
149
154
|
__decorate([
|
150
155
|
property()
|
151
156
|
], SplitInput.prototype, "index", void 0);
|
157
|
+
__decorate([
|
158
|
+
property({ type: Boolean })
|
159
|
+
], SplitInput.prototype, "autofocus", void 0);
|
152
160
|
__decorate([
|
153
161
|
query('input')
|
154
162
|
], SplitInput.prototype, "_input", void 0);
|
@@ -1,15 +1,19 @@
|
|
1
|
-
import {
|
2
|
-
export default class InputFormSTD extends
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class InputFormSTD extends GLOBSTD {
|
3
3
|
name: string;
|
4
4
|
value: any;
|
5
5
|
def: string;
|
6
6
|
_input: HTMLInputElement;
|
7
7
|
compositing: boolean;
|
8
|
-
|
8
|
+
autofocus: boolean;
|
9
|
+
static styles: import("@lit/reactive-element/css-tag").CSSResultGroup[];
|
9
10
|
namevalue(): any[];
|
10
11
|
reset(): void;
|
11
12
|
_handleInput(e: any): void;
|
12
13
|
connectedCallback(): void;
|
13
14
|
_compositionCheck(): void;
|
15
|
+
_focusCheck(): void;
|
16
|
+
focus(options?: FocusOptions): void;
|
17
|
+
firstUpdated(): void;
|
14
18
|
}
|
15
19
|
//# sourceMappingURL=std.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/input-form/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/input-form/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,OAAO;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,MAAM,2DAgBZ;IACD,SAAS;IAGT,KAAK;IAIL,YAAY,CAAC,CAAC,EAAE,GAAG;IAOnB,iBAAiB;IAKjB,iBAAiB;IAUjB,WAAW;IAKX,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAG5B,YAAY;CAIb"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export default class InputFormSTD extends
|
1
|
+
import { GLOBSTD, css, cssvar } from "../deps.js";
|
2
|
+
export default class InputFormSTD extends GLOBSTD {
|
3
3
|
namevalue() {
|
4
4
|
return [this.name, this.value];
|
5
5
|
}
|
@@ -12,8 +12,8 @@ export default class InputFormSTD extends STD {
|
|
12
12
|
this.value = e.target.value;
|
13
13
|
if (this.compositing)
|
14
14
|
return;
|
15
|
-
this.dispatchEvent(new CustomEvent(
|
16
|
-
this.dispatchEvent(new CustomEvent(
|
15
|
+
this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true, composed: true }));
|
16
|
+
this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
|
17
17
|
}
|
18
18
|
connectedCallback() {
|
19
19
|
super.connectedCallback();
|
@@ -32,8 +32,21 @@ export default class InputFormSTD extends STD {
|
|
32
32
|
this._handleInput(e);
|
33
33
|
});
|
34
34
|
}
|
35
|
+
_focusCheck() {
|
36
|
+
if (this.autofocus) {
|
37
|
+
this.focus();
|
38
|
+
}
|
39
|
+
}
|
40
|
+
focus(options) {
|
41
|
+
var _a;
|
42
|
+
(_a = this._input) === null || _a === void 0 ? void 0 : _a.focus(options);
|
43
|
+
}
|
44
|
+
firstUpdated() {
|
45
|
+
this._focusCheck();
|
46
|
+
this._compositionCheck();
|
47
|
+
}
|
35
48
|
}
|
36
|
-
InputFormSTD.styles = [
|
49
|
+
InputFormSTD.styles = [GLOBSTD.styles, css `
|
37
50
|
:host{
|
38
51
|
${cssvar}--text:rgb(240 240 240);
|
39
52
|
${cssvar}--input-outline: rgb(25 130 180);
|
package/out/src/items/index.d.ts
CHANGED
@@ -2,6 +2,7 @@ export * from "./alert-item.js";
|
|
2
2
|
export * from "./avatar-anchor.js";
|
3
3
|
export * from "./base-button.js";
|
4
4
|
export * from "./dialog-item.js";
|
5
|
+
export * from "./link-a.js";
|
5
6
|
export * from "./load-track.js";
|
6
7
|
export * from "./super-a.js";
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/items/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/items/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC"}
|
package/out/src/items/index.js
CHANGED
@@ -0,0 +1,19 @@
|
|
1
|
+
import { SuperAnchor } from "./super-a.js";
|
2
|
+
export declare class LinkAnchor extends SuperAnchor {
|
3
|
+
active: string;
|
4
|
+
replace: boolean;
|
5
|
+
static styles: import("lit").CSSResult;
|
6
|
+
firstUpdated(): void;
|
7
|
+
useActive(): void;
|
8
|
+
_handleClick(e: MouseEvent): void;
|
9
|
+
pushState(url?: string): void;
|
10
|
+
replaceState(url?: string): void;
|
11
|
+
static pushState(data: any, unused: string, url?: string): void;
|
12
|
+
static replaceState(data: any, unused: string, url?: string): void;
|
13
|
+
}
|
14
|
+
declare global {
|
15
|
+
interface HTMLElementTagNameMap {
|
16
|
+
'link-a': LinkAnchor;
|
17
|
+
}
|
18
|
+
}
|
19
|
+
//# sourceMappingURL=link-a.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"link-a.d.ts","sourceRoot":"","sources":["../../../src/items/link-a.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,qBACa,UAAW,SAAQ,WAAW;IAC7B,MAAM,SAAM;IACK,OAAO,UAAS;IAC7C,MAAM,CAAC,MAAM,0BAqBV;IACH,YAAY;IAMZ,SAAS;IAUT,YAAY,CAAC,CAAC,EAAE,UAAU;IAY1B,SAAS,CAAC,GAAG,SAAY;IAIzB,YAAY,CAAC,GAAG,SAAY;IAI5B,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;IAIxD,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM;CAI5D;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,QAAQ,EAAE,UAAU,CAAC;KACtB;CACF"}
|
@@ -0,0 +1,96 @@
|
|
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
|
+
var LinkAnchor_1;
|
8
|
+
import { css, property, define } from "../deps.js";
|
9
|
+
import { SuperAnchor } from "./super-a.js";
|
10
|
+
import { RouteView } from "../view/route-view.js";
|
11
|
+
let LinkAnchor = LinkAnchor_1 = class LinkAnchor extends SuperAnchor {
|
12
|
+
constructor() {
|
13
|
+
super(...arguments);
|
14
|
+
this.active = "";
|
15
|
+
this.replace = false;
|
16
|
+
}
|
17
|
+
firstUpdated() {
|
18
|
+
this.shadowRoot.querySelector("a").addEventListener("click", this._handleClick.bind(this));
|
19
|
+
if (this.active) {
|
20
|
+
window.addEventListener("popstate", this.useActive.bind(this));
|
21
|
+
}
|
22
|
+
}
|
23
|
+
useActive() {
|
24
|
+
const url = new URL(this.href, window.location.href);
|
25
|
+
if (url.origin === window.location.origin) {
|
26
|
+
if (url.pathname === window.location.pathname) {
|
27
|
+
this.classList.add(this.active);
|
28
|
+
}
|
29
|
+
else {
|
30
|
+
this.classList.remove(this.active);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
34
|
+
_handleClick(e) {
|
35
|
+
if (this.target !== "_self")
|
36
|
+
return;
|
37
|
+
const url = new URL(this.href, window.location.href);
|
38
|
+
if (url.origin === window.location.origin) {
|
39
|
+
e.preventDefault();
|
40
|
+
if (this.replace) {
|
41
|
+
this.replaceState();
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
this.pushState();
|
45
|
+
}
|
46
|
+
}
|
47
|
+
}
|
48
|
+
pushState(url = this.href) {
|
49
|
+
LinkAnchor_1.pushState(null, "", url);
|
50
|
+
this.active && this.useActive();
|
51
|
+
}
|
52
|
+
replaceState(url = this.href) {
|
53
|
+
LinkAnchor_1.replaceState(null, "", url);
|
54
|
+
this.active && this.useActive();
|
55
|
+
}
|
56
|
+
static pushState(data, unused, url) {
|
57
|
+
history.pushState(data, unused, url);
|
58
|
+
RouteView.updateAll();
|
59
|
+
}
|
60
|
+
static replaceState(data, unused, url) {
|
61
|
+
history.replaceState(data, unused, url);
|
62
|
+
RouteView.updateAll();
|
63
|
+
}
|
64
|
+
};
|
65
|
+
LinkAnchor.styles = css `
|
66
|
+
:host{
|
67
|
+
display: inline-block;
|
68
|
+
color:currentColor;
|
69
|
+
text-decoration: none;
|
70
|
+
cursor: default;
|
71
|
+
}
|
72
|
+
:host([href]){
|
73
|
+
cursor: pointer;
|
74
|
+
}
|
75
|
+
a{
|
76
|
+
width: 100%;
|
77
|
+
display: flex;
|
78
|
+
color: inherit;
|
79
|
+
text-decoration: inherit;
|
80
|
+
justify-content: space-between;
|
81
|
+
align-items: center;
|
82
|
+
}
|
83
|
+
i{
|
84
|
+
display: inline-flex;
|
85
|
+
border-radius: 20%;
|
86
|
+
}`;
|
87
|
+
__decorate([
|
88
|
+
property()
|
89
|
+
], LinkAnchor.prototype, "active", void 0);
|
90
|
+
__decorate([
|
91
|
+
property({ type: Boolean })
|
92
|
+
], LinkAnchor.prototype, "replace", void 0);
|
93
|
+
LinkAnchor = LinkAnchor_1 = __decorate([
|
94
|
+
define('link-a')
|
95
|
+
], LinkAnchor);
|
96
|
+
export { LinkAnchor };
|
package/out/src/items/std.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/items/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/items/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,OAAO;CAAI"}
|
package/out/src/items/std.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
export default class ItemsSTD extends
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class ItemsSTD extends GLOBSTD {
|
3
3
|
}
|
@@ -2,11 +2,9 @@ import STD from "./std.js";
|
|
2
2
|
export declare class SuperAnchor extends STD {
|
3
3
|
href: string;
|
4
4
|
target: string;
|
5
|
-
active: string;
|
6
5
|
arrow: string;
|
7
6
|
static styles: import("lit").CSSResult;
|
8
7
|
render(): import("lit-html").TemplateResult<1>;
|
9
|
-
firstUpdated(): void;
|
10
8
|
_arrowSwitcher(): import("lit-html").TemplateResult<1>;
|
11
9
|
}
|
12
10
|
declare global {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"super-a.d.ts","sourceRoot":"","sources":["../../../src/items/super-a.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,WAAY,SAAQ,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,
|
1
|
+
{"version":3,"file":"super-a.d.ts","sourceRoot":"","sources":["../../../src/items/super-a.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,UAAU,CAAC;AAC3B,qBACa,WAAY,SAAQ,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,SAAW;IACjB,KAAK,EAAE,MAAM,CAAC;IAC1B,MAAM,CAAC,MAAM,0BAuCV;IACH,MAAM;IAMN,cAAc;CAYf;AACD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,SAAS,EAAE,WAAW,CAAC;KACxB;CACF"}
|
package/out/src/items/super-a.js
CHANGED
@@ -7,23 +7,16 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
7
7
|
import { html, css, property, ifDefined, define } from "../deps.js";
|
8
8
|
import STD from "./std.js";
|
9
9
|
let SuperAnchor = class SuperAnchor extends STD {
|
10
|
+
constructor() {
|
11
|
+
super(...arguments);
|
12
|
+
this.target = "_self";
|
13
|
+
}
|
10
14
|
render() {
|
11
15
|
return html `<a href=${ifDefined(this.href)} target=${this.target}>
|
12
16
|
<slot name="pre"></slot><slot></slot><slot name="suf"></slot>
|
13
17
|
<i style="font-style:normal"><slot name="icon"></slot>${this._arrowSwitcher()}</i>
|
14
18
|
</a>`;
|
15
19
|
}
|
16
|
-
firstUpdated() {
|
17
|
-
if (this.active && this.href) {
|
18
|
-
const x = new URL(this.href, location.href);
|
19
|
-
if (x.hostname === location.hostname && x.pathname === location.pathname) {
|
20
|
-
this.classList.add(this.active);
|
21
|
-
}
|
22
|
-
else {
|
23
|
-
this.classList.remove(this.active);
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
20
|
_arrowSwitcher() {
|
28
21
|
switch (this.arrow) {
|
29
22
|
case "delta":
|
@@ -83,9 +76,6 @@ __decorate([
|
|
83
76
|
__decorate([
|
84
77
|
property()
|
85
78
|
], SuperAnchor.prototype, "target", void 0);
|
86
|
-
__decorate([
|
87
|
-
property()
|
88
|
-
], SuperAnchor.prototype, "active", void 0);
|
89
79
|
__decorate([
|
90
80
|
property()
|
91
81
|
], SuperAnchor.prototype, "arrow", void 0);
|
@@ -18,7 +18,7 @@ let NavLayout = class NavLayout extends STD {
|
|
18
18
|
return html `<nav>
|
19
19
|
<h1>
|
20
20
|
<slot name="host"></slot>
|
21
|
-
<a href="/">${this.host}</a>${this.subhead && html `<span
|
21
|
+
<a href="/">${this.host}</a>${this.subhead && html `<span></span><div>${this.subhead}</div>`}
|
22
22
|
</h1>
|
23
23
|
<div>
|
24
24
|
${this.opt()}
|
package/out/src/layout/std.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export default class LayoutSTD extends
|
1
|
+
import { GLOBSTD } from "../deps.js";
|
2
|
+
export default class LayoutSTD extends GLOBSTD {
|
3
3
|
}
|
4
4
|
export declare const navstyle: import("lit").CSSResult;
|
5
5
|
//# sourceMappingURL=std.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/layout/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"std.d.ts","sourceRoot":"","sources":["../../../src/layout/std.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAe,MAAM,YAAY,CAAC;AAClD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,OAAO;CAAI;AAClD,eAAO,MAAM,QAAQ,yBAIpB,CAAC"}
|
package/out/src/layout/std.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import {
|
2
|
-
export default class LayoutSTD extends
|
1
|
+
import { GLOBSTD, css, cssvar } from "../deps.js";
|
2
|
+
export default class LayoutSTD extends GLOBSTD {
|
3
3
|
}
|
4
4
|
export const navstyle = css `
|
5
5
|
${cssvar}--nav-text: rgb(240 240 240);
|
package/out/src/view/index.d.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/view/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC"}
|