@mgdis/mg-components 6.19.0 → 6.21.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 (164) hide show
  1. package/dist/cjs/{index-Bp6wZzau.js → index-C2viYwrR.js} +1757 -80
  2. package/dist/cjs/{index-TUElr4Wv.js → index-CCsGMNyq.js} +46 -0
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/mg-action-more_37.cjs.entry.js +735 -337
  5. package/dist/cjs/mg-alert.cjs.entry.js +17 -9
  6. package/dist/cjs/mg-components.cjs.js +3 -3
  7. package/dist/cjs/mg-fieldset.cjs.entry.js +24 -7
  8. package/dist/cjs/mg-input-combobox.cjs.entry.js +63 -29
  9. package/dist/cjs/mg-input-file.cjs.entry.js +384 -0
  10. package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +30 -18
  11. package/dist/cjs/{mg-input.conf-D7jmj_lh.js → mg-input.conf-BNpeATnq.js} +7 -0
  12. package/dist/cjs/mg-loader.cjs.entry.js +8 -6
  13. package/dist/cjs/mg-progress.cjs.entry.js +19 -9
  14. package/dist/collection/collection-manifest.json +3 -2
  15. package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
  16. package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +6 -0
  17. package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +1 -1
  18. package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +15 -11
  19. package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +877 -0
  20. package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +1 -1
  21. package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +1 -1
  22. package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
  23. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +12 -12
  24. package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +1 -1
  25. package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +2 -2
  26. package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +1 -1
  27. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +72 -84
  28. package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
  29. package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
  30. package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
  31. package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +12 -3
  32. package/dist/collection/components/molecules/mg-form/mg-form.js +12 -2
  33. package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
  34. package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
  35. package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
  36. package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
  37. package/dist/collection/components/molecules/mg-panel/mg-panel.js +1 -1
  38. package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
  39. package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
  40. package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
  41. package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
  42. package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
  43. package/dist/collection/locales/en/messages.json +11 -0
  44. package/dist/collection/locales/fr/messages.json +11 -0
  45. package/dist/components/events.utils.js +1 -23
  46. package/dist/components/index.d.ts +2 -0
  47. package/dist/components/index.js +1 -1
  48. package/dist/components/index2.js +1 -408
  49. package/dist/components/index3.js +1 -476
  50. package/dist/components/mg-action-more.js +1 -254
  51. package/dist/components/mg-alert.js +1 -224
  52. package/dist/components/mg-badge.js +1 -6
  53. package/dist/components/mg-badge2.js +1 -113
  54. package/dist/components/mg-button.js +1 -6
  55. package/dist/components/mg-button2.js +1 -275
  56. package/dist/components/mg-card.js +1 -6
  57. package/dist/components/mg-card2.js +1 -92
  58. package/dist/components/mg-character-left.js +1 -6
  59. package/dist/components/mg-character-left2.js +1 -75
  60. package/dist/components/mg-details.js +1 -104
  61. package/dist/components/mg-divider.js +1 -6
  62. package/dist/components/mg-divider2.js +1 -49
  63. package/dist/components/mg-fieldset.js +1 -209
  64. package/dist/components/mg-form.js +1 -302
  65. package/dist/components/mg-icon.js +1 -6
  66. package/dist/components/mg-icon2.js +1 -188
  67. package/dist/components/mg-illustrated-message.js +1 -129
  68. package/dist/components/mg-input-checkbox-paginated.js +1 -6
  69. package/dist/components/mg-input-checkbox-paginated2.js +1 -135
  70. package/dist/components/mg-input-checkbox.js +1 -762
  71. package/dist/components/mg-input-combobox.js +1 -936
  72. package/dist/components/mg-input-date.js +1 -463
  73. package/dist/components/mg-input-file.d.ts +11 -0
  74. package/dist/components/mg-input-file.js +1 -0
  75. package/dist/components/mg-input-numeric.js +1 -592
  76. package/dist/components/mg-input-password.js +1 -360
  77. package/dist/components/mg-input-radio.js +1 -392
  78. package/dist/components/mg-input-rich-text-editor.js +1 -16797
  79. package/dist/components/mg-input-select.js +1 -6
  80. package/dist/components/mg-input-select2.js +1 -481
  81. package/dist/components/mg-input-text.js +1 -6
  82. package/dist/components/mg-input-text2.js +1 -514
  83. package/dist/components/mg-input-textarea.js +1 -412
  84. package/dist/components/mg-input-title.js +1 -6
  85. package/dist/components/mg-input-title2.js +1 -81
  86. package/dist/components/mg-input-toggle.js +1 -386
  87. package/dist/components/mg-input.conf.js +1 -0
  88. package/dist/components/mg-input.js +1 -6
  89. package/dist/components/mg-input2.js +1 -459
  90. package/dist/components/mg-item-more.js +1 -6
  91. package/dist/components/mg-item-more2.js +1 -505
  92. package/dist/components/mg-loader.js +1 -6
  93. package/dist/components/mg-loader2.js +1 -74
  94. package/dist/components/mg-menu-item.js +1 -6
  95. package/dist/components/mg-menu-item2.js +1 -485
  96. package/dist/components/mg-menu.js +1 -6
  97. package/dist/components/mg-message.js +1 -6
  98. package/dist/components/mg-message2.js +1 -146
  99. package/dist/components/mg-modal.js +1 -184
  100. package/dist/components/mg-pagination.js +1 -234
  101. package/dist/components/mg-panel.js +1 -350
  102. package/dist/components/mg-popover-content.js +1 -6
  103. package/dist/components/mg-popover-content2.js +1 -96
  104. package/dist/components/mg-popover.js +1 -6
  105. package/dist/components/mg-popover2.js +1 -312
  106. package/dist/components/mg-progress.js +1 -123
  107. package/dist/components/mg-skip-links.js +1 -78
  108. package/dist/components/mg-table.js +1 -319
  109. package/dist/components/mg-tabs.js +1 -6
  110. package/dist/components/mg-tabs2.js +1 -315
  111. package/dist/components/mg-tag.js +1 -133
  112. package/dist/components/mg-tooltip-content.js +1 -6
  113. package/dist/components/mg-tooltip-content2.js +1 -42
  114. package/dist/components/mg-tooltip.js +1 -6
  115. package/dist/components/mg-tooltip2.js +1 -421
  116. package/dist/components/popper.js +1 -1790
  117. package/dist/esm/{index-CNX6lq0x.js → index-D-uaxCxH.js} +46 -1
  118. package/dist/esm/{index-BluNKQ3L.js → index-DFwaH2hS.js} +1757 -80
  119. package/dist/esm/loader.js +3 -3
  120. package/dist/esm/mg-action-more_37.entry.js +735 -337
  121. package/dist/esm/mg-alert.entry.js +17 -9
  122. package/dist/esm/mg-components.js +4 -4
  123. package/dist/esm/mg-fieldset.entry.js +24 -7
  124. package/dist/esm/mg-input-combobox.entry.js +63 -29
  125. package/dist/esm/mg-input-file.entry.js +382 -0
  126. package/dist/esm/mg-input-rich-text-editor.entry.js +30 -18
  127. package/dist/esm/{mg-input.conf-DDnrE1hD.js → mg-input.conf-C9rmNQIL.js} +7 -1
  128. package/dist/esm/mg-loader.entry.js +8 -6
  129. package/dist/esm/mg-progress.entry.js +19 -9
  130. package/dist/mg-components/locales/en/messages.json +11 -0
  131. package/dist/mg-components/locales/fr/messages.json +11 -0
  132. package/dist/mg-components/mg-components.esm.js +1 -1
  133. package/dist/mg-components/{p-d5a276eb.entry.js → p-08fa327b.entry.js} +1 -1
  134. package/dist/mg-components/p-4175dcbe.entry.js +1 -0
  135. package/dist/mg-components/p-6b57f249.entry.js +1 -0
  136. package/dist/mg-components/p-6b655830.entry.js +1 -0
  137. package/dist/mg-components/p-988c282e.entry.js +1 -0
  138. package/dist/mg-components/p-C9rmNQIL.js +1 -0
  139. package/dist/mg-components/p-D-uaxCxH.js +1 -0
  140. package/dist/mg-components/p-DFwaH2hS.js +2 -0
  141. package/dist/mg-components/p-a79b1f19.entry.js +1 -0
  142. package/dist/mg-components/{p-916dfb6d.entry.js → p-c3d116b9.entry.js} +1 -1
  143. package/dist/mg-components/p-dd1934f4.entry.js +1 -0
  144. package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +7 -1
  145. package/dist/types/components/molecules/inputs/mg-input-file/mg-input-file.d.ts +210 -0
  146. package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +4 -4
  147. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +13 -16
  148. package/dist/types/components.d.ts +217 -18
  149. package/dist/types/stencil-public-runtime.d.ts +76 -12
  150. package/ide/intellij/web-types.json +373 -26
  151. package/ide/vscode/css-custom-data.json +12 -0
  152. package/ide/vscode/html-custom-data.json +341 -79
  153. package/package.json +22 -22
  154. package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.scss +0 -1
  155. package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.js +0 -1
  156. package/dist/mg-components/p-016bd291.entry.js +0 -1
  157. package/dist/mg-components/p-186a6139.entry.js +0 -1
  158. package/dist/mg-components/p-66a1cb83.entry.js +0 -1
  159. package/dist/mg-components/p-6efd819f.entry.js +0 -1
  160. package/dist/mg-components/p-BluNKQ3L.js +0 -2
  161. package/dist/mg-components/p-CNX6lq0x.js +0 -1
  162. package/dist/mg-components/p-DDnrE1hD.js +0 -1
  163. package/dist/mg-components/p-d2c72f09.entry.js +0 -1
  164. package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf.d.ts +0 -8
@@ -15,7 +15,7 @@ import { AriaRoleType, RequiredMessageStatusType } from "./components/molecules/
15
15
  import { IconSizeType, IconType, IconVariantStyleType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
16
16
  import { IllustratedMessageDirectionType, IllustratedMessageSizeType } from "./components/molecules/mg-illustrated-message/mg-illustrated-message.conf";
17
17
  import { CheckboxItem, CheckboxType, CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
18
- import { Direction, Option } from "./types";
18
+ import { Direction, Option, Option as ToggleOption } from "./types";
19
19
  import { RequestMappingType, ResponseMappingType } from "./components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf";
20
20
  import { Format, NumericType } from "./components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf";
21
21
  import { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
@@ -23,7 +23,6 @@ import { EditorOptionsType } from "./components/molecules/inputs/mg-input-rich-t
23
23
  import { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
24
24
  import { OptionType, TextType } from "./components/molecules/inputs/mg-input-text/mg-input-text.conf";
25
25
  import { IconType as IconType1 } from "./components";
26
- import { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
27
26
  import { IconType as IconType2, SizeType as SizeType1, SlotLabelType } from "./components/molecules/internals/mg-item-more/mg-item-more.conf";
28
27
  import { ItemMoreType, MenuSizeType } from "./components/molecules/menus/mg-menu/mg-menu.conf";
29
28
  import { MgMenuStatusType, TargetType } from "./components/molecules/menus/mg-menu-item/mg-menu-item.conf";
@@ -47,7 +46,7 @@ export { AriaRoleType, RequiredMessageStatusType } from "./components/molecules/
47
46
  export { IconSizeType, IconType, IconVariantStyleType, IconVariantType } from "./components/atoms/mg-icon/mg-icon.conf";
48
47
  export { IllustratedMessageDirectionType, IllustratedMessageSizeType } from "./components/molecules/mg-illustrated-message/mg-illustrated-message.conf";
49
48
  export { CheckboxItem, CheckboxType, CheckboxValue } from "./components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf";
50
- export { Direction, Option } from "./types";
49
+ export { Direction, Option, Option as ToggleOption } from "./types";
51
50
  export { RequestMappingType, ResponseMappingType } from "./components/molecules/inputs/mg-input-combobox/mg-input-combobox.conf";
52
51
  export { Format, NumericType } from "./components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf";
53
52
  export { RadioOption } from "./components/molecules/inputs/mg-input-radio/mg-input-radio.conf";
@@ -55,7 +54,6 @@ export { EditorOptionsType } from "./components/molecules/inputs/mg-input-rich-t
55
54
  export { SelectOption } from "./components/molecules/inputs/mg-input-select/mg-input-select.conf";
56
55
  export { OptionType, TextType } from "./components/molecules/inputs/mg-input-text/mg-input-text.conf";
57
56
  export { IconType as IconType1 } from "./components";
58
- export { ToggleValue } from "./components/molecules/inputs/mg-input-toggle/mg-input-toggle.conf";
59
57
  export { IconType as IconType2, SizeType as SizeType1, SlotLabelType } from "./components/molecules/internals/mg-item-more/mg-item-more.conf";
60
58
  export { ItemMoreType, MenuSizeType } from "./components/molecules/menus/mg-menu/mg-menu.conf";
61
59
  export { MgMenuStatusType, TargetType } from "./components/molecules/menus/mg-menu-item/mg-menu-item.conf";
@@ -783,6 +781,102 @@ export namespace Components {
783
781
  */
784
782
  "value": string;
785
783
  }
784
+ interface MgInputFile {
785
+ /**
786
+ * Define file accept format The accept property is an attribute of the file `<input>` type that defines the file types the file input should accept (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept).
787
+ */
788
+ "accept"?: string;
789
+ /**
790
+ * Define input capture attribute The capture attribute is a Boolean attribute that specifies if the device's camera or microphone should be used to capture media directly, instead of choosing an existing file. (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#capture).
791
+ */
792
+ "capture"?: 'user' | 'environment' | '';
793
+ /**
794
+ * Define if input is disabled
795
+ * @default false
796
+ */
797
+ "disabled": boolean;
798
+ /**
799
+ * Display input error if it exists.
800
+ */
801
+ "displayError": () => Promise<void>;
802
+ /**
803
+ * Add a help text under the input, usually expected data format and example
804
+ */
805
+ "helpText"?: string;
806
+ /**
807
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
808
+ */
809
+ "identifier": string;
810
+ /**
811
+ * Define input invalid state
812
+ */
813
+ "invalid": boolean;
814
+ /**
815
+ * Input label
816
+ */
817
+ "label": string;
818
+ /**
819
+ * Define if label is visible
820
+ * @default false
821
+ */
822
+ "labelHide": boolean;
823
+ /**
824
+ * Define if label is displayed on top
825
+ * @default false
826
+ */
827
+ "labelOnTop": boolean;
828
+ /**
829
+ * Define max file size (in octets)
830
+ */
831
+ "maxSize"?: number;
832
+ /**
833
+ * Define multiple files When the multiple Boolean attribute is specified, the file input allows the user to select more than one file. (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple).
834
+ * @default false
835
+ */
836
+ "multiple": boolean;
837
+ /**
838
+ * Input name If not set the value equals the identifier
839
+ * @default this.identifier
840
+ */
841
+ "name": string;
842
+ /**
843
+ * Define if input is required
844
+ * @default false
845
+ */
846
+ "required": boolean;
847
+ /**
848
+ * Reset value, validity and error state
849
+ */
850
+ "reset": () => Promise<void>;
851
+ /**
852
+ * Set an error and display a custom error message. This method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter. It must be paired with an error message to display for the given context. When used to set validity to `false`, you should use this method again to reset the validity to `true`.
853
+ * @param valid - value indicating the validity
854
+ * @param errorMessage - the error message to display
855
+ * @param errorMessageLock - lock the error message and validity state
856
+ */
857
+ "setError": (valid: MgInputFile["valid"], errorMessage?: string, errorMessageLock?: boolean) => Promise<void>;
858
+ /**
859
+ * Set focus on input add file button
860
+ */
861
+ "setFocus": () => Promise<void>;
862
+ /**
863
+ * Add a tooltip message next to the input
864
+ */
865
+ "tooltip"?: string;
866
+ /**
867
+ * Define tooltip position
868
+ * @default 'input'
869
+ */
870
+ "tooltipPosition": TooltipPosition;
871
+ /**
872
+ * Define input valid state
873
+ */
874
+ "valid": boolean;
875
+ /**
876
+ * Component value
877
+ */
878
+ "value": any;
879
+ }
786
880
  interface MgInputNumeric {
787
881
  /**
788
882
  * Define currency
@@ -1118,15 +1212,15 @@ export namespace Components {
1118
1212
  */
1119
1213
  "displayError": () => Promise<void>;
1120
1214
  /**
1121
- * Get editor content as HTML
1215
+ * Get editor content in HTML format
1122
1216
  * @returns HTML content of the editor
1123
1217
  */
1124
- "getHTML": () => Promise<string>;
1218
+ "getEditorHTML": () => Promise<string>;
1125
1219
  /**
1126
- * Get editor content as plain text
1220
+ * Get editor content in plain text format
1127
1221
  * @returns Plain text content of the editor
1128
1222
  */
1129
- "getText": () => Promise<string>;
1223
+ "getEditorText": () => Promise<string>;
1130
1224
  /**
1131
1225
  * Add a help text under the input, usually expected data format and example
1132
1226
  */
@@ -1615,7 +1709,7 @@ export namespace Components {
1615
1709
  /**
1616
1710
  * Items are the possible options to select
1617
1711
  */
1618
- "items": string[] | ToggleValue[];
1712
+ "items": string[] | ToggleOption[];
1619
1713
  /**
1620
1714
  * Input label
1621
1715
  */
@@ -1666,7 +1760,7 @@ export namespace Components {
1666
1760
  /**
1667
1761
  * Component value
1668
1762
  */
1669
- "value": any;
1763
+ "value": ToggleOption['value'];
1670
1764
  }
1671
1765
  interface MgItemMore {
1672
1766
  /**
@@ -2051,6 +2145,10 @@ export interface MgInputDateCustomEvent<T> extends CustomEvent<T> {
2051
2145
  detail: T;
2052
2146
  target: HTMLMgInputDateElement;
2053
2147
  }
2148
+ export interface MgInputFileCustomEvent<T> extends CustomEvent<T> {
2149
+ detail: T;
2150
+ target: HTMLMgInputFileElement;
2151
+ }
2054
2152
  export interface MgInputNumericCustomEvent<T> extends CustomEvent<T> {
2055
2153
  detail: T;
2056
2154
  target: HTMLMgInputNumericElement;
@@ -2308,6 +2406,24 @@ declare global {
2308
2406
  prototype: HTMLMgInputDateElement;
2309
2407
  new (): HTMLMgInputDateElement;
2310
2408
  };
2409
+ interface HTMLMgInputFileElementEventMap {
2410
+ "value-change": HTMLMgInputFileElement['value'];
2411
+ "input-valid": HTMLMgInputFileElement['valid'];
2412
+ }
2413
+ interface HTMLMgInputFileElement extends Components.MgInputFile, HTMLStencilElement {
2414
+ addEventListener<K extends keyof HTMLMgInputFileElementEventMap>(type: K, listener: (this: HTMLMgInputFileElement, ev: MgInputFileCustomEvent<HTMLMgInputFileElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2415
+ addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2416
+ addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2417
+ addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
2418
+ removeEventListener<K extends keyof HTMLMgInputFileElementEventMap>(type: K, listener: (this: HTMLMgInputFileElement, ev: MgInputFileCustomEvent<HTMLMgInputFileElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
2419
+ removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2420
+ removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
2421
+ removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
2422
+ }
2423
+ var HTMLMgInputFileElement: {
2424
+ prototype: HTMLMgInputFileElement;
2425
+ new (): HTMLMgInputFileElement;
2426
+ };
2311
2427
  interface HTMLMgInputNumericElementEventMap {
2312
2428
  "value-change": number;
2313
2429
  "input-valid": HTMLMgInputNumericElement['valid'];
@@ -2366,12 +2482,7 @@ declare global {
2366
2482
  "input-valid": boolean;
2367
2483
  "value-change": string;
2368
2484
  }
2369
- interface HTMLMgInputRichTextEditorElement extends Omit<Components.MgInputRichTextEditor, "getHTML">, HTMLStencilElement {
2370
- /**
2371
- * Get editor content as HTML
2372
- * @returns HTML content of the editor
2373
- */
2374
- "getHTML": () => Promise<string>;
2485
+ interface HTMLMgInputRichTextEditorElement extends Components.MgInputRichTextEditor, HTMLStencilElement {
2375
2486
  addEventListener<K extends keyof HTMLMgInputRichTextEditorElementEventMap>(type: K, listener: (this: HTMLMgInputRichTextEditorElement, ev: MgInputRichTextEditorCustomEvent<HTMLMgInputRichTextEditorElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
2376
2487
  addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
2377
2488
  addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
@@ -2676,6 +2787,7 @@ declare global {
2676
2787
  "mg-input-checkbox-paginated": HTMLMgInputCheckboxPaginatedElement;
2677
2788
  "mg-input-combobox": HTMLMgInputComboboxElement;
2678
2789
  "mg-input-date": HTMLMgInputDateElement;
2790
+ "mg-input-file": HTMLMgInputFileElement;
2679
2791
  "mg-input-numeric": HTMLMgInputNumericElement;
2680
2792
  "mg-input-password": HTMLMgInputPasswordElement;
2681
2793
  "mg-input-radio": HTMLMgInputRadioElement;
@@ -3408,6 +3520,91 @@ declare namespace LocalJSX {
3408
3520
  */
3409
3521
  "value"?: string;
3410
3522
  }
3523
+ interface MgInputFile {
3524
+ /**
3525
+ * Define file accept format The accept property is an attribute of the file `<input>` type that defines the file types the file input should accept (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#accept).
3526
+ */
3527
+ "accept"?: string;
3528
+ /**
3529
+ * Define input capture attribute The capture attribute is a Boolean attribute that specifies if the device's camera or microphone should be used to capture media directly, instead of choosing an existing file. (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#capture).
3530
+ */
3531
+ "capture"?: 'user' | 'environment' | '';
3532
+ /**
3533
+ * Define if input is disabled
3534
+ * @default false
3535
+ */
3536
+ "disabled"?: boolean;
3537
+ /**
3538
+ * Add a help text under the input, usually expected data format and example
3539
+ */
3540
+ "helpText"?: string;
3541
+ /**
3542
+ * Identifier is used for the element ID (id is a reserved prop in Stencil.js)
3543
+ */
3544
+ "identifier": string;
3545
+ /**
3546
+ * Define input invalid state
3547
+ */
3548
+ "invalid"?: boolean;
3549
+ /**
3550
+ * Input label
3551
+ */
3552
+ "label": string;
3553
+ /**
3554
+ * Define if label is visible
3555
+ * @default false
3556
+ */
3557
+ "labelHide"?: boolean;
3558
+ /**
3559
+ * Define if label is displayed on top
3560
+ * @default false
3561
+ */
3562
+ "labelOnTop"?: boolean;
3563
+ /**
3564
+ * Define max file size (in octets)
3565
+ */
3566
+ "maxSize"?: number;
3567
+ /**
3568
+ * Define multiple files When the multiple Boolean attribute is specified, the file input allows the user to select more than one file. (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#multiple).
3569
+ * @default false
3570
+ */
3571
+ "multiple"?: boolean;
3572
+ /**
3573
+ * Input name If not set the value equals the identifier
3574
+ * @default this.identifier
3575
+ */
3576
+ "name"?: string;
3577
+ /**
3578
+ * Emitted event when checking validity
3579
+ */
3580
+ "onInput-valid"?: (event: MgInputFileCustomEvent<HTMLMgInputFileElement['valid']>) => void;
3581
+ /**
3582
+ * Emitted event when value change
3583
+ */
3584
+ "onValue-change"?: (event: MgInputFileCustomEvent<HTMLMgInputFileElement['value']>) => void;
3585
+ /**
3586
+ * Define if input is required
3587
+ * @default false
3588
+ */
3589
+ "required"?: boolean;
3590
+ /**
3591
+ * Add a tooltip message next to the input
3592
+ */
3593
+ "tooltip"?: string;
3594
+ /**
3595
+ * Define tooltip position
3596
+ * @default 'input'
3597
+ */
3598
+ "tooltipPosition"?: TooltipPosition;
3599
+ /**
3600
+ * Define input valid state
3601
+ */
3602
+ "valid"?: boolean;
3603
+ /**
3604
+ * Component value
3605
+ */
3606
+ "value"?: any;
3607
+ }
3411
3608
  interface MgInputNumeric {
3412
3609
  /**
3413
3610
  * Define currency
@@ -4153,7 +4350,7 @@ declare namespace LocalJSX {
4153
4350
  /**
4154
4351
  * Items are the possible options to select
4155
4352
  */
4156
- "items": string[] | ToggleValue[];
4353
+ "items": string[] | ToggleOption[];
4157
4354
  /**
4158
4355
  * Input label
4159
4356
  */
@@ -4198,7 +4395,7 @@ declare namespace LocalJSX {
4198
4395
  /**
4199
4396
  * Component value
4200
4397
  */
4201
- "value"?: any;
4398
+ "value"?: ToggleOption['value'];
4202
4399
  }
4203
4400
  interface MgItemMore {
4204
4401
  /**
@@ -4624,6 +4821,7 @@ declare namespace LocalJSX {
4624
4821
  "mg-input-checkbox-paginated": MgInputCheckboxPaginated;
4625
4822
  "mg-input-combobox": MgInputCombobox;
4626
4823
  "mg-input-date": MgInputDate;
4824
+ "mg-input-file": MgInputFile;
4627
4825
  "mg-input-numeric": MgInputNumeric;
4628
4826
  "mg-input-password": MgInputPassword;
4629
4827
  "mg-input-radio": MgInputRadio;
@@ -4676,6 +4874,7 @@ declare module "@stencil/core" {
4676
4874
  "mg-input-checkbox-paginated": LocalJSX.MgInputCheckboxPaginated & JSXBase.HTMLAttributes<HTMLMgInputCheckboxPaginatedElement>;
4677
4875
  "mg-input-combobox": LocalJSX.MgInputCombobox & JSXBase.HTMLAttributes<HTMLMgInputComboboxElement>;
4678
4876
  "mg-input-date": LocalJSX.MgInputDate & JSXBase.HTMLAttributes<HTMLMgInputDateElement>;
4877
+ "mg-input-file": LocalJSX.MgInputFile & JSXBase.HTMLAttributes<HTMLMgInputFileElement>;
4679
4878
  "mg-input-numeric": LocalJSX.MgInputNumeric & JSXBase.HTMLAttributes<HTMLMgInputNumericElement>;
4680
4879
  "mg-input-password": LocalJSX.MgInputPassword & JSXBase.HTMLAttributes<HTMLMgInputPasswordElement>;
4681
4880
  "mg-input-radio": LocalJSX.MgInputRadio & JSXBase.HTMLAttributes<HTMLMgInputRadioElement>;
@@ -1,5 +1,6 @@
1
1
  type CustomMethodDecorator<T> = (target: object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
2
- type UnionToIntersection<U> = (U extends any ? (x: U) => void : never) extends (x: infer I) => void ? I : never;
2
+ type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
3
+ type MixinInstance<F> = F extends (base: MixedInCtor) => MixedInCtor<infer I> ? I : never;
3
4
  export interface ComponentDecorator {
4
5
  (opts?: ComponentOptions): ClassDecorator;
5
6
  }
@@ -62,6 +63,12 @@ export interface ShadowRootOptions {
62
63
  * focusable part is given focus, and the shadow host is given any available `:focus` styling.
63
64
  */
64
65
  delegatesFocus?: boolean;
66
+ /**
67
+ * Sets the slot assignment mode for the shadow root. When set to `'manual'`, enables imperative
68
+ * slotting using the `HTMLSlotElement.assign()` method. Defaults to `'named'` for standard
69
+ * declarative slotting behavior.
70
+ */
71
+ slotAssignment?: 'manual' | 'named';
65
72
  }
66
73
  export interface ModeStyles {
67
74
  [modeName: string]: string | string[];
@@ -124,6 +131,9 @@ export interface AttachInternalsDecorator {
124
131
  export interface ListenDecorator {
125
132
  (eventName: string, opts?: ListenOptions): CustomMethodDecorator<any>;
126
133
  }
134
+ export interface ResolveVarFunction {
135
+ <T>(variable: T): string;
136
+ }
127
137
  export interface ListenOptions {
128
138
  /**
129
139
  * Handlers can also be registered for an event other than the host itself.
@@ -152,7 +162,9 @@ export interface StateDecorator {
152
162
  (): PropertyDecorator;
153
163
  }
154
164
  export interface WatchDecorator {
155
- (propName: any): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
165
+ (propName: any, watchOptions?: {
166
+ immediate?: boolean;
167
+ }): CustomMethodDecorator<(newValue?: any, oldValue?: any, propName?: any, ...args: any[]) => any | void>;
156
168
  }
157
169
  export interface PropSerializeDecorator {
158
170
  (propName: any): CustomMethodDecorator<(newValue?: any, propName?: string, ...args: any[]) => string | null>;
@@ -207,6 +219,24 @@ export declare const AttachInternals: AttachInternalsDecorator;
207
219
  * https://stenciljs.com/docs/events#listen-decorator
208
220
  */
209
221
  export declare const Listen: ListenDecorator;
222
+ /**
223
+ * The `resolveVar()` function is a compile-time utility that resolves const variables
224
+ * and object properties to their string literal values. This allows variables to be
225
+ * used in `@Listen` and `@Event` decorators instead of hardcoded strings.
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * const MY_EVENT = 'myEvent';
230
+ * @Listen(resolveVar(MY_EVENT))
231
+ * ```
232
+ *
233
+ * @example
234
+ * ```ts
235
+ * const EVENTS = { MY_EVENT: 'myEvent' } as const;
236
+ * @Event({ eventName: resolveVar(EVENTS.MY_EVENT) })
237
+ * ```
238
+ */
239
+ export declare const resolveVar: ResolveVarFunction;
210
240
  /**
211
241
  * The `@Method()` decorator is used to expose methods on the public API.
212
242
  * Class methods decorated with the @Method() decorator can be called directly
@@ -364,18 +394,48 @@ export declare function readTask(task: RafCallback): void;
364
394
  * Unhandled exception raised while rendering, during event handling, or lifecycles will trigger the custom event handler.
365
395
  */
366
396
  export declare const setErrorHandler: (handler: ErrorHandler) => void;
367
- export type MixinFactory = <TBase extends new (...args: any[]) => any>(base: TBase) => abstract new (...args: ConstructorParameters<TBase>) => any;
397
+ export type TagTransformer = (tag: string) => string;
398
+ /**
399
+ * Sets a tag transformer to be used when rendering your custom elements.
400
+ * ```ts
401
+ * setTagTransformer((tag) => {
402
+ * if (tag.startsWith('my-')) return `new-${tag}`
403
+ * return tag;
404
+ * });
405
+ * ```
406
+ * Will mean all your components that start with `my-` are defined instead with `new-my-` prefix.
407
+ *
408
+ * @param transformer the transformer function to use which must return a string.
409
+ */
410
+ export declare function setTagTransformer(transformer: TagTransformer): void;
411
+ /**
412
+ * Transforms a tag name using a transformer set via `setTagTransformer`
413
+ *
414
+ * @param tag - the tag to transform e.g. `my-tag`
415
+ * @returns the transformed tag e.g. `new-my-tag`
416
+ */
417
+ export declare function transformTag(tag: string): string;
418
+ /**
419
+ * @deprecated - Use `MixedInCtor` instead:
420
+ * ```ts
421
+ * import { MixedInCtor } from '@stencil/core';
422
+ *
423
+ * const AFactoryFn = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
424
+ * ```
425
+ */
426
+ export type MixinFactory = (base: MixedInCtor) => MixedInCtor;
427
+ export type MixedInCtor<T = {}> = new (...args: any[]) => T;
368
428
  /**
369
429
  * Compose multiple mixin classes into a single constructor.
370
430
  * The resulting class has the combined instance types of all mixed-in classes.
371
431
  *
372
432
  * Example:
373
- * ```
374
- * import { Mixin, MixinFactory } from '@stencil/core';
433
+ * ```ts
434
+ * import { Mixin, MixedInCtor } from '@stencil/core';
375
435
  *
376
- * const AWrap: MixinFactory = (Base) => {class A extends Base { propA = A }; return A;}
377
- * const BWrap: MixinFactory = (Base) => {class B extends Base { propB = B }; return B;}
378
- * const CWrap: MixinFactory = (Base) => {class C extends Base { propC = C }; return C;}
436
+ * const AWrap = <B extends MixedInCtor>(Base: B) => {class A extends Base { propA = A }; return A;}
437
+ * const BWrap = <B extends MixedInCtor>(Base: B) => {class B extends Base { propB = B }; return B;}
438
+ * const CWrap = <B extends MixedInCtor>(Base: B) => {class C extends Base { propC = C }; return C;}
379
439
  *
380
440
  * class X extends Mixin(AWrap, BWrap, CWrap) {
381
441
  * render() { return <div>{this.propA} {this.propB} {this.propC}</div>; }
@@ -383,9 +443,9 @@ export type MixinFactory = <TBase extends new (...args: any[]) => any>(base: TBa
383
443
  * ```
384
444
  *
385
445
  * @param mixinFactories mixin factory functions that return a class which extends from the provided class.
386
- * @returns a class that that is composed from extending each of the provided classes in the order they were provided.
446
+ * @returns a class that is composed from extending each of the provided classes in the order they were provided.
387
447
  */
388
- export declare function Mixin<TMixins extends readonly MixinFactory[]>(...mixinFactories: TMixins): abstract new (...args: any[]) => UnionToIntersection<InstanceType<ReturnType<TMixins[number]>>>;
448
+ export declare function Mixin<const TMixins extends readonly MixinFactory[]>(...mixinFactories: TMixins): abstract new (...args: any[]) => UnionToIntersection<MixinInstance<TMixins[number]>>;
389
449
  /**
390
450
  * This file gets copied to all distributions of stencil component collections.
391
451
  * - no imports
@@ -643,7 +703,7 @@ declare namespace LocalJSX {
643
703
  export { LocalJSX as JSX };
644
704
  export declare namespace JSXBase {
645
705
  interface IntrinsicElements {
646
- slot: JSXBase.SlotAttributes;
706
+ slot: JSXBase.SlotAttributes<HTMLSlotElement>;
647
707
  a: JSXBase.AnchorHTMLAttributes<HTMLAnchorElement>;
648
708
  abbr: JSXBase.HTMLAttributes;
649
709
  address: JSXBase.HTMLAttributes;
@@ -813,7 +873,7 @@ export declare namespace JSXBase {
813
873
  use: JSXBase.SVGAttributes;
814
874
  view: JSXBase.SVGAttributes;
815
875
  }
816
- interface SlotAttributes extends JSXAttributes {
876
+ interface SlotAttributes<T = HTMLSlotElement> extends JSXAttributes<T> {
817
877
  name?: string;
818
878
  slot?: string;
819
879
  onSlotchange?: (event: Event) => void;
@@ -869,6 +929,9 @@ export declare namespace JSXBase {
869
929
  popoverTargetAction?: string;
870
930
  popoverTargetElement?: Element | null;
871
931
  popoverTarget?: string;
932
+ command?: string;
933
+ commandFor?: string;
934
+ commandfor?: string;
872
935
  }
873
936
  interface CanvasHTMLAttributes<T> extends HTMLAttributes<T> {
874
937
  height?: number | string;
@@ -1737,6 +1800,7 @@ export interface CustomElementsDefineOptions {
1737
1800
  exclude?: string[];
1738
1801
  resourcesUrl?: string;
1739
1802
  syncQueue?: boolean;
1803
+ /** @deprecated in-favour of `setTagTransformer` and `transformTag` */
1740
1804
  transformTagName?: (tagName: string) => string;
1741
1805
  jmp?: (c: Function) => any;
1742
1806
  raf?: (c: FrameRequestCallback) => number;