blue-web 1.30.3 → 1.32.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/dialog.bundle.js +1 -1
- package/dist/js/dialog.js +15 -10
- package/dist/js/input-splitted.bundle.js +1 -1
- package/dist/js/input-splitted.js +4 -10
- package/dist/js/layout.bundle.js +1 -1
- package/dist/js/layout.d.ts +31 -1
- package/dist/js/layout.js +149 -13
- package/dist/js/odometer.bundle.js +1 -1
- package/dist/js/overflow-detector.bundle.js +1 -1
- package/dist/js/overflow-detector.js +2 -4
- package/dist/js/read-view.bundle.js +1 -1
- package/dist/js/select-list.bundle.js +1 -1
- package/dist/js/utils.bundle.js +0 -1
- package/dist/merged.scss +85 -1
- package/dist/style.css +76 -15
- package/dist/style.css.map +1 -1
- package/dist/style.min.css +3 -3
- package/dist/style.scss +2 -1
- package/dist/styles/_accordion.scss +26 -0
- package/dist/styles/_bootstrap-variables.scss +3 -0
- package/dist/styles/_layout.scss +54 -0
- package/package.json +63 -88
package/dist/js/dialog.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var n={
|
|
1
|
+
(()=>{"use strict";var n={73(n,e,t){t.d(e,{k:()=>a});const o={Cancel:["Cancel","Abbrechen"],Message:["Message","Nachricht"],Question:["Question","Frage"],Confirm:["Confirm","Bestätigen"],"Toggle menu":["Toggle menu","Menü umschalten"],"Close all":["Close all","Alle schließen"],Error:["Error","Fehler"],Information:["Information","Information"],Loading:["Loading","Laden"],Successful:["Successful","Erfolgreich"]};function a(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return e=e||navigator.language.toLowerCase().indexOf("de")>-1?"de-DE":"en-US",t=t||o,t[n]?e.indexOf("de-")>-1?t[n][1]:t[n][0]:n}},835(n,e,t){function o(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}t.d(e,["Os",0,()=>o()+o()+"-"+o()+"-"+o()+"-"+o()+"-"+o()+o()+o()])}};const e={};function t(o){const a=e[o];if(void 0!==a)return a.exports;const l=e[o]={exports:{}};return n[o](l,l.exports,t),l.exports}t.d=(n,e)=>{if(Array.isArray(e))for(var o=0;o<e.length;){var a=e[o++],l=e[o++];t.o(n,a)?0===l&&o++:0===l?Object.defineProperty(n,a,{enumerable:!0,value:e[o++]}):Object.defineProperty(n,a,{enumerable:!0,get:l})}else for(var a in e)t.o(e,a)&&!t.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:e[a]})},t.o=(n,e)=>Object.prototype.hasOwnProperty.call(n,e);var o=t(835),a=t(73);async function l(n,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l="string"==typeof t?JSON.parse(t):t,c=l.title,i=void 0===c?(0,a.k)("verify"===n?"Confirm":"ask"===n?"Question":"Message"):c,r=l.icon,d=void 0===r?void 0:r,s=l.switchPrimaryBtn,u=void 0!==s&&s,m=l.acceptBtnText,v=void 0===m?"OK":m,b=l.cancelBtnText,f=void 0===b?(0,a.k)("Cancel"):b,g=l.inputType,y=void 0===g?"text":g,p=l.defaultValue;const h=l.id||(0,o.Os)();return document.getElementById(h)||document.body.insertAdjacentHTML("beforeend",'<dialog class="blue-modal modal" id="'.concat(h,'" aria-labelledby="').concat(h,'-label">\n <div class="modal-dialog">\n <div class="modal-content">\n <form>\n <div class="modal-header">\n ').concat(d?'<div class="me-2">'.concat(d,"</div>"):"",'\n <h1 class="modal-title fs-5" id="').concat(h,'-label">').concat(i,'</h1>\n </div>\n <div class="modal-body">\n ').concat("ask"===n?'<label for="'.concat(h,'-input" class="blue-label">').concat(e,'</label>\n <input\n type="').concat(y,'"\n ').concat(void 0!==p?' value="'.concat(p,'"'):"",'\n id="').concat(h,'-input"\n class="form-control"\n />'):e,'\n </div>\n <div class="modal-footer">\n ').concat("verify"===n||"ask"===n?'<button\n type="button"\n class="btn '.concat(u?"btn-primary":"blue-btn-plain-primary",'"\n onclick="document.getElementById(\'').concat(h,"').close()\"\n >\n ").concat(f,"\n </button>"):"",'\n <button\n type="submit"\n class="btn ').concat(u?"blue-btn-plain-primary":"btn-primary",'"\n >\n ').concat(v,'\n </button>\n </div>\n </form>\n </div>\n </div>\n\n <form method="dialog" class="blue-modal-backdrop">\n <button>').concat(f,"</button>\n </form>\n </dialog>")),new Promise(e=>{var t;const o=document.getElementById(h),a=()=>{const n=document.getElementById(h);n&&n.remove()};null==o||o.showModal(),null==o||o.addEventListener("close",()=>{a(),e(!1)}),null==o||null===(t=o.querySelector(".modal-content > form"))||void 0===t||t.addEventListener("submit",t=>{t.preventDefault(),"ask"===n&&(o.close(),a(),e((null==o?void 0:o.querySelector("input")).value||"")),o.close(),a(),e(!0)})})}window.blueWeb=window.blueWeb||{},window.blueWeb.dialog={ask:async function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return await l("ask",n,e)},tell:async function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};await l("tell",n,e)},verify:async function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return!0===await l("verify",n,e)}}})();
|
package/dist/js/dialog.js
CHANGED
|
@@ -14,16 +14,21 @@ export async function verify(text) {
|
|
|
14
14
|
}
|
|
15
15
|
async function dialog(dialogType, text) {
|
|
16
16
|
let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
17
|
-
let
|
|
18
|
-
title =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
17
|
+
let _ref = typeof options === "string" ? JSON.parse(options) : options,
|
|
18
|
+
_ref$title = _ref.title,
|
|
19
|
+
title = _ref$title === void 0 ? getPhrase(dialogType === "verify" ? "Confirm" : dialogType === "ask" ? "Question" : "Message") : _ref$title,
|
|
20
|
+
_ref$icon = _ref.icon,
|
|
21
|
+
icon = _ref$icon === void 0 ? undefined : _ref$icon,
|
|
22
|
+
_ref$switchPrimaryBtn = _ref.switchPrimaryBtn,
|
|
23
|
+
switchPrimaryBtn = _ref$switchPrimaryBtn === void 0 ? false : _ref$switchPrimaryBtn,
|
|
24
|
+
_ref$acceptBtnText = _ref.acceptBtnText,
|
|
25
|
+
acceptBtnText = _ref$acceptBtnText === void 0 ? "OK" : _ref$acceptBtnText,
|
|
26
|
+
_ref$cancelBtnText = _ref.cancelBtnText,
|
|
27
|
+
cancelBtnText = _ref$cancelBtnText === void 0 ? getPhrase("Cancel") : _ref$cancelBtnText,
|
|
28
|
+
_ref$inputType = _ref.inputType,
|
|
29
|
+
inputType = _ref$inputType === void 0 ? "text" : _ref$inputType,
|
|
30
|
+
defaultValue = _ref.defaultValue,
|
|
31
|
+
id = _ref.id;
|
|
27
32
|
const _id = id || guid();
|
|
28
33
|
const addToDom = () => {
|
|
29
34
|
document.body.insertAdjacentHTML("beforeend", /* HTML */"<dialog class=\"blue-modal modal\" id=\"".concat(_id, "\" aria-labelledby=\"").concat(_id, "-label\">\n <div class=\"modal-dialog\">\n <div class=\"modal-content\">\n <form>\n <div class=\"modal-header\">\n ").concat(icon ? /* html */"<div class=\"me-2\">".concat(icon, "</div>") : "", "\n <h1 class=\"modal-title fs-5\" id=\"").concat(_id, "-label\">").concat(title, "</h1>\n </div>\n <div class=\"modal-body\">\n ").concat(dialogType === "ask" ? /* HTML */"<label for=\"".concat(_id, "-input\" class=\"blue-label\">").concat(text, "</label>\n <input\n type=\"").concat(inputType, "\"\n ").concat(defaultValue !== undefined ? " value=\"".concat(defaultValue, "\"") : "", "\n id=\"").concat(_id, "-input\"\n class=\"form-control\"\n />") : text, "\n </div>\n <div class=\"modal-footer\">\n ").concat(dialogType === "verify" || dialogType === "ask" ? /* HTML */"<button\n type=\"button\"\n class=\"btn ".concat(switchPrimaryBtn ? "btn-primary" : "blue-btn-plain-primary", "\"\n onclick=\"document.getElementById('").concat(_id, "').close()\"\n >\n ").concat(cancelBtnText, "\n </button>") : "", "\n <button\n type=\"submit\"\n class=\"btn ").concat(switchPrimaryBtn ? "blue-btn-plain-primary" : "btn-primary", "\"\n >\n ").concat(acceptBtnText, "\n </button>\n </div>\n </form>\n </div>\n </div>\n\n <form method=\"dialog\" class=\"blue-modal-backdrop\">\n <button>").concat(cancelBtnText, "</button>\n </form>\n </dialog>"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";
|
|
1
|
+
(()=>{"use strict";function t(t,i,s){e(t,i),i.set(t,s)}function e(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function i(t,e,i){return t.set(n(t,e),i),i}function s(t,e){return t.get(n(t,e))}function n(t,e,i){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:i;throw new TypeError("Private element is not present on this object")}var h=new WeakMap,l=new WeakMap,o=new WeakMap,r=new WeakMap,a=new WeakMap,u=new WeakMap,d=new WeakMap,c=new WeakMap,b=new WeakMap,p=new WeakMap,g=new WeakSet;class v extends HTMLElement{get lightDom(){return s(r,this)}set lightDom(t){i(r,this,t),!0===this.lightDom?this.innerHTML=s(p,this):(this.shadowRoot||this.attachShadow({mode:"open",delegatesFocus:!0}),this.shadowRoot.innerHTML=s(p,this)),n(g,this,m).call(this)}get value(){return s(a,this)}set value(t){const e=s(a,this);i(a,this,t),i(l,this,this.value.split(""));for(let t=0;t<this.length;t++)s(o,this)[t]&&(s(o,this)[t].value=s(l,this)[t]||"");e!==t&&this.dispatchEvent(new CustomEvent("changeValue",{bubbles:!0,detail:t}))}get length(){return s(u,this)}set length(t){if(i(u,this,t),this.length>s(o,this).length)for(let t=0;t<this.length;t++)!s(o,this)[t]&&this.didInit&&n(g,this,f).call(this,s(o,this).length);else if(this.length<s(o,this).length){const t=Math.abs(s(o,this).length-this.length);for(let e=0;e<t;e++){const t=s(o,this).pop();null==t||t.remove()}}i(o,this,[...s(o,this)])}get disabled(){return s(d,this)}set disabled(t){i(d,this,t);const e=this.lightDom?this.querySelectorAll("input"):this.shadowRoot.querySelectorAll("input");for(const i of e)i.disabled=t}get controlClass(){return s(c,this)}set controlClass(t){i(c,this,t);for(const t of s(o,this))t.className=this.controlClass}get control1Id(){return s(b,this)}set control1Id(t){i(b,this,t),s(o,this)[0]&&(s(o,this)[0].id=this.control1Id)}constructor(){var i;super(),e(this,i=g),i.add(this),t(this,h,void 0),t(this,l,[]),t(this,o,[]),t(this,r,!1),t(this,a,""),t(this,u,0),t(this,d,!1),t(this,c,""),t(this,b,""),t(this,p,"<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>"),function(t,e,i){(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,"string");if("object"!=typeof i)return i;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:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i}(this,"didInit",!1),this.onFocus=this.onFocus.bind(this)}connectedCallback(){this.didInit=!0,this.lightDom=null!==this.getAttribute("light-dom"),this.disabled=null!==this.getAttribute("disabled"),n(g,this,m).call(this),this.value=this.getAttribute("value")||this.value,this.length=y(this),this.controlClass=this.getAttribute("control-class")||this.controlClass,this.control1Id=this.getAttribute("control-1-id")||this.control1Id,n(g,this,w).call(this)}onFocus(){s(o,this)[0]&&s(o,this)[0].focus()}disconnectedCallback(){n(g,this,k).call(this)}static get formAssociated(){return!0}}function f(t){const e=document.createElement("input");s(o,this).push(e),e.type="text",e.className=this.controlClass,0===t&&(e.id=this.control1Id),e.maxLength=1,e.value=s(l,this)[t]||"",e.disabled=this.disabled,e.addEventListener("input",e=>{const i=e.target;""!==i.value&&s(o,this)[t+1]&&s(o,this)[t+1].focus(),s(l,this)[t]=i.value,this.value=s(l,this).join("")}),e.addEventListener("keydown",e=>{let i=e.key,n=e.target;"Backspace"===i&&""===n.value&&void 0!==s(o,this)[t-1]&&s(o,this)[t-1].focus()}),e.addEventListener("paste",e=>{const i=e.clipboardData.getData("Text");let n=0;for(let e=t;e<this.length;e++)s(l,this)[e]=i.split("")[n],s(o,this)[e].focus(),n+=1;this.value=s(l,this).join("")}),this.lightDom?this.appendChild(e):this.shadowRoot.appendChild(e)}function m(){this.value=this.getAttribute("value")||"",this.length=y(this),this.lightDom?(this.innerHTML=s(p,this),this.addEventListener("focus",this.onFocus)):(this.shadowRoot.innerHTML=s(p,this),this.shadowRoot.addEventListener("focus",this.onFocus)),i(l,this,this.value.split("")),i(o,this,[]);for(let t=0;t<this.length;t++)n(g,this,f).call(this,t)}function w(){i(h,this,s(h,this)||new MutationObserver(t=>{t.forEach(t=>{"value"===t.attributeName&&(this.value=this.getAttribute("value")||this.value),"length"===t.attributeName&&(this.length=y(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")),"disabled"===t.attributeName&&(this.disabled=null!==this.getAttribute("disabled"))})})),s(h,this).observe(this,{attributeFilter:["value","length","control-class","control-1-id","light-dom","disabled"],attributeOldValue:!0,childList:!0,subtree:!0})}function k(){s(h,this)&&(s(h,this).takeRecords(),s(h,this).disconnect())}function y(t){const e=t.getAttribute("length");if(e)return parseInt(e)}customElements.define("bl-input-splitted",v)})();
|
|
@@ -153,9 +153,7 @@ function _addInput(i) {
|
|
|
153
153
|
input.value = _classPrivateFieldGet(_valueArray, this)[i] || "";
|
|
154
154
|
input.disabled = this.disabled;
|
|
155
155
|
input.addEventListener("input", _ref => {
|
|
156
|
-
let
|
|
157
|
-
target
|
|
158
|
-
} = _ref;
|
|
156
|
+
let target = _ref.target;
|
|
159
157
|
const inputTarget = target;
|
|
160
158
|
if (inputTarget.value !== "" && _classPrivateFieldGet(_refArray, this)[i + 1]) {
|
|
161
159
|
_classPrivateFieldGet(_refArray, this)[i + 1].focus();
|
|
@@ -164,19 +162,15 @@ function _addInput(i) {
|
|
|
164
162
|
this.value = _classPrivateFieldGet(_valueArray, this).join("");
|
|
165
163
|
});
|
|
166
164
|
input.addEventListener("keydown", _ref2 => {
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
target
|
|
170
|
-
} = _ref2;
|
|
165
|
+
let key = _ref2.key,
|
|
166
|
+
target = _ref2.target;
|
|
171
167
|
const inputTarget = target;
|
|
172
168
|
if (key === "Backspace" && inputTarget.value === "" && _classPrivateFieldGet(_refArray, this)[i - 1] !== undefined) {
|
|
173
169
|
_classPrivateFieldGet(_refArray, this)[i - 1].focus();
|
|
174
170
|
}
|
|
175
171
|
});
|
|
176
172
|
input.addEventListener("paste", _ref3 => {
|
|
177
|
-
let
|
|
178
|
-
clipboardData
|
|
179
|
-
} = _ref3;
|
|
173
|
+
let clipboardData = _ref3.clipboardData;
|
|
180
174
|
const pastedData = clipboardData.getData("Text");
|
|
181
175
|
let k = 0;
|
|
182
176
|
for (let j = i; j < this.length; j++) {
|
package/dist/js/layout.bundle.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";var e={
|
|
1
|
+
(()=>{"use strict";var e={362(e,t,o){o.d(t,{A:()=>r,T:()=>l});const n=new Map;function l(e){if(!e)return;if(n.has(e)&&r(e),!e.querySelector(".offcanvas"))return;const t=new AbortController;n.set(e,t),window.addEventListener("popstate",()=>null==e?void 0:e.close(),{signal:t.signal}),window.addEventListener("resize",()=>{const t=e.querySelector(".offcanvas");t&&"fixed"!==getComputedStyle(t).position&&(null==e||e.close())},{signal:t.signal});const o=history.pushState;history.pushState=function(){for(var t=arguments.length,n=new Array(t),l=0;l<t;l++)n[l]=arguments[l];o.apply(history,n),null==e||e.close()};const l=history.replaceState;history.replaceState=function(){for(var t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];l.apply(history,o),null==e||e.close()}}function r(e){const t=n.get(e);t&&(t.abort(),n.delete(e))}"undefined"!=typeof window&&(window.blueWeb=window.blueWeb||{},window.blueWeb.modalResponsive={init:l,dispose:r})}};const t={};function o(n){const l=t[n];if(void 0!==l)return l.exports;const r=t[n]={exports:{}};return e[n](r,r.exports,o),r.exports}o.d=(e,t)=>{if(Array.isArray(t))for(var n=0;n<t.length;){var l=t[n++],r=t[n++];o.o(e,l)?0===r&&n++:0===r?Object.defineProperty(e,l,{enumerable:!0,value:t[n++]}):Object.defineProperty(e,l,{enumerable:!0,get:r})}else for(var l in t)o.o(t,l)&&!o.o(e,l)&&Object.defineProperty(e,l,{enumerable:!0,get:t[l]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var n=o(362);const l=new Map;function r(e){const t=l.get(e);if(!t)return;const o=t.controller,r=t.modalEl;o.abort(),r&&(0,n.A)(r),l.delete(e)}function s(e,t){t<0?e.splitterPos=0:e.maxPos&&t>e.maxPos?e.splitterPos=e.maxPos:e.splitterPos=t}function i(e,t){const o=localStorage.getItem("blueLayoutInspectorSize"),n=o?Number.parseInt(o,10):NaN;s(t,t.viewSize-(Number.isFinite(n)?n:244)),t.resizable=!0,t.dataset.blueInspectorSize=(t.viewSize-t.splitterPos).toString(),e.dataset.blueSplitterEnabled=""}function a(e,t){s(t,t.maxPos||t.viewSize),t.resizable=!1,delete e.dataset.blueSplitterEnabled}function c(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)return;const o=l.get(t);if(null==o||!o.splitterEl||!o.inspectorEl)return;const n=o.splitterEl,r=o.inspectorEl,s="fixed"===getComputedStyle(r).position?r.open:n.resizable,i=t.dataset.blueInspectorOpen;s?t.dataset.blueInspectorOpen="":delete t.dataset.blueInspectorOpen,i!==t.dataset.blueInspectorOpen&&t.dispatchEvent(new Event("blue-inspector-change"))}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"show-modal";const o="string"==typeof e?document.querySelector(e):e;if(!o)return;const n=l.get(o);if(null==n||!n.splitterEl||!n.inspectorEl)return;const r=n.splitterEl,s=n.inspectorEl;"fixed"===getComputedStyle(s).position?"show"===t?s.show():s.showModal():(i(o,r),localStorage.setItem("blueLayoutInspectorEnabled","")),c(o)}function d(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)return;const o=l.get(t);if(null==o||!o.splitterEl||!o.inspectorEl)return;const n=o.splitterEl,r=o.inspectorEl;"fixed"===getComputedStyle(r).position?r.close():(a(t,n),localStorage.removeItem("blueLayoutInspectorEnabled")),c(t)}"undefined"!=typeof window&&(window.blueWeb=window.blueWeb||{},window.blueWeb.layout={init:function(e){if(!e)return;l.has(e)&&r(e);const t=e.querySelector('[data-blue-toggle="layout-side"]'),o=e.querySelector(".blue-layout-side"),u=e.querySelector(".blue-layout-side > dialog"),d=e.querySelector(".blue-layout-main > sp-split-view.blue-layout-splitter"),p=e.querySelector(".blue-layout-inspector");if(!t||!o||!u)return;const g=new AbortController,b={toggleLayoutSideEl:t,layoutSideEl:o,modalEl:u,splitterEl:d,inspectorEl:p,controller:g};return l.set(e,b),null!=localStorage.getItem("blueLayoutSideShrink")&&(o.classList.add("d-lg-none","w-lg-0"),t.setAttribute("aria-expanded","false")),t.addEventListener("click",()=>function(e){const t=l.get(e);if(!t)return;const o=t.layoutSideEl,n=t.toggleLayoutSideEl;if(!o||!n)return;o.classList.toggle("d-lg-none"),o.classList.toggle("w-lg-0");const r=!o.classList.contains("d-lg-none");n.setAttribute("aria-expanded",r.toString()),r?localStorage.removeItem("blueLayoutSideShrink"):localStorage.setItem("blueLayoutSideShrink","")}(e),{signal:g.signal}),d&&p&&((0,n.T)(p),function(e,t){const o=t.splitterEl,n=t.inspectorEl,l=t.controller;o&&n&&l&&(null!=localStorage.getItem("blueLayoutInspectorEnabled")&&"fixed"!==getComputedStyle(n).position?i(e,o):a(e,o),c(e),window.addEventListener("resize",()=>{o&&(n&&"none"===getComputedStyle(n).display||!o.resizable?(a(e,o),c(e)):o.resizable&&o.dataset.blueInspectorSize&&(s(o,o.viewSize-parseInt(o.dataset.blueInspectorSize)),c(e)))},{signal:l.signal}),o.addEventListener("change",e=>{const t=e.target;let o=t.viewSize-t.splitterPos;o&&(o=Math.round(o),t.dataset.blueInspectorSize=o.toString(),localStorage.setItem("blueLayoutInspectorSize",o.toString()))},{signal:l.signal}),n.addEventListener("close",()=>{c(e)},{signal:l.signal}))}(e,b)),(0,n.T)(u),o.classList.add("with-transition"),b},dispose:r,instances:l,toggleInspector:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"show-modal";const o="string"==typeof e?document.querySelector(e):e;if(!o)return;const n=l.get(o);if(null==n||!n.splitterEl||!n.inspectorEl)return;const r=n.splitterEl,s=n.inspectorEl;("fixed"===getComputedStyle(s).position?s.open:r.resizable)?d(e):u(e,t)},openInspector:u,closeInspector:d})})();
|
package/dist/js/layout.d.ts
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
type SpSplitViewBaseType = HTMLElement & {
|
|
2
|
+
resizable?: boolean;
|
|
3
|
+
collapsible?: boolean;
|
|
4
|
+
splitterPos: number;
|
|
5
|
+
minPos?: number;
|
|
6
|
+
maxPos?: number;
|
|
7
|
+
primaryMin?: string | number | null;
|
|
8
|
+
primaryMax?: string | number | null;
|
|
9
|
+
secondaryMin?: string | number | null;
|
|
10
|
+
viewSize: number;
|
|
11
|
+
};
|
|
12
|
+
export type Instance = {
|
|
13
|
+
toggleLayoutSideEl: Element | null;
|
|
14
|
+
layoutSideEl: Element | null;
|
|
15
|
+
modalEl: HTMLDialogElement | null;
|
|
16
|
+
splitterEl: SpSplitViewBaseType | null;
|
|
17
|
+
inspectorEl: HTMLDialogElement | null;
|
|
18
|
+
controller: AbortController;
|
|
19
|
+
};
|
|
20
|
+
export declare function init(layoutEl: HTMLElement): {
|
|
21
|
+
toggleLayoutSideEl: Element;
|
|
22
|
+
layoutSideEl: Element;
|
|
23
|
+
modalEl: HTMLDialogElement;
|
|
24
|
+
splitterEl: SpSplitViewBaseType | null;
|
|
25
|
+
inspectorEl: HTMLDialogElement | null;
|
|
26
|
+
controller: AbortController;
|
|
27
|
+
} | undefined;
|
|
2
28
|
export declare function dispose(layoutEl: HTMLElement): void;
|
|
29
|
+
export declare function openInspector(layoutTarget: HTMLElement | string, showCommand?: "show-modal" | "show" | undefined): void;
|
|
30
|
+
export declare function closeInspector(layoutTarget: HTMLElement | string): void;
|
|
31
|
+
export declare function toggleInspector(layoutTarget: HTMLElement | string, showCommand?: "show-modal" | "show" | undefined): void;
|
|
32
|
+
export {};
|
package/dist/js/layout.js
CHANGED
|
@@ -8,16 +8,20 @@ export function init(layoutEl) {
|
|
|
8
8
|
const toggleLayoutSideEl = layoutEl.querySelector('[data-blue-toggle="layout-side"]');
|
|
9
9
|
const layoutSideEl = layoutEl.querySelector(".blue-layout-side");
|
|
10
10
|
const modalEl = layoutEl.querySelector(".blue-layout-side > dialog");
|
|
11
|
+
const splitterEl = layoutEl.querySelector(".blue-layout-main > sp-split-view.blue-layout-splitter");
|
|
12
|
+
const inspectorEl = layoutEl.querySelector(".blue-layout-inspector");
|
|
11
13
|
if (!toggleLayoutSideEl || !layoutSideEl || !modalEl) return;
|
|
12
14
|
const controller = new AbortController();
|
|
13
15
|
const instance = {
|
|
14
16
|
toggleLayoutSideEl,
|
|
15
17
|
layoutSideEl,
|
|
16
18
|
modalEl,
|
|
19
|
+
splitterEl,
|
|
20
|
+
inspectorEl,
|
|
17
21
|
controller
|
|
18
22
|
};
|
|
19
23
|
instances.set(layoutEl, instance);
|
|
20
|
-
const entry = localStorage.getItem("
|
|
24
|
+
const entry = localStorage.getItem("blueLayoutSideShrink");
|
|
21
25
|
const shrink = entry != null;
|
|
22
26
|
if (shrink) {
|
|
23
27
|
layoutSideEl.classList.add("d-lg-none", "w-lg-0");
|
|
@@ -26,16 +30,19 @@ export function init(layoutEl) {
|
|
|
26
30
|
toggleLayoutSideEl.addEventListener("click", () => toggleSidebar(layoutEl), {
|
|
27
31
|
signal: controller.signal
|
|
28
32
|
});
|
|
33
|
+
if (splitterEl && inspectorEl) {
|
|
34
|
+
mrInit(inspectorEl);
|
|
35
|
+
initInspector(layoutEl, instance);
|
|
36
|
+
}
|
|
29
37
|
mrInit(modalEl);
|
|
30
38
|
layoutSideEl.classList.add("with-transition");
|
|
39
|
+
return instance;
|
|
31
40
|
}
|
|
32
41
|
export function dispose(layoutEl) {
|
|
33
42
|
const instance = instances.get(layoutEl);
|
|
34
43
|
if (!instance) return;
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
modalEl
|
|
38
|
-
} = instance;
|
|
44
|
+
const controller = instance.controller,
|
|
45
|
+
modalEl = instance.modalEl;
|
|
39
46
|
controller.abort();
|
|
40
47
|
if (modalEl) mrDispose(modalEl);
|
|
41
48
|
instances.delete(layoutEl);
|
|
@@ -43,24 +50,153 @@ export function dispose(layoutEl) {
|
|
|
43
50
|
function toggleSidebar(layoutEl) {
|
|
44
51
|
const instance = instances.get(layoutEl);
|
|
45
52
|
if (!instance) return;
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = instance;
|
|
53
|
+
const layoutSideEl = instance.layoutSideEl,
|
|
54
|
+
toggleLayoutSideEl = instance.toggleLayoutSideEl;
|
|
55
|
+
if (!layoutSideEl || !toggleLayoutSideEl) return;
|
|
50
56
|
layoutSideEl.classList.toggle("d-lg-none");
|
|
51
57
|
layoutSideEl.classList.toggle("w-lg-0");
|
|
52
58
|
const expanded = !layoutSideEl.classList.contains("d-lg-none");
|
|
53
|
-
toggleLayoutSideEl.setAttribute("aria-expanded", expanded);
|
|
59
|
+
toggleLayoutSideEl.setAttribute("aria-expanded", expanded.toString());
|
|
54
60
|
if (expanded) {
|
|
55
|
-
localStorage.removeItem("
|
|
61
|
+
localStorage.removeItem("blueLayoutSideShrink");
|
|
62
|
+
} else {
|
|
63
|
+
localStorage.setItem("blueLayoutSideShrink", "");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
function setSplitterPosition(splitterEl, value) {
|
|
67
|
+
if (value < 0) splitterEl.splitterPos = 0;else if (splitterEl.maxPos && value > splitterEl.maxPos) splitterEl.splitterPos = splitterEl.maxPos;else splitterEl.splitterPos = value;
|
|
68
|
+
}
|
|
69
|
+
function enableSplitter(layoutEl, splitterEl) {
|
|
70
|
+
const inspectorSizeEntry = localStorage.getItem("blueLayoutInspectorSize");
|
|
71
|
+
const inspectorSize = inspectorSizeEntry ? Number.parseInt(inspectorSizeEntry, 10) : NaN;
|
|
72
|
+
setSplitterPosition(splitterEl, splitterEl.viewSize - (Number.isFinite(inspectorSize) ? inspectorSize : 244));
|
|
73
|
+
splitterEl.resizable = true;
|
|
74
|
+
splitterEl.dataset.blueInspectorSize = (splitterEl.viewSize - splitterEl.splitterPos).toString();
|
|
75
|
+
layoutEl.dataset.blueSplitterEnabled = "";
|
|
76
|
+
}
|
|
77
|
+
function disableSplitter(layoutEl, splitterEl) {
|
|
78
|
+
setSplitterPosition(splitterEl, splitterEl.maxPos || splitterEl.viewSize);
|
|
79
|
+
splitterEl.resizable = false;
|
|
80
|
+
delete layoutEl.dataset.blueSplitterEnabled;
|
|
81
|
+
}
|
|
82
|
+
function initInspector(layoutEl, instance) {
|
|
83
|
+
const splitterEl = instance.splitterEl,
|
|
84
|
+
inspectorEl = instance.inspectorEl,
|
|
85
|
+
controller = instance.controller;
|
|
86
|
+
if (!splitterEl || !inspectorEl || !controller) return;
|
|
87
|
+
const enabled = localStorage.getItem("blueLayoutInspectorEnabled") != null;
|
|
88
|
+
if (enabled && getComputedStyle(inspectorEl).position !== "fixed") {
|
|
89
|
+
enableSplitter(layoutEl, splitterEl);
|
|
90
|
+
} else {
|
|
91
|
+
disableSplitter(layoutEl, splitterEl);
|
|
92
|
+
}
|
|
93
|
+
updateInspectorState(layoutEl);
|
|
94
|
+
window.addEventListener("resize", () => {
|
|
95
|
+
if (splitterEl) {
|
|
96
|
+
if (inspectorEl && getComputedStyle(inspectorEl).display === "none" || !splitterEl.resizable) {
|
|
97
|
+
disableSplitter(layoutEl, splitterEl);
|
|
98
|
+
updateInspectorState(layoutEl);
|
|
99
|
+
} else if (splitterEl.resizable && splitterEl.dataset.blueInspectorSize) {
|
|
100
|
+
setSplitterPosition(splitterEl, splitterEl.viewSize - parseInt(splitterEl.dataset.blueInspectorSize));
|
|
101
|
+
updateInspectorState(layoutEl);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
signal: controller.signal
|
|
106
|
+
});
|
|
107
|
+
splitterEl.addEventListener("change", e => {
|
|
108
|
+
const splitterEl = e.target;
|
|
109
|
+
let secondPaneSize = splitterEl.viewSize - splitterEl.splitterPos;
|
|
110
|
+
if (secondPaneSize) {
|
|
111
|
+
secondPaneSize = Math.round(secondPaneSize);
|
|
112
|
+
splitterEl.dataset.blueInspectorSize = secondPaneSize.toString();
|
|
113
|
+
localStorage.setItem("blueLayoutInspectorSize", secondPaneSize.toString());
|
|
114
|
+
}
|
|
115
|
+
}, {
|
|
116
|
+
signal: controller.signal
|
|
117
|
+
});
|
|
118
|
+
inspectorEl.addEventListener("close", () => {
|
|
119
|
+
updateInspectorState(layoutEl);
|
|
120
|
+
}, {
|
|
121
|
+
signal: controller.signal
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function updateInspectorState(layoutTarget) {
|
|
125
|
+
const layoutEl = typeof layoutTarget === "string" ? document.querySelector(layoutTarget) : layoutTarget;
|
|
126
|
+
if (!layoutEl) return;
|
|
127
|
+
const instance = instances.get(layoutEl);
|
|
128
|
+
if (!(instance !== null && instance !== void 0 && instance.splitterEl) || !instance.inspectorEl) return;
|
|
129
|
+
const splitterEl = instance.splitterEl,
|
|
130
|
+
inspectorEl = instance.inspectorEl;
|
|
131
|
+
const isOpen = getComputedStyle(inspectorEl).position === "fixed" ? inspectorEl.open : splitterEl.resizable;
|
|
132
|
+
const previousState = layoutEl.dataset.blueInspectorOpen;
|
|
133
|
+
if (isOpen) layoutEl.dataset.blueInspectorOpen = "";else delete layoutEl.dataset.blueInspectorOpen;
|
|
134
|
+
if (previousState !== layoutEl.dataset.blueInspectorOpen) {
|
|
135
|
+
layoutEl.dispatchEvent(new Event("blue-inspector-change"));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
export function openInspector(layoutTarget) {
|
|
139
|
+
let showCommand = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "show-modal";
|
|
140
|
+
const layoutEl = typeof layoutTarget === "string" ? document.querySelector(layoutTarget) : layoutTarget;
|
|
141
|
+
if (!layoutEl) return;
|
|
142
|
+
const instance = instances.get(layoutEl);
|
|
143
|
+
if (!(instance !== null && instance !== void 0 && instance.splitterEl) || !instance.inspectorEl) return;
|
|
144
|
+
const splitterEl = instance.splitterEl,
|
|
145
|
+
inspectorEl = instance.inspectorEl;
|
|
146
|
+
if (getComputedStyle(inspectorEl).position === "fixed") {
|
|
147
|
+
// Is active as dialog
|
|
148
|
+
if (showCommand === "show") {
|
|
149
|
+
inspectorEl.show();
|
|
150
|
+
} else {
|
|
151
|
+
inspectorEl.showModal();
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
// Is active as split view
|
|
155
|
+
enableSplitter(layoutEl, splitterEl);
|
|
156
|
+
localStorage.setItem("blueLayoutInspectorEnabled", "");
|
|
157
|
+
}
|
|
158
|
+
updateInspectorState(layoutEl);
|
|
159
|
+
}
|
|
160
|
+
export function closeInspector(layoutTarget) {
|
|
161
|
+
const layoutEl = typeof layoutTarget === "string" ? document.querySelector(layoutTarget) : layoutTarget;
|
|
162
|
+
if (!layoutEl) return;
|
|
163
|
+
const instance = instances.get(layoutEl);
|
|
164
|
+
if (!(instance !== null && instance !== void 0 && instance.splitterEl) || !instance.inspectorEl) return;
|
|
165
|
+
const splitterEl = instance.splitterEl,
|
|
166
|
+
inspectorEl = instance.inspectorEl;
|
|
167
|
+
if (getComputedStyle(inspectorEl).position === "fixed") {
|
|
168
|
+
// Is active as dialog
|
|
169
|
+
inspectorEl.close();
|
|
170
|
+
} else {
|
|
171
|
+
// Is active as split view
|
|
172
|
+
disableSplitter(layoutEl, splitterEl);
|
|
173
|
+
localStorage.removeItem("blueLayoutInspectorEnabled");
|
|
174
|
+
}
|
|
175
|
+
updateInspectorState(layoutEl);
|
|
176
|
+
}
|
|
177
|
+
export function toggleInspector(layoutTarget) {
|
|
178
|
+
let showCommand = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "show-modal";
|
|
179
|
+
const layoutEl = typeof layoutTarget === "string" ? document.querySelector(layoutTarget) : layoutTarget;
|
|
180
|
+
if (!layoutEl) return;
|
|
181
|
+
const instance = instances.get(layoutEl);
|
|
182
|
+
if (!(instance !== null && instance !== void 0 && instance.splitterEl) || !instance.inspectorEl) return;
|
|
183
|
+
const splitterEl = instance.splitterEl,
|
|
184
|
+
inspectorEl = instance.inspectorEl;
|
|
185
|
+
const isOpen = getComputedStyle(inspectorEl).position === "fixed" ? inspectorEl.open : splitterEl.resizable;
|
|
186
|
+
if (isOpen) {
|
|
187
|
+
closeInspector(layoutTarget);
|
|
56
188
|
} else {
|
|
57
|
-
|
|
189
|
+
openInspector(layoutTarget, showCommand);
|
|
58
190
|
}
|
|
59
191
|
}
|
|
60
192
|
if (typeof window !== "undefined") {
|
|
61
193
|
window.blueWeb = window.blueWeb || {};
|
|
62
194
|
window.blueWeb.layout = {
|
|
63
195
|
init,
|
|
64
|
-
dispose
|
|
196
|
+
dispose,
|
|
197
|
+
instances,
|
|
198
|
+
toggleInspector,
|
|
199
|
+
openInspector,
|
|
200
|
+
closeInspector
|
|
65
201
|
};
|
|
66
202
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";
|
|
1
|
+
(()=>{"use strict";function e(e,t,i){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var i=t.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}class t extends HTMLElement{static get observedAttributes(){return["value","max"]}constructor(){super(),e(this,"_initialized",!1),e(this,"_resetTimer",null),this.attachShadow({mode:"open"})}connectedCallback(){this._initialized||(this.setup(),this._initialized=!0,this.updateValue(this.value))}setup(){const e=document.createElement("style");e.textContent="\n :host {\n display: inline-flex;\n min-width: 1em;\n height: 1em;\n text-align: center;\n overflow: hidden;\n line-height: 1em;\n }\n .numbers {\n display: flex;\n flex-direction: column;\n transition: transform var(--bl-odometer-duration, 0.4s) cubic-bezier(0.34, 1.56, 0.64, 1);\n }\n .numbers span {\n display: flex;\n align-items: center;\n justify-content: center;\n height: 1em;\n }";const t=document.createElement("span");t.classList.add("numbers"),t.setAttribute("aria-hidden","true"),this.shadowRoot.append(e,t),this.wrapper=t,this.rebuildNumbers()}rebuildNumbers(){this.wrapper.innerHTML="";const e=this.max;for(let t=0;t<=e;t++){const e=document.createElement("span");e.textContent=String(t),this.wrapper.appendChild(e)}const t=document.createElement("span");t.textContent="".concat(e,"+"),this.wrapper.appendChild(t),this._initialized&&this.updateValue(this.value)}attributeChangedCallback(e,t,i){if(i!==t&&this._initialized)if("value"===e){const e=parseInt(null!=t?t:"0",10)||0,n=parseInt(null!=i?i:"0",10)||0;this.applyChangeState(e,n),this.updateValue(n)}else"max"===e&&this.rebuildNumbers()}updateValue(e){const t=this.max,i=e>t?t+1:Math.max(0,e),n=this.wrapper.getBoundingClientRect().height||16;this.wrapper.style.transform="translateY(-".concat(i*n,"px)");const s=e>t?"".concat(t,"+"):"".concat(e);this.setAttribute("aria-label",s)}clearResetTimer(){null!==this._resetTimer&&(clearTimeout(this._resetTimer),this._resetTimer=null)}scheduleResetChange(){this.clearResetTimer(),this._resetTimer=window.setTimeout(()=>{this.removeAttribute("data-change"),this._resetTimer=null},3e3)}applyChangeState(e,t){t>e?(this.setAttribute("data-change","up"),this.scheduleResetChange()):t<e&&(this.setAttribute("data-change","down"),this.scheduleResetChange())}set value(e){this.value!==e&&(this.setAttribute("value",String(e)),this._initialized&&this.dispatchEvent(new CustomEvent("change",{detail:{value:e},bubbles:!0,composed:!0})))}get value(){return parseInt(this.getAttribute("value")||"0",10)||0}set max(e){this.setAttribute("max",String(e))}get max(){return parseInt(this.getAttribute("max")||"9",10)||9}}customElements.get("bl-odometer")||customElements.define("bl-odometer",t)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";
|
|
1
|
+
(()=>{"use strict";function e(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.OverflowDetector=class{constructor(){e(this,"resizeObserver",null),e(this,"entries",new Map),"ResizeObserver"in window&&(this.resizeObserver=new ResizeObserver(e=>{for(const r of e){const e=r.target,t=this.entries.get(e);t&&this.check(t)}}))}check(e){const r=e.element.scrollWidth>e.element.clientWidth+1;r!==e.wasOverflowing&&(e.wasOverflowing=r,e.onChange(r,e.element))}observe(e){var r;const t=e.element,i=e.onChange;this.entries.has(t)&&this.unobserve(t);const n={element:t,onChange:i,wasOverflowing:!1};this.entries.set(t,n),null===(r=this.resizeObserver)||void 0===r||r.observe(t),this.check(n)}unobserve(e){var r;null===(r=this.resizeObserver)||void 0===r||r.unobserve(e),this.entries.delete(e)}checkAll(){this.entries.forEach(e=>{this.check(e)})}destroy(){var e;null===(e=this.resizeObserver)||void 0===e||e.disconnect(),this.resizeObserver=null,this.entries.clear()}},window.blueWeb.isOverflowing=function(e){return e.scrollWidth>e.clientWidth+1}})();
|
|
@@ -26,10 +26,8 @@ export class OverflowDetector {
|
|
|
26
26
|
}
|
|
27
27
|
observe(options) {
|
|
28
28
|
var _this$resizeObserver;
|
|
29
|
-
const
|
|
30
|
-
|
|
31
|
-
onChange
|
|
32
|
-
} = options;
|
|
29
|
+
const element = options.element,
|
|
30
|
+
onChange = options.onChange;
|
|
33
31
|
if (this.entries.has(element)) {
|
|
34
32
|
this.unobserve(element);
|
|
35
33
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";
|
|
1
|
+
(()=>{"use strict";function t(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}class e extends HTMLElement{constructor(){super(),t(this,"startX",0),t(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:\n 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 25%),\n inset 0 0 0 1px 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 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");var i,s;null===(t=this.button)||void 0===t||t.setAttribute("aria-disabled",String(n)),n?null===(i=this.button)||void 0===i||i.setAttribute("tabindex","-1"):null===(s=this.button)||void 0===s||s.removeAttribute("tabindex"),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",e)})();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{"use strict";
|
|
1
|
+
(()=>{"use strict";function t(t,e,i){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 i=e.call(t,"string");if("object"!=typeof i)return i;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:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}class e extends Event{constructor(t,i){super(e.eventName,{bubbles:!0,composed:!0}),this.index=t,this.item=i}}t(e,"eventName","bl-select");class i extends HTMLElement{constructor(){super(),t(this,"handleChildrenChanged",()=>{var t;const e=null===(t=this.items[this.activeIndex])||void 0===t?void 0:t.id;if(this.updateItems(),e){const t=this.items.findIndex(t=>t.id===e);this.activeIndex=t>=0?t:-1}else this.activeIndex=-1;this.updateActiveItem()}),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML='<slot style="border-radius: inherit"></slot>',this.activeIndex=-1,this.items=[],this.inputElement=null,this.slotElement=null,this.observer=null}get activeClass(){return this.getAttribute("active-class")||"active"}connectedCallback(){var t,e;this.setAttribute("role","listbox"),this.tabIndex=-1,this.updateItems(),this.syncActiveIndexFromDataSelected(),this.updateActiveItem();const i=this.getAttribute("for");this.inputElement=i?document.getElementById(i):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-select-list-index]"):null;if(e&&e.hasAttribute("data-select-list-index")){const t=Number(e.getAttribute("data-select-list-index"));this.select(t)}}),this.observer=new MutationObserver(t=>{t.some(t=>"childList"===t.type)&&this.handleChildrenChanged(),t.some(t=>"attributes"===t.type&&"data-selected"===t.attributeName)&&(this.syncActiveIndexFromDataSelected(),this.updateActiveItem())}),this.observer.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["data-selected"]}),this.slotElement=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),null===(e=this.slotElement)||void 0===e||e.addEventListener("slotchange",this.handleChildrenChanged)}disconnectedCallback(){var t,e;null===(t=this.observer)||void 0===t||t.disconnect(),this.observer=null,null===(e=this.slotElement)||void 0===e||e.removeEventListener("slotchange",this.handleChildrenChanged)}syncActiveIndexFromDataSelected(){const t=this.items.findIndex(t=>t.hasAttribute("data-selected"));t>=0&&(this.activeIndex=t)}updateItems(){const t=["button:not([disabled])","a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])",'[tabindex]:not([tabindex="-1"])','[role="option"]'].join(", ");this.items=Array.from(this.querySelectorAll(t)),this.items.forEach((t,e)=>{t.hasAttribute("id")||t.setAttribute("id","".concat(this.id,"-option-").concat(e)),t.setAttribute("data-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){t.preventDefault();const e=this.items[this.activeIndex];null==e||e.click()}}updateActiveItem(){const t=this.activeClass.split(" ");this.items.forEach((e,i)=>{const s=i===this.activeIndex;t.forEach(t=>{e.classList.toggle(t,s)}),e.setAttribute("aria-selected",s.toString())});const e=this.items[this.activeIndex];e&&this.inputElement?(this.inputElement.setAttribute("aria-activedescendant",e.id),e.scrollIntoView({block:"nearest"})):this.inputElement&&this.inputElement.removeAttribute("aria-activedescendant")}select(t){this.activeIndex=t,this.items.forEach(t=>t.removeAttribute("data-selected"));const i=this.items[t];i&&(i.setAttribute("data-selected",""),this.dispatchEvent(new e(t,i)),this.updateActiveItem())}}customElements.get("bl-select-list")||customElements.define("bl-select-list",i)})();
|
package/dist/js/utils.bundle.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict"})();
|
package/dist/merged.scss
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Blue Web v1.
|
|
2
|
+
* Blue Web v1.32.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
|
|
|
@@ -50,6 +50,9 @@ $input-focus-border-color: #{rgba(var(--bs-primary-rgb), 50%)} !default;
|
|
|
50
50
|
$enable-button-pointers: true !default;
|
|
51
51
|
$focus-ring-width: 0.125rem !default;
|
|
52
52
|
|
|
53
|
+
$accordion-padding-x: 1rem !default;
|
|
54
|
+
$accordion-padding-y: 0.75rem !default;
|
|
55
|
+
|
|
53
56
|
|
|
54
57
|
// Bootstrap functions
|
|
55
58
|
//
|
|
@@ -12126,6 +12129,60 @@ dialog.blue-modal:has(.offcanvas-start) {
|
|
|
12126
12129
|
}
|
|
12127
12130
|
}
|
|
12128
12131
|
|
|
12132
|
+
.blue-layout-splitter {
|
|
12133
|
+
height: 100%;
|
|
12134
|
+
|
|
12135
|
+
// Set styles for sp-split-view
|
|
12136
|
+
&:is(sp-split-view) {
|
|
12137
|
+
--mod-splitview-handle-background-color: transparent;
|
|
12138
|
+
--mod-splitview-handle-background-color-down: var(--bs-primary-text-emphasis);
|
|
12139
|
+
--mod-splitview-handle-background-color-hover: var(--bs-gray-400);
|
|
12140
|
+
--mod-splitview-handle-background-color-key-focus: var(--bs-gray-300);
|
|
12141
|
+
--mod-splitview-handle-background-color-mouse-focus: var(--bs-gray-300);
|
|
12142
|
+
--mod-splitview-handle-width: 6px;
|
|
12143
|
+
--mod-splitview-handle-height: 6px;
|
|
12144
|
+
--mod-splitview-gripper-width: 0;
|
|
12145
|
+
--mod-splitview-gripper-border-width-vertical: 0;
|
|
12146
|
+
--mod-splitview-gripper-border-width-horizontal: 0;
|
|
12147
|
+
|
|
12148
|
+
@media (prefers-color-scheme: dark) {
|
|
12149
|
+
& {
|
|
12150
|
+
--mod-splitview-handle-background-color: transparent;
|
|
12151
|
+
--mod-splitview-handle-background-color-down: var(--bs-primary-text-emphasis);
|
|
12152
|
+
--mod-splitview-handle-background-color-hover: var(--bs-gray-600);
|
|
12153
|
+
--mod-splitview-handle-background-color-key-focus: var(--bs-gray-700);
|
|
12154
|
+
--mod-splitview-handle-background-color-mouse-focus: var(--bs-gray-700);
|
|
12155
|
+
}
|
|
12156
|
+
}
|
|
12157
|
+
|
|
12158
|
+
&:not([resizable]) {
|
|
12159
|
+
& > *:first-child {
|
|
12160
|
+
width: 100%;
|
|
12161
|
+
height: 100%;
|
|
12162
|
+
}
|
|
12163
|
+
& > *:last-child {
|
|
12164
|
+
@include media-breakpoint-up(lg) {
|
|
12165
|
+
display: none;
|
|
12166
|
+
}
|
|
12167
|
+
}
|
|
12168
|
+
}
|
|
12169
|
+
}
|
|
12170
|
+
}
|
|
12171
|
+
|
|
12172
|
+
.blue-layout-inspector {
|
|
12173
|
+
&:not([open]) {
|
|
12174
|
+
& > .offcanvas {
|
|
12175
|
+
--spacing: 0.5rem;
|
|
12176
|
+
width: 100%;
|
|
12177
|
+
height: calc(100% - var(--spacing));
|
|
12178
|
+
|
|
12179
|
+
& > .offcanvas-body {
|
|
12180
|
+
padding-inline: var(--spacing);
|
|
12181
|
+
}
|
|
12182
|
+
}
|
|
12183
|
+
}
|
|
12184
|
+
}
|
|
12185
|
+
|
|
12129
12186
|
// Collapse with details and animated
|
|
12130
12187
|
.blue-collapse {
|
|
12131
12188
|
interpolate-size: allow-keywords;
|
|
@@ -12390,6 +12447,33 @@ dialog.blue-modal:has(.offcanvas-start) {
|
|
|
12390
12447
|
max-height: 100px;
|
|
12391
12448
|
}
|
|
12392
12449
|
|
|
12450
|
+
// Let's you use Bootstrap's Accordion component with the native HTML Details element. No JavaScript necessary then anymore.
|
|
12451
|
+
details[open] summary > .accordion-button {
|
|
12452
|
+
@extend .accordion-button, :not(.collapsed);
|
|
12453
|
+
}
|
|
12454
|
+
|
|
12455
|
+
details.accordion-item:last-of-type[open] > .accordion-header .accordion-button.collapsed {
|
|
12456
|
+
border-bottom-right-radius: 0;
|
|
12457
|
+
border-bottom-left-radius: 0;
|
|
12458
|
+
}
|
|
12459
|
+
|
|
12460
|
+
.blue-accordion {
|
|
12461
|
+
&,
|
|
12462
|
+
details.accordion-item {
|
|
12463
|
+
display: flex;
|
|
12464
|
+
flex-direction: column;
|
|
12465
|
+
}
|
|
12466
|
+
|
|
12467
|
+
details.accordion-item[open],
|
|
12468
|
+
details.accordion-item[open]::details-content {
|
|
12469
|
+
flex-grow: 1;
|
|
12470
|
+
}
|
|
12471
|
+
|
|
12472
|
+
.accordion-body {
|
|
12473
|
+
height: 100%;
|
|
12474
|
+
}
|
|
12475
|
+
}
|
|
12476
|
+
|
|
12393
12477
|
|
|
12394
12478
|
/* Make DevExpress components look more like Bootstrap/Blue */
|
|
12395
12479
|
[class^="dxbl-"]:not(.dxbl-btn-tool):not(.dxbl-toolbar-item):not(:is(.dxbl-toolbar-btn-ellipsis > .dxbl-btn)) {
|