blue-web 1.17.5 → 1.17.7

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.
@@ -1,34 +1,48 @@
1
+ function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
2
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
3
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
4
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
5
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
6
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
7
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
8
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
9
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
10
+ var _observer = /*#__PURE__*/new WeakMap();
11
+ var _valueArray = /*#__PURE__*/new WeakMap();
12
+ var _refArray = /*#__PURE__*/new WeakMap();
13
+ var _lightDom2 = /*#__PURE__*/new WeakMap();
14
+ var _value2 = /*#__PURE__*/new WeakMap();
15
+ var _length2 = /*#__PURE__*/new WeakMap();
16
+ var _controlClass = /*#__PURE__*/new WeakMap();
17
+ var _control1Id = /*#__PURE__*/new WeakMap();
18
+ var _styling = /*#__PURE__*/new WeakMap();
19
+ var _InputSplitted_brand = /*#__PURE__*/new WeakSet();
1
20
  export class InputSplitted extends HTMLElement {
2
- #observer;
3
- #valueArray = [];
4
- #refArray = [];
5
- #lightDom = false;
6
21
  get lightDom() {
7
- return this.#lightDom;
22
+ return _classPrivateFieldGet(_lightDom2, this);
8
23
  }
9
24
  set lightDom(_lightDom) {
10
- this.#lightDom = _lightDom;
25
+ _classPrivateFieldSet(_lightDom2, this, _lightDom);
11
26
  if (this.lightDom === true) {
12
- this.innerHTML = this.#styling;
27
+ this.innerHTML = _classPrivateFieldGet(_styling, this);
13
28
  } else {
14
29
  if (!this.shadowRoot) this.attachShadow({
15
30
  mode: "open",
16
31
  delegatesFocus: true
17
32
  });
18
- this.shadowRoot.innerHTML = this.#styling;
33
+ this.shadowRoot.innerHTML = _classPrivateFieldGet(_styling, this);
19
34
  }
20
- this.#initDom();
35
+ _assertClassBrand(_InputSplitted_brand, this, _initDom).call(this);
21
36
  }
22
- #value = "";
23
37
  get value() {
24
- return this.#value;
38
+ return _classPrivateFieldGet(_value2, this);
25
39
  }
26
40
  set value(_value) {
27
- const oldValue = this.#value;
28
- this.#value = _value;
29
- this.#valueArray = this.value.split("");
41
+ const oldValue = _classPrivateFieldGet(_value2, this);
42
+ _classPrivateFieldSet(_value2, this, _value);
43
+ _classPrivateFieldSet(_valueArray, this, this.value.split(""));
30
44
  for (let i = 0; i < this.length; i++) {
31
- if (this.#refArray[i]) this.#refArray[i].value = this.#valueArray[i] || "";
45
+ if (_classPrivateFieldGet(_refArray, this)[i]) _classPrivateFieldGet(_refArray, this)[i].value = _classPrivateFieldGet(_valueArray, this)[i] || "";
32
46
  }
33
47
  if (oldValue !== _value) {
34
48
  this.dispatchEvent(new CustomEvent("changeValue", {
@@ -37,189 +51,182 @@ export class InputSplitted extends HTMLElement {
37
51
  }));
38
52
  }
39
53
  }
40
- #length = 0;
41
54
  get length() {
42
- return this.#length;
55
+ return _classPrivateFieldGet(_length2, this);
43
56
  }
44
57
  set length(_length) {
45
- this.#length = _length;
46
- if (this.length > this.#refArray.length) {
58
+ _classPrivateFieldSet(_length2, this, _length);
59
+ if (this.length > _classPrivateFieldGet(_refArray, this).length) {
47
60
  // Added length
48
61
 
49
62
  for (let j = 0; j < this.length; j++) {
50
- if (!this.#refArray[j] && this.didInit) {
51
- this.#addInput(this.#refArray.length);
63
+ if (!_classPrivateFieldGet(_refArray, this)[j] && this.didInit) {
64
+ _assertClassBrand(_InputSplitted_brand, this, _addInput).call(this, _classPrivateFieldGet(_refArray, this).length);
52
65
  }
53
66
  }
54
- } else if (this.length < this.#refArray.length) {
67
+ } else if (this.length < _classPrivateFieldGet(_refArray, this).length) {
55
68
  // Removed length
56
69
 
57
- const difference = Math.abs(this.#refArray.length - this.length);
70
+ const difference = Math.abs(_classPrivateFieldGet(_refArray, this).length - this.length);
58
71
  for (let j = 0; j < difference; j++) {
59
- const el = this.#refArray.pop();
60
- el?.remove();
72
+ const el = _classPrivateFieldGet(_refArray, this).pop();
73
+ el === null || el === void 0 || el.remove();
61
74
  }
62
75
  }
63
- this.#refArray = [...this.#refArray];
76
+ _classPrivateFieldSet(_refArray, this, [..._classPrivateFieldGet(_refArray, this)]);
64
77
  }
65
- #controlClass = "";
66
78
  get controlClass() {
67
- return this.#controlClass;
79
+ return _classPrivateFieldGet(_controlClass, this);
68
80
  }
69
81
  set controlClass(value) {
70
- this.#controlClass = value;
71
- for (const el of this.#refArray) {
82
+ _classPrivateFieldSet(_controlClass, this, value);
83
+ for (const el of _classPrivateFieldGet(_refArray, this)) {
72
84
  el.className = this.controlClass;
73
85
  }
74
86
  }
75
- #control1Id = "";
76
87
  get control1Id() {
77
- return this.#control1Id;
88
+ return _classPrivateFieldGet(_control1Id, this);
78
89
  }
79
90
  set control1Id(value) {
80
- this.#control1Id = value;
81
- if (this.#refArray[0]) {
82
- this.#refArray[0].id = this.control1Id;
91
+ _classPrivateFieldSet(_control1Id, this, value);
92
+ if (_classPrivateFieldGet(_refArray, this)[0]) {
93
+ _classPrivateFieldGet(_refArray, this)[0].id = this.control1Id;
83
94
  }
84
95
  }
85
- #styling = /* html */`<style>
86
- input {
87
- display: var(--blue-input-splitted-display, revert);
88
- background-color: var(--blue-input-splitted-background-color, revert);
89
- border: var(--blue-input-splitted-border, revert);
90
- border-radius: var(--blue-input-splitted-border-radius, revert);
91
- box-shadow: var(--blue-input-splitted-box-shadow, revert);
92
- color: var(--blue-input-splitted-color, revert);
93
- margin: var(--blue-input-splitted-margin, revert);
94
- padding: var(--blue-input-splitted-padding, revert);
95
- text-align: var(--blue-input-splitted-text-align, revert);
96
- width: var(--blue-input-splitted-width, revert);
97
- }
98
- </style>`;
99
- didInit = false;
100
96
  constructor() {
101
97
  super();
98
+ _classPrivateMethodInitSpec(this, _InputSplitted_brand);
99
+ _classPrivateFieldInitSpec(this, _observer, void 0);
100
+ _classPrivateFieldInitSpec(this, _valueArray, []);
101
+ _classPrivateFieldInitSpec(this, _refArray, []);
102
+ _classPrivateFieldInitSpec(this, _lightDom2, false);
103
+ _classPrivateFieldInitSpec(this, _value2, "");
104
+ _classPrivateFieldInitSpec(this, _length2, 0);
105
+ _classPrivateFieldInitSpec(this, _controlClass, "");
106
+ _classPrivateFieldInitSpec(this, _control1Id, "");
107
+ _classPrivateFieldInitSpec(this, _styling, /* html */"<style>\n input {\n display: var(--blue-input-splitted-display, revert);\n background-color: var(--blue-input-splitted-background-color, revert);\n border: var(--blue-input-splitted-border, revert);\n border-radius: var(--blue-input-splitted-border-radius, revert);\n box-shadow: var(--blue-input-splitted-box-shadow, revert);\n color: var(--blue-input-splitted-color, revert);\n margin: var(--blue-input-splitted-margin, revert);\n padding: var(--blue-input-splitted-padding, revert);\n text-align: var(--blue-input-splitted-text-align, revert);\n width: var(--blue-input-splitted-width, revert);\n }\n</style>");
108
+ _defineProperty(this, "didInit", false);
102
109
  this.onFocus = this.onFocus.bind(this);
103
110
  }
104
111
  connectedCallback() {
105
112
  this.didInit = true;
106
113
  this.lightDom = this.getAttribute("light-dom") !== null;
107
- this.#initDom();
114
+ _assertClassBrand(_InputSplitted_brand, this, _initDom).call(this);
108
115
  this.value = this.getAttribute("value") || this.value;
109
116
  this.length = getLength(this);
110
117
  this.controlClass = this.getAttribute("control-class") || this.controlClass;
111
118
  this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
112
- this.#observe();
113
- }
114
- #addInput(i) {
115
- const input = document.createElement("input");
116
- this.#refArray.push(input);
117
- input.type = "text";
118
- input.className = this.controlClass;
119
- if (i === 0) {
120
- input.id = this.control1Id;
121
- }
122
- input.maxLength = 1;
123
- input.value = this.#valueArray[i] || "";
124
- input.addEventListener("input", _ref => {
125
- let {
126
- target
127
- } = _ref;
128
- const inputTarget = target;
129
- if (inputTarget.value !== "" && this.#refArray[i + 1]) {
130
- this.#refArray[i + 1].focus();
131
- }
132
- this.#valueArray[i] = inputTarget.value;
133
- this.value = this.#valueArray.join("");
134
- });
135
- input.addEventListener("keydown", _ref2 => {
136
- let {
137
- key,
138
- target
139
- } = _ref2;
140
- const inputTarget = target;
141
- if (key === "Backspace" && inputTarget.value === "" && this.#refArray[i - 1] !== undefined) {
142
- this.#refArray[i - 1].focus();
143
- }
144
- });
145
- input.addEventListener("paste", _ref3 => {
146
- let {
147
- clipboardData
148
- } = _ref3;
149
- const pastedData = clipboardData.getData("Text");
150
- let k = 0;
151
- for (let j = i; j < this.length; j++) {
152
- this.#valueArray[j] = pastedData.split("")[k];
153
- this.#refArray[j].focus();
154
- k = k + 1;
155
- }
156
- this.value = this.#valueArray.join("");
157
- });
158
- if (this.lightDom) {
159
- this.appendChild(input);
160
- } else {
161
- this.shadowRoot.appendChild(input);
162
- }
119
+ _assertClassBrand(_InputSplitted_brand, this, _observe).call(this);
163
120
  }
164
121
  onFocus() {
165
- if (this.#refArray[0]) this.#refArray[0].focus();
122
+ if (_classPrivateFieldGet(_refArray, this)[0]) _classPrivateFieldGet(_refArray, this)[0].focus();
166
123
  }
167
- #initDom() {
168
- this.value = this.getAttribute("value") || "";
169
- this.length = getLength(this);
170
- if (this.lightDom) {
171
- this.innerHTML = this.#styling;
172
- this.addEventListener("focus", this.onFocus);
173
- } else {
174
- this.shadowRoot.innerHTML = this.#styling;
175
- this.shadowRoot.addEventListener("focus", this.onFocus);
176
- }
177
- this.#valueArray = this.value.split("");
178
- this.#refArray = [];
179
- for (let i = 0; i < this.length; i++) {
180
- this.#addInput(i);
181
- }
124
+ disconnectedCallback() {
125
+ _assertClassBrand(_InputSplitted_brand, this, _unobserve).call(this);
182
126
  }
183
- #observe() {
184
- // Observer prüft, ob sich HTML-Attribute geändert haben.
185
- // Props-Änderungen werden ohne bemerkt.
186
- this.#observer = this.#observer || new MutationObserver(mutations => {
187
- mutations.forEach(m => {
188
- if (m.attributeName === "value") {
189
- this.value = this.getAttribute("value") || this.value;
190
- }
191
- if (m.attributeName === "length") {
192
- this.length = getLength(this);
193
- }
194
- if (m.attributeName === "control-class") {
195
- this.controlClass = this.getAttribute("control-class") || this.controlClass;
196
- }
197
- if (m.attributeName === "control-1-id") {
198
- this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
199
- }
200
- if (m.attributeName === "light-dom") {
201
- this.lightDom = this.getAttribute("light-dom") !== null;
202
- }
203
- });
204
- });
205
- this.#observer.observe(this, {
206
- attributeFilter: ["value", "length", "control-class", "control-1-id", "light-dom"],
207
- attributeOldValue: true,
208
- childList: true,
209
- subtree: true
210
- });
127
+ static get formAssociated() {
128
+ return true;
211
129
  }
212
- #unobserve() {
213
- if (this.#observer) {
214
- this.#observer.takeRecords();
215
- this.#observer.disconnect();
130
+ }
131
+ function _addInput(i) {
132
+ const input = document.createElement("input");
133
+ _classPrivateFieldGet(_refArray, this).push(input);
134
+ input.type = "text";
135
+ input.className = this.controlClass;
136
+ if (i === 0) {
137
+ input.id = this.control1Id;
138
+ }
139
+ input.maxLength = 1;
140
+ input.value = _classPrivateFieldGet(_valueArray, this)[i] || "";
141
+ input.addEventListener("input", _ref => {
142
+ let {
143
+ target
144
+ } = _ref;
145
+ const inputTarget = target;
146
+ if (inputTarget.value !== "" && _classPrivateFieldGet(_refArray, this)[i + 1]) {
147
+ _classPrivateFieldGet(_refArray, this)[i + 1].focus();
148
+ }
149
+ _classPrivateFieldGet(_valueArray, this)[i] = inputTarget.value;
150
+ this.value = _classPrivateFieldGet(_valueArray, this).join("");
151
+ });
152
+ input.addEventListener("keydown", _ref2 => {
153
+ let {
154
+ key,
155
+ target
156
+ } = _ref2;
157
+ const inputTarget = target;
158
+ if (key === "Backspace" && inputTarget.value === "" && _classPrivateFieldGet(_refArray, this)[i - 1] !== undefined) {
159
+ _classPrivateFieldGet(_refArray, this)[i - 1].focus();
160
+ }
161
+ });
162
+ input.addEventListener("paste", _ref3 => {
163
+ let {
164
+ clipboardData
165
+ } = _ref3;
166
+ const pastedData = clipboardData.getData("Text");
167
+ let k = 0;
168
+ for (let j = i; j < this.length; j++) {
169
+ _classPrivateFieldGet(_valueArray, this)[j] = pastedData.split("")[k];
170
+ _classPrivateFieldGet(_refArray, this)[j].focus();
171
+ k = k + 1;
216
172
  }
173
+ this.value = _classPrivateFieldGet(_valueArray, this).join("");
174
+ });
175
+ if (this.lightDom) {
176
+ this.appendChild(input);
177
+ } else {
178
+ this.shadowRoot.appendChild(input);
217
179
  }
218
- disconnectedCallback() {
219
- this.#unobserve();
180
+ }
181
+ function _initDom() {
182
+ this.value = this.getAttribute("value") || "";
183
+ this.length = getLength(this);
184
+ if (this.lightDom) {
185
+ this.innerHTML = _classPrivateFieldGet(_styling, this);
186
+ this.addEventListener("focus", this.onFocus);
187
+ } else {
188
+ this.shadowRoot.innerHTML = _classPrivateFieldGet(_styling, this);
189
+ this.shadowRoot.addEventListener("focus", this.onFocus);
190
+ }
191
+ _classPrivateFieldSet(_valueArray, this, this.value.split(""));
192
+ _classPrivateFieldSet(_refArray, this, []);
193
+ for (let i = 0; i < this.length; i++) {
194
+ _assertClassBrand(_InputSplitted_brand, this, _addInput).call(this, i);
220
195
  }
221
- static get formAssociated() {
222
- return true;
196
+ }
197
+ function _observe() {
198
+ // Observer prüft, ob sich HTML-Attribute geändert haben.
199
+ // Props-Änderungen werden ohne bemerkt.
200
+ _classPrivateFieldSet(_observer, this, _classPrivateFieldGet(_observer, this) || new MutationObserver(mutations => {
201
+ mutations.forEach(m => {
202
+ if (m.attributeName === "value") {
203
+ this.value = this.getAttribute("value") || this.value;
204
+ }
205
+ if (m.attributeName === "length") {
206
+ this.length = getLength(this);
207
+ }
208
+ if (m.attributeName === "control-class") {
209
+ this.controlClass = this.getAttribute("control-class") || this.controlClass;
210
+ }
211
+ if (m.attributeName === "control-1-id") {
212
+ this.control1Id = this.getAttribute("control-1-id") || this.control1Id;
213
+ }
214
+ if (m.attributeName === "light-dom") {
215
+ this.lightDom = this.getAttribute("light-dom") !== null;
216
+ }
217
+ });
218
+ }));
219
+ _classPrivateFieldGet(_observer, this).observe(this, {
220
+ attributeFilter: ["value", "length", "control-class", "control-1-id", "light-dom"],
221
+ attributeOldValue: true,
222
+ childList: true,
223
+ subtree: true
224
+ });
225
+ }
226
+ function _unobserve() {
227
+ if (_classPrivateFieldGet(_observer, this)) {
228
+ _classPrivateFieldGet(_observer, this).takeRecords();
229
+ _classPrivateFieldGet(_observer, this).disconnect();
223
230
  }
224
231
  }
225
232
  function getLength(element) {
@@ -1 +1 @@
1
- (()=>{"use strict";window.blueWeb=window.blueWeb||{},window.blueWeb.progress={progress:0},window.blueWeb.progress={...window.blueWeb.progress,start:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"blueWebProgress",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Loading data",t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fixed-top";const o="string"==typeof r||r instanceof String?document.querySelector(r.toString()):r;let i=document.getElementById(e);i||(i=document.createElement("div"),i.id=e,i.className=`progress ${t} rounded-0`,i.setAttribute("style","--bs-progress-height: 0.25rem"),i.setAttribute("role","progressbar"),i.setAttribute("aria-label",s),i.setAttribute("aria-valuemin","0"),i.setAttribute("aria-valuemax","100"),i.innerHTML='<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0%"></div>',o.appendChild(i));const n=i.querySelector(".progress-bar");if(n){window.blueWeb.progress.progress=0;var b=setInterval((function(){var e=5*Math.random();window.blueWeb.progress.progress+=e,window.blueWeb.progress.progress=Math.min(window.blueWeb.progress.progress,100),n.style.width=window.blueWeb.progress.progress+"%",i?.setAttribute("aria-valuenow",Math.round(window.blueWeb.progress.progress).toString()),window.blueWeb.progress.progress>=100&&clearInterval(b)}),200)}},stop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"blueWebProgress";const r=document.getElementById(e);r&&(window.blueWeb.progress.progress=100,setTimeout((()=>{r.remove()}),500))}},window.blueWeb.progress})();
1
+ (()=>{"use strict";function e(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function r(r){for(var o=1;o<arguments.length;o++){var n=null!=arguments[o]?arguments[o]:{};o%2?e(Object(n),!0).forEach(function(e){t(r,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach(function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(n,e))})}return r}function t(e,r,t){return(r=function(e){var r=function(e){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var t=r.call(e,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof r?r:r+""}(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}window.blueWeb=window.blueWeb||{},window.blueWeb.progress={progress:0},window.blueWeb.progress=r(r({},window.blueWeb.progress),{},{start:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"blueWebProgress",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.body,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Loading data",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"fixed-top";const n="string"==typeof r||r instanceof String?document.querySelector(r.toString()):r;let s=document.getElementById(e);s||(s=document.createElement("div"),s.id=e,s.className="progress ".concat(o," rounded-0"),s.setAttribute("style","--bs-progress-height: 0.25rem"),s.setAttribute("role","progressbar"),s.setAttribute("aria-label",t),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100"),s.innerHTML='<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0%"></div>',n.appendChild(s));const i=s.querySelector(".progress-bar");if(i){window.blueWeb.progress.progress=0;var b=setInterval(function(){var e,r=5*Math.random();window.blueWeb.progress.progress+=r,window.blueWeb.progress.progress=Math.min(window.blueWeb.progress.progress,100),i.style.width=window.blueWeb.progress.progress+"%",null===(e=s)||void 0===e||e.setAttribute("aria-valuenow",Math.round(window.blueWeb.progress.progress).toString()),window.blueWeb.progress.progress>=100&&clearInterval(b)},200)}},stop:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"blueWebProgress";const r=document.getElementById(e);r&&(window.blueWeb.progress.progress=100,setTimeout(()=>{r.remove()},500))}}),window.blueWeb.progress})();
@@ -1,9 +1,13 @@
1
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
3
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
6
  window.blueWeb = window.blueWeb || {};
2
7
  window.blueWeb.progress = {
3
8
  progress: 0
4
9
  };
5
- window.blueWeb.progress = {
6
- ...window.blueWeb.progress,
10
+ window.blueWeb.progress = _objectSpread(_objectSpread({}, window.blueWeb.progress), {}, {
7
11
  start: function () {
8
12
  let id = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "blueWebProgress";
9
13
  let parent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.body;
@@ -14,19 +18,20 @@ window.blueWeb.progress = {
14
18
  if (!progressEl) {
15
19
  progressEl = document.createElement("div");
16
20
  progressEl.id = id;
17
- progressEl.className = `progress ${positionClass} rounded-0`;
21
+ progressEl.className = "progress ".concat(positionClass, " rounded-0");
18
22
  progressEl.setAttribute("style", "--bs-progress-height: 0.25rem");
19
23
  progressEl.setAttribute("role", "progressbar");
20
24
  progressEl.setAttribute("aria-label", ariaLabel);
21
25
  progressEl.setAttribute("aria-valuemin", "0");
22
26
  progressEl.setAttribute("aria-valuemax", "100");
23
- progressEl.innerHTML = /*html*/`<div class="progress-bar progress-bar-striped progress-bar-animated" style="width: 0%"></div>`;
27
+ progressEl.innerHTML = /*html*/"<div class=\"progress-bar progress-bar-striped progress-bar-animated\" style=\"width: 0%\"></div>";
24
28
  parentEl.appendChild(progressEl);
25
29
  }
26
30
  const progressBar = progressEl.querySelector(".progress-bar");
27
31
  if (!progressBar) return;
28
32
  window.blueWeb.progress.progress = 0;
29
33
  var interval = setInterval(function () {
34
+ var _progressEl;
30
35
  // Simuliere einen natürlichen Anstieg
31
36
  var increment = Math.random() * 5; // Zufälliger Anstieg zwischen 0 und 5
32
37
  window.blueWeb.progress.progress += increment;
@@ -34,7 +39,7 @@ window.blueWeb.progress = {
34
39
 
35
40
  // Aktualisiere die Progressbar
36
41
  progressBar.style.width = window.blueWeb.progress.progress + "%";
37
- progressEl?.setAttribute("aria-valuenow", Math.round(window.blueWeb.progress.progress).toString());
42
+ (_progressEl = progressEl) === null || _progressEl === void 0 || _progressEl.setAttribute("aria-valuenow", Math.round(window.blueWeb.progress.progress).toString());
38
43
 
39
44
  // Stoppe das Intervall, wenn 100% erreicht sind
40
45
  if (window.blueWeb.progress.progress >= 100) {
@@ -51,5 +56,5 @@ window.blueWeb.progress = {
51
56
  progressEl.remove();
52
57
  }, 500);
53
58
  }
54
- };
59
+ });
55
60
  export default window.blueWeb.progress;
@@ -1 +1 @@
1
- (()=>{"use strict";class t extends HTMLElement{startX=0;startY=0;constructor(){super(),this.attachShadow({mode:"open"})}static get observedAttributes(){return["disabled"]}connectedCallback(){this.render()}attributeChangedCallback(t,e,n){"disabled"===t&&this.updateDisabledState()}render(){this.shadowRoot&&(this.shadowRoot.innerHTML='\n <style>\n button {\n display: block;\n margin: 0;\n padding: 0;\n appearance: none;\n background-color: transparent;\n border: none;\n line-height: 1;\n outline: 0;\n }\n\n button:focus-visible + div {\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 25%);\n border-color: rgba(var(--bs-primary-rgb), 50%);\n }\n\n div {\n display: inline-block;\n box-sizing: border-box;\n width: auto;\n max-width: 100%;\n border-color: transparent;\n border-radius: var(--bs-border-radius-sm, 3px);\n border: 1px solid transparent;\n transition: background 0.2s;\n }\n\n div:hover {\n background-color: var(--bs-secondary-bg-subtle);\n }\n\n :host([disabled]) div {\n background-color: transparent;\n }\n </style>\n <button aria-label="Edit"></button>\n <div role="presentation">\n <slot></slot>\n </div>\n ',this.button=this.shadowRoot.querySelector("button"),this.container=this.shadowRoot.querySelector("div"),this.button.addEventListener("click",this.onEditRequested.bind(this)),this.container.addEventListener("click",this.onReadViewClick.bind(this)),this.container.addEventListener("mousedown",this.onMouseDown.bind(this)),this.updateDisabledState())}updateDisabledState(){const t=this.hasAttribute("disabled");this.button?.setAttribute("aria-disabled",String(t)),this.container?.setAttribute("aria-disabled",String(t))}onEditRequested(){this.hasAttribute("disabled")||this.dispatchEvent(new CustomEvent("EditRequested",{bubbles:!0,composed:!0}))}onMouseDown(t){this.hasAttribute("disabled")||(this.startX=t.clientX,this.startY=t.clientY)}mouseHasMovedAfterMouseDown(t){return Math.abs(this.startX-t.clientX)>=5||Math.abs(this.startY-t.clientY)>=5}onReadViewClick(t){this.hasAttribute("disabled")||"a"===t.target.tagName.toLowerCase()||this.mouseHasMovedAfterMouseDown(t)||(t.preventDefault(),this.onEditRequested())}}customElements.define("bl-read-view",t)})();
1
+ (()=>{"use strict";var t={};function e(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}t.d=(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);class n extends HTMLElement{constructor(){super(),e(this,"startX",0),e(this,"startY",0),this.attachShadow({mode:"open"})}static get observedAttributes(){return["disabled"]}connectedCallback(){this.render()}attributeChangedCallback(t,e,n){"disabled"===t&&this.updateDisabledState()}render(){this.shadowRoot&&(this.shadowRoot.innerHTML='\n <style>\n button {\n display: block;\n margin: 0;\n padding: 0;\n appearance: none;\n background-color: transparent;\n border: none;\n line-height: 1;\n outline: 0;\n }\n\n button:focus-visible + div {\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 25%);\n border-color: rgba(var(--bs-primary-rgb), 50%);\n }\n\n div {\n display: inline-block;\n box-sizing: border-box;\n width: auto;\n max-width: 100%;\n border-color: transparent;\n border-radius: var(--bs-border-radius-sm, 3px);\n border: 1px solid transparent;\n transition: background 0.2s;\n }\n\n div:hover {\n background-color: var(--bs-secondary-bg-subtle);\n }\n\n :host([disabled]) div {\n background-color: transparent;\n }\n </style>\n <button aria-label="Edit"></button>\n <div role="presentation">\n <slot></slot>\n </div>\n ',this.button=this.shadowRoot.querySelector("button"),this.container=this.shadowRoot.querySelector("div"),this.button.addEventListener("click",this.onEditRequested.bind(this)),this.container.addEventListener("click",this.onReadViewClick.bind(this)),this.container.addEventListener("mousedown",this.onMouseDown.bind(this)),this.updateDisabledState())}updateDisabledState(){var t,e;const n=this.hasAttribute("disabled");null===(t=this.button)||void 0===t||t.setAttribute("aria-disabled",String(n)),null===(e=this.container)||void 0===e||e.setAttribute("aria-disabled",String(n))}onEditRequested(){this.hasAttribute("disabled")||this.dispatchEvent(new CustomEvent("EditRequested",{bubbles:!0,composed:!0}))}onMouseDown(t){this.hasAttribute("disabled")||(this.startX=t.clientX,this.startY=t.clientY)}mouseHasMovedAfterMouseDown(t){return Math.abs(this.startX-t.clientX)>=5||Math.abs(this.startY-t.clientY)>=5}onReadViewClick(t){this.hasAttribute("disabled")||"a"===t.target.tagName.toLowerCase()||this.mouseHasMovedAfterMouseDown(t)||(t.preventDefault(),this.onEditRequested())}}customElements.define("bl-read-view",n)})();
@@ -1,3 +1,6 @@
1
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
+ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
1
4
  const DRAG_THRESHOLD = 5;
2
5
 
3
6
  /**
@@ -20,10 +23,10 @@ const DRAG_THRESHOLD = 5;
20
23
  * })
21
24
  */
22
25
  export class ReadView extends HTMLElement {
23
- startX = 0;
24
- startY = 0;
25
26
  constructor() {
26
27
  super();
28
+ _defineProperty(this, "startX", 0);
29
+ _defineProperty(this, "startY", 0);
27
30
  this.attachShadow({
28
31
  mode: "open"
29
32
  });
@@ -41,49 +44,7 @@ export class ReadView extends HTMLElement {
41
44
  }
42
45
  render() {
43
46
  if (!this.shadowRoot) return;
44
- this.shadowRoot.innerHTML = /* HTML */`
45
- <style>
46
- button {
47
- display: block;
48
- margin: 0;
49
- padding: 0;
50
- appearance: none;
51
- background-color: transparent;
52
- border: none;
53
- line-height: 1;
54
- outline: 0;
55
- }
56
-
57
- button:focus-visible + div {
58
- outline: 0;
59
- box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 25%);
60
- border-color: rgba(var(--bs-primary-rgb), 50%);
61
- }
62
-
63
- div {
64
- display: inline-block;
65
- box-sizing: border-box;
66
- width: auto;
67
- max-width: 100%;
68
- border-color: transparent;
69
- border-radius: var(--bs-border-radius-sm, 3px);
70
- border: 1px solid transparent;
71
- transition: background 0.2s;
72
- }
73
-
74
- div:hover {
75
- background-color: var(--bs-secondary-bg-subtle);
76
- }
77
-
78
- :host([disabled]) div {
79
- background-color: transparent;
80
- }
81
- </style>
82
- <button aria-label="Edit"></button>
83
- <div role="presentation">
84
- <slot></slot>
85
- </div>
86
- `;
47
+ this.shadowRoot.innerHTML = /* HTML */"\n <style>\n button {\n display: block;\n margin: 0;\n padding: 0;\n appearance: none;\n background-color: transparent;\n border: none;\n line-height: 1;\n outline: 0;\n }\n\n button:focus-visible + div {\n outline: 0;\n box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 25%);\n border-color: rgba(var(--bs-primary-rgb), 50%);\n }\n\n div {\n display: inline-block;\n box-sizing: border-box;\n width: auto;\n max-width: 100%;\n border-color: transparent;\n border-radius: var(--bs-border-radius-sm, 3px);\n border: 1px solid transparent;\n transition: background 0.2s;\n }\n\n div:hover {\n background-color: var(--bs-secondary-bg-subtle);\n }\n\n :host([disabled]) div {\n background-color: transparent;\n }\n </style>\n <button aria-label=\"Edit\"></button>\n <div role=\"presentation\">\n <slot></slot>\n </div>\n ";
87
48
  this.button = this.shadowRoot.querySelector("button");
88
49
  this.container = this.shadowRoot.querySelector("div");
89
50
  this.button.addEventListener("click", this.onEditRequested.bind(this));
@@ -92,9 +53,10 @@ export class ReadView extends HTMLElement {
92
53
  this.updateDisabledState();
93
54
  }
94
55
  updateDisabledState() {
56
+ var _this$button, _this$container;
95
57
  const isDisabled = this.hasAttribute("disabled");
96
- this.button?.setAttribute("aria-disabled", String(isDisabled));
97
- this.container?.setAttribute("aria-disabled", String(isDisabled));
58
+ (_this$button = this.button) === null || _this$button === void 0 || _this$button.setAttribute("aria-disabled", String(isDisabled));
59
+ (_this$container = this.container) === null || _this$container === void 0 || _this$container.setAttribute("aria-disabled", String(isDisabled));
98
60
  }
99
61
  onEditRequested() {
100
62
  if (this.hasAttribute("disabled")) return;
@@ -1 +1 @@
1
- (()=>{"use strict";class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML='<slot style="border-radius: inherit"></slot>',this.activeIndex=-1,this.items=[],this.inputElement=null}connectedCallback(){this.setAttribute("role","listbox"),this.tabIndex=-1,this.updateItems();const t=this.getAttribute("for");this.inputElement=t?document.getElementById(t):null,this.inputElement&&(this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-controls",this.id),this.inputElement.setAttribute("aria-expanded","true"),this.inputElement.addEventListener("keydown",this.onKeyDown.bind(this))),this.addEventListener("keydown",this.onKeyDown.bind(this)),this.addEventListener("click",(t=>{const e=t.target instanceof Element?t.target.closest("[data-blue-select-list-index]"):null;if(e&&e.hasAttribute("data-blue-select-list-index")){const t=Number(e.getAttribute("data-blue-select-list-index"));this.select(t)}}))}updateItems(){this.items=Array.from(this.children),this.items.forEach(((t,e)=>{t.hasAttribute("id")||t.setAttribute("id",`${this.id}-option-${e}`),t.setAttribute("data-blue-select-list-index",e.toString()),t.setAttribute("aria-selected","false"),t.setAttribute("role","option"),t.tabIndex=-1}))}onKeyDown(t){if(console.log("select-list onKeyDown"),this.items.length)if("ArrowDown"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.items.length,this.updateActiveItem();else if("ArrowUp"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length,this.updateActiveItem();else if("Enter"===t.key&&this.activeIndex>=0){const t=this.items[this.activeIndex];t?.click()}}updateActiveItem(){this.items.forEach(((t,e)=>{const i=e===this.activeIndex;t.classList.toggle("active",i),t.setAttribute("aria-selected",i.toString())}));const t=this.items[this.activeIndex];t&&this.inputElement&&(this.inputElement.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"}))}select(t){this.activeIndex=t,this.updateActiveItem();const e=this.items[t];e&&(this.dispatchEvent(new CustomEvent("bl-select",{detail:{index:t,item:e},bubbles:!0,composed:!0})),e.click())}}customElements.define("bl-select-list",t)})();
1
+ (()=>{"use strict";class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML='<slot style="border-radius: inherit"></slot>',this.activeIndex=-1,this.items=[],this.inputElement=null}connectedCallback(){this.setAttribute("role","listbox"),this.tabIndex=-1,this.updateItems();const t=this.getAttribute("for");this.inputElement=t?document.getElementById(t):null,this.inputElement&&(this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-controls",this.id),this.inputElement.setAttribute("aria-expanded","true"),this.inputElement.addEventListener("keydown",this.onKeyDown.bind(this))),this.addEventListener("keydown",this.onKeyDown.bind(this)),this.addEventListener("click",t=>{const e=t.target instanceof Element?t.target.closest("[data-blue-select-list-index]"):null;if(e&&e.hasAttribute("data-blue-select-list-index")){const t=Number(e.getAttribute("data-blue-select-list-index"));this.select(t)}})}updateItems(){this.items=Array.from(this.children),this.items.forEach((t,e)=>{t.hasAttribute("id")||t.setAttribute("id","".concat(this.id,"-option-").concat(e)),t.setAttribute("data-blue-select-list-index",e.toString()),t.setAttribute("aria-selected","false"),t.setAttribute("role","option"),t.tabIndex=-1})}onKeyDown(t){if(console.log("select-list onKeyDown"),this.items.length)if("ArrowDown"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.items.length,this.updateActiveItem();else if("ArrowUp"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length,this.updateActiveItem();else if("Enter"===t.key&&this.activeIndex>=0){const t=this.items[this.activeIndex];null==t||t.click()}}updateActiveItem(){this.items.forEach((t,e)=>{const i=e===this.activeIndex;t.classList.toggle("active",i),t.setAttribute("aria-selected",i.toString())});const t=this.items[this.activeIndex];t&&this.inputElement&&(this.inputElement.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"}))}select(t){this.activeIndex=t,this.updateActiveItem();const e=this.items[t];e&&(this.dispatchEvent(new CustomEvent("bl-select",{detail:{index:t,item:e},bubbles:!0,composed:!0})),e.click())}}customElements.define("bl-select-list",t)})();
@@ -21,7 +21,7 @@ export class SelectList extends HTMLElement {
21
21
  this.attachShadow({
22
22
  mode: "open"
23
23
  });
24
- this.shadowRoot.innerHTML = `<slot style="border-radius: inherit"></slot>`;
24
+ this.shadowRoot.innerHTML = "<slot style=\"border-radius: inherit\"></slot>";
25
25
  this.activeIndex = -1;
26
26
  this.items = [];
27
27
  this.inputElement = null;
@@ -53,7 +53,7 @@ export class SelectList extends HTMLElement {
53
53
  this.items = Array.from(this.children);
54
54
  this.items.forEach((el, i) => {
55
55
  if (!el.hasAttribute("id")) {
56
- el.setAttribute("id", `${this.id}-option-${i}`);
56
+ el.setAttribute("id", "".concat(this.id, "-option-").concat(i));
57
57
  }
58
58
  el.setAttribute("data-blue-select-list-index", i.toString());
59
59
  el.setAttribute("aria-selected", "false");
@@ -74,7 +74,7 @@ export class SelectList extends HTMLElement {
74
74
  this.updateActiveItem();
75
75
  } else if (e.key === "Enter" && this.activeIndex >= 0) {
76
76
  const item = this.items[this.activeIndex];
77
- item?.click();
77
+ item === null || item === void 0 || item.click();
78
78
  }
79
79
  }
80
80
  updateActiveItem() {
@@ -1 +1 @@
1
- (()=>{"use strict";class n extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.addEventListeners()}render(){if(!this.shadowRoot)return;const n=(document.documentElement.lang||navigator.language).startsWith("de")?"Seitenleiste umschalten":"Toggle sidebar";this.shadowRoot.innerHTML=`\n <style>\n :host {\n --spacing: 0.25rem;\n --drawer-side-shadow:\n rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,\n rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,\n rgba(0, 0, 0, 0.25) 0px 25px 50px -12px;\n --toggler-size: calc(\n var(--bs-btn-border-width, 1px) + var(--bs-btn-padding-y, 0.375rem) +\n (var(--bs-btn-font-size, 1rem) * var(--bs-btn-line-height, 1.5)) +\n var(--bs-btn-padding-y, 0.375rem) + var(--bs-btn-border-width, 1px)\n );\n --side-width: 18rem;\n --base-z-index: 0;\n }\n\n .root {\n position: relative;\n display: grid;\n height: 100%;\n grid-template-columns:\n 0 var(--toggler-size) calc(var(--side-width) - var(--toggler-size))\n auto;\n grid-template-rows: var(--toggler-size) auto;\n }\n\n .hidden-input {\n position: fixed;\n --size: 0;\n height: var(--size);\n width: var(--size);\n appearance: none;\n opacity: 0;\n }\n\n .toggler {\n grid-column-start: 2;\n }\n\n .hidden-input:focus-visible + .toggler ::slotted(*) {\n --trigger-box-shadow: var(--trigger-focus-box-shadow, inset 0 0 0.25rem);\n }\n\n @media (width < 64rem) {\n .toggler[for="layout-expand"] {\n display: none;\n }\n }\n\n @media (width >= 64rem) {\n .toggler[for="layout-drawer"] {\n display: none;\n }\n }\n\n .header {\n grid-column-start: 3;\n grid-column-end: 5;\n }\n\n .side {\n overflow: auto;\n }\n\n @media (width < 64rem) {\n .side {\n translate: -100% 0;\n height: 100%;\n transition: translate 0.2s ease;\n }\n\n #layout-drawer:checked ~ .side {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(var(--base-z-index) + 1);\n translate: 0;\n width: calc(var(--spacing) * 80);\n box-shadow: var(--drawer-side-shadow);\n }\n }\n\n @media (width >= 64rem) {\n #layout-expand:checked ~ .side {\n grid-column-start: 2;\n grid-column-end: 4;\n }\n }\n\n .main {\n overflow: auto;\n grid-column-start: 2;\n grid-column-end: 5;\n }\n\n @media (width >= 64rem) {\n #layout-expand:checked ~ .main {\n grid-column-start: 4;\n }\n }\n\n .overlay {\n position: fixed;\n z-index: var(--base-z-index);\n inset: 0;\n display: none;\n }\n\n @media (width < 64rem) {\n #layout-drawer:checked ~ .overlay {\n display: block;\n }\n }\n </style>\n\n <div class="root">\n <input\n id="layout-expand"\n type="checkbox"\n class="hidden-input"\n ${localStorage.getItem("side-layout-shrink")?"":"checked"}\n />\n <label class="toggler" for="layout-expand" title="${n}" role="button">\n <slot name="expand-toggler">🍔</slot>\n </label>\n\n <input id="layout-drawer" type="checkbox" class="hidden-input" />\n <label class="toggler" for="layout-drawer" title="${n}" role="button">\n <slot name="drawer-toggler">🍔</slot>\n </label>\n\n <header class="header"><slot name="header"></slot></header>\n <div class="side"><slot name="side"></slot></div>\n <main class="main"><slot></slot></main>\n <label aria-label="Close sidebar" for="layout-drawer" class="overlay"\n ><slot name="overlay"></slot\n ></label>\n </div>\n `}addEventListeners(){this.shadowRoot&&this.shadowRoot.querySelector("#layout-expand").addEventListener("change",this.handleLayoutExpandChange.bind(this))}handleLayoutExpandChange(n){n.target.checked?localStorage.removeItem("side-layout-shrink"):localStorage.setItem("side-layout-shrink","true")}}customElements.define("bl-side-layout",n)})();
1
+ (()=>{"use strict";class n extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"})}connectedCallback(){this.render(),this.addEventListeners()}render(){if(!this.shadowRoot)return;const n=(document.documentElement.lang||navigator.language).startsWith("de")?"Seitenleiste umschalten":"Toggle sidebar";this.shadowRoot.innerHTML='\n <style>\n :host {\n --spacing: 0.25rem;\n --drawer-side-shadow:\n rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,\n rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,\n rgba(0, 0, 0, 0.25) 0px 25px 50px -12px;\n --toggler-size: calc(\n var(--bs-btn-border-width, 1px) + var(--bs-btn-padding-y, 0.375rem) +\n (var(--bs-btn-font-size, 1rem) * var(--bs-btn-line-height, 1.5)) +\n var(--bs-btn-padding-y, 0.375rem) + var(--bs-btn-border-width, 1px)\n );\n --side-width: 18rem;\n --base-z-index: 0;\n }\n\n .root {\n position: relative;\n display: grid;\n height: 100%;\n grid-template-columns:\n 0 var(--toggler-size) calc(var(--side-width) - var(--toggler-size))\n auto;\n grid-template-rows: var(--toggler-size) auto;\n }\n\n .hidden-input {\n position: fixed;\n --size: 0;\n height: var(--size);\n width: var(--size);\n appearance: none;\n opacity: 0;\n }\n\n .toggler {\n grid-column-start: 2;\n }\n\n .hidden-input:focus-visible + .toggler ::slotted(*) {\n --trigger-box-shadow: var(--trigger-focus-box-shadow, inset 0 0 0.25rem);\n }\n\n @media (width < 64rem) {\n .toggler[for="layout-expand"] {\n display: none;\n }\n }\n\n @media (width >= 64rem) {\n .toggler[for="layout-drawer"] {\n display: none;\n }\n }\n\n .header {\n grid-column-start: 3;\n grid-column-end: 5;\n }\n\n .side {\n overflow: auto;\n }\n\n @media (width < 64rem) {\n .side {\n translate: -100% 0;\n height: 100%;\n transition: translate 0.2s ease;\n }\n\n #layout-drawer:checked ~ .side {\n position: fixed;\n top: 0;\n left: 0;\n z-index: calc(var(--base-z-index) + 1);\n translate: 0;\n width: calc(var(--spacing) * 80);\n box-shadow: var(--drawer-side-shadow);\n }\n }\n\n @media (width >= 64rem) {\n #layout-expand:checked ~ .side {\n grid-column-start: 2;\n grid-column-end: 4;\n }\n }\n\n .main {\n overflow: auto;\n grid-column-start: 2;\n grid-column-end: 5;\n }\n\n @media (width >= 64rem) {\n #layout-expand:checked ~ .main {\n grid-column-start: 4;\n }\n }\n\n .overlay {\n position: fixed;\n z-index: var(--base-z-index);\n inset: 0;\n display: none;\n }\n\n @media (width < 64rem) {\n #layout-drawer:checked ~ .overlay {\n display: block;\n }\n }\n </style>\n\n <div class="root">\n <input\n id="layout-expand"\n type="checkbox"\n class="hidden-input"\n '.concat(localStorage.getItem("side-layout-shrink")?"":"checked",'\n />\n <label class="toggler" for="layout-expand" title="').concat(n,'" role="button">\n <slot name="expand-toggler">🍔</slot>\n </label>\n\n <input id="layout-drawer" type="checkbox" class="hidden-input" />\n <label class="toggler" for="layout-drawer" title="').concat(n,'" role="button">\n <slot name="drawer-toggler">🍔</slot>\n </label>\n\n <header class="header"><slot name="header"></slot></header>\n <div class="side"><slot name="side"></slot></div>\n <main class="main"><slot></slot></main>\n <label aria-label="Close sidebar" for="layout-drawer" class="overlay"\n ><slot name="overlay"></slot\n ></label>\n </div>\n ')}addEventListeners(){this.shadowRoot&&this.shadowRoot.querySelector("#layout-expand").addEventListener("change",this.handleLayoutExpandChange.bind(this))}handleLayoutExpandChange(n){n.target.checked?localStorage.removeItem("side-layout-shrink"):localStorage.setItem("side-layout-shrink","true")}}customElements.define("bl-side-layout",n)})();