@bluevolt-tech/lumen 1.5.2 → 2.0.1
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/bv-alert-banner/bv-alert-banner.d.ts +33 -0
- package/dist/components/bv-alert-banner/bv-alert-banner.js +206 -0
- package/dist/components/bv-badge/bv-badge.d.ts +1 -1
- package/dist/components/bv-badge/bv-badge.js +1 -1
- package/dist/components/bv-button/bv-button.d.ts +1 -1
- package/dist/components/bv-button/bv-button.js +1 -1
- package/dist/components/bv-checkbox/bv-checkbox.js +1 -1
- package/dist/components/bv-course-detail-modal/bv-course-detail-modal.js +1 -1
- package/dist/components/bv-course-grid-card/bv-course-grid-card.d.ts +4 -0
- package/dist/components/bv-course-grid-card/bv-course-grid-card.js +75 -18
- package/dist/components/bv-course-list-card/bv-course-list-card.d.ts +4 -0
- package/dist/components/bv-course-list-card/bv-course-list-card.js +75 -18
- package/dist/components/bv-date-range-input/bv-date-range-input.d.ts +23 -0
- package/dist/components/bv-date-range-input/bv-date-range-input.js +950 -0
- package/dist/components/bv-date-range-picker/bv-date-range-picker.d.ts +56 -0
- package/dist/components/bv-date-range-picker/bv-date-range-picker.js +778 -0
- package/dist/components/bv-empty-state/bv-empty-state.js +1 -1
- package/dist/components/bv-filter-dropdown/bv-filter-dropdown.d.ts +20 -5
- package/dist/components/bv-filter-dropdown/bv-filter-dropdown.js +263 -25
- package/dist/components/bv-filter-panel/bv-filter-panel.js +1 -1
- package/dist/components/bv-input/bv-input.d.ts +24 -0
- package/dist/components/bv-input/bv-input.js +148 -0
- package/dist/components/bv-input-dropdown/bv-input-dropdown.d.ts +46 -0
- package/dist/components/bv-input-dropdown/bv-input-dropdown.js +501 -0
- package/dist/components/bv-pagination/bv-pagination.d.ts +13 -1
- package/dist/components/bv-pagination/bv-pagination.js +290 -9
- package/dist/components/bv-portal-header/bv-portal-header.js +2 -2
- package/dist/components/bv-searchbox/bv-searchbox.js +1 -1
- package/dist/components/bv-segmented-control/bv-segmented-control.d.ts +26 -0
- package/dist/components/bv-segmented-control/bv-segmented-control.js +128 -0
- package/dist/components/bv-select/bv-select.d.ts +41 -0
- package/dist/components/bv-select/bv-select.js +240 -0
- package/dist/components/bv-split-button/bv-split-button.d.ts +37 -0
- package/dist/components/bv-split-button/bv-split-button.js +264 -0
- package/dist/components/bv-table/bv-table.d.ts +15 -0
- package/dist/components/bv-table/bv-table.js +260 -33
- package/dist/components/bv-toggle/bv-toggle.d.ts +2 -1
- package/dist/components/bv-toggle/bv-toggle.js +2 -2
- package/dist/components/bv-tooltip/bv-tooltip.d.ts +18 -0
- package/dist/components/bv-tooltip/bv-tooltip.js +144 -0
- package/dist/components/bv-user-row/bv-user-row.js +1 -1
- package/dist/storybook/stories/screens/cet-report.data.d.ts +55 -0
- package/dist/storybook/stories/screens/cet-report.data.js +3697 -0
- package/dist/themes/base.css +15 -1
- package/package.json +42 -1
- package/themes/base.css +15 -1
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-input-dropdown/bv-input-dropdown.css
|
|
2
|
+
var bv_input_dropdown_default = ":host {\n display: block;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n/* \u2500\u2500 Field label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.field-label {\n display: block;\n font-size: var(--bv-font-size-sm);\n line-height: 20px;\n font-weight: var(--bv-font-weight-semibold);\n color: var(--bv-color-neutral-800);\n margin-bottom: 6px;\n}\n\n.required-mark {\n color: var(--bv-color-danger);\n margin-left: 2px;\n}\n\n/* \u2500\u2500 Trigger \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.trigger {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n height: 44px;\n box-sizing: border-box;\n padding: 0 var(--bv-spacing-md);\n background: var(--bv-color-neutral-0);\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--bv-font-size-sm);\n color: var(--bv-color-neutral-800);\n text-align: left;\n transition:\n border-color var(--bv-transition-fast),\n box-shadow var(--bv-transition-fast);\n}\n\n.trigger:focus-visible {\n outline: none;\n border-color: var(--bv-color-primary);\n box-shadow:\n 0 0 0 3px var(--bv-color-primary-light),\n 0 1px 2px 0 rgba(16, 24, 40, 0.05);\n}\n\n:host([open]) .trigger {\n border-color: var(--bv-color-primary);\n box-shadow:\n 0 0 0 3px var(--bv-color-primary-light),\n 0 1px 2px 0 rgba(16, 24, 40, 0.05);\n}\n\n:host([disabled]) .trigger {\n background: var(--bv-color-neutral-100);\n color: var(--bv-color-neutral-400);\n cursor: not-allowed;\n}\n\n:host([error]:not([error=''])) .trigger {\n border-color: var(--bv-color-danger);\n}\n\n.trigger-label {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.trigger-label.is-placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.trigger-chevron {\n display: flex;\n color: var(--bv-color-neutral-500);\n flex-shrink: 0;\n margin-left: var(--bv-spacing-sm);\n transition: transform var(--bv-transition-fast);\n}\n\n:host([open]) .trigger-chevron {\n transform: rotate(180deg);\n}\n\n/* \u2500\u2500 Panel \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.panel {\n display: none;\n position: absolute;\n top: calc(100% + 4px);\n left: 0;\n min-width: 100%;\n width: max-content;\n max-width: 600px;\n background: var(--bv-color-neutral-0);\n border: 1px solid var(--bv-color-neutral-200);\n border-radius: var(--bv-radius-lg);\n box-shadow: var(--bv-shadow-md);\n z-index: 200;\n overflow: hidden;\n}\n\n:host([toggle-label]) .panel {\n min-width: 260px;\n}\n\n:host([open]) .panel {\n display: block;\n}\n\n/* \u2500\u2500 Panel header (search + toolbar) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.panel-header {\n border-bottom: 1px solid var(--bv-color-neutral-200);\n padding: var(--bv-spacing-sm);\n display: flex;\n flex-direction: column;\n gap: var(--bv-spacing-xs);\n}\n\n.panel-toolbar {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: var(--bv-spacing-xs) 0;\n}\n\n/* \u2500\u2500 Panel content (scrollable slot area) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.panel-content {\n overflow-y: auto;\n max-height: var(--bv-input-dropdown-content-height, 280px);\n padding: var(--bv-spacing-xs) 0;\n}\n\n/* Stack all slotted content vertically */\n::slotted(*) {\n display: block;\n}\n\n/* Row padding \u2014 left aligns with the panel-header padding */\n::slotted(bv-checkbox) {\n padding: 6px var(--bv-spacing-sm);\n box-sizing: border-box;\n white-space: nowrap;\n max-width: 100%;\n}\n\n/* \u2500\u2500 Error message \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.field-error {\n display: block;\n font-size: var(--bv-font-size-xs);\n color: var(--bv-color-danger);\n margin-top: var(--bv-spacing-xs);\n}\n\n.field-error:empty {\n display: none;\n}\n";
|
|
3
|
+
|
|
4
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-searchbox/bv-searchbox.css
|
|
5
|
+
var bv_searchbox_default = ":host {\n display: block;\n width: 100%;\n position: relative;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n.search-icon {\n position: absolute;\n left: 12px;\n top: 50%;\n transform: translateY(-50%);\n color: var(--bv-color-neutral-400);\n display: flex;\n pointer-events: none;\n}\n\n.search-input {\n width: 100%;\n box-sizing: border-box;\n height: 40px;\n padding: 0 12px 0 38px;\n font-size: var(--bv-font-size-sm);\n font-family: inherit;\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n transition: border-color var(--bv-transition-fast);\n}\n\n:host([size='sm']) .search-input {\n height: 36px;\n}\n:host([size='lg']) .search-input {\n height: 46px;\n}\n\n.search-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.search-input:focus {\n border-color: #6fb0d8;\n box-shadow:\n 0px 0px 0px 4px #dbe8ff,\n 0px 1px 2px 0px rgba(16, 24, 40, 0.05);\n}\n";
|
|
6
|
+
|
|
7
|
+
// components/bv-searchbox/bv-searchbox.ts
|
|
8
|
+
var SEARCH_ICON = `<svg width="16" height="16" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
9
|
+
<path d="M17.5 17.5L13.875 13.875M15.8333 9.16667C15.8333 12.8486 12.8486 15.8333 9.16667 15.8333C5.48477 15.8333 2.5 12.8486 2.5 9.16667C2.5 5.48477 5.48477 2.5 9.16667 2.5C12.8486 2.5 15.8333 5.48477 15.8333 9.16667Z"
|
|
10
|
+
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
11
|
+
</svg>`;
|
|
12
|
+
var BvSearchbox = class extends HTMLElement {
|
|
13
|
+
static observedAttributes = ["placeholder", "value", "size"];
|
|
14
|
+
_rendered = false;
|
|
15
|
+
_input = null;
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.attachShadow({ mode: "open" });
|
|
19
|
+
if ("replaceSync" in CSSStyleSheet.prototype) {
|
|
20
|
+
const sheet = new CSSStyleSheet();
|
|
21
|
+
sheet.replaceSync(bv_searchbox_default);
|
|
22
|
+
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
connectedCallback() {
|
|
26
|
+
this._render();
|
|
27
|
+
}
|
|
28
|
+
attributeChangedCallback(name, _old, val) {
|
|
29
|
+
if (!this._rendered || !this._input) return;
|
|
30
|
+
if (name === "placeholder") this._input.placeholder = val ?? "";
|
|
31
|
+
if (name === "value") this._input.value = val ?? "";
|
|
32
|
+
}
|
|
33
|
+
get value() {
|
|
34
|
+
var _a;
|
|
35
|
+
return ((_a = this._input) == null ? void 0 : _a.value) ?? "";
|
|
36
|
+
}
|
|
37
|
+
_render() {
|
|
38
|
+
if (this._rendered) return;
|
|
39
|
+
this._rendered = true;
|
|
40
|
+
const shadow = this.shadowRoot;
|
|
41
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
42
|
+
const s = document.createElement("style");
|
|
43
|
+
s.textContent = bv_searchbox_default;
|
|
44
|
+
shadow.appendChild(s);
|
|
45
|
+
}
|
|
46
|
+
const icon = document.createElement("span");
|
|
47
|
+
icon.className = "search-icon";
|
|
48
|
+
icon.innerHTML = SEARCH_ICON;
|
|
49
|
+
this._input = document.createElement("input");
|
|
50
|
+
this._input.type = "search";
|
|
51
|
+
this._input.className = "search-input";
|
|
52
|
+
this._input.placeholder = this.getAttribute("placeholder") ?? "Search\u2026";
|
|
53
|
+
this._input.value = this.getAttribute("value") ?? "";
|
|
54
|
+
this._input.addEventListener("input", () => {
|
|
55
|
+
this.dispatchEvent(
|
|
56
|
+
new CustomEvent("bv-search", {
|
|
57
|
+
bubbles: true,
|
|
58
|
+
composed: true,
|
|
59
|
+
detail: { value: this._input.value }
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
});
|
|
63
|
+
shadow.append(icon, this._input);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
if (!customElements.get("bv-searchbox")) {
|
|
67
|
+
customElements.define("bv-searchbox", BvSearchbox);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-checkbox/bv-checkbox.css
|
|
71
|
+
var bv_checkbox_default = ":host {\n display: inline-flex;\n font-family: var(--bv-font-family-base);\n}\n\n/* \u2500\u2500 Size tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n:host,\n:host([size='sm']) {\n --_box-size: 16px;\n --_box-radius: 4px;\n --_gap: 8px;\n --_check-size: 10px;\n --_label-size: var(--bv-font-size-sm);\n --_label-lh: 20px;\n}\n\n:host([size='md']) {\n --_box-size: 20px;\n --_box-radius: 6px;\n --_gap: 12px;\n --_check-size: 12px;\n --_label-size: var(--bv-font-size-md);\n --_label-lh: 24px;\n}\n\n/* \u2500\u2500 Layout \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.wrap {\n display: inline-flex;\n align-items: flex-start;\n gap: var(--_gap);\n cursor: pointer;\n user-select: none;\n}\n\n:host([disabled]) .wrap {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n/* \u2500\u2500 Box \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.box {\n width: var(--_box-size);\n height: var(--_box-size);\n border-radius: var(--_box-radius);\n border: 1px solid var(--bv-color-neutral-300);\n background: var(--bv-color-neutral-0);\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin-top: 2px;\n transition:\n background var(--bv-transition-fast),\n border-color var(--bv-transition-fast);\n}\n\n:host([checked]) .box,\n:host([indeterminate]) .box {\n background: var(--bv-color-primary-50);\n border-color: var(--bv-color-primary);\n}\n\n/* \u2500\u2500 Check icon \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.check {\n display: none;\n width: var(--_check-size);\n height: var(--_check-size);\n color: var(--bv-color-primary);\n line-height: 0;\n}\n\n.check svg {\n width: 100%;\n height: 100%;\n display: block;\n}\n\n:host([checked]) .check,\n:host([indeterminate]) .check {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* \u2500\u2500 Label \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */\n\n.label {\n font-size: var(--_label-size);\n font-weight: var(--bv-font-weight-medium);\n color: var(--bv-color-secondary-foreground);\n line-height: var(--_label-lh);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n min-width: 0;\n}\n";
|
|
72
|
+
|
|
73
|
+
// components/bv-checkbox/bv-checkbox.ts
|
|
74
|
+
var CHECK_ICON = `<svg viewBox="0 0 11.3333 8.41667" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
75
|
+
<path d="M10.3333 1L3.91667 7.41667L1 4.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
76
|
+
</svg>`;
|
|
77
|
+
var INDETERMINATE_ICON = `<svg viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
78
|
+
<path d="M2 6H10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
|
|
79
|
+
</svg>`;
|
|
80
|
+
var BvCheckbox = class extends HTMLElement {
|
|
81
|
+
static observedAttributes = ["checked", "indeterminate", "disabled", "label", "size"];
|
|
82
|
+
_rendered = false;
|
|
83
|
+
_checkEl = null;
|
|
84
|
+
_labelEl = null;
|
|
85
|
+
constructor() {
|
|
86
|
+
super();
|
|
87
|
+
this.attachShadow({ mode: "open" });
|
|
88
|
+
if ("replaceSync" in CSSStyleSheet.prototype) {
|
|
89
|
+
const sheet = new CSSStyleSheet();
|
|
90
|
+
sheet.replaceSync(bv_checkbox_default);
|
|
91
|
+
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
connectedCallback() {
|
|
95
|
+
this._render();
|
|
96
|
+
}
|
|
97
|
+
attributeChangedCallback(name, _old, val) {
|
|
98
|
+
if (!this._rendered) return;
|
|
99
|
+
if (name === "checked" || name === "indeterminate") this._syncIcon();
|
|
100
|
+
if (name === "label" && this._labelEl) this._labelEl.textContent = val ?? "";
|
|
101
|
+
}
|
|
102
|
+
get checked() {
|
|
103
|
+
return this.hasAttribute("checked");
|
|
104
|
+
}
|
|
105
|
+
set checked(v) {
|
|
106
|
+
if (v) this.setAttribute("checked", "");
|
|
107
|
+
else this.removeAttribute("checked");
|
|
108
|
+
}
|
|
109
|
+
get indeterminate() {
|
|
110
|
+
return this.hasAttribute("indeterminate");
|
|
111
|
+
}
|
|
112
|
+
_render() {
|
|
113
|
+
if (this._rendered) return;
|
|
114
|
+
this._rendered = true;
|
|
115
|
+
const shadow = this.shadowRoot;
|
|
116
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
117
|
+
const s = document.createElement("style");
|
|
118
|
+
s.textContent = bv_checkbox_default;
|
|
119
|
+
shadow.appendChild(s);
|
|
120
|
+
}
|
|
121
|
+
const wrap = document.createElement("label");
|
|
122
|
+
wrap.className = "wrap";
|
|
123
|
+
const box = document.createElement("span");
|
|
124
|
+
box.className = "box";
|
|
125
|
+
this._checkEl = document.createElement("span");
|
|
126
|
+
this._checkEl.className = "check";
|
|
127
|
+
this._syncIcon();
|
|
128
|
+
box.appendChild(this._checkEl);
|
|
129
|
+
this._labelEl = document.createElement("span");
|
|
130
|
+
this._labelEl.className = "label";
|
|
131
|
+
this._labelEl.textContent = this.getAttribute("label") ?? "";
|
|
132
|
+
const slot = document.createElement("slot");
|
|
133
|
+
wrap.append(box, this._labelEl, slot);
|
|
134
|
+
shadow.appendChild(wrap);
|
|
135
|
+
wrap.addEventListener("click", () => {
|
|
136
|
+
if (this.hasAttribute("disabled")) return;
|
|
137
|
+
this.checked = !this.checked;
|
|
138
|
+
this.removeAttribute("indeterminate");
|
|
139
|
+
this.dispatchEvent(
|
|
140
|
+
new CustomEvent("bv-change", {
|
|
141
|
+
bubbles: true,
|
|
142
|
+
composed: true,
|
|
143
|
+
detail: { checked: this.checked }
|
|
144
|
+
})
|
|
145
|
+
);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
_syncIcon() {
|
|
149
|
+
if (!this._checkEl) return;
|
|
150
|
+
this._checkEl.innerHTML = this.indeterminate ? INDETERMINATE_ICON : CHECK_ICON;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
if (!customElements.get("bv-checkbox")) {
|
|
154
|
+
customElements.define("bv-checkbox", BvCheckbox);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-toggle/bv-toggle.css
|
|
158
|
+
var bv_toggle_default = ":host {\n --bv-toggle-width: 44px;\n --bv-toggle-height: 24px;\n --bv-toggle-track-off: var(--bv-color-neutral-300);\n --bv-toggle-track-on: var(--bv-color-primary);\n --bv-toggle-thumb: var(--bv-color-neutral-0);\n display: inline-flex;\n font-family: var(--bv-font-family-base);\n}\n\n:host([hidden]) {\n display: none;\n}\n\n:host([size='sm']) {\n --bv-toggle-width: 32px;\n --bv-toggle-height: 18px;\n}\n\n.wrap {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n cursor: pointer;\n user-select: none;\n}\n\n:host([disabled]) .wrap {\n cursor: not-allowed;\n opacity: 0.5;\n}\n\n.track {\n position: relative;\n width: var(--bv-toggle-width);\n height: var(--bv-toggle-height);\n border-radius: var(--bv-radius-full);\n background: var(--bv-toggle-track-off);\n transition: background var(--bv-transition-fast);\n flex-shrink: 0;\n}\n\n:host([checked]) .track {\n background: var(--bv-toggle-track-on);\n}\n\n.thumb {\n position: absolute;\n top: 3px;\n left: 3px;\n width: calc(var(--bv-toggle-height) - 6px);\n height: calc(var(--bv-toggle-height) - 6px);\n border-radius: 50%;\n background: var(--bv-toggle-thumb);\n box-shadow: var(--bv-shadow-sm);\n transition: transform var(--bv-transition-fast);\n}\n\n:host([checked]) .thumb {\n transform: translateX(calc(var(--bv-toggle-width) - var(--bv-toggle-height)));\n}\n\n.label {\n font-size: var(--bv-font-size-sm);\n color: var(--bv-color-neutral-800);\n line-height: 20px;\n}\n\n:host([size='sm']) .label {\n font-size: var(--bv-font-size-xs);\n line-height: 18px;\n}\n";
|
|
159
|
+
|
|
160
|
+
// components/bv-toggle/bv-toggle.ts
|
|
161
|
+
var BvToggle = class extends HTMLElement {
|
|
162
|
+
static observedAttributes = ["checked", "disabled", "label", "size"];
|
|
163
|
+
_rendered = false;
|
|
164
|
+
_labelEl = null;
|
|
165
|
+
constructor() {
|
|
166
|
+
super();
|
|
167
|
+
this.attachShadow({ mode: "open" });
|
|
168
|
+
if ("replaceSync" in CSSStyleSheet.prototype) {
|
|
169
|
+
const sheet = new CSSStyleSheet();
|
|
170
|
+
sheet.replaceSync(bv_toggle_default);
|
|
171
|
+
this.shadowRoot.adoptedStyleSheets = [sheet];
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
connectedCallback() {
|
|
175
|
+
this._render();
|
|
176
|
+
}
|
|
177
|
+
attributeChangedCallback(name, _old, val) {
|
|
178
|
+
if (!this._rendered) return;
|
|
179
|
+
if (name === "label" && this._labelEl) this._labelEl.textContent = val ?? "";
|
|
180
|
+
}
|
|
181
|
+
get checked() {
|
|
182
|
+
return this.hasAttribute("checked");
|
|
183
|
+
}
|
|
184
|
+
set checked(v) {
|
|
185
|
+
if (v) this.setAttribute("checked", "");
|
|
186
|
+
else this.removeAttribute("checked");
|
|
187
|
+
}
|
|
188
|
+
_render() {
|
|
189
|
+
if (this._rendered) return;
|
|
190
|
+
this._rendered = true;
|
|
191
|
+
const shadow = this.shadowRoot;
|
|
192
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
193
|
+
const s = document.createElement("style");
|
|
194
|
+
s.textContent = bv_toggle_default;
|
|
195
|
+
shadow.appendChild(s);
|
|
196
|
+
}
|
|
197
|
+
const wrap = document.createElement("label");
|
|
198
|
+
wrap.className = "wrap";
|
|
199
|
+
const track = document.createElement("span");
|
|
200
|
+
track.className = "track";
|
|
201
|
+
const thumb = document.createElement("span");
|
|
202
|
+
thumb.className = "thumb";
|
|
203
|
+
track.appendChild(thumb);
|
|
204
|
+
this._labelEl = document.createElement("span");
|
|
205
|
+
this._labelEl.className = "label";
|
|
206
|
+
this._labelEl.textContent = this.getAttribute("label") ?? "";
|
|
207
|
+
const slot = document.createElement("slot");
|
|
208
|
+
wrap.append(track, this._labelEl, slot);
|
|
209
|
+
shadow.appendChild(wrap);
|
|
210
|
+
wrap.addEventListener("click", () => {
|
|
211
|
+
if (this.hasAttribute("disabled")) return;
|
|
212
|
+
this.checked = !this.checked;
|
|
213
|
+
this.dispatchEvent(
|
|
214
|
+
new CustomEvent("bv-change", {
|
|
215
|
+
bubbles: true,
|
|
216
|
+
composed: true,
|
|
217
|
+
detail: { checked: this.checked }
|
|
218
|
+
})
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
if (!customElements.get("bv-toggle")) {
|
|
224
|
+
customElements.define("bv-toggle", BvToggle);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// components/bv-input-dropdown/bv-input-dropdown.ts
|
|
228
|
+
var CHEVRON_ICON = `<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><polyline points="6 9 12 15 18 9"/></svg>`;
|
|
229
|
+
var _sheet = null;
|
|
230
|
+
function getSheet() {
|
|
231
|
+
if (!_sheet) {
|
|
232
|
+
_sheet = new CSSStyleSheet();
|
|
233
|
+
_sheet.replaceSync(bv_input_dropdown_default);
|
|
234
|
+
}
|
|
235
|
+
return _sheet;
|
|
236
|
+
}
|
|
237
|
+
var BvInputDropdown = class extends HTMLElement {
|
|
238
|
+
static observedAttributes = [
|
|
239
|
+
"label",
|
|
240
|
+
"value",
|
|
241
|
+
"placeholder",
|
|
242
|
+
"required",
|
|
243
|
+
"disabled",
|
|
244
|
+
"error",
|
|
245
|
+
"search",
|
|
246
|
+
"select-all",
|
|
247
|
+
"select-all-state",
|
|
248
|
+
"toggle-label",
|
|
249
|
+
"toggle-checked",
|
|
250
|
+
"open"
|
|
251
|
+
];
|
|
252
|
+
_rendered = false;
|
|
253
|
+
_labelEl = null;
|
|
254
|
+
_triggerLabelEl = null;
|
|
255
|
+
_headerEl = null;
|
|
256
|
+
_searchEl = null;
|
|
257
|
+
_toolbarEl = null;
|
|
258
|
+
_selectAllEl = null;
|
|
259
|
+
_toggleEl = null;
|
|
260
|
+
_errorEl = null;
|
|
261
|
+
_offClick = null;
|
|
262
|
+
constructor() {
|
|
263
|
+
super();
|
|
264
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
265
|
+
if ("adoptedStyleSheets" in ShadowRoot.prototype) {
|
|
266
|
+
shadow.adoptedStyleSheets = [getSheet()];
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
get value() {
|
|
270
|
+
return this.getAttribute("value") ?? "";
|
|
271
|
+
}
|
|
272
|
+
set value(v) {
|
|
273
|
+
this.setAttribute("value", v);
|
|
274
|
+
}
|
|
275
|
+
get disabled() {
|
|
276
|
+
return this.hasAttribute("disabled");
|
|
277
|
+
}
|
|
278
|
+
set disabled(v) {
|
|
279
|
+
if (v) this.setAttribute("disabled", "");
|
|
280
|
+
else this.removeAttribute("disabled");
|
|
281
|
+
}
|
|
282
|
+
get required() {
|
|
283
|
+
return this.hasAttribute("required");
|
|
284
|
+
}
|
|
285
|
+
set required(v) {
|
|
286
|
+
if (v) this.setAttribute("required", "");
|
|
287
|
+
else this.removeAttribute("required");
|
|
288
|
+
}
|
|
289
|
+
connectedCallback() {
|
|
290
|
+
this._render();
|
|
291
|
+
}
|
|
292
|
+
disconnectedCallback() {
|
|
293
|
+
if (this._offClick) document.removeEventListener("click", this._offClick);
|
|
294
|
+
}
|
|
295
|
+
attributeChangedCallback(name, _old, _val) {
|
|
296
|
+
if (!this._rendered) return;
|
|
297
|
+
if (name === "label" || name === "required") this._syncLabel();
|
|
298
|
+
if (name === "value" || name === "placeholder") this._syncTriggerLabel();
|
|
299
|
+
if (name === "error") this._syncError();
|
|
300
|
+
if (name === "search") this._syncSearch();
|
|
301
|
+
if (name === "select-all" || name === "select-all-state" || name === "toggle-label" || name === "toggle-checked")
|
|
302
|
+
this._syncToolbar();
|
|
303
|
+
if (name === "open") {
|
|
304
|
+
const trigger = this.shadowRoot.querySelector(".trigger");
|
|
305
|
+
if (trigger) trigger.setAttribute("aria-expanded", _val !== null ? "true" : "false");
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
_render() {
|
|
309
|
+
if (this._rendered) return;
|
|
310
|
+
this._rendered = true;
|
|
311
|
+
const shadow = this.shadowRoot;
|
|
312
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
313
|
+
const s = document.createElement("style");
|
|
314
|
+
s.textContent = bv_input_dropdown_default;
|
|
315
|
+
shadow.appendChild(s);
|
|
316
|
+
}
|
|
317
|
+
const label = document.createElement("label");
|
|
318
|
+
label.className = "field-label";
|
|
319
|
+
this._labelEl = label;
|
|
320
|
+
const trigger = document.createElement("button");
|
|
321
|
+
trigger.type = "button";
|
|
322
|
+
trigger.className = "trigger";
|
|
323
|
+
trigger.setAttribute("aria-haspopup", "listbox");
|
|
324
|
+
trigger.setAttribute("aria-expanded", "false");
|
|
325
|
+
trigger.setAttribute("part", "trigger");
|
|
326
|
+
trigger.addEventListener("click", (e) => {
|
|
327
|
+
e.stopPropagation();
|
|
328
|
+
if (!this.disabled) this._toggle();
|
|
329
|
+
});
|
|
330
|
+
const triggerLabel = document.createElement("span");
|
|
331
|
+
triggerLabel.className = "trigger-label";
|
|
332
|
+
this._triggerLabelEl = triggerLabel;
|
|
333
|
+
const chevron = document.createElement("span");
|
|
334
|
+
chevron.className = "trigger-chevron";
|
|
335
|
+
chevron.innerHTML = CHEVRON_ICON;
|
|
336
|
+
trigger.append(triggerLabel, chevron);
|
|
337
|
+
const panel = document.createElement("div");
|
|
338
|
+
panel.className = "panel";
|
|
339
|
+
panel.setAttribute("role", "listbox");
|
|
340
|
+
const header = document.createElement("div");
|
|
341
|
+
header.className = "panel-header";
|
|
342
|
+
this._headerEl = header;
|
|
343
|
+
const searchEl = document.createElement("bv-searchbox");
|
|
344
|
+
searchEl.setAttribute("placeholder", "Search...");
|
|
345
|
+
searchEl.addEventListener("bv-search", (e) => {
|
|
346
|
+
e.stopPropagation();
|
|
347
|
+
this.dispatchEvent(
|
|
348
|
+
new CustomEvent("bv-search", {
|
|
349
|
+
bubbles: true,
|
|
350
|
+
composed: true,
|
|
351
|
+
detail: e.detail
|
|
352
|
+
})
|
|
353
|
+
);
|
|
354
|
+
});
|
|
355
|
+
this._searchEl = searchEl;
|
|
356
|
+
const toolbar = document.createElement("div");
|
|
357
|
+
toolbar.className = "panel-toolbar";
|
|
358
|
+
this._toolbarEl = toolbar;
|
|
359
|
+
const selectAllEl = document.createElement("bv-checkbox");
|
|
360
|
+
selectAllEl.setAttribute("label", "Select All");
|
|
361
|
+
selectAllEl.addEventListener("bv-change", (e) => {
|
|
362
|
+
e.stopPropagation();
|
|
363
|
+
this.dispatchEvent(
|
|
364
|
+
new CustomEvent("bv-select-all", {
|
|
365
|
+
bubbles: true,
|
|
366
|
+
composed: true,
|
|
367
|
+
detail: e.detail
|
|
368
|
+
})
|
|
369
|
+
);
|
|
370
|
+
});
|
|
371
|
+
this._selectAllEl = selectAllEl;
|
|
372
|
+
const toggleEl = document.createElement("bv-toggle");
|
|
373
|
+
toggleEl.setAttribute("size", "sm");
|
|
374
|
+
toggleEl.addEventListener("bv-change", (e) => {
|
|
375
|
+
e.stopPropagation();
|
|
376
|
+
this.dispatchEvent(
|
|
377
|
+
new CustomEvent("bv-toggle-change", {
|
|
378
|
+
bubbles: true,
|
|
379
|
+
composed: true,
|
|
380
|
+
detail: e.detail
|
|
381
|
+
})
|
|
382
|
+
);
|
|
383
|
+
});
|
|
384
|
+
this._toggleEl = toggleEl;
|
|
385
|
+
toolbar.append(selectAllEl, toggleEl);
|
|
386
|
+
header.append(searchEl, toolbar);
|
|
387
|
+
const content = document.createElement("div");
|
|
388
|
+
content.className = "panel-content";
|
|
389
|
+
const slot = document.createElement("slot");
|
|
390
|
+
content.appendChild(slot);
|
|
391
|
+
panel.append(header, content);
|
|
392
|
+
const errorEl = document.createElement("span");
|
|
393
|
+
errorEl.className = "field-error";
|
|
394
|
+
this._errorEl = errorEl;
|
|
395
|
+
shadow.append(label, trigger, panel, errorEl);
|
|
396
|
+
this._syncLabel();
|
|
397
|
+
this._syncTriggerLabel();
|
|
398
|
+
this._syncError();
|
|
399
|
+
this._syncSearch();
|
|
400
|
+
this._syncToolbar();
|
|
401
|
+
this._offClick = (e) => {
|
|
402
|
+
if (!this.contains(e.target) && !shadow.contains(e.target)) {
|
|
403
|
+
this._close();
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
document.addEventListener("click", this._offClick);
|
|
407
|
+
}
|
|
408
|
+
_toggle() {
|
|
409
|
+
if (this.hasAttribute("open")) this._close();
|
|
410
|
+
else this._open();
|
|
411
|
+
}
|
|
412
|
+
_open() {
|
|
413
|
+
var _a;
|
|
414
|
+
this.setAttribute("open", "");
|
|
415
|
+
(_a = this.shadowRoot.querySelector(".trigger")) == null ? void 0 : _a.setAttribute("aria-expanded", "true");
|
|
416
|
+
this.dispatchEvent(new CustomEvent("bv-open", { bubbles: true, composed: true }));
|
|
417
|
+
}
|
|
418
|
+
_close() {
|
|
419
|
+
var _a;
|
|
420
|
+
this.removeAttribute("open");
|
|
421
|
+
(_a = this.shadowRoot.querySelector(".trigger")) == null ? void 0 : _a.setAttribute("aria-expanded", "false");
|
|
422
|
+
}
|
|
423
|
+
_syncLabel() {
|
|
424
|
+
if (!this._labelEl) return;
|
|
425
|
+
const text = this.getAttribute("label") ?? "";
|
|
426
|
+
this._labelEl.textContent = text;
|
|
427
|
+
if (this.hasAttribute("required")) {
|
|
428
|
+
const mark = document.createElement("span");
|
|
429
|
+
mark.className = "required-mark";
|
|
430
|
+
mark.setAttribute("aria-hidden", "true");
|
|
431
|
+
mark.textContent = "*";
|
|
432
|
+
this._labelEl.appendChild(mark);
|
|
433
|
+
}
|
|
434
|
+
this._labelEl.hidden = !text;
|
|
435
|
+
}
|
|
436
|
+
_syncTriggerLabel() {
|
|
437
|
+
if (!this._triggerLabelEl) return;
|
|
438
|
+
const val = this.getAttribute("value") ?? "";
|
|
439
|
+
const placeholder = this.getAttribute("placeholder") ?? "All";
|
|
440
|
+
if (val) {
|
|
441
|
+
this._triggerLabelEl.textContent = val;
|
|
442
|
+
this._triggerLabelEl.classList.remove("is-placeholder");
|
|
443
|
+
} else {
|
|
444
|
+
this._triggerLabelEl.textContent = placeholder;
|
|
445
|
+
this._triggerLabelEl.classList.add("is-placeholder");
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
_syncError() {
|
|
449
|
+
if (!this._errorEl) return;
|
|
450
|
+
const err = this.getAttribute("error") ?? "";
|
|
451
|
+
this._errorEl.textContent = err;
|
|
452
|
+
this._errorEl.hidden = !err;
|
|
453
|
+
}
|
|
454
|
+
_syncSearch() {
|
|
455
|
+
if (!this._searchEl) return;
|
|
456
|
+
this._searchEl.hidden = !this.hasAttribute("search");
|
|
457
|
+
this._updateHeaderVisibility();
|
|
458
|
+
}
|
|
459
|
+
_syncToolbar() {
|
|
460
|
+
if (!this._toolbarEl || !this._selectAllEl || !this._toggleEl) return;
|
|
461
|
+
const showSelectAll = this.hasAttribute("select-all");
|
|
462
|
+
const state = this.getAttribute("select-all-state") ?? "unchecked";
|
|
463
|
+
const toggleLabel = this.getAttribute("toggle-label") ?? "";
|
|
464
|
+
this._selectAllEl.hidden = !showSelectAll;
|
|
465
|
+
if (showSelectAll) {
|
|
466
|
+
if (state === "checked") {
|
|
467
|
+
this._selectAllEl.setAttribute("checked", "");
|
|
468
|
+
this._selectAllEl.removeAttribute("indeterminate");
|
|
469
|
+
} else if (state === "mixed") {
|
|
470
|
+
this._selectAllEl.removeAttribute("checked");
|
|
471
|
+
this._selectAllEl.setAttribute("indeterminate", "");
|
|
472
|
+
} else {
|
|
473
|
+
this._selectAllEl.removeAttribute("checked");
|
|
474
|
+
this._selectAllEl.removeAttribute("indeterminate");
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
this._toggleEl.hidden = !toggleLabel;
|
|
478
|
+
if (toggleLabel) {
|
|
479
|
+
this._toggleEl.setAttribute("label", toggleLabel);
|
|
480
|
+
if (this.hasAttribute("toggle-checked")) {
|
|
481
|
+
this._toggleEl.setAttribute("checked", "");
|
|
482
|
+
} else {
|
|
483
|
+
this._toggleEl.removeAttribute("checked");
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
this._toolbarEl.hidden = !showSelectAll && !toggleLabel;
|
|
487
|
+
this._updateHeaderVisibility();
|
|
488
|
+
}
|
|
489
|
+
_updateHeaderVisibility() {
|
|
490
|
+
if (!this._headerEl || !this._searchEl || !this._toolbarEl) return;
|
|
491
|
+
const hasSearch = !this._searchEl.hidden;
|
|
492
|
+
const hasToolbar = !this._toolbarEl.hidden;
|
|
493
|
+
this._headerEl.hidden = !hasSearch && !hasToolbar;
|
|
494
|
+
}
|
|
495
|
+
};
|
|
496
|
+
if (!customElements.get("bv-input-dropdown")) {
|
|
497
|
+
customElements.define("bv-input-dropdown", BvInputDropdown);
|
|
498
|
+
}
|
|
499
|
+
export {
|
|
500
|
+
BvInputDropdown
|
|
501
|
+
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
export declare class BvPagination extends HTMLElement {
|
|
2
|
-
static readonly observedAttributes:
|
|
2
|
+
static readonly observedAttributes: readonly ["page", "total-pages", "total", "page-size", "siblings", "show-results", "show-page-size", "page-size-options", "compact"];
|
|
3
3
|
private _rendered;
|
|
4
4
|
private _pagesEl;
|
|
5
5
|
private _prevBtn;
|
|
6
6
|
private _nextBtn;
|
|
7
7
|
private _rangeEl;
|
|
8
|
+
private _resultsEl;
|
|
9
|
+
private _pageSizeWrapEl;
|
|
10
|
+
private _pageSizeSelectEl;
|
|
11
|
+
private _pageLabelEl;
|
|
8
12
|
constructor();
|
|
9
13
|
connectedCallback(): void;
|
|
10
14
|
attributeChangedCallback(): void;
|
|
@@ -13,8 +17,16 @@ export declare class BvPagination extends HTMLElement {
|
|
|
13
17
|
get total(): number;
|
|
14
18
|
get pageSize(): number;
|
|
15
19
|
get siblings(): number;
|
|
20
|
+
get showResults(): boolean;
|
|
21
|
+
set showResults(v: boolean);
|
|
22
|
+
get showPageSize(): boolean;
|
|
23
|
+
set showPageSize(v: boolean);
|
|
24
|
+
get compact(): boolean;
|
|
25
|
+
set compact(v: boolean);
|
|
26
|
+
get pageSizeOptions(): number[];
|
|
16
27
|
private _go;
|
|
17
28
|
private _render;
|
|
18
29
|
private _update;
|
|
30
|
+
private _syncPageSizeOptions;
|
|
19
31
|
private _pageRange;
|
|
20
32
|
}
|