blue-web 1.36.3 → 1.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/js/utils.js CHANGED
@@ -1,108 +1,6 @@
1
- export function startLoading() {
2
- ;
3
- document.querySelector(".blue-loading").style.display = "block";
4
- }
5
- export function finishLoading() {
6
- ;
7
- document.querySelector(".blue-loading").style.display = "";
8
- }
9
- export function showSuccess() {
10
- ;
11
- document.querySelector(".blue-status-success").style.display = "flex";
12
- }
13
- export function hideSuccess() {
14
- ;
15
- document.querySelector(".blue-status-success").style.display = "";
16
- }
17
-
18
- /**
19
- * Resets alert messages that was set with `setAlertMessage`.
20
- * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v9/component/StatusProvider
21
- * @param alertClassName Leave empty to reset messages of any status type
22
- */
23
- export function resetAlertMessage(alertClassName) {
24
- if (!alertClassName) {
25
- ;
26
- ["loading", "success", "info", "warning", "danger"].forEach(status => {
27
- resetAlertMessage(status);
28
- });
29
- } else {
30
- const alertElement = document.querySelector(".blue-status-alert");
31
- const statusElement = document.querySelector(".blue-status-" + alertClassName);
32
- if (statusElement) statusElement.style.display = "";
33
- if (alertElement) {
34
- alertElement.style.display = "";
35
- alertElement.classList.remove("alert-" + (alertClassName === "loading" ? "info" : alertClassName));
36
- }
37
- }
38
- }
39
-
40
- /**
41
- * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v9/component/StatusProvider
42
- */
43
- export function setAlertMessage(message) {
44
- let alertClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "info";
45
- let close = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
46
- let detailText = arguments.length > 3 ? arguments[3] : undefined;
47
- const alertElement = document.querySelector(".blue-status-alert");
48
- const statusElement = document.querySelector(".blue-status-" + alertClassName);
49
- if (statusElement) statusElement.style.display = "flex";
50
- if (alertElement) {
51
- alertElement.style.display = "block";
52
- alertElement.classList.add("alert-" + (alertClassName === "loading" ? "info" : alertClassName));
53
- alertElement.querySelector(".alert-body").innerHTML = "<h2>" + message + "</h2>";
54
- if (detailText) {
55
- alertElement.querySelector(".alert-body").innerHTML += "<span>" + detailText + "</span>";
56
- }
57
- const btnCloseElement = alertElement.querySelector(".btn-close");
58
- if (close) {
59
- btnCloseElement.style.display = "inline-block";
60
- btnCloseElement.onclick = () => {
61
- resetAlertMessage(alertClassName);
62
- };
63
- } else {
64
- btnCloseElement.style.display = "none";
65
- }
66
- }
67
- }
1
+ // src/js/utils.ts
68
2
  function s4() {
69
- return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
70
- }
71
- export const guid = () => s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
72
- export function scrollToTop() {
73
- const routerPage = document.querySelector(".router-page.active");
74
- routerPage.scroll({
75
- behavior: "smooth",
76
- left: 0,
77
- top: 0
78
- });
3
+ return Math.floor((1 + Math.random()) * 65536).toString(16).substring(1);
79
4
  }
80
- const httpStatusCodes = {
81
- 400: "Bad Request",
82
- 401: "Unauthorized",
83
- 403: "Forbidden",
84
- 404: "Not Found",
85
- 405: "Method Not Allowed",
86
- 408: "Request Timeout",
87
- 409: "Conflict",
88
- 500: "Internal Server Error",
89
- 502: "Bad Gateway"
90
- };
91
- export function fetchData(input, init) {
92
- let showErrorDetail = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
93
- let onError = arguments.length > 3 ? arguments[3] : undefined;
94
- return fetch(input, init).then(response => {
95
- if (!response.ok) throw response;
96
- return response;
97
- }).catch(reason => {
98
- if (reason.text) {
99
- reason.text().then(errorMessage => {
100
- setAlertMessage("".concat(reason.status, " - ").concat(reason.statusText || httpStatusCodes[reason.status] || "Error"), "danger", true, showErrorDetail ? errorMessage.toString().replace(/(<style[\w\W]+style>)/g, "").replace(/<[^>]+>/g, "") : undefined);
101
- if (onError) {
102
- onError(errorMessage, reason);
103
- }
104
- });
105
- }
106
- throw reason;
107
- });
108
- }
5
+ var guid = () => s4() + s4() + "-" + s4() + "-" + s4() + "-" + s4() + "-" + s4() + s4() + s4();
6
+ export { guid };
package/dist/merged.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Blue Web v1.36.3 (https://bruegmann.github.io/blue-web)
2
+ * Blue Web v1.37.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
 
@@ -12538,6 +12538,63 @@ details.accordion-item:last-of-type[open] > .accordion-header .accordion-button.
12538
12538
  }
12539
12539
  }
12540
12540
 
12541
+ // Base styles with focus on functionality
12542
+ bl-quick-look {
12543
+ display: contents;
12544
+ }
12545
+
12546
+ bl-quick-look-backdrop {
12547
+ position: fixed;
12548
+ z-index: 20;
12549
+ inset: 0;
12550
+ background: rgb(22 21 24 / 38%);
12551
+ backdrop-filter: blur(7px);
12552
+ opacity: 1;
12553
+ transition: opacity 180ms ease;
12554
+ }
12555
+
12556
+ bl-quick-look-backdrop[hidden],
12557
+ bl-quick-look-content[hidden] {
12558
+ display: none !important;
12559
+ }
12560
+
12561
+ bl-quick-look-backdrop:is([data-starting-style], [data-ending-style]) {
12562
+ opacity: 0;
12563
+ }
12564
+
12565
+ bl-quick-look-content {
12566
+ position: fixed;
12567
+ z-index: 21;
12568
+ inset: 50% auto auto 50%;
12569
+ display: grid;
12570
+ width: min(1320px, calc(100vw - 2rem));
12571
+ height: min(720px, calc(100dvh - 2rem));
12572
+ grid-template-rows: auto minmax(0, 1fr) auto;
12573
+ padding: 0;
12574
+ overflow: hidden;
12575
+ transform: translate(-50%, -50%);
12576
+ opacity: 1;
12577
+ transition:
12578
+ opacity 180ms ease,
12579
+ scale 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
12580
+ }
12581
+
12582
+ bl-quick-look-content:is([data-starting-style], [data-ending-style]) {
12583
+ scale: 0.97;
12584
+ opacity: 0;
12585
+ }
12586
+
12587
+ // Themed styles
12588
+
12589
+ .blue-quick-look {
12590
+ bl-quick-look-content {
12591
+ border: var(--bs-border-width) var(--bs-border-style) var(--bs-border-color);
12592
+ border-radius: var(--bs-border-radius-lg);
12593
+ background-color: var(--bs-body-bg);
12594
+ box-shadow: var(--bs-box-shadow-lg);
12595
+ }
12596
+ }
12597
+
12541
12598
 
12542
12599
  /* Make DevExpress components look more like Bootstrap/Blue */
12543
12600
  [class^="dxbl-"]:not(.dxbl-btn-tool):not(.dxbl-toolbar-item):not(:is(.dxbl-toolbar-btn-ellipsis > .dxbl-btn)) {