@bluevolt-tech/lumen 1.5.2 → 2.0.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/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.js +1 -1
- package/dist/components/bv-course-list-card/bv-course-list-card.js +1 -1
- 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 +14 -1
- package/package.json +42 -1
- package/themes/base.css +14 -1
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
// css-inline:/home/runner/work/BV_lumen/BV_lumen/components/bv-input/bv-input.css
|
|
2
|
+
var bv_input_default = ":host {\n display: block;\n font-family: var(--bv-font-family-base);\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 */\n\n.field-label {\n display: block;\n font-size: var(--bv-font-size-sm);\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 Input \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.field-input {\n display: block;\n width: 100%;\n box-sizing: border-box;\n height: 44px;\n padding: 0 var(--bv-spacing-md);\n font-family: inherit;\n font-size: var(--bv-font-size-sm);\n color: var(--bv-color-neutral-800);\n background: var(--bv-color-neutral-0);\n border: 1px solid var(--bv-color-neutral-300);\n border-radius: var(--bv-radius-lg);\n outline: none;\n transition:\n border-color var(--bv-transition-fast),\n box-shadow var(--bv-transition-fast);\n}\n\n.field-input::placeholder {\n color: var(--bv-color-neutral-400);\n}\n\n.field-input:focus {\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.field-input:disabled {\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=''])) .field-input {\n border-color: var(--bv-color-danger);\n}\n\n:host([error]:not([error=''])) .field-input:focus {\n border-color: var(--bv-color-danger);\n box-shadow:\n 0 0 0 3px var(--bv-color-danger-light),\n 0 1px 2px 0 rgba(16, 24, 40, 0.05);\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";
|
|
3
|
+
|
|
4
|
+
// components/bv-input/bv-input.ts
|
|
5
|
+
var _sheet = null;
|
|
6
|
+
function getSheet() {
|
|
7
|
+
if (!_sheet) {
|
|
8
|
+
_sheet = new CSSStyleSheet();
|
|
9
|
+
_sheet.replaceSync(bv_input_default);
|
|
10
|
+
}
|
|
11
|
+
return _sheet;
|
|
12
|
+
}
|
|
13
|
+
var BvInput = class extends HTMLElement {
|
|
14
|
+
static observedAttributes = [
|
|
15
|
+
"label",
|
|
16
|
+
"type",
|
|
17
|
+
"placeholder",
|
|
18
|
+
"value",
|
|
19
|
+
"name",
|
|
20
|
+
"error",
|
|
21
|
+
"required",
|
|
22
|
+
"disabled"
|
|
23
|
+
];
|
|
24
|
+
_rendered = false;
|
|
25
|
+
_labelEl = null;
|
|
26
|
+
_inputEl = null;
|
|
27
|
+
_errorEl = null;
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
const shadow = this.attachShadow({ mode: "open" });
|
|
31
|
+
if ("adoptedStyleSheets" in ShadowRoot.prototype) {
|
|
32
|
+
shadow.adoptedStyleSheets = [getSheet()];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
get value() {
|
|
36
|
+
var _a;
|
|
37
|
+
return ((_a = this._inputEl) == null ? void 0 : _a.value) ?? this.getAttribute("value") ?? "";
|
|
38
|
+
}
|
|
39
|
+
set value(v) {
|
|
40
|
+
this.setAttribute("value", v);
|
|
41
|
+
}
|
|
42
|
+
get disabled() {
|
|
43
|
+
return this.hasAttribute("disabled");
|
|
44
|
+
}
|
|
45
|
+
set disabled(v) {
|
|
46
|
+
if (v) this.setAttribute("disabled", "");
|
|
47
|
+
else this.removeAttribute("disabled");
|
|
48
|
+
}
|
|
49
|
+
get required() {
|
|
50
|
+
return this.hasAttribute("required");
|
|
51
|
+
}
|
|
52
|
+
set required(v) {
|
|
53
|
+
if (v) this.setAttribute("required", "");
|
|
54
|
+
else this.removeAttribute("required");
|
|
55
|
+
}
|
|
56
|
+
connectedCallback() {
|
|
57
|
+
this._render();
|
|
58
|
+
}
|
|
59
|
+
attributeChangedCallback(name, _old, val) {
|
|
60
|
+
if (!this._rendered) return;
|
|
61
|
+
if (name === "label") this._syncLabel();
|
|
62
|
+
if (name === "placeholder" && this._inputEl) this._inputEl.placeholder = val ?? "";
|
|
63
|
+
if (name === "value" && this._inputEl && this._inputEl.value !== (val ?? "")) {
|
|
64
|
+
this._inputEl.value = val ?? "";
|
|
65
|
+
}
|
|
66
|
+
if (name === "type" && this._inputEl) this._inputEl.type = val ?? "text";
|
|
67
|
+
if (name === "name" && this._inputEl) this._inputEl.name = val ?? "";
|
|
68
|
+
if (name === "error") this._syncError();
|
|
69
|
+
if (name === "disabled") this._syncDisabled();
|
|
70
|
+
if (name === "required") this._syncLabel();
|
|
71
|
+
}
|
|
72
|
+
_render() {
|
|
73
|
+
if (this._rendered) return;
|
|
74
|
+
this._rendered = true;
|
|
75
|
+
const shadow = this.shadowRoot;
|
|
76
|
+
if (!shadow.adoptedStyleSheets.length) {
|
|
77
|
+
const s = document.createElement("style");
|
|
78
|
+
s.textContent = bv_input_default;
|
|
79
|
+
shadow.appendChild(s);
|
|
80
|
+
}
|
|
81
|
+
const label = document.createElement("label");
|
|
82
|
+
label.className = "field-label";
|
|
83
|
+
this._labelEl = label;
|
|
84
|
+
const inputEl = document.createElement("input");
|
|
85
|
+
inputEl.className = "field-input";
|
|
86
|
+
inputEl.type = this.getAttribute("type") ?? "text";
|
|
87
|
+
inputEl.placeholder = this.getAttribute("placeholder") ?? "";
|
|
88
|
+
inputEl.value = this.getAttribute("value") ?? "";
|
|
89
|
+
inputEl.name = this.getAttribute("name") ?? "";
|
|
90
|
+
inputEl.setAttribute("part", "input");
|
|
91
|
+
this._inputEl = inputEl;
|
|
92
|
+
inputEl.addEventListener("input", () => {
|
|
93
|
+
this.dispatchEvent(
|
|
94
|
+
new CustomEvent("bv-input", {
|
|
95
|
+
bubbles: true,
|
|
96
|
+
composed: true,
|
|
97
|
+
detail: { value: inputEl.value }
|
|
98
|
+
})
|
|
99
|
+
);
|
|
100
|
+
});
|
|
101
|
+
inputEl.addEventListener("change", () => {
|
|
102
|
+
this.dispatchEvent(
|
|
103
|
+
new CustomEvent("bv-change", {
|
|
104
|
+
bubbles: true,
|
|
105
|
+
composed: true,
|
|
106
|
+
detail: { value: inputEl.value }
|
|
107
|
+
})
|
|
108
|
+
);
|
|
109
|
+
});
|
|
110
|
+
const errorEl = document.createElement("span");
|
|
111
|
+
errorEl.className = "field-error";
|
|
112
|
+
errorEl.setAttribute("aria-live", "polite");
|
|
113
|
+
this._errorEl = errorEl;
|
|
114
|
+
shadow.append(label, inputEl, errorEl);
|
|
115
|
+
this._syncLabel();
|
|
116
|
+
this._syncError();
|
|
117
|
+
this._syncDisabled();
|
|
118
|
+
}
|
|
119
|
+
_syncLabel() {
|
|
120
|
+
if (!this._labelEl) return;
|
|
121
|
+
const labelText = this.getAttribute("label") ?? "";
|
|
122
|
+
this._labelEl.textContent = labelText;
|
|
123
|
+
if (this.hasAttribute("required")) {
|
|
124
|
+
const mark = document.createElement("span");
|
|
125
|
+
mark.className = "required-mark";
|
|
126
|
+
mark.setAttribute("aria-hidden", "true");
|
|
127
|
+
mark.textContent = "*";
|
|
128
|
+
this._labelEl.appendChild(mark);
|
|
129
|
+
}
|
|
130
|
+
this._labelEl.hidden = !labelText;
|
|
131
|
+
}
|
|
132
|
+
_syncError() {
|
|
133
|
+
if (!this._errorEl) return;
|
|
134
|
+
const msg = this.getAttribute("error") ?? "";
|
|
135
|
+
this._errorEl.textContent = msg;
|
|
136
|
+
this._errorEl.hidden = !msg;
|
|
137
|
+
}
|
|
138
|
+
_syncDisabled() {
|
|
139
|
+
if (!this._inputEl) return;
|
|
140
|
+
this._inputEl.disabled = this.hasAttribute("disabled");
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
if (!customElements.get("bv-input")) {
|
|
144
|
+
customElements.define("bv-input", BvInput);
|
|
145
|
+
}
|
|
146
|
+
export {
|
|
147
|
+
BvInput
|
|
148
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import '../bv-searchbox/bv-searchbox.ts';
|
|
2
|
+
import '../bv-checkbox/bv-checkbox.ts';
|
|
3
|
+
import '../bv-toggle/bv-toggle.ts';
|
|
4
|
+
export type SelectAllState = 'checked' | 'unchecked' | 'mixed';
|
|
5
|
+
export interface InputDropdownSearchDetail {
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface InputDropdownSelectAllDetail {
|
|
9
|
+
checked: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface InputDropdownToggleDetail {
|
|
12
|
+
checked: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class BvInputDropdown extends HTMLElement {
|
|
15
|
+
static readonly observedAttributes: readonly ["label", "value", "placeholder", "required", "disabled", "error", "search", "select-all", "select-all-state", "toggle-label", "toggle-checked", "open"];
|
|
16
|
+
private _rendered;
|
|
17
|
+
private _labelEl;
|
|
18
|
+
private _triggerLabelEl;
|
|
19
|
+
private _headerEl;
|
|
20
|
+
private _searchEl;
|
|
21
|
+
private _toolbarEl;
|
|
22
|
+
private _selectAllEl;
|
|
23
|
+
private _toggleEl;
|
|
24
|
+
private _errorEl;
|
|
25
|
+
private _offClick;
|
|
26
|
+
constructor();
|
|
27
|
+
get value(): string;
|
|
28
|
+
set value(v: string);
|
|
29
|
+
get disabled(): boolean;
|
|
30
|
+
set disabled(v: boolean);
|
|
31
|
+
get required(): boolean;
|
|
32
|
+
set required(v: boolean);
|
|
33
|
+
connectedCallback(): void;
|
|
34
|
+
disconnectedCallback(): void;
|
|
35
|
+
attributeChangedCallback(name: string, _old: string | null, _val: string | null): void;
|
|
36
|
+
private _render;
|
|
37
|
+
private _toggle;
|
|
38
|
+
private _open;
|
|
39
|
+
private _close;
|
|
40
|
+
private _syncLabel;
|
|
41
|
+
private _syncTriggerLabel;
|
|
42
|
+
private _syncError;
|
|
43
|
+
private _syncSearch;
|
|
44
|
+
private _syncToolbar;
|
|
45
|
+
private _updateHeaderVisibility;
|
|
46
|
+
}
|