@m3ui-vue/m3ui-vue 1.8.0 → 1.9.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 +34 -19
- package/dist/MButton-LiZRRP4h.js +171 -0
- package/dist/MButton-LiZRRP4h.js.map +1 -0
- package/dist/{MColorPickerModal-H8nuX0Wu.js → MColorPickerModal-IjciC8zh.js} +185 -184
- package/dist/MColorPickerModal-IjciC8zh.js.map +1 -0
- package/dist/MDialog-BLpfgIA3.js +167 -0
- package/dist/MDialog-BLpfgIA3.js.map +1 -0
- package/dist/MIcon-BSsJZhK7.js +116 -0
- package/dist/MIcon-BSsJZhK7.js.map +1 -0
- package/dist/{MIconButton-BBggVwBV.js → MIconButton-CNjN0xwW.js} +18 -18
- package/dist/{MIconButton-BBggVwBV.js.map → MIconButton-CNjN0xwW.js.map} +1 -1
- package/dist/{MListItem-DiOAxaN7.js → MListItem-BBQ-6i3v.js} +139 -139
- package/dist/MListItem-BBQ-6i3v.js.map +1 -0
- package/dist/{MLoadingIndicator-CuTZYFFj.js → MLoadingIndicator-dejdXpu8.js} +2 -2
- package/dist/{MLoadingIndicator-CuTZYFFj.js.map → MLoadingIndicator-dejdXpu8.js.map} +1 -1
- package/dist/MMenuItem-E31tMzOt.js +577 -0
- package/dist/MMenuItem-E31tMzOt.js.map +1 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js +1866 -0
- package/dist/MPdfViewer-B5Q9Xs9d.js.map +1 -0
- package/dist/MProgressBar-CPrZhQbA.js +179 -0
- package/dist/MProgressBar-CPrZhQbA.js.map +1 -0
- package/dist/{MSeekBar-BCDQTx2t.js → MSeekBar-NwkuAzx-.js} +2 -2
- package/dist/{MSeekBar-BCDQTx2t.js.map → MSeekBar-NwkuAzx-.js.map} +1 -1
- package/dist/{MSegmentedButton-BXzRsg1S.js → MSegmentedButton-DZuZLBML.js} +4 -4
- package/dist/{MSegmentedButton-BXzRsg1S.js.map → MSegmentedButton-DZuZLBML.js.map} +1 -1
- package/dist/MSignaturePad-Bqr-1R9f.js +140 -0
- package/dist/MSignaturePad-Bqr-1R9f.js.map +1 -0
- package/dist/MSlider-B7dIcHVn.js +745 -0
- package/dist/MSlider-B7dIcHVn.js.map +1 -0
- package/dist/{MSpinner-UCdtSOHP.js → MSpinner-CXLY7lWw.js} +2 -2
- package/dist/{MSpinner-UCdtSOHP.js.map → MSpinner-CXLY7lWw.js.map} +1 -1
- package/dist/{MTextField-CYk9yFvi.js → MTextField-CryHMs8-.js} +18 -18
- package/dist/MTextField-CryHMs8-.js.map +1 -0
- package/dist/MTooltip-Cn_DYm9M.js +90 -0
- package/dist/MTooltip-Cn_DYm9M.js.map +1 -0
- package/dist/{_popupPosition-nL8SVKPK.js → _popupPosition-C_lxj9qU.js} +7 -7
- package/dist/_popupPosition-C_lxj9qU.js.map +1 -0
- package/dist/{_useFieldValidation-B0B44M_t.js → _useFieldValidation-CvZnZfl-.js} +2 -2
- package/dist/{_useFieldValidation-B0B44M_t.js.map → _useFieldValidation-CvZnZfl-.js.map} +1 -1
- package/dist/api.json +1 -1
- package/dist/code-editor.js +129 -128
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +1 -1
- package/dist/components/MAudioPlayer.vue.d.ts +1 -1
- package/dist/components/MAutocomplete.vue.d.ts +1 -1
- package/dist/components/MAvailabilityCalendar.vue.d.ts +3 -3
- package/dist/components/MBadge.vue.d.ts +2 -2
- package/dist/components/MBar.vue.d.ts +1 -1
- package/dist/components/MBeforeAfter.vue.d.ts +3 -3
- package/dist/components/MButton.vue.d.ts +1 -1
- package/dist/components/MCalendarHeatmap.vue.d.ts +1 -1
- package/dist/components/MChatBubble.vue.d.ts +1 -1
- package/dist/components/MCodeEditor.vue.d.ts +1 -1
- package/dist/components/MContainerTransform.vue.d.ts +1 -1
- package/dist/components/MCopyButton.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +1 -1
- package/dist/components/MCreditCardInput.vue.d.ts +2 -2
- package/dist/components/MDiffViewer.vue.d.ts +1 -1
- package/dist/components/MDrawCanvas.vue.d.ts +2 -2
- package/dist/components/MExpansionPanel.vue.d.ts +1 -1
- package/dist/components/MExportButton.vue.d.ts +1 -1
- package/dist/components/MFab.vue.d.ts +1 -1
- package/dist/components/MFilterBuilder.vue.d.ts +1 -1
- package/dist/components/MFlex.vue.d.ts +2 -2
- package/dist/components/MFloorPlan.vue.d.ts +2 -2
- package/dist/components/MFlow.vue.d.ts +2 -2
- package/dist/components/MFormRenderer.vue.d.ts +2 -2
- package/dist/components/MGantt.vue.d.ts +2 -2
- package/dist/components/MGanttControls.vue.d.ts +1 -1
- package/dist/components/MGrid.vue.d.ts +1 -1
- package/dist/components/MIcon.vue.d.ts +3 -5
- package/dist/components/MIconButton.vue.d.ts +1 -1
- package/dist/components/MLightbox.vue.d.ts +2 -2
- package/dist/components/MMapMeasure.vue.d.ts +2 -2
- package/dist/components/MMenu.vue.d.ts +6 -3
- package/dist/components/MMortgageCalculator.vue.d.ts +2 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +1 -1
- package/dist/components/MMultiSelect.vue.d.ts +1 -1
- package/dist/components/MNavigationDrawer.vue.d.ts +5 -4
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNumberField.vue.d.ts +1 -1
- package/dist/components/MOdontogram.vue.d.ts +2 -2
- package/dist/components/MPdfSigner.vue.d.ts +1 -1
- package/dist/components/MPhoneInput.vue.d.ts +2 -2
- package/dist/components/MPinInput.vue.d.ts +3 -3
- package/dist/components/MPosKeypad.vue.d.ts +1 -1
- package/dist/components/MProductConfigurator.vue.d.ts +1 -1
- package/dist/components/MResourceTimeline.vue.d.ts +2 -2
- package/dist/components/MRichTextEditor.vue.d.ts +1 -1
- package/dist/components/MScheme.vue.d.ts +1 -1
- package/dist/components/MSearchBar.vue.d.ts +2 -2
- package/dist/components/MSearchField.vue.d.ts +1 -1
- package/dist/components/MSeatMap.vue.d.ts +1 -1
- package/dist/components/MSeekBar.vue.d.ts +2 -2
- package/dist/components/MSelect.vue.d.ts +1 -1
- package/dist/components/MShortNavigationBar.vue.d.ts +1 -1
- package/dist/components/MSkeleton.vue.d.ts +1 -1
- package/dist/components/MSpreadsheet.vue.d.ts +2 -2
- package/dist/components/MStack.vue.d.ts +2 -2
- package/dist/components/MSubtitle.vue.d.ts +1 -1
- package/dist/components/MSwipeToDismiss.vue.d.ts +1 -1
- package/dist/components/MSwitch.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +1 -1
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +3 -3
- package/dist/components/MTimeScroll.vue.d.ts +1 -1
- package/dist/components/MTimezoneSelect.vue.d.ts +1 -1
- package/dist/components/MTitle.vue.d.ts +1 -1
- package/dist/components/MToolbar.vue.d.ts +1 -1
- package/dist/components/MTooltip.vue.d.ts +1 -1
- package/dist/components/MTopAppBar.vue.d.ts +2 -2
- package/dist/components/MVitalsChart.vue.d.ts +1 -1
- package/dist/components/MWindow.vue.d.ts +3 -3
- package/dist/components/_MDrawerItemList.vue.d.ts +8 -1
- package/dist/composables/_fieldLayout.d.ts +8 -8
- package/dist/composables/_popupPosition.d.ts +3 -2
- package/dist/composables/_rtl.d.ts +26 -0
- package/dist/composables/useColorPalette.d.ts +1 -1
- package/dist/composables/useLocale.d.ts +4 -0
- package/dist/draw.js +5 -5
- package/dist/flow.js +2 -2
- package/dist/gantt.js +3 -3
- package/dist/locales/ar.d.ts +6 -0
- package/dist/locales/index.d.ts +1 -0
- package/dist/locales/index.js +768 -1
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +11962 -12039
- package/dist/m3ui.js.map +1 -1
- package/dist/map.js +1127 -1149
- package/dist/map.js.map +1 -1
- package/dist/markdown.js +1 -1
- package/dist/markdown.js.map +1 -1
- package/dist/media.js +7 -7
- package/dist/pdf-sign.d.ts +3 -0
- package/dist/pdf-sign.js +548 -0
- package/dist/pdf-sign.js.map +1 -0
- package/dist/pdf.d.ts +0 -3
- package/dist/pdf.js +1 -2400
- package/dist/plugin.d.ts +8 -0
- package/dist/rich-text-editor.js +79 -77
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles/theme.css +13 -0
- package/dist/styles.css +1 -1
- package/dist/terminal.js +5 -2
- package/dist/terminal.js.map +1 -1
- package/dist/{useLocale-DL96OFgr.js → useLocale-ybIju59R.js} +3 -1
- package/dist/useLocale-ybIju59R.js.map +1 -0
- package/dist/vTooltip-xESB2YOb.js +154 -0
- package/dist/vTooltip-xESB2YOb.js.map +1 -0
- package/package.json +5 -1
- package/src/__tests__/MAddressField.test.ts +1 -1
- package/src/__tests__/MChip.test.ts +3 -3
- package/src/__tests__/MFab.test.ts +6 -6
- package/src/__tests__/MListItemNestedControl.test.ts +2 -2
- package/src/__tests__/MScheduler.test.ts +1 -1
- package/src/__tests__/MTrackingTimeline.test.ts +1 -1
- package/src/__tests__/MWindow.test.ts +16 -0
- package/src/__tests__/fieldOverflow.test.ts +9 -9
- package/src/__tests__/hydration.test.ts +39 -0
- package/src/__tests__/localePresets.test.ts +2 -0
- package/src/__tests__/rtl.test.ts +167 -0
- package/src/__tests__/ssr.test.ts +6 -0
- package/src/components/MAlert.vue +1 -1
- package/src/components/MAutocomplete.vue +7 -7
- package/src/components/MAvailabilityCalendar.vue +5 -3
- package/src/components/MBadge.vue +12 -3
- package/src/components/MBar.vue +1 -1
- package/src/components/MBottomAppBar.vue +1 -1
- package/src/components/MCalendar.vue +3 -3
- package/src/components/MCalendarHeatmap.vue +3 -3
- package/src/components/MChatBubble.vue +3 -3
- package/src/components/MChip.vue +6 -6
- package/src/components/MCodeEditor.vue +7 -3
- package/src/components/MColorPicker.vue +1 -1
- package/src/components/MCommandPalette.vue +1 -1
- package/src/components/MContainerTransform.vue +1 -1
- package/src/components/MContextMenu.vue +1 -1
- package/src/components/MDataTable.vue +5 -5
- package/src/components/MDatePicker.vue +3 -2
- package/src/components/MDateRangePicker.vue +3 -2
- package/src/components/MDialog.vue +5 -5
- package/src/components/MDiffViewer.vue +1 -1
- package/src/components/MDivider.vue +1 -1
- package/src/components/MDragDropList.vue +1 -1
- package/src/components/MEmojiSelector.vue +11 -7
- package/src/components/MExpansionPanel.vue +1 -1
- package/src/components/MFab.vue +5 -5
- package/src/components/MFormBuilder.vue +3 -3
- package/src/components/MIcon.vue +14 -2
- package/src/components/MJsonEditor.vue +1 -3
- package/src/components/MJsonViewer.vue +1 -1
- package/src/components/MKanban.vue +2 -1
- package/src/components/MListDetail.vue +2 -2
- package/src/components/MListGroup.vue +1 -1
- package/src/components/MListItem.vue +5 -5
- package/src/components/MListSubheader.vue +1 -1
- package/src/components/MMapDraw.vue +3 -2
- package/src/components/MMapHover.vue +2 -1
- package/src/components/MMapMeasure.vue +2 -1
- package/src/components/MMapRoute.vue +2 -1
- package/src/components/MMarkdown.vue +9 -6
- package/src/components/MMaskField.vue +6 -6
- package/src/components/MMenu.vue +13 -6
- package/src/components/MMenuItem.vue +8 -6
- package/src/components/MMultiAutocomplete.vue +9 -8
- package/src/components/MMultiSelect.vue +9 -8
- package/src/components/MNavigationDrawer.vue +39 -27
- package/src/components/MNavigationRail.vue +28 -19
- package/src/components/MNavigationSuite.vue +1 -1
- package/src/components/MNotificationCenter.vue +1 -1
- package/src/components/MNotificationHost.vue +1 -1
- package/src/components/MNumberField.vue +6 -6
- package/src/components/MOrderTicket.vue +1 -1
- package/src/components/MPageProgress.vue +1 -1
- package/src/components/MPdfSigner.vue +1 -1
- package/src/components/MPhoneInput.vue +5 -4
- package/src/components/MPinInput.vue +3 -2
- package/src/components/MPosKeypad.vue +2 -1
- package/src/components/MProductConfigurator.vue +2 -1
- package/src/components/MProgressBar.vue +2 -2
- package/src/components/MRichTextEditor.vue +8 -4
- package/src/components/MScheduler.vue +14 -14
- package/src/components/MSearchField.vue +1 -1
- package/src/components/MSeatMap.vue +2 -1
- package/src/components/MSegmentedButton.vue +1 -1
- package/src/components/MSelect.vue +7 -7
- package/src/components/MSideSheet.vue +3 -2
- package/src/components/MSimpleCarousel.vue +20 -11
- package/src/components/MSlider.vue +15 -5
- package/src/components/MSnackbar.vue +2 -2
- package/src/components/MSplitButton.vue +3 -2
- package/src/components/MSplitter.vue +6 -3
- package/src/components/MSpotlightSearch.vue +1 -1
- package/src/components/MSwitch.vue +5 -5
- package/src/components/MTable.vue +3 -3
- package/src/components/MTabs.vue +4 -1
- package/src/components/MTagInput.vue +6 -6
- package/src/components/MTerminal.vue +1 -1
- package/src/components/MText.vue +1 -1
- package/src/components/MTextField.vue +7 -7
- package/src/components/MTimePicker.vue +3 -2
- package/src/components/MTimePickerModal.vue +2 -2
- package/src/components/MTimeScroll.vue +1 -1
- package/src/components/MTimeline.vue +12 -12
- package/src/components/MToolbar.vue +3 -3
- package/src/components/MTrackingTimeline.vue +3 -2
- package/src/components/MTransition.vue +8 -3
- package/src/components/MTreeTable.vue +1 -1
- package/src/components/MTypewriter.vue +1 -1
- package/src/components/MVirtualTable.vue +2 -2
- package/src/components/MWindow.vue +4 -3
- package/src/components/_MColorPanel.vue +5 -4
- package/src/components/_MDrawerItemList.vue +9 -5
- package/src/components/_MMapAttribution.vue +2 -1
- package/src/components/_MMonthYearButton.vue +1 -1
- package/src/components/_MTransferPane.vue +8 -1
- package/src/components/_MTreeNode.vue +3 -3
- package/src/components/_MYearGrid.vue +4 -2
- package/src/composables/_fieldLayout.ts +19 -19
- package/src/composables/_popupPosition.ts +5 -3
- package/src/composables/_rtl.ts +76 -0
- package/src/composables/_useMenuNav.ts +24 -17
- package/src/composables/_useSheetMotion.ts +10 -3
- package/src/composables/pdfSign.ts +2 -2
- package/src/composables/useLocale.ts +6 -0
- package/src/locales/ar.ts +798 -0
- package/src/locales/de.ts +2 -0
- package/src/locales/es.ts +2 -0
- package/src/locales/fr.ts +2 -0
- package/src/locales/index.ts +1 -0
- package/src/locales/ja.ts +2 -0
- package/src/locales/ko.ts +2 -0
- package/src/locales/pt.ts +2 -0
- package/src/locales/zh.ts +2 -0
- package/src/pdf-sign.ts +5 -0
- package/src/pdf.ts +0 -3
- package/src/plugin.ts +10 -0
- package/src/styles/theme.css +13 -0
- package/dist/MColorPickerModal-H8nuX0Wu.js.map +0 -1
- package/dist/MDialog-B42Mhn8W.js +0 -331
- package/dist/MDialog-B42Mhn8W.js.map +0 -1
- package/dist/MIcon-DpajuUTJ.js +0 -33
- package/dist/MIcon-DpajuUTJ.js.map +0 -1
- package/dist/MListItem-DiOAxaN7.js.map +0 -1
- package/dist/MMenuItem-BuxYoASE.js +0 -574
- package/dist/MMenuItem-BuxYoASE.js.map +0 -1
- package/dist/MSignaturePad-BTqGaPXA.js +0 -313
- package/dist/MSignaturePad-BTqGaPXA.js.map +0 -1
- package/dist/MSlider-D_O8J9YH.js +0 -739
- package/dist/MSlider-D_O8J9YH.js.map +0 -1
- package/dist/MTextField-CYk9yFvi.js.map +0 -1
- package/dist/MTooltip-CK39Zon4.js +0 -183
- package/dist/MTooltip-CK39Zon4.js.map +0 -1
- package/dist/_popupPosition-nL8SVKPK.js.map +0 -1
- package/dist/pdf.js.map +0 -1
- package/dist/useLocale-DL96OFgr.js.map +0 -1
package/src/locales/de.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const deLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: 'Löschen',
|
|
286
286
|
formBuilderCopy: 'Kopieren',
|
|
287
287
|
formBuilderCopied: 'Kopiert',
|
|
288
|
+
codeCopy: 'Code kopieren',
|
|
289
|
+
codeCopied: 'Kopiert',
|
|
288
290
|
formBuilderSubmitted: 'Gesendete Werte',
|
|
289
291
|
formBuilderSelectField: 'Wähle ein Feld zum Bearbeiten',
|
|
290
292
|
formFieldText: 'Text',
|
package/src/locales/es.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const esLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: 'Eliminar',
|
|
286
286
|
formBuilderCopy: 'Copiar',
|
|
287
287
|
formBuilderCopied: 'Copiado',
|
|
288
|
+
codeCopy: 'Copiar código',
|
|
289
|
+
codeCopied: 'Copiado',
|
|
288
290
|
formBuilderSubmitted: 'Valores enviados',
|
|
289
291
|
formBuilderSelectField: 'Elegí un campo para editarlo',
|
|
290
292
|
formFieldText: 'Texto',
|
package/src/locales/fr.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const frLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: 'Supprimer',
|
|
286
286
|
formBuilderCopy: 'Copier',
|
|
287
287
|
formBuilderCopied: 'Copié',
|
|
288
|
+
codeCopy: 'Copier le code',
|
|
289
|
+
codeCopied: 'Copié',
|
|
288
290
|
formBuilderSubmitted: 'Valeurs envoyées',
|
|
289
291
|
formBuilderSelectField: 'Sélectionnez un champ pour le modifier',
|
|
290
292
|
formFieldText: 'Texte',
|
package/src/locales/index.ts
CHANGED
package/src/locales/ja.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const jaLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: '削除',
|
|
286
286
|
formBuilderCopy: 'コピー',
|
|
287
287
|
formBuilderCopied: 'コピーしました',
|
|
288
|
+
codeCopy: 'コードをコピー',
|
|
289
|
+
codeCopied: 'コピーしました',
|
|
288
290
|
formBuilderSubmitted: '送信された値',
|
|
289
291
|
formBuilderSelectField: '編集するフィールドを選択してください',
|
|
290
292
|
formFieldText: 'テキスト',
|
package/src/locales/ko.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const koLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: '삭제',
|
|
286
286
|
formBuilderCopy: '복사',
|
|
287
287
|
formBuilderCopied: '복사됨',
|
|
288
|
+
codeCopy: '코드 복사',
|
|
289
|
+
codeCopied: '복사됨',
|
|
288
290
|
formBuilderSubmitted: '제출된 값',
|
|
289
291
|
formBuilderSelectField: '편집할 필드를 선택하세요',
|
|
290
292
|
formFieldText: '텍스트',
|
package/src/locales/pt.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const ptLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: 'Excluir',
|
|
286
286
|
formBuilderCopy: 'Copiar',
|
|
287
287
|
formBuilderCopied: 'Copiado',
|
|
288
|
+
codeCopy: 'Copiar código',
|
|
289
|
+
codeCopied: 'Copiado',
|
|
288
290
|
formBuilderSubmitted: 'Valores enviados',
|
|
289
291
|
formBuilderSelectField: 'Selecione um campo para editá-lo',
|
|
290
292
|
formFieldText: 'Texto',
|
package/src/locales/zh.ts
CHANGED
|
@@ -285,6 +285,8 @@ export const zhLocale: M3Locale = {
|
|
|
285
285
|
formBuilderDelete: '删除',
|
|
286
286
|
formBuilderCopy: '复制',
|
|
287
287
|
formBuilderCopied: '已复制',
|
|
288
|
+
codeCopy: '复制代码',
|
|
289
|
+
codeCopied: '已复制',
|
|
288
290
|
formBuilderSubmitted: '提交的值',
|
|
289
291
|
formBuilderSelectField: '选择一个字段进行编辑',
|
|
290
292
|
formFieldText: '文本',
|
package/src/pdf-sign.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// MPdfSigner lives in its own entry point: it needs pdf-lib (an optional peer) on top of pdfjs-dist, and a bundler
|
|
2
|
+
// resolves even a dynamic import, so keeping it in /pdf broke every app using MPdfViewer without pdf-lib installed
|
|
3
|
+
export { default as MPdfSigner } from './components/MPdfSigner.vue'
|
|
4
|
+
export { signPdf, shownToUser, fieldMissing } from './composables/pdfSign'
|
|
5
|
+
export type { PdfSignField, SignPdfOptions } from './composables/pdfSign'
|
package/src/pdf.ts
CHANGED
|
@@ -13,6 +13,3 @@ export type {
|
|
|
13
13
|
PdfState,
|
|
14
14
|
PdfjsModule,
|
|
15
15
|
} from './composables/usePdf'
|
|
16
|
-
export { default as MPdfSigner } from './components/MPdfSigner.vue'
|
|
17
|
-
export { signPdf, shownToUser, fieldMissing } from './composables/pdfSign'
|
|
18
|
-
export type { PdfSignField, SignPdfOptions } from './composables/pdfSign'
|
package/src/plugin.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { vClickOutside } from './directives/vClickOutside'
|
|
|
18
18
|
import { vSkeleton } from './directives/vSkeleton'
|
|
19
19
|
import { vSparkle } from './directives/vSparkle'
|
|
20
20
|
import { M3_HYDRATING_KEY } from './composables/_hydration'
|
|
21
|
+
import { M3_DIR_KEY } from './composables/_rtl'
|
|
21
22
|
import { M3_INITIAL_STATE_KEY, enableCookies, readCookie, trackViewport, writeCookie, type M3InitialState, type ResolvedInitialState } from './composables/_ssrState'
|
|
22
23
|
import { THEME_KEY, setStoragePrefix, storageKey } from './composables/_storageKeys'
|
|
23
24
|
import type { Theme } from './composables/useTheme'
|
|
@@ -95,6 +96,14 @@ export interface M3UIOptions {
|
|
|
95
96
|
* that window size instead of compact.
|
|
96
97
|
*/
|
|
97
98
|
initialState?: M3InitialState
|
|
99
|
+
/**
|
|
100
|
+
* Server-side rendering of a right-to-left app: the page's reading direction (the `dir` its `<html>` gets). The
|
|
101
|
+
* server has no page to read it from, so without it what's placed by the direction at render time (which edge
|
|
102
|
+
* `MNavigationDrawer` sits on) renders left to right there and jumps once hydrated. Not needed in an app rendered
|
|
103
|
+
* only in the browser, where the components read `dir` from the page; a `dir` set on an inner element is still
|
|
104
|
+
* followed by layout either way.
|
|
105
|
+
*/
|
|
106
|
+
dir?: 'ltr' | 'rtl'
|
|
98
107
|
}
|
|
99
108
|
|
|
100
109
|
function readStored(key: string): string | null {
|
|
@@ -138,6 +147,7 @@ export function createM3UI(options: M3UIOptions = {}) {
|
|
|
138
147
|
// First: the stored choices below (and those the modules read when they loaded) are this app's own
|
|
139
148
|
if (typeof window !== 'undefined') setStoragePrefix(options.storagePrefix ?? '')
|
|
140
149
|
if (options.isHydrating) app.provide(M3_HYDRATING_KEY, options.isHydrating)
|
|
150
|
+
if (options.dir) app.provide(M3_DIR_KEY, options.dir)
|
|
141
151
|
if (options.initialState) app.provide(M3_INITIAL_STATE_KEY, resolveInitialState(options))
|
|
142
152
|
if (options.cookies && typeof window !== 'undefined') enableCookies()
|
|
143
153
|
for (const custom of options.customPalettes ?? []) {
|
package/src/styles/theme.css
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
|
|
4
4
|
/* Enable class-based dark mode for Tailwind v4 */
|
|
5
5
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
6
|
+
/* Right to left by the element's own directionality (the nearest dir attribute), unlike Tailwind's rtl:, which
|
|
7
|
+
also matches anything under a [dir=rtl] ancestor, even inside a nested dir="ltr" */
|
|
8
|
+
@custom-variant m3-rtl (&:where(:dir(rtl)));
|
|
6
9
|
|
|
7
10
|
/* ---------------------------------------------------------------------- */
|
|
8
11
|
/* Material 3 design tokens — light theme (baseline purple) */
|
|
@@ -287,6 +290,16 @@
|
|
|
287
290
|
--field-bg: var(--color-surface);
|
|
288
291
|
}
|
|
289
292
|
|
|
293
|
+
/* Reading direction as a sign (1 = left to right, -1 = right to left), for transforms CSS can't mirror on
|
|
294
|
+
its own: components write translateX(calc(Npx * var(--m3-dir, 1))). Follows the nearest dir attribute */
|
|
295
|
+
:root,
|
|
296
|
+
[dir='ltr'] {
|
|
297
|
+
--m3-dir: 1;
|
|
298
|
+
}
|
|
299
|
+
[dir='rtl'] {
|
|
300
|
+
--m3-dir: -1;
|
|
301
|
+
}
|
|
302
|
+
|
|
290
303
|
html {
|
|
291
304
|
color-scheme: light;
|
|
292
305
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MColorPickerModal-H8nuX0Wu.js","names":["_openBlock","_createElementBlock","_createElementVNode","_unref","_normalizeStyle","_normalizeClass","_createVNode","MIcon","_toDisplayString","_createBlock","MIconButton","_createTextVNode","_withKeys","_Fragment","_renderList","_openBlock","_createBlock","MDialog","_unref","_withCtx","_createVNode","MButton","_createTextVNode","_toDisplayString","MColorPanel","MButton_default","MIcon_default","MIconButton_default","onStoragePrefix","_plugin_vue_export_helper_default","parseHex","c","input","ch","i","toHex","h","n","r","g","b","a","normalizeHex","rgbToHsv","max","d","hsvToRgb","f","k","v","s","hsvToHsl","l","hslToHsv","inkFor","hex","lin","RECENT_KEY","readRecents","storageKey","x","recentColors","ref","pushRecentColor","limit","defaultColorPresets","_hoisted_1","_hoisted_2","_hoisted_3","_hoisted_4","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","THUMB_INSET","CHECKER","_MColorPanel_default","defineComponent","__expose","__emit","props","__props","emit","t","useLocale","computed","opaqueHex","hueColor","setFromRgb","hsv","lastEmitted","commit","val","pick","color","areaEl","hueEl","alphaEl","dragging","clamp","min","update","el","target","e","p","onPointerDown","onPointerMove","onPointerUp","onKeydown","step","dx","dy","cur","next","canEyedrop","pickFromScreen","Ctor","sRGBHex","formats","format","formatLabel","cycleFormat","setHsv","alphaField","fields","list","rgb","round","hsl","editing","shown","key","display","onHexInput","text","onFieldInput","onFieldKeydown","recents","isSelected","fill","previewInk","showOriginal","openBlock","createElementBlock","createElementVNode","unref","normalizeStyle","_cache","$event","normalizeClass","createCommentVNode","createVNode","toDisplayString","createBlock","createTextVNode","withKeys","Fragment","renderList","group","MColorPickerModal_default","draft","open","cancel","confirm","picked","MDialog_default","withCtx"],"sources":["../src/composables/_colorUtils.ts","../src/components/_MColorPanel.vue","../src/components/MColorPickerModal.vue"],"sourcesContent":["// Internal color math shared by MColorPicker and MColorPickerModal (through _MColorPanel).\n// Not exported from index.ts.\nimport { ref } from 'vue'\nimport { onStoragePrefix, storageKey } from './_storageKeys'\n\nexport interface Rgba { r: number; g: number; b: number; a: number }\n/** h 0–360, s/v 0–100 */\nexport interface Hsv { h: number; s: number; v: number }\n/** h 0–360, s/l 0–100 */\nexport interface Hsl { h: number; s: number; l: number }\n\n/** Parses `#rgb`, `#rgba`, `#rrggbb` or `#rrggbbaa` (the `#` is optional). r/g/b 0–255, a 0–1. */\nexport function parseHex(input: string): Rgba | null {\n let c = input.trim().replace(/^#/, '')\n if (!/^([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(c)) return null\n if (c.length <= 4) c = [...c].map((ch) => ch + ch).join('')\n const n = (i: number) => parseInt(c.substring(i, i + 2), 16)\n return { r: n(0), g: n(2), b: n(4), a: c.length === 8 ? n(6) / 255 : 1 }\n}\n\n/** `#rrggbb`, or `#rrggbbaa` when a < 1. Lowercase. */\nexport function toHex({ r, g, b, a }: Rgba): string {\n const h = (n: number) => Math.round(Math.max(0, Math.min(255, n))).toString(16).padStart(2, '0')\n return `#${h(r)}${h(g)}${h(b)}${a < 1 ? h(a * 255) : ''}`\n}\n\n/** Lowercase canonical form of a hex string, or '' when it isn't one. */\nexport function normalizeHex(input: string): string {\n const c = parseHex(input)\n return c ? toHex(c) : ''\n}\n\nexport function rgbToHsv({ r, g, b }: Rgba): Hsv {\n r /= 255; g /= 255; b /= 255\n const max = Math.max(r, g, b), d = max - Math.min(r, g, b)\n let h = 0\n if (d !== 0) {\n if (max === r) h = ((g - b) / d + 6) % 6\n else if (max === g) h = (b - r) / d + 2\n else h = (r - g) / d + 4\n h *= 60\n }\n return { h, s: max === 0 ? 0 : (d / max) * 100, v: max * 100 }\n}\n\nexport function hsvToRgb({ h, s, v }: Hsv, a = 1): Rgba {\n s /= 100; v /= 100\n const f = (n: number) => {\n const k = (n + h / 60) % 6\n return (v - v * s * Math.max(0, Math.min(k, 4 - k, 1))) * 255\n }\n return { r: f(5), g: f(3), b: f(1), a }\n}\n\nexport function hsvToHsl({ h, s, v }: Hsv): Hsl {\n s /= 100; v /= 100\n const l = v * (1 - s / 2)\n const sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l)\n return { h, s: sl * 100, l: l * 100 }\n}\n\nexport function hslToHsv({ h, s, l }: Hsl): Hsv {\n s /= 100; l /= 100\n const v = l + s * Math.min(l, 1 - l)\n return { h, s: v === 0 ? 0 : 2 * (1 - l / v) * 100, v: v * 100 }\n}\n\n/** Black or white, whichever reads better on the color (WCAG relative luminance). */\nexport function inkFor(hex: string): '#000000' | '#ffffff' {\n const c = parseHex(hex)\n if (!c) return '#000000'\n const lin = (n: number) => {\n n /= 255\n return n <= 0.03928 ? n / 12.92 : ((n + 0.055) / 1.055) ** 2.4\n }\n const lum = 0.2126 * lin(c.r) + 0.7152 * lin(c.g) + 0.0722 * lin(c.b)\n // Contrast against black beats contrast against white above ~0.179\n return lum > 0.179 ? '#000000' : '#ffffff'\n}\n\n// ── Recent colors (per viewer, localStorage, shared by every picker on the page) ──────────────\n\nconst RECENT_KEY = 'm3-color-recent'\n\nfunction readRecents(): string[] {\n try {\n const v = JSON.parse(localStorage.getItem(storageKey(RECENT_KEY)) ?? '[]')\n return Array.isArray(v) ? v.filter((x): x is string => typeof x === 'string' && !!parseHex(x)) : []\n } catch {\n return []\n }\n}\n\nexport const recentColors = ref<string[]>(readRecents())\nonStoragePrefix(() => { recentColors.value = readRecents() })\n\nexport function pushRecentColor(hex: string, limit: number) {\n const c = normalizeHex(hex)\n if (!c) return\n recentColors.value = [c, ...recentColors.value.filter((x) => x !== c)].slice(0, Math.max(limit, 0))\n try { localStorage.setItem(storageKey(RECENT_KEY), JSON.stringify(recentColors.value)) } catch { /* storage blocked */ }\n}\n\n/** Default swatches for both pickers: the Material 2014 palette's 500 tones plus grey, black and white (3 rows of 7) */\nexport const defaultColorPresets = [\n '#f44336', '#e91e63', '#9c27b0', '#673ab7', '#3f51b5', '#2196f3', '#03a9f4',\n '#00bcd4', '#009688', '#4caf50', '#8bc34a', '#cddc39', '#ffeb3b', '#ffc107',\n '#ff9800', '#ff5722', '#795548', '#607d8b', '#9e9e9e', '#000000', '#ffffff',\n]\n","<script setup lang=\"ts\">\n/**\n * Internal: the picking UI shared by MColorPicker (in its dropdown) and MColorPickerModal (in its dialog).\n * Saturation/brightness area, hue and opacity sliders, eyedropper, HEX/RGB/HSL fields, recent and preset\n * swatches. Emits on every change; the parent decides when that becomes the real value.\n */\nimport { computed, onMounted, ref, watch } from 'vue'\nimport MIcon from './MIcon.vue'\nimport MIconButton from './MIconButton.vue'\nimport { useLocale } from '../composables/useLocale'\nimport {\n hslToHsv, hsvToHsl, hsvToRgb, inkFor, normalizeHex, parseHex, recentColors, rgbToHsv, toHex, type Rgba,\n} from '../composables/_colorUtils'\n\nconst props = defineProps<{\n modelValue: string\n presets: string[]\n alpha: boolean\n recent: boolean\n eyedropper: boolean\n /** Shown as the left half of the preview, click to restore */\n original?: string\n}>()\n\nconst emit = defineEmits<{ 'update:modelValue': [string] }>()\nconst t = useLocale()\n\n// ── State: HSV + alpha, kept here so hue survives grays and black ──────────────────────────\nconst h = ref(0)\nconst s = ref(100)\nconst v = ref(100)\nconst a = ref(1)\n\nconst hex = computed(() => toHex(hsvToRgb({ h: h.value, s: s.value, v: v.value }, props.alpha ? a.value : 1)))\nconst opaqueHex = computed(() => toHex(hsvToRgb({ h: h.value, s: s.value, v: v.value })))\nconst hueColor = computed(() => `hsl(${h.value}, 100%, 50%)`)\n\nfunction setFromRgb(c: Rgba) {\n const hsv = rgbToHsv(c)\n // A gray has no hue and black no saturation: keep the ones we had, so the thumbs don't jump\n if (hsv.v > 0 && hsv.s > 0) h.value = hsv.h\n if (hsv.v > 0) s.value = hsv.s\n v.value = hsv.v\n a.value = props.alpha ? c.a : 1\n}\n\nlet lastEmitted = ''\nfunction commit() {\n lastEmitted = hex.value\n if (hex.value !== normalizeHex(props.modelValue)) emit('update:modelValue', hex.value)\n}\n\nwatch(() => props.modelValue, (val) => {\n const n = normalizeHex(val)\n if (!n || n === lastEmitted) return\n setFromRgb(parseHex(n)!)\n lastEmitted = n\n}, { immediate: true })\n\nfunction pick(color: string) {\n const c = parseHex(color)\n if (!c) return\n setFromRgb(c)\n commit()\n}\n\n// ── Pointer: area and sliders ──────────────────────────────────────────────────────────────\ntype Target = 'area' | 'hue' | 'alpha'\nconst areaEl = ref<HTMLElement>()\nconst hueEl = ref<HTMLElement>()\nconst alphaEl = ref<HTMLElement>()\nconst dragging = ref<Target | null>(null)\n// The slider handles travel between the centers of the track's round ends (24px track)\nconst THUMB_INSET = 12\n\nconst clamp = (n: number, min: number, max: number) => Math.min(max, Math.max(min, n))\n\nfunction update(target: Target, e: PointerEvent) {\n const el = target === 'area' ? areaEl.value : target === 'hue' ? hueEl.value : alphaEl.value\n if (!el) return\n const r = el.getBoundingClientRect()\n if (target === 'area') {\n s.value = clamp(((e.clientX - r.left) / r.width) * 100, 0, 100)\n v.value = clamp((1 - (e.clientY - r.top) / r.height) * 100, 0, 100)\n } else {\n const p = clamp((e.clientX - r.left - THUMB_INSET) / (r.width - THUMB_INSET * 2), 0, 1)\n if (target === 'hue') h.value = p * 360\n else a.value = Math.round(p * 100) / 100\n }\n commit()\n}\n\nfunction onPointerDown(target: Target, e: PointerEvent) {\n if (e.button !== 0) return\n e.preventDefault()\n ;(e.currentTarget as HTMLElement).focus({ preventScroll: true })\n ;(e.currentTarget as HTMLElement).setPointerCapture?.(e.pointerId)\n dragging.value = target\n update(target, e)\n}\nfunction onPointerMove(target: Target, e: PointerEvent) {\n if (dragging.value === target) update(target, e)\n}\nfunction onPointerUp() {\n dragging.value = null\n}\n\n// ── Keyboard ───────────────────────────────────────────────────────────────────────────────\nfunction onKeydown(target: Target, e: KeyboardEvent) {\n const step = e.shiftKey ? 10 : 1\n const dx = e.key === 'ArrowRight' ? step : e.key === 'ArrowLeft' ? -step : 0\n const dy = e.key === 'ArrowUp' ? step : e.key === 'ArrowDown' ? -step : 0\n if (target === 'area') {\n if (!dx && !dy) return\n s.value = clamp(s.value + dx, 0, 100)\n v.value = clamp(v.value + dy, 0, 100)\n } else {\n const max = target === 'hue' ? 360 : 100\n const cur = target === 'hue' ? h.value : a.value * 100\n let next: number\n if (e.key === 'Home') next = 0\n else if (e.key === 'End') next = max\n else if (dx || dy) next = clamp(cur + (dx || dy), 0, max)\n else return\n if (target === 'hue') h.value = next\n else a.value = Math.round(next) / 100\n }\n e.preventDefault()\n commit()\n}\n\n// ── Eyedropper (Chromium only; the button isn't shown elsewhere) ─────────────────────────────\nconst canEyedrop = ref(false)\nonMounted(() => { canEyedrop.value = 'EyeDropper' in window })\n\nasync function pickFromScreen() {\n try {\n const Ctor = (window as unknown as { EyeDropper: new () => { open(): Promise<{ sRGBHex: string }> } }).EyeDropper\n const { sRGBHex } = await new Ctor().open()\n const c = parseHex(sRGBHex)\n if (c) { setFromRgb({ ...c, a: a.value }); commit() }\n } catch { /* cancelled */ }\n}\n\n// ── Text fields ─────────────────────────────────────────────────────────────────────────────\ntype Format = 'hex' | 'rgb' | 'hsl'\nconst formats: { id: Format; label: string }[] = [\n { id: 'hex', label: 'HEX' }, { id: 'rgb', label: 'RGB' }, { id: 'hsl', label: 'HSL' },\n]\nconst format = ref<Format>('hex')\nconst formatLabel = computed(() => formats.find((f) => f.id === format.value)!.label)\nfunction cycleFormat() {\n format.value = formats[(formats.findIndex((f) => f.id === format.value) + 1) % formats.length]!.id\n editing.value = null\n}\n\ninterface Field { key: string; label: string; display: string; max: number; apply: (n: number) => void }\n\nfunction setHsv(next: { h: number; s: number; v: number }) {\n h.value = next.h; s.value = next.s; v.value = next.v\n}\n\nconst alphaField = computed<Field>(() => ({\n key: 'a', label: 'A', display: String(Math.round(a.value * 100)), max: 100,\n apply: (n) => { a.value = n / 100 },\n}))\n\nconst fields = computed<Field[]>(() => {\n const list: Field[] = []\n if (format.value === 'rgb') {\n const rgb = hsvToRgb({ h: h.value, s: s.value, v: v.value })\n const round = { r: Math.round(rgb.r), g: Math.round(rgb.g), b: Math.round(rgb.b), a: a.value }\n for (const ch of ['r', 'g', 'b'] as const) {\n list.push({\n key: ch, label: ch.toUpperCase(), display: String(round[ch]), max: 255,\n apply: (n) => setFromRgb({ ...round, [ch]: n }),\n })\n }\n } else if (format.value === 'hsl') {\n const hsl = hsvToHsl({ h: h.value, s: s.value, v: v.value })\n const round = { h: Math.round(hsl.h), s: Math.round(hsl.s), l: Math.round(hsl.l) }\n for (const ch of ['h', 's', 'l'] as const) {\n list.push({\n key: ch, label: ch.toUpperCase(), display: String(round[ch]), max: ch === 'h' ? 360 : 100,\n // Straight from HSL to HSV, so a hue typed on a gray isn't lost\n apply: (n) => setHsv(hslToHsv({ ...round, [ch]: n })),\n })\n }\n }\n if (props.alpha && format.value !== 'hex') list.push(alphaField.value)\n return list\n})\n\n// While a field is focused it shows what the user typed, not the reformatted value\nconst editing = ref<{ key: string; text: string } | null>(null)\nconst shown = (key: string, display: string) => (editing.value?.key === key ? editing.value.text : display)\n\nfunction onHexInput(e: Event) {\n const text = (e.target as HTMLInputElement).value\n editing.value = { key: 'hex', text }\n const c = parseHex(text)\n if (c) { setFromRgb(c); commit() }\n}\n\nfunction onFieldInput(f: Field, e: Event) {\n const text = (e.target as HTMLInputElement).value\n editing.value = { key: f.key, text }\n if (!/^\\d+$/.test(text.trim())) return\n const n = Number(text)\n if (n > f.max) return\n f.apply(n)\n commit()\n}\n\nfunction onFieldKeydown(f: Field, e: KeyboardEvent) {\n if (e.key === 'Enter') { editing.value = null; return }\n if (e.key !== 'ArrowUp' && e.key !== 'ArrowDown') return\n e.preventDefault()\n const step = (e.shiftKey ? 10 : 1) * (e.key === 'ArrowUp' ? 1 : -1)\n f.apply(clamp(Number(f.display) + step, 0, f.max))\n editing.value = null\n commit()\n}\n\n// ── Swatches ────────────────────────────────────────────────────────────────────────────────\nconst recents = computed(() => (props.recent ? recentColors.value : []))\nconst isSelected = (color: string) => normalizeHex(color) === hex.value\n// Swatches and preview segments paint the color over a checkerboard in one background, so a translucent color\n// shows it and the edge is a single antialiased shape (nested clipped layers looked jagged in Firefox)\nconst CHECKER = 'repeating-conic-gradient(#d4d4d4 0 25%, #fff 0 50%) 0 0 / 8px 8px'\nconst fill = (color: string) => `linear-gradient(${color}, ${color}), ${CHECKER}`\n// Over a mostly transparent color the checkerboard (light) is what's behind the text\nconst previewInk = computed(() => (a.value < 0.5 ? '#000000' : inkFor(opaqueHex.value)))\nconst showOriginal = computed(() => !!props.original && !!normalizeHex(props.original) && normalizeHex(props.original) !== hex.value)\n\ndefineExpose({ focus: () => areaEl.value?.focus({ preventScroll: true }) })\n</script>\n\n<template>\n <div class=\"flex flex-col gap-4\">\n <!-- Saturation (x) / brightness (y) -->\n <div\n ref=\"areaEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"`${t.colorSaturation}, ${t.colorBrightness}`\"\n :aria-valuenow=\"Math.round(s)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n :aria-valuetext=\"`${t.colorSaturation} ${Math.round(s)}%, ${t.colorBrightness} ${Math.round(v)}%`\"\n class=\"relative h-40 w-full shrink-0 cursor-crosshair touch-none rounded-md outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :style=\"{ background: `linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, ${hueColor})` }\"\n @pointerdown=\"onPointerDown('area', $event)\"\n @pointermove=\"onPointerMove('area', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('area', $event)\"\n >\n <span\n class=\"m3-cp-area-thumb pointer-events-none absolute size-5 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-white transition-[scale] duration-150\"\n :class=\"dragging === 'area' ? 'scale-125' : ''\"\n :style=\"{ left: `${s}%`, top: `${100 - v}%`, backgroundColor: opaqueHex }\"\n />\n </div>\n\n <!-- Hue / opacity: thick tracks with M3 Expressive's bar handle -->\n <div class=\"flex flex-col gap-1\">\n <div\n ref=\"hueEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"t.colorHue\"\n :aria-valuenow=\"Math.round(h)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"360\"\n class=\"m3-cp-slider group\"\n @pointerdown=\"onPointerDown('hue', $event)\"\n @pointermove=\"onPointerMove('hue', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('hue', $event)\"\n >\n <span class=\"m3-cp-track m3-cp-hue\" />\n <span\n class=\"m3-cp-handle\"\n :class=\"{ 'm3-cp-handle-pressed': dragging === 'hue' }\"\n :style=\"{ left: `calc(${THUMB_INSET}px + ${h / 360} * (100% - ${THUMB_INSET * 2}px))` }\"\n />\n </div>\n <div\n v-if=\"alpha\"\n ref=\"alphaEl\"\n role=\"slider\"\n tabindex=\"0\"\n :aria-label=\"t.colorAlpha\"\n :aria-valuenow=\"Math.round(a * 100)\"\n aria-valuemin=\"0\"\n aria-valuemax=\"100\"\n :aria-valuetext=\"`${Math.round(a * 100)}%`\"\n class=\"m3-cp-slider group\"\n @pointerdown=\"onPointerDown('alpha', $event)\"\n @pointermove=\"onPointerMove('alpha', $event)\"\n @pointerup=\"onPointerUp\"\n @pointercancel=\"onPointerUp\"\n @keydown=\"onKeydown('alpha', $event)\"\n >\n <span class=\"m3-cp-track\" :style=\"{ background: `linear-gradient(to right, transparent, ${opaqueHex}), ${CHECKER}` }\" />\n <span\n class=\"m3-cp-handle\"\n :class=\"{ 'm3-cp-handle-pressed': dragging === 'alpha' }\"\n :style=\"{ left: `calc(${THUMB_INSET}px + ${a} * (100% - ${THUMB_INSET * 2}px))` }\"\n />\n </div>\n </div>\n\n <!-- Preview (original | new) and eyedropper -->\n <div class=\"flex items-center gap-2\">\n <div class=\"flex h-10 min-w-0 flex-1\">\n <button\n v-if=\"showOriginal\"\n type=\"button\"\n class=\"m3-cp-swatch flex w-12 shrink-0 cursor-pointer items-center justify-center rounded-l-full outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :style=\"{ background: fill(original!) }\"\n :aria-label=\"t.colorOriginal\"\n :title=\"t.colorOriginal\"\n @click=\"pick(original!)\"\n >\n <MIcon name=\"undo\" :size=\"18\" :style=\"{ color: inkFor(original!) }\" />\n </button>\n <span\n class=\"m3-cp-swatch flex min-w-0 flex-1 items-center px-4 font-mono text-label-large transition-[border-radius] duration-200\"\n :class=\"showOriginal ? 'rounded-r-full' : 'rounded-full'\"\n :style=\"{ background: fill(hex), color: previewInk }\"\n >{{ hex }}</span>\n </div>\n <MIconButton v-if=\"eyedropper && canEyedrop\" icon=\"colorize\" variant=\"tonal\" :label=\"t.colorEyedropper\" @click=\"pickFromScreen\" />\n </div>\n\n <!-- Format + fields -->\n <div class=\"flex items-start gap-2\">\n <button\n type=\"button\"\n class=\"flex h-10 shrink-0 cursor-pointer items-center gap-0.5 rounded-full bg-secondary-container pr-2 pl-3 text-label-large text-on-secondary-container outline-none transition-[background-color] duration-150 hover:bg-[color-mix(in_srgb,var(--color-secondary-container),var(--color-on-secondary-container)_8%)] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :aria-label=\"`${t.colorFormat}: ${formatLabel}`\"\n @click=\"cycleFormat\"\n >\n {{ formatLabel }}\n <MIcon name=\"unfold_more\" :size=\"18\" />\n </button>\n <input\n v-if=\"format === 'hex'\"\n type=\"text\"\n spellcheck=\"false\"\n autocomplete=\"off\"\n :maxlength=\"alpha ? 9 : 7\"\n aria-label=\"HEX\"\n :value=\"shown('hex', hex)\"\n class=\"m3-cp-field min-w-0 flex-1 font-mono text-body-medium\"\n @input=\"onHexInput\"\n @blur=\"editing = null\"\n @keydown.enter=\"editing = null\"\n />\n <label v-for=\"f in fields\" :key=\"f.key\" class=\"flex min-w-0 flex-1 flex-col items-center gap-1\">\n <input\n type=\"text\"\n inputmode=\"numeric\"\n autocomplete=\"off\"\n :maxlength=\"3\"\n :aria-label=\"f.label\"\n :value=\"shown(f.key, f.display)\"\n class=\"m3-cp-field w-full font-mono text-body-medium\"\n @input=\"onFieldInput(f, $event)\"\n @keydown=\"onFieldKeydown(f, $event)\"\n @blur=\"editing = null\"\n />\n <span class=\"text-label-small text-on-surface-variant\">{{ f.label }}</span>\n </label>\n </div>\n\n <!-- Swatches: rounded squares that morph into a circle when selected -->\n <template v-for=\"group in [{ id: 'recent', label: t.colorRecent, colors: recents }, { id: 'presets', label: t.colorPresets, colors: presets }]\" :key=\"group.id\">\n <div v-if=\"group.colors.length\" role=\"group\" :aria-label=\"group.label\" class=\"flex flex-col gap-2\">\n <span v-if=\"recents.length\" class=\"text-label-medium text-on-surface-variant\">{{ group.label }}</span>\n <div class=\"grid grid-cols-7 gap-2\">\n <button\n v-for=\"color in group.colors\"\n :key=\"color\"\n type=\"button\"\n class=\"m3-cp-swatch m3-cp-morph flex aspect-square cursor-pointer items-center justify-center outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary\"\n :class=\"{ 'm3-cp-morph-selected': isSelected(color) }\"\n :style=\"{ background: fill(color) }\"\n :aria-label=\"color\"\n :aria-pressed=\"isSelected(color)\"\n @click=\"pick(color)\"\n >\n <MIcon v-if=\"isSelected(color)\" name=\"check\" :size=\"18\" :style=\"{ color: inkFor(color) }\" />\n </button>\n </div>\n </div>\n </template>\n </div>\n</template>\n\n<style scoped>\n.m3-cp-hue {\n background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);\n}\n/* Hairline so white swatches show on light surfaces and black ones on dark */\n.m3-cp-swatch {\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n.m3-cp-morph {\n border-radius: 30%;\n transition: border-radius 250ms cubic-bezier(0.2, 0, 0, 1);\n}\n.m3-cp-morph:hover {\n border-radius: 40%;\n}\n.m3-cp-morph-selected,\n.m3-cp-morph-selected:hover {\n border-radius: 50%;\n}\n.m3-cp-area-thumb {\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2), 0 1px 3px 1px rgb(0 0 0 / 0.25);\n}\n.m3-cp-slider {\n position: relative;\n height: 32px;\n cursor: pointer;\n touch-action: none;\n outline: none;\n}\n.m3-cp-track {\n position: absolute;\n inset: 4px 0;\n border-radius: 9999px;\n box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n/* After M3 Expressive's slider handle: a bar taller than the track that narrows while pressed */\n.m3-cp-handle {\n position: absolute;\n top: 0;\n width: 6px;\n height: 32px;\n translate: -50% 0;\n border-radius: 9999px;\n background: #fff;\n box-shadow: 0 0 0 1px rgb(0 0 0 / 0.2), 0 1px 3px rgb(0 0 0 / 0.3);\n pointer-events: none;\n transition: width 150ms cubic-bezier(0.2, 0, 0, 1);\n}\n.m3-cp-handle-pressed {\n width: 4px;\n}\n.group:focus-visible .m3-cp-handle {\n outline: 2px solid var(--color-primary);\n outline-offset: 2px;\n}\n.m3-cp-field {\n height: 40px;\n border-radius: var(--radius-sm);\n border: none;\n background: var(--color-surface-container-highest);\n padding: 0 8px;\n text-align: center;\n color: var(--color-on-surface);\n caret-color: var(--color-primary);\n outline: 2px solid transparent;\n outline-offset: -2px;\n transition: outline-color 150ms;\n}\n.m3-cp-field:hover {\n outline-color: color-mix(in srgb, var(--color-on-surface) 12%, transparent);\n}\n.m3-cp-field:focus {\n outline-color: var(--color-primary);\n}\n</style>\n","<script setup lang=\"ts\">\n/**\n * A color picker in a dialog: saturation/brightness area, hue (and optional opacity) slider, eyedropper,\n * HEX/RGB/HSL fields, recent colors and preset swatches. Built on MDialog; the color is only applied on confirm,\n * and the preview shows it next to the original.\n *\n * @event update:modelValue Emitted when a color is confirmed — powers v-model. Only fires on confirm, not while\n * dragging\n * @event update:show Emitted when the dialog opens or closes — powers v-model:show\n */\nimport { ref, watch } from 'vue'\nimport MButton from './MButton.vue'\nimport MDialog from './MDialog.vue'\nimport MColorPanel from './_MColorPanel.vue'\nimport { useLocale } from '../composables/useLocale'\nimport { defaultColorPresets, normalizeHex, pushRecentColor } from '../composables/_colorUtils'\n\nconst props = withDefaults(defineProps<{\n /** Selected color in hex format (v-model). `#rrggbb`, or `#rrggbbaa` when `alpha` is on and the color isn't opaque. */\n modelValue: string\n /** Controls dialog visibility (v-model:show) */\n show?: boolean\n /** Preset color swatches shown in the dialog */\n presets?: string[]\n /** Dialog title; defaults to the locale's `selectColor` */\n title?: string\n /** Adds an opacity slider and an alpha channel to the value */\n alpha?: boolean\n /** Remember confirmed colors and show them above the presets (stored in localStorage, shared by every picker). */\n recent?: boolean\n /** How many recent colors to keep. */\n recentLimit?: number\n /** Show a button to pick a color from the screen, where the browser supports it (Chrome, Edge). */\n eyedropper?: boolean\n}>(), {\n show: false,\n presets: () => defaultColorPresets,\n alpha: false,\n recent: true,\n recentLimit: 7,\n eyedropper: true,\n})\n\nconst t = useLocale()\nconst emit = defineEmits<{\n 'update:modelValue': [string]\n 'update:show': [boolean]\n}>()\n\n// The color being picked; becomes the value only on confirm\nconst draft = ref(props.modelValue)\n\nwatch(() => props.show, (open) => {\n if (open) draft.value = props.modelValue\n}, { immediate: true })\n\nfunction cancel() { emit('update:show', false) }\n\nfunction confirm() {\n const picked = normalizeHex(draft.value) || draft.value\n if (props.recent) pushRecentColor(picked, props.recentLimit)\n emit('update:modelValue', picked)\n emit('update:show', false)\n}\n</script>\n\n<template>\n <MDialog\n :model-value=\"show\"\n :title=\"title || t.selectColor\"\n max-width=\"328px\"\n :closable=\"false\"\n @update:model-value=\"!$event && cancel()\"\n >\n <MColorPanel\n v-model=\"draft\"\n :presets=\"presets\"\n :alpha=\"alpha\"\n :recent=\"recent\"\n :eyedropper=\"eyedropper\"\n :original=\"modelValue\"\n />\n <template #actions>\n <MButton variant=\"text\" @click=\"cancel\">{{ t.cancel }}</MButton>\n <MButton variant=\"text\" @click=\"confirm\">{{ t.confirm }}</MButton>\n </template>\n </MDialog>\n</template>\n"],"mappings":";;;;;;;;AAYA,SAAgB8B,EAAS,GAA4B;CACnD,IAAIC,IAAIC,EAAM,KAAK,CAAC,CAAC,QAAQ,MAAM,EAAE;CACrC,IAAI,CAAC,6CAA6C,KAAKD,CAAC,GAAG,OAAO;CAClE,AAAIA,EAAE,UAAU,MAAG,IAAI,CAAC,GAAGA,CAAC,CAAC,CAAC,KAAK,MAAOE,IAAKA,CAAE,CAAC,CAAC,KAAK,EAAE;CAC1D,IAAM,KAAK,MAAc,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,EAAK,eAAe,EAAK;EAC3B;E,kBAIE5E,EAAA,GAAAC,EAmBUC,GAAA;GAlBP,eAAayE,EAAA;GACb,OAAOA,EAAA,SAASxE,EAAA0E,CAAA,CAAC,CAAC;GACnB,aAAU;GACT,UAAU;GACV,uBAAkB,AAAAiE,EAAA,QAAA,MAAA,CAAGC,KAAUc,EAAM;;GAU3B,SAAOzJ,QACgD,CAAhEC,EAAgEC,GAAA;IAAvD,SAAQ;IAAQ,SAAOuJ;;IAAQ,SAAAzJ,QAAc,CAAXG,EAAAC,EAAAL,EAAA0E,CAAA,CAAC,CAAC,MAAM,GAAA,CAAA,C;;G,IACnDxE,EAAkEC,GAAA;IAAzD,SAAQ;IAAQ,SAAOwJ;;IAAS,SAAA1J,QAAe,CAAZG,EAAAC,EAAAL,EAAA0E,CAAA,CAAC,CAAC,OAAO,GAAA,CAAA,C;;;GAVvD,SAAAzE,QAOE,CAPFC,EAOEI,GAAA;IANS,YAAAkJ,EAAA;IAAA,uBAAA,AAAAb,EAAA,QAAA,MAAA,EAAK,QAAAC;IACb,SAASpE,EAAA;IACT,OAAOA,EAAA;IACP,QAAQA,EAAA;IACR,YAAYA,EAAA;IACZ,UAAUA,EAAA"}
|
package/dist/MDialog-B42Mhn8W.js
DELETED
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-DL96OFgr.js";
|
|
2
|
-
import { p as t, t as n } from "./MIconButton-BBggVwBV.js";
|
|
3
|
-
import { t as r } from "./MIcon-DpajuUTJ.js";
|
|
4
|
-
import { t as i } from "./MSpinner-UCdtSOHP.js";
|
|
5
|
-
import { t as a } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
6
|
-
import { r as o } from "./_popupPosition-nL8SVKPK.js";
|
|
7
|
-
import { Fragment as s, Teleport as c, 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, mergeProps as y, nextTick as b, normalizeClass as x, normalizeStyle as S, onBeforeUnmount as C, onUnmounted as w, openBlock as T, ref as E, renderSlot as D, resolveDynamicComponent as O, toDisplayString as k, unref as A, useId as j, watch as M, withCtx as N, withDirectives as P, withModifiers as F } from "vue";
|
|
8
|
-
// src/composables/_useScrollLock.ts
|
|
9
|
-
var I = 0, L = "";
|
|
10
|
-
function R() {
|
|
11
|
-
I++ === 0 && (L = document.body.style.overflow, document.body.style.overflow = "hidden");
|
|
12
|
-
}
|
|
13
|
-
function z() {
|
|
14
|
-
I > 0 && --I === 0 && (document.body.style.overflow = L);
|
|
15
|
-
}
|
|
16
|
-
function B(e) {
|
|
17
|
-
let t = !1;
|
|
18
|
-
function n(e) {
|
|
19
|
-
typeof document < "u" && e !== t && (t = e, e ? R() : z());
|
|
20
|
-
}
|
|
21
|
-
return e && M(e, (e) => n(!!e), { immediate: !0 }), v() && C(() => n(!1)), { set: n };
|
|
22
|
-
}
|
|
23
|
-
// src/components/MButton.vue?vue&type=script&setup=true&lang.ts
|
|
24
|
-
var V = "relative inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden transition-[box-shadow,background-color,color] duration-150 select-none cursor-pointer disabled:cursor-not-allowed disabled:shadow-none disabled:text-on-surface/38 before:content-[''] before:pointer-events-none before:absolute before:inset-0 before:bg-current before:opacity-0 before:transition-opacity before:duration-150 enabled:hover:before:opacity-[0.08] enabled:active:before:opacity-[0.12]", H = /* @__PURE__ */ _({
|
|
25
|
-
__name: "MButton",
|
|
26
|
-
props: {
|
|
27
|
-
variant: { default: "filled" },
|
|
28
|
-
color: { default: "primary" },
|
|
29
|
-
type: { default: "button" },
|
|
30
|
-
disabled: {
|
|
31
|
-
type: Boolean,
|
|
32
|
-
default: !1
|
|
33
|
-
},
|
|
34
|
-
loading: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: !1
|
|
37
|
-
},
|
|
38
|
-
icon: {},
|
|
39
|
-
iconFilled: { type: Boolean },
|
|
40
|
-
iconPos: { default: "leading" },
|
|
41
|
-
size: { default: "sm" },
|
|
42
|
-
shape: { default: "rounded" },
|
|
43
|
-
to: {},
|
|
44
|
-
rippleColor: {},
|
|
45
|
-
contentColor: {}
|
|
46
|
-
},
|
|
47
|
-
setup(e) {
|
|
48
|
-
let n = ["primary", "error"], a = e, o = u(() => a.to ? "RouterLink" : "button"), c = u(() => !!a.color && !n.includes(a.color)), l = u(() => {
|
|
49
|
-
if (c.value) return {
|
|
50
|
-
"--color-primary": a.color,
|
|
51
|
-
"--color-on-primary": "#ffffff",
|
|
52
|
-
"--color-primary-container": a.color + "33",
|
|
53
|
-
"--color-on-primary-container": a.color
|
|
54
|
-
};
|
|
55
|
-
}), m = u(() => a.color === "error"), h = /^(on-)?(primary|secondary|tertiary|error|surface|surface-variant|inverse-surface|inverse-primary)(-container|-variant)?$/, g = u(() => {
|
|
56
|
-
let e = a.contentColor;
|
|
57
|
-
return !e || a.disabled || a.loading ? l.value : {
|
|
58
|
-
...l.value,
|
|
59
|
-
color: h.test(e) ? `var(--color-${e})` : e
|
|
60
|
-
};
|
|
61
|
-
}), _ = u(() => {
|
|
62
|
-
switch (a.variant) {
|
|
63
|
-
case "filled":
|
|
64
|
-
case "tonal":
|
|
65
|
-
case "elevated": return "disabled:bg-on-surface/10";
|
|
66
|
-
case "outlined": return m.value ? "disabled:border-error/10" : "disabled:border-outline-variant/10";
|
|
67
|
-
default: return "";
|
|
68
|
-
}
|
|
69
|
-
}), v = {
|
|
70
|
-
xs: {
|
|
71
|
-
h: "h-8",
|
|
72
|
-
text: "text-label-large",
|
|
73
|
-
icon: 20,
|
|
74
|
-
spinner: 16,
|
|
75
|
-
gap: "gap-1",
|
|
76
|
-
px: "px-3",
|
|
77
|
-
pxText: "px-2",
|
|
78
|
-
squareRadius: "rounded-md"
|
|
79
|
-
},
|
|
80
|
-
sm: {
|
|
81
|
-
h: "h-10",
|
|
82
|
-
text: "text-label-large",
|
|
83
|
-
icon: 20,
|
|
84
|
-
spinner: 16,
|
|
85
|
-
gap: "gap-2",
|
|
86
|
-
px: "px-4",
|
|
87
|
-
pxText: "px-3",
|
|
88
|
-
squareRadius: "rounded-md"
|
|
89
|
-
},
|
|
90
|
-
md: {
|
|
91
|
-
h: "h-14",
|
|
92
|
-
text: "text-title-medium",
|
|
93
|
-
icon: 24,
|
|
94
|
-
spinner: 18,
|
|
95
|
-
gap: "gap-2",
|
|
96
|
-
px: "px-6",
|
|
97
|
-
pxText: "px-3",
|
|
98
|
-
squareRadius: "rounded-lg"
|
|
99
|
-
},
|
|
100
|
-
lg: {
|
|
101
|
-
h: "h-24",
|
|
102
|
-
text: "text-headline-small",
|
|
103
|
-
icon: 32,
|
|
104
|
-
spinner: 26,
|
|
105
|
-
gap: "gap-3",
|
|
106
|
-
px: "px-12",
|
|
107
|
-
pxText: "px-4",
|
|
108
|
-
squareRadius: "rounded-xl"
|
|
109
|
-
},
|
|
110
|
-
xl: {
|
|
111
|
-
h: "h-[136px]",
|
|
112
|
-
text: "text-headline-large",
|
|
113
|
-
icon: 40,
|
|
114
|
-
spinner: 34,
|
|
115
|
-
gap: "gap-4",
|
|
116
|
-
px: "px-16",
|
|
117
|
-
pxText: "px-4",
|
|
118
|
-
squareRadius: "rounded-xl"
|
|
119
|
-
}
|
|
120
|
-
}, y = u(() => v[a.size] ?? v.sm), b = u(() => `${y.value.h} ${y.value.text} ${y.value.gap}`), C = u(() => y.value.icon), w = u(() => y.value.spinner), E = u(() => a.variant === "text" ? y.value.pxText : y.value.px), k = u(() => a.shape === "squared" ? y.value.squareRadius : "rounded-full"), j = u(() => {
|
|
121
|
-
let e = m.value;
|
|
122
|
-
switch (a.variant) {
|
|
123
|
-
case "filled": return e ? "bg-error text-on-error enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-primary text-on-primary enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
|
|
124
|
-
case "tonal": return e ? "bg-error-container text-on-error-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none" : "bg-secondary-container text-on-secondary-container enabled:hover:shadow-elevation-1 enabled:active:shadow-none";
|
|
125
|
-
case "elevated": return e ? "bg-surface-container-low text-error shadow-elevation-1 enabled:hover:shadow-elevation-2" : "bg-surface-container-low text-primary shadow-elevation-1 enabled:hover:shadow-elevation-2";
|
|
126
|
-
case "outlined": return e ? "border border-error text-error" : "border border-outline-variant text-primary";
|
|
127
|
-
case "text": return e ? "text-error" : "text-primary";
|
|
128
|
-
default: return "";
|
|
129
|
-
}
|
|
130
|
-
});
|
|
131
|
-
return (n, a) => P((T(), d(O(o.value), {
|
|
132
|
-
to: e.to || void 0,
|
|
133
|
-
type: e.to ? void 0 : e.type,
|
|
134
|
-
disabled: e.disabled || e.loading,
|
|
135
|
-
class: x([
|
|
136
|
-
V,
|
|
137
|
-
k.value,
|
|
138
|
-
b.value,
|
|
139
|
-
E.value,
|
|
140
|
-
j.value,
|
|
141
|
-
_.value
|
|
142
|
-
]),
|
|
143
|
-
style: S(g.value)
|
|
144
|
-
}, {
|
|
145
|
-
default: N(() => [
|
|
146
|
-
e.iconPos === "leading" ? (T(), p(s, { key: 0 }, [e.loading ? (T(), d(i, {
|
|
147
|
-
key: 0,
|
|
148
|
-
size: w.value
|
|
149
|
-
}, null, 8, ["size"])) : e.icon ? (T(), d(r, {
|
|
150
|
-
key: 1,
|
|
151
|
-
name: e.icon,
|
|
152
|
-
size: C.value,
|
|
153
|
-
filled: e.iconFilled
|
|
154
|
-
}, null, 8, [
|
|
155
|
-
"name",
|
|
156
|
-
"size",
|
|
157
|
-
"filled"
|
|
158
|
-
])) : f("", !0)], 64)) : f("", !0),
|
|
159
|
-
D(n.$slots, "default"),
|
|
160
|
-
e.iconPos === "trailing" ? (T(), p(s, { key: 1 }, [e.loading ? (T(), d(i, {
|
|
161
|
-
key: 0,
|
|
162
|
-
size: w.value
|
|
163
|
-
}, null, 8, ["size"])) : e.icon ? (T(), d(r, {
|
|
164
|
-
key: 1,
|
|
165
|
-
name: e.icon,
|
|
166
|
-
size: C.value,
|
|
167
|
-
filled: e.iconFilled
|
|
168
|
-
}, null, 8, [
|
|
169
|
-
"name",
|
|
170
|
-
"size",
|
|
171
|
-
"filled"
|
|
172
|
-
])) : f("", !0)], 64)) : f("", !0)
|
|
173
|
-
]),
|
|
174
|
-
_: 3
|
|
175
|
-
}, 8, [
|
|
176
|
-
"to",
|
|
177
|
-
"type",
|
|
178
|
-
"disabled",
|
|
179
|
-
"class",
|
|
180
|
-
"style"
|
|
181
|
-
])), [[A(t), {
|
|
182
|
-
disabled: e.disabled || e.loading,
|
|
183
|
-
color: e.rippleColor
|
|
184
|
-
}]]);
|
|
185
|
-
}
|
|
186
|
-
}), U = ["aria-labelledby", "aria-label"], W = {
|
|
187
|
-
key: 0,
|
|
188
|
-
class: "min-h-0 overflow-y-auto rounded-[inherit]"
|
|
189
|
-
}, G = { class: "relative px-6 pt-6 pb-2" }, K = {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: "absolute right-4 top-4"
|
|
192
|
-
}, q = {
|
|
193
|
-
key: 1,
|
|
194
|
-
class: "mb-4 flex justify-center text-secondary"
|
|
195
|
-
}, J = {
|
|
196
|
-
key: 0,
|
|
197
|
-
class: "shrink-0 border-t border-outline-variant"
|
|
198
|
-
}, Y = {
|
|
199
|
-
key: 1,
|
|
200
|
-
class: "flex flex-wrap justify-end gap-2 px-6 pt-4 pb-6"
|
|
201
|
-
}, X = ["aria-labelledby", "aria-label"], Z = {
|
|
202
|
-
key: 0,
|
|
203
|
-
class: "min-h-0 flex-1 overflow-y-auto"
|
|
204
|
-
}, Q = {
|
|
205
|
-
key: 1,
|
|
206
|
-
class: "flex h-14 shrink-0 items-center gap-2 px-2"
|
|
207
|
-
}, $ = {
|
|
208
|
-
key: 1,
|
|
209
|
-
class: "flex items-center gap-2"
|
|
210
|
-
}, ee = {
|
|
211
|
-
key: 2,
|
|
212
|
-
class: "flex-1 overflow-y-auto px-6 py-4 text-body-medium text-on-surface-variant"
|
|
213
|
-
}, te = /*#__PURE__*/ a(/* @__PURE__ */ _({
|
|
214
|
-
inheritAttrs: !1,
|
|
215
|
-
__name: "MDialog",
|
|
216
|
-
props: {
|
|
217
|
-
modelValue: { type: Boolean },
|
|
218
|
-
title: {},
|
|
219
|
-
maxWidth: { default: "max-w-[560px]" },
|
|
220
|
-
maxHeight: { default: "max-h-[90vh]" },
|
|
221
|
-
persistent: {
|
|
222
|
-
type: Boolean,
|
|
223
|
-
default: !1
|
|
224
|
-
},
|
|
225
|
-
fullscreen: {
|
|
226
|
-
type: Boolean,
|
|
227
|
-
default: !1
|
|
228
|
-
},
|
|
229
|
-
closeLabel: {},
|
|
230
|
-
closable: {
|
|
231
|
-
type: Boolean,
|
|
232
|
-
default: !0
|
|
233
|
-
},
|
|
234
|
-
bare: {
|
|
235
|
-
type: Boolean,
|
|
236
|
-
default: !1
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
emits: ["update:modelValue"],
|
|
240
|
-
setup(t, { emit: r }) {
|
|
241
|
-
let i = t, a = e(), _ = (e) => /^-?[\d.]+[a-z%]*$|^(calc|min|max|clamp|var)\(/i.test(e.trim()), v = u(() => [i.maxWidth, i.maxHeight].filter((e) => !_(e))), S = u(() => ({
|
|
242
|
-
..._(i.maxWidth) ? { maxWidth: i.maxWidth } : {},
|
|
243
|
-
..._(i.maxHeight) ? { maxHeight: i.maxHeight } : {}
|
|
244
|
-
})), C = r;
|
|
245
|
-
function O() {
|
|
246
|
-
i.persistent || C("update:modelValue", !1);
|
|
247
|
-
}
|
|
248
|
-
let P = E(), I = E(), L = E(!1), R;
|
|
249
|
-
function z() {
|
|
250
|
-
let e = P.value;
|
|
251
|
-
e ? L.value = e.scrollHeight - e.scrollTop - e.clientHeight > 1 : L.value = !1;
|
|
252
|
-
}
|
|
253
|
-
B(() => i.modelValue), o(() => i.modelValue, O);
|
|
254
|
-
let V = `m3-dialog-${j()}`;
|
|
255
|
-
return M(() => i.modelValue, async (e) => {
|
|
256
|
-
typeof window < "u" && (e ? (await b(), z(), R = new ResizeObserver(z), P.value && R.observe(P.value), I.value && R.observe(I.value)) : (R?.disconnect(), R = void 0));
|
|
257
|
-
}, { immediate: !0 }), w(() => {
|
|
258
|
-
R?.disconnect();
|
|
259
|
-
}), (e, r) => (T(), d(c, { to: "body" }, [t.fullscreen ? (T(), d(l, {
|
|
260
|
-
key: 1,
|
|
261
|
-
name: "m3-dialog-fs",
|
|
262
|
-
appear: ""
|
|
263
|
-
}, {
|
|
264
|
-
default: N(() => [t.modelValue ? (T(), p("div", y({ key: 0 }, e.$attrs, {
|
|
265
|
-
class: "dialog-fs m3-dialog-fs-surface fixed inset-0 z-50 flex flex-col",
|
|
266
|
-
role: "dialog",
|
|
267
|
-
"aria-modal": "true",
|
|
268
|
-
"aria-labelledby": !t.bare && (e.$slots.title || t.title) ? V : void 0,
|
|
269
|
-
"aria-label": t.bare ? t.title : void 0
|
|
270
|
-
}), [t.bare ? (T(), p("div", Z, [D(e.$slots, "default", {}, void 0, !0)])) : (T(), p("div", Q, [
|
|
271
|
-
t.persistent ? f("", !0) : (T(), d(n, {
|
|
272
|
-
key: 0,
|
|
273
|
-
icon: "close",
|
|
274
|
-
label: t.closeLabel ?? A(a).close,
|
|
275
|
-
onClick: O
|
|
276
|
-
}, null, 8, ["label"])),
|
|
277
|
-
m("h2", {
|
|
278
|
-
id: V,
|
|
279
|
-
class: "flex-1 text-title-large font-medium text-on-surface"
|
|
280
|
-
}, [D(e.$slots, "title", {}, () => [h(k(t.title), 1)], !0)]),
|
|
281
|
-
e.$slots.actions ? (T(), p("div", $, [D(e.$slots, "actions", {}, void 0, !0)])) : f("", !0)
|
|
282
|
-
])), t.bare ? f("", !0) : (T(), p("div", ee, [D(e.$slots, "default", {}, void 0, !0)]))], 16, X)) : f("", !0)]),
|
|
283
|
-
_: 3
|
|
284
|
-
})) : (T(), d(l, {
|
|
285
|
-
key: 0,
|
|
286
|
-
name: "m3-dialog",
|
|
287
|
-
appear: ""
|
|
288
|
-
}, {
|
|
289
|
-
default: N(() => [t.modelValue ? (T(), p("div", {
|
|
290
|
-
key: 0,
|
|
291
|
-
class: "fixed inset-0 z-50 flex items-center justify-center bg-scrim/32 p-4",
|
|
292
|
-
onClick: F(O, ["self"])
|
|
293
|
-
}, [m("div", y(e.$attrs, {
|
|
294
|
-
class: ["dialog-box m3-dialog-surface flex min-w-[280px] w-full flex-col", v.value],
|
|
295
|
-
style: S.value,
|
|
296
|
-
role: "dialog",
|
|
297
|
-
"aria-modal": "true",
|
|
298
|
-
"aria-labelledby": !t.bare && (e.$slots.title || t.title) ? V : void 0,
|
|
299
|
-
"aria-label": t.bare ? t.title : void 0
|
|
300
|
-
}), [t.bare ? (T(), p("div", W, [D(e.$slots, "default", {}, void 0, !0)])) : (T(), p(s, { key: 1 }, [
|
|
301
|
-
m("div", G, [
|
|
302
|
-
t.closable && !t.persistent ? (T(), p("div", K, [g(n, {
|
|
303
|
-
icon: "close",
|
|
304
|
-
label: t.closeLabel ?? A(a).close,
|
|
305
|
-
onClick: O
|
|
306
|
-
}, null, 8, ["label"])])) : f("", !0),
|
|
307
|
-
e.$slots.icon ? (T(), p("div", q, [D(e.$slots, "icon", {}, void 0, !0)])) : f("", !0),
|
|
308
|
-
m("h2", {
|
|
309
|
-
id: V,
|
|
310
|
-
class: x(["text-headline-small text-on-surface", [e.$slots.icon ? "text-center" : "text-left", t.closable && !t.persistent ? e.$slots.icon ? "px-10" : "pr-10" : ""]])
|
|
311
|
-
}, [D(e.$slots, "title", {}, () => [h(k(t.title), 1)], !0)], 2)
|
|
312
|
-
]),
|
|
313
|
-
m("div", {
|
|
314
|
-
ref_key: "contentEl",
|
|
315
|
-
ref: P,
|
|
316
|
-
class: x(["overflow-y-auto px-6 pt-2 text-body-medium text-on-surface-variant", e.$slots.actions ? "pb-2" : "pb-6"]),
|
|
317
|
-
onScroll: z
|
|
318
|
-
}, [m("div", {
|
|
319
|
-
ref_key: "contentInnerEl",
|
|
320
|
-
ref: I
|
|
321
|
-
}, [D(e.$slots, "default", {}, void 0, !0)], 512)], 34),
|
|
322
|
-
L.value && e.$slots.actions ? (T(), p("div", J)) : f("", !0),
|
|
323
|
-
e.$slots.actions ? (T(), p("div", Y, [D(e.$slots, "actions", {}, void 0, !0)])) : f("", !0)
|
|
324
|
-
], 64))], 16, U)])) : f("", !0)]),
|
|
325
|
-
_: 3
|
|
326
|
-
}))]));
|
|
327
|
-
}
|
|
328
|
-
}), [["__scopeId", "data-v-8f788bae"]]);
|
|
329
|
-
export { H as n, B as r, te as t };
|
|
330
|
-
|
|
331
|
-
//# sourceMappingURL=MDialog-B42Mhn8W.js.map
|