@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/shadow/chip.js
CHANGED
|
@@ -1,273 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as
|
|
1
|
+
import { t as customElement } from "../../mono-element-CKcT0rwv.js";
|
|
2
|
+
import { t as __decorate } from "../../decorate-DbYFpi8R.js";
|
|
3
|
+
import { a as MonoChipCore, i as MonoStatusDot, n as isInteractive, r as validateChipProps, t as generateChipRootClasses } from "../../chip-utils-DpRrd7Zj.js";
|
|
3
4
|
import { t as chip_css_raw_default } from "../../chip.css_raw-ChfRSHLO.js";
|
|
5
|
+
import { i as withShadowUtilityStyles, r as toShadowCss, t as flushSsrHydration } from "../../hydration-flush-Volt9X7Q.js";
|
|
4
6
|
import { LitElement, html, isServer, nothing, unsafeCSS } from "lit";
|
|
5
|
-
import { property, query, state } from "lit/decorators.js";
|
|
6
7
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
7
8
|
import { when } from "lit/directives/when.js";
|
|
8
9
|
|
|
9
|
-
//#region src/components/chip/chip-core.ts
|
|
10
|
-
/**
|
|
11
|
-
* `MonoChipCore` — all render-mode-agnostic logic for `mono-chip`: reactive
|
|
12
|
-
* props, hybrid aliases (incl. the `ariaLabel`/`aria-label`/`arialabel` →
|
|
13
|
-
* `ariaLabelText` getters), camelCase attribute fallbacks, the `modelValue`↔
|
|
14
|
-
* `selected` sync + SSR boolean coercion in `willUpdate`, class computation,
|
|
15
|
-
* click/keyboard/close interactivity (`mno-click`/`mno-close`), and the imperative
|
|
16
|
-
* `focus/blur/click`. No `render()` — the light build keeps its `[data-mono-slot]`
|
|
17
|
-
* capture strategy and the shadow build uses native `<slot>` (mirrors `mono-button`).
|
|
18
|
-
*
|
|
19
|
-
* SSR-safe: no `document`/`window` access; `_chipElement` (`@query`) is lazy and
|
|
20
|
-
* `focus/blur/click` only run client-side.
|
|
21
|
-
*/
|
|
22
|
-
const MonoChipCore = (superClass) => {
|
|
23
|
-
class MonoChipCoreClass extends superClass {
|
|
24
|
-
constructor(...args) {
|
|
25
|
-
super(...args);
|
|
26
|
-
this.cssClass = {};
|
|
27
|
-
this._hasIcon = false;
|
|
28
|
-
defineHybridPropAliases(this, [
|
|
29
|
-
"modelValue",
|
|
30
|
-
"iconPosition",
|
|
31
|
-
"ariaLabelText",
|
|
32
|
-
"closeLabel",
|
|
33
|
-
"cssClass"
|
|
34
|
-
]);
|
|
35
|
-
for (const name of [
|
|
36
|
-
"ariaLabel",
|
|
37
|
-
"aria-label",
|
|
38
|
-
"arialabel"
|
|
39
|
-
]) Object.defineProperty(this, name, {
|
|
40
|
-
get: () => this.ariaLabelText,
|
|
41
|
-
set: (value) => {
|
|
42
|
-
this.ariaLabelText = value == null ? void 0 : String(value);
|
|
43
|
-
},
|
|
44
|
-
configurable: true,
|
|
45
|
-
enumerable: false
|
|
46
|
-
});
|
|
47
|
-
this.size = "md";
|
|
48
|
-
this.color = "primary";
|
|
49
|
-
this.variant = "soft";
|
|
50
|
-
this.label = void 0;
|
|
51
|
-
this.dot = false;
|
|
52
|
-
this.removable = false;
|
|
53
|
-
this.clickable = false;
|
|
54
|
-
this.disabled = false;
|
|
55
|
-
this.modelValue = false;
|
|
56
|
-
this.selected = false;
|
|
57
|
-
this.href = void 0;
|
|
58
|
-
this.target = void 0;
|
|
59
|
-
this.iconPosition = "left";
|
|
60
|
-
this.ariaLabelText = void 0;
|
|
61
|
-
this.closeLabel = "Remove";
|
|
62
|
-
this._isActive = false;
|
|
63
|
-
}
|
|
64
|
-
static get observedAttributes() {
|
|
65
|
-
return [
|
|
66
|
-
...super.observedAttributes ?? [],
|
|
67
|
-
"modelvalue",
|
|
68
|
-
"iconposition",
|
|
69
|
-
"closelabel",
|
|
70
|
-
"arialabeltext",
|
|
71
|
-
"arialabel"
|
|
72
|
-
];
|
|
73
|
-
}
|
|
74
|
-
attributeChangedCallback(name, oldValue, newValue) {
|
|
75
|
-
super.attributeChangedCallback(name, oldValue, newValue);
|
|
76
|
-
if (oldValue === newValue) return;
|
|
77
|
-
if (name === "modelvalue") {
|
|
78
|
-
this.modelValue = this._toBoolean(newValue);
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
if (name === "iconposition") {
|
|
82
|
-
this.iconPosition = newValue ?? "left";
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
if (name === "closelabel") {
|
|
86
|
-
this.closeLabel = newValue ?? "Remove";
|
|
87
|
-
return;
|
|
88
|
-
}
|
|
89
|
-
if (name === "arialabeltext" || name === "arialabel") this.ariaLabelText = newValue ?? void 0;
|
|
90
|
-
}
|
|
91
|
-
willUpdate(changed) {
|
|
92
|
-
for (const key of [
|
|
93
|
-
"dot",
|
|
94
|
-
"removable",
|
|
95
|
-
"clickable",
|
|
96
|
-
"disabled",
|
|
97
|
-
"modelValue",
|
|
98
|
-
"selected"
|
|
99
|
-
]) if (typeof this[key] === "string") this[key] = this._toBoolean(this[key]);
|
|
100
|
-
if (!this.hasUpdated) {
|
|
101
|
-
const on = this.selected || this.modelValue;
|
|
102
|
-
if (this.selected !== on) this.selected = on;
|
|
103
|
-
if (this.modelValue !== on) this.modelValue = on;
|
|
104
|
-
} else {
|
|
105
|
-
if (changed.has("modelValue") && this.selected !== this.modelValue) this.selected = this.modelValue;
|
|
106
|
-
if (changed.has("selected") && this.modelValue !== this.selected) this.modelValue = this.selected;
|
|
107
|
-
}
|
|
108
|
-
super.willUpdate?.(changed);
|
|
109
|
-
}
|
|
110
|
-
_toBoolean(value) {
|
|
111
|
-
if (typeof value === "boolean") return value;
|
|
112
|
-
if (typeof value === "string") {
|
|
113
|
-
const normalized = value.toLowerCase().trim();
|
|
114
|
-
return normalized === "" || normalized === "true";
|
|
115
|
-
}
|
|
116
|
-
return Boolean(value);
|
|
117
|
-
}
|
|
118
|
-
_cls(base, key) {
|
|
119
|
-
const extra = this.cssClass?.[key];
|
|
120
|
-
return extra ? `${base} ${extra}` : base;
|
|
121
|
-
}
|
|
122
|
-
get _isInteractive() {
|
|
123
|
-
return this.clickable || Boolean(this.href) || this.removable;
|
|
124
|
-
}
|
|
125
|
-
get _chipClasses() {
|
|
126
|
-
const classes = ["mono-chip"];
|
|
127
|
-
classes.push(this.size);
|
|
128
|
-
if (this.variant === "soft") classes.push(`soft-${this.color}`);
|
|
129
|
-
else if (this.variant === "solid") classes.push(`solid-${this.color}`);
|
|
130
|
-
else if (this.variant === "outline") classes.push(`outline-${this.color}`);
|
|
131
|
-
if (this.dot) classes.push("has-dot");
|
|
132
|
-
if (this.removable) classes.push("removable");
|
|
133
|
-
if (this.clickable || this.href) classes.push("clickable");
|
|
134
|
-
if (this.disabled) classes.push("disabled");
|
|
135
|
-
if (this.selected || this._isActive) classes.push("selected");
|
|
136
|
-
if (this.cssClass?.root) classes.push(this.cssClass.root);
|
|
137
|
-
return classes.join(" ");
|
|
138
|
-
}
|
|
139
|
-
_createModelDetail(args) {
|
|
140
|
-
return {
|
|
141
|
-
modelValue: args.modelValue,
|
|
142
|
-
currentValue: args.modelValue,
|
|
143
|
-
oldValue: args.oldValue,
|
|
144
|
-
value: args.modelValue,
|
|
145
|
-
selected: args.modelValue,
|
|
146
|
-
label: this.label ?? "",
|
|
147
|
-
sourceEvent: args.sourceEvent
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
_emitClick(detail) {
|
|
151
|
-
dispatchMonoEvent(this, "click", detail);
|
|
152
|
-
}
|
|
153
|
-
_emitClose(detail) {
|
|
154
|
-
dispatchMonoEvent(this, "close", detail);
|
|
155
|
-
}
|
|
156
|
-
_handleClick(event) {
|
|
157
|
-
if (this.disabled) {
|
|
158
|
-
event.preventDefault();
|
|
159
|
-
event.stopPropagation();
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const oldValue = this.modelValue;
|
|
163
|
-
let nextValue = this.modelValue;
|
|
164
|
-
if (this.clickable && !this.href) {
|
|
165
|
-
nextValue = !this.modelValue;
|
|
166
|
-
this.modelValue = nextValue;
|
|
167
|
-
this.selected = nextValue;
|
|
168
|
-
}
|
|
169
|
-
const detail = this._createModelDetail({
|
|
170
|
-
modelValue: nextValue,
|
|
171
|
-
oldValue,
|
|
172
|
-
sourceEvent: event
|
|
173
|
-
});
|
|
174
|
-
this._emitClick(detail);
|
|
175
|
-
}
|
|
176
|
-
_handleKeyDown(event) {
|
|
177
|
-
if (this.disabled) return;
|
|
178
|
-
if (event.key === "Enter" || event.key === " ") {
|
|
179
|
-
event.preventDefault();
|
|
180
|
-
this._chipElement?.click();
|
|
181
|
-
}
|
|
182
|
-
if ((event.key === "Backspace" || event.key === "Delete") && this.removable) {
|
|
183
|
-
event.preventDefault();
|
|
184
|
-
const detail = this._createModelDetail({
|
|
185
|
-
modelValue: this.modelValue,
|
|
186
|
-
oldValue: this.modelValue,
|
|
187
|
-
sourceEvent: event
|
|
188
|
-
});
|
|
189
|
-
this._emitClose(detail);
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
_handleFocus() {
|
|
193
|
-
this._isActive = true;
|
|
194
|
-
}
|
|
195
|
-
_handleBlur() {
|
|
196
|
-
this._isActive = false;
|
|
197
|
-
}
|
|
198
|
-
_handleClose(event) {
|
|
199
|
-
event.preventDefault();
|
|
200
|
-
event.stopPropagation();
|
|
201
|
-
if (this.disabled) return;
|
|
202
|
-
const detail = this._createModelDetail({
|
|
203
|
-
modelValue: this.modelValue,
|
|
204
|
-
oldValue: this.modelValue,
|
|
205
|
-
sourceEvent: event
|
|
206
|
-
});
|
|
207
|
-
this._emitClose(detail);
|
|
208
|
-
}
|
|
209
|
-
focus() {
|
|
210
|
-
this._chipElement?.focus();
|
|
211
|
-
}
|
|
212
|
-
blur() {
|
|
213
|
-
this._chipElement?.blur();
|
|
214
|
-
}
|
|
215
|
-
click() {
|
|
216
|
-
this._chipElement?.click();
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "size", void 0);
|
|
220
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "color", void 0);
|
|
221
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "variant", void 0);
|
|
222
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "rounded", void 0);
|
|
223
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "label", void 0);
|
|
224
|
-
__decorate([property({
|
|
225
|
-
reflect: true,
|
|
226
|
-
converter: booleanStringConverter
|
|
227
|
-
})], MonoChipCoreClass.prototype, "dot", void 0);
|
|
228
|
-
__decorate([property({
|
|
229
|
-
reflect: true,
|
|
230
|
-
converter: booleanStringConverter
|
|
231
|
-
})], MonoChipCoreClass.prototype, "removable", void 0);
|
|
232
|
-
__decorate([property({
|
|
233
|
-
reflect: true,
|
|
234
|
-
converter: booleanStringConverter
|
|
235
|
-
})], MonoChipCoreClass.prototype, "clickable", void 0);
|
|
236
|
-
__decorate([property({
|
|
237
|
-
reflect: true,
|
|
238
|
-
converter: booleanStringConverter
|
|
239
|
-
})], MonoChipCoreClass.prototype, "disabled", void 0);
|
|
240
|
-
__decorate([property({
|
|
241
|
-
attribute: "model-value",
|
|
242
|
-
reflect: true,
|
|
243
|
-
converter: booleanStringConverter
|
|
244
|
-
})], MonoChipCoreClass.prototype, "modelValue", void 0);
|
|
245
|
-
__decorate([property({
|
|
246
|
-
reflect: true,
|
|
247
|
-
converter: booleanStringConverter
|
|
248
|
-
})], MonoChipCoreClass.prototype, "selected", void 0);
|
|
249
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "href", void 0);
|
|
250
|
-
__decorate([property({ type: String })], MonoChipCoreClass.prototype, "target", void 0);
|
|
251
|
-
__decorate([property({
|
|
252
|
-
type: String,
|
|
253
|
-
attribute: "icon-position"
|
|
254
|
-
})], MonoChipCoreClass.prototype, "iconPosition", void 0);
|
|
255
|
-
__decorate([property({
|
|
256
|
-
type: String,
|
|
257
|
-
attribute: "aria-label"
|
|
258
|
-
})], MonoChipCoreClass.prototype, "ariaLabelText", void 0);
|
|
259
|
-
__decorate([property({
|
|
260
|
-
type: String,
|
|
261
|
-
attribute: "close-label"
|
|
262
|
-
})], MonoChipCoreClass.prototype, "closeLabel", void 0);
|
|
263
|
-
__decorate([property({ attribute: false })], MonoChipCoreClass.prototype, "cssClass", void 0);
|
|
264
|
-
__decorate([state()], MonoChipCoreClass.prototype, "_isActive", void 0);
|
|
265
|
-
__decorate([state()], MonoChipCoreClass.prototype, "_hasIcon", void 0);
|
|
266
|
-
__decorate([query("div > span, div > a")], MonoChipCoreClass.prototype, "_chipElement", void 0);
|
|
267
|
-
return MonoChipCoreClass;
|
|
268
|
-
};
|
|
269
|
-
|
|
270
|
-
//#endregion
|
|
271
10
|
//#region src/components/chip/mono-chip.shadow.ts
|
|
272
11
|
const SHADOW_EXTRA_CSS = `
|
|
273
12
|
[data-mono-slot='icon'][data-empty] {
|
|
@@ -430,136 +169,5 @@ let MonoChipShadow = class MonoChipShadow extends withShadowUtilityStyles(MonoCh
|
|
|
430
169
|
};
|
|
431
170
|
MonoChipShadow = __decorate([customElement("mono-shadow-chip")], MonoChipShadow);
|
|
432
171
|
|
|
433
|
-
//#endregion
|
|
434
|
-
//#region src/components/chip/mono-status-dot.ts
|
|
435
|
-
/**
|
|
436
|
-
* `mono-status-dot` — a small status indicator. Already a real shadow-DOM
|
|
437
|
-
* LitElement (default render root + `static styles`, native `<slot>`), so it is
|
|
438
|
-
* SSR-compatible as-is and shared verbatim by BOTH the light (`@mono-lit/helper/ui/chip`)
|
|
439
|
-
* and shadow (`@mono-lit/helper/ui/shadow/chip`) chip builds. It lives in its own
|
|
440
|
-
* module so the shadow chip build can register it WITHOUT importing the light
|
|
441
|
-
* `mono-chip` (which would collide with the shadow `mono-chip` class).
|
|
442
|
-
*
|
|
443
|
-
* It keeps the SAME `mono-status-dot` tag in both builds (it has no light/shadow
|
|
444
|
-
* variant — it is always a shadow-DOM element), so its registration is guarded
|
|
445
|
-
* (see bottom of file): whichever chip build loads first wins, and a page that
|
|
446
|
-
* loads both light + shadow chip won't throw a "already defined" registry error.
|
|
447
|
-
*/
|
|
448
|
-
var MonoStatusDot = class extends LitElement {
|
|
449
|
-
static {
|
|
450
|
-
this.styles = [unsafeCSS(chip_css_raw_default)];
|
|
451
|
-
}
|
|
452
|
-
constructor() {
|
|
453
|
-
super();
|
|
454
|
-
this.state = "online";
|
|
455
|
-
this.pulse = false;
|
|
456
|
-
this.label = void 0;
|
|
457
|
-
this.color = void 0;
|
|
458
|
-
}
|
|
459
|
-
get _statusClasses() {
|
|
460
|
-
const classes = ["mono-status-dot", `sd-${this.state}`];
|
|
461
|
-
if (this.pulse) classes.push("pulse");
|
|
462
|
-
return classes.join(" ");
|
|
463
|
-
}
|
|
464
|
-
get _statusStyle() {
|
|
465
|
-
if (!this.color) return void 0;
|
|
466
|
-
return `--mono-status-dot-color:${this.color};`;
|
|
467
|
-
}
|
|
468
|
-
render() {
|
|
469
|
-
return html`
|
|
470
|
-
<span
|
|
471
|
-
class=${this._statusClasses}
|
|
472
|
-
mono-status-dot
|
|
473
|
-
mono-status=${this.state === "online" ? nothing : this.state}
|
|
474
|
-
?mono-pulse=${this.pulse}
|
|
475
|
-
style=${ifDefined(this._statusStyle)}
|
|
476
|
-
role="status"
|
|
477
|
-
aria-label=${ifDefined(this.label)}
|
|
478
|
-
>
|
|
479
|
-
<span class="sd-dot" mono-dot aria-hidden="true"></span>
|
|
480
|
-
<span class="sd-label">
|
|
481
|
-
${when(Boolean(this.label), () => this.label, () => html`<slot></slot>`)}
|
|
482
|
-
</span>
|
|
483
|
-
</span>
|
|
484
|
-
`;
|
|
485
|
-
}
|
|
486
|
-
focus() {
|
|
487
|
-
this._statusElement?.focus();
|
|
488
|
-
}
|
|
489
|
-
blur() {
|
|
490
|
-
this._statusElement?.blur();
|
|
491
|
-
}
|
|
492
|
-
};
|
|
493
|
-
__decorate([property({ type: String })], MonoStatusDot.prototype, "state", void 0);
|
|
494
|
-
__decorate([property({
|
|
495
|
-
reflect: true,
|
|
496
|
-
converter: booleanStringConverter
|
|
497
|
-
})], MonoStatusDot.prototype, "pulse", void 0);
|
|
498
|
-
__decorate([property({ type: String })], MonoStatusDot.prototype, "label", void 0);
|
|
499
|
-
__decorate([property({ type: String })], MonoStatusDot.prototype, "color", void 0);
|
|
500
|
-
__decorate([query("span")], MonoStatusDot.prototype, "_statusElement", void 0);
|
|
501
|
-
defineMonoElement("mono-status-dot", MonoStatusDot);
|
|
502
|
-
|
|
503
|
-
//#endregion
|
|
504
|
-
//#region src/components/chip/chip-utils.ts
|
|
505
|
-
function generateChipRootClasses(props) {
|
|
506
|
-
const classes = ["mono-chip"];
|
|
507
|
-
classes.push(props.size ?? "md");
|
|
508
|
-
if (props.rounded) classes.push(`rounded-${props.rounded}`);
|
|
509
|
-
const variant = props.variant ?? "soft";
|
|
510
|
-
const color = props.color ?? "primary";
|
|
511
|
-
classes.push(`${variant}-${color}`);
|
|
512
|
-
if (props.clickable) classes.push("clickable");
|
|
513
|
-
if (props.removable) classes.push("removable");
|
|
514
|
-
if (props.disabled) classes.push("disabled");
|
|
515
|
-
if (props.selected) classes.push("selected");
|
|
516
|
-
if (props.dot) classes.push("has-dot");
|
|
517
|
-
return classes.join(" ");
|
|
518
|
-
}
|
|
519
|
-
function isInteractive(props) {
|
|
520
|
-
return Boolean(!props.disabled && (props.clickable || props.href || props.removable));
|
|
521
|
-
}
|
|
522
|
-
function validateChipProps(props) {
|
|
523
|
-
const validSizes = [
|
|
524
|
-
"xs",
|
|
525
|
-
"sm",
|
|
526
|
-
"md",
|
|
527
|
-
"lg",
|
|
528
|
-
"xl",
|
|
529
|
-
"xxl"
|
|
530
|
-
];
|
|
531
|
-
const validColors = [
|
|
532
|
-
"primary",
|
|
533
|
-
"success",
|
|
534
|
-
"danger",
|
|
535
|
-
"warning",
|
|
536
|
-
"info",
|
|
537
|
-
"teal",
|
|
538
|
-
"purple",
|
|
539
|
-
"neutral",
|
|
540
|
-
"dark"
|
|
541
|
-
];
|
|
542
|
-
const validVariants = [
|
|
543
|
-
"soft",
|
|
544
|
-
"solid",
|
|
545
|
-
"outline"
|
|
546
|
-
];
|
|
547
|
-
const validRounded = [
|
|
548
|
-
"none",
|
|
549
|
-
"xs",
|
|
550
|
-
"sm",
|
|
551
|
-
"md",
|
|
552
|
-
"lg",
|
|
553
|
-
"xl",
|
|
554
|
-
"xxl",
|
|
555
|
-
"full"
|
|
556
|
-
];
|
|
557
|
-
if (props.size && !validSizes.includes(props.size)) return false;
|
|
558
|
-
if (props.color && !validColors.includes(props.color)) return false;
|
|
559
|
-
if (props.variant && !validVariants.includes(props.variant)) return false;
|
|
560
|
-
if (props.rounded && !validRounded.includes(props.rounded)) return false;
|
|
561
|
-
return true;
|
|
562
|
-
}
|
|
563
|
-
|
|
564
172
|
//#endregion
|
|
565
173
|
export { MonoChipCore, MonoChipShadow, MonoStatusDot, generateChipRootClasses, isInteractive, validateChipProps };
|