@m3ui-vue/m3ui-vue 1.6.2 → 1.7.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 +649 -28
- package/dist/{MButton-OQ4wIERQ.js → MButton-CN3wYwIG.js} +2 -2
- package/dist/{MButton-OQ4wIERQ.js.map → MButton-CN3wYwIG.js.map} +1 -1
- package/dist/{MColorPickerModal-NtkihoK6.js → MColorPickerModal-BKM1CHxr.js} +4 -4
- package/dist/{MColorPickerModal-NtkihoK6.js.map → MColorPickerModal-BKM1CHxr.js.map} +1 -1
- package/dist/{MDialog-DYMnaBlt.js → MDialog-1LAk9WAO.js} +2 -2
- package/dist/{MDialog-DYMnaBlt.js.map → MDialog-1LAk9WAO.js.map} +1 -1
- package/dist/{MListItem-D2cNUyzP.js → MListItem-BU5KDRCB.js} +376 -270
- package/dist/MListItem-BU5KDRCB.js.map +1 -0
- package/dist/{MLoadingIndicator-DWUj0BAB.js → MLoadingIndicator-RykOo5tf.js} +2 -2
- package/dist/{MLoadingIndicator-DWUj0BAB.js.map → MLoadingIndicator-RykOo5tf.js.map} +1 -1
- package/dist/{MSeekBar-C4cn9RIF.js → MSeekBar-B_Y3MpVz.js} +2 -2
- package/dist/{MSeekBar-C4cn9RIF.js.map → MSeekBar-B_Y3MpVz.js.map} +1 -1
- package/dist/MSegmentedButton-CiOOY1-N.js +105 -0
- package/dist/MSegmentedButton-CiOOY1-N.js.map +1 -0
- package/dist/MSlider-BCeVIxcq.js +739 -0
- package/dist/MSlider-BCeVIxcq.js.map +1 -0
- package/dist/{MSpinner-DZkXZJpc.js → MSpinner-Cs03qoqE.js} +2 -2
- package/dist/{MSpinner-DZkXZJpc.js.map → MSpinner-Cs03qoqE.js.map} +1 -1
- package/dist/{MTextField-CNH-byir.js → MTextField-NaFbMkjv.js} +162 -115
- package/dist/MTextField-NaFbMkjv.js.map +1 -0
- package/dist/_useFieldValidation-Bz34IAQY.js +191 -0
- package/dist/_useFieldValidation-Bz34IAQY.js.map +1 -0
- package/dist/api.json +1 -1
- package/dist/code-editor.js +184 -103
- package/dist/code-editor.js.map +1 -1
- package/dist/components/MAddressField.vue.d.ts +18 -3
- package/dist/components/MAppBarWithSearch.vue.d.ts +1 -1
- package/dist/components/MAudioRecorder.vue.d.ts +2 -2
- package/dist/components/MAutocomplete.vue.d.ts +22 -3
- package/dist/components/MCheckbox.vue.d.ts +23 -1
- package/dist/components/MCodeEditor.vue.d.ts +23 -1
- package/dist/components/MColorPicker.vue.d.ts +24 -3
- package/dist/components/MConfirmDialog.vue.d.ts +2 -2
- package/dist/components/MCountrySelect.vue.d.ts +13 -2
- package/dist/components/MCreditCardInput.vue.d.ts +33 -0
- package/dist/components/MCronField.vue.d.ts +23 -1
- package/dist/components/MDataTable.vue.d.ts +1 -1
- package/dist/components/MDatePicker.vue.d.ts +24 -3
- package/dist/components/MDateRangePicker.vue.d.ts +24 -3
- package/dist/components/MFileUpload.vue.d.ts +23 -2
- package/dist/components/MForm.vue.d.ts +61 -0
- package/dist/components/MJsonEditor.vue.d.ts +23 -1
- package/dist/components/MMapRoute.vue.d.ts +168 -0
- package/dist/components/MMaskField.vue.d.ts +20 -2
- package/dist/components/MMentionField.vue.d.ts +13 -2
- package/dist/components/MMultiAutocomplete.vue.d.ts +22 -3
- package/dist/components/MMultiSelect.vue.d.ts +22 -3
- package/dist/components/MNavigationRail.vue.d.ts +1 -1
- package/dist/components/MNotificationCenter.vue.d.ts +2 -2
- package/dist/components/MNumberField.vue.d.ts +20 -2
- package/dist/components/MPhoneInput.vue.d.ts +19 -4
- package/dist/components/MPinInput.vue.d.ts +24 -3
- package/dist/components/MPosKeypad.vue.d.ts +2 -2
- package/dist/components/MRadioGroup.vue.d.ts +23 -1
- package/dist/components/MRating.vue.d.ts +23 -1
- package/dist/components/MRichTextEditor.vue.d.ts +23 -1
- package/dist/components/MSearchBar.vue.d.ts +1 -1
- package/dist/components/MSegmentedButton.vue.d.ts +23 -2
- package/dist/components/MSelect.vue.d.ts +22 -3
- package/dist/components/MSignaturePad.vue.d.ts +19 -0
- package/dist/components/MSlider.vue.d.ts +23 -1
- package/dist/components/MSwitch.vue.d.ts +23 -1
- package/dist/components/MTable.vue.d.ts +1 -1
- package/dist/components/MTagInput.vue.d.ts +20 -2
- package/dist/components/MText.vue.d.ts +1 -1
- package/dist/components/MTextField.vue.d.ts +26 -3
- package/dist/components/MTimePicker.vue.d.ts +24 -3
- package/dist/components/MTimezoneSelect.vue.d.ts +13 -2
- package/dist/components/MTour.vue.d.ts +2 -2
- package/dist/components/MTrackingTimeline.vue.d.ts +75 -0
- package/dist/components/MWindow.vue.d.ts +2 -2
- package/dist/composables/_routeGeometry.d.ts +26 -0
- package/dist/composables/_useFieldValidation.d.ts +91 -0
- package/dist/composables/mapRouting.d.ts +35 -0
- package/dist/composables/useLocale.d.ts +23 -0
- package/dist/composables/validation.d.ts +82 -0
- package/dist/draw.js +2 -2
- package/dist/flow.js +1 -1
- package/dist/gantt.js +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/locales/index.js +154 -7
- package/dist/locales/index.js.map +1 -1
- package/dist/m3ui-vue.css +1 -1
- package/dist/m3ui.js +6768 -5602
- package/dist/m3ui.js.map +1 -1
- package/dist/map.d.ts +4 -0
- package/dist/map.js +1230 -784
- package/dist/map.js.map +1 -1
- package/dist/media.js +4 -4
- package/dist/pdf.js +4 -4
- package/dist/rich-text-editor.js +189 -146
- package/dist/rich-text-editor.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/{useLocale-DaVSTdm0.js → useLocale-Dh1xZZ8i.js} +22 -1
- package/dist/useLocale-Dh1xZZ8i.js.map +1 -0
- package/package.json +1 -1
- package/src/__tests__/MForm.test.ts +325 -0
- package/src/__tests__/MMapRoute.test.ts +384 -0
- package/src/__tests__/MPhoneInput.test.ts +5 -2
- package/src/__tests__/MRichTextEditor.test.ts +2 -1
- package/src/__tests__/MTrackingTimeline.test.ts +66 -0
- package/src/__tests__/_fakeMaplibre.ts +4 -1
- package/src/__tests__/_osrmRoutes.ts +10 -0
- package/src/__tests__/attrsFallthrough.test.ts +11 -0
- package/src/__tests__/fieldsValidation.test.ts +229 -0
- package/src/__tests__/ssr.test.ts +1 -0
- package/src/__tests__/validation.test.ts +77 -0
- package/src/components/MAddressField.vue +45 -8
- package/src/components/MAutocomplete.vue +69 -23
- package/src/components/MCheckbox.vue +80 -17
- package/src/components/MCodeEditor.vue +59 -2
- package/src/components/MColorPicker.vue +65 -16
- package/src/components/MCountrySelect.vue +17 -3
- package/src/components/MCreditCardInput.vue +76 -7
- package/src/components/MCronField.vue +60 -10
- package/src/components/MDatePicker.vue +65 -16
- package/src/components/MDateRangePicker.vue +66 -16
- package/src/components/MFileUpload.vue +71 -8
- package/src/components/MForm.vue +208 -0
- package/src/components/MJsonEditor.vue +57 -3
- package/src/components/MMapRoute.vue +470 -0
- package/src/components/MMaskField.vue +55 -13
- package/src/components/MMentionField.vue +17 -2
- package/src/components/MMultiAutocomplete.vue +70 -23
- package/src/components/MMultiSelect.vue +70 -23
- package/src/components/MNumberField.vue +58 -16
- package/src/components/MPhoneInput.vue +60 -18
- package/src/components/MPinInput.vue +58 -10
- package/src/components/MRadioGroup.vue +65 -4
- package/src/components/MRating.vue +62 -6
- package/src/components/MRichTextEditor.vue +64 -4
- package/src/components/MSegmentedButton.vue +59 -2
- package/src/components/MSelect.vue +72 -26
- package/src/components/MSignaturePad.vue +71 -6
- package/src/components/MSlider.vue +61 -10
- package/src/components/MSwitch.vue +63 -8
- package/src/components/MTagInput.vue +67 -25
- package/src/components/MTextField.vue +68 -14
- package/src/components/MTimePicker.vue +65 -16
- package/src/components/MTimezoneSelect.vue +17 -3
- package/src/components/MTrackingTimeline.vue +257 -0
- package/src/composables/_routeGeometry.ts +140 -0
- package/src/composables/_useFieldValidation.ts +287 -0
- package/src/composables/mapRouting.ts +55 -0
- package/src/composables/useLocale.ts +46 -0
- package/src/composables/validation.ts +178 -0
- package/src/index.ts +5 -0
- package/src/locales/de.ts +21 -0
- package/src/locales/es.ts +28 -7
- package/src/locales/fr.ts +21 -0
- package/src/locales/ja.ts +21 -0
- package/src/locales/ko.ts +21 -0
- package/src/locales/pt.ts +21 -0
- package/src/locales/zh.ts +21 -0
- package/src/map.ts +4 -0
- package/dist/MListItem-D2cNUyzP.js.map +0 -1
- package/dist/MSegmentedButton-BEB4gXLA.js +0 -64
- package/dist/MSegmentedButton-BEB4gXLA.js.map +0 -1
- package/dist/MSlider-BIkA6DiE.js +0 -690
- package/dist/MSlider-BIkA6DiE.js.map +0 -1
- package/dist/MTextField-CNH-byir.js.map +0 -1
- package/dist/useLocale-DaVSTdm0.js.map +0 -1
package/dist/media.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
2
|
-
import { t } from "./MSeekBar-
|
|
1
|
+
import { i as e } from "./useLocale-Dh1xZZ8i.js";
|
|
2
|
+
import { t } from "./MSeekBar-B_Y3MpVz.js";
|
|
3
3
|
import { t as n } from "./MIconButton-BBggVwBV.js";
|
|
4
4
|
import { t as r } from "./MIcon-DpajuUTJ.js";
|
|
5
|
-
import { t as i } from "./MSlider-
|
|
5
|
+
import { t as i } from "./MSlider-BCeVIxcq.js";
|
|
6
6
|
import { n as a, t as o } from "./MMenuItem-BuxYoASE.js";
|
|
7
|
-
import { t as s } from "./MLoadingIndicator-
|
|
7
|
+
import { t as s } from "./MLoadingIndicator-RykOo5tf.js";
|
|
8
8
|
import { Fragment 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 _, getCurrentScope as v, guardReactiveProps as y, mergeProps as b, nextTick as ee, normalizeClass as x, normalizeProps as S, normalizeStyle as te, onBeforeUnmount as ne, onMounted as re, onScopeDispose as C, openBlock as w, ref as T, renderList as E, renderSlot as D, shallowRef as O, toDisplayString as k, toValue as A, unref as j, useSlots as ie, watch as M, withCtx as N, withModifiers as P } from "vue";
|
|
9
9
|
// src/composables/useMediaPlayer.ts
|
|
10
10
|
var F = typeof window < "u", I = null;
|
package/dist/pdf.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { i as e } from "./useLocale-
|
|
1
|
+
import { i as e } from "./useLocale-Dh1xZZ8i.js";
|
|
2
2
|
import { t } from "./MIcon-DpajuUTJ.js";
|
|
3
3
|
import { t as n } from "./MIconButton-BBggVwBV.js";
|
|
4
4
|
import { n as r, t as i } from "./MMenuItem-BuxYoASE.js";
|
|
5
5
|
import { t as a } from "./MProgressBar-BWly1UKN.js";
|
|
6
|
-
import { t as o } from "./MTextField-
|
|
7
|
-
import { t as s } from "./MButton-
|
|
8
|
-
import { t as c } from "./MLoadingIndicator-
|
|
6
|
+
import { t as o } from "./MTextField-NaFbMkjv.js";
|
|
7
|
+
import { t as s } from "./MButton-CN3wYwIG.js";
|
|
8
|
+
import { t as c } from "./MLoadingIndicator-RykOo5tf.js";
|
|
9
9
|
import { Fragment as l, Transition as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, createTextVNode as g, createVNode as _, defineComponent as v, getCurrentScope as ee, mergeProps as te, nextTick as y, normalizeClass as b, normalizeStyle as x, onBeforeUnmount as ne, onMounted as re, onScopeDispose as S, openBlock as C, reactive as ie, ref as w, renderList as T, renderSlot as ae, resolveDynamicComponent as oe, shallowRef as E, toDisplayString as D, toValue as O, unref as k, vModelText as se, watch as A, withCtx as j, withDirectives as ce, withKeys as le, withModifiers as ue } from "vue";
|
|
10
10
|
// src/composables/usePdf.ts
|
|
11
11
|
var M;
|
package/dist/rich-text-editor.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { t as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { n as e, r as t } from "./_useFieldValidation-Bz34IAQY.js";
|
|
2
|
+
import { t as n } from "./MIcon-DpajuUTJ.js";
|
|
3
|
+
import { n as r, t as i } from "./MMenuItem-BuxYoASE.js";
|
|
4
|
+
import { t as a } from "./MDialog-1LAk9WAO.js";
|
|
5
|
+
import { t as o } from "./MTextField-NaFbMkjv.js";
|
|
6
|
+
import { t as s } from "./MButton-CN3wYwIG.js";
|
|
7
|
+
import { i as c } from "./useLocale-Dh1xZZ8i.js";
|
|
8
|
+
import { t as l } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
|
|
9
|
+
import { Fragment as u, computed as d, createCommentVNode as f, createElementBlock as p, createElementVNode as m, createTextVNode as h, createVNode as g, defineComponent as _, mergeProps as ee, normalizeClass as v, normalizeStyle as te, onBeforeUnmount as ne, onMounted as re, openBlock as y, ref as b, renderList as x, shallowRef as ie, toDisplayString as S, unref as C, watch as w, withCtx as T, withKeys as E } from "vue";
|
|
9
10
|
// src/components/MRichTextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
-
var
|
|
11
|
+
var ae = ["aria-invalid", "aria-describedby"], oe = {
|
|
11
12
|
key: 0,
|
|
12
13
|
class: "flex shrink-0 flex-wrap items-center gap-0.5 border-b border-outline-variant bg-surface-container px-2 py-1.5"
|
|
13
|
-
},
|
|
14
|
+
}, se = {
|
|
14
15
|
type: "button",
|
|
15
16
|
class: "flex h-8 cursor-pointer items-center gap-1 rounded px-2 text-label-large text-on-surface-variant hover:bg-on-surface/8"
|
|
16
|
-
},
|
|
17
|
+
}, ce = ["title", "onClick"], D = {
|
|
17
18
|
key: 0,
|
|
18
19
|
class: "mx-1 h-6 w-px bg-outline-variant"
|
|
19
|
-
},
|
|
20
|
+
}, O = ["title"], k = ["title"], A = ["id"], j = /*#__PURE__*/ l(/* @__PURE__ */ _({
|
|
21
|
+
inheritAttrs: !1,
|
|
20
22
|
__name: "MRichTextEditor",
|
|
21
23
|
props: {
|
|
22
24
|
modelValue: {},
|
|
@@ -25,6 +27,13 @@ var O = {
|
|
|
25
27
|
type: Boolean,
|
|
26
28
|
default: !1
|
|
27
29
|
},
|
|
30
|
+
error: { type: [Boolean, String] },
|
|
31
|
+
errorLabel: {},
|
|
32
|
+
required: { type: Boolean },
|
|
33
|
+
rules: {},
|
|
34
|
+
validateOn: {},
|
|
35
|
+
validateDebounce: {},
|
|
36
|
+
name: {},
|
|
28
37
|
minHeight: { default: "200px" },
|
|
29
38
|
fill: {
|
|
30
39
|
type: Boolean,
|
|
@@ -32,37 +41,55 @@ var O = {
|
|
|
32
41
|
},
|
|
33
42
|
labels: {}
|
|
34
43
|
},
|
|
35
|
-
emits: ["update:modelValue"],
|
|
36
|
-
setup(
|
|
37
|
-
let
|
|
38
|
-
bold:
|
|
39
|
-
italic:
|
|
40
|
-
underline:
|
|
41
|
-
strikethrough:
|
|
42
|
-
highlight:
|
|
43
|
-
bulletList:
|
|
44
|
-
orderedList:
|
|
45
|
-
blockquote:
|
|
46
|
-
code:
|
|
47
|
-
alignLeft:
|
|
48
|
-
alignCenter:
|
|
49
|
-
alignRight:
|
|
50
|
-
undo:
|
|
51
|
-
redo:
|
|
52
|
-
link:
|
|
53
|
-
image:
|
|
54
|
-
paragraph:
|
|
55
|
-
heading1:
|
|
56
|
-
heading2:
|
|
57
|
-
heading3:
|
|
58
|
-
insertLink:
|
|
59
|
-
insertImage:
|
|
60
|
-
imageUrlLabel:
|
|
61
|
-
cancel:
|
|
62
|
-
insert:
|
|
63
|
-
...
|
|
64
|
-
})),
|
|
65
|
-
|
|
44
|
+
emits: ["update:modelValue", "blur"],
|
|
45
|
+
setup(l, { expose: _, emit: j }) {
|
|
46
|
+
let M = c(), N = l, P = d(() => ({
|
|
47
|
+
bold: M.bold,
|
|
48
|
+
italic: M.italic,
|
|
49
|
+
underline: M.underline,
|
|
50
|
+
strikethrough: M.strikethrough,
|
|
51
|
+
highlight: M.highlight,
|
|
52
|
+
bulletList: M.bulletList,
|
|
53
|
+
orderedList: M.orderedList,
|
|
54
|
+
blockquote: M.blockquote,
|
|
55
|
+
code: M.code,
|
|
56
|
+
alignLeft: M.alignLeft,
|
|
57
|
+
alignCenter: M.alignCenter,
|
|
58
|
+
alignRight: M.alignRight,
|
|
59
|
+
undo: M.undo,
|
|
60
|
+
redo: M.redo,
|
|
61
|
+
link: M.link,
|
|
62
|
+
image: M.image,
|
|
63
|
+
paragraph: M.paragraph,
|
|
64
|
+
heading1: M.heading1,
|
|
65
|
+
heading2: M.heading2,
|
|
66
|
+
heading3: M.heading3,
|
|
67
|
+
insertLink: M.insertLink,
|
|
68
|
+
insertImage: M.insertImage,
|
|
69
|
+
imageUrlLabel: M.imageUrlLabel,
|
|
70
|
+
cancel: M.cancel,
|
|
71
|
+
insert: M.insert,
|
|
72
|
+
...N.labels
|
|
73
|
+
})), F = j, le = (e) => !/<(img|hr|iframe|video)\b/i.test(String(e ?? "")) && !String(e ?? "").replace(/<[^>]*>/g, "").replace(/ /g, " ").trim(), I = b(null), L = b(!1), R = ie(null), z = b(null), B = e({
|
|
74
|
+
value: () => N.modelValue,
|
|
75
|
+
rules: () => N.rules,
|
|
76
|
+
required: () => N.required,
|
|
77
|
+
error: () => N.error,
|
|
78
|
+
errorLabel: () => N.errorLabel,
|
|
79
|
+
name: () => N.name,
|
|
80
|
+
validateOn: () => N.validateOn,
|
|
81
|
+
validateDebounce: () => N.validateDebounce,
|
|
82
|
+
disabled: () => N.disabled,
|
|
83
|
+
focus: () => {
|
|
84
|
+
R.value?.commands.focus();
|
|
85
|
+
},
|
|
86
|
+
el: () => I.value,
|
|
87
|
+
setValue: (e) => F("update:modelValue", e),
|
|
88
|
+
isEmpty: le
|
|
89
|
+
}), V = B.disabled, { hasError: H, message: U, messageId: W } = B, G = t(() => I.value, () => {
|
|
90
|
+
B.onBlur(), F("blur");
|
|
91
|
+
}), K = b([]);
|
|
92
|
+
re(async () => {
|
|
66
93
|
let [{ Editor: e }, { default: t }, { default: n }, { default: r }, { default: i }, { default: a }, { default: o }, { default: s }, { TextStyle: c }, { default: l }] = await Promise.all([
|
|
67
94
|
import("@tiptap/vue-3"),
|
|
68
95
|
import("@tiptap/starter-kit"),
|
|
@@ -75,9 +102,9 @@ var O = {
|
|
|
75
102
|
import("@tiptap/extension-text-style"),
|
|
76
103
|
import("@tiptap/extension-color")
|
|
77
104
|
]), u = new e({
|
|
78
|
-
element:
|
|
79
|
-
content:
|
|
80
|
-
editable: !
|
|
105
|
+
element: z.value,
|
|
106
|
+
content: N.modelValue,
|
|
107
|
+
editable: !V.value,
|
|
81
108
|
extensions: [
|
|
82
109
|
t,
|
|
83
110
|
n,
|
|
@@ -85,41 +112,41 @@ var O = {
|
|
|
85
112
|
i.configure({ openOnClick: !1 }),
|
|
86
113
|
a,
|
|
87
114
|
o.configure({ multicolor: !0 }),
|
|
88
|
-
s.configure({ placeholder:
|
|
115
|
+
s.configure({ placeholder: N.placeholder ?? "Start writing..." }),
|
|
89
116
|
c,
|
|
90
117
|
l
|
|
91
118
|
],
|
|
92
|
-
onUpdate: ({ editor: e }) =>
|
|
119
|
+
onUpdate: ({ editor: e }) => F("update:modelValue", e.getHTML())
|
|
93
120
|
});
|
|
94
|
-
|
|
121
|
+
R.value = u, K.value = [
|
|
95
122
|
[
|
|
96
123
|
{
|
|
97
124
|
icon: "format_bold",
|
|
98
|
-
label:
|
|
125
|
+
label: P.value.bold,
|
|
99
126
|
action: () => u.chain().focus().toggleBold().run(),
|
|
100
127
|
active: () => !!u.isActive("bold")
|
|
101
128
|
},
|
|
102
129
|
{
|
|
103
130
|
icon: "format_italic",
|
|
104
|
-
label:
|
|
131
|
+
label: P.value.italic,
|
|
105
132
|
action: () => u.chain().focus().toggleItalic().run(),
|
|
106
133
|
active: () => !!u.isActive("italic")
|
|
107
134
|
},
|
|
108
135
|
{
|
|
109
136
|
icon: "format_underlined",
|
|
110
|
-
label:
|
|
137
|
+
label: P.value.underline,
|
|
111
138
|
action: () => u.chain().focus().toggleUnderline().run(),
|
|
112
139
|
active: () => !!u.isActive("underline")
|
|
113
140
|
},
|
|
114
141
|
{
|
|
115
142
|
icon: "format_strikethrough",
|
|
116
|
-
label:
|
|
143
|
+
label: P.value.strikethrough,
|
|
117
144
|
action: () => u.chain().focus().toggleStrike().run(),
|
|
118
145
|
active: () => !!u.isActive("strike")
|
|
119
146
|
},
|
|
120
147
|
{
|
|
121
148
|
icon: "ink_highlighter",
|
|
122
|
-
label:
|
|
149
|
+
label: P.value.highlight,
|
|
123
150
|
action: () => u.chain().focus().toggleHighlight().run(),
|
|
124
151
|
active: () => !!u.isActive("highlight")
|
|
125
152
|
}
|
|
@@ -127,25 +154,25 @@ var O = {
|
|
|
127
154
|
[
|
|
128
155
|
{
|
|
129
156
|
icon: "format_list_bulleted",
|
|
130
|
-
label:
|
|
157
|
+
label: P.value.bulletList,
|
|
131
158
|
action: () => u.chain().focus().toggleBulletList().run(),
|
|
132
159
|
active: () => !!u.isActive("bulletList")
|
|
133
160
|
},
|
|
134
161
|
{
|
|
135
162
|
icon: "format_list_numbered",
|
|
136
|
-
label:
|
|
163
|
+
label: P.value.orderedList,
|
|
137
164
|
action: () => u.chain().focus().toggleOrderedList().run(),
|
|
138
165
|
active: () => !!u.isActive("orderedList")
|
|
139
166
|
},
|
|
140
167
|
{
|
|
141
168
|
icon: "format_quote",
|
|
142
|
-
label:
|
|
169
|
+
label: P.value.blockquote,
|
|
143
170
|
action: () => u.chain().focus().toggleBlockquote().run(),
|
|
144
171
|
active: () => !!u.isActive("blockquote")
|
|
145
172
|
},
|
|
146
173
|
{
|
|
147
174
|
icon: "code",
|
|
148
|
-
label:
|
|
175
|
+
label: P.value.code,
|
|
149
176
|
action: () => u.chain().focus().toggleCode().run(),
|
|
150
177
|
active: () => !!u.isActive("code")
|
|
151
178
|
}
|
|
@@ -153,170 +180,186 @@ var O = {
|
|
|
153
180
|
[
|
|
154
181
|
{
|
|
155
182
|
icon: "format_align_left",
|
|
156
|
-
label:
|
|
183
|
+
label: P.value.alignLeft,
|
|
157
184
|
action: () => u.chain().focus().setTextAlign("left").run(),
|
|
158
185
|
active: () => !!u.isActive({ textAlign: "left" })
|
|
159
186
|
},
|
|
160
187
|
{
|
|
161
188
|
icon: "format_align_center",
|
|
162
|
-
label:
|
|
189
|
+
label: P.value.alignCenter,
|
|
163
190
|
action: () => u.chain().focus().setTextAlign("center").run(),
|
|
164
191
|
active: () => !!u.isActive({ textAlign: "center" })
|
|
165
192
|
},
|
|
166
193
|
{
|
|
167
194
|
icon: "format_align_right",
|
|
168
|
-
label:
|
|
195
|
+
label: P.value.alignRight,
|
|
169
196
|
action: () => u.chain().focus().setTextAlign("right").run(),
|
|
170
197
|
active: () => !!u.isActive({ textAlign: "right" })
|
|
171
198
|
}
|
|
172
199
|
],
|
|
173
200
|
[{
|
|
174
201
|
icon: "undo",
|
|
175
|
-
label:
|
|
202
|
+
label: P.value.undo,
|
|
176
203
|
action: () => u.chain().focus().undo().run()
|
|
177
204
|
}, {
|
|
178
205
|
icon: "redo",
|
|
179
|
-
label:
|
|
206
|
+
label: P.value.redo,
|
|
180
207
|
action: () => u.chain().focus().redo().run()
|
|
181
208
|
}]
|
|
182
|
-
],
|
|
209
|
+
], ne(() => u.destroy()), w(() => N.modelValue, (e) => {
|
|
183
210
|
u.getHTML() !== e && u.commands.setContent(e);
|
|
184
|
-
}),
|
|
211
|
+
}), w(() => V.value, (e) => u.setEditable(!e)), L.value = !0;
|
|
185
212
|
});
|
|
186
|
-
let
|
|
187
|
-
let e =
|
|
188
|
-
return e ? e.isActive("heading", { level: 1 }) ?
|
|
213
|
+
let q = b(!1), J = b(""), Y = b(!1), X = b(""), ue = d(() => {
|
|
214
|
+
let e = R.value;
|
|
215
|
+
return e ? e.isActive("heading", { level: 1 }) ? P.value.heading1 : e.isActive("heading", { level: 2 }) ? P.value.heading2 : e.isActive("heading", { level: 3 }) ? P.value.heading3 : P.value.paragraph : P.value.paragraph;
|
|
189
216
|
});
|
|
190
|
-
function
|
|
191
|
-
e === 0 ?
|
|
217
|
+
function Z(e) {
|
|
218
|
+
e === 0 ? R.value?.chain().focus().setParagraph().run() : R.value?.chain().focus().toggleHeading({ level: e }).run();
|
|
192
219
|
}
|
|
193
|
-
function
|
|
194
|
-
|
|
220
|
+
function de() {
|
|
221
|
+
J.value = "", q.value = !0;
|
|
195
222
|
}
|
|
196
|
-
function
|
|
197
|
-
|
|
223
|
+
function Q() {
|
|
224
|
+
J.value && R.value?.chain().focus().setLink({ href: J.value }).run(), q.value = !1;
|
|
198
225
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
226
|
+
function fe() {
|
|
227
|
+
X.value = "", Y.value = !0;
|
|
201
228
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
229
|
+
function $() {
|
|
230
|
+
X.value && R.value?.chain().focus().setImage({ src: X.value }).run(), Y.value = !1;
|
|
204
231
|
}
|
|
205
|
-
return (
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
232
|
+
return _({
|
|
233
|
+
validate: B.validate,
|
|
234
|
+
resetValidation: B.resetValidation
|
|
235
|
+
}), (e, t) => (y(), p(u, null, [m("div", ee({
|
|
236
|
+
ref_key: "rootEl",
|
|
237
|
+
ref: I
|
|
238
|
+
}, e.$attrs, {
|
|
239
|
+
class: ["overflow-hidden rounded-lg border transition-colors duration-150", [C(V) ? "border-outline-variant/50 opacity-60" : C(H) ? "border-error" : "border-outline-variant focus-within:border-primary", { "flex flex-col": l.fill }]],
|
|
240
|
+
"aria-invalid": C(H) || void 0,
|
|
241
|
+
"aria-describedby": C(U) ? C(W) : void 0,
|
|
242
|
+
onFocusout: t[10] ||= (...e) => C(G) && C(G)(...e)
|
|
243
|
+
}), [
|
|
244
|
+
L.value ? (y(), p("div", oe, [
|
|
245
|
+
g(r, { align: "left" }, {
|
|
246
|
+
trigger: T(() => [m("button", se, [h(S(ue.value) + " ", 1), g(n, {
|
|
209
247
|
name: "arrow_drop_down",
|
|
210
248
|
size: 20
|
|
211
249
|
})])]),
|
|
212
|
-
default:
|
|
213
|
-
|
|
214
|
-
default:
|
|
250
|
+
default: T(() => [
|
|
251
|
+
g(i, { onClick: t[0] ||= (e) => Z(0) }, {
|
|
252
|
+
default: T(() => [h(S(P.value.paragraph), 1)]),
|
|
215
253
|
_: 1
|
|
216
254
|
}),
|
|
217
|
-
|
|
218
|
-
default:
|
|
255
|
+
g(i, { onClick: t[1] ||= (e) => Z(1) }, {
|
|
256
|
+
default: T(() => [h(S(P.value.heading1), 1)]),
|
|
219
257
|
_: 1
|
|
220
258
|
}),
|
|
221
|
-
|
|
222
|
-
default:
|
|
259
|
+
g(i, { onClick: t[2] ||= (e) => Z(2) }, {
|
|
260
|
+
default: T(() => [h(S(P.value.heading2), 1)]),
|
|
223
261
|
_: 1
|
|
224
262
|
}),
|
|
225
|
-
|
|
226
|
-
default:
|
|
263
|
+
g(i, { onClick: t[3] ||= (e) => Z(3) }, {
|
|
264
|
+
default: T(() => [h(S(P.value.heading3), 1)]),
|
|
227
265
|
_: 1
|
|
228
266
|
})
|
|
229
267
|
]),
|
|
230
268
|
_: 1
|
|
231
269
|
}),
|
|
232
|
-
|
|
233
|
-
(
|
|
234
|
-
key:
|
|
270
|
+
t[11] ||= m("div", { class: "mx-1 h-6 w-px bg-outline-variant" }, null, -1),
|
|
271
|
+
(y(!0), p(u, null, x(K.value, (e, t) => (y(), p(u, { key: t }, [(y(!0), p(u, null, x(e, (e) => (y(), p("button", {
|
|
272
|
+
key: e.icon,
|
|
235
273
|
type: "button",
|
|
236
|
-
title:
|
|
237
|
-
class:
|
|
238
|
-
onClick:
|
|
239
|
-
}, [
|
|
240
|
-
name:
|
|
274
|
+
title: e.label,
|
|
275
|
+
class: v(["flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100", e.active?.() ? "bg-secondary-container text-on-secondary-container" : "text-on-surface-variant hover:bg-on-surface/8"]),
|
|
276
|
+
onClick: e.action
|
|
277
|
+
}, [g(n, {
|
|
278
|
+
name: e.icon,
|
|
241
279
|
size: 20
|
|
242
|
-
}, null, 8, ["name"])], 10,
|
|
243
|
-
|
|
244
|
-
|
|
280
|
+
}, null, 8, ["name"])], 10, ce))), 128)), t < K.value.length - 1 ? (y(), p("div", D)) : f("", !0)], 64))), 128)),
|
|
281
|
+
t[12] ||= m("div", { class: "mx-1 h-6 w-px bg-outline-variant" }, null, -1),
|
|
282
|
+
m("button", {
|
|
245
283
|
type: "button",
|
|
246
|
-
title:
|
|
284
|
+
title: P.value.link,
|
|
247
285
|
class: "flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8",
|
|
248
|
-
onClick:
|
|
249
|
-
}, [
|
|
286
|
+
onClick: de
|
|
287
|
+
}, [g(n, {
|
|
250
288
|
name: "link",
|
|
251
289
|
size: 20
|
|
252
|
-
})], 8,
|
|
253
|
-
|
|
290
|
+
})], 8, O),
|
|
291
|
+
m("button", {
|
|
254
292
|
type: "button",
|
|
255
|
-
title:
|
|
293
|
+
title: P.value.image,
|
|
256
294
|
class: "flex h-8 w-8 cursor-pointer items-center justify-center rounded text-on-surface-variant transition-colors hover:bg-on-surface/8",
|
|
257
|
-
onClick:
|
|
258
|
-
}, [
|
|
295
|
+
onClick: fe
|
|
296
|
+
}, [g(n, {
|
|
259
297
|
name: "image",
|
|
260
298
|
size: 20
|
|
261
|
-
})], 8,
|
|
262
|
-
])) :
|
|
263
|
-
|
|
299
|
+
})], 8, k)
|
|
300
|
+
])) : f("", !0),
|
|
301
|
+
m("div", {
|
|
264
302
|
ref_key: "editorContainer",
|
|
265
|
-
ref:
|
|
266
|
-
class:
|
|
267
|
-
style:
|
|
303
|
+
ref: z,
|
|
304
|
+
class: v(["rte-content bg-surface px-4 py-3 text-body-large text-on-surface", { "rte-fill flex min-h-0 flex-1 flex-col overflow-y-auto": l.fill }]),
|
|
305
|
+
style: te(l.fill ? void 0 : { minHeight: l.minHeight })
|
|
268
306
|
}, null, 6),
|
|
269
|
-
|
|
270
|
-
modelValue:
|
|
271
|
-
"onUpdate:modelValue":
|
|
272
|
-
title:
|
|
307
|
+
g(a, {
|
|
308
|
+
modelValue: q.value,
|
|
309
|
+
"onUpdate:modelValue": t[6] ||= (e) => q.value = e,
|
|
310
|
+
title: P.value.insertLink
|
|
273
311
|
}, {
|
|
274
|
-
actions:
|
|
312
|
+
actions: T(() => [g(s, {
|
|
275
313
|
variant: "text",
|
|
276
|
-
onClick:
|
|
314
|
+
onClick: t[5] ||= (e) => q.value = !1
|
|
277
315
|
}, {
|
|
278
|
-
default:
|
|
316
|
+
default: T(() => [h(S(P.value.cancel), 1)]),
|
|
279
317
|
_: 1
|
|
280
|
-
}),
|
|
281
|
-
default:
|
|
318
|
+
}), g(s, { onClick: Q }, {
|
|
319
|
+
default: T(() => [h(S(P.value.insert), 1)]),
|
|
282
320
|
_: 1
|
|
283
321
|
})]),
|
|
284
|
-
default:
|
|
285
|
-
modelValue:
|
|
286
|
-
"onUpdate:modelValue":
|
|
322
|
+
default: T(() => [g(o, {
|
|
323
|
+
modelValue: J.value,
|
|
324
|
+
"onUpdate:modelValue": t[4] ||= (e) => J.value = e,
|
|
287
325
|
label: "URL",
|
|
288
326
|
placeholder: " ",
|
|
289
|
-
onKeydown:
|
|
327
|
+
onKeydown: E(Q, ["enter"])
|
|
290
328
|
}, null, 8, ["modelValue"])]),
|
|
291
329
|
_: 1
|
|
292
330
|
}, 8, ["modelValue", "title"]),
|
|
293
|
-
|
|
294
|
-
modelValue:
|
|
295
|
-
"onUpdate:modelValue":
|
|
296
|
-
title:
|
|
331
|
+
g(a, {
|
|
332
|
+
modelValue: Y.value,
|
|
333
|
+
"onUpdate:modelValue": t[9] ||= (e) => Y.value = e,
|
|
334
|
+
title: P.value.insertImage
|
|
297
335
|
}, {
|
|
298
|
-
actions:
|
|
336
|
+
actions: T(() => [g(s, {
|
|
299
337
|
variant: "text",
|
|
300
|
-
onClick:
|
|
338
|
+
onClick: t[8] ||= (e) => Y.value = !1
|
|
301
339
|
}, {
|
|
302
|
-
default:
|
|
340
|
+
default: T(() => [h(S(P.value.cancel), 1)]),
|
|
303
341
|
_: 1
|
|
304
|
-
}),
|
|
305
|
-
default:
|
|
342
|
+
}), g(s, { onClick: $ }, {
|
|
343
|
+
default: T(() => [h(S(P.value.insert), 1)]),
|
|
306
344
|
_: 1
|
|
307
345
|
})]),
|
|
308
|
-
default:
|
|
309
|
-
modelValue:
|
|
310
|
-
"onUpdate:modelValue":
|
|
311
|
-
label:
|
|
346
|
+
default: T(() => [g(o, {
|
|
347
|
+
modelValue: X.value,
|
|
348
|
+
"onUpdate:modelValue": t[7] ||= (e) => X.value = e,
|
|
349
|
+
label: P.value.imageUrlLabel,
|
|
312
350
|
placeholder: " ",
|
|
313
|
-
onKeydown:
|
|
351
|
+
onKeydown: E($, ["enter"])
|
|
314
352
|
}, null, 8, ["modelValue", "label"])]),
|
|
315
353
|
_: 1
|
|
316
354
|
}, 8, ["modelValue", "title"])
|
|
317
|
-
],
|
|
355
|
+
], 16, ae), C(U) ? (y(), p("p", {
|
|
356
|
+
key: 0,
|
|
357
|
+
id: C(W),
|
|
358
|
+
role: "alert",
|
|
359
|
+
class: "mt-1 px-4 text-body-small text-error"
|
|
360
|
+
}, S(C(U)), 9, A)) : f("", !0)], 64));
|
|
318
361
|
}
|
|
319
|
-
}), [["__scopeId", "data-v-
|
|
320
|
-
export {
|
|
362
|
+
}), [["__scopeId", "data-v-de9f7da9"]]);
|
|
363
|
+
export { j as MRichTextEditor };
|
|
321
364
|
|
|
322
365
|
//# sourceMappingURL=rich-text-editor.js.map
|