@mgdis/mg-components 6.24.0 → 6.26.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 (192) hide show
  1. package/dist/cjs/index-Acmyl4hv.js +5 -0
  2. package/dist/cjs/{index-BxB20_Vw.js → index-B6J2EllP.js} +3 -1
  3. package/dist/cjs/{index-BEF-cqV9.js → index-BmFwLEZT.js} +5 -1
  4. package/dist/cjs/{index-CpENFzEo.js → index-DrZECzp6.js} +14 -6
  5. package/dist/cjs/loader.cjs.js +2 -2
  6. package/dist/cjs/mg-action-more_36.cjs.entry.js +452 -261
  7. package/dist/cjs/mg-alert.cjs.entry.js +7 -8
  8. package/dist/cjs/mg-breadcrumb.cjs.entry.js +27 -10
  9. package/dist/cjs/mg-components.cjs.js +2 -2
  10. package/dist/cjs/mg-fieldset.cjs.entry.js +8 -8
  11. package/dist/cjs/mg-illustration.cjs.entry.js +57 -0
  12. package/dist/cjs/mg-input-combobox.cjs.entry.js +40 -23
  13. package/dist/cjs/mg-input-file.cjs.entry.js +12 -11
  14. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +2565 -4013
  15. package/dist/cjs/mg-loader.cjs.entry.js +5 -5
  16. package/dist/cjs/mg-progress.cjs.entry.js +3 -3
  17. package/dist/collection/assets/illustrations/index.js +1 -0
  18. package/dist/collection/assets/jodit/jodit.css +5821 -0
  19. package/dist/collection/collection-manifest.json +1 -0
  20. package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
  21. package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
  22. package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
  23. package/dist/collection/components/atoms/mg-button/mg-button.js +4 -1
  24. package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
  25. package/dist/collection/components/atoms/mg-divider/mg-divider.conf.js +4 -0
  26. package/dist/collection/components/atoms/mg-divider/mg-divider.js +62 -3
  27. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  28. package/dist/collection/components/atoms/mg-illustration/mg-illustration.conf.js +1 -0
  29. package/dist/collection/components/atoms/mg-illustration/mg-illustration.js +95 -0
  30. package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
  31. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
  32. package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -7
  33. package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +84 -19
  34. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +5 -2
  35. package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +5 -1
  36. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +30 -22
  37. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +69 -25
  38. package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +14 -8
  39. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +8 -7
  40. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +21 -12
  41. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +9 -8
  42. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +15 -10
  43. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.css +50 -0
  44. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +29 -3
  45. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +262 -9
  46. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -19
  47. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +18 -13
  48. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +7 -7
  49. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -9
  50. package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
  51. package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +7 -5
  52. package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +18 -17
  53. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +7 -4
  54. package/dist/collection/components/molecules/mg-alert/mg-alert.js +6 -7
  55. package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +49 -6
  56. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  57. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +6 -6
  58. package/dist/collection/components/molecules/mg-form/mg-form.js +16 -13
  59. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.js +4 -0
  60. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +51 -2
  61. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  62. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  63. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  64. package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +8 -4
  65. package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -4
  66. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
  67. package/dist/collection/components/molecules/mg-popover/mg-popover.js +24 -37
  68. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  69. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -3
  70. package/dist/collection/components/molecules/mg-table/mg-table.js +10 -6
  71. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +12 -9
  72. package/dist/collection/utils/behaviors.utils.js +3 -3
  73. package/dist/collection/utils/playwright.fixture.js +7 -2
  74. package/dist/components/mg-action-more.js +1 -1
  75. package/dist/components/mg-alert.js +1 -1
  76. package/dist/components/mg-badge2.js +1 -1
  77. package/dist/components/mg-breadcrumb.js +1 -1
  78. package/dist/components/mg-button2.js +1 -1
  79. package/dist/components/mg-card2.js +1 -1
  80. package/dist/components/mg-character-left2.js +1 -1
  81. package/dist/components/mg-details.js +1 -1
  82. package/dist/components/mg-divider2.js +1 -1
  83. package/dist/components/mg-fieldset.js +1 -1
  84. package/dist/components/mg-form.js +1 -1
  85. package/dist/components/mg-icon2.js +1 -1
  86. package/dist/components/mg-illustrated-message.js +1 -1
  87. package/dist/components/mg-illustration.d.ts +11 -0
  88. package/dist/components/mg-illustration.js +1 -0
  89. package/dist/components/mg-input-checkbox.js +1 -1
  90. package/dist/components/mg-input-combobox.js +1 -1
  91. package/dist/components/mg-input-date.js +1 -1
  92. package/dist/components/mg-input-file.js +1 -1
  93. package/dist/components/mg-input-numeric.js +1 -1
  94. package/dist/components/mg-input-password.js +1 -1
  95. package/dist/components/mg-input-radio.js +1 -1
  96. package/dist/components/mg-input-rich-text-editor.js +294 -284
  97. package/dist/components/mg-input-select2.js +1 -1
  98. package/dist/components/mg-input-text2.js +1 -1
  99. package/dist/components/mg-input-textarea.js +1 -1
  100. package/dist/components/mg-input-title2.js +1 -1
  101. package/dist/components/mg-input-toggle.js +1 -1
  102. package/dist/components/mg-input2.js +1 -1
  103. package/dist/components/mg-item-more2.js +1 -1
  104. package/dist/components/mg-loader2.js +1 -1
  105. package/dist/components/mg-menu-item2.js +1 -1
  106. package/dist/components/mg-message2.js +1 -1
  107. package/dist/components/mg-modal.js +1 -1
  108. package/dist/components/mg-pagination.js +1 -1
  109. package/dist/components/mg-panel.js +1 -1
  110. package/dist/components/mg-popover-content2.js +1 -1
  111. package/dist/components/mg-popover2.js +1 -1
  112. package/dist/components/mg-progress.js +1 -1
  113. package/dist/components/mg-skip-links.js +1 -1
  114. package/dist/components/mg-table.js +1 -1
  115. package/dist/components/mg-tabs2.js +1 -1
  116. package/dist/components/mg-tag.js +1 -1
  117. package/dist/components/mg-tooltip-content2.js +1 -1
  118. package/dist/components/mg-tooltip2.js +1 -1
  119. package/dist/custom-elements.json +197 -48
  120. package/dist/esm/{index-C7xjtdiw.js → index-91BOpzAB.js} +14 -6
  121. package/dist/esm/{index-DSEloqPn.js → index-BfblyCaJ.js} +3 -1
  122. package/dist/esm/index-Ci9Hv7DG.js +3 -0
  123. package/dist/esm/{index-DshvCiTL.js → index-D4bO_UCn.js} +5 -1
  124. package/dist/esm/loader.js +3 -3
  125. package/dist/esm/mg-action-more_36.entry.js +449 -258
  126. package/dist/esm/mg-alert.entry.js +7 -8
  127. package/dist/esm/mg-breadcrumb.entry.js +27 -10
  128. package/dist/esm/mg-components.js +3 -3
  129. package/dist/esm/mg-fieldset.entry.js +8 -8
  130. package/dist/esm/mg-illustration.entry.js +55 -0
  131. package/dist/esm/mg-input-combobox.entry.js +40 -23
  132. package/dist/esm/mg-input-file.entry.js +12 -11
  133. package/dist/esm/mg-input-rich-text-editor.entry.js +2550 -3998
  134. package/dist/esm/mg-loader.entry.js +5 -5
  135. package/dist/esm/mg-progress.entry.js +3 -3
  136. package/dist/mg-components/mg-components.css +1 -1
  137. package/dist/mg-components/mg-components.esm.js +1 -1
  138. package/dist/mg-components/p-206505b5.entry.js +1667 -0
  139. package/dist/mg-components/{p-cdb01923.entry.js → p-3ad7441c.entry.js} +1 -1
  140. package/dist/mg-components/p-413b4536.entry.js +1 -0
  141. package/dist/mg-components/p-5dff879a.entry.js +1 -0
  142. package/dist/mg-components/{p-08d3d957.entry.js → p-96fc508e.entry.js} +1 -1
  143. package/dist/mg-components/p-Ci9Hv7DG.js +1 -0
  144. package/dist/mg-components/p-D4bO_UCn.js +2 -0
  145. package/dist/mg-components/{p-d0b6d8f5.entry.js → p-ad533d08.entry.js} +1 -1
  146. package/dist/mg-components/p-b20f3698.entry.js +1 -0
  147. package/dist/mg-components/p-bf2252c9.entry.js +1 -0
  148. package/dist/mg-components/p-d0d12800.entry.js +1 -0
  149. package/dist/mg-components/p-f8e58181.entry.js +1 -0
  150. package/dist/types/assets/illustrations/index.d.ts +21 -0
  151. package/dist/types/components/atoms/mg-divider/mg-divider.conf.d.ts +9 -0
  152. package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +13 -0
  153. package/dist/types/components/atoms/mg-illustration/mg-illustration.conf.d.ts +5 -0
  154. package/dist/types/components/atoms/mg-illustration/mg-illustration.d.ts +24 -0
  155. package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +19 -0
  156. package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +1 -1
  157. package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +10 -5
  158. package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +2 -2
  159. package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +2 -2
  160. package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
  161. package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -1
  162. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +4 -0
  163. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +25 -0
  164. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +61 -2
  165. package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +2 -2
  166. package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +2 -2
  167. package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +2 -2
  168. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -2
  169. package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +2 -2
  170. package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +2 -2
  171. package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +11 -0
  172. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.conf.d.ts +8 -0
  173. package/dist/types/components/molecules/mg-illustrated-message/mg-illustrated-message.d.ts +9 -1
  174. package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +1 -1
  175. package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -3
  176. package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +1 -1
  177. package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -1
  178. package/dist/types/components.d.ts +158 -42
  179. package/ide/intellij/web-types.json +145 -65
  180. package/ide/vscode/css-custom-data.json +6 -2
  181. package/ide/vscode/html-custom-data.json +216 -33
  182. package/package.json +22 -22
  183. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/custom-properties.scss +0 -212
  184. package/dist/mg-components/p-13feb37a.entry.js +0 -1
  185. package/dist/mg-components/p-7c63e469.entry.js +0 -1
  186. package/dist/mg-components/p-7fd3e519.entry.js +0 -1
  187. package/dist/mg-components/p-9953b835.entry.js +0 -1
  188. package/dist/mg-components/p-9c0a9fc7.entry.js +0 -1657
  189. package/dist/mg-components/p-DshvCiTL.js +0 -2
  190. package/dist/mg-components/p-a338088e.entry.js +0 -1
  191. /package/dist/mg-components/{p-C7xjtdiw.js → p-91BOpzAB.js} +0 -0
  192. /package/dist/mg-components/{p-DSEloqPn.js → p-BfblyCaJ.js} +0 -0
@@ -3,7 +3,7 @@ import { ClassList, isValidString, toString } from "@mgdis/core-ui-helpers/dist/
3
3
  import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
4
4
  import { localeCurrency, localeNumber, localePercent, localeUnit } from "@mgdis/core-ui-helpers/dist/locale";
5
5
  import { types, formats } from "./mg-input-numeric.conf";
6
- import { classReadonly, classDisabled, widths } from "../mg-input/mg-input.conf";
6
+ import { classReadonly, classDisabled, widths, } from "../mg-input/mg-input.conf";
7
7
  import { initLocales } from "../../../../locales/";
8
8
  /**
9
9
  * @slot append-input - Content to display next to the input
@@ -137,7 +137,9 @@ export class MgInputNumeric {
137
137
  else {
138
138
  const formattedMin = this.formatErrorValue(this.min);
139
139
  const formattedMax = this.formatErrorValue(this.max);
140
- this.errorMessage = this.messages.input.numeric.error[inputError].replace('{min}', formattedMin).replace('{max}', formattedMax);
140
+ this.errorMessage = this.messages.input.numeric.error[inputError]
141
+ .replace('{min}', formattedMin)
142
+ .replace('{max}', formattedMax);
141
143
  }
142
144
  }
143
145
  };
@@ -146,7 +148,7 @@ export class MgInputNumeric {
146
148
  * @returns error code
147
149
  */
148
150
  this.getInputError = () => {
149
- const hasNotEmptyValues = (toControl) => !toControl.some(value => [null, undefined].includes(value));
151
+ const hasNotEmptyValues = (toControl) => !toControl.some((value) => [null, undefined].includes(value));
150
152
  // required
151
153
  if (!this.input.checkValidity() && this.input.validity.valueMissing) {
152
154
  return 'required';
@@ -160,7 +162,8 @@ export class MgInputNumeric {
160
162
  return 'max';
161
163
  }
162
164
  // both min and max values are set
163
- if (hasNotEmptyValues([this.min, this.max, this.numericValue]) && (this.numericValue < this.min || this.numericValue > this.max)) {
165
+ if (hasNotEmptyValues([this.min, this.max, this.numericValue]) &&
166
+ (this.numericValue < this.min || this.numericValue > this.max)) {
164
167
  return 'minMax';
165
168
  }
166
169
  return null;
@@ -275,7 +278,7 @@ export class MgInputNumeric {
275
278
  }
276
279
  watchMgWidth(newValue) {
277
280
  // reset width class
278
- widths.forEach(width => {
281
+ widths.forEach((width) => {
279
282
  this.classCollection.delete(`mg-c-input--width-${width}`);
280
283
  });
281
284
  // apply new width
@@ -319,7 +322,7 @@ export class MgInputNumeric {
319
322
  // - Async operations are completed
320
323
  // - No timing issues with Stencil's render cycle
321
324
  // - Keep everything in sync both inside and outside the component
322
- return new Promise(resolve => {
325
+ return new Promise((resolve) => {
323
326
  requestAnimationFrame(() => {
324
327
  this.checkValidity();
325
328
  this.setErrorMessage();
@@ -366,7 +369,7 @@ export class MgInputNumeric {
366
369
  // - Async operations are completed
367
370
  // - No timing issues with Stencil's render cycle
368
371
  // - Keep everything in sync both inside and outside the component
369
- return new Promise(resolve => {
372
+ return new Promise((resolve) => {
370
373
  requestAnimationFrame(() => {
371
374
  // unlock validity check by reseting customErrorMessage
372
375
  this.customErrorMessage = { lock: false };
@@ -401,7 +404,10 @@ export class MgInputNumeric {
401
404
  * @returns Returns true if the value is valid, otherwise false.
402
405
  */
403
406
  isValidValue(value, regex, integer, decimal) {
404
- return (['', '-'].includes(value) || (regex.exec(value) !== null && integer.length <= this.integerLength && decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength)));
407
+ return (['', '-'].includes(value) ||
408
+ (regex.exec(value) !== null &&
409
+ integer.length <= this.integerLength &&
410
+ decimal.length <= (this.type === 'integer' ? 0 : this.decimalLength)));
405
411
  }
406
412
  /**
407
413
  * Updates the component values based on the validated input value.
@@ -412,7 +418,10 @@ export class MgInputNumeric {
412
418
  if (this.input !== undefined) {
413
419
  this.input.value = this.value;
414
420
  }
415
- this.numericValue = !['', null].includes(this.value) && !isNaN(parseFloat(this.value)) ? parseFloat(this.value.replace(',', '.')) : null;
421
+ this.numericValue =
422
+ !['', null].includes(this.value) && !isNaN(parseFloat(this.value))
423
+ ? parseFloat(this.value.replace(',', '.'))
424
+ : null;
416
425
  if (newValue === null || (newValue === this.storedValue && !Object.is(this.numericValue, -0))) {
417
426
  this.valueChange.emit(this.numericValue);
418
427
  }
@@ -462,7 +471,7 @@ export class MgInputNumeric {
462
471
  * @returns HTML Element
463
472
  */
464
473
  render() {
465
- return (h("mg-input", { key: '734f1734139c5919481693c869da68586f18a92f', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
474
+ return (h("mg-input", { key: 'dbf435211890922742cbead9ab3a738b5219df44', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.formatHelpText(this.helpText), errorMessage: this.errorMessage }, this.readonly
466
475
  ? this.readonlyValue && this.renderReadonly()
467
476
  : [
468
477
  h("input", { key: "input", type: "text", class: "mg-c-input__box mg-c-input__box--width", value: this.displayValue(), id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, autocomplete: "off", "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onFocus: this.handleFocus, onBlur: this.handleBlur, ref: (el) => {
@@ -1030,7 +1039,7 @@ export class MgInputNumeric {
1030
1039
  "composed": true,
1031
1040
  "docs": {
1032
1041
  "tags": [],
1033
- "text": "Emited event when value change"
1042
+ "text": "Emitted event when value change"
1034
1043
  },
1035
1044
  "complexType": {
1036
1045
  "original": "number",
@@ -1045,7 +1054,7 @@ export class MgInputNumeric {
1045
1054
  "composed": true,
1046
1055
  "docs": {
1047
1056
  "tags": [],
1048
- "text": "Emited event when checking validity"
1057
+ "text": "Emitted event when checking validity"
1049
1058
  },
1050
1059
  "complexType": {
1051
1060
  "original": "HTMLMgInputNumericElement['valid']",
@@ -1,7 +1,7 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, isValidString } from "@mgdis/core-ui-helpers/dist/utils";
3
3
  import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
4
- import { classReadonly, classDisabled, widths } from "../mg-input/mg-input.conf";
4
+ import { classReadonly, classDisabled, widths, } from "../mg-input/mg-input.conf";
5
5
  import { initLocales } from "../../../../locales";
6
6
  export class MgInputPassword {
7
7
  constructor() {
@@ -127,7 +127,7 @@ export class MgInputPassword {
127
127
  }
128
128
  watchMgWidth(newValue) {
129
129
  // reset width class
130
- widths.forEach(width => {
130
+ widths.forEach((width) => {
131
131
  this.classCollection.delete(`mg-c-input--width-${width}`);
132
132
  });
133
133
  // apply new width
@@ -151,7 +151,7 @@ export class MgInputPassword {
151
151
  // - Async operations are completed
152
152
  // - No timing issues with Stencil's render cycle
153
153
  // - Keep everything in sync both inside and outside the component
154
- return new Promise(resolve => {
154
+ return new Promise((resolve) => {
155
155
  requestAnimationFrame(() => {
156
156
  this.checkValidity();
157
157
  this.setErrorMessage();
@@ -198,7 +198,7 @@ export class MgInputPassword {
198
198
  // - Async operations are completed
199
199
  // - No timing issues with Stencil's render cycle
200
200
  // - Keep everything in sync both inside and outside the component
201
- return new Promise(resolve => {
201
+ return new Promise((resolve) => {
202
202
  requestAnimationFrame(() => {
203
203
  // unlock validity check by reseting customErrorMessage
204
204
  this.customErrorMessage = { lock: false };
@@ -250,10 +250,11 @@ export class MgInputPassword {
250
250
  * @returns HTML Element
251
251
  */
252
252
  render() {
253
- return (h("mg-input", { key: 'fb26a8db11651950de2fe01600443bf2d6cad9e6', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value !== undefined && h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (h("span", { class: "mg-c-input__input-group" }, h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
253
+ const displayPasswordIcon = this.displayPassword ? 'eye-slash' : 'eye';
254
+ return (h("mg-input", { key: '913d0653faad21f56cb930dfdc0947a0747f17ad', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && this.value === undefined ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.value !== undefined && h("b", { class: "mg-c-input__readonly-value" }, '•'.repeat(this.value.length))) : (h("span", { class: "mg-c-input__input-group" }, h("input", { type: this.displayPassword ? 'text' : 'password', class: "mg-c-input__box mg-c-input__box--width", value: this.value, id: this.identifier, name: this.name, placeholder: this.placeholder, title: this.placeholder, disabled: this.disabled, required: this.required, maxlength: this.maxlength, "aria-invalid": (this.invalid === true).toString(), onInput: this.handleInput, onBlur: this.handleBlur, ref: (el) => {
254
255
  if (el !== null)
255
256
  this.input = el;
256
- } }), h("mg-button", { label: this.messages.input.password[this.displayPassword ? 'hide' : 'display'], disabled: this.disabled, variant: "flat", class: "mg-c-input__append-button", "is-icon": true, onClick: this.toggleDisplayPassword, "aria-controls": this.identifier }, h("mg-icon", { class: "mg-c-input__input-icon", icon: (this.displayPassword ? 'eye-slash' : 'eye') }))))));
257
+ } }), h("mg-button", { label: this.messages.input.password[this.displayPassword ? 'hide' : 'display'], disabled: this.disabled, variant: "flat", class: "mg-c-input__append-button", "is-icon": true, onClick: this.toggleDisplayPassword, "aria-controls": this.identifier }, h("mg-icon", { class: "mg-c-input__input-icon", icon: displayPasswordIcon }))))));
257
258
  }
258
259
  static get is() { return "mg-input-password"; }
259
260
  static get encapsulation() { return "shadow"; }
@@ -632,7 +633,7 @@ export class MgInputPassword {
632
633
  "composed": true,
633
634
  "docs": {
634
635
  "tags": [],
635
- "text": "Emited event when value change"
636
+ "text": "Emitted event when value change"
636
637
  },
637
638
  "complexType": {
638
639
  "original": "HTMLMgInputPasswordElement['value']",
@@ -652,7 +653,7 @@ export class MgInputPassword {
652
653
  "composed": true,
653
654
  "docs": {
654
655
  "tags": [],
655
- "text": "Emited event when checking validity"
656
+ "text": "Emitted event when checking validity"
656
657
  },
657
658
  "complexType": {
658
659
  "original": "HTMLMgInputPasswordElement['valid']",
@@ -1,14 +1,16 @@
1
1
  import { h } from "@stencil/core";
2
2
  import { ClassList, allItemsAreString, isValidString, toString } from "@mgdis/core-ui-helpers/dist/utils";
3
3
  import { normalizeBooleanAttributes } from "@mgdis/core-ui-helpers/dist/stencil";
4
- import { classReadonly, classDisabled, classFieldset } from "../mg-input/mg-input.conf";
4
+ import { classReadonly, classDisabled, classFieldset, } from "../mg-input/mg-input.conf";
5
5
  import { initLocales } from "../../../../locales";
6
6
  /**
7
7
  * type Option validation function
8
8
  * @param option - radio option
9
9
  * @returns radio option type is valid
10
10
  */
11
- const isOption = (option) => typeof option === 'object' && typeof option.title === 'string' && option.value !== undefined;
11
+ const isOption = (option) => typeof option === 'object' &&
12
+ typeof option.title === 'string' &&
13
+ option.value !== undefined;
12
14
  export class MgInputRadio {
13
15
  constructor() {
14
16
  /************
@@ -114,7 +116,7 @@ export class MgInputRadio {
114
116
  this.readonlyValue = newValue;
115
117
  }
116
118
  else if (Array.isArray(this.items) && this.items.every(isOption)) {
117
- this.readonlyValue = (_a = this.items.find(item => item.value === newValue)) === null || _a === void 0 ? void 0 : _a.title;
119
+ this.readonlyValue = (_a = this.items.find((item) => item.value === newValue)) === null || _a === void 0 ? void 0 : _a.title;
118
120
  }
119
121
  else {
120
122
  this.readonlyValue = null;
@@ -128,10 +130,10 @@ export class MgInputRadio {
128
130
  }
129
131
  // String array
130
132
  else if (allItemsAreString(newValue)) {
131
- this.options = newValue.map(item => ({ title: item, value: item, disabled: this.disabled }));
133
+ this.options = newValue.map((item) => ({ title: item, value: item, disabled: this.disabled }));
132
134
  }
133
135
  // Object array
134
- else if (newValue && newValue.every(item => isOption(item))) {
136
+ else if (newValue && newValue.every((item) => isOption(item))) {
135
137
  this.options = newValue;
136
138
  }
137
139
  else {
@@ -151,7 +153,7 @@ export class MgInputRadio {
151
153
  this.classCollection.delete(classReadonly);
152
154
  }
153
155
  handleValidityChange(newValue, _oldValue, prop) {
154
- this.inputs.forEach(input => {
156
+ this.inputs.forEach((input) => {
155
157
  input[prop] = newValue;
156
158
  });
157
159
  this.checkValidity();
@@ -184,7 +186,7 @@ export class MgInputRadio {
184
186
  // - Async operations are completed
185
187
  // - No timing issues with Stencil's render cycle
186
188
  // - Keep everything in sync both inside and outside the component
187
- return new Promise(resolve => {
189
+ return new Promise((resolve) => {
188
190
  requestAnimationFrame(() => {
189
191
  this.checkValidity();
190
192
  this.setErrorMessage();
@@ -231,7 +233,7 @@ export class MgInputRadio {
231
233
  // - Async operations are completed
232
234
  // - No timing issues with Stencil's render cycle
233
235
  // - Keep everything in sync both inside and outside the component
234
- return new Promise(resolve => {
236
+ return new Promise((resolve) => {
235
237
  requestAnimationFrame(() => {
236
238
  // unlock validity check by reseting customErrorMessage
237
239
  this.customErrorMessage = { lock: false };
@@ -286,7 +288,10 @@ export class MgInputRadio {
286
288
  * @returns HTML Element
287
289
  */
288
290
  render() {
289
- return (h("mg-input", { key: 'a749870b0b690a52d75a5ab6340e26cf0b1449c0', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("div", { class: "mg-c-input__input-group-container" }, this.options.map((input, index) => (h("div", { key: input.title, class: { 'mg-c-input__input-group': true, 'mg-c-input__input-group--disabled': this.disabled || input.disabled } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
291
+ return (h("mg-input", { key: '763e021cdda0735dcbd62700f09cbc32c0de7377', label: this.label, identifier: this.identifier, class: this.classCollection.join(), labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: this.required, tooltip: this.tooltip, tooltipPosition: this.readonly && !this.value ? 'label' : this.tooltipPosition, helpText: this.helpText, errorMessage: this.errorMessage }, this.readonly ? (this.readonlyValue && h("b", { class: "mg-c-input__readonly-value" }, this.readonlyValue)) : (h("div", { class: "mg-c-input__input-group-container" }, this.options.map((input, index) => (h("div", { key: input.title, class: {
292
+ 'mg-c-input__input-group': true,
293
+ 'mg-c-input__input-group--disabled': this.disabled || input.disabled,
294
+ } }, h("input", { type: "radio", id: this.identifier + '_' + index, name: this.identifier, value: index, checked: JSON.stringify(this.value) === JSON.stringify(this.options[index].value), disabled: this.disabled || input.disabled, required: this.required, onBlur: this.handleBlur, onInput: this.handleInput, ref: (el) => {
290
295
  if (el !== null)
291
296
  this.inputs[index] = el;
292
297
  } }), h("label", { htmlFor: this.identifier + '_' + index }, input.title))))))));
@@ -668,7 +673,7 @@ export class MgInputRadio {
668
673
  "composed": true,
669
674
  "docs": {
670
675
  "tags": [],
671
- "text": "Emited event when checking validity"
676
+ "text": "Emitted event when checking validity"
672
677
  },
673
678
  "complexType": {
674
679
  "original": "HTMLMgInputRadioElement['valid']",
@@ -0,0 +1,50 @@
1
+ /* Jodit theming overrides
2
+ *
3
+ * Jodit's own defaults are provided by jodit.css (loaded with :root rewritten to :host).
4
+ * This layer only holds the values the design system intentionally overrides — mainly px
5
+ * sizes converted to rem for scalable UI, plus a few color adjustments. It must load after
6
+ * jodit.css so these win.
7
+ */
8
+ :host {
9
+ --jd-color-background-button-hover-opacity30: rgb(234 234 234 / 30%);
10
+ --jd-color-background-filebrowser-folders: rgb(248 249 250);
11
+ --jd-color-button-background-hover-opacity40: rgb(219 219 219 / 40%);
12
+ --jd-color-button-background-hover-opacity60: rgb(219 219 219 / 60%);
13
+ --jd-color-table-cell-background-hover: rgb(0 0 0 / 5%);
14
+ --jd-dark-text-color-opacity50: rgb(206 206 206 / 50%);
15
+ --jd-dark-text-color-opacity80: rgb(206 206 206 / 80%);
16
+ --jd-dark-toolbar-seperator-color3: rgb(105 105 105 / 75%);
17
+ --jd-dark-toolbar-seperator-color-opacity80: rgb(105 105 105 / 80%);
18
+ --jd-color-picker-cell-size: 2.4rem;
19
+ --jd-button-icon-size: 1.4rem;
20
+ --jd-button-trigger-size: 1.4rem;
21
+ --jd-button-df-size: calc((var(--jd-button-icon-size) - 0.4rem) * 2);
22
+ --jd-icon-size: 1.2rem;
23
+ --jd-icon-loader-size: 4.8rem;
24
+ --jd-height: 1.8rem;
25
+ --jd-height-element-default: 1.8rem;
26
+ --jd-height-search: 3rem;
27
+ --jd-input-height: 3.2rem;
28
+ --jd-switche-height: 3.2rem;
29
+ --jd-viewer-height: 2.4rem;
30
+ --jd-width-default: 18rem;
31
+ --jd-width-element-default: 1.8rem;
32
+ --jd-width-search: 32rem;
33
+ --jd-viewer-width: 7rem;
34
+ --jd-switche-width: 6rem;
35
+ --jd-col-size: 15rem;
36
+ --jd-padding-default: 0.8rem;
37
+ --jd-margin-v: 0.2rem;
38
+ --jd-switche-slider-margin: 0.4rem;
39
+ --jd-resizer-handle-size: 1rem;
40
+ --jd-border-radius-default: 0.3rem;
41
+ --jd-font-size-default: 1.4rem;
42
+ --jd-font-size-small: 1.1rem;
43
+ --jd-box-shadow-1: 0 0.8rem 1.6rem rgb(0 0 0 / 19%);
44
+ --jd-box-shadow-blur: 1.6rem;
45
+ --jd-box-shadow-tabs: 0 0.2rem 0.4rem rgb(0 0 0 / 10%);
46
+ --jd-popup-box-shadow: 0 0.4rem 0.1rem -0.2rem rgb(76 76 76 / 20%), 0 0.3rem 0.3rem 0 rgb(76 76 76 / 15%), 0 0.1rem 0.4rem 0 rgb(76 76 76 / 13%);
47
+ --jd-popup-max-height: max(50vh, 35rem);
48
+ --jd-focus-input-box-shadow: 0 0 0 0.05rem rgb(0 123 255 / 25%);
49
+ --jd-anl-handle-size: 2rem;
50
+ }
@@ -13,6 +13,8 @@ import "jodit/esm/plugins/delete/delete.js";
13
13
  import "jodit/esm/plugins/file/file.js";
14
14
  import "jodit/esm/plugins/print/print.js";
15
15
  import "jodit/esm/plugins/source/source.js";
16
+ // Reuse the design system icon set (same source as mg-icon) to render custom action icons
17
+ import { icons } from "../../../../../assets/icons";
16
18
  const DEFAULT_ROWS = 5;
17
19
  /**
18
20
  * Converts rows count to Jodit editor min-height CSS value.
@@ -53,7 +55,24 @@ export const rowsToEditorHeight = (rows) => {
53
55
  * @returns Configured Jodit editor instance
54
56
  */
55
57
  export const defineEditor = (element, editorElement, config) => {
56
- const { value, modules, readOnly, disabled, placeholder, rows = DEFAULT_ROWS, handleTextChange, handleFocus, handleBlur } = config;
58
+ const { value, modules, customActions, readOnly, disabled, placeholder, rows = DEFAULT_ROWS, handleTextChange, handleFocus, handleBlur, handleCustomAction, handleSelectionChange, } = config;
59
+ // Translate consumer-declared custom actions into Jodit toolbar controls.
60
+ // This keeps the public API decoupled from Jodit: consumers never manipulate Jodit controls directly.
61
+ // `tooltip` is used by Jodit to set the button `aria-label`. The `icon` is an mg-icon name resolved
62
+ // to its SVG from the shared design system icon set, then rendered as-is by Jodit (it returns the
63
+ // string when it contains `<svg`). Using currentColor SVGs, the icon inherits the button color.
64
+ // `mods: { stroke: false }` adds the `jodit-toolbar-button_stroke_false` class so Jodit stops applying
65
+ // a stroke to the icon (its default `.jodit-icon` rule sets both fill and stroke, which distorts the
66
+ // design system icons that are meant to be filled only).
67
+ const customControls = (customActions !== null && customActions !== void 0 ? customActions : []).map((action) => ({
68
+ name: action.name,
69
+ tooltip: action.label,
70
+ icon: icons[action.icon],
71
+ mods: { stroke: false },
72
+ exec: () => {
73
+ handleCustomAction === null || handleCustomAction === void 0 ? void 0 : handleCustomAction(action.name);
74
+ },
75
+ }));
57
76
  // Configure Jodit
58
77
  // Note: Using Record<string, unknown> to avoid TypeScript complexity issues with Jodit's deeply nested Config type
59
78
  // The actual configuration follows Jodit's Config interface from jodit/esm/types
@@ -68,6 +87,9 @@ export const defineEditor = (element, editorElement, config) => {
68
87
  // When disabled, use -1 to exclude the editor from Tab navigation
69
88
  tabIndex: disabled === true ? -1 : 0,
70
89
  buttons: modules,
90
+ // Append custom action buttons after the built-in modules via Jodit's native `extraButtons`
91
+ // (it does `buttons.concat(extraButtons)`), preceded by a separator when there are any.
92
+ extraButtons: customControls.length > 0 ? ['|', ...customControls] : [],
71
93
  // Disable features we don't want
72
94
  showXPathInStatusbar: false,
73
95
  showCharsCounter: false,
@@ -129,7 +151,7 @@ export const defineEditor = (element, editorElement, config) => {
129
151
  // Find all buttons within the toolbar, excluding disabled ones
130
152
  const buttons = Array.from(toolbarEl.querySelectorAll('button:not([disabled])'));
131
153
  // Filter out buttons that are not visible or are in popups/dropdowns
132
- return buttons.filter(button => {
154
+ return buttons.filter((button) => {
133
155
  const isVisible = button.offsetParent !== null;
134
156
  const isInToolbar = toolbarEl.contains(button);
135
157
  // Exclude buttons in popups or dropdowns (they have their own navigation)
@@ -207,7 +229,7 @@ export const defineEditor = (element, editorElement, config) => {
207
229
  * Without aria-hidden, VoiceOver announces them as images.
208
230
  */
209
231
  const hideToolbarSvgsFromScreenReaders = () => {
210
- toolbarElement.querySelectorAll('svg').forEach(svg => {
232
+ toolbarElement.querySelectorAll('svg').forEach((svg) => {
211
233
  svg.setAttribute('aria-hidden', 'true');
212
234
  });
213
235
  };
@@ -310,6 +332,10 @@ export const defineEditor = (element, editorElement, config) => {
310
332
  joditInstance.events.on('change', handleTextChange);
311
333
  joditInstance.events.on('focus', handleFocus);
312
334
  joditInstance.events.on('blur', handleBlur);
335
+ // Notify selection changes so consumers can react (e.g. enable/disable custom AI actions)
336
+ if (handleSelectionChange !== undefined) {
337
+ joditInstance.events.on('changeSelection', handleSelectionChange);
338
+ }
313
339
  // Return the Jodit instance directly
314
340
  return joditInstance;
315
341
  };