@m3ui-vue/m3ui-vue 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/API.md +43 -32
- package/dist/{MButton-D_uxtJa-.js → MButton-CPghlKb0.js} +8 -9
- package/dist/MButton-CPghlKb0.js.map +1 -0
- package/dist/{MDialog-DT4KAPmn.js → MDialog-X50At1Gk.js} +38 -44
- package/dist/MDialog-X50At1Gk.js.map +1 -0
- package/dist/{MIcon-Bxh9j135.js → MIcon-DpajuUTJ.js} +2 -3
- package/dist/MIcon-DpajuUTJ.js.map +1 -0
- package/dist/{MIconButton-DoNotQ9v.js → MIconButton-BBggVwBV.js} +5 -6
- package/dist/MIconButton-BBggVwBV.js.map +1 -0
- package/dist/{MListItem-CwYrxpPZ.js → MListItem-DVi1j1QI.js} +8 -14
- package/dist/MListItem-DVi1j1QI.js.map +1 -0
- package/dist/{MLoadingIndicator-DhzECYRI.js → MLoadingIndicator-vooA3110.js} +3 -4
- package/dist/MLoadingIndicator-vooA3110.js.map +1 -0
- package/dist/{MMenuItem-Bih0h4-n.js → MMenuItem-CRNZkVVr.js} +13 -25
- package/dist/MMenuItem-CRNZkVVr.js.map +1 -0
- package/dist/{MProgressBar-BCoruxA-.js → MProgressBar-BWly1UKN.js} +3 -8
- package/dist/MProgressBar-BWly1UKN.js.map +1 -0
- package/dist/{MSeekBar-DQPF5FTp.js → MSeekBar-BL2W5_rD.js} +4 -5
- package/dist/MSeekBar-BL2W5_rD.js.map +1 -0
- package/dist/{MSegmentedButton-DL9JtJFX.js → MSegmentedButton-BEB4gXLA.js} +3 -4
- package/dist/MSegmentedButton-BEB4gXLA.js.map +1 -0
- package/dist/{MSlider-BvoMZTy9.js → MSlider-B9NcKTmZ.js} +22 -23
- package/dist/MSlider-B9NcKTmZ.js.map +1 -0
- package/dist/{MSpinner-CgcCQhS9.js → MSpinner-_XpTRkAg.js} +3 -4
- package/dist/MSpinner-_XpTRkAg.js.map +1 -0
- package/dist/{MTextField-B72dwF6V.js → MTextField-DpcPmR5B.js} +119 -89
- package/dist/MTextField-DpcPmR5B.js.map +1 -0
- package/dist/{MTooltip-YyF1CO75.js → MTooltip-BL3jPYPT.js} +10 -12
- package/dist/MTooltip-BL3jPYPT.js.map +1 -0
- package/dist/THIRD_PARTY_LICENSES.md +2 -2
- package/dist/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
- package/dist/{_storageKeys-CYXsUBwK.js → _storageKeys-C4W_4xK4.js} +2 -3
- package/dist/_storageKeys-C4W_4xK4.js.map +1 -0
- package/dist/{_useEscapeStack-CjndQhqg.js → _useEscapeStack-C5-BYr8y.js} +2 -3
- package/dist/_useEscapeStack-C5-BYr8y.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/barcode.js +1 -2
- package/dist/barcode.js.map +1 -1
- package/dist/chart.js +2 -4
- package/dist/chart.js.map +1 -1
- package/dist/code-editor.js +22 -23
- package/dist/code-editor.js.map +1 -1
- package/dist/{common-0dgrgaPL.js → common-kIb6A2Qu.js} +8 -37
- package/dist/common-kIb6A2Qu.js.map +1 -0
- package/dist/components/MAbsolute.vue.d.ts +5 -3
- package/dist/components/MAlert.vue.d.ts +8 -6
- package/dist/components/MAppBar.vue.d.ts +9 -7
- package/dist/components/MAppBarWithSearch.vue.d.ts +15 -13
- package/dist/components/MAppLayout.vue.d.ts +13 -11
- package/dist/components/MAspectRatio.vue.d.ts +5 -3
- package/dist/components/MAudioPlayer.vue.d.ts +22 -20
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +19 -17
- package/dist/components/MBadge.vue.d.ts +6 -4
- package/dist/components/MBar.vue.d.ts +14 -12
- package/dist/components/MBarcode.vue.d.ts +5 -3
- package/dist/components/MBeforeAfter.vue.d.ts +12 -10
- package/dist/components/MBodyMap.vue.d.ts +1 -1
- package/dist/components/MBottomAppBar.vue.d.ts +10 -8
- package/dist/components/MBottomSheet.vue.d.ts +8 -6
- package/dist/components/MBottomSheetScaffold.vue.d.ts +9 -7
- package/dist/components/MBox.vue.d.ts +6 -4
- package/dist/components/MButton.vue.d.ts +7 -5
- package/dist/components/MCard.vue.d.ts +12 -10
- package/dist/components/MCenter.vue.d.ts +5 -3
- package/dist/components/MChatBubble.vue.d.ts +6 -4
- package/dist/components/MCheckbox.vue.d.ts +5 -3
- package/dist/components/MChip.vue.d.ts +9 -7
- package/dist/components/MCircleProgressBar.vue.d.ts +6 -4
- package/dist/components/MCodeEditor.vue.d.ts +5 -3
- package/dist/components/MContainer.vue.d.ts +6 -4
- package/dist/components/MContextMenu.vue.d.ts +8 -6
- package/dist/components/MCopyButton.vue.d.ts +1 -1
- package/dist/components/MDataTable.vue.d.ts +21 -19
- package/dist/components/MDialog.vue.d.ts +21 -19
- package/dist/components/MDragHandle.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +5 -3
- package/dist/components/MDrawToolbar.vue.d.ts +7 -5
- package/dist/components/MEmptyState.vue.d.ts +5 -3
- package/dist/components/MExpansionPanel.vue.d.ts +6 -4
- package/dist/components/MExportButton.vue.d.ts +7 -5
- package/dist/components/MFab.vue.d.ts +11 -9
- package/dist/components/MFabMenu.vue.d.ts +3 -3
- package/dist/components/MFixed.vue.d.ts +5 -3
- package/dist/components/MFlex.vue.d.ts +7 -5
- package/dist/components/MFloorPlan.vue.d.ts +3 -3
- package/dist/components/MFloorPlanInspector.vue.d.ts +32 -30
- package/dist/components/MFloorPlanToolbar.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +4 -4
- package/dist/components/MFlowControls.vue.d.ts +6 -4
- package/dist/components/MFlowHandle.vue.d.ts +1 -1
- package/dist/components/MFlowNode.vue.d.ts +11 -9
- package/dist/components/MFooter.vue.d.ts +12 -10
- package/dist/components/MFullscreen.vue.d.ts +5 -3
- package/dist/components/MGantt.vue.d.ts +33 -31
- package/dist/components/MGanttControls.vue.d.ts +8 -6
- package/dist/components/MGrid.vue.d.ts +6 -4
- package/dist/components/MIcon.vue.d.ts +5 -0
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MImageCropper.vue.d.ts +14 -12
- package/dist/components/MInfiniteScroll.vue.d.ts +11 -9
- package/dist/components/MList.vue.d.ts +5 -3
- package/dist/components/MListGroup.vue.d.ts +7 -5
- package/dist/components/MListItem.vue.d.ts +21 -19
- package/dist/components/MListSubheader.vue.d.ts +5 -3
- package/dist/components/MLoadingOverlay.vue.d.ts +10 -8
- package/dist/components/MMap.vue.d.ts +14 -6
- package/dist/components/MMapControl.vue.d.ts +12 -10
- package/dist/components/MMapFeatureInfo.vue.d.ts +11 -9
- package/dist/components/MMapIdentify.vue.d.ts +9 -7
- package/dist/components/MMapLayers.vue.d.ts +13 -11
- package/dist/components/MMapMarker.vue.d.ts +7 -5
- package/dist/components/MMapPopup.vue.d.ts +5 -3
- package/dist/components/MMasonry.vue.d.ts +5 -3
- package/dist/components/MMenu.vue.d.ts +12 -10
- package/dist/components/MMenuItem.vue.d.ts +11 -9
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +6 -4
- package/dist/components/MNavigationDrawer.vue.d.ts +14 -12
- package/dist/components/MNavigationRail.vue.d.ts +7 -5
- package/dist/components/MOdontogram.vue.d.ts +1 -1
- package/dist/components/MOrderBook.vue.d.ts +1 -1
- package/dist/components/MOverlay.vue.d.ts +5 -3
- package/dist/components/MPdfViewer.vue.d.ts +4 -4
- package/dist/components/MPhoneInput.vue.d.ts +11 -9
- package/dist/components/MPosKeypad.vue.d.ts +18 -16
- package/dist/components/MProgressBar.vue.d.ts +1 -1
- package/dist/components/MPullToRefresh.vue.d.ts +5 -3
- package/dist/components/MQRCode.vue.d.ts +7 -5
- package/dist/components/MRadioGroup.vue.d.ts +1 -1
- package/dist/components/MReceipt.vue.d.ts +2 -2
- package/dist/components/MRelative.vue.d.ts +5 -3
- package/dist/components/MResourceTimeline.vue.d.ts +31 -29
- package/dist/components/MResponsive.vue.d.ts +5 -3
- package/dist/components/MResult.vue.d.ts +7 -5
- package/dist/components/MScrollable.vue.d.ts +7 -5
- package/dist/components/MSearchBar.vue.d.ts +13 -11
- package/dist/components/MSearchField.vue.d.ts +7 -5
- package/dist/components/MSection.vue.d.ts +11 -9
- package/dist/components/MSeekBar.vue.d.ts +3 -3
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShader.vue.d.ts +11 -9
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSideSheet.vue.d.ts +9 -7
- package/dist/components/MSimpleCarousel.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +2 -2
- package/dist/components/MSlider.vue.d.ts +3 -3
- package/dist/components/MSparkline.vue.d.ts +1 -1
- package/dist/components/MSplitButton.vue.d.ts +7 -5
- package/dist/components/MSplitter.vue.d.ts +9 -7
- package/dist/components/MSpotlightSearch.vue.d.ts +1 -1
- package/dist/components/MStack.vue.d.ts +8 -6
- package/dist/components/MStatCard.vue.d.ts +5 -3
- package/dist/components/MStepper.vue.d.ts +5 -3
- package/dist/components/MSticky.vue.d.ts +5 -3
- package/dist/components/MSubtitle.vue.d.ts +6 -4
- package/dist/components/MSwipeToDismiss.vue.d.ts +11 -9
- package/dist/components/MTable.vue.d.ts +17 -15
- package/dist/components/MText.vue.d.ts +5 -3
- package/dist/components/MTextField.vue.d.ts +6 -4
- package/dist/components/MTimePickerModal.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +6 -4
- package/dist/components/MToggleButton.vue.d.ts +5 -3
- package/dist/components/MToolbar.vue.d.ts +24 -22
- package/dist/components/MTooltip.vue.d.ts +10 -8
- package/dist/components/MTopAppBar.vue.d.ts +22 -20
- package/dist/components/MTour.vue.d.ts +28 -26
- package/dist/components/MTransition.vue.d.ts +5 -3
- package/dist/components/MTree.vue.d.ts +6 -4
- package/dist/components/MTreeTable.vue.d.ts +21 -19
- package/dist/components/MTypewriter.vue.d.ts +6 -4
- package/dist/components/MVirtualTable.vue.d.ts +8 -6
- package/dist/components/_MMapLayerItem.vue.d.ts +8 -6
- package/dist/components/_MPdfPage.vue.d.ts +2 -2
- package/dist/components/_MToolbarFab.vue.d.ts +5 -3
- package/dist/components/_MTreeNode.vue.d.ts +13 -11
- package/dist/composables/_fieldLayout.d.ts +47 -0
- package/dist/composables/useMap.d.ts +8 -0
- package/dist/{dist-CrjSW5DN.js → dist-Bj5kEq8G.js} +4 -6
- package/dist/dist-Bj5kEq8G.js.map +1 -0
- package/dist/draw.js +62 -82
- package/dist/draw.js.map +1 -1
- package/dist/{emoji-names-de-BphO5XpV.js → emoji-names-de-Cu3OSpp6.js} +2 -3
- package/dist/emoji-names-de-Cu3OSpp6.js.map +1 -0
- package/dist/{emoji-names-en-9ZvMRvzi.js → emoji-names-en-BNX1pM9h.js} +2 -3
- package/dist/emoji-names-en-BNX1pM9h.js.map +1 -0
- package/dist/{emoji-names-es-DvfWU3Pj.js → emoji-names-es-C_Dafg4D.js} +2 -3
- package/dist/emoji-names-es-C_Dafg4D.js.map +1 -0
- package/dist/{emoji-names-fr-B-jhUlsP.js → emoji-names-fr-D4HTMFuM.js} +2 -3
- package/dist/emoji-names-fr-D4HTMFuM.js.map +1 -0
- package/dist/{emoji-names-ja-l8cMFJo1.js → emoji-names-ja-BCql-Sj6.js} +2 -3
- package/dist/emoji-names-ja-BCql-Sj6.js.map +1 -0
- package/dist/{emoji-names-ko-YP-o9G0c.js → emoji-names-ko-CT8L52nn.js} +2 -3
- package/dist/emoji-names-ko-CT8L52nn.js.map +1 -0
- package/dist/{emoji-names-pt-DGj_Js4M.js → emoji-names-pt-DHiwPiL-.js} +2 -3
- package/dist/emoji-names-pt-DHiwPiL-.js.map +1 -0
- package/dist/{emoji-names-zh-Dzecwtw_.js → emoji-names-zh-L3FXVief.js} +2 -3
- package/dist/emoji-names-zh-L3FXVief.js.map +1 -0
- package/dist/flow.js +351 -374
- package/dist/flow.js.map +1 -1
- package/dist/{flowPaths-CcWOKY4Z.js → flowPaths-BaH7yaUM.js} +3 -8
- package/dist/flowPaths-BaH7yaUM.js.map +1 -0
- package/dist/gantt.js +272 -333
- package/dist/gantt.js.map +1 -1
- package/dist/locales/index.js +1 -2
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +4085 -4277
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +1 -1
- package/dist/map.js +521 -520
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +3 -4
- package/dist/markdown.js.map +1 -1
- package/dist/{material-color-utilities-C_iikgRm.js → material-color-utilities-CEFytLsr.js} +15 -32
- package/dist/material-color-utilities-CEFytLsr.js.map +1 -0
- package/dist/media.js +80 -94
- package/dist/media.js.map +1 -1
- package/dist/{motion-DZiXG09o.js → motion-BcejVTeX.js} +2 -3
- package/dist/motion-BcejVTeX.js.map +1 -0
- package/dist/pdf.js +103 -115
- package/dist/pdf.js.map +1 -1
- package/dist/qrcode.js +1 -2
- package/dist/qrcode.js.map +1 -1
- package/dist/rich-text-editor.js +33 -34
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/terminal.js +2 -3
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DLcG3qPC.js → useLocale-COav9m8C.js} +2 -3
- package/dist/useLocale-COav9m8C.js.map +1 -0
- package/dist/{useThemeTokens-DQQcaWbE.js → useThemeTokens-DyAdPQB0.js} +6 -10
- package/dist/useThemeTokens-DyAdPQB0.js.map +1 -0
- package/package.json +32 -32
- package/src/__tests__/MFab.test.ts +10 -1
- package/src/__tests__/MMap.test.ts +16 -1
- package/src/__tests__/_fakeMaplibre.ts +2 -0
- package/src/__tests__/fieldOverflow.test.ts +118 -0
- package/src/components/MAutocomplete.vue +21 -24
- package/src/components/MColorPicker.vue +3 -3
- package/src/components/MDatePicker.vue +4 -4
- package/src/components/MDateRangePicker.vue +4 -4
- package/src/components/MMap.vue +12 -3
- package/src/components/MMapMeasure.vue +3 -1
- package/src/components/MMaskField.vue +16 -24
- package/src/components/MMultiAutocomplete.vue +19 -25
- package/src/components/MMultiSelect.vue +20 -27
- package/src/components/MNumberField.vue +16 -26
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MSearchBar.vue +2 -2
- package/src/components/MSelect.vue +16 -22
- package/src/components/MTagInput.vue +19 -26
- package/src/components/MTextField.vue +18 -46
- package/src/components/MTimePicker.vue +4 -4
- package/src/composables/_fieldLayout.ts +117 -0
- package/src/composables/useMap.ts +17 -0
- package/src/composables/useMapLayers.ts +4 -1
- package/src/map.ts +1 -1
- package/dist/MButton-D_uxtJa-.js.map +0 -1
- package/dist/MDialog-DT4KAPmn.js.map +0 -1
- package/dist/MIcon-Bxh9j135.js.map +0 -1
- package/dist/MIconButton-DoNotQ9v.js.map +0 -1
- package/dist/MListItem-CwYrxpPZ.js.map +0 -1
- package/dist/MLoadingIndicator-DhzECYRI.js.map +0 -1
- package/dist/MMenuItem-Bih0h4-n.js.map +0 -1
- package/dist/MProgressBar-BCoruxA-.js.map +0 -1
- package/dist/MSeekBar-DQPF5FTp.js.map +0 -1
- package/dist/MSegmentedButton-DL9JtJFX.js.map +0 -1
- package/dist/MSlider-BvoMZTy9.js.map +0 -1
- package/dist/MSpinner-CgcCQhS9.js.map +0 -1
- package/dist/MTextField-B72dwF6V.js.map +0 -1
- package/dist/MTooltip-YyF1CO75.js.map +0 -1
- package/dist/_storageKeys-CYXsUBwK.js.map +0 -1
- package/dist/_useEscapeStack-CjndQhqg.js.map +0 -1
- package/dist/common-0dgrgaPL.js.map +0 -1
- package/dist/dist-CrjSW5DN.js.map +0 -1
- package/dist/emoji-names-de-BphO5XpV.js.map +0 -1
- package/dist/emoji-names-en-9ZvMRvzi.js.map +0 -1
- package/dist/emoji-names-es-DvfWU3Pj.js.map +0 -1
- package/dist/emoji-names-fr-B-jhUlsP.js.map +0 -1
- package/dist/emoji-names-ja-l8cMFJo1.js.map +0 -1
- package/dist/emoji-names-ko-YP-o9G0c.js.map +0 -1
- package/dist/emoji-names-pt-DGj_Js4M.js.map +0 -1
- package/dist/emoji-names-zh-Dzecwtw_.js.map +0 -1
- package/dist/flowPaths-CcWOKY4Z.js.map +0 -1
- package/dist/material-color-utilities-C_iikgRm.js.map +0 -1
- package/dist/motion-DZiXG09o.js.map +0 -1
- package/dist/useLocale-DLcG3qPC.js.map +0 -1
- package/dist/useThemeTokens-DQQcaWbE.js.map +0 -1
package/dist/draw.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import { t } from "./MIconButton-
|
|
3
|
-
import { n, t as r } from "./
|
|
4
|
-
import { n as i, t as a } from "./
|
|
1
|
+
import { i as e } from "./useLocale-COav9m8C.js";
|
|
2
|
+
import { t } from "./MIconButton-BBggVwBV.js";
|
|
3
|
+
import { n, t as r } from "./MMenuItem-CRNZkVVr.js";
|
|
4
|
+
import { n as i, t as a } from "./MTooltip-BL3jPYPT.js";
|
|
5
5
|
import { Fragment as o, computed as s, createBlock as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createTextVNode as f, createVNode as p, defineComponent as m, inject as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as x, onMounted as S, openBlock as C, provide as ee, ref as w, renderList as T, renderSlot as E, shallowRef as D, toDisplayString as te, unref as O, useId as ne, useModel as k, vModelText as re, watch as ie, withCtx as A, withDirectives as j, withKeys as ae, withModifiers as M } from "vue";
|
|
6
|
-
|
|
6
|
+
// src/composables/drawGeometry.ts
|
|
7
7
|
var N = 0, oe = () => `d${Date.now().toString(36)}${(N++).toString(36)}`, se = {
|
|
8
8
|
pen: {
|
|
9
9
|
thinning: .6,
|
|
@@ -301,16 +301,14 @@ async function we(e, t = 2) {
|
|
|
301
301
|
URL.revokeObjectURL(n);
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
|
-
|
|
305
|
-
//#region src/composables/useDrawing.ts
|
|
304
|
+
// src/composables/useDrawing.ts
|
|
306
305
|
var Te = Symbol("m3-draw");
|
|
307
306
|
function Ee() {
|
|
308
307
|
let e = h(Te, null);
|
|
309
308
|
if (!e) throw Error("useDrawing() must be called inside <MDrawCanvas>");
|
|
310
309
|
return e;
|
|
311
310
|
}
|
|
312
|
-
|
|
313
|
-
//#region src/components/MDrawCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
311
|
+
// src/components/MDrawCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
314
312
|
var De = ["aria-label"], Oe = [
|
|
315
313
|
"id",
|
|
316
314
|
"width",
|
|
@@ -600,39 +598,31 @@ var De = ["aria-label"], Oe = [
|
|
|
600
598
|
return;
|
|
601
599
|
}
|
|
602
600
|
let o = mt(n.y), s = ht(n, o);
|
|
603
|
-
if (Tt(r)) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
from: [s.x, s.y],
|
|
626
|
-
to: [s.x, s.y]
|
|
627
|
-
};
|
|
628
|
-
return;
|
|
629
|
-
}
|
|
630
|
-
if (r === "text") {
|
|
601
|
+
if (Tt(r)) K.value = {
|
|
602
|
+
kind: "draw",
|
|
603
|
+
id: e.pointerId,
|
|
604
|
+
page: o,
|
|
605
|
+
points: [[
|
|
606
|
+
s.x,
|
|
607
|
+
s.y,
|
|
608
|
+
Dt(e)
|
|
609
|
+
]],
|
|
610
|
+
pen: e.pointerType === "pen",
|
|
611
|
+
touch: e.pointerType === "touch",
|
|
612
|
+
started: performance.now()
|
|
613
|
+
}, Y.value = Ot(K.value);
|
|
614
|
+
else if (Et(r)) K.value = {
|
|
615
|
+
kind: "shape",
|
|
616
|
+
id: e.pointerId,
|
|
617
|
+
page: o,
|
|
618
|
+
shape: r,
|
|
619
|
+
from: [s.x, s.y],
|
|
620
|
+
to: [s.x, s.y]
|
|
621
|
+
};
|
|
622
|
+
else if (r === "text") {
|
|
631
623
|
let t = Ft(n, (e) => e.type === "text");
|
|
632
624
|
t ? Ut(t) : Ht(s, o), e.preventDefault();
|
|
633
|
-
|
|
634
|
-
}
|
|
635
|
-
if (r === "select") {
|
|
625
|
+
} else if (r === "select") {
|
|
636
626
|
let t = Bt(n);
|
|
637
627
|
if (t) {
|
|
638
628
|
let r = X.value, i = t.includes("l") ? r.x + r.width : r.x, o = t.includes("t") ? r.y + r.height : r.y;
|
|
@@ -716,9 +706,7 @@ var De = ["aria-label"], Oe = [
|
|
|
716
706
|
});
|
|
717
707
|
t.last = n;
|
|
718
708
|
}
|
|
719
|
-
|
|
720
|
-
}
|
|
721
|
-
if (t.kind === "shape") {
|
|
709
|
+
} else if (t.kind === "shape") {
|
|
722
710
|
let n = ht(r, t.page);
|
|
723
711
|
t.to = e.shiftKey ? pe(t.shape, t.from, [n.x, n.y]) : [n.x, n.y], Y.value = {
|
|
724
712
|
id: "live",
|
|
@@ -732,13 +720,8 @@ var De = ["aria-label"], Oe = [
|
|
|
732
720
|
layer: ot.value,
|
|
733
721
|
page: t.page
|
|
734
722
|
};
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
if (t.kind === "lasso") {
|
|
738
|
-
t.points.push([r.x, r.y]), wt.value = t.points.slice();
|
|
739
|
-
return;
|
|
740
|
-
}
|
|
741
|
-
if (t.kind === "move") {
|
|
723
|
+
} else if (t.kind === "lasso") t.points.push([r.x, r.y]), wt.value = t.points.slice();
|
|
724
|
+
else if (t.kind === "move") {
|
|
742
725
|
let e = r.x - t.from.x, n = r.y - t.from.y;
|
|
743
726
|
if (!t.moved && Math.hypot(e, n) * W.value.zoom < 3) return;
|
|
744
727
|
t.moved = !0;
|
|
@@ -747,9 +730,7 @@ var De = ["aria-label"], Oe = [
|
|
|
747
730
|
dx: e,
|
|
748
731
|
dy: n
|
|
749
732
|
}) : t);
|
|
750
|
-
|
|
751
|
-
}
|
|
752
|
-
if (t.kind === "scale") {
|
|
733
|
+
} else if (t.kind === "scale") {
|
|
753
734
|
let e = Math.hypot(t.from.x - t.origin.x, t.from.y - t.origin.y) || 1, n = Math.max(.05, Math.hypot(r.x - t.origin.x, r.y - t.origin.y) / e), i = new Set(A.value);
|
|
754
735
|
z.value = a.value.map((e) => i.has(e.id) ? xe(e, {
|
|
755
736
|
sx: n,
|
|
@@ -1384,7 +1365,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1384
1365
|
"aria-label": O(x).drawTools
|
|
1385
1366
|
}, [
|
|
1386
1367
|
E(e.$slots, "default"),
|
|
1387
|
-
(C(!0), u(o, null, T(D.value, (e,
|
|
1368
|
+
(C(!0), u(o, null, T(D.value, (e, i) => (C(), u(o, { key: i }, [e.length === 1 ? (C(), c(a, {
|
|
1388
1369
|
key: 0,
|
|
1389
1370
|
text: j(e[0]),
|
|
1390
1371
|
placement: "top"
|
|
@@ -1403,16 +1384,16 @@ var De = ["aria-label"], Oe = [
|
|
|
1403
1384
|
"onClick"
|
|
1404
1385
|
])]),
|
|
1405
1386
|
_: 2
|
|
1406
|
-
}, 1032, ["text"])) : (C(), u("div", st, [p(
|
|
1407
|
-
text: j(k(e,
|
|
1387
|
+
}, 1032, ["text"])) : (C(), u("div", st, [p(a, {
|
|
1388
|
+
text: j(k(e, i)),
|
|
1408
1389
|
placement: "top"
|
|
1409
1390
|
}, {
|
|
1410
1391
|
default: A(() => [p(t, {
|
|
1411
|
-
icon: S[k(e,
|
|
1412
|
-
label: j(k(e,
|
|
1392
|
+
icon: S[k(e, i)].icon,
|
|
1393
|
+
label: j(k(e, i)),
|
|
1413
1394
|
variant: e.includes(O(v).tool.value) ? "filled" : "standard",
|
|
1414
1395
|
"aria-pressed": e.includes(O(v).tool.value),
|
|
1415
|
-
onClick: (t) => O(v).tool.value = k(e,
|
|
1396
|
+
onClick: (t) => O(v).tool.value = k(e, i)
|
|
1416
1397
|
}, null, 8, [
|
|
1417
1398
|
"icon",
|
|
1418
1399
|
"label",
|
|
@@ -1421,7 +1402,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1421
1402
|
"onClick"
|
|
1422
1403
|
])]),
|
|
1423
1404
|
_: 2
|
|
1424
|
-
}, 1032, ["text"]), p(
|
|
1405
|
+
}, 1032, ["text"]), p(n, null, {
|
|
1425
1406
|
trigger: A(() => [d("button", {
|
|
1426
1407
|
type: "button",
|
|
1427
1408
|
class: "flex h-10 w-4 items-center justify-center rounded-full text-on-surface-variant hover:bg-on-surface/8",
|
|
@@ -1430,7 +1411,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1430
1411
|
class: "material-symbols-outlined text-[18px]",
|
|
1431
1412
|
"aria-hidden": "true"
|
|
1432
1413
|
}, "arrow_drop_down", -1)]], 8, ct)]),
|
|
1433
|
-
default: A(() => [(C(!0), u(o, null, T(e, (e) => (C(), c(
|
|
1414
|
+
default: A(() => [(C(!0), u(o, null, T(e, (e) => (C(), c(r, {
|
|
1434
1415
|
key: e,
|
|
1435
1416
|
icon: S[e].icon,
|
|
1436
1417
|
selected: O(v).tool.value === e,
|
|
@@ -1445,7 +1426,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1445
1426
|
]))), 128))]),
|
|
1446
1427
|
_: 2
|
|
1447
1428
|
}, 1024)]))], 64))), 128)),
|
|
1448
|
-
re.value ? (C(), c(
|
|
1429
|
+
re.value ? (C(), c(a, {
|
|
1449
1430
|
key: 0,
|
|
1450
1431
|
text: O(x).drawFill,
|
|
1451
1432
|
placement: "top"
|
|
@@ -1473,7 +1454,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1473
1454
|
"aria-pressed": O(v).color.value.toLowerCase() === e.toLowerCase(),
|
|
1474
1455
|
onClick: (t) => O(v).color.value = e
|
|
1475
1456
|
}, null, 14, B))), 128)),
|
|
1476
|
-
m.customColor ? (C(), c(
|
|
1457
|
+
m.customColor ? (C(), c(a, {
|
|
1477
1458
|
key: 1,
|
|
1478
1459
|
text: O(x).drawCustomColor,
|
|
1479
1460
|
placement: "top"
|
|
@@ -1488,7 +1469,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1488
1469
|
}, [M.value ? l("", !0) : (C(), u("span", V, "add"))], 14, lt)]),
|
|
1489
1470
|
_: 1
|
|
1490
1471
|
}, 8, ["text"])) : l("", !0),
|
|
1491
|
-
m.customColor ? (C(), c(
|
|
1472
|
+
m.customColor ? (C(), c(i, {
|
|
1492
1473
|
key: 2,
|
|
1493
1474
|
modelValue: O(v).color.value,
|
|
1494
1475
|
"onUpdate:modelValue": s[2] ||= (e) => O(v).color.value = e,
|
|
@@ -1512,7 +1493,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1512
1493
|
}, null, 4)], 10, H))), 128)),
|
|
1513
1494
|
m.history ? (C(), u(o, { key: 3 }, [
|
|
1514
1495
|
s[8] ||= d("span", { class: "mx-1 h-6 w-px shrink-0 bg-outline-variant" }, null, -1),
|
|
1515
|
-
p(
|
|
1496
|
+
p(a, {
|
|
1516
1497
|
text: O(x).drawUndo,
|
|
1517
1498
|
placement: "top"
|
|
1518
1499
|
}, {
|
|
@@ -1524,7 +1505,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1524
1505
|
}, null, 8, ["label", "disabled"])]),
|
|
1525
1506
|
_: 1
|
|
1526
1507
|
}, 8, ["text"]),
|
|
1527
|
-
p(
|
|
1508
|
+
p(a, {
|
|
1528
1509
|
text: O(x).drawRedo,
|
|
1529
1510
|
placement: "top"
|
|
1530
1511
|
}, {
|
|
@@ -1537,7 +1518,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1537
1518
|
_: 1
|
|
1538
1519
|
}, 8, ["text"])
|
|
1539
1520
|
], 64)) : l("", !0),
|
|
1540
|
-
O(v).selection.value.length ? (C(), c(
|
|
1521
|
+
O(v).selection.value.length ? (C(), c(a, {
|
|
1541
1522
|
key: 4,
|
|
1542
1523
|
text: O(x).drawDelete,
|
|
1543
1524
|
placement: "top"
|
|
@@ -1564,12 +1545,12 @@ var De = ["aria-label"], Oe = [
|
|
|
1564
1545
|
], G = { class: "hidden flex-col group-hover:flex group-focus-within:flex" }, mt = ["aria-label", "onClick"], ht = ["aria-label", "onClick"], gt = /* @__PURE__ */ m({
|
|
1565
1546
|
__name: "MDrawLayers",
|
|
1566
1547
|
setup(n) {
|
|
1567
|
-
let
|
|
1568
|
-
if (!
|
|
1569
|
-
let
|
|
1548
|
+
let r = h(Te, null);
|
|
1549
|
+
if (!r) throw Error("MDrawLayers must be inside <MDrawCanvas>");
|
|
1550
|
+
let i = r, f = e(), m = s(() => i.layers.value.length ? i.layers.value : [{
|
|
1570
1551
|
id: "layer-1",
|
|
1571
1552
|
name: f.drawLayer.replace("{n}", "1")
|
|
1572
|
-
}]), g = s(() => m.value.slice().reverse()), _ = (e) =>
|
|
1553
|
+
}]), g = s(() => m.value.slice().reverse()), _ = (e) => i.setLayers(e), b = (e, t) => _(m.value.map((n) => n.id === e ? {
|
|
1573
1554
|
...n,
|
|
1574
1555
|
...t
|
|
1575
1556
|
} : n));
|
|
@@ -1578,14 +1559,14 @@ var De = ["aria-label"], Oe = [
|
|
|
1578
1559
|
id: oe(),
|
|
1579
1560
|
name: f.drawLayer.replace("{n}", String(m.value.length + 1))
|
|
1580
1561
|
};
|
|
1581
|
-
_([...m.value, e]),
|
|
1562
|
+
_([...m.value, e]), i.layer.value = e.id;
|
|
1582
1563
|
}
|
|
1583
1564
|
function S(e) {
|
|
1584
1565
|
if (m.value.length < 2) return;
|
|
1585
|
-
let t = m.value[0].id, n =
|
|
1586
|
-
n.length && (
|
|
1566
|
+
let t = m.value[0].id, n = i.items.value.filter((n) => (n.layer ?? t) === e).map((e) => e.id);
|
|
1567
|
+
n.length && (i.selection.value = n, i.deleteSelection());
|
|
1587
1568
|
let r = m.value.filter((t) => t.id !== e);
|
|
1588
|
-
_(r),
|
|
1569
|
+
_(r), i.layer.value === e && (i.layer.value = r[r.length - 1].id);
|
|
1589
1570
|
}
|
|
1590
1571
|
function ee(e, t) {
|
|
1591
1572
|
let n = m.value.findIndex((t) => t.id === e), r = n + t;
|
|
@@ -1604,7 +1585,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1604
1585
|
class: "m3-draw-layers flex w-64 flex-col rounded-xl bg-surface-container p-2 text-on-surface shadow-elevation-2",
|
|
1605
1586
|
role: "group",
|
|
1606
1587
|
"aria-label": O(f).drawLayers
|
|
1607
|
-
}, [d("div", dt, [d("span", ft, te(O(f).drawLayers), 1), p(
|
|
1588
|
+
}, [d("div", dt, [d("span", ft, te(O(f).drawLayers), 1), p(a, {
|
|
1608
1589
|
text: O(f).drawAddLayer,
|
|
1609
1590
|
placement: "left"
|
|
1610
1591
|
}, {
|
|
@@ -1617,7 +1598,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1617
1598
|
_: 1
|
|
1618
1599
|
}, 8, ["text"])]), (C(!0), u(o, null, T(g.value, (e) => (C(), u("div", {
|
|
1619
1600
|
key: e.id,
|
|
1620
|
-
class: y(["group flex h-10 items-center gap-1 rounded-full pr-1 pl-3 text-body-medium", O(
|
|
1601
|
+
class: y(["group flex h-10 items-center gap-1 rounded-full pr-1 pl-3 text-body-medium", O(i).layer.value === e.id ? "bg-secondary-container text-on-secondary-container" : "hover:bg-on-surface/8"])
|
|
1621
1602
|
}, [
|
|
1622
1603
|
E.value === e.id ? (C(), u("input", {
|
|
1623
1604
|
key: 0,
|
|
@@ -1633,11 +1614,11 @@ var De = ["aria-label"], Oe = [
|
|
|
1633
1614
|
key: 1,
|
|
1634
1615
|
type: "button",
|
|
1635
1616
|
class: y(["min-w-0 flex-1 truncate text-left outline-none", e.visible === !1 && "opacity-50"]),
|
|
1636
|
-
"aria-pressed": O(
|
|
1637
|
-
onClick: (t) => O(
|
|
1617
|
+
"aria-pressed": O(i).layer.value === e.id,
|
|
1618
|
+
onClick: (t) => O(i).layer.value = e.id,
|
|
1638
1619
|
onDblclick: (t) => ne(e.id)
|
|
1639
1620
|
}, te(e.name), 43, W)),
|
|
1640
|
-
p(
|
|
1621
|
+
p(a, {
|
|
1641
1622
|
text: e.visible === !1 ? O(f).drawShowLayer : O(f).drawHideLayer,
|
|
1642
1623
|
placement: "left"
|
|
1643
1624
|
}, {
|
|
@@ -1653,7 +1634,7 @@ var De = ["aria-label"], Oe = [
|
|
|
1653
1634
|
])]),
|
|
1654
1635
|
_: 2
|
|
1655
1636
|
}, 1032, ["text"]),
|
|
1656
|
-
p(
|
|
1637
|
+
p(a, {
|
|
1657
1638
|
text: e.locked ? O(f).drawUnlockLayer : O(f).drawLockLayer,
|
|
1658
1639
|
placement: "left"
|
|
1659
1640
|
}, {
|
|
@@ -1696,7 +1677,6 @@ var De = ["aria-label"], Oe = [
|
|
|
1696
1677
|
], 2))), 128))], 8, ut));
|
|
1697
1678
|
}
|
|
1698
1679
|
});
|
|
1699
|
-
//#endregion
|
|
1700
1680
|
export { at as MDrawCanvas, gt as MDrawLayers, U as MDrawToolbar, pe as constrain, oe as drawId, ye as eraseAt, ve as hitItem, be as inLasso, he as itemBox, z as itemSvg, fe as shapePath, le as simulatePressure, ce as smoothPoints, Se as sortByLayer, de as strokePath, we as svgToPng, F as textBox, Ce as toDrawSvg, xe as transformItem, ge as unionBox, Ee as useDrawing };
|
|
1701
1681
|
|
|
1702
1682
|
//# sourceMappingURL=draw.js.map
|