@mgdis/mg-components 5.12.1 → 5.13.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/loader.cjs.js +1 -1
- package/dist/cjs/{mg-action-more_31.cjs.entry.js → mg-action-more_32.cjs.entry.js} +324 -136
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-item-more.cjs.entry.js +1 -1
- package/dist/cjs/{mg-menu.conf-79f0c761.js → mg-menu.conf-857748e1.js} +20 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +15 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +259 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js +16 -0
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.css +41 -3
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +106 -100
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu/mg-menu.js +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.css +3 -0
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +19 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.conf.js +8 -0
- package/dist/collection/components/molecules/mg-panel/mg-panel.css +9 -5
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +133 -47
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.css +1 -0
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/collection/locales/en/messages.json +13 -1
- package/dist/collection/locales/fr/messages.json +7 -1
- package/dist/collection/stories/icon-gallery.js +9 -0
- package/dist/collection/variables.css +7 -2
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/components/index2.js +20 -2
- package/dist/components/mg-input-checkbox-paginated.d.ts +11 -0
- package/dist/components/mg-input-checkbox-paginated.js +6 -0
- package/dist/components/mg-input-checkbox-paginated2.js +205 -0
- package/dist/components/mg-input-checkbox.js +114 -108
- package/dist/components/mg-menu-item2.js +1 -1
- package/dist/components/mg-menu2.js +1 -1
- package/dist/components/mg-pagination2.js +4 -2
- package/dist/components/mg-panel.js +83 -37
- package/dist/components/mg-tabs.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{mg-action-more_31.entry.js → mg-action-more_32.entry.js} +324 -137
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-item-more.entry.js +1 -1
- package/dist/esm/{mg-menu.conf-850d4c6e.js → mg-menu.conf-c31828ca.js} +20 -2
- package/dist/mg-components/locales/en/messages.json +13 -1
- package/dist/mg-components/locales/fr/messages.json +7 -1
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-622e2323.js +1 -0
- package/dist/mg-components/p-bda0b795.entry.js +1 -0
- package/dist/mg-components/{p-67ba5d05.entry.js → p-d37b29bb.entry.js} +1 -1
- package/dist/mg-components/variables.css +7 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.d.ts +8 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.d.ts +103 -0
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +50 -12
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +48 -53
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -1
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +0 -1
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +4 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.conf.d.ts +16 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +44 -10
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +0 -1
- package/dist/types/components.d.ts +125 -19
- package/dist/types/locales/index.d.ts +18 -0
- package/dist/types/stories/icon-gallery.d.ts +6 -0
- package/package.json +23 -13
- package/dist/mg-components/p-689503fc.js +0 -1
- package/dist/mg-components/p-ec5a0dd6.entry.js +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-03d2557d.js');
|
|
6
|
-
const mgMenu_conf = require('./mg-menu.conf-
|
|
6
|
+
const mgMenu_conf = require('./mg-menu.conf-857748e1.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Available menu-item positions
|
|
@@ -1283,8 +1283,41 @@ const MgInput = (props, children, utils) => {
|
|
|
1283
1283
|
* List of all availables checkbox type
|
|
1284
1284
|
*/
|
|
1285
1285
|
const checkboxTypes = ['checkbox', 'multi'];
|
|
1286
|
+
/**
|
|
1287
|
+
* mg-input-checkbox-paginated section kind
|
|
1288
|
+
*/
|
|
1289
|
+
var SectionKind;
|
|
1290
|
+
(function (SectionKind) {
|
|
1291
|
+
SectionKind["SELECTED"] = "selected";
|
|
1292
|
+
SectionKind["NOT_SELECTED"] = "not-selected";
|
|
1293
|
+
})(SectionKind || (SectionKind = {}));
|
|
1294
|
+
/**
|
|
1295
|
+
* mg-input-checkbox-paginated section title kind
|
|
1296
|
+
*/
|
|
1297
|
+
var SectionTitleKind;
|
|
1298
|
+
(function (SectionTitleKind) {
|
|
1299
|
+
SectionTitleKind["BUTTON"] = "button";
|
|
1300
|
+
SectionTitleKind["TEXT"] = "text";
|
|
1301
|
+
})(SectionTitleKind || (SectionTitleKind = {}));
|
|
1286
1302
|
|
|
1287
|
-
|
|
1303
|
+
/**
|
|
1304
|
+
* Get checkboxes list template
|
|
1305
|
+
* @param props - MgInputCheckboxList Interface Props
|
|
1306
|
+
* @returns input template
|
|
1307
|
+
*/
|
|
1308
|
+
const MgInputCheckboxList = (props) => (
|
|
1309
|
+
// eslint-disable-next-line jsx-a11y/no-redundant-roles
|
|
1310
|
+
index.h("ul", { class: {
|
|
1311
|
+
'mg-input__input-group-container': true,
|
|
1312
|
+
'mg-input__input-group-container--vertical': props.inputVerticalList || (props.type === 'multi' && !props.readonly),
|
|
1313
|
+
'mg-input__input-checkbox-multi-inputs': props.type === 'multi' && !props.readonly,
|
|
1314
|
+
}, role: "list", "aria-describedby": props.displaySearchInput ? 'search-results' : undefined, "aria-label": props.displaySearchInput ? props.messages.searchResults : undefined, "aria-live": props.displaySearchInput ? 'polite' : undefined, id: props.id }, props.checkboxes
|
|
1315
|
+
.filter(item => !props.readonly || item.value)
|
|
1316
|
+
.map(input => (index.h("li", { key: input.id, class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': props.disabled || input.disabled } },
|
|
1317
|
+
index.h("input", { type: "checkbox", id: input.id, name: props.name, value: input.value && input.value.toString(), checked: Boolean(input.value), required: input.required, disabled: props.readonly || props.disabled || input.disabled, indeterminate: input.value === null, onInput: input.handleInput, onBlur: input.handleBlur, onKeyDown: input.handleKeydown }),
|
|
1318
|
+
index.h("label", { htmlFor: input.id }, input.title))))));
|
|
1319
|
+
|
|
1320
|
+
const mgInputCheckboxCss = ":host{display:block}.mg-input{display:flex;align-items:flex-start;min-height:var(--default-size);max-width:100%;margin-bottom:var(--mg-inputs-margin-bottom, 0);}.mg-input mg-input-title{flex-shrink:var(--mg-inputs-shrink, 1);width:var(--mg-inputs-title-width, auto);margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);margin-right:var(--mg-inputs-title-horizontal-space, var(--mg-inputs-spacer));text-align:right}.mg-input.mg-input--label-on-top{flex-direction:column}.mg-input.mg-input--label-on-top .mg-input__input-container{width:100%}.mg-input__title{display:flex;align-items:baseline;margin-bottom:0.3rem}.mg-input__title mg-input-title{flex-shrink:1;width:auto;margin-top:0;margin-right:var(--mg-inputs-spacer);text-align:left}.mg-input__title mg-tooltip{margin-top:0}.mg-input__title mg-icon{display:inline-flex;vertical-align:text-bottom}.mg-input__input-container{min-height:var(--default-size);}.mg-input__input-container>strong{display:inline-block;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2);min-height:var(--font-size)}.mg-input__input-container mg-tooltip{display:inline-flex;width:var(--mg-icon-regular-size);height:var(--mg-icon-regular-size);margin-left:var(--mg-inputs-spacer)}.mg-input__input-container .mg-input__help-text,.mg-input__input-container .mg-input__error{text-align:start;font-size:1.2rem}.mg-input__input{display:flex;}.mg-input__input mg-tooltip{margin-top:calc((var(--default-size) - var(--mg-icon-regular-size)) / 2)}.mg-input__input.mg-input__input--has-error .mg-input__box{border-color:hsl(var(--color-danger))}.mg-input__input+.mg-input__help-text,.mg-input__input+.mg-input__error{margin-top:0.5rem}.mg-input__input .mg-input__box:disabled,.mg-input__input-group--disabled label,.mg-input.mg-input--toggle-disabled .mg-input__input .mg-input__button-toggle,.mg-input.mg-input--checkbox-multi-disabled .mg-input__input strong{opacity:var(--mg-disabled-opacity)}.mg-input__error{display:inline-block;margin-top:0.2rem;padding:0.3rem 0.8rem;border-radius:0.3rem;background:hsl(var(--mg-inputs-error-bg-color));color:hsl(var(--color-danger))}.mg-input__input mg-icon,.mg-input__error mg-icon{display:flex}fieldset.mg-input{border:0;margin-left:0;margin-right:0;padding:0}fieldset.mg-input input[type=radio],fieldset.mg-input input[type=checkbox]{flex-shrink:0;width:var(--mg-input-check-size);height:var(--mg-input-check-size);margin-top:calc((var(--font-size) * var(--line-height) - var(--mg-input-check-size)) / 2);margin-right:0.6rem;margin-bottom:0;margin-left:0}fieldset.mg-input.mg-input--label-on-top .mg-input__input-group-container{margin-top:0.7rem}.mg-input__input-container mg-tooltip{margin-left:3rem}.mg-input__input-group-container{margin:0;padding:0;list-style:none;display:flex;flex-wrap:wrap;column-gap:2.3rem;row-gap:1rem;margin-top:calc((var(--default-size) - var(--font-size) * var(--line-height)) / 2)}.mg-input__input-group-container--vertical{flex-direction:column}.mg-input__input-group{display:flex;align-items:top}.sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi{display:flex;flex-wrap:wrap;gap:calc(var(--mg-inputs-spacer) * 1.2)}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi--with-values.mg-input__input-checkbox-multi{gap:0.4rem}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-values-container{display:flex;flex-wrap:wrap;gap:calc(0.4rem * 1);flex-direction:row;margin:0;padding:0;list-style:none}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-value{display:inline-flex;justify-content:center;align-items:center;box-sizing:border-box;min-height:var(--default-size);min-width:var(--default-size);padding:calc((var(--default-size) - 0.2rem - var(--font-size) * var(--line-height)) / 2) 1.1rem;background-color:hsl(var(--mg-color-dark-5-hsl));border-radius:0.3rem;font-size:var(--font-size)}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-no-result{text-align:center}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-text,.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-title{display:inline;margin:0;color:hsl(var(--mg-color-dark-40-hsl))}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-title{margin:0 1.1rem}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-sections{display:flex;flex-wrap:wrap;gap:calc(0.4rem * 1);flex-direction:column}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-sections-container{display:flex;flex-wrap:nowrap;gap:calc(0.4rem * 0);flex-direction:column;max-height:80vh;padding-right:1rem;overflow-y:auto}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-section-header{display:flex;flex-wrap:wrap;gap:calc(0.4rem * 2);flex-direction:row;align-items:center;min-height:var(--default-size)}.mg-input.mg-input--checkbox-multi .mg-input__input-checkbox-multi-inputs{margin:0;padding:0.4rem calc(0.4rem * 2) 0.4rem calc(0.4rem / 2)}.mg-input.mg-input--checkbox-multi:not(.mg-input--label-on-top) mg-tooltip{margin-left:var(--mg-inputs-spacer)}.mg-input.mg-input--checkbox-multi mg-popover{--mg-popover-min-width:7rem;--mg-card-padding:calc(0.4rem * 2)}.mg-input.mg-input--checkbox-multi mg-popover [slot=content]{display:flex;flex-wrap:wrap;gap:calc(0.4rem * 2);flex-direction:column}.mg-input.mg-input--checkbox-multi mg-popover [slot=content] .mg-input__input-group{margin-left:calc(0.4rem * 2)}.mg-input.mg-input--checkbox-multi mg-input-text{--mg-inputs-margin-bottom:0}";
|
|
1288
1321
|
|
|
1289
1322
|
/**
|
|
1290
1323
|
* type CheckboxItem validation function
|
|
@@ -1298,30 +1331,20 @@ const MgInputCheckbox = class {
|
|
|
1298
1331
|
index.registerInstance(this, hostRef);
|
|
1299
1332
|
this.valueChange = index.createEvent(this, "value-change", 7);
|
|
1300
1333
|
this.inputValid = index.createEvent(this, "input-valid", 7);
|
|
1301
|
-
/************
|
|
1302
|
-
* Internal *
|
|
1303
|
-
************/
|
|
1304
|
-
// HTML selector
|
|
1305
|
-
this.inputs = [];
|
|
1306
1334
|
// hasDisplayedError (triggered by blur event)
|
|
1307
1335
|
this.hasDisplayedError = false;
|
|
1308
1336
|
// style
|
|
1309
1337
|
this.baseClassName = 'mg-input--checkbox';
|
|
1338
|
+
// "multi" setup
|
|
1310
1339
|
this.multiStart = 5;
|
|
1311
1340
|
this.searchStart = 10;
|
|
1312
|
-
this.searchOffset = 10;
|
|
1313
1341
|
/**
|
|
1314
1342
|
* Handle input event
|
|
1315
1343
|
* @param event - input event
|
|
1316
1344
|
*/
|
|
1317
1345
|
this.handleInput = (event) => {
|
|
1318
|
-
this.
|
|
1319
|
-
|
|
1320
|
-
item.value = Boolean(event.target.checked);
|
|
1321
|
-
}
|
|
1322
|
-
return item;
|
|
1323
|
-
});
|
|
1324
|
-
this.value = this.checkboxItems.map(o => ({ value: o.value, title: o.title, disabled: o.disabled }));
|
|
1346
|
+
this.updateCheckboxItems('value', Boolean(event.target.checked), item => item.id === event.target.id);
|
|
1347
|
+
this.updateValues();
|
|
1325
1348
|
this.checkValidity();
|
|
1326
1349
|
};
|
|
1327
1350
|
/**
|
|
@@ -1332,10 +1355,17 @@ const MgInputCheckbox = class {
|
|
|
1332
1355
|
var _a;
|
|
1333
1356
|
// track "Tab" key event when popover display (is "multi" type selected)
|
|
1334
1357
|
if (event.key === 'Tab' && ((_a = this.mgPopover) === null || _a === void 0 ? void 0 : _a.display)) {
|
|
1335
|
-
|
|
1358
|
+
// when search input and do a back tab we close the popover
|
|
1359
|
+
if (Boolean(this.searchInput) && event.shiftKey && this.searchInput.id === event.target.id) {
|
|
1360
|
+
this.mgPopover.display = false;
|
|
1361
|
+
return;
|
|
1362
|
+
}
|
|
1363
|
+
const enableInputs = Array.from(this.element.shadowRoot.querySelectorAll('input'))
|
|
1364
|
+
.filter(input => !Boolean(input.getAttribute('disabled')))
|
|
1365
|
+
.map(({ id }) => id);
|
|
1336
1366
|
const originInputIndex = enableInputs.findIndex(id => id === event.target.id);
|
|
1337
1367
|
// close popover when tab trigger focus outside its DOM
|
|
1338
|
-
if ((originInputIndex + 1 >= enableInputs.length && !event.shiftKey) || (originInputIndex === 0 && event.shiftKey))
|
|
1368
|
+
if ((originInputIndex + 1 >= enableInputs.length && !event.shiftKey) || (originInputIndex === 0 && event.shiftKey && !Boolean(this.searchInput)))
|
|
1339
1369
|
this.mgPopover.display = false;
|
|
1340
1370
|
}
|
|
1341
1371
|
};
|
|
@@ -1355,29 +1385,54 @@ const MgInputCheckbox = class {
|
|
|
1355
1385
|
this.searchValue = event.detail;
|
|
1356
1386
|
};
|
|
1357
1387
|
/**
|
|
1358
|
-
*
|
|
1359
|
-
* @param event -
|
|
1388
|
+
* popover display-change handler
|
|
1389
|
+
* @param event - mg-popover display-change custom event
|
|
1360
1390
|
*/
|
|
1361
|
-
this.handleCurrentPageChange = (event) => {
|
|
1362
|
-
this.currentSearchPage = Number(event.detail);
|
|
1363
|
-
};
|
|
1364
1391
|
this.handleMgPopoverDisplayChange = (event) => {
|
|
1365
1392
|
// reset search value
|
|
1366
1393
|
if (!event.detail) {
|
|
1367
1394
|
this.searchValue = '';
|
|
1368
|
-
this.
|
|
1395
|
+
this.checkValidity();
|
|
1369
1396
|
}
|
|
1370
1397
|
};
|
|
1398
|
+
/**
|
|
1399
|
+
* Handle select all button
|
|
1400
|
+
* @param event - mass action event trigger a global select/unselect on values
|
|
1401
|
+
*/
|
|
1402
|
+
this.handleMassAction = (event) => {
|
|
1403
|
+
this.updateCheckboxItems('value', event.detail !== 'selected');
|
|
1404
|
+
this.updateValues();
|
|
1405
|
+
};
|
|
1406
|
+
/**
|
|
1407
|
+
* Update values
|
|
1408
|
+
*/
|
|
1409
|
+
this.updateValues = () => {
|
|
1410
|
+
this.value = this.checkboxItems.map(o => ({ value: o.value, title: o.title, disabled: o.disabled }));
|
|
1411
|
+
};
|
|
1371
1412
|
/**
|
|
1372
1413
|
* get invalid element
|
|
1373
1414
|
* @returns element
|
|
1374
1415
|
*/
|
|
1375
|
-
this.getInvalidElement = () =>
|
|
1416
|
+
this.getInvalidElement = () => {
|
|
1417
|
+
const items = Array.from(this.element.shadowRoot.querySelectorAll('input[type="checkbox"]'));
|
|
1418
|
+
return items.find(input => input !== null && !input.disabled && !input.checkValidity());
|
|
1419
|
+
};
|
|
1420
|
+
/**
|
|
1421
|
+
* Method to update searchResults
|
|
1422
|
+
*/
|
|
1423
|
+
this.updateSearchResults = () => {
|
|
1424
|
+
this.searchResults = this.checkboxItems.filter(item => item.title.toLocaleLowerCase().includes(this.searchValue.trim().toLocaleLowerCase()));
|
|
1425
|
+
};
|
|
1426
|
+
/**
|
|
1427
|
+
* Methode to validate if one of inputs value is checked id required
|
|
1428
|
+
* @returns truthy if condition is valid
|
|
1429
|
+
*/
|
|
1430
|
+
this.validateRequired = () => !this.required || this.checkboxItems.some(({ value }) => value);
|
|
1376
1431
|
/**
|
|
1377
1432
|
* Check if input is valid
|
|
1378
1433
|
*/
|
|
1379
1434
|
this.checkValidity = () => {
|
|
1380
|
-
this.valid = this.readonly || this.disabled || this.getInvalidElement() === undefined;
|
|
1435
|
+
this.valid = this.readonly || this.disabled || (this.getInvalidElement() === undefined && this.validateRequired());
|
|
1381
1436
|
this.invalid = !this.valid;
|
|
1382
1437
|
// We need to send valid event even if it is the same value
|
|
1383
1438
|
this.inputValid.emit(this.valid);
|
|
@@ -1397,14 +1452,13 @@ const MgInputCheckbox = class {
|
|
|
1397
1452
|
};
|
|
1398
1453
|
/**
|
|
1399
1454
|
* Set input error message
|
|
1455
|
+
* @param displayError - dispay error condition
|
|
1400
1456
|
*/
|
|
1401
|
-
this.setErrorMessage = () => {
|
|
1402
|
-
const invalidElement = this.getInvalidElement();
|
|
1457
|
+
this.setErrorMessage = (displayError = true) => {
|
|
1403
1458
|
// Set error message
|
|
1404
1459
|
this.errorMessage = undefined;
|
|
1405
|
-
if (!this.valid &&
|
|
1460
|
+
if (displayError && !this.valid && !this.validateRequired())
|
|
1406
1461
|
this.errorMessage = this.messages.errors.required;
|
|
1407
|
-
}
|
|
1408
1462
|
};
|
|
1409
1463
|
/**
|
|
1410
1464
|
* Method to get mg-popover identifier
|
|
@@ -1416,12 +1470,6 @@ const MgInputCheckbox = class {
|
|
|
1416
1470
|
* @returns items to display
|
|
1417
1471
|
*/
|
|
1418
1472
|
this.getDisplayItems = () => (this.searchValue.length > 0 ? this.searchResults : this.checkboxItems);
|
|
1419
|
-
/**
|
|
1420
|
-
* Method to get pagination total-page
|
|
1421
|
-
* @param checkboxes - checkboxes to paginate
|
|
1422
|
-
* @returns total page number for pagination
|
|
1423
|
-
*/
|
|
1424
|
-
this.getPaginationTotalPages = (checkboxes) => Math.ceil(checkboxes.length / this.searchOffset);
|
|
1425
1473
|
this.value = undefined;
|
|
1426
1474
|
this.type = checkboxTypes[0];
|
|
1427
1475
|
this.identifier = undefined;
|
|
@@ -1442,7 +1490,6 @@ const MgInputCheckbox = class {
|
|
|
1442
1490
|
this.errorMessage = undefined;
|
|
1443
1491
|
this.checkboxItems = [];
|
|
1444
1492
|
this.displaySearchInput = undefined;
|
|
1445
|
-
this.currentSearchPage = 0;
|
|
1446
1493
|
this.searchValue = '';
|
|
1447
1494
|
this.searchResults = [];
|
|
1448
1495
|
}
|
|
@@ -1453,6 +1500,10 @@ const MgInputCheckbox = class {
|
|
|
1453
1500
|
title: item.title,
|
|
1454
1501
|
value: item.value,
|
|
1455
1502
|
disabled: item.disabled,
|
|
1503
|
+
required: item.required,
|
|
1504
|
+
handleInput: this.handleInput.bind(this),
|
|
1505
|
+
handleBlur: this.handleBlur.bind(this),
|
|
1506
|
+
handleKeydown: this.handleKeydown.bind(this),
|
|
1456
1507
|
}));
|
|
1457
1508
|
this.valueChange.emit(newValue);
|
|
1458
1509
|
}
|
|
@@ -1479,13 +1530,12 @@ const MgInputCheckbox = class {
|
|
|
1479
1530
|
throw new Error('<mg-input-checkbox> prop "displaySelectedValues" can only be used with prop type "multi".');
|
|
1480
1531
|
}
|
|
1481
1532
|
handleValidityChange(newValue, _oldValue, prop) {
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
});
|
|
1533
|
+
if (prop !== 'readonly')
|
|
1534
|
+
this.updateCheckboxItems(prop, newValue);
|
|
1485
1535
|
this.checkValidity();
|
|
1486
1536
|
if (this.hasDisplayedError) {
|
|
1487
|
-
this.
|
|
1488
|
-
this.hasDisplayedError
|
|
1537
|
+
this.hasDisplayedError = prop !== 'required';
|
|
1538
|
+
this.setErrorMessage(this.hasDisplayedError);
|
|
1489
1539
|
}
|
|
1490
1540
|
}
|
|
1491
1541
|
validateDisabled(newValue) {
|
|
@@ -1498,13 +1548,15 @@ const MgInputCheckbox = class {
|
|
|
1498
1548
|
validateCheckboxItems(newValue) {
|
|
1499
1549
|
if (newValue.length > this.multiStart)
|
|
1500
1550
|
this.type = 'multi';
|
|
1501
|
-
if (newValue.length > this.searchStart)
|
|
1551
|
+
if (newValue.length > this.searchStart) {
|
|
1502
1552
|
this.displaySearchInput = this.type === 'multi';
|
|
1553
|
+
// refresh search values
|
|
1554
|
+
this.updateSearchResults();
|
|
1555
|
+
}
|
|
1503
1556
|
}
|
|
1504
|
-
validateSearchValue(
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
this.setCurrentSearchPage();
|
|
1557
|
+
validateSearchValue() {
|
|
1558
|
+
// refresh search values
|
|
1559
|
+
this.updateSearchResults();
|
|
1508
1560
|
}
|
|
1509
1561
|
/**
|
|
1510
1562
|
* Public method to display errors
|
|
@@ -1515,29 +1567,17 @@ const MgInputCheckbox = class {
|
|
|
1515
1567
|
this.hasDisplayedError = this.invalid;
|
|
1516
1568
|
}
|
|
1517
1569
|
/**
|
|
1518
|
-
*
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
}
|
|
1523
|
-
/**
|
|
1524
|
-
* Method to get a array range
|
|
1525
|
-
* @param from - array start index
|
|
1526
|
-
* @param to - array end index
|
|
1527
|
-
* @returns array's range
|
|
1528
|
-
*/
|
|
1529
|
-
getArrayRange(array, from, to) {
|
|
1530
|
-
return array.slice(from, to);
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Get from and to index
|
|
1534
|
-
* @returns [from,to] index
|
|
1570
|
+
* Update ckecboxes item
|
|
1571
|
+
* @param key - property to update
|
|
1572
|
+
* @param newValue - value to update with
|
|
1573
|
+
* @param condition - condtion to applu change on item
|
|
1535
1574
|
*/
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1575
|
+
updateCheckboxItems(key, newValue, condition) {
|
|
1576
|
+
this.checkboxItems = this.checkboxItems.map(item => {
|
|
1577
|
+
if ((typeof condition === 'function' && condition(item)) || condition === undefined)
|
|
1578
|
+
item[key] = newValue;
|
|
1579
|
+
return item;
|
|
1580
|
+
});
|
|
1541
1581
|
}
|
|
1542
1582
|
/*************
|
|
1543
1583
|
* Lifecycle *
|
|
@@ -1554,7 +1594,6 @@ const MgInputCheckbox = class {
|
|
|
1554
1594
|
this.validateValue(this.value);
|
|
1555
1595
|
this.validateDisabled(this.disabled);
|
|
1556
1596
|
this.validateDisplaySelectedValues(this.displaySelectedValues);
|
|
1557
|
-
this.setCurrentSearchPage();
|
|
1558
1597
|
// Check validity when component is ready
|
|
1559
1598
|
// return a promise to process action only in the FIRST render().
|
|
1560
1599
|
// https://stenciljs.com/docs/component-lifecycle#componentwillload
|
|
@@ -1562,6 +1601,14 @@ const MgInputCheckbox = class {
|
|
|
1562
1601
|
this.checkValidity();
|
|
1563
1602
|
}, 0);
|
|
1564
1603
|
}
|
|
1604
|
+
/**
|
|
1605
|
+
* add listeners
|
|
1606
|
+
*/
|
|
1607
|
+
componentDidLoad() {
|
|
1608
|
+
var _a, _b;
|
|
1609
|
+
this.searchInput = (_a = this.element.shadowRoot.querySelector('mg-input-text')) === null || _a === void 0 ? void 0 : _a.shadowRoot.querySelector('input');
|
|
1610
|
+
(_b = this.searchInput) === null || _b === void 0 ? void 0 : _b.addEventListener('keydown', this.handleKeydown);
|
|
1611
|
+
}
|
|
1565
1612
|
/**
|
|
1566
1613
|
* Render checkbox multi display values
|
|
1567
1614
|
* @param selectedValuesNb - selected values length
|
|
@@ -1578,16 +1625,25 @@ const MgInputCheckbox = class {
|
|
|
1578
1625
|
}
|
|
1579
1626
|
}
|
|
1580
1627
|
/**
|
|
1581
|
-
* Render
|
|
1628
|
+
* Render checkboxes by section
|
|
1582
1629
|
* @param checkboxes - checkboxes to render
|
|
1583
|
-
* @returns
|
|
1630
|
+
* @returns render sections of checkboxes
|
|
1584
1631
|
*/
|
|
1585
|
-
|
|
1586
|
-
const [
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1632
|
+
renderCheckboxBySection(checkboxes) {
|
|
1633
|
+
const [checkedValues, notCheckedValues] = checkboxes.reduce((acc, curr) => {
|
|
1634
|
+
acc[curr.value ? 0 : 1].push(curr);
|
|
1635
|
+
return acc;
|
|
1636
|
+
}, [[], []]);
|
|
1637
|
+
const baseSection = {
|
|
1638
|
+
readonly: this.readonly,
|
|
1639
|
+
disabled: this.disabled,
|
|
1640
|
+
identifier: this.identifier,
|
|
1641
|
+
};
|
|
1642
|
+
const sections = [
|
|
1643
|
+
Object.assign(Object.assign({}, baseSection), { sectionKind: SectionKind.SELECTED, checkboxes: checkedValues, messages: this.messages.input.checkbox.sections.selected }),
|
|
1644
|
+
Object.assign(Object.assign({}, baseSection), { sectionKind: SectionKind.NOT_SELECTED, checkboxes: notCheckedValues, messages: this.messages.input.checkbox.sections.notSelected }),
|
|
1590
1645
|
];
|
|
1646
|
+
return sections.map(section => index.h("mg-input-checkbox-paginated", Object.assign({}, section, { "onMass-action": this.handleMassAction })));
|
|
1591
1647
|
}
|
|
1592
1648
|
/**
|
|
1593
1649
|
* render checkbox multi element
|
|
@@ -1602,31 +1658,14 @@ const MgInputCheckbox = class {
|
|
|
1602
1658
|
} }, index.h("mg-button", { variant: "secondary" }, index.h("mg-icon", { icon: "list" }), this.renderButtonText(selectedValuesNb)), index.h("div", { slot: "content" }, this.displaySearchInput && [
|
|
1603
1659
|
index.h("mg-input-text", { key: "input-search", identifier: `${this.identifier}-input-search`, icon: "magnifying-glass", type: "search", placeholder: this.messages.input.checkbox.label, label: this.messages.input.checkbox.label, mgWidth: "full", value: this.searchValue, labelHide: true, displayCharacterLeft: false, name: "q", "onValue-change": this.handleSearchChange, "aria-controls": "search-results items-list" }),
|
|
1604
1660
|
index.h("p", { key: "search-results", role: "status", class: "sr-only", id: "search-results" }, `${checkboxes.length} ${this.messages.input.checkbox[checkboxes.length > 0 ? 'results' : 'result']}`),
|
|
1605
|
-
], this.displaySearchInput
|
|
1606
|
-
}
|
|
1607
|
-
/**
|
|
1608
|
-
* Render checkbox element
|
|
1609
|
-
* @param checkboxes - checkboxes to render
|
|
1610
|
-
* @returns HTML Element
|
|
1611
|
-
*/
|
|
1612
|
-
renderCheckboxes(checkboxes) {
|
|
1613
|
-
return (index.h("ul", { class: {
|
|
1614
|
-
'mg-input__input-group-container': true,
|
|
1615
|
-
'mg-input__input-group-container--vertical': this.inputVerticalList || (this.type === 'multi' && !this.readonly),
|
|
1616
|
-
'mg-input__input-checkbox-multi-inputs': this.type === 'multi' && !this.readonly,
|
|
1617
|
-
}, role: "list", "aria-describedby": this.displaySearchInput ? 'search-results' : false, "aria-label": this.displaySearchInput ? this.messages.input.checkbox.searchResults : false, "aria-live": this.displaySearchInput ? 'polite' : false, id: "items-list", key: "checkboxes" }, checkboxes
|
|
1618
|
-
.filter(item => !this.readonly || item.value)
|
|
1619
|
-
.map((input, index$1) => (index.h("li", { key: input.id, class: { 'mg-input__input-group': true, 'mg-input__input-group--disabled': this.disabled || input.disabled } }, index.h("input", { type: "checkbox", id: input.id, name: this.identifier, value: input.value && input.value.toString(), checked: Boolean(input.value), disabled: this.readonly || this.disabled || input.disabled, required: this.required, indeterminate: input.value === null, onInput: this.handleInput, onBlur: this.handleBlur, onKeyDown: this.handleKeydown, ref: el => {
|
|
1620
|
-
if (el !== null)
|
|
1621
|
-
this.inputs[index$1] = el;
|
|
1622
|
-
} }), index.h("label", { htmlFor: input.id }, input.title))))));
|
|
1661
|
+
], this.displaySearchInput ? (index.h("div", { class: "mg-input__input-checkbox-multi-sections-container" }, this.renderCheckboxBySection(checkboxes))) : (index.h(MgInputCheckboxList, { checkboxes: checkboxes, inputVerticalList: true, type: this.type, readonly: this.readonly, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name })), this.displaySearchInput && checkboxes.length === 0 && index.h("p", { class: "mg-input__input-checkbox-multi-no-result" }, this.messages.input.checkbox.noResult)))));
|
|
1623
1662
|
}
|
|
1624
1663
|
/**
|
|
1625
1664
|
* Render
|
|
1626
1665
|
* @returns HTML Element
|
|
1627
1666
|
*/
|
|
1628
1667
|
render() {
|
|
1629
|
-
return (index.h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value && this.value.toString(), readonlyValue: undefined, tooltip: !this.readonly ? this.tooltip : undefined, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined, isFieldset: true }, this.type === 'checkbox' || this.readonly ?
|
|
1668
|
+
return (index.h(MgInput, { identifier: this.identifier, classCollection: this.classCollection, ariaDescribedbyIDs: [], label: this.label, labelOnTop: this.labelOnTop, labelHide: this.labelHide, required: !this.readonly ? this.required : undefined, readonly: undefined, mgWidth: undefined, disabled: this.disabled, value: this.value && this.value.toString(), readonlyValue: undefined, tooltip: !this.readonly ? this.tooltip : undefined, helpText: !this.readonly ? this.helpText : undefined, errorMessage: !this.readonly ? this.errorMessage : undefined, isFieldset: true }, this.type === 'checkbox' || this.readonly ? (index.h(MgInputCheckboxList, { checkboxes: this.checkboxItems, inputVerticalList: this.inputVerticalList, type: this.type, readonly: this.readonly, displaySearchInput: this.displaySearchInput, messages: this.messages.input.checkbox, id: "checkboxes-list", disabled: this.disabled, name: this.name })) : (this.renderCheckboxMulti())));
|
|
1630
1669
|
}
|
|
1631
1670
|
get element() { return index.getElement(this); }
|
|
1632
1671
|
static get watchers() { return {
|
|
@@ -1642,6 +1681,109 @@ const MgInputCheckbox = class {
|
|
|
1642
1681
|
};
|
|
1643
1682
|
MgInputCheckbox.style = mgInputCheckboxCss;
|
|
1644
1683
|
|
|
1684
|
+
const MgInputCheckboxPaginated = class {
|
|
1685
|
+
constructor(hostRef) {
|
|
1686
|
+
index.registerInstance(this, hostRef);
|
|
1687
|
+
this.massAction = index.createEvent(this, "mass-action", 7);
|
|
1688
|
+
/*************
|
|
1689
|
+
* Constantes *
|
|
1690
|
+
*************/
|
|
1691
|
+
this.offset = 10;
|
|
1692
|
+
/***********
|
|
1693
|
+
* Methods *
|
|
1694
|
+
***********/
|
|
1695
|
+
/**
|
|
1696
|
+
* Mass action handler
|
|
1697
|
+
*/
|
|
1698
|
+
this.massActionHandler = () => {
|
|
1699
|
+
this.massAction.emit(this.sectionKind);
|
|
1700
|
+
};
|
|
1701
|
+
/**
|
|
1702
|
+
* Toogle items button handler
|
|
1703
|
+
*/
|
|
1704
|
+
this.handleToggleClick = () => {
|
|
1705
|
+
this.itemsExpanded = !this.itemsExpanded;
|
|
1706
|
+
};
|
|
1707
|
+
/**
|
|
1708
|
+
* Method to get a array range
|
|
1709
|
+
* @param from - array start index
|
|
1710
|
+
* @param to - array end index
|
|
1711
|
+
* @returns array's range
|
|
1712
|
+
*/
|
|
1713
|
+
this.getArrayRange = (array, from, to) => array.slice(from, to);
|
|
1714
|
+
/**
|
|
1715
|
+
* Method to get page count from items
|
|
1716
|
+
* @param items - items to count
|
|
1717
|
+
* @returns page count from items
|
|
1718
|
+
*/
|
|
1719
|
+
this.getPageCount = (item) => Math.ceil(item.length / this.offset);
|
|
1720
|
+
/**
|
|
1721
|
+
* Handle mg-pagination current page change event
|
|
1722
|
+
* @param event - pagination current page change event
|
|
1723
|
+
*/
|
|
1724
|
+
this.handleCurrentPageChange = (event) => {
|
|
1725
|
+
this.currentPage = Number(event.detail);
|
|
1726
|
+
};
|
|
1727
|
+
this.readonly = undefined;
|
|
1728
|
+
this.disabled = undefined;
|
|
1729
|
+
this.name = undefined;
|
|
1730
|
+
this.checkboxes = [];
|
|
1731
|
+
this.sectionKind = undefined;
|
|
1732
|
+
this.messages = undefined;
|
|
1733
|
+
this.titleKind = undefined;
|
|
1734
|
+
this.currentPage = 1;
|
|
1735
|
+
this.itemsExpanded = true;
|
|
1736
|
+
}
|
|
1737
|
+
validateCheckboxes(newValue, oldValue) {
|
|
1738
|
+
// after each array.length update we reset pagination
|
|
1739
|
+
// when items fill on page, we set current page to 1
|
|
1740
|
+
if (this.getPageCount(newValue) === 1)
|
|
1741
|
+
this.currentPage = 1;
|
|
1742
|
+
// when old items page numbers match the current page AND new items page number is lower than current page, we set the new last page
|
|
1743
|
+
else if (this.getPageCount(oldValue) === this.currentPage && this.getPageCount(newValue) < this.currentPage)
|
|
1744
|
+
this.currentPage = this.getPageCount(newValue);
|
|
1745
|
+
}
|
|
1746
|
+
validateSectionKind(newValue) {
|
|
1747
|
+
if (newValue === SectionKind.SELECTED)
|
|
1748
|
+
this.titleKind = SectionTitleKind.BUTTON;
|
|
1749
|
+
else
|
|
1750
|
+
this.titleKind = SectionTitleKind.TEXT;
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Get from and to index
|
|
1754
|
+
* @returns [from,to] index
|
|
1755
|
+
*/
|
|
1756
|
+
getFromToIndexes() {
|
|
1757
|
+
const isFirstPage = this.currentPage === 1;
|
|
1758
|
+
const checkboxItemsFromIndex = isFirstPage ? 0 : (this.currentPage - 1) * this.offset;
|
|
1759
|
+
const checkboxItemsToIndex = isFirstPage ? this.offset : this.currentPage * this.offset;
|
|
1760
|
+
return [checkboxItemsFromIndex, checkboxItemsToIndex];
|
|
1761
|
+
}
|
|
1762
|
+
/*************
|
|
1763
|
+
* Lifecycle *
|
|
1764
|
+
*************/
|
|
1765
|
+
/**
|
|
1766
|
+
* Check if component props are well configured on init
|
|
1767
|
+
*/
|
|
1768
|
+
componentWillLoad() {
|
|
1769
|
+
this.validateSectionKind(this.sectionKind);
|
|
1770
|
+
}
|
|
1771
|
+
/**
|
|
1772
|
+
* Render
|
|
1773
|
+
* @returns HTML Element
|
|
1774
|
+
*/
|
|
1775
|
+
render() {
|
|
1776
|
+
const [checkboxItemsFromIndex, checkboxItemsToIndex] = this.getFromToIndexes();
|
|
1777
|
+
const itemsContainerId = `items-${this.sectionKind}-container`;
|
|
1778
|
+
const getText = (checkboxes) => index.h("em", null, `${this.messages[checkboxes.length > 1 ? 'titlePlurial' : 'title']} (${checkboxes.length})`);
|
|
1779
|
+
return (index.h(index.Host, { hidden: this.checkboxes.length < 1 }, index.h("div", { class: "mg-input__input-checkbox-multi-section-header" }, this.titleKind === SectionTitleKind.BUTTON ? (index.h("mg-button", { variant: "flat", onClick: this.handleToggleClick, "aria-controls": itemsContainerId, "aria-expanded": this.itemsExpanded.toString() }, index.h("mg-icon", { icon: this.itemsExpanded ? 'chevron-up' : 'chevron-down', size: "small" }), index.h("span", { class: "mg-input__input-checkbox-multi-text" }, getText(this.checkboxes)))) : (index.h("p", { class: "mg-input__input-checkbox-multi-title" }, getText(this.checkboxes))), ((this.sectionKind === SectionKind.SELECTED && this.itemsExpanded) || this.sectionKind === SectionKind.NOT_SELECTED) && (index.h("mg-button", { variant: "link", onClick: this.massActionHandler }, this.messages.action)), this.getPageCount(this.checkboxes) > 1 && (index.h("mg-pagination", { key: "search-pagination", totalPages: this.getPageCount(this.checkboxes), currentPage: this.currentPage > 1 ? this.currentPage : 1, "onCurrent-page-change": this.handleCurrentPageChange, hideNavigationLabels: true, hidePageCount: true, identifier: `input-checkbox-pagination-${this.sectionKind}` }))), index.h("div", { hidden: !this.itemsExpanded, id: itemsContainerId, class: "mg-input__input-checkbox-multi-section-content" }, index.h(MgInputCheckboxList, { checkboxes: this.getArrayRange(this.checkboxes, checkboxItemsFromIndex, checkboxItemsToIndex), inputVerticalList: true, type: 'multi', displaySearchInput: true, messages: this.messages, id: `items-${this.sectionKind}`, readonly: this.readonly, disabled: this.disabled, name: this.name }))));
|
|
1780
|
+
}
|
|
1781
|
+
static get watchers() { return {
|
|
1782
|
+
"checkboxes": ["validateCheckboxes"],
|
|
1783
|
+
"sectionKind": ["validateSectionKind"]
|
|
1784
|
+
}; }
|
|
1785
|
+
};
|
|
1786
|
+
|
|
1645
1787
|
var InputError$1;
|
|
1646
1788
|
(function (InputError) {
|
|
1647
1789
|
InputError["MIN"] = "min";
|
|
@@ -3383,7 +3525,7 @@ const MgMenu = class {
|
|
|
3383
3525
|
* @returns HTML Element
|
|
3384
3526
|
*/
|
|
3385
3527
|
render() {
|
|
3386
|
-
return (index.h(index.Host, { role:
|
|
3528
|
+
return (index.h(index.Host, { role: "list", "aria-label": this.label }, index.h("slot", null)));
|
|
3387
3529
|
}
|
|
3388
3530
|
get element() { return index.getElement(this); }
|
|
3389
3531
|
static get watchers() { return {
|
|
@@ -3676,7 +3818,7 @@ const MgMenuItem = class {
|
|
|
3676
3818
|
[`${this.name}__collapse-container`]: true,
|
|
3677
3819
|
[`${this.name}__collapse-container--first-level`]: (this.isInMainMenu || this.isItemMore) && this.isDirection(mgMenu_conf.Direction.HORIZONTAL),
|
|
3678
3820
|
});
|
|
3679
|
-
return (index.h(index.Host, { role:
|
|
3821
|
+
return (index.h(index.Host, { role: "listitem" }, this.displayPopover() ? (index.h("mg-popover", { display: this.expanded, placement: "bottom-start", arrowHide: true, "onDisplay-change": this.handlePopoverDisplay, identifier: this.getPopoverIdentifier() }, this.renderInteractiveElement(), index.h("div", { class: getContainerClasses(), slot: "content" }, this.renderSlot()))) : ([
|
|
3680
3822
|
this.renderInteractiveElement(),
|
|
3681
3823
|
index.h("div", { key: "vertical-container", class: getContainerClasses(), hidden: !this.expanded }, this.renderSlot()),
|
|
3682
3824
|
])));
|
|
@@ -4003,7 +4145,7 @@ var NavigationAction;
|
|
|
4003
4145
|
NavigationAction["PREVIOUS"] = "previous";
|
|
4004
4146
|
})(NavigationAction || (NavigationAction = {}));
|
|
4005
4147
|
|
|
4006
|
-
const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-pagination{display:flex;align-items:center;flex-direction:row}.mg-pagination mg-input-select{margin-right:0.5rem}.mg-pagination mg-button{display:flex}.mg-pagination mg-button:first-of-type{margin-right:1rem}.mg-pagination mg-button:last-of-type{margin-left:1rem}";
|
|
4148
|
+
const mgPaginationCss = ".sr-only{border:0 !important;clip:rect(1px, 1px, 1px, 1px) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){.mg-a11y-animation{animation:none !important;transition:none !important}}.mg-pagination{display:flex;align-items:center;flex-direction:row}.mg-pagination mg-input-select{margin-right:0.5rem}.mg-pagination mg-button{display:flex}.mg-pagination mg-button:first-of-type{margin-right:1rem}.mg-pagination mg-button:last-of-type{margin-left:1rem}.mg-pagination.mg-pagination--hide-page-count mg-button{margin:0}";
|
|
4007
4149
|
|
|
4008
4150
|
/**
|
|
4009
4151
|
* Range generator
|
|
@@ -4060,6 +4202,7 @@ const MgPagination = class {
|
|
|
4060
4202
|
this.identifier = createID('mg-pagination');
|
|
4061
4203
|
this.label = undefined;
|
|
4062
4204
|
this.hideNavigationLabels = undefined;
|
|
4205
|
+
this.hidePageCount = undefined;
|
|
4063
4206
|
this.totalPages = 1;
|
|
4064
4207
|
this.currentPage = 1;
|
|
4065
4208
|
}
|
|
@@ -4102,7 +4245,7 @@ const MgPagination = class {
|
|
|
4102
4245
|
const navigationActionButton = (disabled, action) => (index.h("mg-button", { identifier: `${this.identifier}-button-${action}`, label: this.messages.pagination[`${action}Page`],
|
|
4103
4246
|
// eslint-disable-next-line react/jsx-no-bind
|
|
4104
4247
|
onClick: () => this.handleGoToPage(action, disabled), disabled: disabled, variant: "flat", isIcon: this.hideNavigationLabels }, action === NavigationAction.PREVIOUS && index.h("mg-icon", { icon: "chevron-left" }), !this.hideNavigationLabels && this.messages.general[action], action === NavigationAction.NEXT && index.h("mg-icon", { icon: "chevron-right" })));
|
|
4105
|
-
return (index.h("nav", { "aria-label": this.label, id: this.identifier, class:
|
|
4248
|
+
return (index.h("nav", { "aria-label": this.label, id: this.identifier, class: { 'mg-pagination': true, 'mg-pagination--hide-page-count': this.hidePageCount } }, navigationActionButton(this.currentPage <= 1, NavigationAction.PREVIOUS), !this.hidePageCount && (index.h("mg-input-select", { identifier: `${this.identifier}-select`, items: range(1, this.totalPages).map(page => page.toString()), label: this.messages.pagination.selectPage, "label-hide": true, "on-value-change": this.handleSelect, value: this.currentPage.toString(), "placeholder-hide": true })), index.h("span", { class: "sr-only" }, this.messages.pagination.page, " ", this.currentPage), index.h("span", { class: { 'sr-only': this.hidePageCount } }, "/ ", this.totalPages, " ", this.totalPages > 1 ? this.messages.pagination.pages : this.messages.pagination.page), navigationActionButton(this.currentPage >= this.totalPages, NavigationAction.NEXT)));
|
|
4106
4249
|
}
|
|
4107
4250
|
get element() { return index.getElement(this); }
|
|
4108
4251
|
static get watchers() { return {
|
|
@@ -4112,7 +4255,16 @@ const MgPagination = class {
|
|
|
4112
4255
|
};
|
|
4113
4256
|
MgPagination.style = mgPaginationCss;
|
|
4114
4257
|
|
|
4115
|
-
|
|
4258
|
+
/**
|
|
4259
|
+
* Available expand toggle display options
|
|
4260
|
+
*/
|
|
4261
|
+
const expandToggleDisplays = ['text', 'icon'];
|
|
4262
|
+
/**
|
|
4263
|
+
* Available title positions
|
|
4264
|
+
*/
|
|
4265
|
+
const titlePositions = ['left', 'right'];
|
|
4266
|
+
|
|
4267
|
+
const mgPanelCss = ":host{--mg-card-border:none;--mg-card-padding:0;--mg-card-border-radius:var(--mg-panel-border-radius);--mg-card-background:hsl(var(--mg-panel-background));--mg-card-box-shadow:var(--mg-panel-box-shadow)}.mg-panel__header{display:flex;flex-wrap:wrap;justify-content:space-between;padding:0 1rem 0 0.3rem;align-items:flex-start}.mg-panel__header.mg-panel__header--reverse{padding-right:0.3rem;padding-left:1rem}.mg-panel__header-title,.mg-panel__header-content{display:flex;margin:0.3rem 0}.mg-panel__header-content{padding-left:0.3rem;flex:1 auto;min-height:var(--default-size);align-items:center}.mg-panel__header-title mg-input-text{flex-grow:1;margin-left:0.3rem}.mg-panel__header-title mg-button+mg-button:not([slot=append-input]){margin-left:0.3rem}.mg-panel__header-title.mg-panel__header-title--full{flex:1 1 auto}.mg-panel__collapse-button-content{--font-size:1.4rem;--mg-button-font-weight:600}.mg-panel__content{padding:var(--mg-panel-content-padding)}.mg-panel ::slotted([slot=header-right]){display:flex;flex-wrap:wrap;gap:1rem;margin-left:auto}.mg-panel ::slotted(*){--mg-card-border:var(--mg-card-border-default);--mg-card-padding:var(--mg-card-padding-default);--mg-card-border-radius:var(--mg-card-border-radius-default);--mg-card-background:var(--mg-card-background-default);--mg-card-box-shadow:var(--mg-card-box-shadow-default);--mg-card-max-width:unset;--mg-card-min-width:unset}";
|
|
4116
4268
|
|
|
4117
4269
|
const MgPanel = class {
|
|
4118
4270
|
constructor(hostRef) {
|
|
@@ -4135,9 +4287,8 @@ const MgPanel = class {
|
|
|
4135
4287
|
* Collapse button click handler
|
|
4136
4288
|
*/
|
|
4137
4289
|
this.handleCollapseButton = () => {
|
|
4138
|
-
if (!this.expandToggleDisabled)
|
|
4290
|
+
if (!this.expandToggleDisabled)
|
|
4139
4291
|
this.expanded = !this.expanded;
|
|
4140
|
-
}
|
|
4141
4292
|
};
|
|
4142
4293
|
/**
|
|
4143
4294
|
* Edit button click handler
|
|
@@ -4163,60 +4314,92 @@ const MgPanel = class {
|
|
|
4163
4314
|
* Validate edition button handler
|
|
4164
4315
|
*/
|
|
4165
4316
|
this.handleValidateEditButton = () => {
|
|
4166
|
-
if (this.editInputElement.valid)
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
this.
|
|
4170
|
-
|
|
4317
|
+
if (!this.editInputElement.valid)
|
|
4318
|
+
return;
|
|
4319
|
+
if (this.updatedPanelTitle !== undefined)
|
|
4320
|
+
this.panelTitle = this.updatedPanelTitle;
|
|
4321
|
+
this.toggleIsEditing();
|
|
4171
4322
|
};
|
|
4323
|
+
/*************
|
|
4324
|
+
* Render *
|
|
4325
|
+
*************/
|
|
4172
4326
|
/**
|
|
4173
|
-
*
|
|
4174
|
-
* @returns
|
|
4327
|
+
* Render collapse button
|
|
4328
|
+
* @returns collpase button
|
|
4175
4329
|
*/
|
|
4176
|
-
this.
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4330
|
+
this.renderCollapseButton = () => (index.h("mg-button", { onClick: this.handleCollapseButton, variant: "flat", identifier: `${this.identifier}-collapse-button`, "aria-expanded": this.expanded !== undefined && this.expanded.toString(), "aria-controls": `${this.identifier}-content`, disabled: this.expandToggleDisabled, isIcon: this.expandToggleDisplay === 'icon', label: this.panelTitle }, index.h("span", { class: "mg-panel__collapse-button-content" }, index.h("mg-icon", { icon: this.expanded ? 'chevron-up' : 'chevron-down' }), !this.isEditing && this.expandToggleDisplay !== 'icon' && this.panelTitle)));
|
|
4331
|
+
/**
|
|
4332
|
+
* Render edit button
|
|
4333
|
+
* @returns edit Button
|
|
4334
|
+
*/
|
|
4335
|
+
this.renderEditButton = () => (index.h("mg-button", { key: "edit-button", "is-icon": true, variant: "flat", label: this.messages.panel.editLabel, onClick: this.handleEditButton, identifier: `${this.identifier}-edit-button` }, index.h("mg-icon", { icon: "pen" })));
|
|
4336
|
+
/**
|
|
4337
|
+
* Render input button
|
|
4338
|
+
* @returns edit title input
|
|
4339
|
+
*/
|
|
4340
|
+
this.renderEditInput = () => (index.h("mg-input-text", { key: "edition-input", 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) }, index.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` }, index.h("mg-icon", { icon: "cross" })), index.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` }, index.h("mg-icon", { icon: "check" }))));
|
|
4341
|
+
/**
|
|
4342
|
+
* Render title
|
|
4343
|
+
* @returns title element
|
|
4344
|
+
*/
|
|
4345
|
+
this.renderTitle = () => {
|
|
4346
|
+
const elementsToRender = [this.renderCollapseButton()];
|
|
4347
|
+
if (this.titleEditable) {
|
|
4348
|
+
if (!this.isEditing)
|
|
4349
|
+
elementsToRender.push(this.renderEditButton());
|
|
4350
|
+
else
|
|
4351
|
+
elementsToRender.push(this.renderEditInput());
|
|
4189
4352
|
}
|
|
4190
|
-
return
|
|
4353
|
+
return this.titlePosition === 'right' ? elementsToRender.reverse() : elementsToRender;
|
|
4354
|
+
};
|
|
4355
|
+
/**
|
|
4356
|
+
* Render header children
|
|
4357
|
+
* @returns header child
|
|
4358
|
+
*/
|
|
4359
|
+
this.renderHeaderChildren = () => {
|
|
4360
|
+
const children = [
|
|
4361
|
+
index.h("div", { class: { 'mg-panel__header-title': true, 'mg-panel__header-title--full': this.isEditing, 'mg-panel__header-title--reverse': this.titlePosition === 'right' }, key: this.panelTitle }, this.renderTitle()),
|
|
4362
|
+
index.h("div", { class: "mg-panel__header-content", key: "slot-header" }, index.h("slot", { name: "header-right" })),
|
|
4363
|
+
];
|
|
4364
|
+
return this.titlePosition === 'right' ? children.reverse() : children;
|
|
4191
4365
|
};
|
|
4192
4366
|
this.identifier = createID('mg-panel');
|
|
4193
4367
|
this.panelTitle = undefined;
|
|
4194
4368
|
this.titlePattern = undefined;
|
|
4195
4369
|
this.titlePatternErrorMessage = undefined;
|
|
4370
|
+
this.titleEditable = false;
|
|
4371
|
+
this.titlePosition = titlePositions[0];
|
|
4196
4372
|
this.expanded = false;
|
|
4373
|
+
this.expandToggleDisplay = expandToggleDisplays[0];
|
|
4197
4374
|
this.expandToggleDisabled = undefined;
|
|
4198
|
-
this.titleEditable = false;
|
|
4199
4375
|
this.classCollection = new ClassList(['mg-panel']);
|
|
4200
4376
|
this.isEditing = false;
|
|
4201
4377
|
this.updatedPanelTitle = undefined;
|
|
4202
4378
|
}
|
|
4203
4379
|
validatePanelTitle(newValue) {
|
|
4204
|
-
if (typeof newValue !== 'string' || newValue.trim() === '')
|
|
4380
|
+
if (typeof newValue !== 'string' || newValue.trim() === '')
|
|
4205
4381
|
throw new Error('<mg-panel> prop "panelTitle" is required.');
|
|
4206
|
-
}
|
|
4207
4382
|
this.titleChange.emit(newValue);
|
|
4208
4383
|
}
|
|
4209
4384
|
validatetitlePattern(newValue) {
|
|
4210
|
-
if (newValue !== undefined && !this.titleEditable)
|
|
4385
|
+
if (newValue !== undefined && !this.titleEditable)
|
|
4211
4386
|
throw new Error('<mg-panel> prop "titleEditable" must be set to `true`.');
|
|
4212
|
-
|
|
4213
|
-
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === '')) {
|
|
4387
|
+
if (newValue !== undefined && (this.titlePatternErrorMessage === undefined || this.titlePatternErrorMessage.trim() === ''))
|
|
4214
4388
|
throw new Error('<mg-panel> prop "titlePattern" must be paired with the prop "titlePatternErrorMessage".');
|
|
4215
|
-
|
|
4389
|
+
}
|
|
4390
|
+
validateTitlePosition(newValue) {
|
|
4391
|
+
if (!titlePositions.includes(newValue))
|
|
4392
|
+
throw new Error(`<mg-panel> prop "titlePosition" must be one of: ${titlePositions.join(', ')}.`);
|
|
4216
4393
|
}
|
|
4217
4394
|
handleExpanded(newValue) {
|
|
4218
4395
|
this.expandedChange.emit(newValue);
|
|
4219
4396
|
}
|
|
4397
|
+
validateExpandToggleDisplay(newValue) {
|
|
4398
|
+
if (!expandToggleDisplays.includes(newValue))
|
|
4399
|
+
throw new Error(`<mg-panel> prop "expandToggleDisplay" must be one of: ${expandToggleDisplays.join(', ')}.`);
|
|
4400
|
+
if (newValue === 'icon' && this.titleEditable)
|
|
4401
|
+
this.titleEditable = false;
|
|
4402
|
+
}
|
|
4220
4403
|
/*************
|
|
4221
4404
|
* Lifecycle *
|
|
4222
4405
|
*************/
|
|
@@ -4229,28 +4412,32 @@ const MgPanel = class {
|
|
|
4229
4412
|
// Validate
|
|
4230
4413
|
this.validatetitlePattern(this.titlePattern);
|
|
4231
4414
|
this.validatePanelTitle(this.panelTitle);
|
|
4415
|
+
this.validateExpandToggleDisplay(this.expandToggleDisplay);
|
|
4416
|
+
this.validateTitlePosition(this.titlePosition);
|
|
4232
4417
|
}
|
|
4233
4418
|
/**
|
|
4234
4419
|
* Edit DOM after render
|
|
4235
4420
|
*/
|
|
4236
4421
|
componentDidRender() {
|
|
4237
4422
|
// when we are editing we get focus on edition input
|
|
4238
|
-
if (this.isEditing)
|
|
4423
|
+
if (this.isEditing)
|
|
4239
4424
|
this.editInputElement.setFocus();
|
|
4240
|
-
}
|
|
4241
4425
|
}
|
|
4242
4426
|
/**
|
|
4243
4427
|
* Render component
|
|
4244
|
-
* @returns
|
|
4428
|
+
* @returns rendered component
|
|
4245
4429
|
*/
|
|
4246
4430
|
render() {
|
|
4247
|
-
|
|
4431
|
+
const headerId = `${this.identifier}-header`;
|
|
4432
|
+
return (index.h("section", { class: this.classCollection.join(), id: this.identifier }, index.h("mg-card", null, index.h("header", { class: { 'mg-panel__header': true, 'mg-panel__header--reverse': this.titlePosition === 'right' }, id: headerId }, this.renderHeaderChildren()), index.h("article", { class: "mg-panel__content", id: `${this.identifier}-content`, "aria-labelledby": headerId, hidden: !this.expanded }, index.h("slot", null)))));
|
|
4248
4433
|
}
|
|
4249
4434
|
get element() { return index.getElement(this); }
|
|
4250
4435
|
static get watchers() { return {
|
|
4251
4436
|
"panelTitle": ["validatePanelTitle"],
|
|
4252
4437
|
"titlePattern": ["validatetitlePattern"],
|
|
4253
|
-
"
|
|
4438
|
+
"titlePosition": ["validateTitlePosition"],
|
|
4439
|
+
"expanded": ["handleExpanded"],
|
|
4440
|
+
"expandToggleDisplay": ["validateExpandToggleDisplay"]
|
|
4254
4441
|
}; }
|
|
4255
4442
|
};
|
|
4256
4443
|
MgPanel.style = mgPanelCss;
|
|
@@ -6288,7 +6475,7 @@ var Status;
|
|
|
6288
6475
|
*/
|
|
6289
6476
|
const sizes = ['regular', 'large'];
|
|
6290
6477
|
|
|
6291
|
-
const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular{padding:1rem 2rem}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=metadata]){font-size:var(--font-size)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large{padding:1.5rem 3rem}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=metadata]){font-size:calc(var(--font-size) + 0.2rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:var(--mg-tabs-navigation-button-column-gap, 1rem);background-color:unset;border:none;font-family:var(--font-family);font-weight:400;color:hsl(var(--mg-tabs-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;white-space:nowrap;box-sizing:border-box;cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:var(--mg-disabled-opacity)}.mg-tabs__navigation-button:focus-visible{z-index:10}.mg-tabs__navigation-button:hover:not(.mg-tabs__navigation-button--disabled),.mg-tabs__navigation-button:focus-visible:not(.mg-tabs__navigation-button--disabled){background-color:hsl(var(--mg-tabs-focused-background-color-hsl), 0.1)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--mg-tabs-color-active-hsl));font-weight:600}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--vertical{border-left-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-tabs__navigation-button.mg-tabs__navigation-button--vertical{border-left:0.3rem solid transparent}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap}.mg-tabs__content-container:focus-visible{outline:none}.mg-tabs__navigation-button-text{flex:0 0 content}";
|
|
6478
|
+
const mgTabsCss = ".mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular{padding:1rem 2rem}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular ::slotted([slot=metadata]){font-size:var(--font-size)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1rem - 0.3rem)}.mg-tabs.mg-tabs--size-regular .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-regular.mg-tabs__navigation-button--vertical{padding-left:calc(2rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large{padding:1.5rem 3rem}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button,.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=label]),.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button ::slotted([slot=metadata]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=label]),.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large ::slotted([slot=metadata]){font-size:calc(var(--font-size) + 0.2rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--horizontal{padding-bottom:calc(1.5rem - 0.3rem)}.mg-tabs.mg-tabs--size-large .mg-tabs__navigation-button.mg-tabs__navigation-button--vertical,.mg-tabs__navigation-button.mg-tabs__navigation-button--size-large.mg-tabs__navigation-button--vertical{padding-left:calc(3rem - 0.3rem)}.mg-tabs__navigation-button{display:flex;align-items:center;column-gap:var(--mg-tabs-navigation-button-column-gap, 1rem);background-color:unset;border:none;font-family:var(--font-family);font-weight:400;color:hsl(var(--mg-tabs-color-hsl, var(--color-dark)));line-height:var(--line-height);text-decoration:none;white-space:nowrap;box-sizing:border-box;cursor:pointer}.mg-tabs__navigation-button:disabled,.mg-tabs__navigation-button--disabled{cursor:default;opacity:var(--mg-disabled-opacity)}.mg-tabs__navigation-button:focus-visible{z-index:10}.mg-tabs__navigation-button:hover:not(.mg-tabs__navigation-button--disabled),.mg-tabs__navigation-button:focus-visible:not(.mg-tabs__navigation-button--disabled){background-color:hsl(var(--mg-tabs-focused-background-color-hsl), 0.1)}.mg-tabs__navigation-button.mg-tabs__navigation-button--active{color:hsl(var(--mg-tabs-color-active-hsl));font-weight:600}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--horizontal{border-bottom-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--active.mg-tabs__navigation-button--vertical{border-left-color:hsl(var(--mg-tabs-border-color-active-hsl))}.mg-tabs__navigation-button.mg-tabs__navigation-button--hidden{display:none}.mg-tabs__navigation-button.mg-tabs__navigation-button--horizontal{border-bottom:0.3rem solid transparent}.mg-tabs__navigation-button.mg-tabs__navigation-button--vertical{border-left:0.3rem solid transparent}.mg-tabs__header{display:flex;flex-direction:row;flex-wrap:wrap;border-bottom:var(--mg-tabs-border-bottom)}.mg-tabs__content-container:focus-visible{outline:none}.mg-tabs__navigation-button-text{flex:0 0 content}";
|
|
6292
6479
|
|
|
6293
6480
|
/**
|
|
6294
6481
|
* type TabItem validation function
|
|
@@ -6862,6 +7049,7 @@ exports.mg_form = MgForm;
|
|
|
6862
7049
|
exports.mg_icon = MgIcon;
|
|
6863
7050
|
exports.mg_illustrated_message = MgIllustratedMessage;
|
|
6864
7051
|
exports.mg_input_checkbox = MgInputCheckbox;
|
|
7052
|
+
exports.mg_input_checkbox_paginated = MgInputCheckboxPaginated;
|
|
6865
7053
|
exports.mg_input_date = MgInputDate;
|
|
6866
7054
|
exports.mg_input_numeric = MgInputNumeric;
|
|
6867
7055
|
exports.mg_input_password = MgInputPassword;
|