blue-web 1.36.2 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/js/701.bundle.js +1 -0
- package/dist/js/776.bundle.js +1 -0
- package/dist/js/actions.js +48 -57
- package/dist/js/color-mode.js +23 -29
- package/dist/js/dialog.js +82 -64
- package/dist/js/edit-view.js +52 -55
- package/dist/js/input-splitted.js +193 -244
- package/dist/js/layout.js +151 -192
- package/dist/js/modal-responsive.js +35 -48
- package/dist/js/odometer.js +132 -131
- package/dist/js/overflow-detector.js +51 -62
- package/dist/js/progress.js +41 -59
- package/dist/js/quick-look.bundle.js +1 -0
- package/dist/js/quick-look.d.ts +15 -0
- package/dist/js/quick-look.js +168 -0
- package/dist/js/read-view.js +125 -91
- package/dist/js/select-list.js +168 -177
- package/dist/js/shared.js +21 -26
- package/dist/js/utils.d.ts +1 -1
- package/dist/js/utils.js +4 -106
- package/dist/merged.scss +87 -9
- package/dist/style.css +75 -7
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +5 -5
- package/dist/style.scss +2 -1
- package/dist/styles/_quick-look.scss +56 -0
- package/package.json +8 -7
|
@@ -1,247 +1,196 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
1
|
+
// src/js/input-splitted.ts
|
|
2
|
+
var InputSplitted = class extends HTMLElement {
|
|
3
|
+
#observer;
|
|
4
|
+
#valueArray = [];
|
|
5
|
+
#refArray = [];
|
|
6
|
+
#lightDom = false;
|
|
7
|
+
get lightDom() {
|
|
8
|
+
return this.#lightDom;
|
|
9
|
+
}
|
|
10
|
+
set lightDom(_lightDom) {
|
|
11
|
+
this.#lightDom = _lightDom;
|
|
12
|
+
if (this.lightDom === true) this.innerHTML = this.#styling;
|
|
13
|
+
else {
|
|
14
|
+
if (!this.shadowRoot) this.attachShadow({
|
|
15
|
+
mode: "open",
|
|
16
|
+
delegatesFocus: true
|
|
17
|
+
});
|
|
18
|
+
this.shadowRoot.innerHTML = this.#styling;
|
|
19
|
+
}
|
|
20
|
+
this.#initDom();
|
|
21
|
+
}
|
|
22
|
+
#value = "";
|
|
23
|
+
get value() {
|
|
24
|
+
return this.#value;
|
|
25
|
+
}
|
|
26
|
+
set value(_value) {
|
|
27
|
+
const oldValue = this.#value;
|
|
28
|
+
this.#value = _value;
|
|
29
|
+
this.#valueArray = this.value.split("");
|
|
30
|
+
for (let i = 0; i < this.length; i++) if (this.#refArray[i]) this.#refArray[i].value = this.#valueArray[i] || "";
|
|
31
|
+
if (oldValue !== _value) this.dispatchEvent(new CustomEvent("changeValue", {
|
|
32
|
+
bubbles: true,
|
|
33
|
+
detail: _value
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
#length = 0;
|
|
37
|
+
get length() {
|
|
38
|
+
return this.#length;
|
|
39
|
+
}
|
|
40
|
+
set length(_length) {
|
|
41
|
+
this.#length = _length;
|
|
42
|
+
if (this.length > this.#refArray.length) {
|
|
43
|
+
for (let j = 0; j < this.length; j++) if (!this.#refArray[j] && this.didInit) this.#addInput(this.#refArray.length);
|
|
44
|
+
} else if (this.length < this.#refArray.length) {
|
|
45
|
+
const difference = Math.abs(this.#refArray.length - this.length);
|
|
46
|
+
for (let j = 0; j < difference; j++) this.#refArray.pop()?.remove();
|
|
47
|
+
}
|
|
48
|
+
this.#refArray = [...this.#refArray];
|
|
49
|
+
}
|
|
50
|
+
#disabled = false;
|
|
51
|
+
get disabled() {
|
|
52
|
+
return this.#disabled;
|
|
53
|
+
}
|
|
54
|
+
set disabled(_disabled) {
|
|
55
|
+
this.#disabled = _disabled;
|
|
56
|
+
const inputs = this.lightDom ? this.querySelectorAll("input") : this.shadowRoot.querySelectorAll("input");
|
|
57
|
+
for (const input of inputs) input.disabled = _disabled;
|
|
58
|
+
}
|
|
59
|
+
#controlClass = "";
|
|
60
|
+
get controlClass() {
|
|
61
|
+
return this.#controlClass;
|
|
62
|
+
}
|
|
63
|
+
set controlClass(value) {
|
|
64
|
+
this.#controlClass = value;
|
|
65
|
+
for (const el of this.#refArray) el.className = this.controlClass;
|
|
66
|
+
}
|
|
67
|
+
#control1Id = "";
|
|
68
|
+
get control1Id() {
|
|
69
|
+
return this.#control1Id;
|
|
70
|
+
}
|
|
71
|
+
set control1Id(value) {
|
|
72
|
+
this.#control1Id = value;
|
|
73
|
+
if (this.#refArray[0]) this.#refArray[0].id = this.control1Id;
|
|
74
|
+
}
|
|
75
|
+
#styling = `<style>
|
|
76
|
+
input {
|
|
77
|
+
display: var(--blue-input-splitted-display, revert);
|
|
78
|
+
background-color: var(--blue-input-splitted-background-color, revert);
|
|
79
|
+
border: var(--blue-input-splitted-border, revert);
|
|
80
|
+
border-radius: var(--blue-input-splitted-border-radius, revert);
|
|
81
|
+
box-shadow: var(--blue-input-splitted-box-shadow, revert);
|
|
82
|
+
color: var(--blue-input-splitted-color, revert);
|
|
83
|
+
margin: var(--blue-input-splitted-margin, revert);
|
|
84
|
+
padding: var(--blue-input-splitted-padding, revert);
|
|
85
|
+
text-align: var(--blue-input-splitted-text-align, revert);
|
|
86
|
+
width: var(--blue-input-splitted-width, revert);
|
|
35
87
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
}
|
|
140
|
-
static get formAssociated() {
|
|
141
|
-
return true;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
function _addInput(i) {
|
|
145
|
-
const input = document.createElement("input");
|
|
146
|
-
_classPrivateFieldGet(_refArray, this).push(input);
|
|
147
|
-
input.type = "text";
|
|
148
|
-
input.className = this.controlClass;
|
|
149
|
-
if (i === 0) {
|
|
150
|
-
input.id = this.control1Id;
|
|
151
|
-
}
|
|
152
|
-
input.maxLength = 1;
|
|
153
|
-
input.value = _classPrivateFieldGet(_valueArray, this)[i] || "";
|
|
154
|
-
input.disabled = this.disabled;
|
|
155
|
-
input.addEventListener("input", _ref => {
|
|
156
|
-
let target = _ref.target;
|
|
157
|
-
const inputTarget = target;
|
|
158
|
-
if (inputTarget.value !== "" && _classPrivateFieldGet(_refArray, this)[i + 1]) {
|
|
159
|
-
_classPrivateFieldGet(_refArray, this)[i + 1].focus();
|
|
160
|
-
}
|
|
161
|
-
_classPrivateFieldGet(_valueArray, this)[i] = inputTarget.value;
|
|
162
|
-
this.value = _classPrivateFieldGet(_valueArray, this).join("");
|
|
163
|
-
});
|
|
164
|
-
input.addEventListener("keydown", _ref2 => {
|
|
165
|
-
let key = _ref2.key,
|
|
166
|
-
target = _ref2.target;
|
|
167
|
-
const inputTarget = target;
|
|
168
|
-
if (key === "Backspace" && inputTarget.value === "" && _classPrivateFieldGet(_refArray, this)[i - 1] !== undefined) {
|
|
169
|
-
_classPrivateFieldGet(_refArray, this)[i - 1].focus();
|
|
170
|
-
}
|
|
171
|
-
});
|
|
172
|
-
input.addEventListener("paste", _ref3 => {
|
|
173
|
-
let clipboardData = _ref3.clipboardData;
|
|
174
|
-
const pastedData = clipboardData.getData("Text");
|
|
175
|
-
let k = 0;
|
|
176
|
-
for (let j = i; j < this.length; j++) {
|
|
177
|
-
_classPrivateFieldGet(_valueArray, this)[j] = pastedData.split("")[k];
|
|
178
|
-
_classPrivateFieldGet(_refArray, this)[j].focus();
|
|
179
|
-
k = k + 1;
|
|
180
|
-
}
|
|
181
|
-
this.value = _classPrivateFieldGet(_valueArray, this).join("");
|
|
182
|
-
});
|
|
183
|
-
if (this.lightDom) {
|
|
184
|
-
this.appendChild(input);
|
|
185
|
-
} else {
|
|
186
|
-
this.shadowRoot.appendChild(input);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
function _initDom() {
|
|
190
|
-
this.value = this.getAttribute("value") || "";
|
|
191
|
-
this.length = getLength(this);
|
|
192
|
-
if (this.lightDom) {
|
|
193
|
-
this.innerHTML = _classPrivateFieldGet(_styling, this);
|
|
194
|
-
this.addEventListener("focus", this.onFocus);
|
|
195
|
-
} else {
|
|
196
|
-
this.shadowRoot.innerHTML = _classPrivateFieldGet(_styling, this);
|
|
197
|
-
this.shadowRoot.addEventListener("focus", this.onFocus);
|
|
198
|
-
}
|
|
199
|
-
_classPrivateFieldSet(_valueArray, this, this.value.split(""));
|
|
200
|
-
_classPrivateFieldSet(_refArray, this, []);
|
|
201
|
-
for (let i = 0; i < this.length; i++) {
|
|
202
|
-
_assertClassBrand(_InputSplitted_brand, this, _addInput).call(this, i);
|
|
203
|
-
}
|
|
204
|
-
}
|
|
205
|
-
function _observe() {
|
|
206
|
-
// Observer prüft, ob sich HTML-Attribute geändert haben.
|
|
207
|
-
// Props-Änderungen werden ohne bemerkt.
|
|
208
|
-
_classPrivateFieldSet(_observer, this, _classPrivateFieldGet(_observer, this) || new MutationObserver(mutations => {
|
|
209
|
-
mutations.forEach(m => {
|
|
210
|
-
if (m.attributeName === "value") {
|
|
211
|
-
this.value = this.getAttribute("value") || this.value;
|
|
212
|
-
}
|
|
213
|
-
if (m.attributeName === "length") {
|
|
214
|
-
this.length = getLength(this);
|
|
215
|
-
}
|
|
216
|
-
if (m.attributeName === "control-class") {
|
|
217
|
-
this.controlClass = this.getAttribute("control-class") || this.controlClass;
|
|
218
|
-
}
|
|
219
|
-
if (m.attributeName === "control-1-id") {
|
|
220
|
-
this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
|
|
221
|
-
}
|
|
222
|
-
if (m.attributeName === "light-dom") {
|
|
223
|
-
this.lightDom = this.getAttribute("light-dom") !== null;
|
|
224
|
-
}
|
|
225
|
-
if (m.attributeName === "disabled") {
|
|
226
|
-
this.disabled = this.getAttribute("disabled") !== null;
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}));
|
|
230
|
-
_classPrivateFieldGet(_observer, this).observe(this, {
|
|
231
|
-
attributeFilter: ["value", "length", "control-class", "control-1-id", "light-dom", "disabled"],
|
|
232
|
-
attributeOldValue: true,
|
|
233
|
-
childList: true,
|
|
234
|
-
subtree: true
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
function _unobserve() {
|
|
238
|
-
if (_classPrivateFieldGet(_observer, this)) {
|
|
239
|
-
_classPrivateFieldGet(_observer, this).takeRecords();
|
|
240
|
-
_classPrivateFieldGet(_observer, this).disconnect();
|
|
241
|
-
}
|
|
242
|
-
}
|
|
88
|
+
</style>`;
|
|
89
|
+
didInit = false;
|
|
90
|
+
constructor() {
|
|
91
|
+
super();
|
|
92
|
+
this.onFocus = this.onFocus.bind(this);
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
this.didInit = true;
|
|
96
|
+
this.lightDom = this.getAttribute("light-dom") !== null;
|
|
97
|
+
this.disabled = this.getAttribute("disabled") !== null;
|
|
98
|
+
this.#initDom();
|
|
99
|
+
this.value = this.getAttribute("value") || this.value;
|
|
100
|
+
this.length = getLength(this);
|
|
101
|
+
this.controlClass = this.getAttribute("control-class") || this.controlClass;
|
|
102
|
+
this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
|
|
103
|
+
this.#observe();
|
|
104
|
+
}
|
|
105
|
+
#addInput(i) {
|
|
106
|
+
const input = document.createElement("input");
|
|
107
|
+
this.#refArray.push(input);
|
|
108
|
+
input.type = "text";
|
|
109
|
+
input.className = this.controlClass;
|
|
110
|
+
if (i === 0) input.id = this.control1Id;
|
|
111
|
+
input.maxLength = 1;
|
|
112
|
+
input.value = this.#valueArray[i] || "";
|
|
113
|
+
input.disabled = this.disabled;
|
|
114
|
+
input.addEventListener("input", ({ target }) => {
|
|
115
|
+
const inputTarget = target;
|
|
116
|
+
if (inputTarget.value !== "" && this.#refArray[i + 1]) this.#refArray[i + 1].focus();
|
|
117
|
+
this.#valueArray[i] = inputTarget.value;
|
|
118
|
+
this.value = this.#valueArray.join("");
|
|
119
|
+
});
|
|
120
|
+
input.addEventListener("keydown", ({ key, target }) => {
|
|
121
|
+
if (key === "Backspace" && target.value === "" && this.#refArray[i - 1] !== void 0) this.#refArray[i - 1].focus();
|
|
122
|
+
});
|
|
123
|
+
input.addEventListener("paste", ({ clipboardData }) => {
|
|
124
|
+
const pastedData = clipboardData.getData("Text");
|
|
125
|
+
let k = 0;
|
|
126
|
+
for (let j = i; j < this.length; j++) {
|
|
127
|
+
this.#valueArray[j] = pastedData.split("")[k];
|
|
128
|
+
this.#refArray[j].focus();
|
|
129
|
+
k = k + 1;
|
|
130
|
+
}
|
|
131
|
+
this.value = this.#valueArray.join("");
|
|
132
|
+
});
|
|
133
|
+
if (this.lightDom) this.appendChild(input);
|
|
134
|
+
else this.shadowRoot.appendChild(input);
|
|
135
|
+
}
|
|
136
|
+
onFocus() {
|
|
137
|
+
if (this.#refArray[0]) this.#refArray[0].focus();
|
|
138
|
+
}
|
|
139
|
+
#initDom() {
|
|
140
|
+
this.value = this.getAttribute("value") || "";
|
|
141
|
+
this.length = getLength(this);
|
|
142
|
+
if (this.lightDom) {
|
|
143
|
+
this.innerHTML = this.#styling;
|
|
144
|
+
this.addEventListener("focus", this.onFocus);
|
|
145
|
+
} else {
|
|
146
|
+
this.shadowRoot.innerHTML = this.#styling;
|
|
147
|
+
this.shadowRoot.addEventListener("focus", this.onFocus);
|
|
148
|
+
}
|
|
149
|
+
this.#valueArray = this.value.split("");
|
|
150
|
+
this.#refArray = [];
|
|
151
|
+
for (let i = 0; i < this.length; i++) this.#addInput(i);
|
|
152
|
+
}
|
|
153
|
+
#observe() {
|
|
154
|
+
this.#observer = this.#observer || new MutationObserver((mutations) => {
|
|
155
|
+
mutations.forEach((m) => {
|
|
156
|
+
if (m.attributeName === "value") this.value = this.getAttribute("value") || this.value;
|
|
157
|
+
if (m.attributeName === "length") this.length = getLength(this);
|
|
158
|
+
if (m.attributeName === "control-class") this.controlClass = this.getAttribute("control-class") || this.controlClass;
|
|
159
|
+
if (m.attributeName === "control-1-id") this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
|
|
160
|
+
if (m.attributeName === "light-dom") this.lightDom = this.getAttribute("light-dom") !== null;
|
|
161
|
+
if (m.attributeName === "disabled") this.disabled = this.getAttribute("disabled") !== null;
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
this.#observer.observe(this, {
|
|
165
|
+
attributeFilter: [
|
|
166
|
+
"value",
|
|
167
|
+
"length",
|
|
168
|
+
"control-class",
|
|
169
|
+
"control-1-id",
|
|
170
|
+
"light-dom",
|
|
171
|
+
"disabled"
|
|
172
|
+
],
|
|
173
|
+
attributeOldValue: true,
|
|
174
|
+
childList: true,
|
|
175
|
+
subtree: true
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
#unobserve() {
|
|
179
|
+
if (this.#observer) {
|
|
180
|
+
this.#observer.takeRecords();
|
|
181
|
+
this.#observer.disconnect();
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
disconnectedCallback() {
|
|
185
|
+
this.#unobserve();
|
|
186
|
+
}
|
|
187
|
+
static get formAssociated() {
|
|
188
|
+
return true;
|
|
189
|
+
}
|
|
190
|
+
};
|
|
243
191
|
function getLength(element) {
|
|
244
|
-
|
|
245
|
-
|
|
192
|
+
const attr = element.getAttribute("length");
|
|
193
|
+
if (attr) return parseInt(attr);
|
|
246
194
|
}
|
|
247
|
-
customElements.define("bl-input-splitted", InputSplitted);
|
|
195
|
+
customElements.define("bl-input-splitted", InputSplitted);
|
|
196
|
+
export { InputSplitted };
|