@m3ui-vue/m3ui-vue 1.10.2 → 1.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -4
- package/dist/API.md +204 -59
- package/dist/MButton-BHKF1Tfd.js +284 -0
- package/dist/MButton-BHKF1Tfd.js.map +1 -0
- package/dist/MColorPickerModal-CNesUJUq.js +466 -0
- package/dist/MColorPickerModal-CNesUJUq.js.map +1 -0
- package/dist/MDialog-jAYkZ4M8.js +226 -0
- package/dist/MDialog-jAYkZ4M8.js.map +1 -0
- package/dist/{MIcon-BSsJZhK7.js → MIcon-CkUc9kuQ.js} +10 -4
- package/dist/MIcon-CkUc9kuQ.js.map +1 -0
- package/dist/MIconButton-DTFOfsTy.js +317 -0
- package/dist/MIconButton-DTFOfsTy.js.map +1 -0
- package/dist/MListItem-CgdM5sco.js +1306 -0
- package/dist/MListItem-CgdM5sco.js.map +1 -0
- package/dist/MLoadingIndicator-00XbLQSf.js +115 -0
- package/dist/MLoadingIndicator-00XbLQSf.js.map +1 -0
- package/dist/{MMenuItem-US0Zbglq.js → MMenuItem-CEIKYvaX.js} +216 -214
- package/dist/MMenuItem-CEIKYvaX.js.map +1 -0
- package/dist/{MPdfViewer-DL9mRsd2.js → MPdfViewer-KjUIJOIs.js} +674 -671
- package/dist/MPdfViewer-KjUIJOIs.js.map +1 -0
- package/dist/MProgressBar-BzZMxq7M.js.map +1 -1
- package/dist/MSeekBar-B4EEWw3B.js +435 -0
- package/dist/MSeekBar-B4EEWw3B.js.map +1 -0
- package/dist/{MSegmentedButton-DMou-8sG.js → MSegmentedButton-UOAJAd2i.js} +4 -4
- package/dist/{MSegmentedButton-DMou-8sG.js.map → MSegmentedButton-UOAJAd2i.js.map} +1 -1
- package/dist/{MSignaturePad-WuvE_Cyl.js → MSignaturePad-HZavgiGB.js} +2 -2
- package/dist/{MSignaturePad-WuvE_Cyl.js.map → MSignaturePad-HZavgiGB.js.map} +1 -1
- package/dist/{MSlider-7TzhFHKS.js → MSlider-BaQeaozI.js} +4 -4
- package/dist/{MSlider-7TzhFHKS.js.map → MSlider-BaQeaozI.js.map} +1 -1
- package/dist/{MSpinner-CkIVBuGE.js → MSpinner-CbEMPY4X.js} +2 -2
- package/dist/{MSpinner-CkIVBuGE.js.map → MSpinner-CbEMPY4X.js.map} +1 -1
- package/dist/{MTextField-B6_iOczK.js → MTextField-B9PwKHlP.js} +136 -134
- package/dist/MTextField-B9PwKHlP.js.map +1 -0
- package/dist/{_useFieldValidation-COBJ1tWr.js → _useFieldValidation-B7AAfa69.js} +2 -2
- package/dist/{_useFieldValidation-COBJ1tWr.js.map → _useFieldValidation-B7AAfa69.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/chart.js +1 -1
- package/dist/code-editor.js +3 -3
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAlert.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +3 -3
- package/dist/components/MAudioRecorder.vue.d.ts +2 -2
- package/dist/components/MAvatar.vue.d.ts +19 -1
- package/dist/components/MButton.vue.d.ts +2 -1
- package/dist/components/MChatBubble.vue.d.ts +2 -0
- package/dist/components/MCheckbox.vue.d.ts +2 -0
- package/dist/components/MDataTable.vue.d.ts +33 -5
- package/dist/components/MFlow.vue.d.ts +1 -1
- package/dist/components/MHotkeys.vue.d.ts +1 -0
- package/dist/components/MIcon.vue.d.ts +6 -0
- package/dist/components/MIconButton.vue.d.ts +5 -0
- package/dist/components/MJsonViewer.vue.d.ts +2 -0
- package/dist/components/MKanban.vue.d.ts +1 -1
- package/dist/components/MLink.vue.d.ts +59 -0
- package/dist/components/MListItem.vue.d.ts +3 -1
- package/dist/components/MMapControl.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MPagination.vue.d.ts +14 -1
- package/dist/components/MPdfSigner.vue.d.ts +3 -3
- package/dist/components/MRadio.vue.d.ts +2 -0
- package/dist/components/MRadioGroup.vue.d.ts +2 -0
- package/dist/components/MStatCard.vue.d.ts +2 -2
- package/dist/components/MSwitch.vue.d.ts +2 -0
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +4 -2
- package/dist/components/MTextField.vue.d.ts +2 -0
- package/dist/components/MTicket.vue.d.ts +1 -1
- package/dist/components/_MDrawerItemList.vue.d.ts +6 -0
- package/dist/composables/_countLabel.d.ts +6 -0
- package/dist/composables/_menuGroups.d.ts +10 -1
- package/dist/composables/_splitAttrs.d.ts +6 -0
- package/dist/composables/_springAnimation.d.ts +2 -2
- package/dist/composables/_useFocusTrap.d.ts +15 -0
- package/dist/composables/_usePaneResize.d.ts +1 -1
- package/dist/composables/_useSpring.d.ts +4 -4
- package/dist/composables/dynamicColor.d.ts +9 -1
- package/dist/composables/motion.d.ts +63 -0
- package/dist/composables/useConfirm.d.ts +28 -0
- package/dist/composables/useDevice.d.ts +8 -1
- package/dist/composables/useLocale.d.ts +18 -0
- package/dist/composables/useScrollReveal.d.ts +1 -1
- package/dist/composables/useTheme.d.ts +1 -0
- package/dist/composables/useToast.d.ts +7 -0
- package/dist/draw.js +556 -556
- package/dist/draw.js.map +1 -1
- package/dist/flow.js +854 -851
- package/dist/flow.js.map +1 -1
- package/dist/gantt.js +1118 -1096
- package/dist/gantt.js.map +1 -1
- package/dist/index.d.ts +8 -5
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +865 -33
- package/dist/locales/index.js.map +1 -1
- package/dist/locales/pl.d.ts +2 -0
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +10335 -9798
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +860 -860
- package/dist/map.js.map +1 -1
- package/dist/{material-color-utilities-CEFytLsr.js → material-color-utilities-BZsBNIhi.js} +276 -217
- package/dist/material-color-utilities-BZsBNIhi.js.map +1 -0
- package/dist/media.js +7 -7
- package/dist/{motion-BcejVTeX.js → motion-BqYcqcim.js} +15 -5
- package/dist/motion-BqYcqcim.js.map +1 -0
- package/dist/pdf-sign.js +140 -137
- package/dist/pdf-sign.js.map +1 -1
- package/dist/pdf.js +1 -1
- package/dist/plugin.d.ts +11 -0
- package/dist/rich-text-editor.js +7 -7
- package/dist/styles/theme.css +40 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +1 -1
- package/dist/{useLocale-YRaOT12S.js → useLocale-BAPJ34Pq.js} +64 -8
- package/dist/useLocale-BAPJ34Pq.js.map +1 -0
- package/dist/{useThemeTokens-DyAdPQB0.js → useThemeTokens-D5nr5KHf.js} +28 -27
- package/dist/useThemeTokens-D5nr5KHf.js.map +1 -0
- package/package.json +17 -2
- package/src/__tests__/MAvatarImage.test.ts +37 -0
- package/src/__tests__/MDataTableControlled.test.ts +68 -0
- package/src/__tests__/MHotkeysSequence.test.ts +53 -0
- package/src/__tests__/MIconAxes.test.ts +16 -0
- package/src/__tests__/MIconButtonWidth.test.ts +22 -0
- package/src/__tests__/MLink.test.ts +46 -0
- package/src/__tests__/MPaginationPages.test.ts +43 -0
- package/src/__tests__/MTextEmphasized.test.ts +14 -0
- package/src/__tests__/controlDescription.test.ts +34 -0
- package/src/__tests__/countLabels.test.ts +66 -0
- package/src/__tests__/customColor.test.ts +27 -0
- package/src/__tests__/dynamicColor.test.ts +3 -2
- package/src/__tests__/focusTrap.test.ts +124 -0
- package/src/__tests__/formatMessage.test.ts +20 -0
- package/src/__tests__/inputAttrs.test.ts +103 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/menuGroupsRemount.test.ts +40 -0
- package/src/__tests__/menuHydration.test.ts +41 -0
- package/src/__tests__/motionPrefs.test.ts +28 -0
- package/src/__tests__/ssr.test.ts +11 -0
- package/src/__tests__/ssrToast.test.ts +20 -0
- package/src/__tests__/toastDetails.test.ts +39 -0
- package/src/__tests__/useConfirm.test.ts +47 -0
- package/src/__tests__/useTheme.test.ts +14 -0
- package/src/__tests__/warningRole.test.ts +22 -0
- package/src/components/MAlert.vue +2 -2
- package/src/components/MAnimatedNumber.vue +9 -3
- package/src/components/MAutocomplete.vue +16 -4
- package/src/components/MAvailabilityCalendar.vue +3 -3
- package/src/components/MAvatar.vue +32 -5
- package/src/components/MAvatarGroup.vue +7 -2
- package/src/components/MBottomSheet.vue +18 -2
- package/src/components/MButton.vue +18 -5
- package/src/components/MCarousel.vue +3 -3
- package/src/components/MChatBubble.vue +14 -1
- package/src/components/MCheckbox.vue +21 -4
- package/src/components/MChip.vue +4 -2
- package/src/components/MCollapse.vue +7 -1
- package/src/components/MCommandPalette.vue +6 -2
- package/src/components/MContextMenu.vue +4 -4
- package/src/components/MCreditCardInput.vue +5 -0
- package/src/components/MDashboardGrid.vue +2 -1
- package/src/components/MDataTable.vue +68 -20
- package/src/components/MDialog.vue +21 -3
- package/src/components/MDiffViewer.vue +3 -3
- package/src/components/MDrawLayers.vue +3 -3
- package/src/components/MFabMenu.vue +7 -0
- package/src/components/MFloorPlan.vue +3 -3
- package/src/components/MFloorPlanInspector.vue +3 -3
- package/src/components/MFlow.vue +9 -5
- package/src/components/MFlowControls.vue +6 -0
- package/src/components/MFormBuilder.vue +1 -1
- package/src/components/MGantt.vue +10 -10
- package/src/components/MHotkeys.vue +61 -16
- package/src/components/MIcon.vue +17 -1
- package/src/components/MIconButton.vue +29 -6
- package/src/components/MImageCropper.vue +1 -1
- package/src/components/MJsonViewer.vue +4 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MLightbox.vue +5 -4
- package/src/components/MLink.vue +136 -0
- package/src/components/MListDetail.vue +7 -0
- package/src/components/MListItem.vue +7 -4
- package/src/components/MLoadingIndicator.vue +2 -1
- package/src/components/MMap.vue +3 -0
- package/src/components/MMapCluster.vue +2 -2
- package/src/components/MMapControl.vue +2 -2
- package/src/components/MMapMeasure.vue +1 -1
- package/src/components/MMaskField.vue +16 -3
- package/src/components/MMenu.vue +4 -4
- package/src/components/MMenuItem.vue +2 -2
- package/src/components/MMeterGroup.vue +3 -2
- package/src/components/MMortgageCalculator.vue +3 -3
- package/src/components/MMultiAutocomplete.vue +19 -7
- package/src/components/MMultiSelect.vue +19 -7
- package/src/components/MNavigationDrawer.vue +10 -3
- package/src/components/MNavigationRail.vue +5 -1
- package/src/components/MNotificationCenter.vue +2 -1
- package/src/components/MNotificationHost.vue +3 -3
- package/src/components/MNumberField.vue +23 -6
- package/src/components/MOdontogram.vue +4 -4
- package/src/components/MOrderBook.vue +4 -0
- package/src/components/MPagination.vue +91 -12
- package/src/components/MPdfSigner.vue +3 -3
- package/src/components/MPdfViewer.vue +7 -7
- package/src/components/MPhoneInput.vue +17 -4
- package/src/components/MProductConfigurator.vue +4 -4
- package/src/components/MProgressBar.vue +5 -0
- package/src/components/MQuiz.vue +8 -5
- package/src/components/MRadio.vue +24 -5
- package/src/components/MRadioGroup.vue +3 -0
- package/src/components/MReactions.vue +2 -2
- package/src/components/MResourceTimeline.vue +3 -3
- package/src/components/MResult.vue +1 -1
- package/src/components/MScrollField.vue +1 -1
- package/src/components/MSearchField.vue +6 -5
- package/src/components/MSeatMap.vue +5 -0
- package/src/components/MSeekBar.vue +3 -2
- package/src/components/MSelect.vue +16 -4
- package/src/components/MSideSheet.vue +25 -3
- package/src/components/MSimpleCarousel.vue +2 -2
- package/src/components/MSnackbar.vue +16 -13
- package/src/components/MSparkline.vue +2 -1
- package/src/components/MSpinner.vue +8 -0
- package/src/components/MSplitter.vue +1 -1
- package/src/components/MSpotlightSearch.vue +6 -2
- package/src/components/MSpreadsheet.vue +1 -1
- package/src/components/MStatCard.vue +2 -1
- package/src/components/MSwitch.vue +21 -4
- package/src/components/MTable.vue +3 -2
- package/src/components/MTabs.vue +2 -1
- package/src/components/MTagInput.vue +19 -6
- package/src/components/MText.vue +23 -4
- package/src/components/MTextField.vue +25 -6
- package/src/components/MTimeline.vue +5 -5
- package/src/components/MToolbar.vue +2 -2
- package/src/components/MTour.vue +3 -0
- package/src/components/MTrackingTimeline.vue +6 -0
- package/src/components/MTypewriter.vue +7 -1
- package/src/components/MWindow.vue +10 -1
- package/src/components/_MColorPanel.vue +4 -4
- package/src/components/_MComment.vue +3 -2
- package/src/components/_MFlowNodeShell.vue +1 -1
- package/src/components/_MPdfPage.vue +1 -1
- package/src/components/_MTransferPane.vue +10 -0
- package/src/composables/_countLabel.ts +10 -0
- package/src/composables/_effectCanvas.ts +2 -1
- package/src/composables/_menuGroups.ts +10 -1
- package/src/composables/_splitAttrs.ts +29 -0
- package/src/composables/_springAnimation.ts +3 -3
- package/src/composables/_themeTransition.ts +3 -2
- package/src/composables/_useFocusTrap.ts +142 -0
- package/src/composables/_useMenuNav.ts +3 -3
- package/src/composables/_usePaneResize.ts +2 -1
- package/src/composables/_useSheetMotion.ts +3 -4
- package/src/composables/_useSpring.ts +16 -10
- package/src/composables/cron.ts +7 -6
- package/src/composables/dynamicColor.ts +21 -2
- package/src/composables/motion.ts +27 -0
- package/src/composables/useConfirm.ts +116 -0
- package/src/composables/useDevice.ts +23 -3
- package/src/composables/useFieldBg.ts +4 -0
- package/src/composables/useLocale.ts +82 -4
- package/src/composables/useNotification.ts +3 -0
- package/src/composables/useScrollReveal.ts +3 -3
- package/src/composables/useTheme.ts +8 -2
- package/src/composables/useToast.ts +27 -4
- package/src/directives/vSparkle.ts +2 -1
- package/src/index.ts +8 -5
- package/src/locales/ar.ts +11 -4
- package/src/locales/de.ts +11 -4
- package/src/locales/es.ts +11 -4
- package/src/locales/fr.ts +11 -4
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +11 -4
- package/src/locales/ko.ts +11 -4
- package/src/locales/pl.ts +807 -0
- package/src/locales/pt.ts +11 -4
- package/src/locales/zh.ts +11 -4
- package/src/plugin.ts +16 -0
- package/src/styles/theme.css +40 -0
- package/dist/MButton-B9RCM06i.js +0 -171
- package/dist/MButton-B9RCM06i.js.map +0 -1
- package/dist/MColorPickerModal-ChRtcZOo.js +0 -577
- package/dist/MColorPickerModal-ChRtcZOo.js.map +0 -1
- package/dist/MDialog-dk07tify.js +0 -167
- package/dist/MDialog-dk07tify.js.map +0 -1
- package/dist/MIcon-BSsJZhK7.js.map +0 -1
- package/dist/MIconButton-CrBPZidd.js +0 -288
- package/dist/MIconButton-CrBPZidd.js.map +0 -1
- package/dist/MListItem-h9H223vx.js +0 -1239
- package/dist/MListItem-h9H223vx.js.map +0 -1
- package/dist/MLoadingIndicator-YTV1Ov5w.js +0 -114
- package/dist/MLoadingIndicator-YTV1Ov5w.js.map +0 -1
- package/dist/MMenuItem-US0Zbglq.js.map +0 -1
- package/dist/MPdfViewer-DL9mRsd2.js.map +0 -1
- package/dist/MSeekBar-JFZcoJ8y.js +0 -434
- package/dist/MSeekBar-JFZcoJ8y.js.map +0 -1
- package/dist/MTextField-B6_iOczK.js.map +0 -1
- package/dist/material-color-utilities-CEFytLsr.js.map +0 -1
- package/dist/motion-BcejVTeX.js.map +0 -1
- package/dist/useLocale-YRaOT12S.js.map +0 -1
- package/dist/useThemeTokens-DyAdPQB0.js.map +0 -1
|
@@ -0,0 +1,1306 @@
|
|
|
1
|
+
import { r as e, t } from "./MIcon-CkUc9kuQ.js";
|
|
2
|
+
import { a as n } from "./useLocale-BAPJ34Pq.js";
|
|
3
|
+
import { a as r, i, p as a, s as o } from "./MIconButton-DTFOfsTy.js";
|
|
4
|
+
import { s } from "./MTextField-B9PwKHlP.js";
|
|
5
|
+
import { n as c } from "./_useFieldValidation-B7AAfa69.js";
|
|
6
|
+
import { Transition as l, computed as u, createBlock as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, getCurrentInstance as v, h as y, inject as b, mergeProps as x, nextTick as S, normalizeClass as C, normalizeStyle as w, onBeforeUnmount as T, onMounted as E, onUnmounted as D, onUpdated as O, openBlock as k, provide as A, ref as j, renderSlot as M, resolveDynamicComponent as ee, shallowRef as N, toDisplayString as P, unref as F, useId as I, useSlots as L, watch as R, withCtx as z, withDirectives as B, withModifiers as V } from "vue";
|
|
7
|
+
// src/composables/_useFollowAnchor.ts
|
|
8
|
+
var H = /(auto|scroll|hidden|clip)/;
|
|
9
|
+
function U(e) {
|
|
10
|
+
if (!e.isConnected) return !0;
|
|
11
|
+
let t = e.getBoundingClientRect(), n = t.top, r = t.left, i = t.bottom, a = t.right;
|
|
12
|
+
for (let t = e.parentElement; t && t !== document.body && t !== document.documentElement; t = t.parentElement) {
|
|
13
|
+
let e = getComputedStyle(t);
|
|
14
|
+
if (e.position === "fixed") break;
|
|
15
|
+
if (!H.test(e.overflow + e.overflowX + e.overflowY)) continue;
|
|
16
|
+
let o = t.getBoundingClientRect();
|
|
17
|
+
n = Math.max(n, o.top), r = Math.max(r, o.left), i = Math.min(i, o.bottom), a = Math.min(a, o.right);
|
|
18
|
+
}
|
|
19
|
+
return n = Math.max(n, 0), r = Math.max(r, 0), i = Math.min(i, window.innerHeight), a = Math.min(a, window.innerWidth), i <= n || a <= r;
|
|
20
|
+
}
|
|
21
|
+
function W(e) {
|
|
22
|
+
let t = 0, n = null, r = !1;
|
|
23
|
+
function i() {
|
|
24
|
+
if (t = 0, !e.open()) return;
|
|
25
|
+
let n = e.anchor.value;
|
|
26
|
+
if (!n || U(n)) {
|
|
27
|
+
e.close();
|
|
28
|
+
let t = document.activeElement;
|
|
29
|
+
n && t instanceof HTMLElement && n.contains(t) && t.blur();
|
|
30
|
+
} else e.place();
|
|
31
|
+
}
|
|
32
|
+
function a() {
|
|
33
|
+
t ||= requestAnimationFrame(i);
|
|
34
|
+
}
|
|
35
|
+
function o(t) {
|
|
36
|
+
let n = t.target;
|
|
37
|
+
n instanceof Node && e.popup.value?.contains(n) || a();
|
|
38
|
+
}
|
|
39
|
+
function s() {
|
|
40
|
+
r || typeof window > "u" || (r = !0, window.addEventListener("scroll", o, {
|
|
41
|
+
capture: !0,
|
|
42
|
+
passive: !0
|
|
43
|
+
}), window.addEventListener("resize", a), window.visualViewport?.addEventListener("resize", a), window.visualViewport?.addEventListener("scroll", a), typeof ResizeObserver < "u" && e.anchor.value && (n = new ResizeObserver(a), n.observe(e.anchor.value)));
|
|
44
|
+
}
|
|
45
|
+
function c() {
|
|
46
|
+
r && (r = !1, window.removeEventListener("scroll", o, { capture: !0 }), window.removeEventListener("resize", a), window.visualViewport?.removeEventListener("resize", a), window.visualViewport?.removeEventListener("scroll", a), n?.disconnect(), n = null, t && cancelAnimationFrame(t), t = 0);
|
|
47
|
+
}
|
|
48
|
+
R(e.open, (e) => e ? s() : c(), { immediate: !0 }), T(c);
|
|
49
|
+
}
|
|
50
|
+
// src/components/MAvatar.vue?vue&type=script&setup=true&lang.ts
|
|
51
|
+
var G = ["role", "aria-label"], K = ["src", "alt"], q = ["aria-hidden"], te = /* @__PURE__ */ _({
|
|
52
|
+
__name: "MAvatar",
|
|
53
|
+
props: {
|
|
54
|
+
name: {},
|
|
55
|
+
fallback: {},
|
|
56
|
+
size: { default: 40 },
|
|
57
|
+
src: {},
|
|
58
|
+
alt: {},
|
|
59
|
+
icon: {}
|
|
60
|
+
},
|
|
61
|
+
setup(e) {
|
|
62
|
+
let n = e, r = u(() => {
|
|
63
|
+
if (n.name) {
|
|
64
|
+
let e = n.name.trim().split(/\s+/).filter(Boolean);
|
|
65
|
+
return ((e[0]?.[0] ?? "") + (e.length > 1 ? e[e.length - 1]?.[0] ?? "" : "")).toUpperCase() || n.fallback || "?";
|
|
66
|
+
}
|
|
67
|
+
return n.fallback || "?";
|
|
68
|
+
}), i = j(!1);
|
|
69
|
+
R(() => n.src, () => {
|
|
70
|
+
i.value = !1;
|
|
71
|
+
});
|
|
72
|
+
let a = u(() => !!n.src && !i.value), o = u(() => n.alt ?? n.name);
|
|
73
|
+
return (n, s) => (k(), p("div", {
|
|
74
|
+
class: "inline-flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary-container font-medium text-on-primary-container",
|
|
75
|
+
style: w({
|
|
76
|
+
width: `${e.size}px`,
|
|
77
|
+
height: `${e.size}px`,
|
|
78
|
+
fontSize: `${Math.round(e.size * .4)}px`
|
|
79
|
+
}),
|
|
80
|
+
role: !a.value && o.value ? "img" : void 0,
|
|
81
|
+
"aria-label": !a.value && o.value ? o.value : void 0
|
|
82
|
+
}, [M(n.$slots, "default", {}, () => [a.value ? (k(), p("img", {
|
|
83
|
+
key: 0,
|
|
84
|
+
src: e.src,
|
|
85
|
+
alt: o.value ?? "",
|
|
86
|
+
class: "size-full object-cover",
|
|
87
|
+
draggable: "false",
|
|
88
|
+
onError: s[0] ||= (e) => i.value = !0
|
|
89
|
+
}, null, 40, K)) : e.icon ? (k(), d(t, {
|
|
90
|
+
key: 1,
|
|
91
|
+
name: e.icon,
|
|
92
|
+
size: Math.round(e.size * .6),
|
|
93
|
+
"aria-hidden": "true"
|
|
94
|
+
}, null, 8, ["name", "size"])) : (k(), p("span", {
|
|
95
|
+
key: 2,
|
|
96
|
+
"aria-hidden": o.value ? "true" : void 0
|
|
97
|
+
}, P(r.value), 9, q))])], 12, G));
|
|
98
|
+
}
|
|
99
|
+
}), J = [
|
|
100
|
+
"role",
|
|
101
|
+
"tabindex",
|
|
102
|
+
"aria-disabled"
|
|
103
|
+
], ne = ["src", "alt"], re = {
|
|
104
|
+
key: 1,
|
|
105
|
+
class: "px-4 pt-4 pb-2"
|
|
106
|
+
}, Y = {
|
|
107
|
+
key: 2,
|
|
108
|
+
class: "px-4 pt-4 pb-2"
|
|
109
|
+
}, X = { class: "text-title-large font-medium text-on-surface" }, ie = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "mt-1 text-body-medium text-on-surface-variant"
|
|
112
|
+
}, ae = {
|
|
113
|
+
key: 3,
|
|
114
|
+
class: "flex justify-end gap-2 px-4 pt-2 pb-4"
|
|
115
|
+
}, Z = "relative before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-on-surface before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] focus-visible:before:opacity-[0.1] active:before:opacity-[0.1]", oe = /* @__PURE__ */ _({
|
|
116
|
+
__name: "MCard",
|
|
117
|
+
props: {
|
|
118
|
+
variant: { default: "elevated" },
|
|
119
|
+
clickable: {
|
|
120
|
+
type: Boolean,
|
|
121
|
+
default: !1
|
|
122
|
+
},
|
|
123
|
+
elevated: {
|
|
124
|
+
type: Boolean,
|
|
125
|
+
default: !1
|
|
126
|
+
},
|
|
127
|
+
disabled: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: !1
|
|
130
|
+
},
|
|
131
|
+
image: {},
|
|
132
|
+
imageAlt: {},
|
|
133
|
+
imageHeight: {},
|
|
134
|
+
title: {},
|
|
135
|
+
subtitle: {}
|
|
136
|
+
},
|
|
137
|
+
setup(e) {
|
|
138
|
+
let t = e, n = u(() => t.elevated ? "elevated" : t.variant), r = {
|
|
139
|
+
elevated: "var(--color-surface-container-low)",
|
|
140
|
+
filled: "var(--color-surface-container-highest)",
|
|
141
|
+
outlined: "var(--color-surface)"
|
|
142
|
+
}, i = u(() => (t.disabled ? {
|
|
143
|
+
elevated: "bg-surface/38 shadow-none",
|
|
144
|
+
filled: "bg-surface-variant/38",
|
|
145
|
+
outlined: "bg-surface border border-outline/12"
|
|
146
|
+
} : {
|
|
147
|
+
elevated: "bg-surface-container-low shadow-elevation-1",
|
|
148
|
+
filled: "bg-surface-container-highest",
|
|
149
|
+
outlined: "bg-surface border border-outline-variant"
|
|
150
|
+
})[n.value]), o = {
|
|
151
|
+
elevated: "hover:shadow-elevation-2 active:shadow-elevation-1 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
152
|
+
filled: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-secondary",
|
|
153
|
+
outlined: "hover:shadow-elevation-1 active:shadow-none focus-visible:outline-none focus-visible:border-on-surface"
|
|
154
|
+
}, s = u(() => t.clickable && !t.disabled);
|
|
155
|
+
function c(e) {
|
|
156
|
+
s.value && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.currentTarget.click());
|
|
157
|
+
}
|
|
158
|
+
return (t, l) => B((k(), p("div", {
|
|
159
|
+
class: C(["overflow-hidden rounded-md transition-shadow duration-150", [
|
|
160
|
+
i.value,
|
|
161
|
+
s.value ? [
|
|
162
|
+
"cursor-pointer",
|
|
163
|
+
o[n.value],
|
|
164
|
+
Z
|
|
165
|
+
] : "",
|
|
166
|
+
e.disabled ? "cursor-not-allowed pointer-events-none" : ""
|
|
167
|
+
]]),
|
|
168
|
+
style: w({ "--field-bg": r[n.value] }),
|
|
169
|
+
role: e.clickable ? "button" : void 0,
|
|
170
|
+
tabindex: s.value ? 0 : void 0,
|
|
171
|
+
"aria-disabled": e.clickable && e.disabled ? "true" : void 0,
|
|
172
|
+
onKeydown: c
|
|
173
|
+
}, [
|
|
174
|
+
e.image || t.$slots.media ? (k(), p("div", {
|
|
175
|
+
key: 0,
|
|
176
|
+
class: C(["w-full overflow-hidden", e.imageHeight ?? "h-48"])
|
|
177
|
+
}, [e.image ? (k(), p("img", {
|
|
178
|
+
key: 0,
|
|
179
|
+
src: e.image,
|
|
180
|
+
alt: e.imageAlt ?? "",
|
|
181
|
+
class: "h-full w-full object-cover"
|
|
182
|
+
}, null, 8, ne)) : M(t.$slots, "media", {}, void 0, void 0, 1)], 2)) : f("", !0),
|
|
183
|
+
t.$slots.header ? (k(), p("div", re, [M(t.$slots, "header")])) : e.title ? (k(), p("div", Y, [m("h3", X, P(e.title), 1), e.subtitle ? (k(), p("p", ie, P(e.subtitle), 1)) : f("", !0)])) : f("", !0),
|
|
184
|
+
M(t.$slots, "default"),
|
|
185
|
+
t.$slots.actions ? (k(), p("div", ae, [M(t.$slots, "actions")])) : f("", !0)
|
|
186
|
+
], 46, J)), [[F(a), s.value ? { disabled: e.disabled } : !1]]);
|
|
187
|
+
}
|
|
188
|
+
}), se = [
|
|
189
|
+
"checked",
|
|
190
|
+
"disabled",
|
|
191
|
+
"name",
|
|
192
|
+
"required",
|
|
193
|
+
"aria-label",
|
|
194
|
+
"aria-invalid",
|
|
195
|
+
"aria-describedby"
|
|
196
|
+
], Q = {
|
|
197
|
+
key: 2,
|
|
198
|
+
class: "pointer-events-none absolute inset-0 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2"
|
|
199
|
+
}, ce = {
|
|
200
|
+
key: 0,
|
|
201
|
+
class: "flex flex-col"
|
|
202
|
+
}, le = {
|
|
203
|
+
key: 0,
|
|
204
|
+
class: "text-error"
|
|
205
|
+
}, ue = ["id"], de = "border-error bg-error text-on-error", fe = /* @__PURE__ */ _({
|
|
206
|
+
inheritAttrs: !1,
|
|
207
|
+
__name: "MCheckbox",
|
|
208
|
+
props: {
|
|
209
|
+
modelValue: { type: Boolean },
|
|
210
|
+
indeterminate: {
|
|
211
|
+
type: Boolean,
|
|
212
|
+
default: !1
|
|
213
|
+
},
|
|
214
|
+
disabled: {
|
|
215
|
+
type: Boolean,
|
|
216
|
+
default: !1
|
|
217
|
+
},
|
|
218
|
+
label: {},
|
|
219
|
+
description: {},
|
|
220
|
+
color: { default: "primary" },
|
|
221
|
+
ariaLabel: {},
|
|
222
|
+
error: { type: [Boolean, String] },
|
|
223
|
+
errorLabel: {},
|
|
224
|
+
required: { type: Boolean },
|
|
225
|
+
rules: {},
|
|
226
|
+
validateOn: {},
|
|
227
|
+
validateDebounce: {},
|
|
228
|
+
name: {}
|
|
229
|
+
},
|
|
230
|
+
emits: ["update:modelValue", "blur"],
|
|
231
|
+
setup(e, { expose: n, emit: r }) {
|
|
232
|
+
let i = e, o = r, l = j(null), u = j(null), d = c({
|
|
233
|
+
value: () => i.modelValue,
|
|
234
|
+
rules: () => i.rules,
|
|
235
|
+
required: () => i.required,
|
|
236
|
+
error: () => i.error,
|
|
237
|
+
errorLabel: () => i.errorLabel,
|
|
238
|
+
name: () => i.name,
|
|
239
|
+
validateOn: () => i.validateOn,
|
|
240
|
+
validateDebounce: () => i.validateDebounce,
|
|
241
|
+
disabled: () => i.disabled,
|
|
242
|
+
focus: () => {
|
|
243
|
+
l.value?.focus();
|
|
244
|
+
},
|
|
245
|
+
el: () => l.value,
|
|
246
|
+
setValue: (e) => o("update:modelValue", e)
|
|
247
|
+
}), _ = d.disabled, { hasError: v, message: y, messageId: b } = d, S = `${b}-desc`, { rootAttrs: T, inputAttrs: E, attrId: D } = s();
|
|
248
|
+
function O() {
|
|
249
|
+
return [
|
|
250
|
+
i.description ? S : "",
|
|
251
|
+
y.value ? b : "",
|
|
252
|
+
E()["aria-describedby"]
|
|
253
|
+
].filter(Boolean).join(" ") || void 0;
|
|
254
|
+
}
|
|
255
|
+
let A = {
|
|
256
|
+
primary: "border-primary bg-primary text-on-primary",
|
|
257
|
+
secondary: "border-secondary bg-secondary text-on-secondary",
|
|
258
|
+
tertiary: "border-tertiary bg-tertiary text-on-tertiary",
|
|
259
|
+
error: "border-error bg-error text-on-error"
|
|
260
|
+
}, ee = {
|
|
261
|
+
primary: "bg-primary",
|
|
262
|
+
secondary: "bg-secondary",
|
|
263
|
+
tertiary: "bg-tertiary",
|
|
264
|
+
error: "bg-error"
|
|
265
|
+
};
|
|
266
|
+
return n({
|
|
267
|
+
validate: d.validate,
|
|
268
|
+
resetValidation: d.resetValidation
|
|
269
|
+
}), (n, r) => B((k(), p("label", x(F(T)(), { class: ["group inline-flex gap-2 select-none", [F(_) ? "cursor-not-allowed" : "cursor-pointer", F(y) || e.description ? "items-start" : "items-center"]] }), [m("span", {
|
|
270
|
+
class: "relative -m-[11px] inline-flex h-10 w-10 shrink-0 items-center justify-center rounded-full",
|
|
271
|
+
style: w(F(y) ? { marginTop: "-8px" } : void 0)
|
|
272
|
+
}, [
|
|
273
|
+
m("input", x(F(E)(), {
|
|
274
|
+
type: "checkbox",
|
|
275
|
+
class: "peer sr-only",
|
|
276
|
+
checked: e.modelValue,
|
|
277
|
+
disabled: F(_),
|
|
278
|
+
ref_key: "inputEl",
|
|
279
|
+
ref: l,
|
|
280
|
+
name: e.name,
|
|
281
|
+
required: e.required,
|
|
282
|
+
"aria-label": e.ariaLabel,
|
|
283
|
+
"aria-invalid": F(v) || void 0,
|
|
284
|
+
"aria-describedby": O(),
|
|
285
|
+
onChange: r[0] ||= (t) => o("update:modelValue", !e.modelValue),
|
|
286
|
+
onBlur: r[1] ||= (e) => {
|
|
287
|
+
F(d).onBlur(), o("blur", e);
|
|
288
|
+
}
|
|
289
|
+
}), null, 16, se),
|
|
290
|
+
F(_) ? f("", !0) : (k(), p("span", {
|
|
291
|
+
key: 0,
|
|
292
|
+
class: C(["pointer-events-none absolute inset-0 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] peer-focus-visible:opacity-[0.1] group-active:opacity-[0.1]", F(v) ? "bg-error" : e.modelValue || e.indeterminate ? ee[e.color] : "bg-on-surface"])
|
|
293
|
+
}, null, 2)),
|
|
294
|
+
F(_) ? f("", !0) : (k(), p("span", {
|
|
295
|
+
key: 1,
|
|
296
|
+
ref_key: "rippleEl",
|
|
297
|
+
ref: u,
|
|
298
|
+
"aria-hidden": "true",
|
|
299
|
+
class: C(["pointer-events-none absolute inset-0 rounded-full", (F(v) ? "bg-error" : e.modelValue || e.indeterminate ? ee[e.color] : "bg-on-surface").replace("bg-", "text-")])
|
|
300
|
+
}, null, 2)),
|
|
301
|
+
F(_) ? f("", !0) : (k(), p("span", Q)),
|
|
302
|
+
m("span", { class: C(["relative inline-flex h-4.5 w-4.5 items-center justify-center rounded-[2px] border-2 transition-colors", F(_) ? e.modelValue || e.indeterminate ? "border-on-surface/38 bg-on-surface/38 text-surface" : "border-on-surface/38 text-transparent" : F(v) ? e.modelValue || e.indeterminate ? de : "border-error text-transparent" : e.modelValue || e.indeterminate ? A[e.color] : "border-on-surface-variant text-transparent group-hover:border-on-surface group-active:border-on-surface"]) }, [g(t, {
|
|
303
|
+
name: e.indeterminate ? "remove" : "check",
|
|
304
|
+
size: 18,
|
|
305
|
+
class: C(["transition-[opacity,transform] duration-150", e.modelValue || e.indeterminate ? "scale-100 opacity-100" : "scale-0 opacity-0"])
|
|
306
|
+
}, null, 8, ["name", "class"])], 2)
|
|
307
|
+
], 4), e.label || n.$slots.default || e.description || F(y) ? (k(), p("span", ce, [
|
|
308
|
+
e.label || n.$slots.default ? (k(), p("span", {
|
|
309
|
+
key: 0,
|
|
310
|
+
class: C(["text-body-large", F(_) ? "text-on-surface/38" : "text-on-surface"])
|
|
311
|
+
}, [M(n.$slots, "default", {}, () => [h(P(e.label), 1)]), e.required ? (k(), p("span", le, "\xA0*")) : f("", !0)], 2)) : f("", !0),
|
|
312
|
+
e.description ? (k(), p("span", {
|
|
313
|
+
key: 1,
|
|
314
|
+
id: S,
|
|
315
|
+
class: "text-body-medium text-on-surface-variant"
|
|
316
|
+
}, P(e.description), 1)) : f("", !0),
|
|
317
|
+
F(y) ? (k(), p("span", {
|
|
318
|
+
key: 2,
|
|
319
|
+
id: F(b),
|
|
320
|
+
role: "alert",
|
|
321
|
+
class: "text-body-small text-error"
|
|
322
|
+
}, P(F(y)), 9, ue)) : f("", !0)
|
|
323
|
+
])) : f("", !0)], 16)), [[F(a), {
|
|
324
|
+
disabled: F(_),
|
|
325
|
+
layer: () => u.value,
|
|
326
|
+
centered: !0
|
|
327
|
+
}]]);
|
|
328
|
+
}
|
|
329
|
+
}), pe = ["disabled", "aria-pressed"], $ = { class: "whitespace-nowrap" }, me = ["aria-label", "disabled"], he = ["aria-label", "disabled"], ge = "relative cursor-pointer before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 hover:before:opacity-[0.08] focus-visible:before:opacity-[0.1] active:before:opacity-[0.1] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", _e = /* @__PURE__ */ _({
|
|
330
|
+
__name: "MChip",
|
|
331
|
+
props: {
|
|
332
|
+
tone: { default: "neutral" },
|
|
333
|
+
selected: {
|
|
334
|
+
type: Boolean,
|
|
335
|
+
default: !1
|
|
336
|
+
},
|
|
337
|
+
removable: {
|
|
338
|
+
type: Boolean,
|
|
339
|
+
default: !1
|
|
340
|
+
},
|
|
341
|
+
clickable: {
|
|
342
|
+
type: Boolean,
|
|
343
|
+
default: !1
|
|
344
|
+
},
|
|
345
|
+
disabled: {
|
|
346
|
+
type: Boolean,
|
|
347
|
+
default: !1
|
|
348
|
+
},
|
|
349
|
+
icon: {},
|
|
350
|
+
type: {},
|
|
351
|
+
elevated: {
|
|
352
|
+
type: Boolean,
|
|
353
|
+
default: !1
|
|
354
|
+
},
|
|
355
|
+
trailingIcon: {}
|
|
356
|
+
},
|
|
357
|
+
emits: [
|
|
358
|
+
"click",
|
|
359
|
+
"remove",
|
|
360
|
+
"update:selected"
|
|
361
|
+
],
|
|
362
|
+
setup(e, { emit: s }) {
|
|
363
|
+
let c = [
|
|
364
|
+
"neutral",
|
|
365
|
+
"primary",
|
|
366
|
+
"success",
|
|
367
|
+
"warning",
|
|
368
|
+
"error",
|
|
369
|
+
"tertiary",
|
|
370
|
+
"secondary"
|
|
371
|
+
], l = e, h = s, _ = n(), v = L(), y = u(() => !!l.tone && !c.includes(l.tone)), b = u(() => {
|
|
372
|
+
if (y.value) return {
|
|
373
|
+
"--chip-bg": `color-mix(in srgb, ${l.tone} 13%, transparent)`,
|
|
374
|
+
"--chip-color": l.tone
|
|
375
|
+
};
|
|
376
|
+
}), x = u(() => {
|
|
377
|
+
if (l.disabled) return l.tone === "neutral" && !l.selected && !y.value ? "border border-on-surface/10 bg-transparent text-on-surface/38" : "border border-transparent bg-on-surface/12 text-on-surface/38";
|
|
378
|
+
if (y.value) return "border border-transparent bg-[var(--chip-bg)] text-[var(--chip-color)]";
|
|
379
|
+
if (l.tone === "neutral" && !l.selected) return "border border-outline-variant bg-transparent text-on-surface-variant";
|
|
380
|
+
let e = {
|
|
381
|
+
neutral: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
382
|
+
primary: "border border-transparent bg-primary-container text-on-primary-container",
|
|
383
|
+
secondary: "border border-transparent bg-secondary-container text-on-secondary-container",
|
|
384
|
+
success: "border border-transparent bg-success-container text-on-success-container",
|
|
385
|
+
warning: "border border-transparent bg-warning-container text-on-warning-container",
|
|
386
|
+
error: "border border-transparent bg-error-container text-on-error-container",
|
|
387
|
+
tertiary: "border border-transparent bg-tertiary-container text-on-tertiary-container"
|
|
388
|
+
};
|
|
389
|
+
return e[l.tone ?? "neutral"] ?? e.neutral;
|
|
390
|
+
}), S = u(() => l.selected ? "rounded-full" : "rounded-md"), T = u(() => l.type === "filter" || l.type === "input"), E = u(() => l.type === "input" && !!v.avatar), D = u(() => !!l.trailingIcon || l.type === "input" && l.removable), O = u(() => {
|
|
391
|
+
let e = T.value && l.selected;
|
|
392
|
+
if (l.disabled) return e || l.elevated && l.type !== "input" ? "bg-on-surface/12 text-on-surface/38" : "border border-on-surface/12 text-on-surface/38";
|
|
393
|
+
if (e) return ["bg-secondary-container text-on-secondary-container", l.elevated ? "shadow-elevation-1 hover:shadow-elevation-2" : ""];
|
|
394
|
+
let t = l.type === "assist" ? "text-on-surface" : "text-on-surface-variant";
|
|
395
|
+
return l.elevated && l.type !== "input" ? ["bg-surface-container-low shadow-elevation-1 hover:shadow-elevation-2", t] : ["border border-outline-variant", t];
|
|
396
|
+
}), A = u(() => l.disabled ? "" : l.type === "assist" || l.type === "suggestion" ? "text-primary" : l.selected ? "text-on-secondary-container" : "text-on-surface-variant"), N = u(() => l.type === "input" ? [E.value ? "ps-1" : l.icon ? "ps-2" : "ps-3", D.value ? "pe-2" : "pe-3"] : [l.icon || H.value ? "ps-2" : "ps-4", D.value ? "pe-2" : "pe-4"]), P = j(!1), I = j(), R = j(), H = u(() => l.type === "filter" && !l.icon);
|
|
397
|
+
o(() => l.type === "filter" || l.type === "input" ? [P.value ? 8 : l.selected ? 16 : 12, H.value ? l.selected ? 26 : 8 : 0] : [], ([e, t]) => {
|
|
398
|
+
I.value && e !== void 0 && (I.value.style.borderRadius = `${e}px`), R.value && t !== void 0 && (R.value.style.width = `${t}px`);
|
|
399
|
+
}, r), o(() => H.value ? [+!!l.selected] : [], ([e]) => {
|
|
400
|
+
R.value && e !== void 0 && (R.value.style.opacity = String(e));
|
|
401
|
+
}, i);
|
|
402
|
+
function U() {
|
|
403
|
+
l.disabled || (T.value && h("update:selected", !l.selected), h("click"));
|
|
404
|
+
}
|
|
405
|
+
return (n, r) => e.type ? (k(), p("span", {
|
|
406
|
+
key: 0,
|
|
407
|
+
ref_key: "typedEl",
|
|
408
|
+
ref: I,
|
|
409
|
+
class: C(["relative inline-flex h-8 items-center overflow-hidden align-middle text-label-large transition-[background-color,box-shadow,color] has-[button:focus-visible]:ring-2 has-[button:focus-visible]:ring-inset has-[button:focus-visible]:ring-secondary", [O.value, e.type === "assist" || e.type === "suggestion" ? "rounded-sm" : "rounded-md"]])
|
|
410
|
+
}, [B((k(), p("button", {
|
|
411
|
+
type: "button",
|
|
412
|
+
class: C(["flex h-full items-center gap-2 outline-none before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity", [N.value, e.disabled ? "cursor-not-allowed" : "cursor-pointer hover:before:opacity-[0.08] focus-visible:before:opacity-[0.1] active:before:opacity-[0.1]"]]),
|
|
413
|
+
disabled: e.disabled,
|
|
414
|
+
"aria-pressed": T.value ? e.selected : void 0,
|
|
415
|
+
onPointerdown: r[0] ||= (e) => P.value = !0,
|
|
416
|
+
onPointerup: r[1] ||= (e) => P.value = !1,
|
|
417
|
+
onPointerleave: r[2] ||= (e) => P.value = !1,
|
|
418
|
+
onPointercancel: r[3] ||= (e) => P.value = !1,
|
|
419
|
+
onClick: U
|
|
420
|
+
}, [
|
|
421
|
+
E.value ? (k(), p("span", {
|
|
422
|
+
key: 0,
|
|
423
|
+
class: C(["-my-1 flex h-6 w-6 shrink-0 items-center justify-center overflow-hidden rounded-full", e.disabled ? "opacity-38" : ""])
|
|
424
|
+
}, [M(n.$slots, "avatar")], 2)) : e.icon ? (k(), d(t, {
|
|
425
|
+
key: 1,
|
|
426
|
+
name: e.icon,
|
|
427
|
+
size: 18,
|
|
428
|
+
filled: e.type === "filter" && e.selected,
|
|
429
|
+
class: C(["shrink-0", A.value])
|
|
430
|
+
}, null, 8, [
|
|
431
|
+
"name",
|
|
432
|
+
"filled",
|
|
433
|
+
"class"
|
|
434
|
+
])) : H.value ? (k(), p("span", {
|
|
435
|
+
key: 2,
|
|
436
|
+
ref_key: "checkEl",
|
|
437
|
+
ref: R,
|
|
438
|
+
class: "-me-2 flex shrink-0 overflow-hidden",
|
|
439
|
+
style: {
|
|
440
|
+
width: "8px",
|
|
441
|
+
opacity: "0"
|
|
442
|
+
},
|
|
443
|
+
"aria-hidden": "true"
|
|
444
|
+
}, [g(t, {
|
|
445
|
+
name: "check",
|
|
446
|
+
size: 18,
|
|
447
|
+
class: C(["shrink-0", A.value])
|
|
448
|
+
}, null, 8, ["class"])], 512)) : f("", !0),
|
|
449
|
+
m("span", $, [M(n.$slots, "default")]),
|
|
450
|
+
e.trailingIcon ? (k(), d(t, {
|
|
451
|
+
key: 3,
|
|
452
|
+
name: e.trailingIcon,
|
|
453
|
+
size: 18,
|
|
454
|
+
class: C(["shrink-0", e.disabled ? "" : e.selected && T.value ? "text-on-secondary-container" : "text-on-surface-variant"])
|
|
455
|
+
}, null, 8, ["name", "class"])) : f("", !0)
|
|
456
|
+
], 42, pe)), [[F(a), { disabled: e.disabled }]]), e.type === "input" && e.removable ? (k(), p("button", {
|
|
457
|
+
key: 0,
|
|
458
|
+
type: "button",
|
|
459
|
+
class: C(["relative -ms-1 me-2 flex h-6 w-6 shrink-0 items-center justify-center rounded-full outline-none hover:bg-on-surface/8 focus-visible:ring-2 focus-visible:ring-secondary", e.disabled ? "cursor-not-allowed" : "cursor-pointer"]),
|
|
460
|
+
"aria-label": F(_).remove,
|
|
461
|
+
disabled: e.disabled,
|
|
462
|
+
onClick: r[4] ||= V((e) => h("remove"), ["stop"])
|
|
463
|
+
}, [g(t, {
|
|
464
|
+
name: "close",
|
|
465
|
+
size: 18
|
|
466
|
+
})], 10, me)) : f("", !0)], 2)) : B((k(), d(ee(e.clickable ? "button" : "span"), {
|
|
467
|
+
key: 1,
|
|
468
|
+
type: e.clickable ? "button" : void 0,
|
|
469
|
+
disabled: e.clickable && e.disabled ? !0 : void 0,
|
|
470
|
+
class: C(["inline-flex h-8 items-center gap-1.5 overflow-hidden px-3 text-label-large transition-colors", [
|
|
471
|
+
S.value,
|
|
472
|
+
x.value,
|
|
473
|
+
e.clickable && !e.disabled ? ge : "",
|
|
474
|
+
e.disabled ? "cursor-not-allowed" : ""
|
|
475
|
+
]]),
|
|
476
|
+
style: w(b.value),
|
|
477
|
+
onClick: r[6] ||= (t) => e.clickable && !e.disabled && h("click")
|
|
478
|
+
}, {
|
|
479
|
+
default: z(() => [
|
|
480
|
+
e.icon ? (k(), d(t, {
|
|
481
|
+
key: 0,
|
|
482
|
+
name: e.icon,
|
|
483
|
+
size: 18
|
|
484
|
+
}, null, 8, ["name"])) : f("", !0),
|
|
485
|
+
M(n.$slots, "default"),
|
|
486
|
+
e.removable ? (k(), p("button", {
|
|
487
|
+
key: 1,
|
|
488
|
+
type: "button",
|
|
489
|
+
class: "-me-1 ms-0.5 inline-flex items-center justify-center rounded-full hover:bg-on-surface/8 active:bg-on-surface/10",
|
|
490
|
+
"aria-label": F(_).remove,
|
|
491
|
+
disabled: e.disabled,
|
|
492
|
+
onClick: r[5] ||= V((e) => h("remove"), ["stop"])
|
|
493
|
+
}, [g(t, {
|
|
494
|
+
name: "close",
|
|
495
|
+
size: 16
|
|
496
|
+
})], 8, he)) : f("", !0)
|
|
497
|
+
]),
|
|
498
|
+
_: 3
|
|
499
|
+
}, 8, [
|
|
500
|
+
"type",
|
|
501
|
+
"disabled",
|
|
502
|
+
"class",
|
|
503
|
+
"style"
|
|
504
|
+
])), [[F(a), e.clickable ? { disabled: e.disabled } : !1]]);
|
|
505
|
+
}
|
|
506
|
+
}), ve = { class: "relative -my-2 inline-flex h-12 shrink-0 items-center" }, ye = [
|
|
507
|
+
"checked",
|
|
508
|
+
"disabled",
|
|
509
|
+
"name",
|
|
510
|
+
"required",
|
|
511
|
+
"aria-invalid",
|
|
512
|
+
"aria-describedby"
|
|
513
|
+
], be = {
|
|
514
|
+
key: 0,
|
|
515
|
+
class: "text-body-large text-on-surface"
|
|
516
|
+
}, xe = {
|
|
517
|
+
key: 0,
|
|
518
|
+
class: "text-error"
|
|
519
|
+
}, Se = ["id"], Ce = "bg-outline group-hover:bg-on-surface-variant group-active:bg-on-surface-variant peer-focus-visible:bg-on-surface-variant", we = 18, Te = 8, Ee = 125, De = /* @__PURE__ */ _({
|
|
520
|
+
inheritAttrs: !1,
|
|
521
|
+
__name: "MSwitch",
|
|
522
|
+
props: {
|
|
523
|
+
modelValue: { type: Boolean },
|
|
524
|
+
disabled: {
|
|
525
|
+
type: Boolean,
|
|
526
|
+
default: !1
|
|
527
|
+
},
|
|
528
|
+
label: {},
|
|
529
|
+
description: {},
|
|
530
|
+
color: { default: "primary" },
|
|
531
|
+
icon: {
|
|
532
|
+
type: Boolean,
|
|
533
|
+
default: !0
|
|
534
|
+
},
|
|
535
|
+
error: { type: [Boolean, String] },
|
|
536
|
+
errorLabel: {},
|
|
537
|
+
required: { type: Boolean },
|
|
538
|
+
rules: {},
|
|
539
|
+
validateOn: {},
|
|
540
|
+
validateDebounce: {},
|
|
541
|
+
name: {}
|
|
542
|
+
},
|
|
543
|
+
emits: ["update:modelValue", "blur"],
|
|
544
|
+
setup(n, { expose: r, emit: i }) {
|
|
545
|
+
let o = n, _ = i, v = j(null), y = j(null), b = c({
|
|
546
|
+
value: () => o.modelValue,
|
|
547
|
+
rules: () => o.rules,
|
|
548
|
+
required: () => o.required,
|
|
549
|
+
error: () => o.error,
|
|
550
|
+
errorLabel: () => o.errorLabel,
|
|
551
|
+
name: () => o.name,
|
|
552
|
+
validateOn: () => o.validateOn,
|
|
553
|
+
validateDebounce: () => o.validateDebounce,
|
|
554
|
+
disabled: () => o.disabled,
|
|
555
|
+
focus: () => {
|
|
556
|
+
v.value?.focus();
|
|
557
|
+
},
|
|
558
|
+
el: () => v.value,
|
|
559
|
+
setValue: (e) => _("update:modelValue", e)
|
|
560
|
+
}), S = b.disabled, { hasError: T, message: E, messageId: D } = b, O = `${D}-desc`, { rootAttrs: A, inputAttrs: M, attrId: ee } = s();
|
|
561
|
+
function N() {
|
|
562
|
+
return [
|
|
563
|
+
o.description ? O : "",
|
|
564
|
+
E.value ? D : "",
|
|
565
|
+
M()["aria-describedby"]
|
|
566
|
+
].filter(Boolean).join(" ") || void 0;
|
|
567
|
+
}
|
|
568
|
+
let I = {
|
|
569
|
+
primary: "border-primary bg-primary",
|
|
570
|
+
secondary: "border-secondary bg-secondary",
|
|
571
|
+
tertiary: "border-tertiary bg-tertiary",
|
|
572
|
+
error: "border-error bg-error"
|
|
573
|
+
}, L = {
|
|
574
|
+
primary: "bg-on-primary group-hover:bg-primary-container group-active:bg-primary-container peer-focus-visible:bg-primary-container",
|
|
575
|
+
secondary: "bg-on-secondary group-hover:bg-secondary-container group-active:bg-secondary-container peer-focus-visible:bg-secondary-container",
|
|
576
|
+
tertiary: "bg-on-tertiary group-hover:bg-tertiary-container group-active:bg-tertiary-container peer-focus-visible:bg-tertiary-container",
|
|
577
|
+
error: "bg-on-error group-hover:bg-error-container group-active:bg-error-container peer-focus-visible:bg-error-container"
|
|
578
|
+
}, R = {
|
|
579
|
+
primary: "text-on-primary-container",
|
|
580
|
+
secondary: "text-on-secondary-container",
|
|
581
|
+
tertiary: "text-on-tertiary-container",
|
|
582
|
+
error: "text-on-error-container"
|
|
583
|
+
}, V = {
|
|
584
|
+
primary: "bg-primary",
|
|
585
|
+
secondary: "bg-secondary",
|
|
586
|
+
tertiary: "bg-tertiary",
|
|
587
|
+
error: "bg-error"
|
|
588
|
+
}, H = j(!1);
|
|
589
|
+
function U() {
|
|
590
|
+
S.value || (H.value = !0);
|
|
591
|
+
}
|
|
592
|
+
function W() {
|
|
593
|
+
G.value === null && (H.value = !1);
|
|
594
|
+
}
|
|
595
|
+
let G = j(null), K = null, q = !1;
|
|
596
|
+
function te(t) {
|
|
597
|
+
S.value || t.button !== 0 || (K = {
|
|
598
|
+
id: t.pointerId,
|
|
599
|
+
x: t.clientX,
|
|
600
|
+
from: o.modelValue ? we : 0,
|
|
601
|
+
dir: e(t.currentTarget) ? -1 : 1,
|
|
602
|
+
last: []
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
function J(e) {
|
|
606
|
+
if (!K || e.pointerId !== K.id) return;
|
|
607
|
+
let t = (e.clientX - K.x) * K.dir, n = Math.min(we, Math.max(0, K.from + t));
|
|
608
|
+
if (K.last.push({
|
|
609
|
+
t: e.timeStamp,
|
|
610
|
+
x: n
|
|
611
|
+
}), K.last.length > 6 && K.last.shift(), G.value === null) {
|
|
612
|
+
if (Math.abs(t) < Te) return;
|
|
613
|
+
e.currentTarget.setPointerCapture?.(e.pointerId), H.value = !0;
|
|
614
|
+
}
|
|
615
|
+
G.value = n;
|
|
616
|
+
}
|
|
617
|
+
function ne(e) {
|
|
618
|
+
if (!K || e.pointerId !== K.id) return;
|
|
619
|
+
let t = G.value, n = K.last.filter((t) => e.timeStamp - t.t <= 100);
|
|
620
|
+
if (K = null, t === null) return;
|
|
621
|
+
let r = n[0], i = n[n.length - 1], a = r && i && i.t > r.t ? (i.x - r.x) / (i.t - r.t) * 1e3 : 0, s = a >= Ee ? !0 : a <= -125 ? !1 : t >= we / 2;
|
|
622
|
+
G.value = null, H.value = !1, q = !0, setTimeout(() => {
|
|
623
|
+
q = !1;
|
|
624
|
+
}, 0), s !== o.modelValue && _("update:modelValue", s);
|
|
625
|
+
}
|
|
626
|
+
function re() {
|
|
627
|
+
K = null, G.value = null, H.value = !1;
|
|
628
|
+
}
|
|
629
|
+
function Y(e) {
|
|
630
|
+
q && (q = !1, e.preventDefault(), e.stopPropagation());
|
|
631
|
+
}
|
|
632
|
+
let X = u(() => G.value ?? (o.modelValue ? we : 0)), ie = (e) => G.value === null ? e ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1), background-color 280ms ease" : "transform 240ms cubic-bezier(0.2, 0, 0, 1), background-color 240ms ease" : "background-color 280ms ease", ae = u(() => H.value ? 28 / 24 : o.modelValue ? 1 : 16 / 24), Z = u(() => ({
|
|
633
|
+
transform: `translateY(-50%) translateX(calc(${X.value}px * var(--m3-dir, 1))) scale(${ae.value})`,
|
|
634
|
+
transition: ie(o.modelValue)
|
|
635
|
+
})), oe = u(() => ({
|
|
636
|
+
transform: `translateX(calc(${X.value}px * var(--m3-dir, 1)))`,
|
|
637
|
+
transition: G.value === null ? o.modelValue ? "transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1)" : "transform 240ms cubic-bezier(0.2, 0, 0, 1)" : "none"
|
|
638
|
+
}));
|
|
639
|
+
return r({
|
|
640
|
+
validate: b.validate,
|
|
641
|
+
resetValidation: b.resetValidation
|
|
642
|
+
}), (e, r) => B((k(), p("label", x(F(A)(), {
|
|
643
|
+
class: ["group inline-flex gap-3 select-none", [F(S) ? "cursor-not-allowed opacity-[0.38]" : "cursor-pointer", F(E) || n.description ? "items-start" : "items-center"]],
|
|
644
|
+
onPointerdown: U,
|
|
645
|
+
onPointerup: W,
|
|
646
|
+
onPointerleave: W,
|
|
647
|
+
onPointercancel: W,
|
|
648
|
+
onClickCapture: Y
|
|
649
|
+
}), [m("span", ve, [m("span", {
|
|
650
|
+
class: C(["relative inline-flex h-8 w-[52px] touch-pan-y items-center rounded-full border-2 transition-colors duration-200", n.modelValue ? I[n.color] : "border-outline bg-surface-container-highest"]),
|
|
651
|
+
onPointerdown: te,
|
|
652
|
+
onPointermove: J,
|
|
653
|
+
onPointerup: ne,
|
|
654
|
+
onPointercancel: re
|
|
655
|
+
}, [
|
|
656
|
+
m("input", x(F(M)(), {
|
|
657
|
+
type: "checkbox",
|
|
658
|
+
class: "peer sr-only",
|
|
659
|
+
checked: n.modelValue,
|
|
660
|
+
disabled: F(S),
|
|
661
|
+
ref_key: "inputEl",
|
|
662
|
+
ref: v,
|
|
663
|
+
role: "switch",
|
|
664
|
+
name: n.name,
|
|
665
|
+
required: n.required,
|
|
666
|
+
"aria-invalid": F(T) || void 0,
|
|
667
|
+
"aria-describedby": N(),
|
|
668
|
+
onChange: r[0] ||= (e) => _("update:modelValue", !n.modelValue),
|
|
669
|
+
onBlur: r[1] ||= (e) => {
|
|
670
|
+
F(b).onBlur(), _("blur", e);
|
|
671
|
+
}
|
|
672
|
+
}), null, 16, ye),
|
|
673
|
+
F(S) ? f("", !0) : (k(), p("span", {
|
|
674
|
+
key: 0,
|
|
675
|
+
class: C(["pointer-events-none absolute top-1/2 -start-1 h-10 w-10 -translate-y-1/2 rounded-full opacity-0 transition-opacity duration-150 group-hover:opacity-[0.08] group-active:opacity-[0.1] peer-focus-visible:opacity-[0.1]", n.modelValue ? V[n.color] : "bg-on-surface-variant"]),
|
|
676
|
+
style: w(oe.value)
|
|
677
|
+
}, null, 6)),
|
|
678
|
+
F(S) ? f("", !0) : (k(), p("span", {
|
|
679
|
+
key: 1,
|
|
680
|
+
ref_key: "rippleEl",
|
|
681
|
+
ref: y,
|
|
682
|
+
"aria-hidden": "true",
|
|
683
|
+
class: C(["pointer-events-none absolute top-1/2 -start-1 h-10 w-10 -translate-y-1/2 rounded-full", (n.modelValue ? V[n.color] : "bg-on-surface-variant").replace("bg-", "text-")]),
|
|
684
|
+
style: w(oe.value)
|
|
685
|
+
}, null, 6)),
|
|
686
|
+
F(S) ? f("", !0) : (k(), p("span", {
|
|
687
|
+
key: 2,
|
|
688
|
+
class: "pointer-events-none absolute top-1/2 -start-1 h-10 w-10 -translate-y-1/2 rounded-full ring-0 ring-secondary transition-[box-shadow] duration-150 peer-focus-visible:ring-2",
|
|
689
|
+
style: w(oe.value)
|
|
690
|
+
}, null, 4)),
|
|
691
|
+
m("span", {
|
|
692
|
+
class: C(["absolute start-1 top-1/2 flex h-6 w-6 items-center justify-center rounded-full will-change-transform", n.modelValue ? [L[n.color], "shadow-sm"] : Ce]),
|
|
693
|
+
style: w(Z.value)
|
|
694
|
+
}, [g(l, {
|
|
695
|
+
"enter-active-class": "transition-opacity duration-150 delay-[120ms]",
|
|
696
|
+
"enter-from-class": "opacity-0",
|
|
697
|
+
"enter-to-class": "opacity-100",
|
|
698
|
+
"leave-active-class": "transition-opacity duration-75",
|
|
699
|
+
"leave-from-class": "opacity-100",
|
|
700
|
+
"leave-to-class": "opacity-0"
|
|
701
|
+
}, {
|
|
702
|
+
default: z(() => [n.modelValue && n.icon ? (k(), d(t, {
|
|
703
|
+
key: 0,
|
|
704
|
+
name: "check",
|
|
705
|
+
size: 14,
|
|
706
|
+
class: C(R[n.color])
|
|
707
|
+
}, null, 8, ["class"])) : f("", !0)]),
|
|
708
|
+
_: 1
|
|
709
|
+
})], 6)
|
|
710
|
+
], 34)]), n.label || n.description || F(E) ? (k(), p("span", {
|
|
711
|
+
key: 0,
|
|
712
|
+
class: C(["flex flex-col", (F(E) || n.description) && "pt-1"])
|
|
713
|
+
}, [
|
|
714
|
+
n.label ? (k(), p("span", be, [h(P(n.label), 1), n.required ? (k(), p("span", xe, "\xA0*")) : f("", !0)])) : f("", !0),
|
|
715
|
+
n.description ? (k(), p("span", {
|
|
716
|
+
key: 1,
|
|
717
|
+
id: O,
|
|
718
|
+
class: "text-body-medium text-on-surface-variant"
|
|
719
|
+
}, P(n.description), 1)) : f("", !0),
|
|
720
|
+
F(E) ? (k(), p("span", {
|
|
721
|
+
key: 2,
|
|
722
|
+
id: F(D),
|
|
723
|
+
role: "alert",
|
|
724
|
+
class: "text-body-small text-error"
|
|
725
|
+
}, P(F(E)), 9, Se)) : f("", !0)
|
|
726
|
+
], 2)) : f("", !0)], 16)), [[F(a), {
|
|
727
|
+
disabled: F(S),
|
|
728
|
+
layer: () => y.value,
|
|
729
|
+
centered: !0
|
|
730
|
+
}]]);
|
|
731
|
+
}
|
|
732
|
+
});
|
|
733
|
+
// src/composables/_useSegmentRuns.ts
|
|
734
|
+
function Oe(e) {
|
|
735
|
+
let t = N(/* @__PURE__ */ new Map());
|
|
736
|
+
function n() {
|
|
737
|
+
let n = /* @__PURE__ */ new Map(), r = [], i = () => {
|
|
738
|
+
r.forEach((e, t) => n.set(e, r.length === 1 ? "single" : t === 0 ? "first" : t === r.length - 1 ? "last" : "middle")), r = [];
|
|
739
|
+
};
|
|
740
|
+
for (let t of e.value?.children ?? []) t.getAttribute("role") === "listitem" ? r.push(t) : i();
|
|
741
|
+
i(), t.value = n;
|
|
742
|
+
}
|
|
743
|
+
let r;
|
|
744
|
+
return E(() => {
|
|
745
|
+
n(), e.value && (r = new MutationObserver(n), r.observe(e.value, { childList: !0 }));
|
|
746
|
+
}), D(() => r?.disconnect()), (e) => e ? t.value.get(e) : void 0;
|
|
747
|
+
}
|
|
748
|
+
// src/components/MList.vue?vue&type=script&setup=true&lang.ts
|
|
749
|
+
var ke = ["role", "aria-multiselectable"], Ae = 400, je = 8, Me = /* @__PURE__ */ _({
|
|
750
|
+
__name: "MList",
|
|
751
|
+
props: {
|
|
752
|
+
dense: {
|
|
753
|
+
type: Boolean,
|
|
754
|
+
default: !1
|
|
755
|
+
},
|
|
756
|
+
dividers: {
|
|
757
|
+
type: [Boolean, String],
|
|
758
|
+
default: !1
|
|
759
|
+
},
|
|
760
|
+
nav: {
|
|
761
|
+
type: Boolean,
|
|
762
|
+
default: !1
|
|
763
|
+
},
|
|
764
|
+
segmented: {
|
|
765
|
+
type: Boolean,
|
|
766
|
+
default: !1
|
|
767
|
+
},
|
|
768
|
+
selectable: {
|
|
769
|
+
type: Boolean,
|
|
770
|
+
default: !1
|
|
771
|
+
},
|
|
772
|
+
selected: {},
|
|
773
|
+
lines: {},
|
|
774
|
+
multiSelect: { type: Boolean },
|
|
775
|
+
checked: {},
|
|
776
|
+
selectionMode: {
|
|
777
|
+
type: Boolean,
|
|
778
|
+
default: void 0
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
emits: [
|
|
782
|
+
"update:selected",
|
|
783
|
+
"update:checked",
|
|
784
|
+
"update:selectionMode"
|
|
785
|
+
],
|
|
786
|
+
setup(e, { emit: t }) {
|
|
787
|
+
let n = e, r = t, i = j(), a = Oe(i);
|
|
788
|
+
A("m-list", {
|
|
789
|
+
segmentPosition: a,
|
|
790
|
+
dense: u(() => n.dense),
|
|
791
|
+
nav: u(() => n.nav),
|
|
792
|
+
segmented: u(() => n.segmented),
|
|
793
|
+
selectable: u(() => n.selectable),
|
|
794
|
+
selected: u(() => n.selected),
|
|
795
|
+
dividers: u(() => n.dividers),
|
|
796
|
+
lines: u(() => n.lines),
|
|
797
|
+
select: (e) => r("update:selected", e),
|
|
798
|
+
multiSelect: u(() => n.multiSelect),
|
|
799
|
+
selecting: u(() => d.value),
|
|
800
|
+
isChecked: (e) => c.value.has(e),
|
|
801
|
+
toggle: g,
|
|
802
|
+
enterSelection: _,
|
|
803
|
+
register: (e, t) => f.set(e, t),
|
|
804
|
+
unregister: (e) => f.delete(e)
|
|
805
|
+
});
|
|
806
|
+
let o = j(n.checked ?? []);
|
|
807
|
+
R(() => n.checked, (e) => {
|
|
808
|
+
e && (o.value = e);
|
|
809
|
+
});
|
|
810
|
+
let s = u(() => o.value), c = u(() => new Set(s.value)), l = j(!1), d = u(() => n.selectionMode ?? (l.value || s.value.length > 0)), f = /* @__PURE__ */ new WeakMap();
|
|
811
|
+
function m(e) {
|
|
812
|
+
o.value = e, r("update:checked", e), !e.length && n.selectionMode === void 0 && h(!1);
|
|
813
|
+
}
|
|
814
|
+
function h(e) {
|
|
815
|
+
(l.value !== e || n.selectionMode !== void 0) && (l.value = e, r("update:selectionMode", e));
|
|
816
|
+
}
|
|
817
|
+
function g(e) {
|
|
818
|
+
let t = new Set(s.value);
|
|
819
|
+
t.has(e) ? t.delete(e) : t.add(e), m([...t]);
|
|
820
|
+
}
|
|
821
|
+
function _(e) {
|
|
822
|
+
d.value || h(!0), c.value.has(e) || m([...s.value, e]);
|
|
823
|
+
}
|
|
824
|
+
function v() {
|
|
825
|
+
m([]), h(!1);
|
|
826
|
+
}
|
|
827
|
+
let y = () => [...i.value?.querySelectorAll("[data-mli-value]") ?? []], b = null, x = !1;
|
|
828
|
+
function w(e) {
|
|
829
|
+
let t = e.target?.closest?.("[data-mli-value]");
|
|
830
|
+
if (!t || !i.value?.contains(t)) return null;
|
|
831
|
+
let n = e.target.closest("button, a[href], input, select, textarea, [role=\"checkbox\"], [role=\"switch\"]");
|
|
832
|
+
return n && n !== t && t.contains(n) && !n.closest("[data-mli-part]") ? null : t;
|
|
833
|
+
}
|
|
834
|
+
function D(e) {
|
|
835
|
+
if (!n.multiSelect || e.button !== 0) return;
|
|
836
|
+
let t = w(e);
|
|
837
|
+
t && t.getAttribute("aria-disabled") !== "true" && (b = {
|
|
838
|
+
x: e.clientX,
|
|
839
|
+
y: e.clientY,
|
|
840
|
+
row: t,
|
|
841
|
+
base: /* @__PURE__ */ new Set(),
|
|
842
|
+
anchor: -1,
|
|
843
|
+
ranging: !1,
|
|
844
|
+
timer: setTimeout(ee, Ae)
|
|
845
|
+
}, window.addEventListener("pointermove", N), window.addEventListener("pointerup", P), window.addEventListener("pointercancel", F));
|
|
846
|
+
}
|
|
847
|
+
function ee() {
|
|
848
|
+
if (!b) return;
|
|
849
|
+
let e = f.get(b.row);
|
|
850
|
+
e !== void 0 && (_(e), b.base = new Set(s.value), b.anchor = y().indexOf(b.row), b.ranging = !0, x = !0, document.body.style.userSelect = "none");
|
|
851
|
+
}
|
|
852
|
+
function N(e) {
|
|
853
|
+
if (!b) return;
|
|
854
|
+
if (!b.ranging) {
|
|
855
|
+
Math.hypot(e.clientX - b.x, e.clientY - b.y) > je && I();
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
let t = document.elementFromPoint?.(e.clientX, e.clientY)?.closest?.("[data-mli-value]"), n = y(), r = t ? n.indexOf(t) : -1;
|
|
859
|
+
if (r < 0) return;
|
|
860
|
+
let [i, a] = r < b.anchor ? [r, b.anchor] : [b.anchor, r], o = new Set(b.base);
|
|
861
|
+
for (let e = i; e <= a; e++) {
|
|
862
|
+
let t = f.get(n[e]);
|
|
863
|
+
t !== void 0 && n[e].getAttribute("aria-disabled") !== "true" && o.add(t);
|
|
864
|
+
}
|
|
865
|
+
(o.size !== c.value.size || [...o].some((e) => !c.value.has(e))) && m([...o]);
|
|
866
|
+
}
|
|
867
|
+
function P() {
|
|
868
|
+
I();
|
|
869
|
+
}
|
|
870
|
+
function F() {
|
|
871
|
+
I();
|
|
872
|
+
}
|
|
873
|
+
function I() {
|
|
874
|
+
b && (clearTimeout(b.timer), b.ranging && (document.body.style.userSelect = ""), b = null, window.removeEventListener("pointermove", N), window.removeEventListener("pointerup", P), window.removeEventListener("pointercancel", F), x && setTimeout(() => {
|
|
875
|
+
x = !1;
|
|
876
|
+
}, 0));
|
|
877
|
+
}
|
|
878
|
+
function L(e) {
|
|
879
|
+
x && (x = !1, e.preventDefault(), e.stopPropagation());
|
|
880
|
+
}
|
|
881
|
+
function z(e) {
|
|
882
|
+
b?.ranging && e.preventDefault();
|
|
883
|
+
}
|
|
884
|
+
function B(e) {
|
|
885
|
+
n.multiSelect && b && e.preventDefault();
|
|
886
|
+
}
|
|
887
|
+
E(() => i.value?.addEventListener("touchmove", z, { passive: !1 })), T(() => {
|
|
888
|
+
I(), i.value?.removeEventListener("touchmove", z);
|
|
889
|
+
}), R(() => n.multiSelect, (e) => {
|
|
890
|
+
e || I();
|
|
891
|
+
});
|
|
892
|
+
let V = () => [...i.value?.querySelectorAll("[role=\"option\"]") ?? []].filter((e) => e.getAttribute("aria-disabled") !== "true");
|
|
893
|
+
function H(e) {
|
|
894
|
+
if (n.multiSelect && e.key === "Escape" && d.value) {
|
|
895
|
+
e.stopPropagation(), v();
|
|
896
|
+
return;
|
|
897
|
+
}
|
|
898
|
+
if (!n.selectable && !n.multiSelect) return;
|
|
899
|
+
let t = V(), r = t.indexOf(document.activeElement);
|
|
900
|
+
if (r < 0) return;
|
|
901
|
+
let i = e.key === "ArrowDown" ? t[r + 1] : e.key === "ArrowUp" ? t[r - 1] : e.key === "Home" ? t[0] : e.key === "End" ? t[t.length - 1] : void 0;
|
|
902
|
+
i && (e.preventDefault(), i.focus());
|
|
903
|
+
}
|
|
904
|
+
function U() {
|
|
905
|
+
if (!n.selectable && !n.multiSelect) return;
|
|
906
|
+
let e = V();
|
|
907
|
+
e.length && !e.some((e) => e.tabIndex === 0) && (e[0].tabIndex = 0);
|
|
908
|
+
}
|
|
909
|
+
E(U), O(() => S(U));
|
|
910
|
+
let W = u(() => [
|
|
911
|
+
"flex flex-col",
|
|
912
|
+
n.segmented ? "gap-0.5 p-2" : "py-2",
|
|
913
|
+
n.nav && !n.segmented && "gap-0.5 px-3"
|
|
914
|
+
]);
|
|
915
|
+
return (t, n) => (k(), p("ul", {
|
|
916
|
+
ref_key: "listEl",
|
|
917
|
+
ref: i,
|
|
918
|
+
role: e.selectable || e.multiSelect ? "listbox" : "list",
|
|
919
|
+
"aria-multiselectable": e.multiSelect || void 0,
|
|
920
|
+
class: C(W.value),
|
|
921
|
+
onKeydown: H,
|
|
922
|
+
onPointerdown: D,
|
|
923
|
+
onClickCapture: L,
|
|
924
|
+
onContextmenu: B
|
|
925
|
+
}, [M(t.$slots, "default")], 42, ke));
|
|
926
|
+
}
|
|
927
|
+
}), Ne = [
|
|
928
|
+
"tabindex",
|
|
929
|
+
"aria-expanded",
|
|
930
|
+
"aria-controls",
|
|
931
|
+
"aria-disabled"
|
|
932
|
+
], Pe = { class: "min-w-0 flex-1" }, Fe = ["id"], Ie = {
|
|
933
|
+
key: 1,
|
|
934
|
+
"data-mli-leading": "",
|
|
935
|
+
class: "flex h-10 w-10 shrink-0 items-center justify-center rounded-full bg-primary text-on-primary"
|
|
936
|
+
}, Le = {
|
|
937
|
+
key: 2,
|
|
938
|
+
"data-mli-leading": "",
|
|
939
|
+
class: "contents"
|
|
940
|
+
}, Re = ["src"], ze = ["src"], Be = { class: "min-w-0 flex-1" }, Ve = 4, He = 8, Ue = 16, We = "button, a, input, select, textarea, label, [role=\"button\"], [role=\"switch\"], [role=\"checkbox\"], [role=\"radio\"], [role=\"link\"], [tabindex]", Ge = /* @__PURE__ */ _({
|
|
941
|
+
inheritAttrs: !1,
|
|
942
|
+
__name: "MListItem",
|
|
943
|
+
props: {
|
|
944
|
+
title: {},
|
|
945
|
+
overline: {},
|
|
946
|
+
subtitle: {},
|
|
947
|
+
description: {},
|
|
948
|
+
lines: {},
|
|
949
|
+
icon: {},
|
|
950
|
+
leading: {},
|
|
951
|
+
avatarName: {},
|
|
952
|
+
avatarSrc: {},
|
|
953
|
+
image: {},
|
|
954
|
+
iconContainerColor: {},
|
|
955
|
+
trailingIcon: {},
|
|
956
|
+
trailingText: {},
|
|
957
|
+
trailing: {},
|
|
958
|
+
trailingValue: { type: Boolean },
|
|
959
|
+
value: {},
|
|
960
|
+
active: {
|
|
961
|
+
type: Boolean,
|
|
962
|
+
default: !1
|
|
963
|
+
},
|
|
964
|
+
disabled: {
|
|
965
|
+
type: Boolean,
|
|
966
|
+
default: !1
|
|
967
|
+
},
|
|
968
|
+
clickable: { type: Boolean },
|
|
969
|
+
href: {},
|
|
970
|
+
to: {},
|
|
971
|
+
expandable: {
|
|
972
|
+
type: Boolean,
|
|
973
|
+
default: !1
|
|
974
|
+
},
|
|
975
|
+
expanded: { type: Boolean },
|
|
976
|
+
indent: {}
|
|
977
|
+
},
|
|
978
|
+
emits: [
|
|
979
|
+
"click",
|
|
980
|
+
"update:trailingValue",
|
|
981
|
+
"update:expanded"
|
|
982
|
+
],
|
|
983
|
+
setup(e, { emit: n }) {
|
|
984
|
+
let r = e, i = n, s = v(), c = () => !!s?.vnode.props?.onClick, h = j(r.expanded ?? !1);
|
|
985
|
+
R(() => r.expanded, (e) => {
|
|
986
|
+
e !== void 0 && (h.value = e);
|
|
987
|
+
});
|
|
988
|
+
let _ = u(() => h.value), S = b("m-list", null), T = u(() => !!S?.multiSelect?.value && r.value != null && !r.href && !r.to && !r.expandable), E = u(() => T.value && !!S?.isChecked?.(r.value)), D = u(() => !!S?.selecting?.value), O = u(() => r.lines ? r.lines : S?.lines.value ? S.lines.value : r.description || r.overline && r.subtitle ? 3 : r.subtitle || r.overline ? 2 : 1), A = u(() => r.clickable || r.href || r.to || c() || S?.selectable.value || r.expandable || T.value), N = u(() => (!!S?.selectable.value || T.value) && r.value != null && !r.href && !r.to && !r.expandable), L = u(() => !!(r.href || r.to)), V = u(() => !N.value && !L.value && !r.expandable && (r.clickable || c())), H = u(() => L.value || V.value), U = u(() => N.value ? "option" : V.value ? "button" : L.value ? void 0 : "listitem"), W = u(() => {
|
|
989
|
+
if (N.value && T.value) return -1;
|
|
990
|
+
if (N.value) return K.value && !r.disabled ? 0 : -1;
|
|
991
|
+
if (V.value) return r.disabled ? -1 : 0;
|
|
992
|
+
});
|
|
993
|
+
function G(e) {
|
|
994
|
+
(N.value || V.value) && (e.key !== "Enter" && e.key !== " " || e.target !== e.currentTarget || (e.preventDefault(), T.value && !r.disabled && (e.key === " " || D.value) ? D.value ? S.toggle(r.value) : S.enterSelection(r.value) : Ge(e)));
|
|
995
|
+
}
|
|
996
|
+
let K = u(() => r.active ? !0 : T.value ? E.value : S?.selectable.value && r.value != null ? S.selected.value === r.value : !1), q = u(() => r.leading ? r.leading : r.icon ? "icon" : r.avatarName || r.avatarSrc ? "avatar" : r.image ? "image" : null), J = u(() => r.expandable ? "expand" : r.trailing ? r.trailing : r.trailingIcon ? "icon" : r.trailingText ? "text" : null), ne = {
|
|
997
|
+
primary: "bg-primary-container text-on-primary-container",
|
|
998
|
+
secondary: "bg-secondary-container text-on-secondary-container",
|
|
999
|
+
tertiary: "bg-tertiary-container text-on-tertiary-container",
|
|
1000
|
+
error: "bg-error-container text-on-error-container",
|
|
1001
|
+
success: "bg-success-container text-on-success-container",
|
|
1002
|
+
warning: "bg-warning-container text-on-warning-container"
|
|
1003
|
+
}, re = u(() => S?.dense.value ?? !1), Y = u(() => S?.nav.value ?? !1), X = u(() => S?.segmented.value ?? !1), ie = u(() => S?.dividers.value ?? !1), ae = u(() => K.value ? "text-on-secondary-container" : "text-on-surface"), Z = u(() => K.value ? "text-on-secondary-container" : "text-on-surface-variant"), oe = u(() => re.value ? "" : O.value === 3 ? "min-h-22" : O.value === 2 ? "min-h-18" : "min-h-14"), se = u(() => [
|
|
1004
|
+
"mli-row relative flex w-full items-center gap-4 text-start",
|
|
1005
|
+
X.value ? "bg-surface-container px-4" : Y.value ? "rounded-full px-4" : "px-4",
|
|
1006
|
+
re.value ? "py-1" : O.value === 3 ? "py-3" : "py-2",
|
|
1007
|
+
oe.value,
|
|
1008
|
+
A.value && !r.disabled && "cursor-pointer",
|
|
1009
|
+
K.value && "bg-secondary-container text-on-secondary-container",
|
|
1010
|
+
r.disabled && "opacity-[0.38] pointer-events-none"
|
|
1011
|
+
]), Q = j(null), ce = j(null), le = (e, { slots: t }) => H.value ? y("li", {
|
|
1012
|
+
role: "listitem",
|
|
1013
|
+
ref: (e) => {
|
|
1014
|
+
ce.value = e;
|
|
1015
|
+
}
|
|
1016
|
+
}, t.default?.()) : t.default?.(), ue = j(null), de = (e) => e && "$el" in e ? e.$el : e, pe = j(!1), $ = j(!1), me = j(!1), he = u(() => X.value ? S?.segmentPosition(H.value ? ce.value : de(Q.value)) : void 0), ge = u(() => {
|
|
1017
|
+
if (Y.value) return [];
|
|
1018
|
+
let e = A.value && !r.disabled, t = e && $.value || K.value || e && me.value ? Ue : e && pe.value ? He : null;
|
|
1019
|
+
if (t !== null) return [
|
|
1020
|
+
t,
|
|
1021
|
+
t,
|
|
1022
|
+
t,
|
|
1023
|
+
t
|
|
1024
|
+
];
|
|
1025
|
+
let n = he.value, i = n === "first" || n === "single" ? Ue : Ve, a = n === "last" || n === "single" ? Ue : Ve;
|
|
1026
|
+
return [
|
|
1027
|
+
i,
|
|
1028
|
+
i,
|
|
1029
|
+
a,
|
|
1030
|
+
a
|
|
1031
|
+
];
|
|
1032
|
+
}), { snap: _e } = o(() => ge.value, (e) => {
|
|
1033
|
+
let t = ue.value ?? de(Q.value);
|
|
1034
|
+
t && (t.style.borderRadius = e.length ? e.map((e) => `${e}px`).join(" ") : "");
|
|
1035
|
+
});
|
|
1036
|
+
R([he, Y], () => _e());
|
|
1037
|
+
function ve(e) {
|
|
1038
|
+
let t = e.currentTarget, n = e.target?.closest?.(We);
|
|
1039
|
+
return !!n && n !== t && t.contains(n) && !n.closest("[data-mli-part]");
|
|
1040
|
+
}
|
|
1041
|
+
function ye(e) {
|
|
1042
|
+
e.pointerType !== "touch" && (pe.value = !ve(e));
|
|
1043
|
+
}
|
|
1044
|
+
function be() {
|
|
1045
|
+
pe.value = !1, $.value = !1;
|
|
1046
|
+
}
|
|
1047
|
+
function xe(e) {
|
|
1048
|
+
e.button === 0 && !ve(e) && ($.value = !0);
|
|
1049
|
+
}
|
|
1050
|
+
function Se() {
|
|
1051
|
+
$.value = !1;
|
|
1052
|
+
}
|
|
1053
|
+
let Ce = u(() => !A.value || r.disabled ? 0 : $.value || me.value ? .1 : pe.value ? .08 : 0), we = u(() => r.indent === void 0 ? void 0 : { paddingInlineStart: typeof r.indent == "number" ? `${r.indent}px` : r.indent });
|
|
1054
|
+
function Te(e) {
|
|
1055
|
+
me.value = e.currentTarget.matches(":focus-visible");
|
|
1056
|
+
}
|
|
1057
|
+
function Ee() {
|
|
1058
|
+
me.value = !1;
|
|
1059
|
+
}
|
|
1060
|
+
let Oe = u(() => r.href ? "a" : r.to ? "router-link" : V.value ? "div" : "li"), ke = u(() => r.href ? { href: r.href } : r.to ? { to: r.to } : {}), Ae = I();
|
|
1061
|
+
function je(e) {
|
|
1062
|
+
(e.key === "Enter" || e.key === " ") && e.target === e.currentTarget && (e.preventDefault(), Ge(e));
|
|
1063
|
+
}
|
|
1064
|
+
function Me(e) {
|
|
1065
|
+
r.disabled || (h.value = !h.value, i("update:expanded", h.value), i("click", e));
|
|
1066
|
+
}
|
|
1067
|
+
function Ge(e) {
|
|
1068
|
+
if (!r.disabled) {
|
|
1069
|
+
if (r.expandable) {
|
|
1070
|
+
if (ve(e)) return;
|
|
1071
|
+
Me(e);
|
|
1072
|
+
} else {
|
|
1073
|
+
if (T.value) {
|
|
1074
|
+
if (D.value) {
|
|
1075
|
+
S.toggle(r.value);
|
|
1076
|
+
return;
|
|
1077
|
+
}
|
|
1078
|
+
if (e.target?.closest?.("[data-mli-leading]")) {
|
|
1079
|
+
S.enterSelection(r.value);
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
S?.selectable.value && r.value != null && S.select(r.value), i("click", e);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
R([
|
|
1088
|
+
Q,
|
|
1089
|
+
() => r.value,
|
|
1090
|
+
T
|
|
1091
|
+
], ([e, t, n], r, i) => {
|
|
1092
|
+
if (!e || t == null || !n || !S?.register) return;
|
|
1093
|
+
let a = e;
|
|
1094
|
+
S.register(a, t), i(() => S.unregister?.(a));
|
|
1095
|
+
}, {
|
|
1096
|
+
immediate: !0,
|
|
1097
|
+
flush: "post"
|
|
1098
|
+
});
|
|
1099
|
+
function Ke() {
|
|
1100
|
+
i("update:trailingValue", !r.trailingValue);
|
|
1101
|
+
}
|
|
1102
|
+
return (n, r) => e.expandable ? (k(), p("li", x({
|
|
1103
|
+
key: 0,
|
|
1104
|
+
ref_key: "rootEl",
|
|
1105
|
+
ref: Q
|
|
1106
|
+
}, n.$attrs, { role: "listitem" }), [B((k(), p("div", {
|
|
1107
|
+
ref_key: "shapeEl",
|
|
1108
|
+
ref: ue,
|
|
1109
|
+
role: "button",
|
|
1110
|
+
tabindex: e.disabled ? -1 : 0,
|
|
1111
|
+
"aria-expanded": _.value,
|
|
1112
|
+
"aria-controls": F(Ae),
|
|
1113
|
+
"aria-disabled": e.disabled || void 0,
|
|
1114
|
+
class: C(["focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-secondary", se.value]),
|
|
1115
|
+
onClick: Ge,
|
|
1116
|
+
onKeydown: je,
|
|
1117
|
+
onFocus: Te,
|
|
1118
|
+
onBlur: Ee,
|
|
1119
|
+
onPointerenter: ye,
|
|
1120
|
+
onPointermove: ye,
|
|
1121
|
+
onPointerleave: be,
|
|
1122
|
+
onPointerdown: xe,
|
|
1123
|
+
onPointerup: Se,
|
|
1124
|
+
onPointercancel: Se
|
|
1125
|
+
}, [
|
|
1126
|
+
m("span", {
|
|
1127
|
+
class: C(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", K.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
1128
|
+
style: w({ opacity: Ce.value }),
|
|
1129
|
+
"aria-hidden": "true"
|
|
1130
|
+
}, null, 6),
|
|
1131
|
+
M(n.$slots, "leading", {}, () => [q.value === "icon" ? (k(), d(t, {
|
|
1132
|
+
key: 0,
|
|
1133
|
+
name: e.icon,
|
|
1134
|
+
size: 24,
|
|
1135
|
+
class: C(["shrink-0", Z.value])
|
|
1136
|
+
}, null, 8, ["name", "class"])) : f("", !0)]),
|
|
1137
|
+
m("div", Pe, [M(n.$slots, "overline", {}, () => [e.overline ? (k(), p("p", {
|
|
1138
|
+
key: 0,
|
|
1139
|
+
class: C(["truncate text-label-small", Z.value])
|
|
1140
|
+
}, P(e.overline), 3)) : f("", !0)]), M(n.$slots, "default", {}, () => [m("p", { class: C(["truncate text-body-large", ae.value]) }, P(e.title), 3), e.subtitle && O.value >= 2 ? (k(), p("p", {
|
|
1141
|
+
key: 0,
|
|
1142
|
+
class: C(["text-body-medium", [Z.value, O.value === 2 && "truncate"]])
|
|
1143
|
+
}, P(e.subtitle), 3)) : f("", !0)])]),
|
|
1144
|
+
M(n.$slots, "trailing"),
|
|
1145
|
+
g(t, {
|
|
1146
|
+
name: _.value ? "expand_less" : "expand_more",
|
|
1147
|
+
size: 20,
|
|
1148
|
+
class: C(["shrink-0", Z.value])
|
|
1149
|
+
}, null, 8, ["name", "class"])
|
|
1150
|
+
], 42, Ne)), [[F(a), { disabled: e.disabled }]]), g(l, { name: "mli-expand" }, {
|
|
1151
|
+
default: z(() => [_.value ? (k(), p("div", {
|
|
1152
|
+
key: 0,
|
|
1153
|
+
id: F(Ae),
|
|
1154
|
+
class: "mli-expand-grid"
|
|
1155
|
+
}, [m("div", {
|
|
1156
|
+
class: "mli-expand-body",
|
|
1157
|
+
style: w(we.value)
|
|
1158
|
+
}, [M(n.$slots, "children")], 4)], 8, Fe)) : f("", !0)]),
|
|
1159
|
+
_: 3
|
|
1160
|
+
})], 16)) : (k(), d(le, { key: 1 }, {
|
|
1161
|
+
default: z(() => [B((k(), d(ee(Oe.value), x({
|
|
1162
|
+
class: se.value,
|
|
1163
|
+
ref_key: "rootEl",
|
|
1164
|
+
ref: Q
|
|
1165
|
+
}, {
|
|
1166
|
+
...ke.value,
|
|
1167
|
+
...n.$attrs
|
|
1168
|
+
}, {
|
|
1169
|
+
role: U.value,
|
|
1170
|
+
tabindex: W.value,
|
|
1171
|
+
"data-mli-value": T.value ? "" : void 0,
|
|
1172
|
+
"aria-selected": N.value ? K.value : void 0,
|
|
1173
|
+
"aria-disabled": (N.value || V.value) && e.disabled ? "true" : void 0,
|
|
1174
|
+
onClick: Ge,
|
|
1175
|
+
onKeydown: G,
|
|
1176
|
+
onPointerenter: ye,
|
|
1177
|
+
onPointermove: ye,
|
|
1178
|
+
onPointerleave: be,
|
|
1179
|
+
onPointerdown: xe,
|
|
1180
|
+
onPointerup: Se,
|
|
1181
|
+
onPointercancel: Se,
|
|
1182
|
+
onFocus: Te,
|
|
1183
|
+
onBlur: Ee
|
|
1184
|
+
}), {
|
|
1185
|
+
default: z(() => [
|
|
1186
|
+
m("span", {
|
|
1187
|
+
class: C(["mli-state-layer pointer-events-none absolute inset-0 rounded-[inherit]", K.value ? "bg-on-secondary-container" : "bg-on-surface"]),
|
|
1188
|
+
style: w({ opacity: Ce.value }),
|
|
1189
|
+
"aria-hidden": "true"
|
|
1190
|
+
}, null, 6),
|
|
1191
|
+
ie.value ? (k(), p("div", {
|
|
1192
|
+
key: 0,
|
|
1193
|
+
class: C(["absolute top-0 end-0 h-px bg-outline-variant", ie.value === "inset" ? "start-16" : "start-0"])
|
|
1194
|
+
}, null, 2)) : f("", !0),
|
|
1195
|
+
T.value && E.value && q.value && q.value !== "checkbox" && q.value !== "radio" && !n.$slots.leading ? (k(), p("span", Ie, [g(t, {
|
|
1196
|
+
name: "check",
|
|
1197
|
+
size: 24
|
|
1198
|
+
})])) : T.value ? (k(), p("span", Le, [M(n.$slots, "leading", {
|
|
1199
|
+
checked: E.value,
|
|
1200
|
+
selecting: D.value
|
|
1201
|
+
}, () => [q.value === "icon" ? (k(), d(t, {
|
|
1202
|
+
key: 0,
|
|
1203
|
+
name: e.icon,
|
|
1204
|
+
size: 24,
|
|
1205
|
+
class: C(["shrink-0", Z.value])
|
|
1206
|
+
}, null, 8, ["name", "class"])) : q.value === "icon-container" ? (k(), p("div", {
|
|
1207
|
+
key: 1,
|
|
1208
|
+
class: C(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ne[e.iconContainerColor || "primary"]])
|
|
1209
|
+
}, [g(t, {
|
|
1210
|
+
name: e.icon,
|
|
1211
|
+
size: 24
|
|
1212
|
+
}, null, 8, ["name"])], 2)) : q.value === "avatar" ? (k(), d(te, {
|
|
1213
|
+
key: 2,
|
|
1214
|
+
name: e.avatarName,
|
|
1215
|
+
src: e.avatarSrc,
|
|
1216
|
+
size: 40,
|
|
1217
|
+
class: "shrink-0"
|
|
1218
|
+
}, null, 8, ["name", "src"])) : q.value === "image" ? (k(), p("img", {
|
|
1219
|
+
key: 3,
|
|
1220
|
+
src: e.image,
|
|
1221
|
+
alt: "",
|
|
1222
|
+
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
1223
|
+
}, null, 8, Re)) : q.value === "checkbox" ? (k(), d(fe, {
|
|
1224
|
+
key: 4,
|
|
1225
|
+
"model-value": E.value,
|
|
1226
|
+
class: "shrink-0",
|
|
1227
|
+
"data-mli-part": ""
|
|
1228
|
+
}, null, 8, ["model-value"])) : f("", !0)])])) : M(n.$slots, "leading", {
|
|
1229
|
+
checked: !1,
|
|
1230
|
+
selecting: !1
|
|
1231
|
+
}, () => [q.value === "icon" ? (k(), d(t, {
|
|
1232
|
+
key: 0,
|
|
1233
|
+
name: e.icon,
|
|
1234
|
+
size: 24,
|
|
1235
|
+
class: C(["shrink-0", Z.value])
|
|
1236
|
+
}, null, 8, ["name", "class"])) : q.value === "icon-container" ? (k(), p("div", {
|
|
1237
|
+
key: 1,
|
|
1238
|
+
class: C(["flex h-10 w-10 shrink-0 items-center justify-center rounded-full", ne[e.iconContainerColor || "primary"]])
|
|
1239
|
+
}, [g(t, {
|
|
1240
|
+
name: e.icon,
|
|
1241
|
+
size: 24
|
|
1242
|
+
}, null, 8, ["name"])], 2)) : q.value === "avatar" ? (k(), d(te, {
|
|
1243
|
+
key: 2,
|
|
1244
|
+
name: e.avatarName,
|
|
1245
|
+
src: e.avatarSrc,
|
|
1246
|
+
size: 40,
|
|
1247
|
+
class: "shrink-0"
|
|
1248
|
+
}, null, 8, ["name", "src"])) : q.value === "image" ? (k(), p("img", {
|
|
1249
|
+
key: 3,
|
|
1250
|
+
src: e.image,
|
|
1251
|
+
alt: "",
|
|
1252
|
+
class: "h-14 w-14 shrink-0 rounded-md object-cover"
|
|
1253
|
+
}, null, 8, ze)) : q.value === "checkbox" ? (k(), d(fe, {
|
|
1254
|
+
key: 4,
|
|
1255
|
+
"model-value": K.value,
|
|
1256
|
+
class: "shrink-0",
|
|
1257
|
+
"data-mli-part": ""
|
|
1258
|
+
}, null, 8, ["model-value"])) : f("", !0)], void 0, 3),
|
|
1259
|
+
m("div", Be, [M(n.$slots, "overline", {}, () => [e.overline ? (k(), p("p", {
|
|
1260
|
+
key: 0,
|
|
1261
|
+
class: C(["truncate text-label-small", Z.value])
|
|
1262
|
+
}, P(e.overline), 3)) : f("", !0)]), M(n.$slots, "default", {}, () => [
|
|
1263
|
+
m("p", { class: C(["truncate text-body-large", ae.value]) }, P(e.title), 3),
|
|
1264
|
+
e.subtitle && O.value >= 2 ? (k(), p("p", {
|
|
1265
|
+
key: 0,
|
|
1266
|
+
class: C(["text-body-medium", [Z.value, O.value === 2 && "truncate"]])
|
|
1267
|
+
}, P(e.subtitle), 3)) : f("", !0),
|
|
1268
|
+
e.description && O.value >= 3 ? (k(), p("p", {
|
|
1269
|
+
key: 1,
|
|
1270
|
+
class: C(["line-clamp-2 text-body-small", Z.value])
|
|
1271
|
+
}, P(e.description), 3)) : f("", !0)
|
|
1272
|
+
])]),
|
|
1273
|
+
M(n.$slots, "trailing", {}, () => [J.value === "icon" ? (k(), d(t, {
|
|
1274
|
+
key: 0,
|
|
1275
|
+
name: e.trailingIcon,
|
|
1276
|
+
size: 24,
|
|
1277
|
+
class: C(["shrink-0", Z.value])
|
|
1278
|
+
}, null, 8, ["name", "class"])) : J.value === "text" ? (k(), p("span", {
|
|
1279
|
+
key: 1,
|
|
1280
|
+
class: C(["shrink-0 text-label-small", Z.value])
|
|
1281
|
+
}, P(e.trailingText), 3)) : J.value === "switch" ? (k(), d(De, {
|
|
1282
|
+
key: 2,
|
|
1283
|
+
"model-value": !!e.trailingValue,
|
|
1284
|
+
"onUpdate:modelValue": Ke
|
|
1285
|
+
}, null, 8, ["model-value"])) : J.value === "checkbox" ? (k(), d(fe, {
|
|
1286
|
+
key: 3,
|
|
1287
|
+
"model-value": !!e.trailingValue,
|
|
1288
|
+
"onUpdate:modelValue": Ke
|
|
1289
|
+
}, null, 8, ["model-value"])) : f("", !0)])
|
|
1290
|
+
]),
|
|
1291
|
+
_: 3
|
|
1292
|
+
}, 16, [
|
|
1293
|
+
"class",
|
|
1294
|
+
"role",
|
|
1295
|
+
"tabindex",
|
|
1296
|
+
"data-mli-value",
|
|
1297
|
+
"aria-selected",
|
|
1298
|
+
"aria-disabled"
|
|
1299
|
+
])), [[F(a), A.value ? { disabled: e.disabled } : !1]])]),
|
|
1300
|
+
_: 3
|
|
1301
|
+
}));
|
|
1302
|
+
}
|
|
1303
|
+
});
|
|
1304
|
+
export { _e as a, te as c, De as i, W as l, Me as n, fe as o, Oe as r, oe as s, Ge as t };
|
|
1305
|
+
|
|
1306
|
+
//# sourceMappingURL=MListItem-CgdM5sco.js.map
|