monobill-mintui 0.6.651 → 0.6.653
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/bin/component-dependencies.json +9 -0
- package/dist/components/chunks/date-picker-BQsCoKaK.js +1282 -0
- package/dist/components/chunks/date-picker-tm5Oc92c.js +1 -0
- package/dist/components/chunks/{input-CdsHKiuL.js → input-DcglGwsR.js} +1 -1
- package/dist/components/chunks/{input-BhptfvVH.js → input-awdYlp-G.js} +1 -1
- package/dist/components/chunks/{popover-BRi53qYL.js → popover-FdMS4yAD.js} +1 -1
- package/dist/components/chunks/{popover-PNIdAt8C.js → popover-wGdggZ-a.js} +1 -1
- package/dist/components/chunks/{table-ty0Sgdpv.js → table-B9e-cnAC.js} +1 -1
- package/dist/components/chunks/{table-odOvGji2.js → table-vjF3q3J5.js} +1 -1
- package/dist/components/chunks/time-picker-Cq3qzkDb.js +1 -0
- package/dist/components/chunks/time-picker-S0bc0BPU.js +360 -0
- package/dist/components/date-picker/DatePicker.d.ts +5 -0
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/browser.js +2 -1270
- package/dist/components/date-picker/index.cjs +1 -1
- package/dist/components/date-picker/index.js +2 -1270
- package/dist/components/datetime-picker/DateTimePicker.d.ts +44 -0
- package/dist/components/datetime-picker/DateTimePicker.d.ts.map +1 -0
- package/dist/components/datetime-picker/browser.js +261 -0
- package/dist/components/datetime-picker/index.cjs +1 -0
- package/dist/components/datetime-picker/index.d.ts +4 -0
- package/dist/components/datetime-picker/index.d.ts.map +1 -0
- package/dist/components/datetime-picker/index.js +249 -0
- package/dist/components/form/Form.d.ts.map +1 -1
- package/dist/components/form/browser.js +9 -8
- package/dist/components/form/index.cjs +1 -1
- package/dist/components/form/index.js +9 -8
- package/dist/components/input/browser.js +1 -1
- package/dist/components/input/index.cjs +1 -1
- package/dist/components/input/index.js +1 -1
- package/dist/components/link/browser.js +1 -1
- package/dist/components/link/index.cjs +1 -1
- package/dist/components/link/index.js +1 -1
- package/dist/components/navigation/browser.js +2 -2
- package/dist/components/navigation/index.cjs +1 -1
- package/dist/components/navigation/index.js +2 -2
- package/dist/components/popover/browser.js +1 -1
- package/dist/components/popover/index.cjs +1 -1
- package/dist/components/popover/index.js +1 -1
- package/dist/components/resource-table/browser.js +6 -6
- package/dist/components/resource-table/index.cjs +1 -1
- package/dist/components/resource-table/index.js +6 -6
- package/dist/components/scroll-fade/browser.js +1 -1
- package/dist/components/scroll-fade/index.cjs +1 -1
- package/dist/components/scroll-fade/index.js +1 -1
- package/dist/components/search/Search.d.ts.map +1 -1
- package/dist/components/search/browser.js +3 -3
- package/dist/components/search/index.cjs +1 -1
- package/dist/components/search/index.js +3 -3
- package/dist/components/select/browser.js +1 -1
- package/dist/components/select/index.cjs +1 -1
- package/dist/components/select/index.js +1 -1
- package/dist/components/side-navigation/browser.js +4 -4
- package/dist/components/side-navigation/index.cjs +1 -1
- package/dist/components/side-navigation/index.js +4 -4
- package/dist/components/sortable/browser.js +1 -1
- package/dist/components/sortable/index.cjs +1 -1
- package/dist/components/sortable/index.js +1 -1
- package/dist/components/table/browser.js +1 -1
- package/dist/components/table/index.cjs +1 -1
- package/dist/components/table/index.js +1 -1
- package/dist/components/tags/browser.js +1 -1
- package/dist/components/tags/index.cjs +1 -1
- package/dist/components/tags/index.js +1 -1
- package/dist/components/time-picker/TimePicker.d.ts +1 -0
- package/dist/components/time-picker/TimePicker.d.ts.map +1 -1
- package/dist/components/time-picker/browser.js +2 -347
- package/dist/components/time-picker/index.cjs +1 -1
- package/dist/components/time-picker/index.js +2 -347
- package/dist/components/tree/browser.js +2 -2
- package/dist/components/tree/index.cjs +1 -1
- package/dist/components/tree/index.js +2 -2
- package/dist/datetime-picker.css +3 -0
- package/dist/index.cjs +3 -3
- package/dist/index.css +10 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +957 -697
- package/dist/navigation-search.json +7 -0
- package/dist/theme.css +5 -0
- package/dist/time-picker.css +1 -1
- package/package.json +10 -1
- /package/dist/components/chunks/{ScrollFade-DIKawLYD.js → ScrollFade-D1FPF6ZS.js} +0 -0
- /package/dist/components/chunks/{ScrollFade-Br6QSd_-.js → ScrollFade-DT2Br2g7.js} +0 -0
- /package/dist/components/chunks/{caret-down-DRrCYUv0.js → caret-down-DGeJj0xv.js} +0 -0
- /package/dist/components/chunks/{caret-down-BU-Ee_JS.js → caret-down-DJvCrCjc.js} +0 -0
- /package/dist/components/chunks/{caret-right-BzeJ0Fw3.js → caret-right-BcZ9bOhS.js} +0 -0
- /package/dist/components/chunks/{caret-right-Bh7uMg-Y.js → caret-right-CgIVfus7.js} +0 -0
- /package/dist/components/chunks/{link-BsC3zT_I.js → link-BjbBJpI6.js} +0 -0
- /package/dist/components/chunks/{link-dTjSvr4E.js → link-CU-gTgir.js} +0 -0
- /package/dist/components/chunks/{search-v06eZL4m.js → search--bcFMYMP.js} +0 -0
- /package/dist/components/chunks/{search-CTAGy5ab.js → search-Cixhf7hA.js} +0 -0
- /package/dist/components/chunks/{sortable-B1nMJBah.js → sortable-CNlF0_gv.js} +0 -0
- /package/dist/components/chunks/{sortable-CXM-7eyL.js → sortable-CVK48xj1.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -6003,6 +6003,18 @@ var In = class extends HTMLElement {
|
|
|
6003
6003
|
getValue() {
|
|
6004
6004
|
return this.getAttribute("value") || "";
|
|
6005
6005
|
}
|
|
6006
|
+
getPopoverElement() {
|
|
6007
|
+
return this._popover;
|
|
6008
|
+
}
|
|
6009
|
+
getPopoverContentElement() {
|
|
6010
|
+
return this._popover?.querySelector(".popover-content") || null;
|
|
6011
|
+
}
|
|
6012
|
+
getDisplayElement() {
|
|
6013
|
+
return this._displayEl;
|
|
6014
|
+
}
|
|
6015
|
+
refreshCalendar() {
|
|
6016
|
+
this._buildCalendar();
|
|
6017
|
+
}
|
|
6006
6018
|
setValue(e) {
|
|
6007
6019
|
e ? (this.setAttribute("value", e), this._textInput && (this._textInput.value = e), this._parseValue(e)) : (this.removeAttribute("value"), this._textInput && (this._textInput.value = ""), this._selectedStartDate = null, this._selectedEndDate = null), this._buildCalendar(), this._updateDisplayText();
|
|
6008
6020
|
}
|
|
@@ -7084,7 +7096,7 @@ var In = class extends HTMLElement {
|
|
|
7084
7096
|
else {
|
|
7085
7097
|
this._selectedStartDate = r, this._selectedEndDate = null;
|
|
7086
7098
|
let e = this._formatDate(r, t);
|
|
7087
|
-
this.setValue(e), this._textInput && (this._textInput.value = e), this._popover && typeof this._popover.close == "function" && this._popover.close();
|
|
7099
|
+
this.setValue(e), this._textInput && (this._textInput.value = e), !this.hasAttribute("keep-open-on-select") && this._popover && typeof this._popover.close == "function" && this._popover.close();
|
|
7088
7100
|
}
|
|
7089
7101
|
this._buildCalendar(), this._updateDisplayText(), this._exitInputMode();
|
|
7090
7102
|
let a = new Event("input", {
|
|
@@ -7187,224 +7199,812 @@ var In = class extends HTMLElement {
|
|
|
7187
7199
|
this._focusTrapHandler &&= (document.removeEventListener("keydown", this._focusTrapHandler, !0), null), this._escapeHandler &&= (document.removeEventListener("keydown", this._escapeHandler, !0), null);
|
|
7188
7200
|
}
|
|
7189
7201
|
};
|
|
7190
|
-
customElements.get("mint-date-picker") || a("mint-date-picker", In)
|
|
7191
|
-
name: "upload",
|
|
7192
|
-
viewBox: "0 0 24 24",
|
|
7193
|
-
path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
|
|
7194
|
-
strokeLinecap: "round",
|
|
7195
|
-
strokeLinejoin: "round"
|
|
7196
|
-
}), s({
|
|
7197
|
-
name: "attach",
|
|
7198
|
-
viewBox: "0 0 24 24",
|
|
7199
|
-
path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
|
|
7200
|
-
strokeLinecap: "round",
|
|
7201
|
-
strokeLinejoin: "round"
|
|
7202
|
-
});
|
|
7202
|
+
customElements.get("mint-date-picker") || a("mint-date-picker", In);
|
|
7203
7203
|
//#endregion
|
|
7204
|
-
//#region src/components/
|
|
7204
|
+
//#region src/components/time-picker/TimePicker.ts
|
|
7205
7205
|
var Ln = class extends HTMLElement {
|
|
7206
|
+
constructor(...e) {
|
|
7207
|
+
super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._triggerClickObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
|
|
7208
|
+
hour: 9,
|
|
7209
|
+
minute: 0,
|
|
7210
|
+
second: 0,
|
|
7211
|
+
meridiem: "AM"
|
|
7212
|
+
}, this._rangeStart = {
|
|
7213
|
+
hour: 9,
|
|
7214
|
+
minute: 0,
|
|
7215
|
+
second: 0,
|
|
7216
|
+
meridiem: "AM"
|
|
7217
|
+
}, this._rangeEnd = {
|
|
7218
|
+
hour: 5,
|
|
7219
|
+
minute: 0,
|
|
7220
|
+
second: 0,
|
|
7221
|
+
meridiem: "PM"
|
|
7222
|
+
}, this._invalidFromInput = !1;
|
|
7223
|
+
}
|
|
7206
7224
|
static get observedAttributes() {
|
|
7207
7225
|
return [
|
|
7226
|
+
"value",
|
|
7227
|
+
"inline",
|
|
7208
7228
|
"label",
|
|
7209
|
-
"
|
|
7210
|
-
"multiple",
|
|
7211
|
-
"width",
|
|
7212
|
-
"height",
|
|
7229
|
+
"info",
|
|
7213
7230
|
"disabled",
|
|
7231
|
+
"id",
|
|
7214
7232
|
"name",
|
|
7233
|
+
"required",
|
|
7234
|
+
"readonly",
|
|
7235
|
+
"range",
|
|
7236
|
+
"hours",
|
|
7237
|
+
"minutes",
|
|
7238
|
+
"seconds",
|
|
7215
7239
|
"error",
|
|
7216
|
-
"error-message"
|
|
7217
|
-
"loading",
|
|
7218
|
-
"aria-label",
|
|
7219
|
-
"aria-describedby"
|
|
7240
|
+
"error-message"
|
|
7220
7241
|
];
|
|
7221
7242
|
}
|
|
7222
|
-
constructor() {
|
|
7223
|
-
super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
|
|
7224
|
-
}
|
|
7225
7243
|
connectedCallback() {
|
|
7226
|
-
this.classList.add("mint-
|
|
7244
|
+
this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
|
|
7227
7245
|
}
|
|
7228
7246
|
disconnectedCallback() {
|
|
7229
|
-
|
|
7230
|
-
let e = this.closest("form");
|
|
7231
|
-
e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
|
|
7232
|
-
}
|
|
7247
|
+
this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null);
|
|
7233
7248
|
}
|
|
7234
7249
|
attributeChangedCallback(e, t, n) {
|
|
7235
7250
|
if (t !== n) {
|
|
7236
|
-
if (e === "
|
|
7237
|
-
this.
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7251
|
+
if (e === "value") {
|
|
7252
|
+
this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
7253
|
+
{
|
|
7254
|
+
let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
7255
|
+
e && this._buildPopoverContent(e);
|
|
7256
|
+
}
|
|
7242
7257
|
return;
|
|
7243
7258
|
}
|
|
7244
|
-
this.render();
|
|
7259
|
+
e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
|
|
7245
7260
|
}
|
|
7246
7261
|
}
|
|
7247
|
-
|
|
7248
|
-
return this.
|
|
7249
|
-
}
|
|
7250
|
-
getAccept() {
|
|
7251
|
-
return this.getAttribute("accept") || "";
|
|
7262
|
+
get value() {
|
|
7263
|
+
return this.getValue();
|
|
7252
7264
|
}
|
|
7253
|
-
|
|
7254
|
-
|
|
7265
|
+
set value(e) {
|
|
7266
|
+
this.setValue(e || "");
|
|
7255
7267
|
}
|
|
7256
|
-
|
|
7257
|
-
return this.getAttribute("
|
|
7268
|
+
getValue() {
|
|
7269
|
+
return this.getAttribute("value") || "";
|
|
7258
7270
|
}
|
|
7259
|
-
|
|
7260
|
-
|
|
7271
|
+
setValue(e) {
|
|
7272
|
+
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
7261
7273
|
}
|
|
7262
|
-
|
|
7263
|
-
|
|
7264
|
-
if (e) {
|
|
7265
|
-
this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
|
|
7266
|
-
let e = t.querySelector(".mint-dropzone-skeleton");
|
|
7267
|
-
e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
|
|
7268
|
-
} else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
|
|
7274
|
+
isRange() {
|
|
7275
|
+
return this.getAttribute("range") === "true";
|
|
7269
7276
|
}
|
|
7270
|
-
|
|
7271
|
-
|
|
7277
|
+
isHoursEnabled() {
|
|
7278
|
+
let e = this.getAttribute("hours");
|
|
7279
|
+
return e === null ? !0 : e !== "false";
|
|
7272
7280
|
}
|
|
7273
|
-
|
|
7274
|
-
|
|
7281
|
+
isMinutesEnabled() {
|
|
7282
|
+
let e = this.getAttribute("minutes");
|
|
7283
|
+
return e === null ? !0 : e !== "false";
|
|
7275
7284
|
}
|
|
7276
|
-
|
|
7277
|
-
|
|
7285
|
+
isSecondsEnabled() {
|
|
7286
|
+
let e = this.getAttribute("seconds");
|
|
7287
|
+
return e === null ? !1 : e !== "false";
|
|
7278
7288
|
}
|
|
7279
7289
|
isDisabled() {
|
|
7280
7290
|
return this.getAttribute("disabled") === "true";
|
|
7281
7291
|
}
|
|
7282
|
-
|
|
7283
|
-
return this.getAttribute("
|
|
7292
|
+
isReadonly() {
|
|
7293
|
+
return this.getAttribute("readonly") === "true";
|
|
7284
7294
|
}
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
|
|
7288
|
-
else {
|
|
7289
|
-
this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
|
|
7290
|
-
let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
|
|
7291
|
-
n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7292
|
-
}
|
|
7293
|
-
this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
|
|
7294
|
-
let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
|
|
7295
|
-
u && u.remove(), d && d.remove();
|
|
7296
|
-
let f = document.createElement("div");
|
|
7297
|
-
f.className = "mint-dropzone-icon";
|
|
7298
|
-
let p = document.createElement("mint-icon");
|
|
7299
|
-
if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
|
|
7300
|
-
let e = document.createElement("div");
|
|
7301
|
-
e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
|
|
7302
|
-
}
|
|
7303
|
-
this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
|
|
7295
|
+
isRequired() {
|
|
7296
|
+
return this.getAttribute("required") === "true";
|
|
7304
7297
|
}
|
|
7305
|
-
|
|
7306
|
-
|
|
7298
|
+
hasExternalError() {
|
|
7299
|
+
return this.getAttribute("error") === "true";
|
|
7307
7300
|
}
|
|
7308
|
-
|
|
7309
|
-
|
|
7310
|
-
if (e && t ? (n || (n = document.createElement("div"), n.className = "mint-dropzone-error", this.appendChild(n)), n.textContent = t) : n && n.remove(), this._dropzone) {
|
|
7311
|
-
this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
|
|
7312
|
-
let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
7313
|
-
n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7314
|
-
}
|
|
7301
|
+
getExternalErrorMessage() {
|
|
7302
|
+
return this.getAttribute("error-message") || "";
|
|
7315
7303
|
}
|
|
7316
|
-
|
|
7317
|
-
|
|
7318
|
-
let e = this.isDisabled(), t = this.hasError();
|
|
7319
|
-
this._dropzone.className = "mint-dropzone-target", this._dropzone.classList.toggle("has-files", this._selectedFiles.length > 0), this._dropzone.classList.toggle("is-dragging", this._isDragging), this._dropzone.classList.toggle("has-error", t), this._dropzone.classList.toggle("is-disabled", e);
|
|
7304
|
+
getLabel() {
|
|
7305
|
+
return this.getAttribute("label") || "";
|
|
7320
7306
|
}
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
if (!(this.isDisabled() || !this._fileInput) && e.target !== this._fileInput && (e.stopPropagation(), e.preventDefault(), e.isTrusted)) try {
|
|
7324
|
-
this._fileInput.click();
|
|
7325
|
-
} catch (e) {
|
|
7326
|
-
console.debug("File chooser blocked:", e);
|
|
7327
|
-
}
|
|
7328
|
-
}, this._onDragOver ||= (e) => {
|
|
7329
|
-
e.preventDefault(), e.stopPropagation(), this.isDisabled() || this._isDragging || (this._isDragging = !0, this._wasDragging = !0, this._updateDragState());
|
|
7330
|
-
}, this._onDragLeave ||= (e) => {
|
|
7331
|
-
e.preventDefault(), e.stopPropagation();
|
|
7332
|
-
let t = this._dropzone?.getBoundingClientRect();
|
|
7333
|
-
t && (e.clientX < t.left || e.clientX > t.right || e.clientY < t.top || e.clientY > t.bottom) && this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState());
|
|
7334
|
-
}, this._onDrop ||= (e) => {
|
|
7335
|
-
if (e.preventDefault(), e.stopPropagation(), this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState()), this.isDisabled()) return;
|
|
7336
|
-
let t = e.dataTransfer?.files;
|
|
7337
|
-
t && t.length > 0 && this._handleFiles(t);
|
|
7338
|
-
}, this._onFileInputInput ||= (e) => {
|
|
7339
|
-
e.stopImmediatePropagation(), e.stopPropagation();
|
|
7340
|
-
}, this._onKeyDown ||= (e) => {
|
|
7341
|
-
if (!(this.isDisabled() || !this._fileInput) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.isTrusted)) try {
|
|
7342
|
-
this._fileInput.click();
|
|
7343
|
-
} catch (e) {
|
|
7344
|
-
console.debug("File chooser blocked:", e);
|
|
7345
|
-
}
|
|
7346
|
-
}, this._onFocus ||= (e) => {
|
|
7347
|
-
this._dropzone && !this.isDisabled() && this._dropzone.classList.add("is-focused");
|
|
7348
|
-
}, this._onBlur ||= (e) => {
|
|
7349
|
-
this._dropzone;
|
|
7350
|
-
}, this._onFileInputChange ||= (e) => {
|
|
7351
|
-
if (e.stopImmediatePropagation(), e.stopPropagation(), this._isUpdatingFiles) return;
|
|
7352
|
-
let t = e.target.files;
|
|
7353
|
-
if (t && t.length > 0) {
|
|
7354
|
-
let e = this.getAccept(), n = this.isMultiple(), r = [], i = [];
|
|
7355
|
-
for (let n = 0; n < t.length; n++) {
|
|
7356
|
-
let a = t[n];
|
|
7357
|
-
this._isFileAccepted(a, e) ? r.push(a) : i.push(a);
|
|
7358
|
-
}
|
|
7359
|
-
if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
|
|
7360
|
-
let e = new CustomEvent("dropRejected", {
|
|
7361
|
-
detail: {
|
|
7362
|
-
files: i,
|
|
7363
|
-
reason: "File type not accepted or multiple files not allowed"
|
|
7364
|
-
},
|
|
7365
|
-
bubbles: !0,
|
|
7366
|
-
cancelable: !0
|
|
7367
|
-
});
|
|
7368
|
-
this.dispatchEvent(e);
|
|
7369
|
-
}
|
|
7370
|
-
r.length > 0 && this._applyValidFiles(r);
|
|
7371
|
-
}
|
|
7372
|
-
}, this._dropzone.addEventListener("click", this._onDropzoneClick), this._dropzone.addEventListener("dragover", this._onDragOver), this._dropzone.addEventListener("dragleave", this._onDragLeave), this._dropzone.addEventListener("drop", this._onDrop), this._dropzone.addEventListener("keydown", this._onKeyDown), this._dropzone.addEventListener("focus", this._onFocus), this._dropzone.addEventListener("blur", this._onBlur), this._fileInput.addEventListener("change", this._onFileInputChange), this._fileInput.addEventListener("input", this._onFileInputInput, !0)));
|
|
7307
|
+
getInfo() {
|
|
7308
|
+
return this.getAttribute("info") || "";
|
|
7373
7309
|
}
|
|
7374
|
-
|
|
7375
|
-
|
|
7310
|
+
getName() {
|
|
7311
|
+
return this.getAttribute("name") || "";
|
|
7376
7312
|
}
|
|
7377
|
-
|
|
7378
|
-
|
|
7379
|
-
|
|
7380
|
-
|
|
7381
|
-
|
|
7382
|
-
}
|
|
7383
|
-
if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
|
|
7384
|
-
let e = new CustomEvent("dropRejected", {
|
|
7385
|
-
detail: {
|
|
7386
|
-
files: i,
|
|
7387
|
-
reason: "File type not accepted or multiple files not allowed"
|
|
7388
|
-
},
|
|
7389
|
-
bubbles: !0,
|
|
7390
|
-
cancelable: !0
|
|
7391
|
-
});
|
|
7392
|
-
this.dispatchEvent(e);
|
|
7393
|
-
}
|
|
7394
|
-
r.length > 0 && this._applyValidFiles(r);
|
|
7313
|
+
_getEffectiveError() {
|
|
7314
|
+
return {
|
|
7315
|
+
hasError: this.hasExternalError(),
|
|
7316
|
+
message: this.getExternalErrorMessage()
|
|
7317
|
+
};
|
|
7395
7318
|
}
|
|
7396
|
-
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
for (let t of n) if (t.startsWith(".")) {
|
|
7400
|
-
if ("." + e.name.split(".").pop()?.toLowerCase() === t) return !0;
|
|
7401
|
-
} else if (t.includes("/*")) {
|
|
7402
|
-
if (t.split("/")[0] === e.type.split("/")[0]) return !0;
|
|
7403
|
-
} else if (e.type === t) return !0;
|
|
7404
|
-
return !1;
|
|
7319
|
+
_formatParts(e) {
|
|
7320
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
|
|
7321
|
+
return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
|
|
7405
7322
|
}
|
|
7406
|
-
|
|
7407
|
-
let
|
|
7323
|
+
_to24Hour(e) {
|
|
7324
|
+
let t = e.hour % 12;
|
|
7325
|
+
return e.meridiem === "PM" && (t += 12), {
|
|
7326
|
+
hour: t,
|
|
7327
|
+
minute: e.minute,
|
|
7328
|
+
second: e.second
|
|
7329
|
+
};
|
|
7330
|
+
}
|
|
7331
|
+
_formatParts24(e) {
|
|
7332
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
|
|
7333
|
+
return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
|
|
7334
|
+
}
|
|
7335
|
+
_getDisplayValue() {
|
|
7336
|
+
return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
|
|
7337
|
+
}
|
|
7338
|
+
_getOutputValue() {
|
|
7339
|
+
return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
|
|
7340
|
+
}
|
|
7341
|
+
_getExpectedFormat() {
|
|
7342
|
+
let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
|
|
7343
|
+
e && r.push("h"), t && r.push("mm"), n && r.push("ss");
|
|
7344
|
+
let i = e ? `${r.join(":")} am/pm` : r.join(":");
|
|
7345
|
+
return this.isRange() ? `${i} - ${i}` : i;
|
|
7346
|
+
}
|
|
7347
|
+
_syncHiddenInput() {
|
|
7348
|
+
this._hiddenInput && (this._hiddenInput.value = this.getValue() || this._getOutputValue());
|
|
7349
|
+
}
|
|
7350
|
+
_syncInputValue() {
|
|
7351
|
+
this._inputEl && (this._inputEl.value = this._getDisplayValue(), typeof this._inputEl.render == "function" && this._inputEl.render());
|
|
7352
|
+
}
|
|
7353
|
+
_emitChangeFromPicker() {
|
|
7354
|
+
let e = this._getOutputValue();
|
|
7355
|
+
this._invalidFromInput = !1, this.setAttribute("value", e), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
7356
|
+
bubbles: !0,
|
|
7357
|
+
composed: !0
|
|
7358
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7359
|
+
}
|
|
7360
|
+
_parseSingle(e) {
|
|
7361
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
7362
|
+
if (t) {
|
|
7363
|
+
let e = i.match(/^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*(am|pm)$/i);
|
|
7364
|
+
if (!e) return null;
|
|
7365
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0), s = e[4].toUpperCase();
|
|
7366
|
+
return t < 1 || t > 12 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59) ? null : {
|
|
7367
|
+
hour: t,
|
|
7368
|
+
minute: a,
|
|
7369
|
+
second: o,
|
|
7370
|
+
meridiem: s
|
|
7371
|
+
};
|
|
7372
|
+
}
|
|
7373
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
7374
|
+
if (!a) return null;
|
|
7375
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
7376
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
7377
|
+
hour: 12,
|
|
7378
|
+
minute: o,
|
|
7379
|
+
second: s,
|
|
7380
|
+
meridiem: "AM"
|
|
7381
|
+
};
|
|
7382
|
+
}
|
|
7383
|
+
_parseSingleOutput24(e) {
|
|
7384
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
7385
|
+
if (t) {
|
|
7386
|
+
let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
|
|
7387
|
+
if (!e) return null;
|
|
7388
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
|
|
7389
|
+
if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
|
|
7390
|
+
let s = t >= 12 ? "PM" : "AM";
|
|
7391
|
+
return {
|
|
7392
|
+
hour: t % 12 == 0 ? 12 : t % 12,
|
|
7393
|
+
minute: a,
|
|
7394
|
+
second: o,
|
|
7395
|
+
meridiem: s
|
|
7396
|
+
};
|
|
7397
|
+
}
|
|
7398
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
7399
|
+
if (!a) return null;
|
|
7400
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
7401
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
7402
|
+
hour: 12,
|
|
7403
|
+
minute: o,
|
|
7404
|
+
second: s,
|
|
7405
|
+
meridiem: "AM"
|
|
7406
|
+
};
|
|
7407
|
+
}
|
|
7408
|
+
_parseAndApplyValue(e) {
|
|
7409
|
+
if (!e) return !1;
|
|
7410
|
+
if (this.isRange()) {
|
|
7411
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingleOutput24(t || ""), i = this._parseSingleOutput24(n || "");
|
|
7412
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
7413
|
+
}
|
|
7414
|
+
let t = this._parseSingleOutput24(e);
|
|
7415
|
+
return t ? (this._single = t, !0) : !1;
|
|
7416
|
+
}
|
|
7417
|
+
_parseAndApplyDisplayValue(e) {
|
|
7418
|
+
if (!e) return !1;
|
|
7419
|
+
if (this.isRange()) {
|
|
7420
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
|
|
7421
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
7422
|
+
}
|
|
7423
|
+
let t = this._parseSingle(e);
|
|
7424
|
+
return t ? (this._single = t, !0) : !1;
|
|
7425
|
+
}
|
|
7426
|
+
_handleTypedValue(e) {
|
|
7427
|
+
let t = e.trim();
|
|
7428
|
+
if (!t) {
|
|
7429
|
+
this._invalidFromInput = !1, this.removeAttribute("value"), this._syncHiddenInput(), this._syncInputValue();
|
|
7430
|
+
return;
|
|
7431
|
+
}
|
|
7432
|
+
if (!this._parseAndApplyDisplayValue(t)) {
|
|
7433
|
+
this._invalidFromInput = !0, this.removeAttribute("value"), this._inputEl && (this._inputEl.value = ""), this._syncHiddenInput(), this.render(), this.dispatchEvent(new Event("input", {
|
|
7434
|
+
bubbles: !0,
|
|
7435
|
+
composed: !0
|
|
7436
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7437
|
+
return;
|
|
7438
|
+
}
|
|
7439
|
+
this._invalidFromInput = !1;
|
|
7440
|
+
let n = this._getOutputValue();
|
|
7441
|
+
this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
7442
|
+
bubbles: !0,
|
|
7443
|
+
composed: !0
|
|
7444
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
7445
|
+
}
|
|
7446
|
+
_buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
|
|
7447
|
+
let o = document.createElement("div");
|
|
7448
|
+
return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
|
|
7449
|
+
let r = document.createElement("button");
|
|
7450
|
+
r.type = "button";
|
|
7451
|
+
let i = e === t;
|
|
7452
|
+
r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
|
|
7453
|
+
}), o;
|
|
7454
|
+
}
|
|
7455
|
+
_centerSelectedInColumn(e) {
|
|
7456
|
+
let t = e.querySelector("button[data-selected=\"true\"]");
|
|
7457
|
+
if (!t) return;
|
|
7458
|
+
let n = t.offsetTop - e.offsetTop - (e.clientHeight / 2 - t.offsetHeight / 2), r = Math.max(0, Math.min(e.scrollHeight - e.clientHeight, n));
|
|
7459
|
+
e.scrollTo({
|
|
7460
|
+
top: r,
|
|
7461
|
+
behavior: "instant"
|
|
7462
|
+
});
|
|
7463
|
+
}
|
|
7464
|
+
_centerAllColumnsInPopoverBody() {
|
|
7465
|
+
let e = (this._popover || this).querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
7466
|
+
e && Array.from(e.querySelectorAll(".mint-time-picker-column")).forEach((e) => this._centerSelectedInColumn(e));
|
|
7467
|
+
}
|
|
7468
|
+
_setupPopoverOpenObserver() {
|
|
7469
|
+
this._popover && (this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._popoverObserver = new MutationObserver(() => {
|
|
7470
|
+
this._popover?.getAttribute("open") === "true" && requestAnimationFrame(() => {
|
|
7471
|
+
requestAnimationFrame(() => {
|
|
7472
|
+
this._centerAllColumnsInPopoverBody();
|
|
7473
|
+
});
|
|
7474
|
+
});
|
|
7475
|
+
}), this._popoverObserver.observe(this._popover, {
|
|
7476
|
+
attributes: !0,
|
|
7477
|
+
attributeFilter: ["open"]
|
|
7478
|
+
}));
|
|
7479
|
+
}
|
|
7480
|
+
_buildPickerSet(e, t, n) {
|
|
7481
|
+
let r = this.isHoursEnabled(), i = this.isMinutesEnabled(), a = this.isSecondsEnabled(), o = document.createElement("div"), s = (r ? 1 : 0) + (i ? 1 : 0) + (a ? 1 : 0) + (r ? 1 : 0);
|
|
7482
|
+
o.className = "mint-time-picker-wheel", o.style.gridTemplateColumns = `repeat(${Math.max(s, 1)}, minmax(0, 1fr))`;
|
|
7483
|
+
let c = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), l = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), u = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), d = ["AM", "PM"], f = [];
|
|
7484
|
+
r && f.push(this._buildColumn(c, t.hour.toString().padStart(2, "0"), (e) => {
|
|
7485
|
+
n({
|
|
7486
|
+
...t,
|
|
7487
|
+
hour: Number(e)
|
|
7488
|
+
});
|
|
7489
|
+
}, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
|
|
7490
|
+
n({
|
|
7491
|
+
...t,
|
|
7492
|
+
minute: Number(e)
|
|
7493
|
+
});
|
|
7494
|
+
}, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
|
|
7495
|
+
n({
|
|
7496
|
+
...t,
|
|
7497
|
+
second: Number(e)
|
|
7498
|
+
});
|
|
7499
|
+
}, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
|
|
7500
|
+
n({
|
|
7501
|
+
...t,
|
|
7502
|
+
meridiem: e
|
|
7503
|
+
});
|
|
7504
|
+
}, !0, "tall", "Meridiem")), f.forEach((e, t) => {
|
|
7505
|
+
t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
|
|
7506
|
+
}), e.appendChild(o);
|
|
7507
|
+
}
|
|
7508
|
+
_buildPopoverContent(e) {
|
|
7509
|
+
if (e.innerHTML = "", !this.isRange()) {
|
|
7510
|
+
this._buildPickerSet(e, this._single, (t) => {
|
|
7511
|
+
this._single = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7512
|
+
}), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody());
|
|
7513
|
+
return;
|
|
7514
|
+
}
|
|
7515
|
+
let t = document.createElement("div");
|
|
7516
|
+
t.className = "mint-time-picker-range";
|
|
7517
|
+
let n = document.createElement("div"), r = document.createElement("mint-text");
|
|
7518
|
+
r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
|
|
7519
|
+
this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7520
|
+
});
|
|
7521
|
+
let i = document.createElement("div"), a = document.createElement("mint-text");
|
|
7522
|
+
a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
|
|
7523
|
+
this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
7524
|
+
}), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
|
|
7525
|
+
this._centerAllColumnsInPopoverBody();
|
|
7526
|
+
});
|
|
7527
|
+
}
|
|
7528
|
+
render() {
|
|
7529
|
+
let e = this.isDisabled(), t = this.isReadonly(), n = this._getEffectiveError();
|
|
7530
|
+
this._triggerClickObserver &&= (document.removeEventListener("click", this._triggerClickObserver, !0), null), this.innerHTML = "";
|
|
7531
|
+
let r = document.createElement("div");
|
|
7532
|
+
r.className = "mint-time-picker-control";
|
|
7533
|
+
let i = this.getAttribute("inline") === "true";
|
|
7534
|
+
i || (this._inputEl = document.createElement("mint-input"), this._inputEl.id = this._triggerId, this._inputEl.classList.add("mint-time-picker-trigger"), this._inputEl.setAttribute("type", "text"), this._inputEl.setAttribute("icon", "clock"), this._inputEl.setAttribute("placeholder", this._getExpectedFormat()), this._inputEl.setAttribute("label", this.getLabel()), this._inputEl.setAttribute("info", this.getInfo()), this._inputEl.setAttribute("value", this._getDisplayValue()), this._inputEl.setAttribute("error", n.hasError ? "true" : "false"), this._inputEl.setAttribute("error-message", n.message || ""), e && this._inputEl.setAttribute("disabled", "true"), t && this._inputEl.setAttribute("readonly", "true"), this._inputEl.addEventListener("change", (n) => {
|
|
7535
|
+
if (e || t) return;
|
|
7536
|
+
let r = n.target;
|
|
7537
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
7538
|
+
}), this._inputEl.addEventListener("blur", (n) => {
|
|
7539
|
+
if (e || t) return;
|
|
7540
|
+
let r = n.target;
|
|
7541
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
7542
|
+
}, !0), r.appendChild(this._inputEl)), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput();
|
|
7543
|
+
let a = document.createElement("div");
|
|
7544
|
+
if (a.setAttribute("data-mint-time-picker-body", "true"), a.className = "mint-time-picker-popover", this._buildPopoverContent(a), i ? (this._popover = null, r.appendChild(a), requestAnimationFrame(() => this._centerAllColumnsInPopoverBody())) : (this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false"), this._popover.appendChild(a), r.appendChild(this._popover), this._setupPopoverOpenObserver()), this.appendChild(r), !i && this._inputEl) {
|
|
7545
|
+
let e = this._inputEl;
|
|
7546
|
+
this._triggerClickObserver = (t) => {
|
|
7547
|
+
t.composedPath().includes(e) && requestAnimationFrame(() => {
|
|
7548
|
+
requestAnimationFrame(() => {
|
|
7549
|
+
this._popover?.getAttribute("open") === "true" && this._centerAllColumnsInPopoverBody();
|
|
7550
|
+
});
|
|
7551
|
+
});
|
|
7552
|
+
}, document.addEventListener("click", this._triggerClickObserver, !0);
|
|
7553
|
+
}
|
|
7554
|
+
}
|
|
7555
|
+
};
|
|
7556
|
+
customElements.get("mint-time-picker") || a("mint-time-picker", Ln);
|
|
7557
|
+
//#endregion
|
|
7558
|
+
//#region src/components/datetime-picker/DateTimePicker.ts
|
|
7559
|
+
var Rn = class extends HTMLElement {
|
|
7560
|
+
constructor(...e) {
|
|
7561
|
+
super(...e), this._datePicker = null, this._timePicker = null, this._content = null, this._popoverContent = null, this._popoverObserver = null, this._hiddenInput = null, this._dateValue = "", this._timeValue = "", this._dateStageComplete = !1, this._ready = !1, this._writingValue = !1, this._displayControlBound = !1;
|
|
7562
|
+
}
|
|
7563
|
+
static get observedAttributes() {
|
|
7564
|
+
return [
|
|
7565
|
+
"value",
|
|
7566
|
+
"label",
|
|
7567
|
+
"info",
|
|
7568
|
+
"name",
|
|
7569
|
+
"required",
|
|
7570
|
+
"disabled",
|
|
7571
|
+
"readonly",
|
|
7572
|
+
"format",
|
|
7573
|
+
"display-format",
|
|
7574
|
+
"min",
|
|
7575
|
+
"max",
|
|
7576
|
+
"shortcuts",
|
|
7577
|
+
"hours",
|
|
7578
|
+
"minutes",
|
|
7579
|
+
"seconds",
|
|
7580
|
+
"error",
|
|
7581
|
+
"error-message"
|
|
7582
|
+
];
|
|
7583
|
+
}
|
|
7584
|
+
connectedCallback() {
|
|
7585
|
+
this.classList.add("mint-datetime-picker"), this._readValue(this.getAttribute("value") || ""), this.render(), this._ready = !0;
|
|
7586
|
+
}
|
|
7587
|
+
attributeChangedCallback(e, t, n) {
|
|
7588
|
+
if (!(t === n || !this._ready || e === "value" && this._writingValue)) {
|
|
7589
|
+
if (e === "value") {
|
|
7590
|
+
this._readValue(n || ""), this.render();
|
|
7591
|
+
return;
|
|
7592
|
+
}
|
|
7593
|
+
if (e === "error" || e === "error-message") {
|
|
7594
|
+
this._syncState();
|
|
7595
|
+
return;
|
|
7596
|
+
}
|
|
7597
|
+
this.render();
|
|
7598
|
+
}
|
|
7599
|
+
}
|
|
7600
|
+
get value() {
|
|
7601
|
+
return this.getAttribute("value") || "";
|
|
7602
|
+
}
|
|
7603
|
+
set value(e) {
|
|
7604
|
+
this.setValue(e || "");
|
|
7605
|
+
}
|
|
7606
|
+
getValue() {
|
|
7607
|
+
return this.getAttribute("value") || "";
|
|
7608
|
+
}
|
|
7609
|
+
setValue(e) {
|
|
7610
|
+
this._readValue(e), this._writingValue = !0, e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._writingValue = !1, this.render(), this._syncState();
|
|
7611
|
+
}
|
|
7612
|
+
_parseDate(e, t) {
|
|
7613
|
+
let n = e.match(/^(\d{4})-(\d{2})-(\d{2})/);
|
|
7614
|
+
if (n) return new Date(Number(n[1]), Number(n[2]) - 1, Number(n[3]));
|
|
7615
|
+
let r = {
|
|
7616
|
+
yyyy: "(\\d{4})",
|
|
7617
|
+
yy: "(\\d{2})",
|
|
7618
|
+
Y: "(\\d{4})",
|
|
7619
|
+
y: "(\\d{2})",
|
|
7620
|
+
mm: "(\\d{1,2})",
|
|
7621
|
+
m: "(\\d{1,2})",
|
|
7622
|
+
n: "(\\d{1,2})",
|
|
7623
|
+
dd: "(\\d{1,2})",
|
|
7624
|
+
d: "(\\d{1,2})",
|
|
7625
|
+
j: "(\\d{1,2})",
|
|
7626
|
+
M: "([A-Za-z]+)",
|
|
7627
|
+
F: "([A-Za-z]+)"
|
|
7628
|
+
}, i = Object.keys(r).sort((e, t) => t.length - e.length), a = [], o = "^";
|
|
7629
|
+
for (let e = 0; e < t.length;) {
|
|
7630
|
+
let n = i.find((n) => t.startsWith(n, e));
|
|
7631
|
+
n ? (o += r[n], a.push(n), e += n.length) : (o += t[e].replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), e++);
|
|
7632
|
+
}
|
|
7633
|
+
let s = e.match(RegExp(`${o}$`, "i"));
|
|
7634
|
+
if (!s) return null;
|
|
7635
|
+
let c = 2e3, l = 1, u = 1;
|
|
7636
|
+
a.forEach((e, t) => {
|
|
7637
|
+
let n = s[t + 1];
|
|
7638
|
+
if (e === "Y" || e === "yyyy") c = Number(n);
|
|
7639
|
+
else if (e === "y" || e === "yy") c = Number(n) + 2e3;
|
|
7640
|
+
else if (e === "m" || e === "mm" || e === "n") l = Number(n);
|
|
7641
|
+
else if (e === "d" || e === "dd" || e === "j") u = Number(n);
|
|
7642
|
+
else if (e === "M" || e === "F") {
|
|
7643
|
+
let e = (/* @__PURE__ */ new Date(`${n} 1, 2000`)).getMonth();
|
|
7644
|
+
Number.isNaN(e) || (l = e + 1);
|
|
7645
|
+
}
|
|
7646
|
+
});
|
|
7647
|
+
let d = new Date(c, l - 1, u);
|
|
7648
|
+
return d.getFullYear() === c && d.getMonth() === l - 1 && d.getDate() === u ? d : null;
|
|
7649
|
+
}
|
|
7650
|
+
_formatDate(e, t) {
|
|
7651
|
+
let n = (e) => String(e).padStart(2, "0"), r = {
|
|
7652
|
+
Y: String(e.getFullYear()),
|
|
7653
|
+
yyyy: String(e.getFullYear()),
|
|
7654
|
+
yy: String(e.getFullYear()).slice(-2),
|
|
7655
|
+
y: String(e.getFullYear()).slice(-2),
|
|
7656
|
+
mm: n(e.getMonth() + 1),
|
|
7657
|
+
m: n(e.getMonth() + 1),
|
|
7658
|
+
n: String(e.getMonth() + 1),
|
|
7659
|
+
dd: n(e.getDate()),
|
|
7660
|
+
d: n(e.getDate()),
|
|
7661
|
+
j: String(e.getDate()),
|
|
7662
|
+
M: e.toLocaleString(void 0, { month: "short" }),
|
|
7663
|
+
F: e.toLocaleString(void 0, { month: "long" })
|
|
7664
|
+
};
|
|
7665
|
+
return t.replace(/yyyy|yy|mm|dd|Y|y|m|n|d|j|M|F/g, (e) => r[e]);
|
|
7666
|
+
}
|
|
7667
|
+
_readValue(e) {
|
|
7668
|
+
let [t = "", n = ""] = e.split(/[T ]/), r = this._parseDate(t, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7669
|
+
this._dateValue = r ? this._formatDate(r, this.getAttribute("format") || "mm/dd/yyyy") : "", this._timeValue = n || "", this._dateStageComplete = !!r;
|
|
7670
|
+
}
|
|
7671
|
+
_toISODate() {
|
|
7672
|
+
let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7673
|
+
return e ? `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}` : "";
|
|
7674
|
+
}
|
|
7675
|
+
_syncValue(e = !1) {
|
|
7676
|
+
let t = this._toISODate(), n = this._timeValue, r = t && n ? `${t}T${n}` : "";
|
|
7677
|
+
this._writingValue = !0, r ? this.setAttribute("value", r) : this.removeAttribute("value"), this._writingValue = !1, this._hiddenInput && (this._hiddenInput.value = r), e && r && (this.dispatchEvent(new Event("input", {
|
|
7678
|
+
bubbles: !0,
|
|
7679
|
+
composed: !0
|
|
7680
|
+
})), this.dispatchEvent(new CustomEvent("change", {
|
|
7681
|
+
detail: { value: r },
|
|
7682
|
+
bubbles: !0,
|
|
7683
|
+
composed: !0
|
|
7684
|
+
})));
|
|
7685
|
+
}
|
|
7686
|
+
_syncState() {
|
|
7687
|
+
this._datePicker && (this._datePicker.setAttribute("value", this._dateValue), this._datePicker.setAttribute("error", this.getAttribute("error") || "false"), this._datePicker.setAttribute("error-message", this.getAttribute("error-message") || ""), this._timePicker?.setAttribute("error", this.getAttribute("error") || "false"), this._timePicker?.setAttribute("error-message", this.getAttribute("error-message") || ""), this._hiddenInput && (this._hiddenInput.value = this.getValue()), this._syncCombinedDisplay());
|
|
7688
|
+
}
|
|
7689
|
+
render() {
|
|
7690
|
+
let e = this.getAttribute("label") || "", t = this.getAttribute("info") || "", n = this.getAttribute("format") || "mm/dd/yyyy", r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
|
|
7691
|
+
this._displayControlBound = !1;
|
|
7692
|
+
let a = document.createElement("mint-date-picker");
|
|
7693
|
+
a.setAttribute("class", "mint-datetime-picker-date"), a.setAttribute("keep-open-on-select", "true"), a.setAttribute("format", n), a.setAttribute("value", this._dateValue), a.setAttribute("label", e), a.setAttribute("info", t), a.setAttribute("display-format", this.getAttribute("display-format") || "F j, Y");
|
|
7694
|
+
for (let e of [
|
|
7695
|
+
"min",
|
|
7696
|
+
"max",
|
|
7697
|
+
"shortcuts"
|
|
7698
|
+
]) this.hasAttribute(e) && a.setAttribute(e, this.getAttribute(e) || "");
|
|
7699
|
+
r && a.setAttribute("disabled", "true"), i && a.setAttribute("readonly", "true"), this.hasAttribute("required") && a.setAttribute("required", this.getAttribute("required") || "true"), this.hasAttribute("error") && a.setAttribute("error", this.getAttribute("error") || "false"), this.hasAttribute("error-message") && a.setAttribute("error-message", this.getAttribute("error-message") || ""), a.addEventListener("change", (e) => {
|
|
7700
|
+
e.stopPropagation();
|
|
7701
|
+
let t = e.detail?.value || a.value || "";
|
|
7702
|
+
this._parseDate(t, n) && (this._dateValue = t, this._dateStageComplete = !0, this._syncValue(!1), this._syncCombinedDisplay(), this._openTimeStage());
|
|
7703
|
+
}), this._datePicker = a, this._bindCombinedDisplayControl();
|
|
7704
|
+
let o = document.createElement("div");
|
|
7705
|
+
o.className = "mint-datetime-picker-content", this._content = o, this.innerHTML = "", this.appendChild(o), o.appendChild(a), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getAttribute("name") || "", this._hiddenInput.value = this.getValue(), this.appendChild(this._hiddenInput), this._waitForPopover();
|
|
7706
|
+
}
|
|
7707
|
+
_getPopover() {
|
|
7708
|
+
let e = this._datePicker, t = e?.getPopoverElement?.() || e?._popover;
|
|
7709
|
+
if (t) return t;
|
|
7710
|
+
let n = e?.querySelector?.(".mint-date-picker-icon-button")?.id;
|
|
7711
|
+
return n ? document.querySelector(`mint-popover[trigger-id="${CSS.escape(n)}"]`) : null;
|
|
7712
|
+
}
|
|
7713
|
+
_getPopoverContent(e) {
|
|
7714
|
+
return e.querySelector(".popover-content") || e;
|
|
7715
|
+
}
|
|
7716
|
+
_waitForPopover(e = 0) {
|
|
7717
|
+
let t = this._getPopover();
|
|
7718
|
+
if (!t) {
|
|
7719
|
+
e < 120 && requestAnimationFrame(() => this._waitForPopover(e + 1));
|
|
7720
|
+
return;
|
|
7721
|
+
}
|
|
7722
|
+
if (this._popoverContent = this._datePicker?.getPopoverContentElement?.() || this._getPopoverContent(t), this._bindCombinedDisplayControl(), this._syncCombinedDisplay(), this._popoverObserver?.disconnect(), this._popoverObserver = new MutationObserver(() => {
|
|
7723
|
+
if (t.getAttribute("open") === "true") {
|
|
7724
|
+
let e = this._datePicker;
|
|
7725
|
+
typeof e?.refreshCalendar == "function" ? e.refreshCalendar() : e?._buildCalendar?.();
|
|
7726
|
+
}
|
|
7727
|
+
}), this._popoverObserver.observe(t, {
|
|
7728
|
+
attributes: !0,
|
|
7729
|
+
attributeFilter: ["open"]
|
|
7730
|
+
}), t.getAttribute("open") === "true") {
|
|
7731
|
+
let e = this._datePicker;
|
|
7732
|
+
typeof e?.refreshCalendar == "function" ? e.refreshCalendar() : e?._buildCalendar?.();
|
|
7733
|
+
}
|
|
7734
|
+
}
|
|
7735
|
+
_bindCombinedDisplayControl() {
|
|
7736
|
+
if (this._displayControlBound || !this._datePicker) return;
|
|
7737
|
+
this._displayControlBound = !0;
|
|
7738
|
+
let e = (e) => {
|
|
7739
|
+
if (!e.target?.closest(".mint-date-picker-field") || this.getAttribute("disabled") === "true" || this.getAttribute("readonly") === "true" || e instanceof KeyboardEvent && e.key !== "Enter" && e.key !== " ") return;
|
|
7740
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
7741
|
+
let t = this._getPopover();
|
|
7742
|
+
t?.open ? t.open() : t?.setAttribute("open", "true");
|
|
7743
|
+
};
|
|
7744
|
+
this._datePicker.addEventListener("click", e, !0), this._datePicker.addEventListener("keydown", e, !0);
|
|
7745
|
+
}
|
|
7746
|
+
_openTimeStage() {
|
|
7747
|
+
queueMicrotask(() => this._renderTimeStage());
|
|
7748
|
+
}
|
|
7749
|
+
_renderTimeStage() {
|
|
7750
|
+
if (!this._popoverContent || !this._dateStageComplete) return;
|
|
7751
|
+
let e = document.createElement("div");
|
|
7752
|
+
e.className = "mint-datetime-picker-panel";
|
|
7753
|
+
let t = document.createElement("button");
|
|
7754
|
+
t.type = "button", t.className = "mint-datetime-picker-time-heading", t.setAttribute("aria-label", `Change date, ${this._dateValue}`), t.textContent = this._getFormattedDate(), t.addEventListener("click", () => {
|
|
7755
|
+
let e = this._datePicker;
|
|
7756
|
+
typeof e?.refreshCalendar == "function" ? e.refreshCalendar() : e?._buildCalendar?.();
|
|
7757
|
+
});
|
|
7758
|
+
let n = document.createElement("mint-time-picker"), r = this.getAttribute("disabled") === "true", i = this.getAttribute("readonly") === "true";
|
|
7759
|
+
n.setAttribute("inline", "true"), n.setAttribute("value", this._timeValue || "09:00"), n.setAttribute("label", "");
|
|
7760
|
+
for (let e of [
|
|
7761
|
+
"hours",
|
|
7762
|
+
"minutes",
|
|
7763
|
+
"seconds"
|
|
7764
|
+
]) this.hasAttribute(e) && n.setAttribute(e, this.getAttribute(e) || "");
|
|
7765
|
+
r && n.setAttribute("disabled", "true"), i && n.setAttribute("readonly", "true"), n.addEventListener("change", () => {
|
|
7766
|
+
this._timeValue = n.getValue?.() || n.getAttribute("value") || "", this._syncValue(!0), this._syncCombinedDisplay();
|
|
7767
|
+
}), n.addEventListener("change", (e) => e.stopPropagation()), n.addEventListener("input", (e) => e.stopPropagation()), this._timePicker = n, e.appendChild(t), e.appendChild(n), this._popoverContent.replaceChildren(e);
|
|
7768
|
+
}
|
|
7769
|
+
_syncCombinedDisplay() {
|
|
7770
|
+
let e = this._datePicker?.getDisplayElement?.() || this._datePicker?.querySelector(".mint-date-picker-display");
|
|
7771
|
+
if (!e || !this._dateValue) return;
|
|
7772
|
+
let t = this._getFormattedDate();
|
|
7773
|
+
e.textContent = this._timeValue ? `${t} · ${this._formatTime(this._timeValue)}` : t, e.setAttribute("aria-label", `${this.getAttribute("label") || "Date and time"}: ${e.textContent}`);
|
|
7774
|
+
}
|
|
7775
|
+
_getFormattedDate() {
|
|
7776
|
+
let e = this._parseDate(this._dateValue, this.getAttribute("format") || "mm/dd/yyyy");
|
|
7777
|
+
return e ? this._formatDate(e, this.getAttribute("display-format") || "F j, Y") : this._dateValue;
|
|
7778
|
+
}
|
|
7779
|
+
_formatTime(e) {
|
|
7780
|
+
let [t = "00", n = "00", r] = e.split(":"), i = Number(t), a = this.getAttribute("hours") !== "false", o = this.getAttribute("minutes") !== "false", s = this.getAttribute("seconds") === "true";
|
|
7781
|
+
if (!a) return [o ? n : "", s ? r || "00" : ""].filter(Boolean).join(":");
|
|
7782
|
+
let c = i % 12 || 12;
|
|
7783
|
+
return `${[
|
|
7784
|
+
String(c),
|
|
7785
|
+
o ? n : "",
|
|
7786
|
+
s ? r || "00" : ""
|
|
7787
|
+
].filter(Boolean).join(":")} ${i >= 12 ? "pm" : "am"}`;
|
|
7788
|
+
}
|
|
7789
|
+
};
|
|
7790
|
+
customElements.get("mint-datetime-picker") || a("mint-datetime-picker", Rn), s({
|
|
7791
|
+
name: "upload",
|
|
7792
|
+
viewBox: "0 0 24 24",
|
|
7793
|
+
path: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",
|
|
7794
|
+
strokeLinecap: "round",
|
|
7795
|
+
strokeLinejoin: "round"
|
|
7796
|
+
}), s({
|
|
7797
|
+
name: "attach",
|
|
7798
|
+
viewBox: "0 0 24 24",
|
|
7799
|
+
path: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",
|
|
7800
|
+
strokeLinecap: "round",
|
|
7801
|
+
strokeLinejoin: "round"
|
|
7802
|
+
});
|
|
7803
|
+
//#endregion
|
|
7804
|
+
//#region src/components/dropzone/Dropzone.ts
|
|
7805
|
+
var zn = class extends HTMLElement {
|
|
7806
|
+
static get observedAttributes() {
|
|
7807
|
+
return [
|
|
7808
|
+
"label",
|
|
7809
|
+
"accept",
|
|
7810
|
+
"multiple",
|
|
7811
|
+
"width",
|
|
7812
|
+
"height",
|
|
7813
|
+
"disabled",
|
|
7814
|
+
"name",
|
|
7815
|
+
"error",
|
|
7816
|
+
"error-message",
|
|
7817
|
+
"loading",
|
|
7818
|
+
"aria-label",
|
|
7819
|
+
"aria-describedby"
|
|
7820
|
+
];
|
|
7821
|
+
}
|
|
7822
|
+
constructor() {
|
|
7823
|
+
super(), this._dropzone = null, this._fileInput = null, this._previewContainer = null, this._isDragging = !1, this._wasDragging = !1, this._isUpdatingFiles = !1, this._listenersInitialized = !1, this._selectedFiles = [], this._previewUrls = [], this._resetHandler = null, this._a11yId = `mint-dropzone-${Math.random().toString(36).slice(2, 10)}`;
|
|
7824
|
+
}
|
|
7825
|
+
connectedCallback() {
|
|
7826
|
+
this.classList.add("mint-dropzone"), this.render(), this._attachFormResetListener();
|
|
7827
|
+
}
|
|
7828
|
+
disconnectedCallback() {
|
|
7829
|
+
if (this.removeEventListeners(), this._cleanupPreviewUrls(), this._resetHandler) {
|
|
7830
|
+
let e = this.closest("form");
|
|
7831
|
+
e && e.removeEventListener("reset", this._resetHandler), this._resetHandler = null;
|
|
7832
|
+
}
|
|
7833
|
+
}
|
|
7834
|
+
attributeChangedCallback(e, t, n) {
|
|
7835
|
+
if (t !== n) {
|
|
7836
|
+
if (e === "error" || e === "error-message") {
|
|
7837
|
+
this._updateDragStateClass(), this._renderErrorState(this.hasError(), this.getErrorMessage());
|
|
7838
|
+
return;
|
|
7839
|
+
}
|
|
7840
|
+
if (e === "loading") {
|
|
7841
|
+
this.render();
|
|
7842
|
+
return;
|
|
7843
|
+
}
|
|
7844
|
+
this.render();
|
|
7845
|
+
}
|
|
7846
|
+
}
|
|
7847
|
+
getLabel() {
|
|
7848
|
+
return this.getAttribute("label") || "";
|
|
7849
|
+
}
|
|
7850
|
+
getAccept() {
|
|
7851
|
+
return this.getAttribute("accept") || "";
|
|
7852
|
+
}
|
|
7853
|
+
isMultiple() {
|
|
7854
|
+
return this.getAttribute("multiple") === "true";
|
|
7855
|
+
}
|
|
7856
|
+
getWidth() {
|
|
7857
|
+
return this.getAttribute("width") || "200px";
|
|
7858
|
+
}
|
|
7859
|
+
getHeight() {
|
|
7860
|
+
return this.getAttribute("height") || "200px";
|
|
7861
|
+
}
|
|
7862
|
+
_renderSkeleton(e) {
|
|
7863
|
+
let t = this.querySelector(".mint-dropzone-skeleton-container"), n = this._dropzone;
|
|
7864
|
+
if (e) {
|
|
7865
|
+
this.classList.add("is-loading"), t || (t = document.createElement("div"), t.className = "mint-dropzone-skeleton-container", n ? (n.classList.add("is-positioned"), n.appendChild(t)) : this.appendChild(t));
|
|
7866
|
+
let e = t.querySelector(".mint-dropzone-skeleton");
|
|
7867
|
+
e || (e = document.createElement("div"), e.className = "mint-dropzone-skeleton", t.appendChild(e)), t.classList.add("is-visible"), n?.classList.add("is-loading");
|
|
7868
|
+
} else this.classList.remove("is-loading"), t && t.classList.remove("is-visible"), n?.classList.remove("is-loading");
|
|
7869
|
+
}
|
|
7870
|
+
getName() {
|
|
7871
|
+
return this.getAttribute("name") || "";
|
|
7872
|
+
}
|
|
7873
|
+
hasError() {
|
|
7874
|
+
return this.getAttribute("error") === "true";
|
|
7875
|
+
}
|
|
7876
|
+
getErrorMessage() {
|
|
7877
|
+
return this.getAttribute("error-message") || "";
|
|
7878
|
+
}
|
|
7879
|
+
isDisabled() {
|
|
7880
|
+
return this.getAttribute("disabled") === "true";
|
|
7881
|
+
}
|
|
7882
|
+
isLoading() {
|
|
7883
|
+
return this.getAttribute("loading") === "true";
|
|
7884
|
+
}
|
|
7885
|
+
render() {
|
|
7886
|
+
let e = this.isLoading(), t = this.getLabel(), n = this.getAccept(), r = this.isMultiple(), i = this.isDisabled(), a = this.getWidth(), o = this.getHeight(), s = this.getName(), c = this.hasError(), l = this.getErrorMessage();
|
|
7887
|
+
if (this._dropzone || (this._dropzone = document.createElement("div"), this.appendChild(this._dropzone)), this._updateDragStateClass(), this._dropzone.setAttribute("aria-invalid", c ? "true" : "false"), i) this._dropzone.setAttribute("tabindex", "-1"), this._dropzone.removeAttribute("role");
|
|
7888
|
+
else {
|
|
7889
|
+
this._dropzone.setAttribute("tabindex", "0"), this._dropzone.setAttribute("role", "button"), this._dropzone.setAttribute("aria-label", this.getAttribute("aria-label") || t || "File upload dropzone");
|
|
7890
|
+
let e = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean), n = this.querySelector(".mint-dropzone-error");
|
|
7891
|
+
n && (n.id = `${this.id || this._a11yId}-error`, e.push(n.id)), e.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(e)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7892
|
+
}
|
|
7893
|
+
this._dropzone.style.width = a, this._dropzone.style.height = o, this._dropzone.style.minWidth = a, this._dropzone.style.minHeight = o, this._fileInput || (this._fileInput = document.createElement("input"), this._fileInput.type = "file", this._fileInput.className = "mint-dropzone-file-input", this._fileInput.setAttribute("tabindex", "-1"), this._fileInput.setAttribute("aria-hidden", "true"), this._dropzone.appendChild(this._fileInput)), this._fileInput.accept = n, this._fileInput.multiple = r, this._fileInput.disabled = i, s ? this._fileInput.name = s : this._fileInput.removeAttribute("name"), this._fileInput.setAttribute("aria-invalid", c ? "true" : "false");
|
|
7894
|
+
let u = this._dropzone.querySelector(".mint-dropzone-icon"), d = this._dropzone.querySelector(".mint-dropzone-label");
|
|
7895
|
+
u && u.remove(), d && d.remove();
|
|
7896
|
+
let f = document.createElement("div");
|
|
7897
|
+
f.className = "mint-dropzone-icon";
|
|
7898
|
+
let p = document.createElement("mint-icon");
|
|
7899
|
+
if (p.setAttribute("name", "upload"), p.className = "mint-dropzone-upload-icon", f.appendChild(p), this._dropzone.appendChild(f), t) {
|
|
7900
|
+
let e = document.createElement("div");
|
|
7901
|
+
e.className = "mint-dropzone-label", e.textContent = t, this._dropzone.appendChild(e);
|
|
7902
|
+
}
|
|
7903
|
+
this.setupEventListeners(), this._renderErrorState(c, l), this._renderPreviews(), this._renderSkeleton(e);
|
|
7904
|
+
}
|
|
7905
|
+
_updateDragState() {
|
|
7906
|
+
this._dropzone && this._updateDragStateClass();
|
|
7907
|
+
}
|
|
7908
|
+
_renderErrorState(e, t) {
|
|
7909
|
+
let n = this.querySelector(".mint-dropzone-error");
|
|
7910
|
+
if (e && t ? (n || (n = document.createElement("div"), n.className = "mint-dropzone-error", this.appendChild(n)), n.textContent = t) : n && n.remove(), this._dropzone) {
|
|
7911
|
+
this._dropzone.setAttribute("aria-invalid", String(e)), n && (n.id = `${this.id || this._a11yId}-error`);
|
|
7912
|
+
let t = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
7913
|
+
n && t.push(n.id), t.length ? this._dropzone.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._dropzone.removeAttribute("aria-describedby");
|
|
7914
|
+
}
|
|
7915
|
+
}
|
|
7916
|
+
_updateDragStateClass() {
|
|
7917
|
+
if (!this._dropzone) return;
|
|
7918
|
+
let e = this.isDisabled(), t = this.hasError();
|
|
7919
|
+
this._dropzone.className = "mint-dropzone-target", this._dropzone.classList.toggle("has-files", this._selectedFiles.length > 0), this._dropzone.classList.toggle("is-dragging", this._isDragging), this._dropzone.classList.toggle("has-error", t), this._dropzone.classList.toggle("is-disabled", e);
|
|
7920
|
+
}
|
|
7921
|
+
setupEventListeners() {
|
|
7922
|
+
this._listenersInitialized || (this._listenersInitialized = !0, this.removeEventListeners(), !(!this._dropzone || !this._fileInput || this.isDisabled()) && (this._onDropzoneClick ||= (e) => {
|
|
7923
|
+
if (!(this.isDisabled() || !this._fileInput) && e.target !== this._fileInput && (e.stopPropagation(), e.preventDefault(), e.isTrusted)) try {
|
|
7924
|
+
this._fileInput.click();
|
|
7925
|
+
} catch (e) {
|
|
7926
|
+
console.debug("File chooser blocked:", e);
|
|
7927
|
+
}
|
|
7928
|
+
}, this._onDragOver ||= (e) => {
|
|
7929
|
+
e.preventDefault(), e.stopPropagation(), this.isDisabled() || this._isDragging || (this._isDragging = !0, this._wasDragging = !0, this._updateDragState());
|
|
7930
|
+
}, this._onDragLeave ||= (e) => {
|
|
7931
|
+
e.preventDefault(), e.stopPropagation();
|
|
7932
|
+
let t = this._dropzone?.getBoundingClientRect();
|
|
7933
|
+
t && (e.clientX < t.left || e.clientX > t.right || e.clientY < t.top || e.clientY > t.bottom) && this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState());
|
|
7934
|
+
}, this._onDrop ||= (e) => {
|
|
7935
|
+
if (e.preventDefault(), e.stopPropagation(), this._isDragging && (this._isDragging = !1, this._wasDragging = !1, this._updateDragState()), this.isDisabled()) return;
|
|
7936
|
+
let t = e.dataTransfer?.files;
|
|
7937
|
+
t && t.length > 0 && this._handleFiles(t);
|
|
7938
|
+
}, this._onFileInputInput ||= (e) => {
|
|
7939
|
+
e.stopImmediatePropagation(), e.stopPropagation();
|
|
7940
|
+
}, this._onKeyDown ||= (e) => {
|
|
7941
|
+
if (!(this.isDisabled() || !this._fileInput) && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), e.isTrusted)) try {
|
|
7942
|
+
this._fileInput.click();
|
|
7943
|
+
} catch (e) {
|
|
7944
|
+
console.debug("File chooser blocked:", e);
|
|
7945
|
+
}
|
|
7946
|
+
}, this._onFocus ||= (e) => {
|
|
7947
|
+
this._dropzone && !this.isDisabled() && this._dropzone.classList.add("is-focused");
|
|
7948
|
+
}, this._onBlur ||= (e) => {
|
|
7949
|
+
this._dropzone;
|
|
7950
|
+
}, this._onFileInputChange ||= (e) => {
|
|
7951
|
+
if (e.stopImmediatePropagation(), e.stopPropagation(), this._isUpdatingFiles) return;
|
|
7952
|
+
let t = e.target.files;
|
|
7953
|
+
if (t && t.length > 0) {
|
|
7954
|
+
let e = this.getAccept(), n = this.isMultiple(), r = [], i = [];
|
|
7955
|
+
for (let n = 0; n < t.length; n++) {
|
|
7956
|
+
let a = t[n];
|
|
7957
|
+
this._isFileAccepted(a, e) ? r.push(a) : i.push(a);
|
|
7958
|
+
}
|
|
7959
|
+
if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
|
|
7960
|
+
let e = new CustomEvent("dropRejected", {
|
|
7961
|
+
detail: {
|
|
7962
|
+
files: i,
|
|
7963
|
+
reason: "File type not accepted or multiple files not allowed"
|
|
7964
|
+
},
|
|
7965
|
+
bubbles: !0,
|
|
7966
|
+
cancelable: !0
|
|
7967
|
+
});
|
|
7968
|
+
this.dispatchEvent(e);
|
|
7969
|
+
}
|
|
7970
|
+
r.length > 0 && this._applyValidFiles(r);
|
|
7971
|
+
}
|
|
7972
|
+
}, this._dropzone.addEventListener("click", this._onDropzoneClick), this._dropzone.addEventListener("dragover", this._onDragOver), this._dropzone.addEventListener("dragleave", this._onDragLeave), this._dropzone.addEventListener("drop", this._onDrop), this._dropzone.addEventListener("keydown", this._onKeyDown), this._dropzone.addEventListener("focus", this._onFocus), this._dropzone.addEventListener("blur", this._onBlur), this._fileInput.addEventListener("change", this._onFileInputChange), this._fileInput.addEventListener("input", this._onFileInputInput, !0)));
|
|
7973
|
+
}
|
|
7974
|
+
removeEventListeners() {
|
|
7975
|
+
this._dropzone && (this._onDropzoneClick && this._dropzone.removeEventListener("click", this._onDropzoneClick), this._onDragOver && this._dropzone.removeEventListener("dragover", this._onDragOver), this._onDragLeave && this._dropzone.removeEventListener("dragleave", this._onDragLeave), this._onDrop && this._dropzone.removeEventListener("drop", this._onDrop), this._onKeyDown && this._dropzone.removeEventListener("keydown", this._onKeyDown), this._onFocus && this._dropzone.removeEventListener("focus", this._onFocus), this._onBlur && this._dropzone.removeEventListener("blur", this._onBlur)), this._fileInput && (this._onFileInputChange && this._fileInput.removeEventListener("change", this._onFileInputChange), this._onFileInputInput && this._fileInput.removeEventListener("input", this._onFileInputInput, !0)), this._isDragging = !1, this._listenersInitialized = !1;
|
|
7976
|
+
}
|
|
7977
|
+
_handleFiles(e) {
|
|
7978
|
+
let t = this.getAccept(), n = this.isMultiple(), r = [], i = [];
|
|
7979
|
+
for (let n = 0; n < e.length; n++) {
|
|
7980
|
+
let a = e[n];
|
|
7981
|
+
this._isFileAccepted(a, t) ? r.push(a) : i.push(a);
|
|
7982
|
+
}
|
|
7983
|
+
if (!n && r.length > 1 && (i.push(...r.slice(1)), r.splice(1)), i.length > 0) {
|
|
7984
|
+
let e = new CustomEvent("dropRejected", {
|
|
7985
|
+
detail: {
|
|
7986
|
+
files: i,
|
|
7987
|
+
reason: "File type not accepted or multiple files not allowed"
|
|
7988
|
+
},
|
|
7989
|
+
bubbles: !0,
|
|
7990
|
+
cancelable: !0
|
|
7991
|
+
});
|
|
7992
|
+
this.dispatchEvent(e);
|
|
7993
|
+
}
|
|
7994
|
+
r.length > 0 && this._applyValidFiles(r);
|
|
7995
|
+
}
|
|
7996
|
+
_isFileAccepted(e, t) {
|
|
7997
|
+
if (!t) return !0;
|
|
7998
|
+
let n = t.split(",").map((e) => e.trim().toLowerCase());
|
|
7999
|
+
for (let t of n) if (t.startsWith(".")) {
|
|
8000
|
+
if ("." + e.name.split(".").pop()?.toLowerCase() === t) return !0;
|
|
8001
|
+
} else if (t.includes("/*")) {
|
|
8002
|
+
if (t.split("/")[0] === e.type.split("/")[0]) return !0;
|
|
8003
|
+
} else if (e.type === t) return !0;
|
|
8004
|
+
return !1;
|
|
8005
|
+
}
|
|
8006
|
+
_dispatchEvent(e, t) {
|
|
8007
|
+
let n = t.target, r = new CustomEvent(e, {
|
|
7408
8008
|
detail: {
|
|
7409
8009
|
files: n.files ? Array.from(n.files) : [],
|
|
7410
8010
|
value: n.value || ""
|
|
@@ -7520,10 +8120,10 @@ var Ln = class extends HTMLElement {
|
|
|
7520
8120
|
return this._selectedFiles.some((t) => t.name === e.name && t.size === e.size && t.lastModified === e.lastModified);
|
|
7521
8121
|
}
|
|
7522
8122
|
};
|
|
7523
|
-
customElements.get("mint-dropzone") || a("mint-dropzone",
|
|
8123
|
+
customElements.get("mint-dropzone") || a("mint-dropzone", zn);
|
|
7524
8124
|
//#endregion
|
|
7525
8125
|
//#region src/components/form/Form.ts
|
|
7526
|
-
var
|
|
8126
|
+
var Bn = class extends HTMLElement {
|
|
7527
8127
|
static get observedAttributes() {
|
|
7528
8128
|
return [
|
|
7529
8129
|
"action",
|
|
@@ -7878,6 +8478,7 @@ var Rn = class extends HTMLElement {
|
|
|
7878
8478
|
"mint-input[name]",
|
|
7879
8479
|
"mint-select[name]",
|
|
7880
8480
|
"mint-date-picker[name]",
|
|
8481
|
+
"mint-datetime-picker[name]",
|
|
7881
8482
|
"mint-time-picker[name]",
|
|
7882
8483
|
"mint-dropzone[name]",
|
|
7883
8484
|
"mint-checkbox[name]",
|
|
@@ -8204,7 +8805,7 @@ var Rn = class extends HTMLElement {
|
|
|
8204
8805
|
});
|
|
8205
8806
|
}
|
|
8206
8807
|
_resetCustomFields() {
|
|
8207
|
-
this.querySelectorAll("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8808
|
+
this.querySelectorAll("mint-input, mint-date-picker, mint-datetime-picker, mint-time-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8208
8809
|
e.removeAttribute("error"), e.removeAttribute("error-message");
|
|
8209
8810
|
let t = e.tagName;
|
|
8210
8811
|
if (t === "MINT-INPUT") try {
|
|
@@ -8242,7 +8843,7 @@ var Rn = class extends HTMLElement {
|
|
|
8242
8843
|
let t = e.closest("mint-choice");
|
|
8243
8844
|
if (t) return t;
|
|
8244
8845
|
}
|
|
8245
|
-
return e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
|
|
8846
|
+
return e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags") || e;
|
|
8246
8847
|
}
|
|
8247
8848
|
_setupBlurValidation() {
|
|
8248
8849
|
if (!this._form) return;
|
|
@@ -8253,7 +8854,7 @@ var Rn = class extends HTMLElement {
|
|
|
8253
8854
|
if (!n) return;
|
|
8254
8855
|
let r = this._getFieldName(n);
|
|
8255
8856
|
if (!r || !this._collectValidationRules()[r]) return;
|
|
8256
|
-
let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker");
|
|
8857
|
+
let i = this._extractFieldValue([n]), a = i != null && (typeof i == "string" ? i.trim() !== "" : i instanceof FileList || Array.isArray(i) ? i.length > 0 : !0), o = n.hasAttribute("data-mint-form-error") || t instanceof HTMLElement && (t.hasAttribute("aria-invalid") || t.closest("[data-mint-form-error]")), s = !!n.closest("mint-tags"), c = n.tagName === "MINT-CHECKBOX" || n.tagName === "MINT-SWITCH" || n.tagName === "MINT-CHOICE" || t instanceof HTMLElement && (t.closest("mint-checkbox, mint-switch, mint-choice") || t.closest("mint-choice-option")), l = n.tagName === "MINT-DATE-PICKER" || t instanceof HTMLElement && t.closest("mint-date-picker, mint-datetime-picker");
|
|
8257
8858
|
(a || o || s || c || l) && setTimeout(() => {
|
|
8258
8859
|
this._validateField(r);
|
|
8259
8860
|
}, 0);
|
|
@@ -8312,7 +8913,7 @@ var Rn = class extends HTMLElement {
|
|
|
8312
8913
|
this._form.addEventListener("change", t, !0), this._form.addEventListener("input", t, !0), this._form.addEventListener("tags-change", t, !0), this._form.addEventListener("choice-change", t, !0), this._fieldChangeHandlers.set(this._form, t);
|
|
8313
8914
|
}
|
|
8314
8915
|
_findFieldElement(e) {
|
|
8315
|
-
let t = e.closest("mint-input, mint-date-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
|
|
8916
|
+
let t = e.closest("mint-input, mint-date-picker, mint-datetime-picker, mint-select, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags");
|
|
8316
8917
|
if (t && t.hasAttribute("name")) return t;
|
|
8317
8918
|
if (e.hasAttribute("name") && (e.tagName.startsWith("MINT-") || e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) || (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) && e.hasAttribute("name")) return e;
|
|
8318
8919
|
let n = e;
|
|
@@ -8364,11 +8965,11 @@ var Rn = class extends HTMLElement {
|
|
|
8364
8965
|
this._restoreSubmittingAttributeState();
|
|
8365
8966
|
return;
|
|
8366
8967
|
}
|
|
8367
|
-
this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8968
|
+
this._attrSubmittingMintFields.size > 0 || this._attrSubmittingNativeFields.size > 0 || this._attrSubmittingMintButtons.size > 0 || this._attrSubmittingNativeButtons.size > 0 || (this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags").forEach((e) => {
|
|
8368
8969
|
let t = e.getAttribute("disabled") === "true";
|
|
8369
8970
|
this._attrSubmittingMintFields.set(e, t), t || e.setAttribute("disabled", "true"), typeof e.render == "function" && e.render();
|
|
8370
8971
|
}), this._form.querySelectorAll("input, textarea, select").forEach((e) => {
|
|
8371
|
-
if (e.closest("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
|
|
8972
|
+
if (e.closest("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags, mint-button") || e instanceof HTMLInputElement && e.type === "hidden") return;
|
|
8372
8973
|
let t = e.disabled;
|
|
8373
8974
|
this._attrSubmittingNativeFields.set(e, t), t || (e.disabled = !0);
|
|
8374
8975
|
}), Array.from(this.querySelectorAll("mint-button")).forEach((e) => {
|
|
@@ -8380,7 +8981,7 @@ var Rn = class extends HTMLElement {
|
|
|
8380
8981
|
let r = (e.getAttribute("type") || e.getAttribute("button-type") || "default") === "submit";
|
|
8381
8982
|
t || e.setAttribute("disabled", "true"), r && !n && e.setAttribute("loading", "true"), typeof e.render == "function" && e.render();
|
|
8382
8983
|
}), Array.from(this.querySelectorAll("button")).forEach((e) => {
|
|
8383
|
-
if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
|
|
8984
|
+
if (e.closest("mint-button, mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")) return;
|
|
8384
8985
|
let t = e.disabled;
|
|
8385
8986
|
this._attrSubmittingNativeButtons.set(e, t), t || (e.disabled = !0);
|
|
8386
8987
|
}));
|
|
@@ -8400,7 +9001,7 @@ var Rn = class extends HTMLElement {
|
|
|
8400
9001
|
_propagateLoadingState() {
|
|
8401
9002
|
if (!this._form) return;
|
|
8402
9003
|
let e = this.getAttribute("loading"), t = e !== null && e !== "false";
|
|
8403
|
-
Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
|
|
9004
|
+
Array.from(this._form.querySelectorAll("mint-input, mint-select, mint-date-picker, mint-datetime-picker, mint-dropzone, mint-checkbox, mint-choice, mint-switch, mint-tags")).forEach((e) => {
|
|
8404
9005
|
t ? e.setAttribute("loading", "true") : e.removeAttribute("loading"), typeof e.render == "function" && e.render();
|
|
8405
9006
|
});
|
|
8406
9007
|
}
|
|
@@ -8498,7 +9099,7 @@ var Rn = class extends HTMLElement {
|
|
|
8498
9099
|
this._reactiveDataObserver !== null && (cancelAnimationFrame(this._reactiveDataObserver), this._reactiveDataObserver = null), this._reactiveDataProxy = null, this._lastDataSnapshot = null, this._lastAppliedDataSnapshot = null;
|
|
8499
9100
|
}
|
|
8500
9101
|
};
|
|
8501
|
-
customElements.get("mint-form") || a("mint-form",
|
|
9102
|
+
customElements.get("mint-form") || a("mint-form", Bn), typeof window < "u" && (window.mintForm = window.mintForm || {
|
|
8502
9103
|
defaults: { headers: { common: {} } },
|
|
8503
9104
|
interceptors: { response: { handlers: [] } }
|
|
8504
9105
|
}, window.mintForm.interceptors.response.use || (window.mintForm.interceptors.response.use = function(e, t) {
|
|
@@ -8509,7 +9110,7 @@ customElements.get("mint-form") || a("mint-form", Rn), typeof window < "u" && (w
|
|
|
8509
9110
|
}));
|
|
8510
9111
|
//#endregion
|
|
8511
9112
|
//#region src/components/off-canvas/OffCanvas.ts
|
|
8512
|
-
var
|
|
9113
|
+
var Vn = class extends HTMLElement {
|
|
8513
9114
|
static get observedAttributes() {
|
|
8514
9115
|
return [
|
|
8515
9116
|
"id",
|
|
@@ -8673,7 +9274,7 @@ var zn = class extends HTMLElement {
|
|
|
8673
9274
|
}, 300);
|
|
8674
9275
|
}
|
|
8675
9276
|
};
|
|
8676
|
-
customElements.get("mint-off-canvas") || a("mint-off-canvas",
|
|
9277
|
+
customElements.get("mint-off-canvas") || a("mint-off-canvas", Vn), s({
|
|
8677
9278
|
name: "search",
|
|
8678
9279
|
viewBox: "0 0 24 24",
|
|
8679
9280
|
path: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
|
|
@@ -8682,7 +9283,7 @@ customElements.get("mint-off-canvas") || a("mint-off-canvas", zn), s({
|
|
|
8682
9283
|
});
|
|
8683
9284
|
//#endregion
|
|
8684
9285
|
//#region src/components/resource-table/utility-aliases.js
|
|
8685
|
-
var
|
|
9286
|
+
var Hn = {
|
|
8686
9287
|
"-mr-1": "rtu-8956a4275",
|
|
8687
9288
|
"-translate-y-1/2": "rtu-36b381be4",
|
|
8688
9289
|
"[&>*]:m-0": "rtu-7b41b3d11",
|
|
@@ -8844,7 +9445,7 @@ var Bn = {
|
|
|
8844
9445
|
"z-10": "rtu-236812d64",
|
|
8845
9446
|
"z-20": "rtu-145745bf5",
|
|
8846
9447
|
"z-30": "rtu-0f2fff0ae"
|
|
8847
|
-
},
|
|
9448
|
+
}, Un = class extends HTMLElement {
|
|
8848
9449
|
constructor(...e) {
|
|
8849
9450
|
super(...e), this._observer = null, this._disposeScrollFade = null;
|
|
8850
9451
|
}
|
|
@@ -8904,10 +9505,10 @@ var Bn = {
|
|
|
8904
9505
|
e.dataset.mtProcessed = "", e.innerHTML = n, Object.entries(t).forEach(([t, n]) => e.setAttribute(t, n));
|
|
8905
9506
|
}
|
|
8906
9507
|
};
|
|
8907
|
-
customElements.get("mint-table") || a("mint-table",
|
|
9508
|
+
customElements.get("mint-table") || a("mint-table", Un);
|
|
8908
9509
|
//#endregion
|
|
8909
9510
|
//#region src/components/resource-table/ResourceTable.ts
|
|
8910
|
-
var
|
|
9511
|
+
var Wn = class extends HTMLElement {
|
|
8911
9512
|
static get observedAttributes() {
|
|
8912
9513
|
return [
|
|
8913
9514
|
"configuration",
|
|
@@ -9817,7 +10418,7 @@ var Hn = class extends HTMLElement {
|
|
|
9817
10418
|
return e.class && n.push(e.class.trim()), e.align === "center" ? n.push("text-center") : e.align === "right" && n.push("text-right"), e.sortable && !t && n.push("cursor-pointer"), e.stickLeft && n.push("sticky-left"), e.stickRight && n.push("sticky-right"), n.join(" ");
|
|
9818
10419
|
}
|
|
9819
10420
|
_replaceUtilityClasses() {
|
|
9820
|
-
let e =
|
|
10421
|
+
let e = Hn, t = [this, ...Array.from(this.querySelectorAll("[class]"))];
|
|
9821
10422
|
for (let n of t) for (let t of Array.from(n.classList)) {
|
|
9822
10423
|
let r = e[t];
|
|
9823
10424
|
r && n.classList.replace(t, r);
|
|
@@ -10017,10 +10618,10 @@ var Hn = class extends HTMLElement {
|
|
|
10017
10618
|
e !== null && (this._currentPage = e, this._offset = (this._currentPage - 1) * this._perPage);
|
|
10018
10619
|
}
|
|
10019
10620
|
};
|
|
10020
|
-
customElements.get("mint-resource-table") || a("mint-resource-table",
|
|
10621
|
+
customElements.get("mint-resource-table") || a("mint-resource-table", Wn);
|
|
10021
10622
|
//#endregion
|
|
10022
10623
|
//#region src/components/resource-table/ResourceTableContextMenu.ts
|
|
10023
|
-
var
|
|
10624
|
+
var Gn = 550, Kn = 12, qn = { passive: !0 }, Jn = class extends HTMLElement {
|
|
10024
10625
|
constructor(...e) {
|
|
10025
10626
|
super(...e), this._table = null, this._anchor = null, this._popover = null, this._menuRoot = null, this._baseId = "", this._touchTimer = null, this._touchStart = null, this._slotObserver = null, this._scrollCloseTargets = [], this._onScrollClose = () => {
|
|
10026
10627
|
this._closePopover();
|
|
@@ -10047,7 +10648,7 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
|
|
|
10047
10648
|
let t = e.touches[0];
|
|
10048
10649
|
if (!t) return;
|
|
10049
10650
|
let n = t.clientX - this._touchStart.x, r = t.clientY - this._touchStart.y;
|
|
10050
|
-
n * n + r * r >
|
|
10651
|
+
n * n + r * r > Kn * Kn && (this._clearTouchTimer(), this._touchStart = null);
|
|
10051
10652
|
}, this._onTouchEnd = () => {
|
|
10052
10653
|
this._clearTouchTimer(), this._touchStart = null;
|
|
10053
10654
|
};
|
|
@@ -10070,7 +10671,7 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
|
|
|
10070
10671
|
}
|
|
10071
10672
|
_longPressMs() {
|
|
10072
10673
|
let e = parseInt(this.getAttribute("long-press-ms") || "", 10);
|
|
10073
|
-
return !Number.isNaN(e) && e > 100 ? e :
|
|
10674
|
+
return !Number.isNaN(e) && e > 100 ? e : Gn;
|
|
10074
10675
|
}
|
|
10075
10676
|
_resolveTable() {
|
|
10076
10677
|
let e = this.getAttribute("for")?.trim();
|
|
@@ -10124,12 +10725,12 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
|
|
|
10124
10725
|
return this._elementIsScrollContainer(e) && r(e), t;
|
|
10125
10726
|
}
|
|
10126
10727
|
_detachScrollCloseListeners() {
|
|
10127
|
-
for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose,
|
|
10728
|
+
for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, qn);
|
|
10128
10729
|
this._scrollCloseTargets = [];
|
|
10129
10730
|
}
|
|
10130
10731
|
_attachScrollCloseListeners(e) {
|
|
10131
10732
|
this._detachScrollCloseListeners(), this._scrollCloseTargets = this._collectScrollCloseTargets(e);
|
|
10132
|
-
for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose,
|
|
10733
|
+
for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, qn);
|
|
10133
10734
|
}
|
|
10134
10735
|
_closePopover() {
|
|
10135
10736
|
if (this._detachScrollCloseListeners(), !this._popover?.hasAttribute("open")) return;
|
|
@@ -10170,10 +10771,10 @@ var Un = 550, Wn = 12, Gn = { passive: !0 }, Kn = class extends HTMLElement {
|
|
|
10170
10771
|
l && this._attachScrollCloseListeners(l);
|
|
10171
10772
|
}
|
|
10172
10773
|
};
|
|
10173
|
-
customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu",
|
|
10774
|
+
customElements.get("mint-resource-table-context-menu") || a("mint-resource-table-context-menu", Jn);
|
|
10174
10775
|
//#endregion
|
|
10175
10776
|
//#region src/components/search/Search.ts
|
|
10176
|
-
var
|
|
10777
|
+
var Yn = class e extends HTMLElement {
|
|
10177
10778
|
constructor(...e) {
|
|
10178
10779
|
super(...e), this._shell = null, this._desktopInput = null, this._panel = null, this._panelInner = null, this._resultsId = "", this._panelInput = null, this._panelFiltersWrap = null, this._panelFiltersMainRow = null, this._panelFiltersChips = null, this._panelFiltersShowAllWrap = null, this._panelFiltersShowAllBtn = null, this._panelFiltersMorePanel = null, this._filtersMoreOpen = !1, this._filterOverflowObserver = null, this._filterOverflowZeroWidthRetries = 0, this._desktopFilterWrap = null, this._mobileFilterWrap = null, this._resultsWrap = null, this._stateWrap = null, this._customResultsWrap = null, this._query = "", this._searchOpen = !1, this._selectedFilters = [], this._selectedFilterBackspaceArmed = !1, this._debounceId = null, this._abortController = null, this._docPointerDownHandler = null, this._globalKeydownHandler = null, this._focusOutHandler = null, this._resizeHandler = null, this._scrollHandler = null, this._desktopShortcutHint = null, this._panelSearchBar = null, this._contentObserver = null, this._renderFrame = null;
|
|
10179
10780
|
}
|
|
@@ -10745,7 +11346,7 @@ var qn = class e extends HTMLElement {
|
|
|
10745
11346
|
let e = document.createElement("div");
|
|
10746
11347
|
e.className = "mint-search-panel-inner", this._panelInner = e;
|
|
10747
11348
|
let t = document.createElement("div");
|
|
10748
|
-
this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
|
|
11349
|
+
this._panelSearchBar = t, t.className = "mint-search-panel-searchbar is-hidden", this._mobileFilterWrap = document.createElement("div"), this._mobileFilterWrap.className = "mint-search-filter-slot", this._mobileFilterWrap.setAttribute("slot", "prepend"), this._panelInput = document.createElement("mint-input"), this._panelInput.setAttribute("type", "search"), this._panelInput.setAttribute("icon", "search"), this._panelInput.setAttribute("aria-label", this.getAttribute("placeholder") || "Search"), this._panelInput.className = "mint-search-input", this._bindInputHandlers(this._panelInput), this._panelInput.appendChild(this._mobileFilterWrap), t.appendChild(this._panelInput), this._customResultsWrap = document.createElement("div"), this._customResultsWrap.className = "mint-search-custom-results is-hidden", this._stateWrap = document.createElement("div"), this._stateWrap.className = "mint-search-state", this._stateWrap.textContent = "Start typing to search", this._stateWrap.setAttribute("role", "status"), this._stateWrap.setAttribute("aria-live", "polite"), this._resultsWrap = document.createElement("div"), this._resultsWrap.className = "mint-search-results", this._resultsId = `mint-search-results-${Math.random().toString(36).slice(2, 10)}`, this._resultsWrap.id = this._resultsId, this._resultsWrap.setAttribute("role", "listbox"), this._resultsWrap.setAttribute("aria-label", "Search results"), this._customResultsWrap.setAttribute("role", "region"), this._customResultsWrap.setAttribute("aria-label", "Search results"), e.appendChild(t), this._panelFiltersWrap = document.createElement("div"), e.appendChild(this._panelFiltersWrap), this._ensurePanelFiltersShell(), e.appendChild(this._customResultsWrap), e.appendChild(this._stateWrap), e.appendChild(this._resultsWrap), this._panel.appendChild(e);
|
|
10749
11350
|
}
|
|
10750
11351
|
this._panel.parentElement !== document.body && document.body.appendChild(this._panel);
|
|
10751
11352
|
let t = this._hasSelectedFilters() ? "" : this._getPlaceholder();
|
|
@@ -10823,10 +11424,10 @@ var qn = class e extends HTMLElement {
|
|
|
10823
11424
|
this._shell && this._shell.classList.toggle("is-collapsed", e), this._panelSearchBar && (this._panelSearchBar.classList.toggle("is-hidden", !e), this._panelSearchBar.classList.toggle("is-collapsed", e));
|
|
10824
11425
|
}
|
|
10825
11426
|
};
|
|
10826
|
-
customElements.get("mint-search") || a("mint-search",
|
|
11427
|
+
customElements.get("mint-search") || a("mint-search", Yn);
|
|
10827
11428
|
//#endregion
|
|
10828
11429
|
//#region src/components/select/NativeSelect.ts
|
|
10829
|
-
var B = "data-mint-native-select-part",
|
|
11430
|
+
var B = "data-mint-native-select-part", Xn = class extends HTMLElement {
|
|
10830
11431
|
static get observedAttributes() {
|
|
10831
11432
|
return [
|
|
10832
11433
|
"name",
|
|
@@ -11087,10 +11688,10 @@ var B = "data-mint-native-select-part", Jn = class extends HTMLElement {
|
|
|
11087
11688
|
n && (n.id = `${e}-info`, t.push(n.id)), r && (r.id = `${e}-error`, t.push(r.id)), t.length ? this._select.setAttribute("aria-describedby", Array.from(new Set(t)).join(" ")) : this._select.removeAttribute("aria-describedby");
|
|
11088
11689
|
}
|
|
11089
11690
|
};
|
|
11090
|
-
customElements.get("mint-native-select") || a("mint-native-select",
|
|
11691
|
+
customElements.get("mint-native-select") || a("mint-native-select", Xn);
|
|
11091
11692
|
//#endregion
|
|
11092
11693
|
//#region src/components/select/Select.ts
|
|
11093
|
-
var V = "data-mint-select-part",
|
|
11694
|
+
var V = "data-mint-select-part", Zn = class extends HTMLElement {
|
|
11094
11695
|
constructor(...e) {
|
|
11095
11696
|
super(...e), this._native = null, this._trigger = null, this._popover = null, this._list = null, this._observer = null, this._syncing = !1, this._typeahead = "", this._typeaheadTimer = null, this._id = `mint-select-${Math.random().toString(36).slice(2, 10)}`;
|
|
11096
11697
|
}
|
|
@@ -11380,10 +11981,10 @@ var V = "data-mint-select-part", Yn = class extends HTMLElement {
|
|
|
11380
11981
|
t && (this._popover?.hasAttribute("open") || this._popover?.open(), t.focus());
|
|
11381
11982
|
}
|
|
11382
11983
|
};
|
|
11383
|
-
customElements.get("mint-select") || a("mint-select",
|
|
11984
|
+
customElements.get("mint-select") || a("mint-select", Zn);
|
|
11384
11985
|
//#endregion
|
|
11385
11986
|
//#region src/components/side-navigation/SideNavigationLink.ts
|
|
11386
|
-
var
|
|
11987
|
+
var Qn = class extends HTMLElement {
|
|
11387
11988
|
constructor(...e) {
|
|
11388
11989
|
super(...e), this._trigger = null, this._submenuContainer = null, this._contentObserver = null, this._renderFrame = null;
|
|
11389
11990
|
}
|
|
@@ -11517,10 +12118,10 @@ var Xn = class extends HTMLElement {
|
|
|
11517
12118
|
this._hasSubmenu() && !this._isSubmenuItem() ? this._buildDropdownLink() : this._buildSimpleLink();
|
|
11518
12119
|
}
|
|
11519
12120
|
};
|
|
11520
|
-
customElements.get("mint-sidenav-link") || a("mint-sidenav-link",
|
|
12121
|
+
customElements.get("mint-sidenav-link") || a("mint-sidenav-link", Qn);
|
|
11521
12122
|
//#endregion
|
|
11522
12123
|
//#region src/components/side-navigation/SideNavigationLinks.ts
|
|
11523
|
-
var
|
|
12124
|
+
var $n = class extends HTMLElement {
|
|
11524
12125
|
constructor(...e) {
|
|
11525
12126
|
super(...e), this._container = null, this._title = null, this._titleLabel = null, this._titleCaret = null, this._titleIsInteractive = null, this._list = null, this._titleClickHandler = null, this._listenerCounts = /* @__PURE__ */ new Map();
|
|
11526
12127
|
}
|
|
@@ -11583,10 +12184,10 @@ var Zn = class extends HTMLElement {
|
|
|
11583
12184
|
});
|
|
11584
12185
|
}
|
|
11585
12186
|
};
|
|
11586
|
-
customElements.get("mint-sidenav-links") || a("mint-sidenav-links",
|
|
12187
|
+
customElements.get("mint-sidenav-links") || a("mint-sidenav-links", $n);
|
|
11587
12188
|
//#endregion
|
|
11588
12189
|
//#region src/components/side-navigation/SideNavigationActionLinks.ts
|
|
11589
|
-
var
|
|
12190
|
+
var er = class extends HTMLElement {
|
|
11590
12191
|
static get observedAttributes() {
|
|
11591
12192
|
return ["separated"];
|
|
11592
12193
|
}
|
|
@@ -11603,10 +12204,10 @@ var Qn = class extends HTMLElement {
|
|
|
11603
12204
|
this.className = this._isSeparated() ? "mint-sidenav-action-links is-separated" : "mint-sidenav-action-links";
|
|
11604
12205
|
}
|
|
11605
12206
|
};
|
|
11606
|
-
customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links",
|
|
12207
|
+
customElements.get("mint-sidenav-action-links") || a("mint-sidenav-action-links", er);
|
|
11607
12208
|
//#endregion
|
|
11608
12209
|
//#region src/components/side-navigation/SideNavigationActionMenu.ts
|
|
11609
|
-
var
|
|
12210
|
+
var tr = class extends HTMLElement {
|
|
11610
12211
|
constructor(...e) {
|
|
11611
12212
|
super(...e), this._wrapper = null, this._trigger = null, this._popover = null, this._triggerId = "", this._contentObserver = null, this._renderFrame = null;
|
|
11612
12213
|
}
|
|
@@ -11673,11 +12274,11 @@ var $n = class extends HTMLElement {
|
|
|
11673
12274
|
}) : a.appendChild(this._createDefaultGroup()), this._popover.appendChild(a), this._wrapper.appendChild(this._trigger), this._wrapper.appendChild(this._popover);
|
|
11674
12275
|
}
|
|
11675
12276
|
};
|
|
11676
|
-
customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu",
|
|
12277
|
+
customElements.get("mint-sidenav-action-menu") || a("mint-sidenav-action-menu", tr);
|
|
11677
12278
|
//#endregion
|
|
11678
12279
|
//#region src/components/side-navigation/SideNavigation.ts
|
|
11679
12280
|
var H = "mint:url-change";
|
|
11680
|
-
function
|
|
12281
|
+
function nr() {
|
|
11681
12282
|
if (window.__mintUrlChangePatched) return;
|
|
11682
12283
|
window.__mintUrlChangePatched = !0;
|
|
11683
12284
|
let e = () => {
|
|
@@ -11691,7 +12292,7 @@ function er() {
|
|
|
11691
12292
|
};
|
|
11692
12293
|
t("pushState"), t("replaceState");
|
|
11693
12294
|
}
|
|
11694
|
-
var
|
|
12295
|
+
var rr = class extends HTMLElement {
|
|
11695
12296
|
constructor(...e) {
|
|
11696
12297
|
super(...e), this._backdrop = null, this._container = null, this._header = null, this._content = null, this._disposeContentFade = null, this._footer = null, this._escapeHandler = null, this._mediaQuery = null, this._mediaListener = null, this._accordionHandler = null, this._urlChangeHandler = null, this._contentObserver = null, this._renderFrame = null, this._onMobileNavNavigateClick = (e) => {
|
|
11697
12298
|
if (this._mediaQuery?.matches) return;
|
|
@@ -11754,7 +12355,7 @@ var tr = class extends HTMLElement {
|
|
|
11754
12355
|
this._accordionHandler &&= (this.removeEventListener("mint-sidenav-accordion", this._accordionHandler), null);
|
|
11755
12356
|
}
|
|
11756
12357
|
_attachUrlChangeListener() {
|
|
11757
|
-
this._urlChangeHandler || (
|
|
12358
|
+
this._urlChangeHandler || (nr(), this._urlChangeHandler = () => {
|
|
11758
12359
|
this._mediaQuery?.matches || this._isOpen() && this.removeAttribute("open");
|
|
11759
12360
|
}, window.addEventListener("popstate", this._urlChangeHandler), window.addEventListener("hashchange", this._urlChangeHandler), window.addEventListener(H, this._urlChangeHandler));
|
|
11760
12361
|
}
|
|
@@ -11817,10 +12418,10 @@ var tr = class extends HTMLElement {
|
|
|
11817
12418
|
this._ensureBackdrop(), this._ensureContainer(), this._syncShell(), this._buildUserHeader(), this._buildContent(), this._buildFooter();
|
|
11818
12419
|
}
|
|
11819
12420
|
};
|
|
11820
|
-
customElements.get("mint-side-navigation") || a("mint-side-navigation",
|
|
12421
|
+
customElements.get("mint-side-navigation") || a("mint-side-navigation", rr);
|
|
11821
12422
|
//#endregion
|
|
11822
12423
|
//#region src/components/side-navigation/index.ts
|
|
11823
|
-
var
|
|
12424
|
+
var ir = rr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", ar = class e extends HTMLElement {
|
|
11824
12425
|
static get observedAttributes() {
|
|
11825
12426
|
return [
|
|
11826
12427
|
"direction",
|
|
@@ -12237,10 +12838,10 @@ var nr = tr, U = "mint-sortable-placeholder", W = "mint-sortable-dragging", rr =
|
|
|
12237
12838
|
this._placeholder?.remove(), this._placeholder = null, this._dragEl = null, this._pointerId = null, this._restoreAfter = null, this._originListRoot = null, this._originNextSibling = null, this._dropList = null, this._dropRejected = !1;
|
|
12238
12839
|
}
|
|
12239
12840
|
};
|
|
12240
|
-
customElements.get("mint-sortable") || a("mint-sortable",
|
|
12841
|
+
customElements.get("mint-sortable") || a("mint-sortable", ar);
|
|
12241
12842
|
//#endregion
|
|
12242
12843
|
//#region src/components/tabs/Tab.ts
|
|
12243
|
-
var
|
|
12844
|
+
var or = class extends HTMLElement {
|
|
12244
12845
|
static get observedAttributes() {
|
|
12245
12846
|
return [
|
|
12246
12847
|
"active",
|
|
@@ -12299,10 +12900,10 @@ var ir = class extends HTMLElement {
|
|
|
12299
12900
|
})));
|
|
12300
12901
|
}
|
|
12301
12902
|
};
|
|
12302
|
-
customElements.get("mint-tab") || a("mint-tab",
|
|
12903
|
+
customElements.get("mint-tab") || a("mint-tab", or);
|
|
12303
12904
|
//#endregion
|
|
12304
12905
|
//#region src/components/tabs/TabList.ts
|
|
12305
|
-
var
|
|
12906
|
+
var sr = class extends HTMLElement {
|
|
12306
12907
|
static get observedAttributes() {
|
|
12307
12908
|
return ["position"];
|
|
12308
12909
|
}
|
|
@@ -12322,10 +12923,10 @@ var ar = class extends HTMLElement {
|
|
|
12322
12923
|
this.setAttribute("role", "tablist"), !this.hasAttribute("aria-label") && !this.hasAttribute("aria-labelledby") && this.setAttribute("aria-label", "Tabs"), this.setAttribute("aria-orientation", this.getPosition() === "top" ? "horizontal" : "vertical");
|
|
12323
12924
|
}
|
|
12324
12925
|
};
|
|
12325
|
-
customElements.get("mint-tab-list") || a("mint-tab-list",
|
|
12926
|
+
customElements.get("mint-tab-list") || a("mint-tab-list", sr);
|
|
12326
12927
|
//#endregion
|
|
12327
12928
|
//#region src/components/tabs/TabContent.ts
|
|
12328
|
-
var
|
|
12929
|
+
var cr = class extends HTMLElement {
|
|
12329
12930
|
static get observedAttributes() {
|
|
12330
12931
|
return ["id"];
|
|
12331
12932
|
}
|
|
@@ -12363,10 +12964,10 @@ var or = class extends HTMLElement {
|
|
|
12363
12964
|
this.setAttribute("role", "tabpanel"), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "0");
|
|
12364
12965
|
}
|
|
12365
12966
|
};
|
|
12366
|
-
customElements.get("mint-tab-content") || a("mint-tab-content",
|
|
12967
|
+
customElements.get("mint-tab-content") || a("mint-tab-content", cr);
|
|
12367
12968
|
//#endregion
|
|
12368
12969
|
//#region src/components/tabs/Tabs.ts
|
|
12369
|
-
var
|
|
12970
|
+
var lr = class e extends HTMLElement {
|
|
12370
12971
|
static {
|
|
12371
12972
|
this._id = 0;
|
|
12372
12973
|
}
|
|
@@ -12472,10 +13073,10 @@ var sr = class e extends HTMLElement {
|
|
|
12472
13073
|
});
|
|
12473
13074
|
}
|
|
12474
13075
|
};
|
|
12475
|
-
customElements.get("mint-tabs") || a("mint-tabs",
|
|
13076
|
+
customElements.get("mint-tabs") || a("mint-tabs", lr);
|
|
12476
13077
|
//#endregion
|
|
12477
13078
|
//#region src/components/tags/Tags.ts
|
|
12478
|
-
var
|
|
13079
|
+
var ur = class extends HTMLElement {
|
|
12479
13080
|
constructor(...e) {
|
|
12480
13081
|
super(...e), this._container = null, this._chipsWrap = null, this._input = null, this._tags = [], this._predefinedTags = [], this._placeholder = "Add tag", this._predefinedPopoverOpenListenersAttached = !1, this._predefinedBlurCloseTimer = null, this._suppressNextPredefinedBlurClose = !1, this._dragIndex = null, this._dragChip = null, this._isPointerDragging = !1, this._pointerMoveHandler = null, this._pointerUpHandler = null, this._containerFocusRingListeners = !1, this._predefinedFieldResizeObserver = null, this._predefinedPopoverBodyEl = null;
|
|
12481
13082
|
}
|
|
@@ -12782,457 +13383,116 @@ var cr = class extends HTMLElement {
|
|
|
12782
13383
|
}
|
|
12783
13384
|
_focusLastChip() {
|
|
12784
13385
|
let e = this._chipsWrap?.querySelectorAll("mint-chip");
|
|
12785
|
-
e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
|
|
12786
|
-
}
|
|
12787
|
-
_focusInput() {
|
|
12788
|
-
setTimeout(() => {
|
|
12789
|
-
this._input?.focus({ preventScroll: !0 });
|
|
12790
|
-
}, 10);
|
|
12791
|
-
}
|
|
12792
|
-
_wireInputBackspace() {
|
|
12793
|
-
this._input && this._input.addEventListener("keydown", (e) => {
|
|
12794
|
-
e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
|
|
12795
|
-
});
|
|
12796
|
-
}
|
|
12797
|
-
_setupChipEvents(e, t) {
|
|
12798
|
-
e.tabIndex = 0, e.addEventListener("keydown", (e) => {
|
|
12799
|
-
(e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
|
|
12800
|
-
});
|
|
12801
|
-
}
|
|
12802
|
-
_onContainerPointerDown(e) {
|
|
12803
|
-
if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
|
|
12804
|
-
let t = e.composedPath();
|
|
12805
|
-
if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
|
|
12806
|
-
this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
|
|
12807
|
-
try {
|
|
12808
|
-
this._input.focus({ preventScroll: !0 });
|
|
12809
|
-
} catch {}
|
|
12810
|
-
this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
|
|
12811
|
-
}
|
|
12812
|
-
}
|
|
12813
|
-
_onDragStart(e, t) {
|
|
12814
|
-
this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
|
|
12815
|
-
}
|
|
12816
|
-
_reorderTags(e, t) {
|
|
12817
|
-
if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
|
|
12818
|
-
let n = [...this._tags], [r] = n.splice(e, 1);
|
|
12819
|
-
n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
|
|
12820
|
-
}
|
|
12821
|
-
_onDragOverInput(e) {
|
|
12822
|
-
this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
|
|
12823
|
-
}
|
|
12824
|
-
_onDragOverChip(e, t) {
|
|
12825
|
-
if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
|
|
12826
|
-
let n = t.getBoundingClientRect();
|
|
12827
|
-
if (e.clientX < n.left + n.width * .5) {
|
|
12828
|
-
if (this._dragChip.nextSibling === t) return;
|
|
12829
|
-
this._chipsWrap.insertBefore(this._dragChip, t);
|
|
12830
|
-
} else {
|
|
12831
|
-
if (t.nextSibling === this._dragChip) return;
|
|
12832
|
-
let e = t.nextSibling;
|
|
12833
|
-
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
12834
|
-
}
|
|
12835
|
-
}
|
|
12836
|
-
_onDrop(e) {
|
|
12837
|
-
this.hasAttribute("sortable") && e.preventDefault();
|
|
12838
|
-
}
|
|
12839
|
-
_onDragEnd() {
|
|
12840
|
-
this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
12841
|
-
}
|
|
12842
|
-
_syncOrderFromDom() {
|
|
12843
|
-
if (!this._chipsWrap) return;
|
|
12844
|
-
let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
|
|
12845
|
-
if (e.length === 0) return;
|
|
12846
|
-
let t = [];
|
|
12847
|
-
e.forEach((e) => {
|
|
12848
|
-
let n = e.dataset.value;
|
|
12849
|
-
if (!n) return;
|
|
12850
|
-
let r = this._tags.find((e) => e.value === n);
|
|
12851
|
-
r && t.push(r);
|
|
12852
|
-
}), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
|
|
12853
|
-
}
|
|
12854
|
-
_onPointerDown(e, t) {
|
|
12855
|
-
if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
|
|
12856
|
-
this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
|
|
12857
|
-
try {
|
|
12858
|
-
t.setPointerCapture(e.pointerId);
|
|
12859
|
-
} catch {}
|
|
12860
|
-
t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
|
|
12861
|
-
}
|
|
12862
|
-
}
|
|
12863
|
-
_onPointerMove(e) {
|
|
12864
|
-
if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
|
|
12865
|
-
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
12866
|
-
if (!t) return;
|
|
12867
|
-
let n = t.closest("mint-chip");
|
|
12868
|
-
if (n && n !== this._dragChip) {
|
|
12869
|
-
let t = n.getBoundingClientRect();
|
|
12870
|
-
if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
|
|
12871
|
-
else if (n.nextSibling !== this._dragChip) {
|
|
12872
|
-
let e = n.nextSibling;
|
|
12873
|
-
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
12874
|
-
}
|
|
12875
|
-
return;
|
|
12876
|
-
}
|
|
12877
|
-
this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
|
|
12878
|
-
}
|
|
12879
|
-
_onPointerUp(e) {
|
|
12880
|
-
if (this._isPointerDragging) {
|
|
12881
|
-
if (this._isPointerDragging = !1, this._dragChip) {
|
|
12882
|
-
try {
|
|
12883
|
-
this._dragChip.releasePointerCapture(e.pointerId);
|
|
12884
|
-
} catch {}
|
|
12885
|
-
this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
|
|
12886
|
-
}
|
|
12887
|
-
this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
12888
|
-
}
|
|
12889
|
-
}
|
|
12890
|
-
};
|
|
12891
|
-
customElements.get("mint-tags") || a("mint-tags", cr);
|
|
12892
|
-
//#endregion
|
|
12893
|
-
//#region src/components/time-picker/TimePicker.ts
|
|
12894
|
-
var lr = class extends HTMLElement {
|
|
12895
|
-
constructor(...e) {
|
|
12896
|
-
super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
|
|
12897
|
-
hour: 9,
|
|
12898
|
-
minute: 0,
|
|
12899
|
-
second: 0,
|
|
12900
|
-
meridiem: "AM"
|
|
12901
|
-
}, this._rangeStart = {
|
|
12902
|
-
hour: 9,
|
|
12903
|
-
minute: 0,
|
|
12904
|
-
second: 0,
|
|
12905
|
-
meridiem: "AM"
|
|
12906
|
-
}, this._rangeEnd = {
|
|
12907
|
-
hour: 5,
|
|
12908
|
-
minute: 0,
|
|
12909
|
-
second: 0,
|
|
12910
|
-
meridiem: "PM"
|
|
12911
|
-
}, this._invalidFromInput = !1;
|
|
12912
|
-
}
|
|
12913
|
-
static get observedAttributes() {
|
|
12914
|
-
return [
|
|
12915
|
-
"value",
|
|
12916
|
-
"label",
|
|
12917
|
-
"info",
|
|
12918
|
-
"disabled",
|
|
12919
|
-
"id",
|
|
12920
|
-
"name",
|
|
12921
|
-
"required",
|
|
12922
|
-
"readonly",
|
|
12923
|
-
"range",
|
|
12924
|
-
"hours",
|
|
12925
|
-
"minutes",
|
|
12926
|
-
"seconds",
|
|
12927
|
-
"error",
|
|
12928
|
-
"error-message"
|
|
12929
|
-
];
|
|
12930
|
-
}
|
|
12931
|
-
connectedCallback() {
|
|
12932
|
-
this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
|
|
12933
|
-
}
|
|
12934
|
-
disconnectedCallback() {
|
|
12935
|
-
this._popoverObserver &&= (this._popoverObserver.disconnect(), null);
|
|
12936
|
-
}
|
|
12937
|
-
attributeChangedCallback(e, t, n) {
|
|
12938
|
-
if (t !== n) {
|
|
12939
|
-
if (e === "value") {
|
|
12940
|
-
if (this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue(), this._popover) {
|
|
12941
|
-
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
12942
|
-
e && this._buildPopoverContent(e);
|
|
12943
|
-
}
|
|
12944
|
-
return;
|
|
12945
|
-
}
|
|
12946
|
-
e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
|
|
12947
|
-
}
|
|
12948
|
-
}
|
|
12949
|
-
get value() {
|
|
12950
|
-
return this.getValue();
|
|
12951
|
-
}
|
|
12952
|
-
set value(e) {
|
|
12953
|
-
this.setValue(e || "");
|
|
12954
|
-
}
|
|
12955
|
-
getValue() {
|
|
12956
|
-
return this.getAttribute("value") || "";
|
|
12957
|
-
}
|
|
12958
|
-
setValue(e) {
|
|
12959
|
-
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
12960
|
-
}
|
|
12961
|
-
isRange() {
|
|
12962
|
-
return this.getAttribute("range") === "true";
|
|
12963
|
-
}
|
|
12964
|
-
isHoursEnabled() {
|
|
12965
|
-
let e = this.getAttribute("hours");
|
|
12966
|
-
return e === null ? !0 : e !== "false";
|
|
12967
|
-
}
|
|
12968
|
-
isMinutesEnabled() {
|
|
12969
|
-
let e = this.getAttribute("minutes");
|
|
12970
|
-
return e === null ? !0 : e !== "false";
|
|
12971
|
-
}
|
|
12972
|
-
isSecondsEnabled() {
|
|
12973
|
-
let e = this.getAttribute("seconds");
|
|
12974
|
-
return e === null ? !1 : e !== "false";
|
|
12975
|
-
}
|
|
12976
|
-
isDisabled() {
|
|
12977
|
-
return this.getAttribute("disabled") === "true";
|
|
12978
|
-
}
|
|
12979
|
-
isReadonly() {
|
|
12980
|
-
return this.getAttribute("readonly") === "true";
|
|
12981
|
-
}
|
|
12982
|
-
isRequired() {
|
|
12983
|
-
return this.getAttribute("required") === "true";
|
|
12984
|
-
}
|
|
12985
|
-
hasExternalError() {
|
|
12986
|
-
return this.getAttribute("error") === "true";
|
|
12987
|
-
}
|
|
12988
|
-
getExternalErrorMessage() {
|
|
12989
|
-
return this.getAttribute("error-message") || "";
|
|
12990
|
-
}
|
|
12991
|
-
getLabel() {
|
|
12992
|
-
return this.getAttribute("label") || "";
|
|
12993
|
-
}
|
|
12994
|
-
getInfo() {
|
|
12995
|
-
return this.getAttribute("info") || "";
|
|
12996
|
-
}
|
|
12997
|
-
getName() {
|
|
12998
|
-
return this.getAttribute("name") || "";
|
|
12999
|
-
}
|
|
13000
|
-
_getEffectiveError() {
|
|
13001
|
-
return {
|
|
13002
|
-
hasError: this.hasExternalError(),
|
|
13003
|
-
message: this.getExternalErrorMessage()
|
|
13004
|
-
};
|
|
13005
|
-
}
|
|
13006
|
-
_formatParts(e) {
|
|
13007
|
-
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
|
|
13008
|
-
return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
|
|
13009
|
-
}
|
|
13010
|
-
_to24Hour(e) {
|
|
13011
|
-
let t = e.hour % 12;
|
|
13012
|
-
return e.meridiem === "PM" && (t += 12), {
|
|
13013
|
-
hour: t,
|
|
13014
|
-
minute: e.minute,
|
|
13015
|
-
second: e.second
|
|
13016
|
-
};
|
|
13017
|
-
}
|
|
13018
|
-
_formatParts24(e) {
|
|
13019
|
-
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
|
|
13020
|
-
return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
|
|
13021
|
-
}
|
|
13022
|
-
_getDisplayValue() {
|
|
13023
|
-
return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
|
|
13024
|
-
}
|
|
13025
|
-
_getOutputValue() {
|
|
13026
|
-
return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
|
|
13027
|
-
}
|
|
13028
|
-
_getExpectedFormat() {
|
|
13029
|
-
let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
|
|
13030
|
-
e && r.push("h"), t && r.push("mm"), n && r.push("ss");
|
|
13031
|
-
let i = e ? `${r.join(":")} am/pm` : r.join(":");
|
|
13032
|
-
return this.isRange() ? `${i} - ${i}` : i;
|
|
13386
|
+
e && e.length > 0 && e[e.length - 1].focus({ preventScroll: !0 });
|
|
13033
13387
|
}
|
|
13034
|
-
|
|
13035
|
-
|
|
13388
|
+
_focusInput() {
|
|
13389
|
+
setTimeout(() => {
|
|
13390
|
+
this._input?.focus({ preventScroll: !0 });
|
|
13391
|
+
}, 10);
|
|
13036
13392
|
}
|
|
13037
|
-
|
|
13038
|
-
this.
|
|
13393
|
+
_wireInputBackspace() {
|
|
13394
|
+
this._input && this._input.addEventListener("keydown", (e) => {
|
|
13395
|
+
e.key === "Backspace" && this._input?.value === "" && (e.preventDefault(), this._focusLastChip());
|
|
13396
|
+
});
|
|
13039
13397
|
}
|
|
13040
|
-
|
|
13041
|
-
|
|
13042
|
-
|
|
13043
|
-
|
|
13044
|
-
composed: !0
|
|
13045
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
13398
|
+
_setupChipEvents(e, t) {
|
|
13399
|
+
e.tabIndex = 0, e.addEventListener("keydown", (e) => {
|
|
13400
|
+
(e.key === "Backspace" || e.key === "Delete") && t.dismissable && (e.preventDefault(), this._removeTag(t.value), this._focusInput());
|
|
13401
|
+
});
|
|
13046
13402
|
}
|
|
13047
|
-
|
|
13048
|
-
|
|
13049
|
-
|
|
13050
|
-
|
|
13051
|
-
|
|
13052
|
-
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
second: o,
|
|
13057
|
-
meridiem: s
|
|
13058
|
-
};
|
|
13403
|
+
_onContainerPointerDown(e) {
|
|
13404
|
+
if (!this._input || !this._input.isConnected || this._input.parentElement !== this._chipsWrap || e.button !== 0 || e.defaultPrevented) return;
|
|
13405
|
+
let t = e.composedPath();
|
|
13406
|
+
if (!t.some((e) => e === this._input) && !t.some((e) => e instanceof Element && e.closest("mint-chip") != null)) {
|
|
13407
|
+
this._predefinedBlurCloseTimer !== null && (window.clearTimeout(this._predefinedBlurCloseTimer), this._predefinedBlurCloseTimer = null), this._suppressNextPredefinedBlurClose = !0, e.preventDefault();
|
|
13408
|
+
try {
|
|
13409
|
+
this._input.focus({ preventScroll: !0 });
|
|
13410
|
+
} catch {}
|
|
13411
|
+
this._predefinedTags.length > 0 && this._getPredefinedPopoverEl()?.setAttribute("open", "true");
|
|
13059
13412
|
}
|
|
13060
|
-
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
13061
|
-
if (!a) return null;
|
|
13062
|
-
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
13063
|
-
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
13064
|
-
hour: 12,
|
|
13065
|
-
minute: o,
|
|
13066
|
-
second: s,
|
|
13067
|
-
meridiem: "AM"
|
|
13068
|
-
};
|
|
13069
13413
|
}
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
if (t) {
|
|
13073
|
-
let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
|
|
13074
|
-
if (!e) return null;
|
|
13075
|
-
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
|
|
13076
|
-
if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
|
|
13077
|
-
let s = t >= 12 ? "PM" : "AM";
|
|
13078
|
-
return {
|
|
13079
|
-
hour: t % 12 == 0 ? 12 : t % 12,
|
|
13080
|
-
minute: a,
|
|
13081
|
-
second: o,
|
|
13082
|
-
meridiem: s
|
|
13083
|
-
};
|
|
13084
|
-
}
|
|
13085
|
-
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
13086
|
-
if (!a) return null;
|
|
13087
|
-
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
13088
|
-
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
13089
|
-
hour: 12,
|
|
13090
|
-
minute: o,
|
|
13091
|
-
second: s,
|
|
13092
|
-
meridiem: "AM"
|
|
13093
|
-
};
|
|
13414
|
+
_onDragStart(e, t) {
|
|
13415
|
+
this.hasAttribute("sortable") && (this._dragChip = t, this._dragIndex = Number(t.dataset.index), e.dataTransfer?.setData("text/plain", t.dataset.index || ""), e.dataTransfer && (e.dataTransfer.effectAllowed = "move", e.dataTransfer.dropEffect = "move"), t.classList.add("mint-tags-chip-dragging"));
|
|
13094
13416
|
}
|
|
13095
|
-
|
|
13096
|
-
if (
|
|
13097
|
-
|
|
13098
|
-
|
|
13099
|
-
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
13100
|
-
}
|
|
13101
|
-
let t = this._parseSingleOutput24(e);
|
|
13102
|
-
return t ? (this._single = t, !0) : !1;
|
|
13417
|
+
_reorderTags(e, t) {
|
|
13418
|
+
if (e < 0 || t < 0 || e >= this._tags.length || t >= this._tags.length) return;
|
|
13419
|
+
let n = [...this._tags], [r] = n.splice(e, 1);
|
|
13420
|
+
n.splice(t, 0, r), this._tags = n, this._syncAttr(), this._renderChips(), this._emitChange();
|
|
13103
13421
|
}
|
|
13104
|
-
|
|
13105
|
-
|
|
13106
|
-
if (this.isRange()) {
|
|
13107
|
-
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
|
|
13108
|
-
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
13109
|
-
}
|
|
13110
|
-
let t = this._parseSingle(e);
|
|
13111
|
-
return t ? (this._single = t, !0) : !1;
|
|
13422
|
+
_onDragOverInput(e) {
|
|
13423
|
+
this.hasAttribute("sortable") && (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), this._dragChip && this._chipsWrap && this._input && this._chipsWrap.insertBefore(this._dragChip, this._input));
|
|
13112
13424
|
}
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
|
|
13116
|
-
|
|
13117
|
-
return;
|
|
13118
|
-
|
|
13119
|
-
|
|
13120
|
-
|
|
13121
|
-
|
|
13122
|
-
|
|
13123
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
13124
|
-
return;
|
|
13425
|
+
_onDragOverChip(e, t) {
|
|
13426
|
+
if (!this.hasAttribute("sortable") || (e.preventDefault(), e.dataTransfer && (e.dataTransfer.dropEffect = "move"), !this._dragChip || !this._chipsWrap) || t === this._dragChip) return;
|
|
13427
|
+
let n = t.getBoundingClientRect();
|
|
13428
|
+
if (e.clientX < n.left + n.width * .5) {
|
|
13429
|
+
if (this._dragChip.nextSibling === t) return;
|
|
13430
|
+
this._chipsWrap.insertBefore(this._dragChip, t);
|
|
13431
|
+
} else {
|
|
13432
|
+
if (t.nextSibling === this._dragChip) return;
|
|
13433
|
+
let e = t.nextSibling;
|
|
13434
|
+
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
13125
13435
|
}
|
|
13126
|
-
this._invalidFromInput = !1;
|
|
13127
|
-
let n = this._getOutputValue();
|
|
13128
|
-
this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
13129
|
-
bubbles: !0,
|
|
13130
|
-
composed: !0
|
|
13131
|
-
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
13132
|
-
}
|
|
13133
|
-
_buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
|
|
13134
|
-
let o = document.createElement("div");
|
|
13135
|
-
return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
|
|
13136
|
-
let r = document.createElement("button");
|
|
13137
|
-
r.type = "button";
|
|
13138
|
-
let i = e === t;
|
|
13139
|
-
r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
|
|
13140
|
-
}), o;
|
|
13141
13436
|
}
|
|
13142
|
-
|
|
13143
|
-
|
|
13144
|
-
if (!n) return;
|
|
13145
|
-
let r = n.offsetTop - (e.clientHeight / 2 - n.clientHeight / 2) - t;
|
|
13146
|
-
e.scrollTop = Math.max(0, r);
|
|
13437
|
+
_onDrop(e) {
|
|
13438
|
+
this.hasAttribute("sortable") && e.preventDefault();
|
|
13147
13439
|
}
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
13151
|
-
if (!e) return;
|
|
13152
|
-
let t = Array.from(e.querySelectorAll(".mint-time-picker-column")), n = this.isRange() ? 20 : 0;
|
|
13153
|
-
t.forEach((e) => this._centerSelectedInColumn(e, n));
|
|
13440
|
+
_onDragEnd() {
|
|
13441
|
+
this._dragChip && this._dragChip.classList.remove("mint-tags-chip-dragging"), this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
13154
13442
|
}
|
|
13155
|
-
|
|
13156
|
-
|
|
13157
|
-
|
|
13158
|
-
|
|
13159
|
-
|
|
13160
|
-
|
|
13161
|
-
|
|
13162
|
-
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
}));
|
|
13443
|
+
_syncOrderFromDom() {
|
|
13444
|
+
if (!this._chipsWrap) return;
|
|
13445
|
+
let e = Array.from(this._chipsWrap.querySelectorAll("mint-chip"));
|
|
13446
|
+
if (e.length === 0) return;
|
|
13447
|
+
let t = [];
|
|
13448
|
+
e.forEach((e) => {
|
|
13449
|
+
let n = e.dataset.value;
|
|
13450
|
+
if (!n) return;
|
|
13451
|
+
let r = this._tags.find((e) => e.value === n);
|
|
13452
|
+
r && t.push(r);
|
|
13453
|
+
}), t.length === this._tags.length && (this._tags = t, this._syncAttr(), this._renderChips(), this._emitChange());
|
|
13166
13454
|
}
|
|
13167
|
-
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13172
|
-
|
|
13173
|
-
|
|
13174
|
-
|
|
13175
|
-
});
|
|
13176
|
-
}, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
|
|
13177
|
-
n({
|
|
13178
|
-
...t,
|
|
13179
|
-
minute: Number(e)
|
|
13180
|
-
});
|
|
13181
|
-
}, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
|
|
13182
|
-
n({
|
|
13183
|
-
...t,
|
|
13184
|
-
second: Number(e)
|
|
13185
|
-
});
|
|
13186
|
-
}, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
|
|
13187
|
-
n({
|
|
13188
|
-
...t,
|
|
13189
|
-
meridiem: e
|
|
13190
|
-
});
|
|
13191
|
-
}, !0, "compact", "Meridiem")), f.forEach((e, t) => {
|
|
13192
|
-
t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
|
|
13193
|
-
}), e.appendChild(o);
|
|
13455
|
+
_onPointerDown(e, t) {
|
|
13456
|
+
if (this.hasAttribute("sortable") && e.pointerType !== "mouse") {
|
|
13457
|
+
this._isPointerDragging = !0, this._dragChip = t, this._dragIndex = Number(t.dataset.index);
|
|
13458
|
+
try {
|
|
13459
|
+
t.setPointerCapture(e.pointerId);
|
|
13460
|
+
} catch {}
|
|
13461
|
+
t.classList.add("mint-tags-chip-dragging", "mint-tags-chip-no-select"), e.preventDefault();
|
|
13462
|
+
}
|
|
13194
13463
|
}
|
|
13195
|
-
|
|
13196
|
-
if (
|
|
13197
|
-
|
|
13198
|
-
|
|
13199
|
-
|
|
13464
|
+
_onPointerMove(e) {
|
|
13465
|
+
if (!this._isPointerDragging || !this._dragChip || !this._chipsWrap || e.pointerType === "mouse") return;
|
|
13466
|
+
let t = document.elementFromPoint(e.clientX, e.clientY);
|
|
13467
|
+
if (!t) return;
|
|
13468
|
+
let n = t.closest("mint-chip");
|
|
13469
|
+
if (n && n !== this._dragChip) {
|
|
13470
|
+
let t = n.getBoundingClientRect();
|
|
13471
|
+
if (e.clientX < t.left + t.width * .5) this._dragChip.nextSibling !== n && this._chipsWrap.insertBefore(this._dragChip, n);
|
|
13472
|
+
else if (n.nextSibling !== this._dragChip) {
|
|
13473
|
+
let e = n.nextSibling;
|
|
13474
|
+
e ? this._chipsWrap.insertBefore(this._dragChip, e) : this._chipsWrap.appendChild(this._dragChip);
|
|
13475
|
+
}
|
|
13200
13476
|
return;
|
|
13201
13477
|
}
|
|
13202
|
-
|
|
13203
|
-
t.className = "mint-time-picker-range";
|
|
13204
|
-
let n = document.createElement("div"), r = document.createElement("mint-text");
|
|
13205
|
-
r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
|
|
13206
|
-
this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
13207
|
-
});
|
|
13208
|
-
let i = document.createElement("div"), a = document.createElement("mint-text");
|
|
13209
|
-
a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
|
|
13210
|
-
this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
13211
|
-
}), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
|
|
13212
|
-
this._centerAllColumnsInPopoverBody();
|
|
13213
|
-
});
|
|
13478
|
+
this._input && t.closest("input") === this._input && this._chipsWrap.insertBefore(this._dragChip, this._input);
|
|
13214
13479
|
}
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
let r = n.target;
|
|
13226
|
-
this._handleTypedValue((r?.value || "").toString());
|
|
13227
|
-
}, !0), r.appendChild(this._inputEl), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput(), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false");
|
|
13228
|
-
let i = document.createElement("div");
|
|
13229
|
-
i.setAttribute("data-mint-time-picker-body", "true"), i.className = "mint-time-picker-popover", this._buildPopoverContent(i), this._popover.appendChild(i), r.appendChild(this._popover), this._setupPopoverOpenObserver(), this.appendChild(r);
|
|
13480
|
+
_onPointerUp(e) {
|
|
13481
|
+
if (this._isPointerDragging) {
|
|
13482
|
+
if (this._isPointerDragging = !1, this._dragChip) {
|
|
13483
|
+
try {
|
|
13484
|
+
this._dragChip.releasePointerCapture(e.pointerId);
|
|
13485
|
+
} catch {}
|
|
13486
|
+
this._dragChip.classList.remove("mint-tags-chip-dragging", "mint-tags-chip-no-select");
|
|
13487
|
+
}
|
|
13488
|
+
this._syncOrderFromDom(), this._dragChip = null, this._dragIndex = null;
|
|
13489
|
+
}
|
|
13230
13490
|
}
|
|
13231
13491
|
};
|
|
13232
|
-
customElements.get("mint-
|
|
13492
|
+
customElements.get("mint-tags") || a("mint-tags", ur);
|
|
13233
13493
|
//#endregion
|
|
13234
13494
|
//#region src/components/toast/Toast.ts
|
|
13235
|
-
var
|
|
13495
|
+
var dr = class extends HTMLElement {
|
|
13236
13496
|
constructor(...e) {
|
|
13237
13497
|
super(...e), this._messageEl = null, this._hideTimer = null, this._hideResolve = null, this._bottomNavObserver = null, this._bodyObserver = null;
|
|
13238
13498
|
}
|
|
@@ -13309,11 +13569,11 @@ var ur = class extends HTMLElement {
|
|
|
13309
13569
|
this.classList.toggle("mint-toast-is-open", e), this._messageEl ||= (this.innerHTML = "<div class=\"mint-toast-surface\">\n <span data-mint-toast-message></span>\n </div>", this.querySelector("[data-mint-toast-message]")), this._messageEl && (this._messageEl.textContent = t);
|
|
13310
13570
|
}
|
|
13311
13571
|
};
|
|
13312
|
-
customElements.get("mint-toast") || a("mint-toast",
|
|
13572
|
+
customElements.get("mint-toast") || a("mint-toast", dr);
|
|
13313
13573
|
//#endregion
|
|
13314
13574
|
//#region src/components/toast/ToastApi.ts
|
|
13315
|
-
var
|
|
13316
|
-
function
|
|
13575
|
+
var fr = 2200, pr = [], G = !1, K = null;
|
|
13576
|
+
function mr() {
|
|
13317
13577
|
return typeof document > "u" || document.body ? Promise.resolve() : new Promise((e) => {
|
|
13318
13578
|
if (typeof window > "u") {
|
|
13319
13579
|
e();
|
|
@@ -13324,25 +13584,25 @@ function pr() {
|
|
|
13324
13584
|
}, { once: !0 });
|
|
13325
13585
|
});
|
|
13326
13586
|
}
|
|
13327
|
-
async function
|
|
13328
|
-
if (await
|
|
13587
|
+
async function hr() {
|
|
13588
|
+
if (await mr(), typeof document > "u") throw Error("mintui.toast is only available in browser environments.");
|
|
13329
13589
|
let e = document.querySelector("mint-toast[data-mint-toast-root=\"true\"]");
|
|
13330
13590
|
if (e) return e;
|
|
13331
13591
|
let t = document.createElement("mint-toast");
|
|
13332
13592
|
return t.setAttribute("data-mint-toast-root", "true"), document.body.appendChild(t), t;
|
|
13333
13593
|
}
|
|
13334
|
-
async function
|
|
13594
|
+
async function gr() {
|
|
13335
13595
|
if (!G) {
|
|
13336
13596
|
G = !0;
|
|
13337
13597
|
try {
|
|
13338
|
-
for (;
|
|
13339
|
-
let e =
|
|
13598
|
+
for (; pr.length > 0;) {
|
|
13599
|
+
let e = pr.shift();
|
|
13340
13600
|
if (!e) continue;
|
|
13341
13601
|
let t = e.message.trim().slice(0, 120);
|
|
13342
13602
|
if (!t) continue;
|
|
13343
|
-
let n = await
|
|
13603
|
+
let n = await hr();
|
|
13344
13604
|
K = n;
|
|
13345
|
-
let r = e.options?.duration ??
|
|
13605
|
+
let r = e.options?.duration ?? fr, i = e.options?.type ?? "neutral";
|
|
13346
13606
|
await n.showToast(t, r, i);
|
|
13347
13607
|
}
|
|
13348
13608
|
} finally {
|
|
@@ -13350,21 +13610,21 @@ async function hr() {
|
|
|
13350
13610
|
}
|
|
13351
13611
|
}
|
|
13352
13612
|
}
|
|
13353
|
-
function
|
|
13354
|
-
typeof window > "u" || (
|
|
13613
|
+
function _r(e, t) {
|
|
13614
|
+
typeof window > "u" || (pr.push({
|
|
13355
13615
|
message: e,
|
|
13356
13616
|
options: t
|
|
13357
|
-
}), G && K && K.hideToast(),
|
|
13617
|
+
}), G && K && K.hideToast(), gr());
|
|
13358
13618
|
}
|
|
13359
|
-
var
|
|
13619
|
+
var vr = { toast: _r };
|
|
13360
13620
|
if (typeof window < "u") {
|
|
13361
13621
|
let e = window.mintui || {};
|
|
13362
|
-
e.toast =
|
|
13622
|
+
e.toast = _r, window.mintui = e;
|
|
13363
13623
|
}
|
|
13364
13624
|
//#endregion
|
|
13365
13625
|
//#region src/components/tree/tree-utils.js
|
|
13366
13626
|
function q(e = []) {
|
|
13367
|
-
|
|
13627
|
+
xr(e);
|
|
13368
13628
|
let t = (e) => e.map((e) => ({
|
|
13369
13629
|
...e,
|
|
13370
13630
|
children: Array.isArray(e.children) ? t(e.children) : []
|
|
@@ -13393,11 +13653,11 @@ function Y(e, t, n = null) {
|
|
|
13393
13653
|
}
|
|
13394
13654
|
return null;
|
|
13395
13655
|
}
|
|
13396
|
-
function
|
|
13656
|
+
function yr(e, t, n = 0) {
|
|
13397
13657
|
let r = String(t);
|
|
13398
13658
|
for (let t of e) {
|
|
13399
13659
|
if (String(t.id) === r) return n;
|
|
13400
|
-
let e =
|
|
13660
|
+
let e = yr(t.children || [], r, n + 1);
|
|
13401
13661
|
if (e >= 0) return e;
|
|
13402
13662
|
}
|
|
13403
13663
|
return -1;
|
|
@@ -13406,10 +13666,10 @@ function X(e) {
|
|
|
13406
13666
|
let t = Array.isArray(e?.children) ? e.children : [];
|
|
13407
13667
|
return t.length ? 1 + Math.max(...t.map(X)) : 1;
|
|
13408
13668
|
}
|
|
13409
|
-
function
|
|
13410
|
-
return String(e.id) === String(t) ? !0 : (e.children || []).some((e) =>
|
|
13669
|
+
function br(e, t) {
|
|
13670
|
+
return String(e.id) === String(t) ? !0 : (e.children || []).some((e) => br(e, t));
|
|
13411
13671
|
}
|
|
13412
|
-
function
|
|
13672
|
+
function xr(e) {
|
|
13413
13673
|
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
13414
13674
|
for (let r of e) {
|
|
13415
13675
|
if (r.id === null || r.id === void 0 || String(r.id) === "") throw Error("Every tree item must have a non-empty identifier.");
|
|
@@ -13420,13 +13680,13 @@ function br(e) {
|
|
|
13420
13680
|
};
|
|
13421
13681
|
n(e);
|
|
13422
13682
|
}
|
|
13423
|
-
function
|
|
13683
|
+
function Sr(e, t, n, r, i = {}) {
|
|
13424
13684
|
let a = q(e), o = Y(a, t);
|
|
13425
13685
|
if (!o) throw Error(`Tree item ${t} was not found.`);
|
|
13426
13686
|
if (o.item.disabled || o.item.draggable === !1) throw Error("Disabled tree items cannot be moved.");
|
|
13427
13687
|
let s = n == null || n === "" ? null : J(a, n);
|
|
13428
13688
|
if (n != null && n !== "" && !s) throw Error(`Target parent ${n} was not found.`);
|
|
13429
|
-
if (s &&
|
|
13689
|
+
if (s && br(o.item, s.id)) throw Error("A tree item cannot be moved inside itself or one of its descendants.");
|
|
13430
13690
|
if (s?.disabled) throw Error("Disabled tree items cannot contain children.");
|
|
13431
13691
|
if (i.allowNesting === !1 && s) throw Error("Nesting is disabled for this tree.");
|
|
13432
13692
|
if (s?.canHaveChildren === !1) throw Error("The target item cannot contain children.");
|
|
@@ -13434,7 +13694,7 @@ function xr(e, t, n, r, i = {}) {
|
|
|
13434
13694
|
let c = s ? s.children : a, l = o.siblings.findIndex((e) => String(e.id) === String(t)), [u] = o.siblings.splice(l, 1), d = Math.min(Math.max(0, Number.isFinite(r) ? Math.trunc(r) : c.length), c.length);
|
|
13435
13695
|
c.splice(d, 0, u);
|
|
13436
13696
|
let f = Number.isFinite(i.maxDepth) ? Math.max(1, Math.trunc(i.maxDepth)) : Infinity;
|
|
13437
|
-
if ((s ?
|
|
13697
|
+
if ((s ? yr(a, s.id) + 1 : 0) + X(u) > f) throw Error(`Moving this branch would exceed the maximum tree depth of ${f}.`);
|
|
13438
13698
|
return {
|
|
13439
13699
|
items: a,
|
|
13440
13700
|
item: u,
|
|
@@ -13446,7 +13706,7 @@ function xr(e, t, n, r, i = {}) {
|
|
|
13446
13706
|
}
|
|
13447
13707
|
//#endregion
|
|
13448
13708
|
//#region src/components/tree/Tree.ts
|
|
13449
|
-
var
|
|
13709
|
+
var Cr = 0;
|
|
13450
13710
|
function Z(e, t, n) {
|
|
13451
13711
|
e.dispatchEvent(new CustomEvent(t, {
|
|
13452
13712
|
bubbles: !0,
|
|
@@ -13454,7 +13714,7 @@ function Z(e, t, n) {
|
|
|
13454
13714
|
detail: n
|
|
13455
13715
|
}));
|
|
13456
13716
|
}
|
|
13457
|
-
function
|
|
13717
|
+
function wr(e, t) {
|
|
13458
13718
|
let n = e.getAttribute(t);
|
|
13459
13719
|
return n === "" || n === "true";
|
|
13460
13720
|
}
|
|
@@ -13463,7 +13723,7 @@ function Q(e) {
|
|
|
13463
13723
|
}
|
|
13464
13724
|
var $ = class extends HTMLElement {
|
|
13465
13725
|
constructor(...e) {
|
|
13466
|
-
super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++
|
|
13726
|
+
super(...e), this._items = [], this._undoStack = [], this._redoStack = [], this._selectedId = null, this._expandedIds = /* @__PURE__ */ new Set(), this._root = null, this._confirm = null, this._treeId = `mint-tree-${++Cr}`, this._liveRegion = null, this._dragExpansion = null, this._autoExpandedIds = /* @__PURE__ */ new Set(), this._dragHoverExpandedId = null, this._keyboardFocusRestore = null, this._suppressSelectionClick = !1, this._selectionClickSuppressionTimer = null, this._onClick = (e) => {
|
|
13467
13727
|
let t = e.target instanceof Element ? e.target.closest("[data-tree-command]") : null;
|
|
13468
13728
|
if (!t || !this.contains(t)) return;
|
|
13469
13729
|
let n = t.getAttribute("data-tree-command"), r = t.getAttribute("data-tree-id");
|
|
@@ -13767,13 +14027,13 @@ var $ = class extends HTMLElement {
|
|
|
13767
14027
|
return Number.isFinite(e) && e > 0 ? e : Infinity;
|
|
13768
14028
|
}
|
|
13769
14029
|
_allowNesting() {
|
|
13770
|
-
return !this.hasAttribute("allow-nesting") ||
|
|
14030
|
+
return !this.hasAttribute("allow-nesting") || wr(this, "allow-nesting");
|
|
13771
14031
|
}
|
|
13772
14032
|
_disabled() {
|
|
13773
|
-
return
|
|
14033
|
+
return wr(this, "disabled");
|
|
13774
14034
|
}
|
|
13775
14035
|
_isLoading() {
|
|
13776
|
-
return
|
|
14036
|
+
return wr(this, "loading");
|
|
13777
14037
|
}
|
|
13778
14038
|
_render() {
|
|
13779
14039
|
let e = document.activeElement instanceof HTMLElement ? document.activeElement.closest("[data-mint-tree-row]") : null, t = e && this.contains(e) ? e.getAttribute("data-tree-id") : null;
|
|
@@ -13924,7 +14184,7 @@ var $ = class extends HTMLElement {
|
|
|
13924
14184
|
i = e.parentId, a = e.siblings.findIndex((e) => String(e.id) === n.parentId) + 1;
|
|
13925
14185
|
} else return;
|
|
13926
14186
|
try {
|
|
13927
|
-
let t =
|
|
14187
|
+
let t = Sr(this._items, e, i, a, {
|
|
13928
14188
|
maxDepth: this._maxDepth(),
|
|
13929
14189
|
allowNesting: this._allowNesting()
|
|
13930
14190
|
});
|
|
@@ -14059,7 +14319,7 @@ var $ = class extends HTMLElement {
|
|
|
14059
14319
|
if (!t || t.siblings.indexOf(t.item) <= 0) return;
|
|
14060
14320
|
let n = t.siblings[t.siblings.indexOf(t.item) - 1];
|
|
14061
14321
|
try {
|
|
14062
|
-
let t =
|
|
14322
|
+
let t = Sr(this._items, e, n.id, (n.children || []).length, {
|
|
14063
14323
|
maxDepth: this._maxDepth(),
|
|
14064
14324
|
allowNesting: this._allowNesting()
|
|
14065
14325
|
});
|
|
@@ -14081,7 +14341,7 @@ var $ = class extends HTMLElement {
|
|
|
14081
14341
|
if (!n) return;
|
|
14082
14342
|
let r = n.siblings.findIndex((e) => String(e.id) === t.parentId) + 1;
|
|
14083
14343
|
try {
|
|
14084
|
-
let t =
|
|
14344
|
+
let t = Sr(this._items, e, n.parentId, r, {
|
|
14085
14345
|
maxDepth: this._maxDepth(),
|
|
14086
14346
|
allowNesting: this._allowNesting()
|
|
14087
14347
|
});
|
|
@@ -14102,4 +14362,4 @@ var $ = class extends HTMLElement {
|
|
|
14102
14362
|
};
|
|
14103
14363
|
customElements.get("mint-tree") || a("mint-tree", $);
|
|
14104
14364
|
//#endregion
|
|
14105
|
-
export { Sn as Alert, cn as BackButton, wn as BottomNavigation, M as Button, M as default, an as Card, Tn as Chart, _n as Checkbox, En as Chip, vn as Choice, Dn as Clickable, On as Collapsible, kn as ConfirmAction, In as DatePicker,
|
|
14365
|
+
export { Sn as Alert, cn as BackButton, wn as BottomNavigation, M as Button, M as default, an as Card, Tn as Chart, _n as Checkbox, En as Chip, vn as Choice, Dn as Clickable, On as Collapsible, kn as ConfirmAction, In as DatePicker, Rn as DateTimePicker, zn as Dropzone, Bn as Form, un as Grid, l as Icon, Fn as Input, on as Link, Cn as MintBottomNavItem, L as MintBottomNavigation, er as MintSidenavActionLinks, tr as MintSidenavActionMenu, Qn as MintSidenavLink, $n as MintSidenavLinks, $ as MintTree, $ as Tree, fn as Modal, Xn as NativeSelect, xn as Navigation, Vn as OffCanvas, ln as Page, gn as Popover, Wn as ResourceTable, pn as ScrollFade, Yn as Search, Zn as Select, ir as SideNavigation, ar as Sortable, en as Spinner, rn as Stack, tn as Switch, or as Tab, cr as TabContent, sr as TabList, Un as Table, lr as Tabs, ur as Tags, nn as Text, Ln as TimePicker, dr as Toast, Pn as confirm, vr as mintui, I as observeScrollFade, _r as toast };
|