@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.
Files changed (163) hide show
  1. package/dist/API.md +649 -28
  2. package/dist/{MButton-OQ4wIERQ.js → MButton-CN3wYwIG.js} +2 -2
  3. package/dist/{MButton-OQ4wIERQ.js.map → MButton-CN3wYwIG.js.map} +1 -1
  4. package/dist/{MColorPickerModal-NtkihoK6.js → MColorPickerModal-BKM1CHxr.js} +4 -4
  5. package/dist/{MColorPickerModal-NtkihoK6.js.map → MColorPickerModal-BKM1CHxr.js.map} +1 -1
  6. package/dist/{MDialog-DYMnaBlt.js → MDialog-1LAk9WAO.js} +2 -2
  7. package/dist/{MDialog-DYMnaBlt.js.map → MDialog-1LAk9WAO.js.map} +1 -1
  8. package/dist/{MListItem-D2cNUyzP.js → MListItem-BU5KDRCB.js} +376 -270
  9. package/dist/MListItem-BU5KDRCB.js.map +1 -0
  10. package/dist/{MLoadingIndicator-DWUj0BAB.js → MLoadingIndicator-RykOo5tf.js} +2 -2
  11. package/dist/{MLoadingIndicator-DWUj0BAB.js.map → MLoadingIndicator-RykOo5tf.js.map} +1 -1
  12. package/dist/{MSeekBar-C4cn9RIF.js → MSeekBar-B_Y3MpVz.js} +2 -2
  13. package/dist/{MSeekBar-C4cn9RIF.js.map → MSeekBar-B_Y3MpVz.js.map} +1 -1
  14. package/dist/MSegmentedButton-CiOOY1-N.js +105 -0
  15. package/dist/MSegmentedButton-CiOOY1-N.js.map +1 -0
  16. package/dist/MSlider-BCeVIxcq.js +739 -0
  17. package/dist/MSlider-BCeVIxcq.js.map +1 -0
  18. package/dist/{MSpinner-DZkXZJpc.js → MSpinner-Cs03qoqE.js} +2 -2
  19. package/dist/{MSpinner-DZkXZJpc.js.map → MSpinner-Cs03qoqE.js.map} +1 -1
  20. package/dist/{MTextField-CNH-byir.js → MTextField-NaFbMkjv.js} +162 -115
  21. package/dist/MTextField-NaFbMkjv.js.map +1 -0
  22. package/dist/_useFieldValidation-Bz34IAQY.js +191 -0
  23. package/dist/_useFieldValidation-Bz34IAQY.js.map +1 -0
  24. package/dist/api.json +1 -1
  25. package/dist/code-editor.js +184 -103
  26. package/dist/code-editor.js.map +1 -1
  27. package/dist/components/MAddressField.vue.d.ts +18 -3
  28. package/dist/components/MAppBarWithSearch.vue.d.ts +1 -1
  29. package/dist/components/MAudioRecorder.vue.d.ts +2 -2
  30. package/dist/components/MAutocomplete.vue.d.ts +22 -3
  31. package/dist/components/MCheckbox.vue.d.ts +23 -1
  32. package/dist/components/MCodeEditor.vue.d.ts +23 -1
  33. package/dist/components/MColorPicker.vue.d.ts +24 -3
  34. package/dist/components/MConfirmDialog.vue.d.ts +2 -2
  35. package/dist/components/MCountrySelect.vue.d.ts +13 -2
  36. package/dist/components/MCreditCardInput.vue.d.ts +33 -0
  37. package/dist/components/MCronField.vue.d.ts +23 -1
  38. package/dist/components/MDataTable.vue.d.ts +1 -1
  39. package/dist/components/MDatePicker.vue.d.ts +24 -3
  40. package/dist/components/MDateRangePicker.vue.d.ts +24 -3
  41. package/dist/components/MFileUpload.vue.d.ts +23 -2
  42. package/dist/components/MForm.vue.d.ts +61 -0
  43. package/dist/components/MJsonEditor.vue.d.ts +23 -1
  44. package/dist/components/MMapRoute.vue.d.ts +168 -0
  45. package/dist/components/MMaskField.vue.d.ts +20 -2
  46. package/dist/components/MMentionField.vue.d.ts +13 -2
  47. package/dist/components/MMultiAutocomplete.vue.d.ts +22 -3
  48. package/dist/components/MMultiSelect.vue.d.ts +22 -3
  49. package/dist/components/MNavigationRail.vue.d.ts +1 -1
  50. package/dist/components/MNotificationCenter.vue.d.ts +2 -2
  51. package/dist/components/MNumberField.vue.d.ts +20 -2
  52. package/dist/components/MPhoneInput.vue.d.ts +19 -4
  53. package/dist/components/MPinInput.vue.d.ts +24 -3
  54. package/dist/components/MPosKeypad.vue.d.ts +2 -2
  55. package/dist/components/MRadioGroup.vue.d.ts +23 -1
  56. package/dist/components/MRating.vue.d.ts +23 -1
  57. package/dist/components/MRichTextEditor.vue.d.ts +23 -1
  58. package/dist/components/MSearchBar.vue.d.ts +1 -1
  59. package/dist/components/MSegmentedButton.vue.d.ts +23 -2
  60. package/dist/components/MSelect.vue.d.ts +22 -3
  61. package/dist/components/MSignaturePad.vue.d.ts +19 -0
  62. package/dist/components/MSlider.vue.d.ts +23 -1
  63. package/dist/components/MSwitch.vue.d.ts +23 -1
  64. package/dist/components/MTable.vue.d.ts +1 -1
  65. package/dist/components/MTagInput.vue.d.ts +20 -2
  66. package/dist/components/MText.vue.d.ts +1 -1
  67. package/dist/components/MTextField.vue.d.ts +26 -3
  68. package/dist/components/MTimePicker.vue.d.ts +24 -3
  69. package/dist/components/MTimezoneSelect.vue.d.ts +13 -2
  70. package/dist/components/MTour.vue.d.ts +2 -2
  71. package/dist/components/MTrackingTimeline.vue.d.ts +75 -0
  72. package/dist/components/MWindow.vue.d.ts +2 -2
  73. package/dist/composables/_routeGeometry.d.ts +26 -0
  74. package/dist/composables/_useFieldValidation.d.ts +91 -0
  75. package/dist/composables/mapRouting.d.ts +35 -0
  76. package/dist/composables/useLocale.d.ts +23 -0
  77. package/dist/composables/validation.d.ts +82 -0
  78. package/dist/draw.js +2 -2
  79. package/dist/flow.js +1 -1
  80. package/dist/gantt.js +2 -2
  81. package/dist/index.d.ts +5 -0
  82. package/dist/locales/index.js +154 -7
  83. package/dist/locales/index.js.map +1 -1
  84. package/dist/m3ui-vue.css +1 -1
  85. package/dist/m3ui.js +6768 -5602
  86. package/dist/m3ui.js.map +1 -1
  87. package/dist/map.d.ts +4 -0
  88. package/dist/map.js +1230 -784
  89. package/dist/map.js.map +1 -1
  90. package/dist/media.js +4 -4
  91. package/dist/pdf.js +4 -4
  92. package/dist/rich-text-editor.js +189 -146
  93. package/dist/rich-text-editor.js.map +1 -1
  94. package/dist/styles.css +1 -1
  95. package/dist/{useLocale-DaVSTdm0.js → useLocale-Dh1xZZ8i.js} +22 -1
  96. package/dist/useLocale-Dh1xZZ8i.js.map +1 -0
  97. package/package.json +1 -1
  98. package/src/__tests__/MForm.test.ts +325 -0
  99. package/src/__tests__/MMapRoute.test.ts +384 -0
  100. package/src/__tests__/MPhoneInput.test.ts +5 -2
  101. package/src/__tests__/MRichTextEditor.test.ts +2 -1
  102. package/src/__tests__/MTrackingTimeline.test.ts +66 -0
  103. package/src/__tests__/_fakeMaplibre.ts +4 -1
  104. package/src/__tests__/_osrmRoutes.ts +10 -0
  105. package/src/__tests__/attrsFallthrough.test.ts +11 -0
  106. package/src/__tests__/fieldsValidation.test.ts +229 -0
  107. package/src/__tests__/ssr.test.ts +1 -0
  108. package/src/__tests__/validation.test.ts +77 -0
  109. package/src/components/MAddressField.vue +45 -8
  110. package/src/components/MAutocomplete.vue +69 -23
  111. package/src/components/MCheckbox.vue +80 -17
  112. package/src/components/MCodeEditor.vue +59 -2
  113. package/src/components/MColorPicker.vue +65 -16
  114. package/src/components/MCountrySelect.vue +17 -3
  115. package/src/components/MCreditCardInput.vue +76 -7
  116. package/src/components/MCronField.vue +60 -10
  117. package/src/components/MDatePicker.vue +65 -16
  118. package/src/components/MDateRangePicker.vue +66 -16
  119. package/src/components/MFileUpload.vue +71 -8
  120. package/src/components/MForm.vue +208 -0
  121. package/src/components/MJsonEditor.vue +57 -3
  122. package/src/components/MMapRoute.vue +470 -0
  123. package/src/components/MMaskField.vue +55 -13
  124. package/src/components/MMentionField.vue +17 -2
  125. package/src/components/MMultiAutocomplete.vue +70 -23
  126. package/src/components/MMultiSelect.vue +70 -23
  127. package/src/components/MNumberField.vue +58 -16
  128. package/src/components/MPhoneInput.vue +60 -18
  129. package/src/components/MPinInput.vue +58 -10
  130. package/src/components/MRadioGroup.vue +65 -4
  131. package/src/components/MRating.vue +62 -6
  132. package/src/components/MRichTextEditor.vue +64 -4
  133. package/src/components/MSegmentedButton.vue +59 -2
  134. package/src/components/MSelect.vue +72 -26
  135. package/src/components/MSignaturePad.vue +71 -6
  136. package/src/components/MSlider.vue +61 -10
  137. package/src/components/MSwitch.vue +63 -8
  138. package/src/components/MTagInput.vue +67 -25
  139. package/src/components/MTextField.vue +68 -14
  140. package/src/components/MTimePicker.vue +65 -16
  141. package/src/components/MTimezoneSelect.vue +17 -3
  142. package/src/components/MTrackingTimeline.vue +257 -0
  143. package/src/composables/_routeGeometry.ts +140 -0
  144. package/src/composables/_useFieldValidation.ts +287 -0
  145. package/src/composables/mapRouting.ts +55 -0
  146. package/src/composables/useLocale.ts +46 -0
  147. package/src/composables/validation.ts +178 -0
  148. package/src/index.ts +5 -0
  149. package/src/locales/de.ts +21 -0
  150. package/src/locales/es.ts +28 -7
  151. package/src/locales/fr.ts +21 -0
  152. package/src/locales/ja.ts +21 -0
  153. package/src/locales/ko.ts +21 -0
  154. package/src/locales/pt.ts +21 -0
  155. package/src/locales/zh.ts +21 -0
  156. package/src/map.ts +4 -0
  157. package/dist/MListItem-D2cNUyzP.js.map +0 -1
  158. package/dist/MSegmentedButton-BEB4gXLA.js +0 -64
  159. package/dist/MSegmentedButton-BEB4gXLA.js.map +0 -1
  160. package/dist/MSlider-BIkA6DiE.js +0 -690
  161. package/dist/MSlider-BIkA6DiE.js.map +0 -1
  162. package/dist/MTextField-CNH-byir.js.map +0 -1
  163. package/dist/useLocale-DaVSTdm0.js.map +0 -1
package/dist/media.js CHANGED
@@ -1,10 +1,10 @@
1
- import { i as e } from "./useLocale-DaVSTdm0.js";
2
- import { t } from "./MSeekBar-C4cn9RIF.js";
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-BIkA6DiE.js";
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-DWUj0BAB.js";
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-DaVSTdm0.js";
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-CNH-byir.js";
7
- import { t as s } from "./MButton-OQ4wIERQ.js";
8
- import { t as c } from "./MLoadingIndicator-DWUj0BAB.js";
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;
@@ -1,22 +1,24 @@
1
- import { t as e } from "./MIcon-DpajuUTJ.js";
2
- import { n as t, t as n } from "./MMenuItem-BuxYoASE.js";
3
- import { t as r } from "./MDialog-DYMnaBlt.js";
4
- import { t as i } from "./MTextField-CNH-byir.js";
5
- import { t as a } from "./MButton-OQ4wIERQ.js";
6
- import { i as o } from "./useLocale-DaVSTdm0.js";
7
- import { t as s } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
8
- import { Fragment as c, computed as l, createCommentVNode as u, createElementBlock as d, createElementVNode as f, createTextVNode as p, createVNode as m, defineComponent as h, normalizeClass as g, normalizeStyle as _, onBeforeUnmount as v, onMounted as y, openBlock as b, ref as x, renderList as S, shallowRef as C, toDisplayString as w, watch as T, withCtx as E, withKeys as D } from "vue";
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 O = {
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
- }, k = {
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
- }, A = ["title", "onClick"], j = {
17
+ }, ce = ["title", "onClick"], D = {
17
18
  key: 0,
18
19
  class: "mx-1 h-6 w-px bg-outline-variant"
19
- }, M = ["title"], N = ["title"], P = /*#__PURE__*/ s(/* @__PURE__ */ h({
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(s, { emit: h }) {
37
- let P = o(), F = s, I = l(() => ({
38
- bold: P.bold,
39
- italic: P.italic,
40
- underline: P.underline,
41
- strikethrough: P.strikethrough,
42
- highlight: P.highlight,
43
- bulletList: P.bulletList,
44
- orderedList: P.orderedList,
45
- blockquote: P.blockquote,
46
- code: P.code,
47
- alignLeft: P.alignLeft,
48
- alignCenter: P.alignCenter,
49
- alignRight: P.alignRight,
50
- undo: P.undo,
51
- redo: P.redo,
52
- link: P.link,
53
- image: P.image,
54
- paragraph: P.paragraph,
55
- heading1: P.heading1,
56
- heading2: P.heading2,
57
- heading3: P.heading3,
58
- insertLink: P.insertLink,
59
- insertImage: P.insertImage,
60
- imageUrlLabel: P.imageUrlLabel,
61
- cancel: P.cancel,
62
- insert: P.insert,
63
- ...F.labels
64
- })), L = h, R = x(!1), z = C(null), B = x(null), V = x([]);
65
- y(async () => {
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(/&nbsp;/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: B.value,
79
- content: F.modelValue,
80
- editable: !F.disabled,
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: F.placeholder ?? "Start writing..." }),
115
+ s.configure({ placeholder: N.placeholder ?? "Start writing..." }),
89
116
  c,
90
117
  l
91
118
  ],
92
- onUpdate: ({ editor: e }) => L("update:modelValue", e.getHTML())
119
+ onUpdate: ({ editor: e }) => F("update:modelValue", e.getHTML())
93
120
  });
94
- z.value = u, V.value = [
121
+ R.value = u, K.value = [
95
122
  [
96
123
  {
97
124
  icon: "format_bold",
98
- label: I.value.bold,
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: I.value.italic,
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: I.value.underline,
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: I.value.strikethrough,
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: I.value.highlight,
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: I.value.bulletList,
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: I.value.orderedList,
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: I.value.blockquote,
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: I.value.code,
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: I.value.alignLeft,
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: I.value.alignCenter,
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: I.value.alignRight,
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: I.value.undo,
202
+ label: P.value.undo,
176
203
  action: () => u.chain().focus().undo().run()
177
204
  }, {
178
205
  icon: "redo",
179
- label: I.value.redo,
206
+ label: P.value.redo,
180
207
  action: () => u.chain().focus().redo().run()
181
208
  }]
182
- ], v(() => u.destroy()), T(() => F.modelValue, (e) => {
209
+ ], ne(() => u.destroy()), w(() => N.modelValue, (e) => {
183
210
  u.getHTML() !== e && u.commands.setContent(e);
184
- }), T(() => F.disabled, (e) => u.setEditable(!e)), R.value = !0;
211
+ }), w(() => V.value, (e) => u.setEditable(!e)), L.value = !0;
185
212
  });
186
- let H = x(!1), U = x(""), W = x(!1), G = x(""), K = l(() => {
187
- let e = z.value;
188
- return e ? e.isActive("heading", { level: 1 }) ? I.value.heading1 : e.isActive("heading", { level: 2 }) ? I.value.heading2 : e.isActive("heading", { level: 3 }) ? I.value.heading3 : I.value.paragraph : I.value.paragraph;
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 q(e) {
191
- e === 0 ? z.value?.chain().focus().setParagraph().run() : z.value?.chain().focus().toggleHeading({ level: e }).run();
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 J() {
194
- U.value = "", H.value = !0;
220
+ function de() {
221
+ J.value = "", q.value = !0;
195
222
  }
196
- function Y() {
197
- U.value && z.value?.chain().focus().setLink({ href: U.value }).run(), H.value = !1;
223
+ function Q() {
224
+ J.value && R.value?.chain().focus().setLink({ href: J.value }).run(), q.value = !1;
198
225
  }
199
- function X() {
200
- G.value = "", W.value = !0;
226
+ function fe() {
227
+ X.value = "", Y.value = !0;
201
228
  }
202
- function Z() {
203
- G.value && z.value?.chain().focus().setImage({ src: G.value }).run(), W.value = !1;
229
+ function $() {
230
+ X.value && R.value?.chain().focus().setImage({ src: X.value }).run(), Y.value = !1;
204
231
  }
205
- return (o, l) => (b(), d("div", { class: g(["overflow-hidden rounded-lg border transition-colors duration-150", [s.disabled ? "border-outline-variant/50 opacity-60" : "border-outline-variant focus-within:border-primary", { "flex flex-col": s.fill }]]) }, [
206
- R.value ? (b(), d("div", O, [
207
- m(t, { align: "left" }, {
208
- trigger: E(() => [f("button", k, [p(w(K.value) + " ", 1), m(e, {
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: E(() => [
213
- m(n, { onClick: l[0] ||= (e) => q(0) }, {
214
- default: E(() => [p(w(I.value.paragraph), 1)]),
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
- m(n, { onClick: l[1] ||= (e) => q(1) }, {
218
- default: E(() => [p(w(I.value.heading1), 1)]),
255
+ g(i, { onClick: t[1] ||= (e) => Z(1) }, {
256
+ default: T(() => [h(S(P.value.heading1), 1)]),
219
257
  _: 1
220
258
  }),
221
- m(n, { onClick: l[2] ||= (e) => q(2) }, {
222
- default: E(() => [p(w(I.value.heading2), 1)]),
259
+ g(i, { onClick: t[2] ||= (e) => Z(2) }, {
260
+ default: T(() => [h(S(P.value.heading2), 1)]),
223
261
  _: 1
224
262
  }),
225
- m(n, { onClick: l[3] ||= (e) => q(3) }, {
226
- default: E(() => [p(w(I.value.heading3), 1)]),
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
- l[10] ||= f("div", { class: "mx-1 h-6 w-px bg-outline-variant" }, null, -1),
233
- (b(!0), d(c, null, S(V.value, (t, n) => (b(), d(c, { key: n }, [(b(!0), d(c, null, S(t, (t) => (b(), d("button", {
234
- key: t.icon,
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: t.label,
237
- class: g(["flex h-8 w-8 cursor-pointer items-center justify-center rounded transition-colors duration-100", t.active?.() ? "bg-secondary-container text-on-secondary-container" : "text-on-surface-variant hover:bg-on-surface/8"]),
238
- onClick: t.action
239
- }, [m(e, {
240
- name: t.icon,
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, A))), 128)), n < V.value.length - 1 ? (b(), d("div", j)) : u("", !0)], 64))), 128)),
243
- l[11] ||= f("div", { class: "mx-1 h-6 w-px bg-outline-variant" }, null, -1),
244
- f("button", {
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: I.value.link,
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: J
249
- }, [m(e, {
286
+ onClick: de
287
+ }, [g(n, {
250
288
  name: "link",
251
289
  size: 20
252
- })], 8, M),
253
- f("button", {
290
+ })], 8, O),
291
+ m("button", {
254
292
  type: "button",
255
- title: I.value.image,
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: X
258
- }, [m(e, {
295
+ onClick: fe
296
+ }, [g(n, {
259
297
  name: "image",
260
298
  size: 20
261
- })], 8, N)
262
- ])) : u("", !0),
263
- f("div", {
299
+ })], 8, k)
300
+ ])) : f("", !0),
301
+ m("div", {
264
302
  ref_key: "editorContainer",
265
- ref: B,
266
- class: g(["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": s.fill }]),
267
- style: _(s.fill ? void 0 : { minHeight: s.minHeight })
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
- m(r, {
270
- modelValue: H.value,
271
- "onUpdate:modelValue": l[6] ||= (e) => H.value = e,
272
- title: I.value.insertLink
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: E(() => [m(a, {
312
+ actions: T(() => [g(s, {
275
313
  variant: "text",
276
- onClick: l[5] ||= (e) => H.value = !1
314
+ onClick: t[5] ||= (e) => q.value = !1
277
315
  }, {
278
- default: E(() => [p(w(I.value.cancel), 1)]),
316
+ default: T(() => [h(S(P.value.cancel), 1)]),
279
317
  _: 1
280
- }), m(a, { onClick: Y }, {
281
- default: E(() => [p(w(I.value.insert), 1)]),
318
+ }), g(s, { onClick: Q }, {
319
+ default: T(() => [h(S(P.value.insert), 1)]),
282
320
  _: 1
283
321
  })]),
284
- default: E(() => [m(i, {
285
- modelValue: U.value,
286
- "onUpdate:modelValue": l[4] ||= (e) => U.value = e,
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: D(Y, ["enter"])
327
+ onKeydown: E(Q, ["enter"])
290
328
  }, null, 8, ["modelValue"])]),
291
329
  _: 1
292
330
  }, 8, ["modelValue", "title"]),
293
- m(r, {
294
- modelValue: W.value,
295
- "onUpdate:modelValue": l[9] ||= (e) => W.value = e,
296
- title: I.value.insertImage
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: E(() => [m(a, {
336
+ actions: T(() => [g(s, {
299
337
  variant: "text",
300
- onClick: l[8] ||= (e) => W.value = !1
338
+ onClick: t[8] ||= (e) => Y.value = !1
301
339
  }, {
302
- default: E(() => [p(w(I.value.cancel), 1)]),
340
+ default: T(() => [h(S(P.value.cancel), 1)]),
303
341
  _: 1
304
- }), m(a, { onClick: Z }, {
305
- default: E(() => [p(w(I.value.insert), 1)]),
342
+ }), g(s, { onClick: $ }, {
343
+ default: T(() => [h(S(P.value.insert), 1)]),
306
344
  _: 1
307
345
  })]),
308
- default: E(() => [m(i, {
309
- modelValue: G.value,
310
- "onUpdate:modelValue": l[7] ||= (e) => G.value = e,
311
- label: I.value.imageUrlLabel,
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: D(Z, ["enter"])
351
+ onKeydown: E($, ["enter"])
314
352
  }, null, 8, ["modelValue", "label"])]),
315
353
  _: 1
316
354
  }, 8, ["modelValue", "title"])
317
- ], 2));
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-d506d3d1"]]);
320
- export { P as MRichTextEditor };
362
+ }), [["__scopeId", "data-v-de9f7da9"]]);
363
+ export { j as MRichTextEditor };
321
364
 
322
365
  //# sourceMappingURL=rich-text-editor.js.map