godown 1.1.5 → 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.
Files changed (118) hide show
  1. package/conf.d.ts +18 -18
  2. package/conf.js +22 -22
  3. package/deps.d.ts +7 -7
  4. package/deps.js +7 -7
  5. package/effect/index.d.ts +3 -3
  6. package/effect/index.js +3 -3
  7. package/effect/ov-effect.d.ts +23 -23
  8. package/effect/ov-effect.js +63 -63
  9. package/effect/ro-effect.d.ts +19 -19
  10. package/effect/ro-effect.js +76 -76
  11. package/effect/std.d.ts +3 -3
  12. package/effect/std.js +3 -3
  13. package/effect/tw-effect.d.ts +21 -21
  14. package/effect/tw-effect.js +90 -90
  15. package/glob.d.ts +8 -8
  16. package/glob.js +9 -9
  17. package/group/avatar-group.d.ts +20 -20
  18. package/group/avatar-group.js +88 -88
  19. package/group/button-group.d.ts +12 -12
  20. package/group/button-group.js +26 -26
  21. package/group/details-group.d.ts +16 -16
  22. package/group/details-group.js +51 -51
  23. package/group/index.d.ts +3 -3
  24. package/group/index.js +3 -3
  25. package/group/std.d.ts +3 -3
  26. package/group/std.js +3 -3
  27. package/index.d.ts +7 -7
  28. package/index.js +7 -7
  29. package/input-form/base-input.d.ts +32 -32
  30. package/input-form/base-input.js +129 -129
  31. package/input-form/exp-input.d.ts +22 -22
  32. package/input-form/exp-input.js +67 -67
  33. package/input-form/index.d.ts +8 -8
  34. package/input-form/index.js +8 -8
  35. package/input-form/label-input.d.ts +21 -21
  36. package/input-form/label-input.js +69 -69
  37. package/input-form/search-input.d.ts +36 -36
  38. package/input-form/search-input.js +162 -162
  39. package/input-form/select-input.d.ts +31 -31
  40. package/input-form/select-input.js +256 -256
  41. package/input-form/sign-form.d.ts +25 -25
  42. package/input-form/sign-form.js +147 -147
  43. package/input-form/split-input.d.ts +26 -26
  44. package/input-form/split-input.js +127 -127
  45. package/input-form/std.d.ts +19 -19
  46. package/input-form/std.js +56 -55
  47. package/input-form/switch-input.d.ts +22 -22
  48. package/input-form/switch-input.js +73 -73
  49. package/items/alert-item.d.ts +16 -16
  50. package/items/alert-item.js +46 -46
  51. package/items/avatar-anchor.d.ts +19 -19
  52. package/items/avatar-anchor.js +62 -62
  53. package/items/base-button.d.ts +16 -16
  54. package/items/base-button.js +44 -44
  55. package/items/dialog-item.d.ts +24 -24
  56. package/items/dialog-item.js +92 -92
  57. package/items/index.d.ts +7 -7
  58. package/items/index.js +7 -7
  59. package/items/link-a.d.ts +19 -19
  60. package/items/link-a.js +76 -76
  61. package/items/load-track.d.ts +20 -20
  62. package/items/load-track.js +76 -76
  63. package/items/std.d.ts +3 -3
  64. package/items/std.js +3 -3
  65. package/items/super-a.d.ts +15 -15
  66. package/items/super-a.js +46 -46
  67. package/layout/div-line.d.ts +15 -15
  68. package/layout/div-line.js +39 -39
  69. package/layout/drag-box.d.ts +25 -25
  70. package/layout/drag-box.js +88 -88
  71. package/layout/flex-flow.d.ts +13 -13
  72. package/layout/flex-flow.js +32 -32
  73. package/layout/index.d.ts +5 -5
  74. package/layout/index.js +5 -5
  75. package/layout/nav-aside.d.ts +13 -13
  76. package/layout/nav-aside.js +38 -38
  77. package/layout/nav-layout.d.ts +16 -16
  78. package/layout/nav-layout.js +51 -51
  79. package/layout/std.d.ts +4 -4
  80. package/layout/std.js +4 -4
  81. package/package.json +6 -5
  82. package/react/effect.d.ts +9 -9
  83. package/react/effect.d.ts.map +1 -1
  84. package/react/effect.js +33 -33
  85. package/react/group.d.ts +4 -4
  86. package/react/group.d.ts.map +1 -1
  87. package/react/group.js +19 -19
  88. package/react/index.d.ts +7 -7
  89. package/react/index.d.ts.map +1 -1
  90. package/react/index.js +7 -7
  91. package/react/input-form.d.ts +32 -32
  92. package/react/input-form.d.ts.map +1 -1
  93. package/react/input-form.js +65 -65
  94. package/react/items.d.ts +8 -8
  95. package/react/items.d.ts.map +1 -1
  96. package/react/items.js +39 -39
  97. package/react/layout.d.ts +6 -6
  98. package/react/layout.d.ts.map +1 -1
  99. package/react/layout.js +29 -29
  100. package/react/view.d.ts +6 -6
  101. package/react/view.d.ts.map +1 -1
  102. package/react/view.js +29 -29
  103. package/view/details-expand.d.ts +18 -18
  104. package/view/details-expand.js +53 -53
  105. package/view/down-drop.d.ts +18 -18
  106. package/view/down-drop.js +71 -71
  107. package/view/index.d.ts +5 -5
  108. package/view/index.js +5 -5
  109. package/view/menu-list.d.ts +16 -16
  110. package/view/menu-list.js +48 -48
  111. package/view/route-view.d.ts +57 -57
  112. package/view/route-view.js +257 -257
  113. package/view/scroll-x.d.ts +14 -14
  114. package/view/scroll-x.js +47 -47
  115. package/view/std.d.ts +4 -4
  116. package/view/std.js +4 -4
  117. package/with.d.ts +27 -27
  118. package/with.js +77 -77
@@ -1,119 +1,119 @@
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 { html, css, property, query, define } from "../deps.js";
8
- import STD from "./std.js";
9
- import "./label-input.js";
10
- let SignForm = class SignForm extends STD {
11
- constructor() {
12
- super(...arguments);
13
- this.name = "";
14
- this.set = 2;
15
- }
16
- render() {
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 { html, css, property, query, define } from "../deps.js";
8
+ import STD from "./std.js";
9
+ import "./label-input.js";
10
+ let SignForm = class SignForm extends STD {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.name = "";
14
+ this.set = 2;
15
+ }
16
+ render() {
17
17
  return html `<form enctype="multipart/form-data">
18
18
  <slot name="pre"></slot>
19
19
  <main>${this.opt()}<slot></slot></main>
20
20
  <slot name="suf"></slot>
21
- </form>`;
22
- }
23
- opt() {
24
- const result = [];
25
- for (let i = 0; i <= this.set - 1; i++) {
26
- opts[i] && result.push(opts[i]);
27
- }
28
- return result;
29
- }
30
- reset() {
31
- each(this._form, (node) => {
32
- if (node.reset) {
33
- node.reset();
34
- }
35
- });
36
- const form = document.createElement("form");
37
- for (const slot of this.shadowRoot.querySelectorAll("slot"))
38
- for (const i of slot.assignedNodes()) {
39
- if (i.reset) {
40
- i.reset();
41
- }
42
- form.appendChild(i.cloneNode(true));
43
- }
44
- form.reset();
45
- for (const slot of this.shadowRoot.querySelectorAll("slot"))
46
- for (const i of slot.assignedNodes()) {
47
- if (i.name && form[i.name]) {
48
- i.value = form[i.name].value;
49
- }
50
- }
51
- form.remove();
52
- }
53
- namevalue() {
54
- const x = {};
55
- const form = document.createElement("form");
56
- form.enctype = "multipart/form-data";
57
- for (const slot of this.shadowRoot.querySelectorAll("slot"))
58
- for (const i of slot.assignedNodes()) {
59
- if (i.namevalue) {
60
- const [name, value] = i.namevalue();
61
- if (name) {
62
- x[name] = value;
63
- }
64
- }
65
- else {
66
- form.appendChild(i.cloneNode(true));
67
- }
68
- }
69
- const y = new FormData(form);
70
- for (const [key, value] of y) {
71
- x[key] = value;
72
- }
73
- each(this._form, (node) => {
74
- if (node.namevalue) {
75
- const [name, value] = node.namevalue();
76
- if (name) {
77
- x[name] = value;
78
- }
79
- }
80
- });
81
- form.remove();
82
- return [this.name, x];
83
- }
84
- FormData() {
85
- const x = {};
86
- const form = document.createElement("form");
87
- form.enctype = "multipart/form-data";
88
- for (const slot of this.shadowRoot.querySelectorAll("slot"))
89
- for (const i of slot.assignedNodes()) {
90
- if (i.FormData) {
91
- for (const [key, value] of i.FormData()) {
92
- x[key] = value;
93
- }
94
- }
95
- else {
96
- form.appendChild(i.cloneNode(true));
97
- }
98
- }
99
- const y = new FormData(form);
100
- each(this._form, (node) => {
101
- if (node.namevalue) {
102
- const [name, value] = node.namevalue();
103
- if (name) {
104
- y.append(name, value);
105
- }
106
- }
107
- });
108
- for (const key in x) {
109
- y.append(key, x[key]);
110
- }
111
- form.remove();
112
- return y;
113
- }
114
- };
115
- SignForm.styles = [
116
- STD.styles,
21
+ </form>`;
22
+ }
23
+ opt() {
24
+ const result = [];
25
+ for (let i = 0; i <= this.set - 1; i++) {
26
+ opts[i] && result.push(opts[i]);
27
+ }
28
+ return result;
29
+ }
30
+ reset() {
31
+ each(this._form, (node) => {
32
+ if (node.reset) {
33
+ node.reset();
34
+ }
35
+ });
36
+ const form = document.createElement("form");
37
+ for (const slot of this.shadowRoot.querySelectorAll("slot"))
38
+ for (const i of slot.assignedNodes()) {
39
+ if (i.reset) {
40
+ i.reset();
41
+ }
42
+ form.appendChild(i.cloneNode(true));
43
+ }
44
+ form.reset();
45
+ for (const slot of this.shadowRoot.querySelectorAll("slot"))
46
+ for (const i of slot.assignedNodes()) {
47
+ if (i.name && form[i.name]) {
48
+ i.value = form[i.name].value;
49
+ }
50
+ }
51
+ form.remove();
52
+ }
53
+ namevalue() {
54
+ const x = {};
55
+ const form = document.createElement("form");
56
+ form.enctype = "multipart/form-data";
57
+ for (const slot of this.shadowRoot.querySelectorAll("slot"))
58
+ for (const i of slot.assignedNodes()) {
59
+ if (i.namevalue) {
60
+ const [name, value] = i.namevalue();
61
+ if (name) {
62
+ x[name] = value;
63
+ }
64
+ }
65
+ else {
66
+ form.appendChild(i.cloneNode(true));
67
+ }
68
+ }
69
+ const y = new FormData(form);
70
+ for (const [key, value] of y) {
71
+ x[key] = value;
72
+ }
73
+ each(this._form, (node) => {
74
+ if (node.namevalue) {
75
+ const [name, value] = node.namevalue();
76
+ if (name) {
77
+ x[name] = value;
78
+ }
79
+ }
80
+ });
81
+ form.remove();
82
+ return [this.name, x];
83
+ }
84
+ FormData() {
85
+ const x = {};
86
+ const form = document.createElement("form");
87
+ form.enctype = "multipart/form-data";
88
+ for (const slot of this.shadowRoot.querySelectorAll("slot"))
89
+ for (const i of slot.assignedNodes()) {
90
+ if (i.FormData) {
91
+ for (const [key, value] of i.FormData()) {
92
+ x[key] = value;
93
+ }
94
+ }
95
+ else {
96
+ form.appendChild(i.cloneNode(true));
97
+ }
98
+ }
99
+ const y = new FormData(form);
100
+ each(this._form, (node) => {
101
+ if (node.namevalue) {
102
+ const [name, value] = node.namevalue();
103
+ if (name) {
104
+ y.append(name, value);
105
+ }
106
+ }
107
+ });
108
+ for (const key in x) {
109
+ y.append(key, x[key]);
110
+ }
111
+ form.remove();
112
+ return y;
113
+ }
114
+ };
115
+ SignForm.styles = [
116
+ STD.styles,
117
117
  css `
118
118
  :host {
119
119
  display: flow-root;
@@ -128,38 +128,38 @@ SignForm.styles = [
128
128
  display: flex;
129
129
  flex-direction: column;
130
130
  }
131
- `,
132
- ];
133
- __decorate([
134
- property()
135
- ], SignForm.prototype, "name", void 0);
136
- __decorate([
137
- property({ type: Number })
138
- ], SignForm.prototype, "set", void 0);
139
- __decorate([
140
- query("form")
141
- ], SignForm.prototype, "_form", void 0);
142
- SignForm = __decorate([
143
- define("sign-form")
144
- ], SignForm);
145
- export { SignForm };
146
- function each(node, callback) {
147
- if (node) {
148
- callback(node);
149
- for (const i of node.childNodes) {
150
- each(i, callback);
151
- }
152
- }
153
- }
154
- const opts = [html `<label-input label="E-mail" style="margin: 0.25em 0;" type="email"></label-input>`, html `<label-input label="Password" style="margin: 0.25em 0;" type="password"></label-input>`];
155
- let BaseForm = class BaseForm extends SignForm {
156
- constructor() {
157
- super();
158
- this.set = 0;
159
- }
160
- };
161
- BaseForm = __decorate([
162
- define("base-form")
163
- ], BaseForm);
164
- export { BaseForm };
165
- export default SignForm;
131
+ `,
132
+ ];
133
+ __decorate([
134
+ property()
135
+ ], SignForm.prototype, "name", void 0);
136
+ __decorate([
137
+ property({ type: Number })
138
+ ], SignForm.prototype, "set", void 0);
139
+ __decorate([
140
+ query("form")
141
+ ], SignForm.prototype, "_form", void 0);
142
+ SignForm = __decorate([
143
+ define("sign-form")
144
+ ], SignForm);
145
+ export { SignForm };
146
+ function each(node, callback) {
147
+ if (node) {
148
+ callback(node);
149
+ for (const i of node.childNodes) {
150
+ each(i, callback);
151
+ }
152
+ }
153
+ }
154
+ const opts = [html `<label-input label="E-mail" style="margin: 0.25em 0;" type="email"></label-input>`, html `<label-input label="Password" style="margin: 0.25em 0;" type="password"></label-input>`];
155
+ let BaseForm = class BaseForm extends SignForm {
156
+ constructor() {
157
+ super();
158
+ this.set = 0;
159
+ }
160
+ };
161
+ BaseForm = __decorate([
162
+ define("base-form")
163
+ ], BaseForm);
164
+ export { BaseForm };
165
+ export default SignForm;
@@ -1,27 +1,27 @@
1
- import STD from "./std.js";
2
- export declare class SplitInput extends STD {
3
- static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
4
- name: string;
5
- value: string;
6
- max: number;
7
- index: number;
8
- autofocus: boolean;
9
- _input: HTMLInputElement;
10
- _spans: NodeListOf<HTMLSpanElement>;
11
- current: number;
12
- currentValue: Array<string | null>;
13
- render(): import("lit-html").TemplateResult<1>;
14
- firstUpdated(): void;
15
- _handleInput(e: InputEvent): void;
16
- focus(): void;
17
- focusAt(i?: number): void;
18
- blur(i?: number): void;
19
- reset(): void;
20
- }
21
- export default SplitInput;
22
- declare global {
23
- interface HTMLElementTagNameMap {
24
- "split-input": SplitInput;
25
- }
26
- }
1
+ import STD from "./std.js";
2
+ export declare class SplitInput extends STD {
3
+ static styles: (import("lit").CSSResult | import("@lit/reactive-element/css-tag.js").CSSResultGroup[])[];
4
+ name: string;
5
+ value: string;
6
+ max: number;
7
+ index: number;
8
+ autofocus: boolean;
9
+ _input: HTMLInputElement;
10
+ _spans: NodeListOf<HTMLSpanElement>;
11
+ current: number;
12
+ currentValue: Array<string | null>;
13
+ render(): import("lit-html").TemplateResult<1>;
14
+ firstUpdated(): void;
15
+ _handleInput(e: InputEvent): void;
16
+ focus(): void;
17
+ focusAt(i?: number): void;
18
+ blur(i?: number): void;
19
+ reset(): void;
20
+ }
21
+ export default SplitInput;
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ "split-input": SplitInput;
25
+ }
26
+ }
27
27
  //# sourceMappingURL=split-input.d.ts.map
@@ -1,107 +1,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 { html, css, property, query, queryAll, define, cssvar } from "../deps.js";
8
- import STD from "./std.js";
9
- let SplitInput = class SplitInput extends STD {
10
- constructor() {
11
- super(...arguments);
12
- this.name = "";
13
- this.value = "";
14
- this.max = 6;
15
- this.index = -1;
16
- this.autofocus = false;
17
- this.current = 0;
18
- this.currentValue = [];
19
- }
20
- render() {
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 { html, css, property, query, queryAll, define, cssvar } from "../deps.js";
8
+ import STD from "./std.js";
9
+ let SplitInput = class SplitInput extends STD {
10
+ constructor() {
11
+ super(...arguments);
12
+ this.name = "";
13
+ this.value = "";
14
+ this.max = 6;
15
+ this.index = -1;
16
+ this.autofocus = false;
17
+ this.current = 0;
18
+ this.currentValue = [];
19
+ }
20
+ render() {
21
21
  return html `<main>
22
22
  <div>
23
- ${Array(this.max)
24
- .fill(0)
23
+ ${Array(this.max)
24
+ .fill(0)
25
25
  .map(() => html `<span><i></i></span>`)}
26
26
  <input @input=${this._handleInput} value=" " />
27
27
  </div>
28
- </main>`;
29
- }
30
- firstUpdated() {
31
- this._focusCheck();
32
- this.currentValue = this.value.split("").concat(Array(this.max - this.value.length).fill(null));
33
- this.current = this.index < 0 || this.index > this.max ? this.currentValue.indexOf(null) : this.index;
34
- this._spans.forEach((span, index) => {
35
- span.addEventListener("click", () => {
36
- this.current = index;
37
- this.focusAt();
38
- this._input.focus();
39
- });
40
- });
41
- document.addEventListener("click", (e) => {
42
- if (!this.contains(e.target)) {
43
- this.blur();
44
- }
45
- });
46
- }
47
- _handleInput(e) {
48
- if (e.data === null) {
49
- if (this.currentValue[this.current] !== null) {
50
- this.currentValue[this.current] = null;
51
- }
52
- else {
53
- this.currentValue[this.current - 1] = null;
54
- this.current = this.current - 1 < 0 ? 0 : this.current - 1;
55
- }
56
- }
57
- else {
58
- this.currentValue[this.current] = e.data;
59
- if (this.current + 1 >= this.max) {
60
- this.current = this.currentValue.indexOf(null);
61
- if (this.current === -1) {
62
- this.blur();
63
- }
64
- }
65
- else {
66
- this.current += 1;
67
- }
68
- }
69
- this.focus();
70
- this._spans.forEach((span, index) => {
71
- span.querySelector("i").innerText = this.currentValue[index] || "";
72
- });
73
- this.value = this.currentValue.join("");
74
- this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true, composed: true }));
75
- this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
76
- }
77
- focus() {
78
- this.focusAt();
79
- }
80
- focusAt(i = this.current) {
81
- var _a;
82
- this._spans.forEach((span) => {
83
- span.classList.remove("focus");
84
- });
85
- (_a = this._spans[i]) === null || _a === void 0 ? void 0 : _a.classList.add("focus");
86
- this._input.value = " ";
87
- }
88
- blur(i = this.current) {
89
- var _a;
90
- (_a = this._spans[i]) === null || _a === void 0 ? void 0 : _a.classList.remove("focus");
91
- this._input.blur();
92
- }
93
- reset() {
94
- this.currentValue = Array(this.max).fill(null);
95
- this.current = 0;
96
- this._spans.forEach((span) => {
97
- span.querySelector("i").innerText = "";
98
- });
99
- this.value = "";
100
- this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
101
- }
102
- };
103
- SplitInput.styles = [
104
- STD.styles,
28
+ </main>`;
29
+ }
30
+ firstUpdated() {
31
+ this._focusCheck();
32
+ this.currentValue = this.value.split("").concat(Array(this.max - this.value.length).fill(null));
33
+ this.current = this.index < 0 || this.index > this.max ? this.currentValue.indexOf(null) : this.index;
34
+ this._spans.forEach((span, index) => {
35
+ span.addEventListener("click", () => {
36
+ this.current = index;
37
+ this.focusAt();
38
+ this._input.focus();
39
+ });
40
+ });
41
+ document.addEventListener("click", (e) => {
42
+ if (!this.contains(e.target)) {
43
+ this.blur();
44
+ }
45
+ });
46
+ }
47
+ _handleInput(e) {
48
+ if (e.data === null) {
49
+ if (this.currentValue[this.current] !== null) {
50
+ this.currentValue[this.current] = null;
51
+ }
52
+ else {
53
+ this.currentValue[this.current - 1] = null;
54
+ this.current = this.current - 1 < 0 ? 0 : this.current - 1;
55
+ }
56
+ }
57
+ else {
58
+ this.currentValue[this.current] = e.data;
59
+ if (this.current + 1 >= this.max) {
60
+ this.current = this.currentValue.indexOf(null);
61
+ if (this.current === -1) {
62
+ this.blur();
63
+ }
64
+ }
65
+ else {
66
+ this.current += 1;
67
+ }
68
+ }
69
+ this.focus();
70
+ this._spans.forEach((span, index) => {
71
+ span.querySelector("i").innerText = this.currentValue[index] || "";
72
+ });
73
+ this.value = this.currentValue.join("");
74
+ this.dispatchEvent(new CustomEvent("input", { detail: this.value, bubbles: true, composed: true }));
75
+ this.dispatchEvent(new CustomEvent("change", { detail: this.value, composed: true }));
76
+ }
77
+ focus() {
78
+ this.focusAt();
79
+ }
80
+ focusAt(i = this.current) {
81
+ var _a;
82
+ this._spans.forEach((span) => {
83
+ span.classList.remove("focus");
84
+ });
85
+ (_a = this._spans[i]) === null || _a === void 0 ? void 0 : _a.classList.add("focus");
86
+ this._input.value = " ";
87
+ }
88
+ blur(i = this.current) {
89
+ var _a;
90
+ (_a = this._spans[i]) === null || _a === void 0 ? void 0 : _a.classList.remove("focus");
91
+ this._input.blur();
92
+ }
93
+ reset() {
94
+ this.currentValue = Array(this.max).fill(null);
95
+ this.current = 0;
96
+ this._spans.forEach((span) => {
97
+ span.querySelector("i").innerText = "";
98
+ });
99
+ this.value = "";
100
+ this.dispatchEvent(new CustomEvent("change", { detail: this.value }));
101
+ }
102
+ };
103
+ SplitInput.styles = [
104
+ STD.styles,
105
105
  css `
106
106
  :host {
107
107
  display: inline-block;
@@ -151,31 +151,31 @@ SplitInput.styles = [
151
151
  .focus i {
152
152
  outline: 0.12em solid var(${cssvar}--input-true);
153
153
  }
154
- `,
155
- ];
156
- __decorate([
157
- property()
158
- ], SplitInput.prototype, "name", void 0);
159
- __decorate([
160
- property()
161
- ], SplitInput.prototype, "value", void 0);
162
- __decorate([
163
- property({ type: Number })
164
- ], SplitInput.prototype, "max", void 0);
165
- __decorate([
166
- property({ type: Number })
167
- ], SplitInput.prototype, "index", void 0);
168
- __decorate([
169
- property({ type: Boolean })
170
- ], SplitInput.prototype, "autofocus", void 0);
171
- __decorate([
172
- query("input")
173
- ], SplitInput.prototype, "_input", void 0);
174
- __decorate([
175
- queryAll("span")
176
- ], SplitInput.prototype, "_spans", void 0);
177
- SplitInput = __decorate([
178
- define("split-input")
179
- ], SplitInput);
180
- export { SplitInput };
181
- export default SplitInput;
154
+ `,
155
+ ];
156
+ __decorate([
157
+ property()
158
+ ], SplitInput.prototype, "name", void 0);
159
+ __decorate([
160
+ property()
161
+ ], SplitInput.prototype, "value", void 0);
162
+ __decorate([
163
+ property({ type: Number })
164
+ ], SplitInput.prototype, "max", void 0);
165
+ __decorate([
166
+ property({ type: Number })
167
+ ], SplitInput.prototype, "index", void 0);
168
+ __decorate([
169
+ property({ type: Boolean })
170
+ ], SplitInput.prototype, "autofocus", void 0);
171
+ __decorate([
172
+ query("input")
173
+ ], SplitInput.prototype, "_input", void 0);
174
+ __decorate([
175
+ queryAll("span")
176
+ ], SplitInput.prototype, "_spans", void 0);
177
+ SplitInput = __decorate([
178
+ define("split-input")
179
+ ], SplitInput);
180
+ export { SplitInput };
181
+ export default SplitInput;
@@ -1,20 +1,20 @@
1
- import { GLOBSTD } from "../deps.js";
2
- export default class InputFormSTD extends GLOBSTD {
3
- name: string;
4
- value: any;
5
- def: string;
6
- _input: HTMLInputElement;
7
- compositing: boolean;
8
- autofocus: boolean;
9
- static styles: import("@lit/reactive-element/css-tag.js").CSSResultGroup[];
10
- namevalue(): [string, any];
11
- reset(): void;
12
- _handleInput(e: any): void;
13
- _handleChange(): void;
14
- connectedCallback(): void;
15
- _compositionCheck(): void;
16
- _focusCheck(): void;
17
- focus(options?: FocusOptions): void;
18
- firstUpdated(): void;
19
- }
1
+ import { GLOBSTD } from "../deps.js";
2
+ export default class InputFormSTD extends GLOBSTD {
3
+ name: string;
4
+ value: any;
5
+ def: string;
6
+ _input: HTMLInputElement;
7
+ compositing: boolean;
8
+ autofocus: boolean;
9
+ static styles: import("@lit/reactive-element/css-tag.js").CSSResultGroup[];
10
+ namevalue(): [string, any];
11
+ reset(): void;
12
+ _handleInput(e: any): void;
13
+ _handleChange(): void;
14
+ connectedCallback(): void;
15
+ _compositionCheck(): void;
16
+ _focusCheck(): void;
17
+ focus(options?: FocusOptions): void;
18
+ firstUpdated(): void;
19
+ }
20
20
  //# sourceMappingURL=std.d.ts.map