@mgdis/mg-components 6.23.0 → 6.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-Acmyl4hv.js +5 -0
- package/dist/cjs/{index-BxB20_Vw.js → index-B6J2EllP.js} +3 -1
- package/dist/cjs/{index-BEF-cqV9.js → index-BmFwLEZT.js} +5 -1
- package/dist/cjs/{index-CpENFzEo.js → index-DrZECzp6.js} +14 -6
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +394 -260
- package/dist/cjs/mg-alert.cjs.entry.js +7 -8
- package/dist/cjs/mg-breadcrumb.cjs.entry.js +27 -10
- package/dist/cjs/mg-components.cjs.js +2 -2
- package/dist/cjs/mg-fieldset.cjs.entry.js +8 -8
- package/dist/cjs/mg-illustration.cjs.entry.js +57 -0
- package/dist/cjs/mg-input-combobox.cjs.entry.js +46 -28
- package/dist/cjs/mg-input-file.cjs.entry.js +12 -11
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +3367 -4140
- package/dist/cjs/mg-loader.cjs.entry.js +5 -5
- package/dist/cjs/mg-progress.cjs.entry.js +3 -3
- package/dist/collection/assets/illustrations/index.js +1 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +1 -1
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +4 -1
- package/dist/collection/components/atoms/mg-card/mg-card.js +1 -1
- package/dist/collection/components/atoms/mg-divider/mg-divider.conf.js +4 -0
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +62 -3
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/atoms/mg-illustration/mg-illustration.conf.js +1 -0
- package/dist/collection/components/atoms/mg-illustration/mg-illustration.js +95 -0
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +9 -7
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +49 -19
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +5 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxPaginated.js +5 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +30 -22
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +75 -30
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +14 -8
- package/dist/collection/components/molecules/inputs/mg-input-file/mg-input-file.js +8 -7
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +21 -12
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +7 -7
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +15 -10
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/editor/index.js +29 -3
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +260 -7
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +21 -19
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +18 -13
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +7 -7
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +10 -9
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +1 -1
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +7 -5
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +18 -17
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +7 -4
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +6 -7
- package/dist/collection/components/molecules/mg-breadcrumb/mg-breadcrumb.js +49 -6
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +6 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +16 -13
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +2 -2
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +8 -4
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +2 -2
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +29 -37
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +5 -3
- package/dist/collection/components/molecules/mg-table/mg-table.js +10 -6
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +12 -9
- package/dist/collection/utils/behaviors.utils.js +3 -3
- package/dist/collection/utils/playwright.fixture.js +7 -2
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-badge2.js +1 -1
- package/dist/components/mg-breadcrumb.js +1 -1
- package/dist/components/mg-button2.js +1 -1
- package/dist/components/mg-card2.js +1 -1
- package/dist/components/mg-character-left2.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-divider2.js +1 -1
- package/dist/components/mg-fieldset.js +1 -1
- package/dist/components/mg-form.js +1 -1
- package/dist/components/mg-icon2.js +1 -1
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-illustration.d.ts +11 -0
- package/dist/components/mg-illustration.js +1 -0
- package/dist/components/mg-input-checkbox.js +1 -1
- package/dist/components/mg-input-combobox.js +1 -1
- package/dist/components/mg-input-date.js +1 -1
- package/dist/components/mg-input-file.js +1 -1
- package/dist/components/mg-input-numeric.js +1 -1
- package/dist/components/mg-input-password.js +1 -1
- package/dist/components/mg-input-radio.js +1 -1
- package/dist/components/mg-input-rich-text-editor.js +298 -289
- package/dist/components/mg-input-select2.js +1 -1
- package/dist/components/mg-input-text2.js +1 -1
- package/dist/components/mg-input-textarea.js +1 -1
- package/dist/components/mg-input-title2.js +1 -1
- package/dist/components/mg-input-toggle.js +1 -1
- package/dist/components/mg-input2.js +1 -1
- package/dist/components/mg-item-more2.js +1 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-message2.js +1 -1
- package/dist/components/mg-modal.js +1 -1
- package/dist/components/mg-pagination.js +1 -1
- package/dist/components/mg-panel.js +1 -1
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-table.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/components/mg-tag.js +1 -1
- package/dist/components/mg-tooltip-content2.js +1 -1
- package/dist/components/mg-tooltip2.js +1 -1
- package/dist/custom-elements.json +178 -48
- package/dist/esm/{index-C7xjtdiw.js → index-91BOpzAB.js} +14 -6
- package/dist/esm/{index-DSEloqPn.js → index-BfblyCaJ.js} +3 -1
- package/dist/esm/index-Ci9Hv7DG.js +3 -0
- package/dist/esm/{index-DshvCiTL.js → index-D4bO_UCn.js} +5 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +391 -257
- package/dist/esm/mg-alert.entry.js +7 -8
- package/dist/esm/mg-breadcrumb.entry.js +27 -10
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-fieldset.entry.js +8 -8
- package/dist/esm/mg-illustration.entry.js +55 -0
- package/dist/esm/mg-input-combobox.entry.js +46 -28
- package/dist/esm/mg-input-file.entry.js +12 -11
- package/dist/esm/mg-input-rich-text-editor.entry.js +3352 -4125
- package/dist/esm/mg-loader.entry.js +5 -5
- package/dist/esm/mg-progress.entry.js +3 -3
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-cdb01923.entry.js → p-3ad7441c.entry.js} +1 -1
- package/dist/mg-components/p-413b4536.entry.js +1 -0
- package/dist/mg-components/p-4693077a.entry.js +1 -0
- package/dist/mg-components/p-5dff879a.entry.js +1 -0
- package/dist/mg-components/{p-236bb1d2.entry.js → p-96fc508e.entry.js} +1 -1
- package/dist/mg-components/p-Ci9Hv7DG.js +1 -0
- package/dist/mg-components/p-D4bO_UCn.js +2 -0
- package/dist/mg-components/{p-d0b6d8f5.entry.js → p-ad533d08.entry.js} +1 -1
- package/dist/mg-components/p-b20f3698.entry.js +1 -0
- package/dist/mg-components/p-d0d12800.entry.js +1 -0
- package/dist/mg-components/p-ec4bd337.entry.js +1667 -0
- package/dist/mg-components/p-f8e58181.entry.js +1 -0
- package/dist/types/assets/illustrations/index.d.ts +21 -0
- package/dist/types/components/atoms/mg-divider/mg-divider.conf.d.ts +9 -0
- package/dist/types/components/atoms/mg-divider/mg-divider.d.ts +13 -0
- package/dist/types/components/atoms/mg-illustration/mg-illustration.conf.d.ts +5 -0
- package/dist/types/components/atoms/mg-illustration/mg-illustration.d.ts +24 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +18 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +10 -5
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.conf.d.ts +25 -0
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +61 -2
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +2 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +2 -2
- package/dist/types/components/molecules/menus/mg-menu-item/mg-menu-item.d.ts +2 -2
- package/dist/types/components/molecules/mg-alert/mg-alert.d.ts +2 -2
- package/dist/types/components/molecules/mg-breadcrumb/mg-breadcrumb.d.ts +11 -0
- package/dist/types/components/molecules/mg-popover/mg-popover-content/mg-popover-content.d.ts +1 -1
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +3 -3
- package/dist/types/components/molecules/mg-skip-links/mg-skip-links.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -1
- package/dist/types/components.d.ts +145 -40
- package/ide/intellij/web-types.json +134 -64
- package/ide/vscode/css-custom-data.json +6 -2
- package/ide/vscode/html-custom-data.json +190 -32
- package/package.json +22 -22
- package/dist/mg-components/p-13feb37a.entry.js +0 -1
- package/dist/mg-components/p-79265ad3.entry.js +0 -1
- package/dist/mg-components/p-7c63e469.entry.js +0 -1
- package/dist/mg-components/p-7fd3e519.entry.js +0 -1
- package/dist/mg-components/p-DshvCiTL.js +0 -2
- package/dist/mg-components/p-a0e2c886.entry.js +0 -1
- package/dist/mg-components/p-d698fa67.entry.js +0 -1658
- /package/dist/mg-components/{p-C7xjtdiw.js → p-91BOpzAB.js} +0 -0
- /package/dist/mg-components/{p-DSEloqPn.js → p-BfblyCaJ.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,a}from"./p-D4bO_UCn.js";import{i}from"./p-BfblyCaJ.js";import{i as r,t as s}from"./p-91BOpzAB.js";const o=class{constructor(t){e(this,t),this.messageHide=!1}watchMessage(e){if(e&&!r(e))throw new Error(`<mg-loader> prop "message" must be a valid string. Passed value: ${s(e)}.`)}componentWillLoad(){this.messages=i(this.element).messages,this.watchMessage(this.message)}render(){return t("div",{key:"a2e3880baccec9691a9fd6abbdb9e01d452136aa",class:"mg-c-loader","aria-live":"polite"},t("mg-icon",{key:"044153b87e799f1f51cb3c9c6236bf6b8b328cf5",icon:"loader",spin:!0}),t("span",{key:"5e4293bd33bd2a51b7557ebf26037991e4fc853e",class:{"mg-u-visually-hidden":this.messageHide}},this.message||this.messages.loader.inProgress))}get element(){return a(this)}static get watchers(){return{message:[{watchMessage:0}]}}};o.style=".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip-path:inset(50%) !important;white-space:nowrap !important}.mg-u-visually-hidden *{overflow:hidden !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--mg-b-size-4);text-align:center}";export{o as mg_loader}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const illustrations: {
|
|
2
|
+
aides: string;
|
|
3
|
+
'all-done': string;
|
|
4
|
+
'convention-empty': string;
|
|
5
|
+
conviviale: string;
|
|
6
|
+
'digital-forms': string;
|
|
7
|
+
'digital-security': string;
|
|
8
|
+
disconnected: string;
|
|
9
|
+
documents: string;
|
|
10
|
+
echanges: string;
|
|
11
|
+
empty: string;
|
|
12
|
+
'missing-informations': string;
|
|
13
|
+
neutral: string;
|
|
14
|
+
'no-data': string;
|
|
15
|
+
'no-result': string;
|
|
16
|
+
'request-sent': string;
|
|
17
|
+
'search-no-result': string;
|
|
18
|
+
'secure-data': string;
|
|
19
|
+
stage: string;
|
|
20
|
+
welcome: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Direction } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* List of all possibles directions
|
|
4
|
+
*/
|
|
5
|
+
export declare const directions: readonly ["horizontal", "vertical"];
|
|
6
|
+
/**
|
|
7
|
+
* Divider direction type
|
|
8
|
+
*/
|
|
9
|
+
export type DividerDirectionType = Direction & (typeof directions)[number];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type DividerDirectionType } from './mg-divider.conf';
|
|
1
2
|
export declare class MgDivider {
|
|
2
3
|
/**************
|
|
3
4
|
* Decorators *
|
|
@@ -6,6 +7,18 @@ export declare class MgDivider {
|
|
|
6
7
|
* Define component size
|
|
7
8
|
*/
|
|
8
9
|
fullWidth: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Define component direction
|
|
12
|
+
*/
|
|
13
|
+
direction: DividerDirectionType;
|
|
14
|
+
validateDirection(newValue: DividerDirectionType | ''): void;
|
|
15
|
+
/*************
|
|
16
|
+
* Lifecycle *
|
|
17
|
+
*************/
|
|
18
|
+
/**
|
|
19
|
+
* Check if component props are well configured on init
|
|
20
|
+
*/
|
|
21
|
+
componentWillLoad(): void;
|
|
9
22
|
/**
|
|
10
23
|
* Render
|
|
11
24
|
* @returns HTML Element
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type IllustrationType } from './mg-illustration.conf';
|
|
2
|
+
/**
|
|
3
|
+
* @part illustration - The inlined illustration SVG. Recolor its brand accent through the `--mg-b-color-app` custom property.
|
|
4
|
+
*/
|
|
5
|
+
export declare class MgIllustration {
|
|
6
|
+
/**
|
|
7
|
+
* Illustration HTML Element
|
|
8
|
+
*/
|
|
9
|
+
element: HTMLMgIllustrationElement;
|
|
10
|
+
/**
|
|
11
|
+
* Illustration to display, by name from @mgdis/img.
|
|
12
|
+
*/
|
|
13
|
+
illustration: IllustrationType;
|
|
14
|
+
validateIllustration(newValue: MgIllustration['illustration']): void;
|
|
15
|
+
/**
|
|
16
|
+
* Render illustration in shadowroot
|
|
17
|
+
* @param illustration - illustration to render
|
|
18
|
+
*/
|
|
19
|
+
private renderIllustration;
|
|
20
|
+
/**
|
|
21
|
+
* Check if props are well configured on init
|
|
22
|
+
*/
|
|
23
|
+
componentWillLoad(): void;
|
|
24
|
+
}
|
|
@@ -11,6 +11,7 @@ export declare class MgInput {
|
|
|
11
11
|
private readonly slotLabel;
|
|
12
12
|
private readonly slotError;
|
|
13
13
|
private readonly slotHelpText;
|
|
14
|
+
private readonly blockLevelContentRegExp;
|
|
14
15
|
private errorMessageSlotElement;
|
|
15
16
|
private helptextMessageSlotElement;
|
|
16
17
|
private readonly classInput;
|
|
@@ -127,6 +128,23 @@ export declare class MgInput {
|
|
|
127
128
|
* Render input label
|
|
128
129
|
*/
|
|
129
130
|
private renderLabel;
|
|
131
|
+
/**
|
|
132
|
+
* Get the semantic tag name for a slotted message.
|
|
133
|
+
* Phrasing (textual/inline) content uses <p> (RGAA 8.9); block-level content falls back to
|
|
134
|
+
* <div> to avoid invalid nesting such as <p><p>…</p></p> (RGAA 8.2).
|
|
135
|
+
* @param content - the HTML content that will be injected in the slot
|
|
136
|
+
* @returns the tag name to use
|
|
137
|
+
*/
|
|
138
|
+
private getSlotMessageTagName;
|
|
139
|
+
/**
|
|
140
|
+
* Get the existing slotted element or (re)create it with the expected tag.
|
|
141
|
+
* The element is recreated when its current tag no longer matches the expected one
|
|
142
|
+
* (e.g. the content switched from text to block HTML), keeping the slot id and position.
|
|
143
|
+
* @param slot - the slot name
|
|
144
|
+
* @param tagName - the expected tag name
|
|
145
|
+
* @returns the slotted element
|
|
146
|
+
*/
|
|
147
|
+
private getSlotMessageElement;
|
|
130
148
|
/**
|
|
131
149
|
* Render error message
|
|
132
150
|
*/
|
|
@@ -167,7 +167,7 @@ export declare class MgInputCheckbox implements Omit<IMgInputCheckboxListProps,
|
|
|
167
167
|
*/
|
|
168
168
|
valueChange: EventEmitter<HTMLMgInputCheckboxElement['value']>;
|
|
169
169
|
/**
|
|
170
|
-
*
|
|
170
|
+
* Emitted event when checking validity
|
|
171
171
|
*/
|
|
172
172
|
inputValid: EventEmitter<HTMLMgInputCheckboxElement['valid']>;
|
|
173
173
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter } from '../../../../stencil-public-runtime';
|
|
2
2
|
import { ClassList, Paginate } from '@mgdis/core-ui-helpers/dist/utils';
|
|
3
|
+
import { type Placement } from '@popperjs/core';
|
|
3
4
|
import { type RequestMappingType, type ResponseMappingType } from './mg-input-combobox.conf';
|
|
4
5
|
import { type TooltipPosition, type Width } from '../mg-input/mg-input.conf';
|
|
5
6
|
import type { Option } from '../../../../types';
|
|
@@ -90,6 +91,10 @@ export declare class MgInputCombobox {
|
|
|
90
91
|
*/
|
|
91
92
|
mgWidth: Width;
|
|
92
93
|
watchMgWidth(newValue: MgInputCombobox['mgWidth']): void;
|
|
94
|
+
/**
|
|
95
|
+
* Define the popover placement
|
|
96
|
+
*/
|
|
97
|
+
popoverPlacement: Placement;
|
|
93
98
|
/**
|
|
94
99
|
* Add a tooltip message next to the input
|
|
95
100
|
*/
|
|
@@ -192,23 +197,23 @@ export declare class MgInputCombobox {
|
|
|
192
197
|
popoverDisplay: boolean;
|
|
193
198
|
watchPopoverDisplay(newValue: MgInputCombobox['popoverDisplay']): void;
|
|
194
199
|
/**
|
|
195
|
-
*
|
|
200
|
+
* Emitted event when value change
|
|
196
201
|
*/
|
|
197
202
|
valueChange: EventEmitter<HTMLMgInputComboboxElement['value']>;
|
|
198
203
|
/**
|
|
199
|
-
*
|
|
204
|
+
* Emitted event when filter change
|
|
200
205
|
*/
|
|
201
206
|
filterChange: EventEmitter<string>;
|
|
202
207
|
/**
|
|
203
|
-
*
|
|
208
|
+
* Emitted event when `load-more` is called
|
|
204
209
|
*/
|
|
205
210
|
showMore: EventEmitter<void>;
|
|
206
211
|
/**
|
|
207
|
-
*
|
|
212
|
+
* Emitted event when checking validity
|
|
208
213
|
*/
|
|
209
214
|
inputValid: EventEmitter<HTMLMgInputComboboxElement['valid']>;
|
|
210
215
|
/**
|
|
211
|
-
*
|
|
216
|
+
* Emitted event when fetch API throw an error
|
|
212
217
|
*/
|
|
213
218
|
fetchError: EventEmitter<Error>;
|
|
214
219
|
/**
|
|
@@ -105,11 +105,11 @@ export declare class MgInputDate {
|
|
|
105
105
|
*/
|
|
106
106
|
errorMessage: string;
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* Emitted event when value change
|
|
109
109
|
*/
|
|
110
110
|
valueChange: EventEmitter<HTMLMgInputDateElement['value']>;
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
112
|
+
* Emitted event when checking validity
|
|
113
113
|
*/
|
|
114
114
|
inputValid: EventEmitter<HTMLMgInputDateElement['valid']>;
|
|
115
115
|
/**
|
|
@@ -153,11 +153,11 @@ export declare class MgInputNumeric {
|
|
|
153
153
|
*/
|
|
154
154
|
hasFocus: boolean;
|
|
155
155
|
/**
|
|
156
|
-
*
|
|
156
|
+
* Emitted event when value change
|
|
157
157
|
*/
|
|
158
158
|
valueChange: EventEmitter<number>;
|
|
159
159
|
/**
|
|
160
|
-
*
|
|
160
|
+
* Emitted event when checking validity
|
|
161
161
|
*/
|
|
162
162
|
inputValid: EventEmitter<HTMLMgInputNumericElement['valid']>;
|
|
163
163
|
/**
|
|
@@ -105,11 +105,11 @@ export declare class MgInputPassword {
|
|
|
105
105
|
*/
|
|
106
106
|
displayPassword: boolean;
|
|
107
107
|
/**
|
|
108
|
-
*
|
|
108
|
+
* Emitted event when value change
|
|
109
109
|
*/
|
|
110
110
|
valueChange: EventEmitter<HTMLMgInputPasswordElement['value']>;
|
|
111
111
|
/**
|
|
112
|
-
*
|
|
112
|
+
* Emitted event when checking validity
|
|
113
113
|
*/
|
|
114
114
|
inputValid: EventEmitter<HTMLMgInputPasswordElement['valid']>;
|
|
115
115
|
/**
|
|
@@ -111,7 +111,7 @@ export declare class MgInputRadio {
|
|
|
111
111
|
*/
|
|
112
112
|
valueChange: EventEmitter<HTMLMgInputRadioElement['value']>;
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* Emitted event when checking validity
|
|
115
115
|
*/
|
|
116
116
|
inputValid: EventEmitter<HTMLMgInputRadioElement['valid']>;
|
|
117
117
|
/**
|
package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/editor/editor.conf.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IJodit, ButtonsOption } from 'jodit/esm/types';
|
|
2
|
+
import type { RichTextEditorCustomAction } from '../mg-input-rich-text-editor.conf';
|
|
2
3
|
/**
|
|
3
4
|
* Configuration options for defineEditor function
|
|
4
5
|
* Combines component-specific options with Jodit configuration
|
|
@@ -9,9 +10,12 @@ export type DefineEditorConfig = {
|
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
placeholder?: string;
|
|
11
12
|
modules: ButtonsOption;
|
|
13
|
+
customActions?: RichTextEditorCustomAction[];
|
|
12
14
|
rows?: number;
|
|
13
15
|
handleTextChange: () => void;
|
|
14
16
|
handleFocus: () => void;
|
|
15
17
|
handleBlur: () => void;
|
|
18
|
+
handleCustomAction?: (name: string) => void;
|
|
19
|
+
handleSelectionChange?: () => void;
|
|
16
20
|
};
|
|
17
21
|
export type { IJodit, ButtonsOption };
|
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
import type { ButtonsOption } from './editor/editor.conf';
|
|
2
|
+
import type { IconType } from '../../../atoms/mg-icon/mg-icon.conf';
|
|
3
|
+
/**
|
|
4
|
+
* Custom toolbar action injected by the consumer.
|
|
5
|
+
* Each action is rendered as a toolbar button appended after the built-in modules.
|
|
6
|
+
* The editor stays decoupled from the underlying editor library: consumers only
|
|
7
|
+
* declare the action, then react through the `custom-action` event and the
|
|
8
|
+
* selection methods (`getSelectedText`, `getSelectedHTML`, `replaceSelection`).
|
|
9
|
+
*/
|
|
10
|
+
export type RichTextEditorCustomAction = {
|
|
11
|
+
/** Unique action name. Returned in the `custom-action` event detail when the button is clicked. */
|
|
12
|
+
name: string;
|
|
13
|
+
/** Accessible label, used as the button tooltip and aria-label. */
|
|
14
|
+
label: string;
|
|
15
|
+
/** Icon rendered inside the button. Must be one of the design system `mg-icon` names. */
|
|
16
|
+
icon: IconType;
|
|
17
|
+
};
|
|
18
|
+
/** Payload emitted by the `selection-change` event. */
|
|
19
|
+
export type SelectionChange = {
|
|
20
|
+
/** Plain text of the current selection. */
|
|
21
|
+
text: string;
|
|
22
|
+
/** Sanitized HTML of the current selection. */
|
|
23
|
+
html: string;
|
|
24
|
+
/** Whether the selection is collapsed (i.e. empty, no range selected). */
|
|
25
|
+
isCollapsed: boolean;
|
|
26
|
+
};
|
|
2
27
|
/** Default toolbar modules when the modules prop is not set. */
|
|
3
28
|
export declare const DEFAULT_MODULES: ButtonsOption;
|
|
@@ -3,6 +3,7 @@ import { ClassList } from '@mgdis/core-ui-helpers/dist/utils';
|
|
|
3
3
|
import { type TooltipPosition } from '../mg-input/mg-input.conf';
|
|
4
4
|
import { type SanitizerOptions } from '@mgdis/sanitize-html';
|
|
5
5
|
import type { ButtonsOption } from './editor/editor.conf';
|
|
6
|
+
import { type RichTextEditorCustomAction, type SelectionChange } from './mg-input-rich-text-editor.conf';
|
|
6
7
|
export declare class MgInputRichTextEditor {
|
|
7
8
|
/************
|
|
8
9
|
* Internal *
|
|
@@ -12,6 +13,7 @@ export declare class MgInputRichTextEditor {
|
|
|
12
13
|
private currentTitleElement;
|
|
13
14
|
private sanitizer;
|
|
14
15
|
private messages;
|
|
16
|
+
private savedSelection;
|
|
15
17
|
private hasDisplayedError;
|
|
16
18
|
private customErrorMessage;
|
|
17
19
|
/**************
|
|
@@ -110,6 +112,18 @@ export declare class MgInputRichTextEditor {
|
|
|
110
112
|
*/
|
|
111
113
|
modules?: ButtonsOption;
|
|
112
114
|
watchModules(newValue: MgInputRichTextEditor['modules']): void;
|
|
115
|
+
/**
|
|
116
|
+
* Inject custom action buttons in the toolbar (e.g. to insert merge fields or apply custom formatting).
|
|
117
|
+
* Buttons are appended after the built-in `modules`.
|
|
118
|
+
* Each action is an object `{ name, label, icon }`:
|
|
119
|
+
* - `name`: unique identifier, returned in the `custom-action` event detail on click.
|
|
120
|
+
* - `label`: accessible label used as the button tooltip and aria-label.
|
|
121
|
+
* - `icon`: design system `mg-icon` name rendered inside the button, unique across actions.
|
|
122
|
+
* The action behaviour is the consumer's responsibility: listen to `custom-action`,
|
|
123
|
+
* then read/write the selection with `getSelectedText()` / `getSelectedHTML()` / `replaceSelection()`.
|
|
124
|
+
*/
|
|
125
|
+
customActions?: RichTextEditorCustomAction[];
|
|
126
|
+
watchCustomActions(newValue: MgInputRichTextEditor['customActions']): void;
|
|
113
127
|
/**
|
|
114
128
|
* Sanitizer configuration in native format.
|
|
115
129
|
* Use disallowTags (array of tag names) and/or disallowAttributes (object mapping tag names to string arrays).
|
|
@@ -134,13 +148,23 @@ export declare class MgInputRichTextEditor {
|
|
|
134
148
|
*/
|
|
135
149
|
errorMessage: string;
|
|
136
150
|
/**
|
|
137
|
-
*
|
|
151
|
+
* Emitted event when checking validity
|
|
138
152
|
*/
|
|
139
153
|
inputValid: EventEmitter<boolean>;
|
|
140
154
|
/**
|
|
141
|
-
*
|
|
155
|
+
* Emitted event when value change
|
|
142
156
|
*/
|
|
143
157
|
valueChange: EventEmitter<string>;
|
|
158
|
+
/**
|
|
159
|
+
* Emitted event when a custom action button is clicked.
|
|
160
|
+
* The detail contains the action `name`.
|
|
161
|
+
*/
|
|
162
|
+
customAction: EventEmitter<string>;
|
|
163
|
+
/**
|
|
164
|
+
* Emitted event when the text selection changes.
|
|
165
|
+
* The detail contains the selected `text`, sanitized `html` and whether the selection `isCollapsed`.
|
|
166
|
+
*/
|
|
167
|
+
selectionChange: EventEmitter<SelectionChange>;
|
|
144
168
|
/**
|
|
145
169
|
* Set focus on input.
|
|
146
170
|
*/
|
|
@@ -155,6 +179,26 @@ export declare class MgInputRichTextEditor {
|
|
|
155
179
|
* @returns Plain text content of the editor
|
|
156
180
|
*/
|
|
157
181
|
getEditorText(): Promise<string>;
|
|
182
|
+
/**
|
|
183
|
+
* Get the current text selection as plain text.
|
|
184
|
+
* When a custom action is in progress, returns the selection snapshotted when the action was triggered.
|
|
185
|
+
* @returns Plain text of the selection (empty string if nothing is selected)
|
|
186
|
+
*/
|
|
187
|
+
getSelectedText(): Promise<string>;
|
|
188
|
+
/**
|
|
189
|
+
* Get the current text selection as HTML.
|
|
190
|
+
* When a custom action is in progress, returns the selection snapshotted when the action was triggered.
|
|
191
|
+
* @returns Sanitized HTML of the selection (empty string if nothing is selected)
|
|
192
|
+
*/
|
|
193
|
+
getSelectedHTML(): Promise<string>;
|
|
194
|
+
/**
|
|
195
|
+
* Replace the current text selection with the given content.
|
|
196
|
+
* When a custom action is in progress, the selection snapshotted when the action was triggered is
|
|
197
|
+
* restored first, so the replacement targets the right range even after focus moved away (e.g. during
|
|
198
|
+
* an async network request). No-op when the editor is readonly or disabled.
|
|
199
|
+
* @param content - HTML (or plain text) content to insert in place of the selection. It is sanitized.
|
|
200
|
+
*/
|
|
201
|
+
replaceSelection(content: string): Promise<void>;
|
|
158
202
|
/**
|
|
159
203
|
* Display input error if it exists.
|
|
160
204
|
*/
|
|
@@ -210,6 +254,21 @@ export declare class MgInputRichTextEditor {
|
|
|
210
254
|
* Handle `text-change` event
|
|
211
255
|
*/
|
|
212
256
|
private handleTextChange;
|
|
257
|
+
/**
|
|
258
|
+
* Capture the current selection (plain text, sanitized HTML and a cloned range).
|
|
259
|
+
* @returns Selection snapshot
|
|
260
|
+
*/
|
|
261
|
+
private captureSelection;
|
|
262
|
+
/**
|
|
263
|
+
* Handle a custom action button click.
|
|
264
|
+
* Snapshots the current selection then emits the `custom-action` event with the action name.
|
|
265
|
+
* @param name - the triggered action name
|
|
266
|
+
*/
|
|
267
|
+
private handleCustomAction;
|
|
268
|
+
/**
|
|
269
|
+
* Handle Jodit `changeSelection` event: emit the `selection-change` event.
|
|
270
|
+
*/
|
|
271
|
+
private handleSelectionChange;
|
|
213
272
|
/**
|
|
214
273
|
* Initialize sanitizer with current sanitizerOptions
|
|
215
274
|
*/
|
|
@@ -119,11 +119,11 @@ export declare class MgInputSelect {
|
|
|
119
119
|
*/
|
|
120
120
|
valueExist: boolean;
|
|
121
121
|
/**
|
|
122
|
-
*
|
|
122
|
+
* Emitted event when value change
|
|
123
123
|
*/
|
|
124
124
|
valueChange: EventEmitter<HTMLMgInputCheckboxElement['value']>;
|
|
125
125
|
/**
|
|
126
|
-
*
|
|
126
|
+
* Emitted event when checking validity
|
|
127
127
|
*/
|
|
128
128
|
inputValid: EventEmitter<HTMLMgInputCheckboxElement['valid']>;
|
|
129
129
|
/**
|
|
@@ -144,11 +144,11 @@ export declare class MgInputText {
|
|
|
144
144
|
*/
|
|
145
145
|
errorMessage: string;
|
|
146
146
|
/**
|
|
147
|
-
*
|
|
147
|
+
* Emitted event when value change
|
|
148
148
|
*/
|
|
149
149
|
valueChange: EventEmitter<HTMLMgInputTextElement['value']>;
|
|
150
150
|
/**
|
|
151
|
-
*
|
|
151
|
+
* Emitted event when checking validity
|
|
152
152
|
*/
|
|
153
153
|
inputValid: EventEmitter<HTMLMgInputTextElement['valid']>;
|
|
154
154
|
/**
|
|
@@ -125,11 +125,11 @@ export declare class MgInputTextarea {
|
|
|
125
125
|
*/
|
|
126
126
|
errorMessage: string;
|
|
127
127
|
/**
|
|
128
|
-
*
|
|
128
|
+
* Emitted event when value change
|
|
129
129
|
*/
|
|
130
130
|
valueChange: EventEmitter<HTMLMgInputTextareaElement['value']>;
|
|
131
131
|
/**
|
|
132
|
-
*
|
|
132
|
+
* Emitted event when checking validity
|
|
133
133
|
*/
|
|
134
134
|
inputValid: EventEmitter<HTMLMgInputTextareaElement['valid']>;
|
|
135
135
|
/**
|
|
@@ -103,11 +103,11 @@ export declare class MgInputToggle {
|
|
|
103
103
|
*/
|
|
104
104
|
valid: boolean;
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* Emitted event when value change
|
|
107
107
|
*/
|
|
108
108
|
valueChange: EventEmitter<HTMLMgInputToggleElement['value']>;
|
|
109
109
|
/**
|
|
110
|
-
*
|
|
110
|
+
* Emitted event when checking validity
|
|
111
111
|
*/
|
|
112
112
|
inputValid: EventEmitter<boolean>;
|
|
113
113
|
/**
|
|
@@ -61,11 +61,11 @@ export declare class MgMenuItem {
|
|
|
61
61
|
* Events *
|
|
62
62
|
*********/
|
|
63
63
|
/**
|
|
64
|
-
*
|
|
64
|
+
* Emitted event when item is loaded
|
|
65
65
|
*/
|
|
66
66
|
itemLoaded: EventEmitter<void>;
|
|
67
67
|
/**
|
|
68
|
-
*
|
|
68
|
+
* Emitted event when item is updated
|
|
69
69
|
*/
|
|
70
70
|
itemUpdated: EventEmitter<void>;
|
|
71
71
|
/**********
|
|
@@ -54,11 +54,11 @@ export declare class MgAlert {
|
|
|
54
54
|
*/
|
|
55
55
|
hasActions: boolean;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
57
|
+
* Emitted event when alert is diplayed
|
|
58
58
|
*/
|
|
59
59
|
componentShow: EventEmitter<void>;
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
61
|
+
* Emitted event when alert is hidden
|
|
62
62
|
*/
|
|
63
63
|
componentHide: EventEmitter<void>;
|
|
64
64
|
/**
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../stencil-public-runtime';
|
|
1
2
|
import { BreadcrumbItemType } from './mg-breadcrumb.conf';
|
|
2
3
|
export declare class MgBreadcrumb {
|
|
3
4
|
/************
|
|
@@ -15,10 +16,20 @@ export declare class MgBreadcrumb {
|
|
|
15
16
|
* Breadcrumb items (hierarchical order: root → current page).
|
|
16
17
|
*/
|
|
17
18
|
items: BreadcrumbItemType[];
|
|
19
|
+
/**
|
|
20
|
+
* Emitted event when item link is clicked
|
|
21
|
+
*/
|
|
22
|
+
itemClick: EventEmitter<BreadcrumbItemType>;
|
|
18
23
|
validateItems(newValue: MgBreadcrumb['items']): void;
|
|
19
24
|
/***********
|
|
20
25
|
* Methods *
|
|
21
26
|
**********/
|
|
27
|
+
/**
|
|
28
|
+
* Handle item link click: emit item-click event and conditionally prevent native navigation
|
|
29
|
+
* @param event - mouse event
|
|
30
|
+
* @param item - the clicked breadcrumb item
|
|
31
|
+
*/
|
|
32
|
+
private handleItemClick;
|
|
22
33
|
/**
|
|
23
34
|
* Render a single breadcrumb item (link or current page)
|
|
24
35
|
* @param item - The breadcrumb item
|
|
@@ -33,9 +33,9 @@ export declare class MgPopover {
|
|
|
33
33
|
placement: Placement;
|
|
34
34
|
/**
|
|
35
35
|
* Hide popover arrow
|
|
36
|
+
* @deprecated this prop is deprecated and will be removed in future releases. The popover arrow has been removed.
|
|
36
37
|
*/
|
|
37
|
-
arrowHide:
|
|
38
|
-
validateArrowHide(newValue: MgPopover['arrowHide']): void;
|
|
38
|
+
arrowHide: never;
|
|
39
39
|
/**
|
|
40
40
|
* Define if popover has a cross button
|
|
41
41
|
*/
|
|
@@ -51,7 +51,7 @@ export declare class MgPopover {
|
|
|
51
51
|
*/
|
|
52
52
|
disabled: boolean;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
54
|
+
* Emitted event when display value change
|
|
55
55
|
*/
|
|
56
56
|
displayChange: EventEmitter<HTMLMgPopoverElement['display']>;
|
|
57
57
|
/**
|