@mono-lit/helper 0.0.8 → 0.0.10
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/accordion-core-DaNyPWRr.js +277 -0
- package/dist/alert-core-DWtHbX_-.js +134 -0
- package/dist/breadcrumb-list-core-Dh68T8Cf.js +747 -0
- package/dist/{mono-button-CLkHg3WW.js → button-core-DerXg84Q.js} +3 -276
- package/dist/button-dropdown-core-DKYEOyjy.js +654 -0
- package/dist/button-utils-D5-66M02.js +63 -0
- package/dist/card-utils-l80qAmrN.js +312 -0
- package/dist/chart-core-DV7hD3ZY.js +801 -0
- package/dist/checkbox-utils-DKdrhAzF.js +337 -0
- package/dist/chip-utils-DpRrd7Zj.js +403 -0
- package/dist/{data-source-controller-C6C4ej_M.js → data-source-controller-DS_JLrmS.js} +1 -1
- package/dist/{data-source-options-fxT5QIX4.js → data-source-options-DJUNU26C.js} +6 -6
- package/dist/{data-source-read-BL266IW0.js → data-source-read-uKJpRAzx.js} +2 -2
- package/dist/date-core-CyuSyvvG.js +734 -0
- package/dist/drawer-core-DbFWvNln.js +759 -0
- package/dist/dropdown-core-BCH1pK14.js +511 -0
- package/dist/dropdown-table-core-SfHUJVFq.js +1342 -0
- package/dist/export.js +1 -1
- package/dist/{field-path-BabiMrrA.js → field-path-DK2VBWHl.js} +1 -1
- package/dist/field-tooltip.css_raw-DVblekCl.js +5 -0
- package/dist/{field-validation.css_raw-Cx6SGrfP.js → field-validation.css_raw-BU7C6173.js} +1 -170
- package/dist/file-upload-core-Cz_dBQMx.js +624 -0
- package/dist/filter-builder-core-DyWjbBP7.js +381 -0
- package/dist/{filter-builder-B6Y2mmbM.js → filter-builder-vbqIuPhX.js} +1 -1
- package/dist/{filter-eval-ChDSaAUH.js → filter-eval-CqeBnMYh.js} +1 -1
- package/dist/{filter-odata-Bi27XUpQ.js → filter-odata-GsczYKNC.js} +1 -1
- package/dist/{hydration-flush-BaE9gN3C.js → hydration-flush-Volt9X7Q.js} +2 -1071
- package/dist/index.js +11 -11
- package/dist/{index.node-CLqE8F8P.js → index.node-Csy9zrr1.js} +4 -4
- package/dist/index.node.js +11 -11
- package/dist/input-utils-BglY-k0H.js +1145 -0
- package/dist/menu-core-DkAYuCZ2.js +831 -0
- package/dist/modal-core-CSBSPN_m.js +844 -0
- package/dist/mono-button-DVvZ03P-.js +280 -0
- package/dist/{mono-button.shadow-DqZMpcqY.js → mono-button.shadow-BANxMGln.js} +6 -594
- package/dist/{mono-data-chart-NKPdAgVq.js → mono-data-chart-ChF4J9RT.js} +6 -6
- package/dist/{mono-data-dropdown-DUXo_jxd.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
- package/dist/{mono-data-grid-Bb00QM72.js → mono-data-grid-DJkp96N-.js} +346 -51
- package/dist/{mono-event-BPku9HpS.js → mono-event-CAZf0F_k.js} +14 -9
- package/dist/{mono-form-controller-BrA10erm.js → mono-form-controller-DxZLvyg6.js} +2 -1
- package/dist/mono-table-checkbox-core-BKOMx8R5.js +5288 -0
- package/dist/nav-core-B5qU2dzn.js +225 -0
- package/dist/{normalize-error-D93O4q8g.js → normalize-error-BEcd1tmS.js} +2 -2
- package/dist/otp-core-DXg3vFLh.js +758 -0
- package/dist/radio-utils-Dk9Tl1jz.js +319 -0
- package/dist/rich-text-editor-core-Ddd_QaLn.js +1280 -0
- package/dist/select-utils-BgArYHk8.js +2140 -0
- package/dist/sidebar-core-CD6txDo3.js +583 -0
- package/dist/slider-core-vcWr321-.js +1014 -0
- package/dist/src/components/dropdown-table/dropdown-table-core.d.ts +2 -2
- package/dist/src/components/dropdown-table/dropdown-table-types.d.ts +1 -1
- package/dist/src/components/dropdown-table/index.d.ts +1 -1
- package/dist/src/components/dropdown-table/index.shadow.d.ts +1 -1
- package/dist/src/components/dropdown-table/mono-data-dropdown.d.ts +1 -1
- package/dist/src/components/form/form-types.d.ts +9 -3
- package/dist/src/components/input/input-core.d.ts +1 -1
- package/dist/src/components/input/input-types.d.ts +1 -1
- package/dist/src/components/otp/otp-core.d.ts +1 -1
- package/dist/src/components/select/select-core.d.ts +1 -1
- package/dist/src/components/select/select-types.d.ts +1 -1
- package/dist/src/components/slider/slider-core.d.ts +1 -1
- package/dist/src/components/slider/slider-types.d.ts +1 -1
- package/dist/src/components/table/filter-suggestion.d.ts +171 -0
- package/dist/src/components/table/index.d.ts +5 -4
- package/dist/src/components/table/index.shadow.d.ts +5 -4
- package/dist/src/components/table/mono-data-grid.d.ts +58 -3
- package/dist/src/components/table/mono-table-empty-core.d.ts +37 -0
- package/dist/src/components/table/mono-table-search-core.d.ts +22 -3
- package/dist/src/components/table/table-types.d.ts +74 -4
- package/dist/src/components/tag-input/tag-input-core.d.ts +1 -1
- package/dist/src/components/tag-input/tag-input-types.d.ts +1 -1
- package/dist/src/components/textarea/textarea-core.d.ts +1 -1
- package/dist/src/composables/mono-event.d.ts +7 -1
- package/dist/src/entries/index.d.ts +8 -6
- package/dist/src/entries/index.node.d.ts +8 -6
- package/dist/src/search/index.d.ts +1 -1
- package/dist/src/utils/group-count.d.ts +36 -0
- package/dist/switch-utils-CTZ4id2V.js +338 -0
- package/dist/tabs-core-r5-B8k_N.js +317 -0
- package/dist/tag-input-utils-D2JA90DQ.js +3060 -0
- package/dist/textarea-utils-VU1KeXm8.js +821 -0
- package/dist/ui/accordion.js +2 -274
- package/dist/ui/alert.js +2 -131
- package/dist/ui/breadcrumb.js +4 -745
- package/dist/ui/button-dropdown.js +4 -652
- package/dist/ui/button.js +2 -63
- package/dist/ui/card.js +2 -310
- package/dist/ui/chart.js +4 -800
- package/dist/ui/checkbox.js +4 -335
- package/dist/ui/chip.js +4 -402
- package/dist/ui/date.js +3 -732
- package/dist/ui/drawer.js +3 -757
- package/dist/ui/dropdown-table.js +5 -1341
- package/dist/ui/dropdown.js +4 -509
- package/dist/ui/file-upload.js +3 -622
- package/dist/ui/filter.js +5 -380
- package/dist/ui/form.js +1 -1
- package/dist/ui/index.css +130 -5
- package/dist/ui/input.js +3 -1141
- package/dist/ui/menu.js +4 -828
- package/dist/ui/modal.js +4 -843
- package/dist/ui/nav.js +4 -223
- package/dist/ui/otp.js +4 -756
- package/dist/ui/radio.js +4 -317
- package/dist/ui/rich-text-editor.js +4 -1278
- package/dist/ui/select.js +5 -2138
- package/dist/ui/shadow/accordion.js +4 -273
- package/dist/ui/shadow/alert.js +4 -130
- package/dist/ui/shadow/breadcrumb.js +5 -744
- package/dist/ui/shadow/button-dropdown.js +6 -652
- package/dist/ui/shadow/button.js +3 -63
- package/dist/ui/shadow/card.js +4 -309
- package/dist/ui/shadow/chart.js +6 -1576
- package/dist/ui/shadow/checkbox.js +4 -334
- package/dist/ui/shadow/chip.js +4 -396
- package/dist/ui/shadow/date.js +7 -731
- package/dist/ui/shadow/drawer.js +4 -756
- package/dist/ui/shadow/dropdown-table.js +8 -1762
- package/dist/ui/shadow/dropdown.js +4 -508
- package/dist/ui/shadow/file-upload.js +4 -620
- package/dist/ui/shadow/filter.js +7 -379
- package/dist/ui/shadow/input.js +6 -1140
- package/dist/ui/shadow/menu.js +5 -828
- package/dist/ui/shadow/modal.js +6 -1063
- package/dist/ui/shadow/nav.js +5 -223
- package/dist/ui/shadow/otp.js +6 -754
- package/dist/ui/shadow/radio.js +4 -316
- package/dist/ui/shadow/rich-text-editor.js +4 -1276
- package/dist/ui/shadow/select.js +6 -2136
- package/dist/ui/shadow/sidebar.js +5 -581
- package/dist/ui/shadow/slider.js +5 -1010
- package/dist/ui/shadow/switch.js +4 -335
- package/dist/ui/shadow/table.js +10 -4501
- package/dist/ui/shadow/tabs.js +6 -315
- package/dist/ui/shadow/tag-input.js +7 -3057
- package/dist/ui/shadow/textarea.js +6 -817
- package/dist/ui/sidebar.js +3 -581
- package/dist/ui/slider.js +4 -1012
- package/dist/ui/switch.js +4 -336
- package/dist/ui/table.js +9 -4502
- package/dist/ui/tabs.js +4 -315
- package/dist/ui/tag-input.js +5 -3058
- package/dist/ui/textarea.js +4 -819
- package/dist/vue.d.ts +3 -2
- package/package.json +3 -3
- package/dist/chip-strip-bNfLn52Z.js +0 -215
- package/dist/data-source-controller-Dx6IQ2CN.js +0 -243
- package/dist/data-source-options-BM4r4PRw.js +0 -558
- package/dist/data-source-read-HyBCRg1t.js +0 -242
- package/dist/excel-BXzr3uI1.js +0 -784
- package/dist/export-ixRdCS2y.js +0 -2388
- package/dist/field-tooltip-addon-CWCp19mJ.js +0 -702
- package/dist/field-tooltip.css_raw-U5UeTa2d.js +0 -269
- package/dist/filter-builder-C0T3pMx2.js +0 -208
- package/dist/form-control-core-BbiACMtL.js +0 -226
- package/dist/icon-ClxnYhBG.js +0 -19
- package/dist/import-Dc4eXC02.js +0 -612
- package/dist/light-slots-_no0r2Z-.js +0 -246
- package/dist/markdown-uGlE_OfJ.js +0 -20191
- package/dist/mono-data-grid-Bkr-e1-i.js +0 -4043
- package/dist/normalize-error-BmLbgANw.js +0 -1048
package/dist/ui/tabs.js
CHANGED
|
@@ -1,322 +1,11 @@
|
|
|
1
1
|
import { g as monoHostChildNodes } from "../mono-ui-kvLVIf1V.js";
|
|
2
2
|
import { t as customElement } from "../mono-element-CKcT0rwv.js";
|
|
3
|
-
import {
|
|
4
|
-
import { t as dispatchMonoEvent } from "../mono-event-BPku9HpS.js";
|
|
3
|
+
import { t as __decorate } from "../decorate-DbYFpi8R.js";
|
|
5
4
|
import { a as parkDetachedNodes, s as placeSlotNode } from "../light-slots-B5Ck0t_E.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { t as MonoTabsCore } from "../tabs-core-r5-B8k_N.js";
|
|
6
|
+
import { LitElement } from "lit";
|
|
7
|
+
import { state } from "lit/decorators.js";
|
|
9
8
|
|
|
10
|
-
//#region src/components/tabs/tabs-core.ts
|
|
11
|
-
/**
|
|
12
|
-
* Coerce any `items` input to a `TabItem[]`. Accepts an array (pass-through), a
|
|
13
|
-
* JSON string (`items='[...]'` attribute, OR a string assigned to the PROPERTY —
|
|
14
|
-
* which is what nuxt-ssr-lit does forwarding a Vue `:items="<json>"` binding to
|
|
15
|
-
* the SSR renderer), or anything else (→ `[]`).
|
|
16
|
-
*/
|
|
17
|
-
function coerceTabItems(value) {
|
|
18
|
-
if (Array.isArray(value)) return value;
|
|
19
|
-
if (typeof value === "string") {
|
|
20
|
-
if (!value) return [];
|
|
21
|
-
try {
|
|
22
|
-
const parsed = JSON.parse(value);
|
|
23
|
-
return Array.isArray(parsed) ? parsed : [];
|
|
24
|
-
} catch {
|
|
25
|
-
return [];
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
return [];
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* `MonoTabsCore` — all render-mode-agnostic logic for `mono-tabs`: reactive props
|
|
32
|
-
* (incl. the SSR `items` string→array coercion and `disabled` string→bool
|
|
33
|
-
* coercion), hybrid aliases, camelCase attribute fallbacks, the `modelValue`↔
|
|
34
|
-
* `value` sync, class computation, tab selection + `mno-click` events, keyboard
|
|
35
|
-
* navigation, and the `role="tablist"` `render()`. Per-tab icons render through a
|
|
36
|
-
* `_renderIcon()` hook: the light build uses `data-mono-slot` placeholders, the
|
|
37
|
-
* shadow build native `<slot name="icon-<id>">` (mirrors `mono-breadcrumb`).
|
|
38
|
-
*
|
|
39
|
-
* SSR-safe: no `document`/`window` access; `focus`/`blur` query `this.renderRoot`
|
|
40
|
-
* (the host in light, the shadow root in shadow) and only matter client-side.
|
|
41
|
-
*/
|
|
42
|
-
const MonoTabsCore = (superClass) => {
|
|
43
|
-
class MonoTabsCoreClass extends superClass {
|
|
44
|
-
constructor(...args) {
|
|
45
|
-
super(...args);
|
|
46
|
-
this.items = [];
|
|
47
|
-
this.modelValue = "";
|
|
48
|
-
this.value = "";
|
|
49
|
-
this.size = "md";
|
|
50
|
-
this.color = "primary";
|
|
51
|
-
this.variant = "underline";
|
|
52
|
-
this.orientation = "horizontal";
|
|
53
|
-
this.disabled = false;
|
|
54
|
-
this.cssClass = {};
|
|
55
|
-
this.cssClassName = "";
|
|
56
|
-
this._rootEl = null;
|
|
57
|
-
this.bindRoot = (el) => {
|
|
58
|
-
this._rootEl = el ?? null;
|
|
59
|
-
this._applyRootAttrs(this._rootEl);
|
|
60
|
-
};
|
|
61
|
-
defineHybridPropAliases(this, ["modelValue", "cssClass"]);
|
|
62
|
-
Object.defineProperty(this, "css-class", {
|
|
63
|
-
get: () => this.cssClass,
|
|
64
|
-
set: (value) => this._setCssClass(value),
|
|
65
|
-
configurable: true,
|
|
66
|
-
enumerable: false
|
|
67
|
-
});
|
|
68
|
-
Object.defineProperty(this, "cssclass", {
|
|
69
|
-
get: () => this.cssClass,
|
|
70
|
-
set: (value) => this._setCssClass(value),
|
|
71
|
-
configurable: true,
|
|
72
|
-
enumerable: false
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
static get observedAttributes() {
|
|
76
|
-
return [
|
|
77
|
-
...super.observedAttributes ?? [],
|
|
78
|
-
"modelvalue",
|
|
79
|
-
"css-class",
|
|
80
|
-
"cssclass"
|
|
81
|
-
];
|
|
82
|
-
}
|
|
83
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
84
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
85
|
-
if (oldValue === newValue) return;
|
|
86
|
-
if (name === "modelvalue") {
|
|
87
|
-
this.modelValue = newValue ?? "";
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
if (name === "css-class" || name === "cssclass") this._setCssClass(newValue);
|
|
91
|
-
}
|
|
92
|
-
willUpdate(changed) {
|
|
93
|
-
if (typeof this.items === "string") this.items = coerceTabItems(this.items);
|
|
94
|
-
if (typeof this.disabled === "string") {
|
|
95
|
-
const normalized = this.disabled.toLowerCase().trim();
|
|
96
|
-
this.disabled = normalized === "" || normalized === "true";
|
|
97
|
-
}
|
|
98
|
-
if (changed.has("modelValue") && this.value !== this.modelValue) this.value = this.modelValue;
|
|
99
|
-
if (changed.has("value") && this.modelValue !== this.value) this.modelValue = this.value;
|
|
100
|
-
super.willUpdate?.(changed);
|
|
101
|
-
}
|
|
102
|
-
_setCssClass(value) {
|
|
103
|
-
if (value == null) {
|
|
104
|
-
this.cssClass = {};
|
|
105
|
-
this.cssClassName = "";
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
if (typeof value === "object") {
|
|
109
|
-
this.cssClass = value;
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
if (typeof value === "string") {
|
|
113
|
-
const trimmed = value.trim();
|
|
114
|
-
if (!trimmed) {
|
|
115
|
-
this.cssClass = {};
|
|
116
|
-
this.cssClassName = "";
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (trimmed.startsWith("{") && trimmed.endsWith("}")) try {
|
|
120
|
-
this.cssClass = JSON.parse(trimmed);
|
|
121
|
-
return;
|
|
122
|
-
} catch {}
|
|
123
|
-
this.cssClassName = trimmed;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
_cls(base, key) {
|
|
127
|
-
const extra = this.cssClass?.[key];
|
|
128
|
-
return extra ? `${base} ${extra}` : base;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* The prop mirrors, each omitted at its default so `:not([mono-size])` means
|
|
132
|
-
* "md" for hand-written markup exactly as it does for the element.
|
|
133
|
-
*
|
|
134
|
-
* `aria-orientation` is ALWAYS written, and is not a `mono-` attribute:
|
|
135
|
-
* upstream styles the vertical strip from the ARIA state, and a tablist is
|
|
136
|
-
* supposed to carry it either way.
|
|
137
|
-
*/
|
|
138
|
-
_computeRootAttrs() {
|
|
139
|
-
return {
|
|
140
|
-
"mono-size": this.size === "md" ? null : this.size,
|
|
141
|
-
"mono-color": this.color === "primary" ? null : this.color,
|
|
142
|
-
"mono-variant": this.variant === "underline" ? null : this.variant,
|
|
143
|
-
"mono-disabled": this.disabled ? "" : null,
|
|
144
|
-
"aria-orientation": this.orientation === "vertical" ? "vertical" : "horizontal"
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
_applyRootAttrs(root) {
|
|
148
|
-
if (!root) return;
|
|
149
|
-
if (!root.hasAttribute("mono-tabs")) root.setAttribute("mono-tabs", "");
|
|
150
|
-
for (const [name, value] of Object.entries(this._computeRootAttrs())) if (value === null) root.removeAttribute(name);
|
|
151
|
-
else if (root.getAttribute(name) !== value) root.setAttribute(name, value);
|
|
152
|
-
}
|
|
153
|
-
updated(changed) {
|
|
154
|
-
super.updated?.(changed);
|
|
155
|
-
this._applyRootAttrs(this._rootEl);
|
|
156
|
-
}
|
|
157
|
-
get _wrapperClasses() {
|
|
158
|
-
return [
|
|
159
|
-
"mono-tabs",
|
|
160
|
-
this.size,
|
|
161
|
-
this.color,
|
|
162
|
-
`variant-${this.variant}`,
|
|
163
|
-
this.disabled ? "disabled" : "",
|
|
164
|
-
this.cssClassName,
|
|
165
|
-
this.cssClass?.root
|
|
166
|
-
].filter(Boolean).join(" ");
|
|
167
|
-
}
|
|
168
|
-
_isActive(item) {
|
|
169
|
-
return item.id === this.modelValue;
|
|
170
|
-
}
|
|
171
|
-
_tabClasses(item) {
|
|
172
|
-
const active = this._isActive(item);
|
|
173
|
-
return [
|
|
174
|
-
this._cls("mono-tabs-tab", "tab"),
|
|
175
|
-
active ? "on" : "",
|
|
176
|
-
active && this.cssClass?.tabActive ? this.cssClass.tabActive : "",
|
|
177
|
-
item.disabled ? "disabled" : "",
|
|
178
|
-
item.disabled && this.cssClass?.tabDisabled ? this.cssClass.tabDisabled : ""
|
|
179
|
-
].filter(Boolean).join(" ");
|
|
180
|
-
}
|
|
181
|
-
_emitClick(detail) {
|
|
182
|
-
dispatchMonoEvent(this, "click", detail, { alias: "change" });
|
|
183
|
-
}
|
|
184
|
-
_selectItem(item, sourceEvent) {
|
|
185
|
-
if (this.disabled || item.disabled) return;
|
|
186
|
-
if (this.modelValue === item.id) return;
|
|
187
|
-
const oldValue = this.modelValue;
|
|
188
|
-
this.modelValue = item.id;
|
|
189
|
-
this.value = item.id;
|
|
190
|
-
this._emitClick({
|
|
191
|
-
modelValue: item.id,
|
|
192
|
-
currentValue: item.id,
|
|
193
|
-
oldValue,
|
|
194
|
-
value: item.id,
|
|
195
|
-
item,
|
|
196
|
-
sourceEvent
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
_handleClick(item, event) {
|
|
200
|
-
this._selectItem(item, event);
|
|
201
|
-
}
|
|
202
|
-
select(id) {
|
|
203
|
-
const item = this.items.find((entry) => entry.id === id);
|
|
204
|
-
if (item) this._selectItem(item);
|
|
205
|
-
}
|
|
206
|
-
next() {
|
|
207
|
-
this._step(1);
|
|
208
|
-
}
|
|
209
|
-
previous() {
|
|
210
|
-
this._step(-1);
|
|
211
|
-
}
|
|
212
|
-
_step(delta) {
|
|
213
|
-
if (this.disabled || !this.items.length) return;
|
|
214
|
-
const enabled = this.items.filter((item) => !item.disabled);
|
|
215
|
-
if (!enabled.length) return;
|
|
216
|
-
const currentIndex = enabled.findIndex((item) => item.id === this.modelValue);
|
|
217
|
-
const nextIndex = currentIndex < 0 ? 0 : (currentIndex + delta + enabled.length) % enabled.length;
|
|
218
|
-
this._selectItem(enabled[nextIndex]);
|
|
219
|
-
}
|
|
220
|
-
focus() {
|
|
221
|
-
const root = this.renderRoot;
|
|
222
|
-
const tab = root.querySelector(".mono-tabs-tab.on");
|
|
223
|
-
const fallback = root.querySelector(".mono-tabs-tab");
|
|
224
|
-
(tab ?? fallback)?.focus();
|
|
225
|
-
}
|
|
226
|
-
blur() {
|
|
227
|
-
this.renderRoot.querySelector(".mono-tabs-tab:focus")?.blur();
|
|
228
|
-
}
|
|
229
|
-
/** The items to render for THIS pass. Shadow overrides for the hydration gate. */
|
|
230
|
-
_itemsForRender() {
|
|
231
|
-
return this.items;
|
|
232
|
-
}
|
|
233
|
-
/** Whether per-tab icons render through a native `<slot>` (shadow) vs `data-mono-slot` (light). */
|
|
234
|
-
_useIconSlots() {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
/** Whether tab `id` has a slotted icon. Light reads its capture map; shadow its scanned set. */
|
|
238
|
-
_iconHasContent(_id) {
|
|
239
|
-
return false;
|
|
240
|
-
}
|
|
241
|
-
_renderIcon(item) {
|
|
242
|
-
if (this._useIconSlots()) return html`
|
|
243
|
-
<span
|
|
244
|
-
class=${this._cls("mono-tabs-tab-icon", "icon")}
|
|
245
|
-
mono-icon
|
|
246
|
-
aria-hidden="true"
|
|
247
|
-
?mono-empty=${!this._iconHasContent(item.id)}
|
|
248
|
-
>
|
|
249
|
-
<slot name=${`icon-${item.id}`}></slot>
|
|
250
|
-
</span>
|
|
251
|
-
`;
|
|
252
|
-
if (!this._iconHasContent(item.id)) return nothing;
|
|
253
|
-
return html`
|
|
254
|
-
<span class=${this._cls("mono-tabs-tab-icon", "icon")} mono-icon aria-hidden="true">
|
|
255
|
-
<span data-mono-slot=${`icon-${item.id}`}></span>
|
|
256
|
-
</span>
|
|
257
|
-
`;
|
|
258
|
-
}
|
|
259
|
-
_renderBadge(item) {
|
|
260
|
-
if (item.badge === void 0 || item.badge === null || item.badge === "") return nothing;
|
|
261
|
-
return html`
|
|
262
|
-
<span class=${this._cls("mono-tabs-tab-badge", "badge")} mono-badge>
|
|
263
|
-
${item.badge}
|
|
264
|
-
</span>
|
|
265
|
-
`;
|
|
266
|
-
}
|
|
267
|
-
render() {
|
|
268
|
-
return html`
|
|
269
|
-
<div class=${this._wrapperClasses} mono-tabs role="tablist" ${ref(this.bindRoot)}>
|
|
270
|
-
${this._itemsForRender().map((item) => html`
|
|
271
|
-
<button
|
|
272
|
-
type="button"
|
|
273
|
-
class=${this._tabClasses(item)}
|
|
274
|
-
mono-tab
|
|
275
|
-
role="tab"
|
|
276
|
-
aria-selected=${this._isActive(item) ? "true" : "false"}
|
|
277
|
-
?disabled=${this.disabled || item.disabled}
|
|
278
|
-
data-tab-id=${item.id}
|
|
279
|
-
@click=${(event) => this._handleClick(item, event)}
|
|
280
|
-
>
|
|
281
|
-
${this._renderIcon(item)}
|
|
282
|
-
<span class=${this._cls("mono-tabs-tab-label", "label")} mono-label>
|
|
283
|
-
${item.label}
|
|
284
|
-
</span>
|
|
285
|
-
${this._renderBadge(item)}
|
|
286
|
-
</button>
|
|
287
|
-
`)}
|
|
288
|
-
</div>
|
|
289
|
-
`;
|
|
290
|
-
}
|
|
291
|
-
}
|
|
292
|
-
__decorate([property({
|
|
293
|
-
attribute: "items",
|
|
294
|
-
converter: {
|
|
295
|
-
fromAttribute: (value) => coerceTabItems(value),
|
|
296
|
-
toAttribute: () => null
|
|
297
|
-
},
|
|
298
|
-
hasChanged: arrayHasChanged
|
|
299
|
-
})], MonoTabsCoreClass.prototype, "items", void 0);
|
|
300
|
-
__decorate([property({
|
|
301
|
-
type: String,
|
|
302
|
-
attribute: "model-value",
|
|
303
|
-
reflect: true
|
|
304
|
-
})], MonoTabsCoreClass.prototype, "modelValue", void 0);
|
|
305
|
-
__decorate([property({ type: String })], MonoTabsCoreClass.prototype, "value", void 0);
|
|
306
|
-
__decorate([property({ type: String })], MonoTabsCoreClass.prototype, "size", void 0);
|
|
307
|
-
__decorate([property({ type: String })], MonoTabsCoreClass.prototype, "color", void 0);
|
|
308
|
-
__decorate([property({ type: String })], MonoTabsCoreClass.prototype, "variant", void 0);
|
|
309
|
-
__decorate([property({ type: String })], MonoTabsCoreClass.prototype, "orientation", void 0);
|
|
310
|
-
__decorate([property({
|
|
311
|
-
reflect: true,
|
|
312
|
-
converter: booleanStringConverter
|
|
313
|
-
})], MonoTabsCoreClass.prototype, "disabled", void 0);
|
|
314
|
-
__decorate([property({ attribute: false })], MonoTabsCoreClass.prototype, "cssClass", void 0);
|
|
315
|
-
__decorate([property({ attribute: false })], MonoTabsCoreClass.prototype, "cssClassName", void 0);
|
|
316
|
-
return MonoTabsCoreClass;
|
|
317
|
-
};
|
|
318
|
-
|
|
319
|
-
//#endregion
|
|
320
9
|
//#region src/components/tabs/mono-tabs.ts
|
|
321
10
|
let MonoTabs = class MonoTabs extends MonoTabsCore(LitElement) {
|
|
322
11
|
constructor(..._args) {
|