blue-web 1.16.0 → 1.17.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.
@@ -1 +1 @@
1
- (()=>{"use strict";window.blueWeb=window.blueWeb||{},window.blueWeb.actions={init:function(e){let i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;function n(){for(const e of i.children)e.style.display="none";for(const e of t.children)e.style.display="",e.classList.add("BLUE-actions-collapse-visible");let n=0;for(const s of i.children){if(s.style.display="",t.children[n].style.display="none",t.children[n].classList.remove("BLUE-actions-collapse-visible"),e.scrollWidth>e.clientWidth){s.style.display="none",t.children[n].style.display="",t.children[n].classList.add("BLUE-actions-collapse-visible");break}n++}}i||(i=e.querySelector(".BLUE-actions-menu")),t||(t=e.querySelector(".BLUE-actions-collapse-menu")),n();const s=new ResizeObserver((()=>{requestAnimationFrame(n)}));s.observe(e);const l=i=>{if(!e)return;const t=e.querySelectorAll("details[open]");!t||t.length<=0||t.forEach((e=>{e.contains(i.target)||e.removeAttribute("open")}))};return document.addEventListener("click",l),{updateActions:n,resizeObserver:s,destroy(){s.disconnect(),document.removeEventListener("click",l)}}}}})();
1
+ (()=>{"use strict";window.blueWeb=window.blueWeb||{},window.blueWeb.actions={init:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;function s(){for(const e of t.children)e.style.display="none";for(const e of i.children)e.style.display="",e.classList.add("BLUE-actions-collapse-visible");let s=0;for(const n of t.children){if(n.style.display="",i.children[s].style.display="none",i.children[s].classList.remove("BLUE-actions-collapse-visible"),e.scrollWidth>e.clientWidth){n.style.display="none",i.children[s].style.display="",i.children[s].classList.add("BLUE-actions-collapse-visible");break}s++}}t||(t=e.querySelector(".BLUE-actions-menu")),i||(i=e.querySelector(".BLUE-actions-collapse-menu")),s();const n=()=>{requestAnimationFrame(s)},o=new ResizeObserver(n);o.observe(e);const l=new MutationObserver(n);l.observe(e,{attributes:!1,childList:!0,subtree:!0});const c=t=>{if(!e)return;const i=e.querySelectorAll("details[open]");!i||i.length<=0||i.forEach((e=>{e.contains(t.target)||e.removeAttribute("open")}))};return document.addEventListener("click",c),{updateActions:s,resizeObserver:o,mutationObserver:l,destroy(){o.disconnect(),l.disconnect(),document.removeEventListener("click",c)}}}}})();
@@ -1,5 +1,6 @@
1
1
  export declare function init(actionsElement: HTMLElement, menu?: HTMLElement | undefined, collapseMenu?: HTMLElement | undefined): {
2
2
  updateActions: () => void;
3
3
  resizeObserver: ResizeObserver;
4
+ mutationObserver: MutationObserver;
4
5
  destroy(): void;
5
6
  };
@@ -31,10 +31,17 @@ export function init(actionsElement) {
31
31
  }
32
32
  }
33
33
  updateActions();
34
- const resizeObserver = new ResizeObserver(() => {
34
+ const callback = () => {
35
35
  requestAnimationFrame(updateActions);
36
- });
36
+ };
37
+ const resizeObserver = new ResizeObserver(callback);
37
38
  resizeObserver.observe(actionsElement);
39
+ const mutationObserver = new MutationObserver(callback);
40
+ mutationObserver.observe(actionsElement, {
41
+ attributes: false,
42
+ childList: true,
43
+ subtree: true
44
+ });
38
45
  const outsideClickHandler = event => {
39
46
  if (!actionsElement) return;
40
47
  const openDetails = actionsElement.querySelectorAll("details[open]");
@@ -49,8 +56,10 @@ export function init(actionsElement) {
49
56
  return {
50
57
  updateActions,
51
58
  resizeObserver,
59
+ mutationObserver,
52
60
  destroy() {
53
61
  resizeObserver.disconnect();
62
+ mutationObserver.disconnect();
54
63
  document.removeEventListener("click", outsideClickHandler);
55
64
  }
56
65
  };
@@ -0,0 +1 @@
1
+ (()=>{"use strict";class t extends HTMLElement{#t;#e=[];#s=[];#i=!1;get lightDom(){return this.#i}set lightDom(t){this.#i=t,!0===this.lightDom?this.innerHTML=this.#r:(this.shadowRoot||this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot.innerHTML=this.#r),this.#l()}#h="";get value(){return this.#h}set value(t){const e=this.#h;this.#h=t,this.#e=this.value.split("");for(let t=0;t<this.length;t++)this.#s[t]&&(this.#s[t].value=this.#e[t]||"");e!==t&&this.dispatchEvent(new CustomEvent("changeValue",{bubbles:!0,detail:t}))}#o=0;get length(){return this.#o}set length(t){if(this.#o=t,this.length>this.#s.length)for(let t=0;t<this.length;t++)!this.#s[t]&&this.didInit&&this.#n(this.#s.length);else if(this.length<this.#s.length){const t=Math.abs(this.#s.length-this.length);for(let e=0;e<t;e++){const t=this.#s.pop();t?.remove()}}this.#s=[...this.#s]}#a="";get controlClass(){return this.#a}set controlClass(t){this.#a=t;for(const t of this.#s)t.className=this.controlClass}#u="";get control1Id(){return this.#u}set control1Id(t){this.#u=t,this.#s[0]&&(this.#s[0].id=this.control1Id)}#r="<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>";didInit=!1;constructor(){super(),this.onFocus=this.onFocus.bind(this)}connectedCallback(){this.didInit=!0,this.lightDom=null!==this.getAttribute("light-dom"),this.#l(),this.value=this.getAttribute("value")||this.value,this.length=e(this),this.controlClass=this.getAttribute("control-class")||this.controlClass,this.control1Id=this.getAttribute("control-1-id")||this.control1Id,this.#d()}#n(t){const e=document.createElement("input");this.#s.push(e),e.type="text",e.className=this.controlClass,0===t&&(e.id=this.control1Id),e.maxLength=1,e.value=this.#e[t]||"",e.addEventListener("input",(e=>{let{target:s}=e;const i=s;""!==i.value&&this.#s[t+1]&&this.#s[t+1].focus(),this.#e[t]=i.value,this.value=this.#e.join("")})),e.addEventListener("keydown",(e=>{let{key:s,target:i}=e;"Backspace"===s&&""===i.value&&void 0!==this.#s[t-1]&&this.#s[t-1].focus()})),e.addEventListener("paste",(e=>{let{clipboardData:s}=e;const i=s.getData("Text");let r=0;for(let e=t;e<this.length;e++)this.#e[e]=i.split("")[r],this.#s[e].focus(),r+=1;this.value=this.#e.join("")})),this.lightDom?this.appendChild(e):this.shadowRoot.appendChild(e)}onFocus(){this.#s[0]&&this.#s[0].focus()}#l(){this.value=this.getAttribute("value")||"",this.length=e(this),this.lightDom?(this.innerHTML=this.#r,this.addEventListener("focus",this.onFocus)):(this.shadowRoot.innerHTML=this.#r,this.shadowRoot.addEventListener("focus",this.onFocus)),this.#e=this.value.split(""),this.#s=[];for(let t=0;t<this.length;t++)this.#n(t)}#d(){this.#t=this.#t||new MutationObserver((t=>{t.forEach((t=>{"value"===t.attributeName&&(this.value=this.getAttribute("value")||this.value),"length"===t.attributeName&&(this.length=e(this)),"control-class"===t.attributeName&&(this.controlClass=this.getAttribute("control-class")||this.controlClass),"control-1-id"===t.attributeName&&(this.control1Id=this.getAttribute("control-1-id")||this.control1Id),"light-dom"===t.attributeName&&(this.lightDom=null!==this.getAttribute("light-dom"))}))})),this.#t.observe(this,{attributeFilter:["value","length","control-class","control-1-id","light-dom"],attributeOldValue:!0,childList:!0,subtree:!0})}#c(){this.#t&&(this.#t.takeRecords(),this.#t.disconnect())}disconnectedCallback(){this.#c()}static get formAssociated(){return!0}}function e(t){const e=t.getAttribute("length");if(e)return parseInt(e)}customElements.define("bl-input-splitted",t)})();
@@ -0,0 +1,19 @@
1
+ export declare class InputSplitted extends HTMLElement {
2
+ #private;
3
+ get lightDom(): boolean;
4
+ set lightDom(_lightDom: boolean);
5
+ get value(): string;
6
+ set value(_value: string);
7
+ get length(): number;
8
+ set length(_length: number);
9
+ get controlClass(): string;
10
+ set controlClass(value: string);
11
+ get control1Id(): string;
12
+ set control1Id(value: string);
13
+ didInit: boolean;
14
+ constructor();
15
+ connectedCallback(): void;
16
+ onFocus(): void;
17
+ disconnectedCallback(): void;
18
+ static get formAssociated(): boolean;
19
+ }
@@ -0,0 +1,229 @@
1
+ export class InputSplitted extends HTMLElement {
2
+ #observer;
3
+ #valueArray = [];
4
+ #refArray = [];
5
+ #lightDom = false;
6
+ get lightDom() {
7
+ return this.#lightDom;
8
+ }
9
+ set lightDom(_lightDom) {
10
+ this.#lightDom = _lightDom;
11
+ if (this.lightDom === true) {
12
+ 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++) {
31
+ if (this.#refArray[i]) this.#refArray[i].value = this.#valueArray[i] || "";
32
+ }
33
+ if (oldValue !== _value) {
34
+ this.dispatchEvent(new CustomEvent("changeValue", {
35
+ bubbles: true,
36
+ detail: _value
37
+ }));
38
+ }
39
+ }
40
+ #length = 0;
41
+ get length() {
42
+ return this.#length;
43
+ }
44
+ set length(_length) {
45
+ this.#length = _length;
46
+ if (this.length > this.#refArray.length) {
47
+ // Added length
48
+
49
+ for (let j = 0; j < this.length; j++) {
50
+ if (!this.#refArray[j] && this.didInit) {
51
+ this.#addInput(this.#refArray.length);
52
+ }
53
+ }
54
+ } else if (this.length < this.#refArray.length) {
55
+ // Removed length
56
+
57
+ const difference = Math.abs(this.#refArray.length - this.length);
58
+ for (let j = 0; j < difference; j++) {
59
+ const el = this.#refArray.pop();
60
+ el?.remove();
61
+ }
62
+ }
63
+ this.#refArray = [...this.#refArray];
64
+ }
65
+ #controlClass = "";
66
+ get controlClass() {
67
+ return this.#controlClass;
68
+ }
69
+ set controlClass(value) {
70
+ this.#controlClass = value;
71
+ for (const el of this.#refArray) {
72
+ el.className = this.controlClass;
73
+ }
74
+ }
75
+ #control1Id = "";
76
+ get control1Id() {
77
+ return this.#control1Id;
78
+ }
79
+ set control1Id(value) {
80
+ this.#control1Id = value;
81
+ if (this.#refArray[0]) {
82
+ this.#refArray[0].id = this.control1Id;
83
+ }
84
+ }
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
+ constructor() {
101
+ super();
102
+ this.onFocus = this.onFocus.bind(this);
103
+ }
104
+ connectedCallback() {
105
+ this.didInit = true;
106
+ this.lightDom = this.getAttribute("light-dom") !== null;
107
+ this.#initDom();
108
+ this.value = this.getAttribute("value") || this.value;
109
+ this.length = getLength(this);
110
+ this.controlClass = this.getAttribute("control-class") || this.controlClass;
111
+ 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
+ }
163
+ }
164
+ onFocus() {
165
+ if (this.#refArray[0]) this.#refArray[0].focus();
166
+ }
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
+ }
182
+ }
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
+ });
211
+ }
212
+ #unobserve() {
213
+ if (this.#observer) {
214
+ this.#observer.takeRecords();
215
+ this.#observer.disconnect();
216
+ }
217
+ }
218
+ disconnectedCallback() {
219
+ this.#unobserve();
220
+ }
221
+ static get formAssociated() {
222
+ return true;
223
+ }
224
+ }
225
+ function getLength(element) {
226
+ const attr = element.getAttribute("length");
227
+ if (attr) return parseInt(attr);
228
+ }
229
+ customElements.define("bl-input-splitted", InputSplitted);
@@ -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("read-view",t)})();
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)})();
@@ -9,9 +9,9 @@
9
9
  * @cssprop --bs-border-radius-sm - The border radius for the read view.
10
10
  * @slot - The content to display in the read view.
11
11
  * @example
12
- * <read-view id="my-read-view" onEditRequested="setEditing(true)">
12
+ * <bl-read-view id="my-read-view" onEditRequested="setEditing(true)">
13
13
  * <a href="#">bla</a> {value}
14
- * </read-view>
14
+ * </bl-read-view>
15
15
  * @example
16
16
  * document.getElementById("my-read-view").addEventListener("EditRequested", () => {
17
17
  * setEditing(true)
@@ -11,9 +11,9 @@ const DRAG_THRESHOLD = 5;
11
11
  * @cssprop --bs-border-radius-sm - The border radius for the read view.
12
12
  * @slot - The content to display in the read view.
13
13
  * @example
14
- * <read-view id="my-read-view" onEditRequested="setEditing(true)">
14
+ * <bl-read-view id="my-read-view" onEditRequested="setEditing(true)">
15
15
  * <a href="#">bla</a> {value}
16
- * </read-view>
16
+ * </bl-read-view>
17
17
  * @example
18
18
  * document.getElementById("my-read-view").addEventListener("EditRequested", () => {
19
19
  * setEditing(true)
@@ -120,4 +120,4 @@ export class ReadView extends HTMLElement {
120
120
  }
121
121
  }
122
122
  }
123
- customElements.define("read-view", ReadView);
123
+ customElements.define("bl-read-view", ReadView);
@@ -0,0 +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-autocomplete","list"),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(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)})();
@@ -0,0 +1,30 @@
1
+ /**
2
+ * A Web Component that provides a keyboard-accessible selectable list, typically used for dropdowns or autocomplete lists.
3
+ * Supports keyboard navigation and selection, and integrates with an input element for combobox behavior.
4
+ *
5
+ * The Web Component will automatically set attributes for accessibility.
6
+ *
7
+ * @element blue-select-list
8
+ * @attr {string} for - The id of the input element to associate as the combobox controller.
9
+ * @slot - The list options.
10
+ * @example
11
+ * <input id="my-input" />
12
+ * <blue-select-list for="my-input">
13
+ * <div>Option 1</div>
14
+ * <div>Option 2</div>
15
+ * </blue-select-list>
16
+ */
17
+ export declare class SelectList extends HTMLElement {
18
+ activeIndex: number;
19
+ items: HTMLElement[];
20
+ inputElement: HTMLElement | null;
21
+ constructor();
22
+ connectedCallback(): void;
23
+ updateItems(): void;
24
+ onKeyDown(e: {
25
+ key: string;
26
+ preventDefault: () => void;
27
+ }): void;
28
+ updateActiveItem(): void;
29
+ select(index: number): void;
30
+ }
@@ -0,0 +1,111 @@
1
+ /**
2
+ * A Web Component that provides a keyboard-accessible selectable list, typically used for dropdowns or autocomplete lists.
3
+ * Supports keyboard navigation and selection, and integrates with an input element for combobox behavior.
4
+ *
5
+ * The Web Component will automatically set attributes for accessibility.
6
+ *
7
+ * @element blue-select-list
8
+ * @attr {string} for - The id of the input element to associate as the combobox controller.
9
+ * @slot - The list options.
10
+ * @example
11
+ * <input id="my-input" />
12
+ * <blue-select-list for="my-input">
13
+ * <div>Option 1</div>
14
+ * <div>Option 2</div>
15
+ * </blue-select-list>
16
+ */
17
+ export class SelectList extends HTMLElement {
18
+ constructor() {
19
+ super();
20
+ this.attachShadow({
21
+ mode: "open"
22
+ });
23
+ this.shadowRoot.innerHTML = `<slot style="border-radius: inherit"></slot>`;
24
+ this.activeIndex = -1;
25
+ this.items = [];
26
+ this.inputElement = null;
27
+ }
28
+ connectedCallback() {
29
+ this.setAttribute("role", "listbox");
30
+ this.tabIndex = -1;
31
+ this.updateItems();
32
+
33
+ // Input zuweisen über Attribut oder fallback
34
+ const inputId = this.getAttribute("for");
35
+ this.inputElement = inputId ? document.getElementById(inputId) : null;
36
+ if (this.inputElement) {
37
+ this.inputElement.setAttribute("role", "combobox");
38
+ this.inputElement.setAttribute("aria-controls", this.id);
39
+ this.inputElement.setAttribute("aria-autocomplete", "list");
40
+ this.inputElement.setAttribute("aria-expanded", "true");
41
+ this.inputElement.addEventListener("keydown", this.onKeyDown.bind(this));
42
+ }
43
+ this.addEventListener("keydown", this.onKeyDown.bind(this));
44
+ this.addEventListener("click", e => {
45
+ const target = e.target instanceof Element ? e.target.closest("[data-blue-select-list-index]") : null;
46
+ if (target && target.hasAttribute("data-blue-select-list-index")) {
47
+ const index = Number(target.getAttribute("data-blue-select-list-index"));
48
+ this.select(index);
49
+ }
50
+ });
51
+ }
52
+ updateItems() {
53
+ this.items = Array.from(this.children);
54
+ this.items.forEach((el, i) => {
55
+ if (!el.hasAttribute("id")) {
56
+ el.setAttribute("id", `${this.id}-option-${i}`);
57
+ }
58
+ el.setAttribute("data-blue-select-list-index", i.toString());
59
+ el.setAttribute("aria-selected", "false");
60
+ el.setAttribute("role", "option");
61
+ el.tabIndex = -1;
62
+ });
63
+ }
64
+ onKeyDown(e) {
65
+ if (!this.items.length) return;
66
+ if (e.key === "ArrowDown") {
67
+ e.preventDefault();
68
+ this.activeIndex = (this.activeIndex + 1) % this.items.length;
69
+ this.updateActiveItem();
70
+ } else if (e.key === "ArrowUp") {
71
+ e.preventDefault();
72
+ this.activeIndex = (this.activeIndex - 1 + this.items.length) % this.items.length;
73
+ this.updateActiveItem();
74
+ } else if (e.key === "Enter" && this.activeIndex >= 0) {
75
+ const item = this.items[this.activeIndex];
76
+ item?.click();
77
+ }
78
+ }
79
+ updateActiveItem() {
80
+ this.items.forEach((el, i) => {
81
+ const active = i === this.activeIndex;
82
+ el.classList.toggle("active", active);
83
+ el.setAttribute("aria-selected", active.toString());
84
+ });
85
+ const activeItem = this.items[this.activeIndex];
86
+ if (activeItem && this.inputElement) {
87
+ this.inputElement.setAttribute("aria-activedescendant", activeItem.id);
88
+ activeItem.scrollIntoView({
89
+ block: "nearest"
90
+ });
91
+ }
92
+ }
93
+ select(index) {
94
+ this.activeIndex = index;
95
+ this.updateActiveItem();
96
+ const selectedItem = this.items[index];
97
+ if (selectedItem) {
98
+ // Fire a custom event with the selected item and index
99
+ this.dispatchEvent(new CustomEvent("bl-select", {
100
+ detail: {
101
+ index,
102
+ item: selectedItem
103
+ },
104
+ bubbles: true,
105
+ composed: true
106
+ }));
107
+ selectedItem.click();
108
+ }
109
+ }
110
+ }
111
+ customElements.define("bl-select-list", SelectList);
@@ -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: 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("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 ${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)})();
@@ -17,7 +17,8 @@ export class SideLayout extends HTMLElement {
17
17
  <style>
18
18
  :host {
19
19
  --spacing: 0.25rem;
20
- --drawer-side-shadow: rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
20
+ --drawer-side-shadow:
21
+ rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
21
22
  rgba(0, 0, 0, 0) 0px 0px 0px 0px, rgba(0, 0, 0, 0) 0px 0px 0px 0px,
22
23
  rgba(0, 0, 0, 0.25) 0px 25px 50px -12px;
23
24
  --toggler-size: calc(
@@ -167,4 +168,4 @@ export class SideLayout extends HTMLElement {
167
168
  }
168
169
  }
169
170
  }
170
- customElements.define("side-layout", SideLayout);
171
+ customElements.define("bl-side-layout", SideLayout);
package/dist/merged.scss CHANGED
@@ -1,12 +1,12 @@
1
1
  /*!
2
- * Blue Web v1.16.0 (https://bruegmann.github.io/blue-web)
2
+ * Blue Web v1.17.0 (https://bruegmann.github.io/blue-web)
3
3
  * Licensed under GNU General Public License v3.0 (https://github.com/bruegmann/blue-web/blob/master/LICENSE).
4
4
  */
5
5
 
6
6
  // Main color theme. E.g. used for background for body and sidebar.
7
7
  $theme: hsl(217deg 10% 94%) !default;
8
8
  $theme-dark: hsl(217deg 10% 8%) !default;
9
- $primary: hsl(217deg 91% 50%) !default;
9
+ $primary: hsl(221, 97%, 53%) !default;
10
10
  $white: #fff !default;
11
11
  $gray-100: hsl(217deg 17% 98%) !default;
12
12
  $gray-200: hsl(217deg 16% 93%) !default;
@@ -3376,17 +3376,23 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
3376
3376
  @mixin box-shadow($shadow...) {
3377
3377
  @if $enable-shadows {
3378
3378
  $result: ();
3379
+ $has-single-value: false;
3380
+ $single-value: null;
3379
3381
 
3380
3382
  @each $value in $shadow {
3381
3383
  @if $value != null {
3382
- $result: append($result, $value, "comma");
3383
- }
3384
- @if $value == none and length($shadow) > 1 {
3385
- @warn "The keyword 'none' must be used as a single argument.";
3384
+ @if $value == none or $value == initial or $value == inherit or $value == unset {
3385
+ $has-single-value: true;
3386
+ $single-value: $value;
3387
+ } @else {
3388
+ $result: append($result, $value, "comma");
3389
+ }
3386
3390
  }
3387
3391
  }
3388
3392
 
3389
- @if (length($result) > 0) {
3393
+ @if $has-single-value {
3394
+ box-shadow: $single-value;
3395
+ } @else if (length($result) > 0) {
3390
3396
  box-shadow: $result;
3391
3397
  }
3392
3398
  }
@@ -4167,7 +4173,7 @@ $sidebar-expanded-breakpoint: 1400px !default;
4167
4173
 
4168
4174
  @mixin bsBanner($file) {
4169
4175
  /*!
4170
- * Bootstrap #{$file} v5.3.6 (https://getbootstrap.com/)
4176
+ * Bootstrap #{$file} v5.3.7 (https://getbootstrap.com/)
4171
4177
  * Copyright 2011-2025 The Bootstrap Authors
4172
4178
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
4173
4179
  */
@@ -12234,6 +12240,10 @@ dialog.blue-modal:has(.offcanvas-start) {
12234
12240
  position: absolute;
12235
12241
  }
12236
12242
 
12243
+ .BLUE-actions-collapse-menu:popover-open {
12244
+ display: var(--display);
12245
+ }
12246
+
12237
12247
  .blue-anchor {
12238
12248
  anchor-name: var(--blue-anchor-name, --anchor-1);
12239
12249
  }
@@ -12391,6 +12401,7 @@ body.modal-open .dxbl-popup-cell[style="z-index: 1050;"] {
12391
12401
  "cv07" 1,
12392
12402
  "tnum" 1,
12393
12403
  "zero" 1;
12404
+ font-size: 14px;
12394
12405
  }
12395
12406
  @supports (font-variation-settings: normal) {
12396
12407
  :root {