@mgdis/mg-components 4.1.0 → 4.2.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-88560a66.js → index-64cee0c8.js} +248 -81
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{mg-badge_24.cjs.entry.js → mg-badge_23.cjs.entry.js} +206 -2180
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-modal.cjs.entry.js +8 -1
- package/dist/cjs/mg-popover.cjs.entry.js +171 -0
- package/dist/cjs/popper-71bf3058.js +1790 -0
- package/dist/collection/collection-manifest.json +2 -2
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +116 -99
- package/dist/collection/components/atoms/mg-button/mg-button.js +221 -220
- package/dist/collection/components/atoms/mg-character-left/mg-character-left.js +72 -69
- package/dist/collection/components/atoms/mg-icon/doc/mg-icon.stories.js +1 -2
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +102 -92
- package/dist/collection/components/atoms/mg-input-title/mg-input-title.js +83 -67
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +64 -55
- package/dist/collection/components/atoms/mg-tooltip/doc/mg-tooltip.stories.js +3 -6
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +120 -106
- package/dist/collection/components/molecules/inputs/MgInput.js +8 -17
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +323 -318
- package/dist/collection/components/molecules/inputs/mg-input-date/doc/mg-input-date.stories.js +3 -2
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +356 -361
- package/dist/collection/components/molecules/inputs/mg-input-numeric/doc/mg-input-numeric.stories.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +462 -456
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +347 -340
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +348 -343
- package/dist/collection/components/molecules/inputs/mg-input-select/doc/mg-input-select.stories.js +4 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +406 -401
- package/dist/collection/components/molecules/inputs/mg-input-text/doc/mg-input-text.stories.js +12 -15
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.css +2 -0
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +476 -473
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +461 -456
- package/dist/collection/components/molecules/inputs/mg-input-toggle/doc/mg-input-toggle.stories.js +2 -8
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.css +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +299 -298
- package/dist/collection/components/molecules/mg-details/doc/mg-details.stories.js +1 -3
- package/dist/collection/components/molecules/mg-details/mg-details.js +95 -93
- package/dist/collection/components/molecules/mg-form/doc/mg-form.stories.js +13 -27
- package/dist/collection/components/molecules/mg-form/mg-form.js +175 -166
- package/dist/collection/components/molecules/mg-illustrated-message/doc/mg-illustrated-message.stories.js +2 -6
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +37 -37
- package/dist/collection/components/molecules/mg-message/doc/mg-message.stories.js +1 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +154 -153
- package/dist/collection/components/molecules/mg-modal/doc/mg-modal.stories.js +11 -15
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +147 -134
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +5 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +112 -117
- package/dist/collection/components/molecules/mg-panel/doc/mg-panel.stories.js +1 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +192 -189
- package/dist/collection/components/molecules/mg-popover/doc/mg-popover.stories.js +1 -4
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +129 -127
- package/dist/collection/components/molecules/mg-tabs/doc/mg-tabs.stories.js +1 -5
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +150 -135
- package/dist/collection/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/collection/locales/en/messages.json +50 -0
- package/dist/collection/locales/fr/messages.json +50 -0
- package/dist/collection/stories/grids.stories.js +1 -44
- package/dist/collection/stories/helpers.stories.js +1 -19
- package/dist/collection/stories/icons.stories.js +1 -4
- package/dist/collection/stories/typography.stories.js +1 -12
- package/dist/collection/variables.css +3 -2
- package/dist/collection/variables.scss +3 -2
- package/dist/components/MgInput.js +6 -3
- package/dist/components/mg-badge2.js +7 -0
- package/dist/components/mg-button2.js +2 -7
- package/dist/components/mg-input-checkbox.js +1 -6
- package/dist/components/mg-input-date.js +10 -27
- package/dist/components/mg-input-numeric.js +1 -6
- package/dist/components/mg-input-password.js +1 -6
- package/dist/components/mg-input-radio.js +1 -6
- package/dist/components/mg-input-select2.js +1 -6
- package/dist/components/mg-input-text2.js +3 -8
- package/dist/components/mg-input-textarea.js +2 -7
- package/dist/components/mg-input-title2.js +9 -0
- package/dist/components/mg-input-toggle.js +2 -7
- package/dist/components/mg-modal.js +7 -0
- package/dist/components/mg-pagination.js +3 -3
- package/dist/components/mg-panel.js +8 -4
- package/dist/components/mg-tabs.js +8 -1
- package/dist/components/mg-tooltip2.js +7 -0
- package/dist/esm/{index-bca81100.js → index-120f47fd.js} +248 -81
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{mg-badge_24.entry.js → mg-badge_23.entry.js} +207 -2180
- package/dist/esm/mg-components.js +3 -3
- package/dist/esm/mg-modal.entry.js +8 -1
- package/dist/esm/mg-popover.entry.js +167 -0
- package/dist/esm/popper-93ecb064.js +1788 -0
- package/dist/mg-components/fonts/OpenSans-Bold.ttf +0 -0
- package/dist/mg-components/locales/en/messages.json +50 -0
- package/dist/mg-components/locales/fr/messages.json +50 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-21991be8.entry.js +1 -0
- package/dist/mg-components/p-36a64f8c.entry.js +1 -0
- package/dist/mg-components/p-4c66f794.js +1 -0
- package/dist/mg-components/{p-b14a3443.js → p-7bc32a2f.js} +0 -0
- package/dist/mg-components/p-b380a0df.entry.js +1 -0
- package/dist/mg-components/variables.css +3 -2
- package/dist/mg-components/variables.scss +3 -2
- package/dist/types/components/atoms/mg-badge/mg-badge.d.ts +1 -0
- package/dist/types/components/atoms/mg-button/mg-button.d.ts +0 -1
- package/dist/types/components/atoms/mg-input-title/mg-input-title.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +1 -10
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +0 -1
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -1
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +29 -29
- package/loader/package.json +1 -0
- package/package.json +8 -8
- package/dist/collection/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/fonts/Poppins-Bold.ttf +0 -0
- package/dist/mg-components/p-a2883dc7.entry.js +0 -1
- package/dist/mg-components/p-cffe0519.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
2
|
import { createID, ClassList } from '../../../utils/components.utils';
|
|
3
3
|
import { initLocales } from '../../../locales';
|
|
4
4
|
export class MgPanel {
|
|
@@ -93,37 +93,33 @@ export class MgPanel {
|
|
|
93
93
|
* @returns {HTMLMgButtonElement | HTMLElement | HTMLElement[]} header left element
|
|
94
94
|
*/
|
|
95
95
|
this.headerLeft = () => {
|
|
96
|
-
const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", identifier: `${this.identifier}-collapse-button`, expanded: this.expanded, controls: `${this.identifier}-content`, disabled: this.expandToggleDisabled },
|
|
97
|
-
h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }),
|
|
98
|
-
!this.isEditing && this.panelTitle));
|
|
96
|
+
const collapseButton = () => (h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", identifier: `${this.identifier}-collapse-button`, expanded: this.expanded, controls: `${this.identifier}-content`, disabled: this.expandToggleDisabled }, h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), !this.isEditing && this.panelTitle));
|
|
99
97
|
if (this.titleEditable && !this.isEditing) {
|
|
100
98
|
return [
|
|
101
99
|
collapseButton(),
|
|
102
|
-
h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` },
|
|
103
|
-
h("mg-icon", { icon: "pen" })),
|
|
100
|
+
h("mg-button", { "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, h("mg-icon", { icon: "pen" })),
|
|
104
101
|
];
|
|
105
102
|
}
|
|
106
103
|
if (this.titleEditable && this.isEditing) {
|
|
107
104
|
return [
|
|
108
105
|
collapseButton(),
|
|
109
|
-
h("mg-input-text", { label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) },
|
|
110
|
-
h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` },
|
|
111
|
-
h("mg-icon", { icon: "cross" })),
|
|
112
|
-
h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` },
|
|
113
|
-
h("mg-icon", { icon: "check" }))),
|
|
106
|
+
h("mg-input-text", { label: this.messages.panel.editLabel, "label-hide": true, value: this.panelTitle, "onValue-change": this.handleUpdateTitle, displayCharacterLeft: false, pattern: this.titlePattern, "pattern-error-message": this.titlePatternErrorMessage, identifier: `${this.identifier}-edition-input`, ref: el => (this.editInputElement = el) }, h("mg-button", { slot: "append-input", label: this.messages.general.cancel, "is-icon": true, variant: "secondary", onClick: this.handleCancelEditButton, identifier: `${this.identifier}-edition-button-cancel` }, h("mg-icon", { icon: "cross" })), h("mg-button", { slot: "append-input", label: this.messages.general.confirm, "is-icon": true, variant: "secondary", onClick: this.handleValidateEditButton, identifier: `${this.identifier}-edition-button-validate` }, h("mg-icon", { icon: "check" }))),
|
|
114
107
|
];
|
|
115
108
|
}
|
|
116
109
|
return collapseButton();
|
|
117
110
|
};
|
|
118
111
|
}
|
|
119
|
-
|
|
112
|
+
validatePanelTitle(newValue) {
|
|
113
|
+
if (typeof newValue !== 'string' || newValue.trim() === '') {
|
|
114
|
+
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
115
|
+
}
|
|
120
116
|
this.titleChange.emit(newValue);
|
|
121
117
|
}
|
|
122
118
|
validatetitlePattern(newValue) {
|
|
123
119
|
if (newValue && !this.titleEditable) {
|
|
124
120
|
throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
|
|
125
121
|
}
|
|
126
|
-
if (newValue && this.titlePatternErrorMessage === undefined) {
|
|
122
|
+
if (newValue && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
127
123
|
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
128
124
|
}
|
|
129
125
|
}
|
|
@@ -143,6 +139,7 @@ export class MgPanel {
|
|
|
143
139
|
this.messages = initLocales(this.element).messages;
|
|
144
140
|
// Validate
|
|
145
141
|
this.validatetitlePattern(this.titlePattern);
|
|
142
|
+
this.validatePanelTitle(this.panelTitle);
|
|
146
143
|
}
|
|
147
144
|
/**
|
|
148
145
|
* Edit DOM after render
|
|
@@ -161,191 +158,197 @@ export class MgPanel {
|
|
|
161
158
|
* @returns {HTMLElement} html element
|
|
162
159
|
*/
|
|
163
160
|
render() {
|
|
164
|
-
return (h("section", { class: this.classList.join(), id: this.identifier },
|
|
165
|
-
h("header", { class: "mg-panel__header", id: `${this.identifier}-header` },
|
|
166
|
-
h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()),
|
|
167
|
-
h("div", { class: "mg-panel__header-right" },
|
|
168
|
-
h("slot", { name: "header-right" }))),
|
|
169
|
-
h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded },
|
|
170
|
-
h("slot", null))));
|
|
161
|
+
return (h("section", { class: this.classList.join(), id: this.identifier }, h("header", { class: "mg-panel__header", id: `${this.identifier}-header` }, h("div", { class: `mg-panel__header-left ${this.isEditing ? 'mg-panel__header-left--full' : ''}` }, this.headerLeft()), h("div", { class: "mg-panel__header-right" }, h("slot", { name: "header-right" }))), h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": `${this.identifier}-header`, hidden: !this.expanded }, h("slot", null))));
|
|
171
162
|
}
|
|
172
163
|
static get is() { return "mg-panel"; }
|
|
173
164
|
static get encapsulation() { return "shadow"; }
|
|
174
|
-
static get originalStyleUrls() {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
"
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
"original": "string",
|
|
204
|
-
"resolved": "string",
|
|
205
|
-
"references": {}
|
|
206
|
-
},
|
|
207
|
-
"required": true,
|
|
208
|
-
"optional": false,
|
|
209
|
-
"docs": {
|
|
210
|
-
"tags": [],
|
|
211
|
-
"text": "Panel title"
|
|
212
|
-
},
|
|
213
|
-
"attribute": "panel-title",
|
|
214
|
-
"reflect": false
|
|
215
|
-
},
|
|
216
|
-
"titlePattern": {
|
|
217
|
-
"type": "string",
|
|
218
|
-
"mutable": true,
|
|
219
|
-
"complexType": {
|
|
220
|
-
"original": "string",
|
|
221
|
-
"resolved": "string",
|
|
222
|
-
"references": {}
|
|
223
|
-
},
|
|
224
|
-
"required": false,
|
|
225
|
-
"optional": false,
|
|
226
|
-
"docs": {
|
|
227
|
-
"tags": [],
|
|
228
|
-
"text": "Panel title pattern"
|
|
229
|
-
},
|
|
230
|
-
"attribute": "title-pattern",
|
|
231
|
-
"reflect": false
|
|
232
|
-
},
|
|
233
|
-
"titlePatternErrorMessage": {
|
|
234
|
-
"type": "string",
|
|
235
|
-
"mutable": true,
|
|
236
|
-
"complexType": {
|
|
237
|
-
"original": "string",
|
|
238
|
-
"resolved": "string",
|
|
239
|
-
"references": {}
|
|
240
|
-
},
|
|
241
|
-
"required": false,
|
|
242
|
-
"optional": false,
|
|
243
|
-
"docs": {
|
|
244
|
-
"tags": [],
|
|
245
|
-
"text": "Panel title pattern error message"
|
|
246
|
-
},
|
|
247
|
-
"attribute": "title-pattern-error-message",
|
|
248
|
-
"reflect": false
|
|
249
|
-
},
|
|
250
|
-
"expanded": {
|
|
251
|
-
"type": "boolean",
|
|
252
|
-
"mutable": true,
|
|
253
|
-
"complexType": {
|
|
254
|
-
"original": "boolean",
|
|
255
|
-
"resolved": "boolean",
|
|
256
|
-
"references": {}
|
|
257
|
-
},
|
|
258
|
-
"required": false,
|
|
259
|
-
"optional": false,
|
|
260
|
-
"docs": {
|
|
261
|
-
"tags": [],
|
|
262
|
-
"text": "Panel is opened"
|
|
263
|
-
},
|
|
264
|
-
"attribute": "expanded",
|
|
265
|
-
"reflect": false,
|
|
266
|
-
"defaultValue": "false"
|
|
267
|
-
},
|
|
268
|
-
"expandToggleDisabled": {
|
|
269
|
-
"type": "boolean",
|
|
270
|
-
"mutable": true,
|
|
271
|
-
"complexType": {
|
|
272
|
-
"original": "boolean",
|
|
273
|
-
"resolved": "boolean",
|
|
274
|
-
"references": {}
|
|
165
|
+
static get originalStyleUrls() {
|
|
166
|
+
return {
|
|
167
|
+
"$": ["mg-panel.scss"]
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
static get styleUrls() {
|
|
171
|
+
return {
|
|
172
|
+
"$": ["mg-panel.css"]
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
static get properties() {
|
|
176
|
+
return {
|
|
177
|
+
"identifier": {
|
|
178
|
+
"type": "string",
|
|
179
|
+
"mutable": false,
|
|
180
|
+
"complexType": {
|
|
181
|
+
"original": "string",
|
|
182
|
+
"resolved": "string",
|
|
183
|
+
"references": {}
|
|
184
|
+
},
|
|
185
|
+
"required": false,
|
|
186
|
+
"optional": false,
|
|
187
|
+
"docs": {
|
|
188
|
+
"tags": [],
|
|
189
|
+
"text": "Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created."
|
|
190
|
+
},
|
|
191
|
+
"attribute": "identifier",
|
|
192
|
+
"reflect": false,
|
|
193
|
+
"defaultValue": "createID('mg-panel')"
|
|
275
194
|
},
|
|
276
|
-
"
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
"
|
|
280
|
-
|
|
195
|
+
"panelTitle": {
|
|
196
|
+
"type": "string",
|
|
197
|
+
"mutable": true,
|
|
198
|
+
"complexType": {
|
|
199
|
+
"original": "string",
|
|
200
|
+
"resolved": "string",
|
|
201
|
+
"references": {}
|
|
202
|
+
},
|
|
203
|
+
"required": true,
|
|
204
|
+
"optional": false,
|
|
205
|
+
"docs": {
|
|
206
|
+
"tags": [],
|
|
207
|
+
"text": "Panel title"
|
|
208
|
+
},
|
|
209
|
+
"attribute": "panel-title",
|
|
210
|
+
"reflect": false
|
|
281
211
|
},
|
|
282
|
-
"
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
"
|
|
291
|
-
"
|
|
212
|
+
"titlePattern": {
|
|
213
|
+
"type": "string",
|
|
214
|
+
"mutable": true,
|
|
215
|
+
"complexType": {
|
|
216
|
+
"original": "string",
|
|
217
|
+
"resolved": "string",
|
|
218
|
+
"references": {}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": "Panel title pattern"
|
|
225
|
+
},
|
|
226
|
+
"attribute": "title-pattern",
|
|
227
|
+
"reflect": false
|
|
292
228
|
},
|
|
293
|
-
"
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
|
|
229
|
+
"titlePatternErrorMessage": {
|
|
230
|
+
"type": "string",
|
|
231
|
+
"mutable": true,
|
|
232
|
+
"complexType": {
|
|
233
|
+
"original": "string",
|
|
234
|
+
"resolved": "string",
|
|
235
|
+
"references": {}
|
|
236
|
+
},
|
|
237
|
+
"required": false,
|
|
238
|
+
"optional": false,
|
|
239
|
+
"docs": {
|
|
240
|
+
"tags": [],
|
|
241
|
+
"text": "Panel title pattern error message"
|
|
242
|
+
},
|
|
243
|
+
"attribute": "title-pattern-error-message",
|
|
244
|
+
"reflect": false
|
|
298
245
|
},
|
|
299
|
-
"
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
"tags": [],
|
|
317
|
-
"text": "Emmited event when title change"
|
|
246
|
+
"expanded": {
|
|
247
|
+
"type": "boolean",
|
|
248
|
+
"mutable": true,
|
|
249
|
+
"complexType": {
|
|
250
|
+
"original": "boolean",
|
|
251
|
+
"resolved": "boolean",
|
|
252
|
+
"references": {}
|
|
253
|
+
},
|
|
254
|
+
"required": false,
|
|
255
|
+
"optional": false,
|
|
256
|
+
"docs": {
|
|
257
|
+
"tags": [],
|
|
258
|
+
"text": "Panel is opened"
|
|
259
|
+
},
|
|
260
|
+
"attribute": "expanded",
|
|
261
|
+
"reflect": false,
|
|
262
|
+
"defaultValue": "false"
|
|
318
263
|
},
|
|
319
|
-
"
|
|
320
|
-
"
|
|
321
|
-
"
|
|
322
|
-
"
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
264
|
+
"expandToggleDisabled": {
|
|
265
|
+
"type": "boolean",
|
|
266
|
+
"mutable": true,
|
|
267
|
+
"complexType": {
|
|
268
|
+
"original": "boolean",
|
|
269
|
+
"resolved": "boolean",
|
|
270
|
+
"references": {}
|
|
271
|
+
},
|
|
272
|
+
"required": false,
|
|
273
|
+
"optional": false,
|
|
274
|
+
"docs": {
|
|
275
|
+
"tags": [],
|
|
276
|
+
"text": "Disable possibility to toggle expand"
|
|
277
|
+
},
|
|
278
|
+
"attribute": "expand-toggle-disabled",
|
|
279
|
+
"reflect": false
|
|
333
280
|
},
|
|
334
|
-
"
|
|
335
|
-
"
|
|
336
|
-
"
|
|
337
|
-
"
|
|
281
|
+
"titleEditable": {
|
|
282
|
+
"type": "boolean",
|
|
283
|
+
"mutable": false,
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "boolean",
|
|
286
|
+
"resolved": "boolean",
|
|
287
|
+
"references": {}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": "Panel title is editabled"
|
|
294
|
+
},
|
|
295
|
+
"attribute": "title-editable",
|
|
296
|
+
"reflect": false,
|
|
297
|
+
"defaultValue": "false"
|
|
338
298
|
}
|
|
339
|
-
}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
static get states() {
|
|
302
|
+
return {
|
|
303
|
+
"classList": {},
|
|
304
|
+
"isEditing": {},
|
|
305
|
+
"updatedPanelTitle": {}
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
static get events() {
|
|
309
|
+
return [{
|
|
310
|
+
"method": "titleChange",
|
|
311
|
+
"name": "title-change",
|
|
312
|
+
"bubbles": true,
|
|
313
|
+
"cancelable": true,
|
|
314
|
+
"composed": true,
|
|
315
|
+
"docs": {
|
|
316
|
+
"tags": [],
|
|
317
|
+
"text": "Emmited event when title change"
|
|
318
|
+
},
|
|
319
|
+
"complexType": {
|
|
320
|
+
"original": "string",
|
|
321
|
+
"resolved": "string",
|
|
322
|
+
"references": {}
|
|
323
|
+
}
|
|
324
|
+
}, {
|
|
325
|
+
"method": "expandedChange",
|
|
326
|
+
"name": "expanded-change",
|
|
327
|
+
"bubbles": true,
|
|
328
|
+
"cancelable": true,
|
|
329
|
+
"composed": true,
|
|
330
|
+
"docs": {
|
|
331
|
+
"tags": [],
|
|
332
|
+
"text": "Emmited event when expanded change"
|
|
333
|
+
},
|
|
334
|
+
"complexType": {
|
|
335
|
+
"original": "boolean",
|
|
336
|
+
"resolved": "boolean",
|
|
337
|
+
"references": {}
|
|
338
|
+
}
|
|
339
|
+
}];
|
|
340
|
+
}
|
|
340
341
|
static get elementRef() { return "element"; }
|
|
341
|
-
static get watchers() {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
342
|
+
static get watchers() {
|
|
343
|
+
return [{
|
|
344
|
+
"propName": "panelTitle",
|
|
345
|
+
"methodName": "validatePanelTitle"
|
|
346
|
+
}, {
|
|
347
|
+
"propName": "titlePattern",
|
|
348
|
+
"methodName": "validatetitlePattern"
|
|
349
|
+
}, {
|
|
350
|
+
"propName": "expanded",
|
|
351
|
+
"methodName": "handleExpanded"
|
|
352
|
+
}];
|
|
353
|
+
}
|
|
351
354
|
}
|
|
@@ -26,10 +26,7 @@ export default {
|
|
|
26
26
|
* @returns {HTMLElement} HTMLElement
|
|
27
27
|
*/
|
|
28
28
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
-
const Template = (args) => (h("mg-popover", Object.assign({}, filterArgs(args, { placement: 'bottom' })),
|
|
30
|
-
h("mg-button", null, "Button"),
|
|
31
|
-
args.slotTitle && h("h2", { slot: "title" }, args.slotTitle),
|
|
32
|
-
args.slotContent && h("p", { slot: "content" }, args.slotContent)));
|
|
29
|
+
const Template = (args) => (h("mg-popover", Object.assign({}, filterArgs(args, { placement: 'bottom' })), h("mg-button", null, "Button"), args.slotTitle && h("h2", { slot: "title" }, args.slotTitle), args.slotContent && h("p", { slot: "content" }, args.slotContent)));
|
|
33
30
|
export const MgPopover = Template.bind({});
|
|
34
31
|
MgPopover.args = {
|
|
35
32
|
slotTitle: `Blu bli blo bla`,
|