@bluevolt-tech/lumen 2.1.0 → 2.2.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/components/_shared/date-range-validator.d.ts +26 -1
- package/dist/components/_shared/dropdown-controller.d.ts +29 -0
- package/dist/components/bv-date-range-input/bv-date-range-input.d.ts +7 -1
- package/dist/components/bv-date-range-input/bv-date-range-input.js +233 -94
- package/dist/components/bv-date-range-picker/bv-date-range-picker.d.ts +61 -8
- package/dist/components/bv-date-range-picker/bv-date-range-picker.js +180 -81
- package/dist/components/bv-filter-dropdown/bv-filter-dropdown.js +10 -8
- package/dist/components/bv-input-dropdown/bv-input-dropdown.js +10 -8
- package/dist/components/bv-select/bv-select.js +10 -8
- package/dist/components/bv-split-button/bv-split-button.js +10 -8
- package/dist/components/bv-table/bv-table.js +1 -0
- package/dist/components/bv-tooltip/bv-tooltip.js +1 -0
- package/dist/themes/base.css +1 -1
- package/package.json +1 -1
- package/themes/base.css +1 -1
|
@@ -21,8 +21,7 @@ function adoptStyles(shadow, css) {
|
|
|
21
21
|
|
|
22
22
|
// components/_shared/dropdown-controller.ts
|
|
23
23
|
function bindDropdownController(host, options = {}) {
|
|
24
|
-
|
|
25
|
-
if (!shadow) {
|
|
24
|
+
if (!host.shadowRoot) {
|
|
26
25
|
throw new Error("bindDropdownController requires the host to have an open shadow root.");
|
|
27
26
|
}
|
|
28
27
|
const syncExpanded = () => {
|
|
@@ -37,24 +36,27 @@ function bindDropdownController(host, options = {}) {
|
|
|
37
36
|
syncExpanded();
|
|
38
37
|
host.dispatchEvent(new CustomEvent("bv-open", { bubbles: true, composed: true }));
|
|
39
38
|
};
|
|
40
|
-
const
|
|
39
|
+
const closeWithReason = (reason) => {
|
|
40
|
+
var _a;
|
|
41
41
|
if (!host.hasAttribute("open")) return;
|
|
42
|
+
if (options.canClose && !options.canClose(reason)) return;
|
|
42
43
|
host.removeAttribute("open");
|
|
43
44
|
syncExpanded();
|
|
45
|
+
(_a = options.onAfterClose) == null ? void 0 : _a.call(options);
|
|
44
46
|
};
|
|
47
|
+
const close = () => closeWithReason("programmatic");
|
|
45
48
|
const toggle = () => {
|
|
46
|
-
if (host.hasAttribute("open"))
|
|
49
|
+
if (host.hasAttribute("open")) closeWithReason("programmatic");
|
|
47
50
|
else open();
|
|
48
51
|
};
|
|
49
52
|
const offClick = (e) => {
|
|
50
53
|
if (!host.hasAttribute("open")) return;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
close();
|
|
54
|
+
if (e.composedPath().includes(host)) return;
|
|
55
|
+
closeWithReason("outside-click");
|
|
54
56
|
};
|
|
55
57
|
document.addEventListener("click", offClick);
|
|
56
58
|
const onKeyDown = (e) => {
|
|
57
|
-
if (e.key === "Escape")
|
|
59
|
+
if (e.key === "Escape") closeWithReason("escape");
|
|
58
60
|
};
|
|
59
61
|
host.addEventListener("keydown", onKeyDown);
|
|
60
62
|
const observer = new MutationObserver(syncExpanded);
|
|
@@ -21,8 +21,7 @@ function adoptStyles(shadow, css) {
|
|
|
21
21
|
|
|
22
22
|
// components/_shared/dropdown-controller.ts
|
|
23
23
|
function bindDropdownController(host, options = {}) {
|
|
24
|
-
|
|
25
|
-
if (!shadow) {
|
|
24
|
+
if (!host.shadowRoot) {
|
|
26
25
|
throw new Error("bindDropdownController requires the host to have an open shadow root.");
|
|
27
26
|
}
|
|
28
27
|
const syncExpanded = () => {
|
|
@@ -37,24 +36,27 @@ function bindDropdownController(host, options = {}) {
|
|
|
37
36
|
syncExpanded();
|
|
38
37
|
host.dispatchEvent(new CustomEvent("bv-open", { bubbles: true, composed: true }));
|
|
39
38
|
};
|
|
40
|
-
const
|
|
39
|
+
const closeWithReason = (reason) => {
|
|
40
|
+
var _a;
|
|
41
41
|
if (!host.hasAttribute("open")) return;
|
|
42
|
+
if (options.canClose && !options.canClose(reason)) return;
|
|
42
43
|
host.removeAttribute("open");
|
|
43
44
|
syncExpanded();
|
|
45
|
+
(_a = options.onAfterClose) == null ? void 0 : _a.call(options);
|
|
44
46
|
};
|
|
47
|
+
const close = () => closeWithReason("programmatic");
|
|
45
48
|
const toggle = () => {
|
|
46
|
-
if (host.hasAttribute("open"))
|
|
49
|
+
if (host.hasAttribute("open")) closeWithReason("programmatic");
|
|
47
50
|
else open();
|
|
48
51
|
};
|
|
49
52
|
const offClick = (e) => {
|
|
50
53
|
if (!host.hasAttribute("open")) return;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
close();
|
|
54
|
+
if (e.composedPath().includes(host)) return;
|
|
55
|
+
closeWithReason("outside-click");
|
|
54
56
|
};
|
|
55
57
|
document.addEventListener("click", offClick);
|
|
56
58
|
const onKeyDown = (e) => {
|
|
57
|
-
if (e.key === "Escape")
|
|
59
|
+
if (e.key === "Escape") closeWithReason("escape");
|
|
58
60
|
};
|
|
59
61
|
host.addEventListener("keydown", onKeyDown);
|
|
60
62
|
const observer = new MutationObserver(syncExpanded);
|
|
@@ -100,6 +100,7 @@ var BvTooltip = class extends HTMLElement {
|
|
|
100
100
|
popup.style.transform = "none";
|
|
101
101
|
popup.style.display = "block";
|
|
102
102
|
popup.style.visibility = "hidden";
|
|
103
|
+
void popup.offsetHeight;
|
|
103
104
|
const tRect = trigger.getBoundingClientRect();
|
|
104
105
|
const pRect = popup.getBoundingClientRect();
|
|
105
106
|
const vw = window.innerWidth;
|
|
@@ -97,6 +97,7 @@ var BvTooltip = class extends HTMLElement {
|
|
|
97
97
|
popup.style.transform = "none";
|
|
98
98
|
popup.style.display = "block";
|
|
99
99
|
popup.style.visibility = "hidden";
|
|
100
|
+
void popup.offsetHeight;
|
|
100
101
|
const tRect = trigger.getBoundingClientRect();
|
|
101
102
|
const pRect = popup.getBoundingClientRect();
|
|
102
103
|
const vw = window.innerWidth;
|
package/dist/themes/base.css
CHANGED
package/package.json
CHANGED