scb-wc 0.1.52 → 0.1.53
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/README.md +22 -41
- package/all.js +2 -0
- package/index.js +90 -88
- package/mvc/components/all.js +2 -0
- package/mvc/components/scb-accordion/scb-accordion-item.js +1 -1
- package/mvc/{vendor → components/scb-chevron}/scb-chevron.js +1 -1
- package/mvc/components/scb-datepicker/scb-datepicker.js +296 -0
- package/mvc/components/scb-dropdown/scb-dropdown.js +1 -1
- package/mvc/components/scb-header/scb-header.js +1 -1
- package/mvc/components/scb-menu/scb-menu-item.js +1 -1
- package/mvc/components/scb-select/scb-select.js +1 -1
- package/mvc/components/scb-table/scb-table.js +3 -3
- package/mvc/components/scb-textfield/scb-textfield.js +24 -319
- package/mvc/components/scb-toc/scb-toc-item.js +1 -1
- package/package.json +2 -2
- package/scb-chevron/scb-chevron.js +1 -0
- package/scb-components/index.d.ts +94 -0
- package/scb-components/scb-chevron/scb-chevron.d.ts +11 -0
- package/scb-components/scb-datepicker/scb-datepicker.d.ts +39 -0
- package/scb-components/scb-table/scb-table.d.ts +2 -0
- package/scb-datepicker/scb-datepicker.js +1 -0
- package/scb-table/scb-table.js +19 -2
- package/scb-wc.bundle.js +823 -823
- package/scb-wc.d.ts +188 -184
- package/scb-wc-public-entry/index.d.ts +0 -92
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
export * from './scb-accordion/scb-accordion-item';
|
|
2
|
+
export * from './scb-accordion/scb-accordion';
|
|
3
|
+
export * from './scb-app-bar/scb-app-bar';
|
|
4
|
+
export * from './scb-avatar/scb-avatar';
|
|
5
|
+
export * from './scb-badge/scb-badge';
|
|
6
|
+
export * from './scb-breadcrumb/scb-breadcrumb-item';
|
|
7
|
+
export * from './scb-breadcrumb/scb-breadcrumb';
|
|
8
|
+
export * from './scb-button/scb-button';
|
|
9
|
+
export * from './scb-calendar/scb-calendar-event';
|
|
10
|
+
export * from './scb-calendar/scb-calendar';
|
|
11
|
+
export * from './scb-calendar-card/scb-calendar-card';
|
|
12
|
+
export * from './scb-card/scb-action-card';
|
|
13
|
+
export * from './scb-card/scb-card';
|
|
14
|
+
export * from './scb-card/scb-container-card';
|
|
15
|
+
export * from './scb-card/scb-link-card';
|
|
16
|
+
export * from './scb-card/scb-list-card';
|
|
17
|
+
export * from './scb-card/scb-social-card';
|
|
18
|
+
export * from './scb-checkbox/scb-checkbox-group';
|
|
19
|
+
export * from './scb-checkbox/scb-checkbox';
|
|
20
|
+
export * from './scb-chevron/scb-chevron';
|
|
21
|
+
export * from './scb-chip/scb-chip';
|
|
22
|
+
export * from './scb-collapse/scb-collapse';
|
|
23
|
+
export * from './scb-cookies-consent/scb-cookies-consent';
|
|
24
|
+
export * from './scb-datepicker/scb-datepicker';
|
|
25
|
+
export * from './scb-dialog/scb-dialog';
|
|
26
|
+
export * from './scb-divider/scb-divider';
|
|
27
|
+
export * from './scb-drawer/scb-drawer';
|
|
28
|
+
export * from './scb-drop-zone/scb-drop-zone';
|
|
29
|
+
export * from './scb-dropdown/scb-dropdown';
|
|
30
|
+
export * from './scb-fab/scb-fab';
|
|
31
|
+
export * from './scb-fact-card/scb-fact-card-content';
|
|
32
|
+
export * from './scb-fact-card/scb-fact-card';
|
|
33
|
+
export * from './scb-footer/scb-footer-section';
|
|
34
|
+
export * from './scb-footer/scb-footer';
|
|
35
|
+
export * from './scb-gallery-grid/scb-gallery-grid';
|
|
36
|
+
export * from './scb-grid/scb-grid-item';
|
|
37
|
+
export * from './scb-grid/scb-grid';
|
|
38
|
+
export * from './scb-grid/scb-stack';
|
|
39
|
+
export * from './scb-header/scb-header-menu-group';
|
|
40
|
+
export * from './scb-header/scb-header-menu-item';
|
|
41
|
+
export * from './scb-header/scb-header-tab';
|
|
42
|
+
export * from './scb-header/scb-header-utility';
|
|
43
|
+
export * from './scb-header/scb-header';
|
|
44
|
+
export * from './scb-horizontal-scroller/scb-horizontal-scroller';
|
|
45
|
+
export * from './scb-icon-button/scb-icon-button';
|
|
46
|
+
export * from './scb-keyfigure-card/scb-keyfigure-card';
|
|
47
|
+
export * from './scb-link/scb-link';
|
|
48
|
+
export * from './scb-list/scb-list-item';
|
|
49
|
+
export * from './scb-list/scb-list';
|
|
50
|
+
export * from './scb-menu/scb-menu-item';
|
|
51
|
+
export * from './scb-menu/scb-menu-section';
|
|
52
|
+
export * from './scb-menu/scb-menu';
|
|
53
|
+
export * from './scb-menu/scb-sub-menu';
|
|
54
|
+
export * from './scb-nav/scb-nav-item';
|
|
55
|
+
export * from './scb-nav/scb-nav';
|
|
56
|
+
export * from './scb-notification-card/scb-notification-card';
|
|
57
|
+
export * from './scb-options-menu/scb-options-menu-item';
|
|
58
|
+
export * from './scb-options-menu/scb-options-menu';
|
|
59
|
+
export * from './scb-options-menu/scb-options-sub-menu';
|
|
60
|
+
export * from './scb-overlay/scb-overlay';
|
|
61
|
+
export * from './scb-pagination/scb-pagination';
|
|
62
|
+
export * from './scb-progress-indicator/scb-progress-indicator';
|
|
63
|
+
export * from './scb-progress-stepper/scb-progress-step';
|
|
64
|
+
export * from './scb-progress-stepper/scb-progress-stepper';
|
|
65
|
+
export * from './scb-radio-button/scb-radio-button';
|
|
66
|
+
export * from './scb-radio-button/scb-radio-group';
|
|
67
|
+
export * from './scb-scrollspy/scb-scrollspy';
|
|
68
|
+
export * from './scb-search/scb-search';
|
|
69
|
+
export * from './scb-segmented-button/scb-segmented-button';
|
|
70
|
+
export * from './scb-segmented-button/scb-segmented-item';
|
|
71
|
+
export * from './scb-select/scb-select-option';
|
|
72
|
+
export * from './scb-select/scb-select';
|
|
73
|
+
export * from './scb-skeleton/scb-skeleton';
|
|
74
|
+
export * from './scb-slider/scb-slider';
|
|
75
|
+
export * from './scb-snackbar/scb-snackbar';
|
|
76
|
+
export * from './scb-status-pill/scb-status-pill';
|
|
77
|
+
export * from './scb-stepper/scb-step';
|
|
78
|
+
export * from './scb-stepper/scb-stepper';
|
|
79
|
+
export * from './scb-switch/scb-switch';
|
|
80
|
+
export * from './scb-table/scb-table';
|
|
81
|
+
export * from './scb-table-advanced/scb-table-advanced';
|
|
82
|
+
export * from './scb-tabs/scb-primary-tab';
|
|
83
|
+
export * from './scb-tabs/scb-secondary-tab';
|
|
84
|
+
export * from './scb-tabs/scb-tabs';
|
|
85
|
+
export * from './scb-textfield/scb-textfield';
|
|
86
|
+
export * from './scb-toc/scb-toc-item';
|
|
87
|
+
export * from './scb-toc/scb-toc';
|
|
88
|
+
export * from './scb-tooltip/scb-tooltip';
|
|
89
|
+
export * from './scb-viz/scb-viz-actions-runtime';
|
|
90
|
+
export * from './scb-viz/scb-viz-print-runtime';
|
|
91
|
+
export * from './scb-viz/scb-viz-series-differentiation-registry';
|
|
92
|
+
export * from './scb-viz/scb-viz-series-differentiation-runtime';
|
|
93
|
+
export * from './scb-viz/scb-viz-table-runtime';
|
|
94
|
+
export * from './scb-viz/scb-viz';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export declare class ScbChevron extends LitElement {
|
|
3
|
+
open: boolean;
|
|
4
|
+
static styles: import('lit').CSSResult;
|
|
5
|
+
render(): import('lit-html').TemplateResult<1>;
|
|
6
|
+
}
|
|
7
|
+
declare global {
|
|
8
|
+
interface HTMLElementTagNameMap {
|
|
9
|
+
'scb-chevron': ScbChevron;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LitElement, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
export declare class ScbDatepicker extends LitElement {
|
|
3
|
+
private _currentDate;
|
|
4
|
+
private _selectedDate;
|
|
5
|
+
private _showMonthDropdown;
|
|
6
|
+
private _showYearDropdown;
|
|
7
|
+
variant: 'datetime-local' | 'date';
|
|
8
|
+
lang: 'sv' | 'en';
|
|
9
|
+
selectedValue: string;
|
|
10
|
+
open: boolean;
|
|
11
|
+
private _selectedHour;
|
|
12
|
+
private _selectedMinute;
|
|
13
|
+
private readonly _viewportMargin;
|
|
14
|
+
private readonly _popupOffset;
|
|
15
|
+
private _onWindowReposition;
|
|
16
|
+
private _isRenderedInsideDialog;
|
|
17
|
+
private _positionPopupWithinViewport;
|
|
18
|
+
static styles: import('lit').CSSResult[];
|
|
19
|
+
updated(changed: PropertyValues): void;
|
|
20
|
+
disconnectedCallback(): void;
|
|
21
|
+
private _monthNames;
|
|
22
|
+
render(): TemplateResult;
|
|
23
|
+
private _getMonthDays;
|
|
24
|
+
private _outsideClickHandler;
|
|
25
|
+
private _toggleMonthDropdown;
|
|
26
|
+
private _toggleYearDropdown;
|
|
27
|
+
private _onMonthChangeCustom;
|
|
28
|
+
private _onYearChangeCustom;
|
|
29
|
+
private _prevMonth;
|
|
30
|
+
private _prevYear;
|
|
31
|
+
private _nextMonth;
|
|
32
|
+
private _nextYear;
|
|
33
|
+
private _isToday;
|
|
34
|
+
private _isSelected;
|
|
35
|
+
private _selectDate;
|
|
36
|
+
private _fireDateTimeChange;
|
|
37
|
+
private _onTimeChange;
|
|
38
|
+
private _close;
|
|
39
|
+
}
|
|
@@ -19,6 +19,8 @@ export declare class ScbTable extends LitElement {
|
|
|
19
19
|
private _applyGeneratedColGroup;
|
|
20
20
|
private _removeGeneratedColGroup;
|
|
21
21
|
private _measureCellContentWidth;
|
|
22
|
+
private _measureColumnReadableBodyWidth;
|
|
23
|
+
private _measureCellTextWidth;
|
|
22
24
|
private _onThClick;
|
|
23
25
|
private _sortTable;
|
|
24
26
|
private _getCellSortableValue;
|
|
@@ -467,3 +467,4 @@ var s = class extends t {
|
|
|
467
467
|
};
|
|
468
468
|
e([o()], s.prototype, "_currentDate", void 0), e([o()], s.prototype, "_selectedDate", void 0), e([o()], s.prototype, "_showMonthDropdown", void 0), e([o()], s.prototype, "_showYearDropdown", void 0), e([a({ type: String })], s.prototype, "variant", void 0), e([a({ type: String })], s.prototype, "lang", void 0), e([a({ type: String })], s.prototype, "selectedValue", void 0), e([a({ type: Boolean })], s.prototype, "open", void 0), e([o()], s.prototype, "_selectedHour", void 0), e([o()], s.prototype, "_selectedMinute", void 0), s = e([i("scb-datepicker")], s);
|
|
469
469
|
//#endregion
|
|
470
|
+
export { s as ScbDatepicker };
|
package/scb-table/scb-table.js
CHANGED
|
@@ -116,7 +116,7 @@ var o = class extends t {
|
|
|
116
116
|
i.style.display = "flex", i.style.gap = "8px", i.style.flexWrap = "nowrap", i.style.alignItems = "center", i.appendChild(r), i.appendChild(n), e.appendChild(i);
|
|
117
117
|
} else e.appendChild(r);
|
|
118
118
|
}), i.forEach((e) => {
|
|
119
|
-
e.style.padding = "12px", e.style.textAlign = "left", e.style.borderTop = "1px solid var(--md-sys-color-outline-variant)", e.style.verticalAlign = "text-top", e.style.backgroundColor = "var(--md-sys-color-surface)", e.style.fontFamily = "var(--md-sys-typescale-body-medium-font)", e.style.fontSize = "var(--md-sys-typescale-body-medium-size)", e.style.lineHeight = "var(--md-sys-typescale-body-medium-line-height)", e.style.fontWeight = "var(--md-sys-typescale-body-medium-weight)", e.style.letterSpacing = "var(--md-sys-typescale-body-medium-tracking)", e.style.borderRight = "1px solid var(--md-sys-color-on-surface)", e.style.borderBottom = "1px solid var(--md-sys-color-on-surface)";
|
|
119
|
+
e.style.padding = "12px", e.style.textAlign = "left", e.style.borderTop = "1px solid var(--md-sys-color-outline-variant)", e.style.verticalAlign = "text-top", e.style.backgroundColor = "var(--md-sys-color-surface)", e.style.fontFamily = "var(--md-sys-typescale-body-medium-font)", e.style.fontSize = "var(--md-sys-typescale-body-medium-size)", e.style.lineHeight = "var(--md-sys-typescale-body-medium-line-height)", e.style.fontWeight = "var(--md-sys-typescale-body-medium-weight)", e.style.letterSpacing = "var(--md-sys-typescale-body-medium-tracking)", e.style.borderRight = "1px solid var(--md-sys-color-on-surface)", e.style.borderBottom = "1px solid var(--md-sys-color-on-surface)", e.style.overflowWrap = "break-word", e.style.wordBreak = "normal", e.style.hyphens = "manual";
|
|
120
120
|
}), a.forEach((e) => {
|
|
121
121
|
let t = Array.from(e.cells);
|
|
122
122
|
t.forEach((e, n) => {
|
|
@@ -141,7 +141,10 @@ var o = class extends t {
|
|
|
141
141
|
if (this._removeGeneratedColGroup(e), e.style.tableLayout = "", e.style.width = "", e.style.minWidth = "", e.style.maxWidth = "", this.columnWidthMode !== "header") return;
|
|
142
142
|
let t = Array.from(e.querySelectorAll("thead tr")), n = t[t.length - 1];
|
|
143
143
|
if (!n) return;
|
|
144
|
-
let r = Array.from(n.cells).map((
|
|
144
|
+
let r = Array.from(n.cells).map((t, n) => {
|
|
145
|
+
let r = this._measureCellContentWidth(t), i = this._measureColumnReadableBodyWidth(e, n);
|
|
146
|
+
return `${Math.ceil(Math.max(r, i))}px`;
|
|
147
|
+
}), i = r.reduce((e, t) => e + parseFloat(t), 0);
|
|
145
148
|
this._applyGeneratedColGroup(e, r), e.style.tableLayout = "fixed", e.style.width = `${Math.ceil(i)}px`, e.style.minWidth = `${Math.ceil(i)}px`, e.style.maxWidth = "none";
|
|
146
149
|
});
|
|
147
150
|
}
|
|
@@ -163,6 +166,20 @@ var o = class extends t {
|
|
|
163
166
|
let i = parseFloat(n.paddingLeft || "0"), a = parseFloat(n.paddingRight || "0"), o = r.getBoundingClientRect().width + i + a;
|
|
164
167
|
return document.body.removeChild(r), o;
|
|
165
168
|
}
|
|
169
|
+
_measureColumnReadableBodyWidth(e, t) {
|
|
170
|
+
return Array.from(e.querySelectorAll("tbody tr")).reduce((e, n) => {
|
|
171
|
+
let r = n.cells[t];
|
|
172
|
+
if (!r) return e;
|
|
173
|
+
let i = (r.textContent ?? "").replace(/\s+/g, " ").trim().split(" ").filter(Boolean).reduce((e, t) => Math.max(e, this._measureCellTextWidth(r, t)), 0), a = i > 0 ? i + 16 : 0;
|
|
174
|
+
return Math.max(e, a);
|
|
175
|
+
}, 0);
|
|
176
|
+
}
|
|
177
|
+
_measureCellTextWidth(e, t) {
|
|
178
|
+
let n = window.getComputedStyle(e), r = document.createElement("span");
|
|
179
|
+
r.textContent = t, r.style.position = "absolute", r.style.left = "-99999px", r.style.top = "0", r.style.visibility = "hidden", r.style.pointerEvents = "none", r.style.whiteSpace = "nowrap", r.style.fontFamily = n.fontFamily, r.style.fontSize = n.fontSize, r.style.fontWeight = n.fontWeight, r.style.lineHeight = n.lineHeight, r.style.letterSpacing = n.letterSpacing, document.body.appendChild(r);
|
|
180
|
+
let i = parseFloat(n.paddingLeft || "0"), a = parseFloat(n.paddingRight || "0"), o = r.getBoundingClientRect().width + i + a;
|
|
181
|
+
return document.body.removeChild(r), o;
|
|
182
|
+
}
|
|
166
183
|
_onThClick(e) {
|
|
167
184
|
this.dataSorting && (this._sortedColumn === e ? this._sortDirection = this._sortDirection === "asc" ? "desc" : "asc" : (this._sortedColumn = e, this._sortDirection = "asc"), this._sortTable(e, this._sortDirection), this._attachThListeners(), this.dispatchEvent(new CustomEvent("tablesortchange", {
|
|
168
185
|
detail: {
|