@mono-lit/helper 0.0.9 → 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-DTqDBca7.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-B2iRpJuI.js → mono-data-dropdown-Bgj2PDfm.js} +1 -1
- package/dist/{mono-data-grid-llJCX9MC.js → mono-data-grid-DJkp96N-.js} +144 -46
- 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 +22 -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 +118 -1
- 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-e9ZVBlNN.js +0 -4240
- package/dist/normalize-error-BmLbgANw.js +0 -1048
package/dist/ui/accordion.js
CHANGED
|
@@ -1,283 +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
|
|
5
|
-
import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
|
|
3
|
+
import { t as __decorate } from "../decorate-DbYFpi8R.js";
|
|
4
|
+
import { t as MonoAccordionCore } from "../accordion-core-DaNyPWRr.js";
|
|
6
5
|
import { a as parkDetachedNodes, i as guardHostTextContent, s as placeSlotNode } from "../light-slots-B5Ck0t_E.js";
|
|
7
6
|
import { LitElement, html, isServer, nothing } from "lit";
|
|
8
7
|
import { ref } from "lit/directives/ref.js";
|
|
9
|
-
import { property, query, state } from "lit/decorators.js";
|
|
10
8
|
|
|
11
|
-
//#region src/components/accordion/accordion-core.ts
|
|
12
|
-
/**
|
|
13
|
-
* `MonoAccordionCore` — all render-mode-agnostic logic for `mono-accordion`:
|
|
14
|
-
* reactive props, hybrid aliases, the camelCase attribute fallbacks, slot-presence
|
|
15
|
-
* `@state`, class/getter computation, click/toggle interactivity, and the
|
|
16
|
-
* imperative `focus/blur`. No `render()` — the light build keeps its
|
|
17
|
-
* `[data-mono-slot]` capture strategy and the shadow build uses native `<slot>`
|
|
18
|
-
* (each ships its own `render()`, mirroring `mono-card`).
|
|
19
|
-
*
|
|
20
|
-
* SSR-safe: no `document`/`window` access. `_headEl` (`@query`) is lazy and
|
|
21
|
-
* `focus/blur` only run client-side.
|
|
22
|
-
*/
|
|
23
|
-
const MonoAccordionCore = (superClass) => {
|
|
24
|
-
class MonoAccordionCoreClass extends superClass {
|
|
25
|
-
constructor(...args) {
|
|
26
|
-
super(...args);
|
|
27
|
-
this.size = "md";
|
|
28
|
-
this.color = "primary";
|
|
29
|
-
this.modelValue = false;
|
|
30
|
-
this.disabled = false;
|
|
31
|
-
this.cssClass = {};
|
|
32
|
-
this.cssClassName = "";
|
|
33
|
-
this._hasTitleSlotState = false;
|
|
34
|
-
this._hasSubtitleSlotState = false;
|
|
35
|
-
this._hasHeaderSlotState = false;
|
|
36
|
-
this._hasIconSlotState = false;
|
|
37
|
-
this._hasActionsSlotState = false;
|
|
38
|
-
this._hasBodySlotState = false;
|
|
39
|
-
this._rootEl = null;
|
|
40
|
-
this.bindRoot = (el) => {
|
|
41
|
-
this._rootEl = el ?? null;
|
|
42
|
-
this._applyRootAttrs(this._rootEl);
|
|
43
|
-
};
|
|
44
|
-
defineHybridPropAliases(this, ["modelValue", "cssClass"]);
|
|
45
|
-
defineHybridPropAlias(this, "label", "title");
|
|
46
|
-
defineHybridPropAlias(this, "description", "subtitle");
|
|
47
|
-
this.title = "";
|
|
48
|
-
this.subtitle = "";
|
|
49
|
-
this.icon = "";
|
|
50
|
-
/**
|
|
51
|
-
* Vue support:
|
|
52
|
-
*
|
|
53
|
-
* <mono-accordion :cssClass="{}" />
|
|
54
|
-
* <mono-accordion :css-class="{}" />
|
|
55
|
-
* <mono-accordion :cssclass="{}" />
|
|
56
|
-
*/
|
|
57
|
-
Object.defineProperty(this, "css-class", {
|
|
58
|
-
get: () => this.cssClass,
|
|
59
|
-
set: (value) => {
|
|
60
|
-
this._setCssClass(value);
|
|
61
|
-
},
|
|
62
|
-
configurable: true,
|
|
63
|
-
enumerable: false
|
|
64
|
-
});
|
|
65
|
-
Object.defineProperty(this, "cssclass", {
|
|
66
|
-
get: () => this.cssClass,
|
|
67
|
-
set: (value) => {
|
|
68
|
-
this._setCssClass(value);
|
|
69
|
-
},
|
|
70
|
-
configurable: true,
|
|
71
|
-
enumerable: false
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
static get observedAttributes() {
|
|
75
|
-
return [
|
|
76
|
-
...super.observedAttributes ?? [],
|
|
77
|
-
"modelvalue",
|
|
78
|
-
"css-class",
|
|
79
|
-
"cssclass",
|
|
80
|
-
"label",
|
|
81
|
-
"description"
|
|
82
|
-
];
|
|
83
|
-
}
|
|
84
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
85
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
86
|
-
if (oldValue === newValue) return;
|
|
87
|
-
if (name === "modelvalue") {
|
|
88
|
-
this.modelValue = this._toBoolean(newValue);
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (name === "css-class" || name === "cssclass") {
|
|
92
|
-
this._setCssClass(newValue);
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
if (name === "label") {
|
|
96
|
-
this.title = newValue ?? "";
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
if (name === "description") this.subtitle = newValue ?? "";
|
|
100
|
-
}
|
|
101
|
-
_toBoolean(value) {
|
|
102
|
-
if (typeof value === "boolean") return value;
|
|
103
|
-
if (typeof value === "string") {
|
|
104
|
-
const normalized = value.toLowerCase().trim();
|
|
105
|
-
return normalized === "" || normalized === "true";
|
|
106
|
-
}
|
|
107
|
-
return Boolean(value);
|
|
108
|
-
}
|
|
109
|
-
_setCssClass(value) {
|
|
110
|
-
if (value == null) {
|
|
111
|
-
this.cssClass = {};
|
|
112
|
-
this.cssClassName = "";
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (typeof value === "object") {
|
|
116
|
-
this.cssClass = value;
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
if (typeof value === "string") {
|
|
120
|
-
const trimmed = value.trim();
|
|
121
|
-
if (!trimmed) {
|
|
122
|
-
this.cssClass = {};
|
|
123
|
-
this.cssClassName = "";
|
|
124
|
-
return;
|
|
125
|
-
}
|
|
126
|
-
if (trimmed.startsWith("{") && trimmed.endsWith("}")) try {
|
|
127
|
-
this.cssClass = JSON.parse(trimmed);
|
|
128
|
-
return;
|
|
129
|
-
} catch {}
|
|
130
|
-
this.cssClassName = trimmed;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
_cls(base, key) {
|
|
134
|
-
const extra = this.cssClass?.[key];
|
|
135
|
-
return extra ? `${base} ${extra}` : base;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* The prop mirrors, each omitted at its default so `:not([mono-size])` means
|
|
139
|
-
* "md" for hand-written markup exactly as it does for the element.
|
|
140
|
-
*/
|
|
141
|
-
_computeRootAttrs() {
|
|
142
|
-
return {
|
|
143
|
-
"mono-size": this.size === "md" ? null : this.size,
|
|
144
|
-
"mono-color": this.color === "primary" ? null : this.color,
|
|
145
|
-
"mono-open": this.modelValue ? "" : null,
|
|
146
|
-
"mono-disabled": this.disabled ? "" : null,
|
|
147
|
-
"mono-grouped": this._inGroup() ? "" : null
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Is this item inside an accordion group?
|
|
152
|
-
*
|
|
153
|
-
* The CSS can see that for hand-written markup — `[mono-accordion-group] >
|
|
154
|
-
* [mono-accordion]` — but not for the ELEMENT: the light build puts the
|
|
155
|
-
* custom-element host between the group and the root, and the shadow build
|
|
156
|
-
* puts a boundary there, and a selector crosses neither. So the element
|
|
157
|
-
* detects its own group and writes it as an attribute, which is the one thing
|
|
158
|
-
* that reaches the root in both builds.
|
|
159
|
-
*
|
|
160
|
-
* Only MEMBERSHIP, never position: "am I the last one?" would be answered
|
|
161
|
-
* from however many siblings existed at this render, and appending a fourth
|
|
162
|
-
* item does not re-render the third. The divider is the group's business and
|
|
163
|
-
* rides its own `:last-child` (see accordion.css).
|
|
164
|
-
*
|
|
165
|
-
* `closest()` on the HOST, not the root: the group is the consumer's wrapper
|
|
166
|
-
* around `<mono-accordion>`, so the host is what sits inside it.
|
|
167
|
-
*/
|
|
168
|
-
_inGroup() {
|
|
169
|
-
if (typeof this.closest !== "function") return false;
|
|
170
|
-
return Boolean(this.closest("[mono-accordion-group], .mono-accordion-group"));
|
|
171
|
-
}
|
|
172
|
-
_applyRootAttrs(root) {
|
|
173
|
-
if (!root) return;
|
|
174
|
-
if (!root.hasAttribute("mono-accordion")) root.setAttribute("mono-accordion", "");
|
|
175
|
-
for (const [name, value] of Object.entries(this._computeRootAttrs())) if (value === null) root.removeAttribute(name);
|
|
176
|
-
else if (root.getAttribute(name) !== value) root.setAttribute(name, value);
|
|
177
|
-
}
|
|
178
|
-
updated(changed) {
|
|
179
|
-
super.updated?.(changed);
|
|
180
|
-
this._applyRootAttrs(this._rootEl);
|
|
181
|
-
}
|
|
182
|
-
get _wrapperClasses() {
|
|
183
|
-
return [
|
|
184
|
-
"mono-accordion",
|
|
185
|
-
this.size,
|
|
186
|
-
this.color,
|
|
187
|
-
this.modelValue ? "open" : "",
|
|
188
|
-
this.disabled ? "disabled" : "",
|
|
189
|
-
this.cssClassName,
|
|
190
|
-
this.cssClass?.root
|
|
191
|
-
].filter(Boolean).join(" ");
|
|
192
|
-
}
|
|
193
|
-
get _hasTitleContent() {
|
|
194
|
-
return Boolean(this.title) || this._hasTitleSlotState;
|
|
195
|
-
}
|
|
196
|
-
get _hasSubtitleContent() {
|
|
197
|
-
return Boolean(this.subtitle) || this._hasSubtitleSlotState;
|
|
198
|
-
}
|
|
199
|
-
get _hasIconContent() {
|
|
200
|
-
return this._hasIconSlotState || Boolean(this.icon);
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* The `icon` prop: an iconify class becomes an empty masked span, anything
|
|
204
|
-
* else is text. The shadow build overrides this with inline SVG (a page
|
|
205
|
-
* utility class cannot reach inside a shadow root).
|
|
206
|
-
*/
|
|
207
|
-
_renderIconGlyph() {
|
|
208
|
-
if (!this.icon) return nothing;
|
|
209
|
-
if (isIconifyClass(this.icon)) return html`<span class=${`mono-accordion-iconify ${this.icon}`}></span>`;
|
|
210
|
-
return html`${this.icon}`;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* The open state changed. `mno-click` is the historical name; the plain
|
|
214
|
-
* event is `toggle`, and the transition also fires `open` / `close`
|
|
215
|
-
* (+ `mno-open` / `mno-close`) — the same trio modal and drawer emit.
|
|
216
|
-
*/
|
|
217
|
-
_emitClick(detail) {
|
|
218
|
-
dispatchMonoEvent(this, "click", detail, { alias: "toggle" });
|
|
219
|
-
dispatchMonoEvent(this, detail.modelValue ? "open" : "close", detail);
|
|
220
|
-
}
|
|
221
|
-
_setOpen(next, sourceEvent) {
|
|
222
|
-
if (this.disabled) return;
|
|
223
|
-
if (this.modelValue === next) return;
|
|
224
|
-
const oldValue = this.modelValue;
|
|
225
|
-
this.modelValue = next;
|
|
226
|
-
this._emitClick({
|
|
227
|
-
modelValue: next,
|
|
228
|
-
currentValue: next,
|
|
229
|
-
oldValue,
|
|
230
|
-
value: next,
|
|
231
|
-
sourceEvent
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
_handleClick(event) {
|
|
235
|
-
if (this.disabled) return;
|
|
236
|
-
this._setOpen(!this.modelValue, event);
|
|
237
|
-
}
|
|
238
|
-
toggle() {
|
|
239
|
-
this._setOpen(!this.modelValue);
|
|
240
|
-
}
|
|
241
|
-
expand() {
|
|
242
|
-
this._setOpen(true);
|
|
243
|
-
}
|
|
244
|
-
collapse() {
|
|
245
|
-
this._setOpen(false);
|
|
246
|
-
}
|
|
247
|
-
focus() {
|
|
248
|
-
this._headEl?.focus();
|
|
249
|
-
}
|
|
250
|
-
blur() {
|
|
251
|
-
this._headEl?.blur();
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
__decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "size", void 0);
|
|
255
|
-
__decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "color", void 0);
|
|
256
|
-
__decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "title", void 0);
|
|
257
|
-
__decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "subtitle", void 0);
|
|
258
|
-
__decorate([property({ type: String })], MonoAccordionCoreClass.prototype, "icon", void 0);
|
|
259
|
-
__decorate([property({
|
|
260
|
-
attribute: "model-value",
|
|
261
|
-
reflect: true,
|
|
262
|
-
converter: booleanStringConverter
|
|
263
|
-
})], MonoAccordionCoreClass.prototype, "modelValue", void 0);
|
|
264
|
-
__decorate([property({
|
|
265
|
-
reflect: true,
|
|
266
|
-
converter: booleanStringConverter
|
|
267
|
-
})], MonoAccordionCoreClass.prototype, "disabled", void 0);
|
|
268
|
-
__decorate([property({ attribute: false })], MonoAccordionCoreClass.prototype, "cssClass", void 0);
|
|
269
|
-
__decorate([property({ attribute: false })], MonoAccordionCoreClass.prototype, "cssClassName", void 0);
|
|
270
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasTitleSlotState", void 0);
|
|
271
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasSubtitleSlotState", void 0);
|
|
272
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasHeaderSlotState", void 0);
|
|
273
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasIconSlotState", void 0);
|
|
274
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasActionsSlotState", void 0);
|
|
275
|
-
__decorate([state()], MonoAccordionCoreClass.prototype, "_hasBodySlotState", void 0);
|
|
276
|
-
__decorate([query(".mono-accordion-head")], MonoAccordionCoreClass.prototype, "_headEl", void 0);
|
|
277
|
-
return MonoAccordionCoreClass;
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
//#endregion
|
|
281
9
|
//#region src/components/accordion/mono-accordion.ts
|
|
282
10
|
let MonoAccordion = class MonoAccordion extends MonoAccordionCore(LitElement) {
|
|
283
11
|
constructor(..._args) {
|
package/dist/ui/alert.js
CHANGED
|
@@ -1,138 +1,9 @@
|
|
|
1
1
|
import { t as customElement } from "../mono-element-CKcT0rwv.js";
|
|
2
|
-
import {
|
|
3
|
-
import { t as isIconifyClass } from "../icon-ClxnYhBG.js";
|
|
2
|
+
import { t as __decorate } from "../decorate-DbYFpi8R.js";
|
|
4
3
|
import { a as parkDetachedNodes, n as bucketHasContent, o as placeLightSlots, r as captureLightSlots } from "../light-slots-B5Ck0t_E.js";
|
|
5
|
-
import {
|
|
4
|
+
import { t as MonoAlertCore } from "../alert-core-DWtHbX_-.js";
|
|
6
5
|
import { LitElement, html, nothing } from "lit";
|
|
7
|
-
import { property, state } from "lit/decorators.js";
|
|
8
6
|
|
|
9
|
-
//#region src/components/alert/alert-core.ts
|
|
10
|
-
/**
|
|
11
|
-
* `MonoAlertCore` — everything both builds share: props (with the `closeable`
|
|
12
|
-
* alias), the ✕ that hides the alert, and the root template. The regions are
|
|
13
|
-
* one overridable hook, `_renderMain()`: the light build fills `[data-mono-slot]`
|
|
14
|
-
* placeholders, the shadow build uses native `<slot>`s.
|
|
15
|
-
*
|
|
16
|
-
* The alert emits NO events of its own. `@click` on it is the browser's click;
|
|
17
|
-
* the ✕ only hides the element (the native `hidden` attribute), and stops its
|
|
18
|
-
* own click so a listener on the alert does not fire for it.
|
|
19
|
-
*
|
|
20
|
-
* SSR-safe: no `document`/`window` access.
|
|
21
|
-
*/
|
|
22
|
-
const MonoAlertCore = (superClass) => {
|
|
23
|
-
class MonoAlertCoreClass extends superClass {
|
|
24
|
-
constructor(...args) {
|
|
25
|
-
super(...args);
|
|
26
|
-
this._hasIconSlot = false;
|
|
27
|
-
this._hasTitleSlot = false;
|
|
28
|
-
this._hasSubtitleSlot = false;
|
|
29
|
-
this._hasBodySlot = false;
|
|
30
|
-
this._clear = (event) => {
|
|
31
|
-
event.stopPropagation();
|
|
32
|
-
this.hidden = true;
|
|
33
|
-
};
|
|
34
|
-
defineHybridPropAliases(this, ["clearLabel", "cssClass"]);
|
|
35
|
-
defineHybridPropAlias(this, "closeable", "clearable");
|
|
36
|
-
this.title = "";
|
|
37
|
-
this.subtitle = "";
|
|
38
|
-
this.icon = "";
|
|
39
|
-
this.color = "neutral";
|
|
40
|
-
this.variant = "outline";
|
|
41
|
-
this.size = "md";
|
|
42
|
-
this.clearable = false;
|
|
43
|
-
this.clearLabel = "Close";
|
|
44
|
-
this.cssClass = {};
|
|
45
|
-
}
|
|
46
|
-
static get observedAttributes() {
|
|
47
|
-
return [
|
|
48
|
-
...super.observedAttributes ?? [],
|
|
49
|
-
"closeable",
|
|
50
|
-
"clearlabel",
|
|
51
|
-
"cssclass"
|
|
52
|
-
];
|
|
53
|
-
}
|
|
54
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
55
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
56
|
-
if (oldValue === newValue) return;
|
|
57
|
-
if (name === "closeable") {
|
|
58
|
-
this.clearable = booleanStringConverter.fromAttribute(newValue);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (name === "clearlabel") this.clearLabel = newValue ?? "Close";
|
|
62
|
-
}
|
|
63
|
-
_cls(base, key) {
|
|
64
|
-
const extra = this.cssClass?.[key];
|
|
65
|
-
return extra ? `${base} ${extra}` : base;
|
|
66
|
-
}
|
|
67
|
-
get _showsIcon() {
|
|
68
|
-
return !this._hasBodySlot && (this._hasIconSlot || Boolean(this.icon));
|
|
69
|
-
}
|
|
70
|
-
get _showsTitle() {
|
|
71
|
-
return !this._hasBodySlot && (this._hasTitleSlot || Boolean(this.title));
|
|
72
|
-
}
|
|
73
|
-
get _showsSubtitle() {
|
|
74
|
-
return !this._hasBodySlot && (this._hasSubtitleSlot || Boolean(this.subtitle));
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* The `icon` prop: an iconify class becomes an empty masked span, anything
|
|
78
|
-
* else is text. The shadow build overrides this with inline SVG (a page
|
|
79
|
-
* utility class cannot reach inside a shadow root).
|
|
80
|
-
*/
|
|
81
|
-
_renderIconGlyph() {
|
|
82
|
-
if (!this.icon) return nothing;
|
|
83
|
-
if (isIconifyClass(this.icon)) return html`<span class=${`mono-alert-iconify ${this.icon}`} mono-glyph></span>`;
|
|
84
|
-
return html`${this.icon}`;
|
|
85
|
-
}
|
|
86
|
-
/** The regions — each build renders its own slot strategy here. */
|
|
87
|
-
_renderMain() {
|
|
88
|
-
return nothing;
|
|
89
|
-
}
|
|
90
|
-
_renderClear() {
|
|
91
|
-
if (!this.clearable) return nothing;
|
|
92
|
-
return html`<button
|
|
93
|
-
type="button"
|
|
94
|
-
class=${this._cls("mono-alert-clear", "clear")}
|
|
95
|
-
mono-clear
|
|
96
|
-
aria-label=${this.clearLabel}
|
|
97
|
-
@click=${this._clear}
|
|
98
|
-
>${closeIcon()}</button>`;
|
|
99
|
-
}
|
|
100
|
-
render() {
|
|
101
|
-
return html`<div
|
|
102
|
-
class=${this._cls("mono-alert", "root")}
|
|
103
|
-
mono-alert
|
|
104
|
-
mono-size=${this.size && this.size !== "md" ? this.size : nothing}
|
|
105
|
-
mono-variant=${this.variant && this.variant !== "outline" ? this.variant : nothing}
|
|
106
|
-
mono-color=${this.color && this.color !== "neutral" ? this.color : nothing}
|
|
107
|
-
?mono-clearable=${this.clearable}
|
|
108
|
-
role="alert"
|
|
109
|
-
title=""
|
|
110
|
-
>${this._renderMain()}${this._renderClear()}</div>`;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "title", void 0);
|
|
114
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "subtitle", void 0);
|
|
115
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "icon", void 0);
|
|
116
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "color", void 0);
|
|
117
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "variant", void 0);
|
|
118
|
-
__decorate([property({ type: String })], MonoAlertCoreClass.prototype, "size", void 0);
|
|
119
|
-
__decorate([property({
|
|
120
|
-
reflect: true,
|
|
121
|
-
converter: booleanStringConverter
|
|
122
|
-
})], MonoAlertCoreClass.prototype, "clearable", void 0);
|
|
123
|
-
__decorate([property({
|
|
124
|
-
type: String,
|
|
125
|
-
attribute: "clear-label"
|
|
126
|
-
})], MonoAlertCoreClass.prototype, "clearLabel", void 0);
|
|
127
|
-
__decorate([property({ attribute: false })], MonoAlertCoreClass.prototype, "cssClass", void 0);
|
|
128
|
-
__decorate([state()], MonoAlertCoreClass.prototype, "_hasIconSlot", void 0);
|
|
129
|
-
__decorate([state()], MonoAlertCoreClass.prototype, "_hasTitleSlot", void 0);
|
|
130
|
-
__decorate([state()], MonoAlertCoreClass.prototype, "_hasSubtitleSlot", void 0);
|
|
131
|
-
__decorate([state()], MonoAlertCoreClass.prototype, "_hasBodySlot", void 0);
|
|
132
|
-
return MonoAlertCoreClass;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
//#endregion
|
|
136
7
|
//#region src/components/alert/mono-alert.ts
|
|
137
8
|
/** Named regions. Unslotted children fall into `body` (the capture fallback). */
|
|
138
9
|
const ALERT_NAMED_SLOTS = [
|