@mgdis/mg-components 6.15.0 → 6.17.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/events.utils-D5SAtkpQ.js +25 -0
- package/dist/cjs/{index-BGxkpQwi.js → index-DCZEYvlH.js} +48 -29
- package/dist/cjs/{index-iUZvsp-F.js → index-TUElr4Wv.js} +18 -30
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_37.cjs.entry.js +100 -365
- package/dist/cjs/mg-alert.cjs.entry.js +2 -2
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-input-combobox.cjs.entry.js +78 -140
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +4 -4
- package/dist/cjs/{mg-input.conf-CwjEAih3.js → mg-input.conf-WTsvDfpC.js} +0 -7
- package/dist/cjs/mg-loader.cjs.entry.js +2 -2
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +5 -5
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +7 -7
- package/dist/collection/components/atoms/mg-badge/mg-badge.js +6 -6
- package/dist/collection/components/atoms/mg-button/mg-button.js +13 -13
- package/dist/collection/components/atoms/mg-card/mg-card.js +2 -2
- package/dist/collection/components/atoms/mg-divider/mg-divider.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.conf.js +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +32 -26
- package/dist/collection/components/atoms/mg-tag/mg-tag.js +3 -3
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip-content/mg-tooltip-content.js +2 -2
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +6 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +0 -6
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +37 -108
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -2
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +6 -8
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +42 -99
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +82 -167
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +27 -44
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +40 -55
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +26 -26
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +32 -86
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +26 -27
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +33 -82
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +33 -34
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +32 -32
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +27 -161
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +2 -4
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +4 -5
- package/dist/collection/components/molecules/menus/mg-menu-item/mg-menu-item.js +7 -7
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -4
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +4 -4
- package/dist/collection/components/molecules/mg-details/mg-details.js +6 -6
- package/dist/collection/components/molecules/mg-form/mg-form.js +13 -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 +3 -3
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +6 -6
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +7 -8
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +13 -13
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +6 -6
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +6 -6
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +0 -1
- package/dist/collection/components/molecules/mg-table/mg-table.js +2 -3
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +6 -7
- package/dist/collection/locales/en/messages.json +8 -13
- package/dist/collection/locales/fr/messages.json +8 -13
- package/dist/components/index2.js +1 -1
- package/dist/components/index3.js +18 -30
- package/dist/components/mg-action-more.js +4 -2
- package/dist/components/mg-alert.js +4 -2
- package/dist/components/mg-badge2.js +4 -2
- package/dist/components/mg-button2.js +4 -2
- package/dist/components/mg-card2.js +4 -2
- package/dist/components/mg-character-left2.js +4 -2
- package/dist/components/mg-details.js +99 -1
- package/dist/components/mg-divider2.js +4 -2
- package/dist/components/mg-form.js +4 -2
- package/dist/components/mg-icon2.js +29 -21
- package/dist/components/mg-illustrated-message.js +4 -2
- package/dist/components/mg-input-checkbox-paginated2.js +6 -7
- package/dist/components/mg-input-checkbox.js +23 -65
- package/dist/components/mg-input-combobox.js +64 -132
- package/dist/components/mg-input-date.js +8 -29
- package/dist/components/mg-input-numeric.js +8 -27
- package/dist/components/mg-input-password.js +6 -10
- package/dist/components/mg-input-radio.js +16 -55
- package/dist/components/mg-input-rich-text-editor.js +6 -10
- package/dist/components/mg-input-select2.js +12 -46
- package/dist/components/mg-input-text2.js +6 -10
- package/dist/components/mg-input-textarea.js +6 -10
- package/dist/components/mg-input-title2.js +4 -2
- package/dist/components/mg-input-toggle.js +15 -98
- package/dist/components/mg-input2.js +26 -101
- package/dist/components/mg-item-more2.js +8 -4
- package/dist/components/mg-loader2.js +4 -2
- package/dist/components/mg-menu-item2.js +4 -2
- package/dist/components/mg-message2.js +4 -2
- package/dist/components/mg-modal.js +4 -2
- package/dist/components/mg-pagination.js +6 -10
- package/dist/components/mg-panel.js +11 -15
- package/dist/components/mg-popover-content2.js +4 -2
- package/dist/components/mg-popover2.js +4 -2
- package/dist/components/mg-progress.js +4 -2
- package/dist/components/mg-skip-links.js +4 -2
- package/dist/components/mg-table.js +4 -2
- package/dist/components/mg-tabs2.js +4 -2
- package/dist/components/mg-tag.js +4 -2
- package/dist/components/mg-tooltip-content2.js +4 -2
- package/dist/components/mg-tooltip2.js +4 -2
- package/dist/esm/events.utils-yMGqY8YG.js +23 -0
- package/dist/esm/{index-CKB-AnCZ.js → index-CNX6lq0x.js} +18 -30
- package/dist/esm/{index-DhAOnZJn.js → index-T6kOJXP1.js} +48 -29
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_37.entry.js +96 -361
- package/dist/esm/mg-alert.entry.js +2 -2
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-input-combobox.entry.js +59 -121
- package/dist/esm/mg-input-rich-text-editor.entry.js +4 -4
- package/dist/esm/{mg-input.conf-BAUTlb6r.js → mg-input.conf-CNgv8hc5.js} +1 -7
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +1 -1
- package/dist/mg-components/locales/en/messages.json +8 -13
- package/dist/mg-components/locales/fr/messages.json +8 -13
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/{p-47e19783.entry.js → p-0e6b40d6.entry.js} +1 -1
- package/dist/mg-components/{p-67af6274.entry.js → p-397bf67b.entry.js} +1 -1
- package/dist/mg-components/{p-a0fa44cf.entry.js → p-5dc3a1fb.entry.js} +1 -1
- package/dist/mg-components/p-8a69175b.entry.js +1 -0
- package/dist/mg-components/p-CNX6lq0x.js +1 -0
- package/dist/mg-components/p-CNgv8hc5.js +1 -0
- package/dist/mg-components/p-T6kOJXP1.js +2 -0
- package/dist/mg-components/{p-420daa1e.entry.js → p-c5da335e.entry.js} +1 -1
- package/dist/mg-components/p-d84d87ea.entry.js +1 -0
- package/dist/mg-components/p-yMGqY8YG.js +1 -0
- package/dist/types/components/atoms/mg-icon/mg-icon.conf.d.ts +1 -1
- package/dist/types/components/atoms/mg-icon/mg-icon.d.ts +0 -5
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +0 -13
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +4 -15
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +3 -21
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +2 -16
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +0 -18
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +4 -40
- package/dist/types/components.d.ts +7 -63
- package/dist/types/stencil-public-runtime.d.ts +39 -2
- package/dist/types/types/index.d.ts +1 -1
- package/ide/intellij/web-types.json +23 -304
- package/ide/vscode/html-custom-data.json +18 -113
- package/package.json +22 -22
- package/dist/cjs/mg-input.utils-D-ASK4ua.js +0 -49
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.utils.js +0 -21
- package/dist/components/mg-details2.js +0 -99
- package/dist/components/mg-input.utils.js +0 -24
- package/dist/esm/mg-input.utils-BYI03zSi.js +0 -46
- package/dist/mg-components/p-31856cff.entry.js +0 -1
- package/dist/mg-components/p-698dfc6c.entry.js +0 -1
- package/dist/mg-components/p-BAUTlb6r.js +0 -1
- package/dist/mg-components/p-CKB-AnCZ.js +0 -1
- package/dist/mg-components/p-DhAOnZJn.js +0 -2
- package/dist/mg-components/p-PuX-pdL4.js +0 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.utils.d.ts +0 -8
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"tags": [
|
|
4
4
|
{
|
|
5
5
|
"name": "mg-action-more",
|
|
6
|
-
"description": "Attributes:\n- `
|
|
6
|
+
"description": "Attributes:\n- `display-chevron`: Define if chevron is display\n\nProperties:\n- `button`: Define button properties\n- `icon`: Define displayed icon\n- `items`: Define the menu-items elements\n\n",
|
|
7
7
|
"attributes": [
|
|
8
8
|
{
|
|
9
9
|
"name": "button",
|
|
@@ -1501,7 +1501,7 @@
|
|
|
1501
1501
|
},
|
|
1502
1502
|
{
|
|
1503
1503
|
"name": "variant",
|
|
1504
|
-
"description": "Define icon variant color\n\nType: `\"app\" | \"danger\" | \"info\" | \"success\" | \"warning\"`",
|
|
1504
|
+
"description": "Define icon variant color\n\nType: `\"app\" | \"danger\" | \"info\" | \"neutral\" | \"success\" | \"warning\"`",
|
|
1505
1505
|
"values": [
|
|
1506
1506
|
{
|
|
1507
1507
|
"name": "app"
|
|
@@ -1512,6 +1512,9 @@
|
|
|
1512
1512
|
{
|
|
1513
1513
|
"name": "info"
|
|
1514
1514
|
},
|
|
1515
|
+
{
|
|
1516
|
+
"name": "neutral"
|
|
1517
|
+
},
|
|
1515
1518
|
{
|
|
1516
1519
|
"name": "success"
|
|
1517
1520
|
},
|
|
@@ -1650,7 +1653,7 @@
|
|
|
1650
1653
|
},
|
|
1651
1654
|
{
|
|
1652
1655
|
"name": "error-message",
|
|
1653
|
-
"description": "Define error message to display\n\nType: `string
|
|
1656
|
+
"description": "Define error message to display\n\nType: `string`",
|
|
1654
1657
|
"references": [
|
|
1655
1658
|
{
|
|
1656
1659
|
"name": "Storybook",
|
|
@@ -1796,7 +1799,7 @@
|
|
|
1796
1799
|
},
|
|
1797
1800
|
{
|
|
1798
1801
|
"name": "mg-input-checkbox",
|
|
1799
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `display-selected-values`: Display selected values list in \"multi\" type\nThis prop is only applied with prop type \"multi\" or when an \"unset\" mode render a \"multi\" type.\n- `edit-button-message`: Overwrite default \"edit\" button message\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `input-vertical-list`: Define if inputs are display verticaly\n- `invalid`: Define input invalid state\n- `label`: Define input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Define input name\nIf not set the value equals the identifier\n- `
|
|
1802
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `display-selected-values`: Display selected values list in \"multi\" type\nThis prop is only applied with prop type \"multi\" or when an \"unset\" mode render a \"multi\" type.\n- `edit-button-message`: Overwrite default \"edit\" button message\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `input-vertical-list`: Define if inputs are display verticaly\n- `invalid`: Define input invalid state\n- `label`: Define input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Define input name\nIf not set the value equals the identifier\n- `readonly`: Define if mg-input-checkbox is readonly\n- `required`: Define if mg-input-checkbox is required\n- `select-button-message`: Overwrite default \"select\" button message\n- `show-button-message`: Overwrite default \"show\" button message\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `type`: Define checkbox type\nWhen it's undefined the type is dynamic:\n- With 0-5 items type is 'checkbox'\n- With 5-10 items type is 'multi'\nWhen it set the type is locked to the defined value.\nWhen type is dynamic OR with 'multi' type AND Over 10 items \"search\" feature is enabled\n- `valid`: Define input valid state\n\nProperties:\n- `value`: Component value\nIf item.value is `null`, checkbox will be indeterminate by default\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emitted event when value change\n\n",
|
|
1800
1803
|
"attributes": [
|
|
1801
1804
|
{
|
|
1802
1805
|
"name": "disabled",
|
|
@@ -1952,20 +1955,6 @@
|
|
|
1952
1955
|
}
|
|
1953
1956
|
]
|
|
1954
1957
|
},
|
|
1955
|
-
{
|
|
1956
|
-
"name": "no-value-error-detail",
|
|
1957
|
-
"description": "Define no value error detail\n\nType: `string`",
|
|
1958
|
-
"references": [
|
|
1959
|
-
{
|
|
1960
|
-
"name": "Storybook",
|
|
1961
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-checkbox--docs"
|
|
1962
|
-
},
|
|
1963
|
-
{
|
|
1964
|
-
"name": "Sources",
|
|
1965
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.tsx"
|
|
1966
|
-
}
|
|
1967
|
-
]
|
|
1968
|
-
},
|
|
1969
1958
|
{
|
|
1970
1959
|
"name": "readonly",
|
|
1971
1960
|
"description": "Define if mg-input-checkbox is readonly\n\nType: `boolean`",
|
|
@@ -2122,7 +2111,7 @@
|
|
|
2122
2111
|
},
|
|
2123
2112
|
{
|
|
2124
2113
|
"name": "mg-input-combobox",
|
|
2125
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `
|
|
2114
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `fetchurl`: Define API url to fetch\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `items-label`: Define items label\nInclude short description. Required for accessibility.\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `mg-width`: Define input width\n- `name`: Input name\nIf not set the value equals the identifier\n- `placeholder`: Define input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help combobox.\n- `readonly`: Define if input is readonly\n- `required`: Define if input is required\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `valid`: Define input valid state\n- `value`: Define component value\n\nProperties:\n- `fetchmappings`: Define fetch request mappings.\nRequired with `fetchurl`\n- `fetchoptions`: Define fetch options object\nRequire `fetchurl` prop to be defined otherwith it will be ignored if defined\n- `items`: Define components items\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its concombobox by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given concombobox.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `fetch-error`: Emited event when fetch API throw an error\n- `filter-change`: Emited event when filter change\n- `input-valid`: Emited event when checking validity\n- `load-more`: Emited event when `load-more` is called\n- `value-change`: Emited event when value change\n\n",
|
|
2126
2115
|
"attributes": [
|
|
2127
2116
|
{
|
|
2128
2117
|
"name": "disabled",
|
|
@@ -2334,20 +2323,6 @@
|
|
|
2334
2323
|
}
|
|
2335
2324
|
]
|
|
2336
2325
|
},
|
|
2337
|
-
{
|
|
2338
|
-
"name": "no-value-error-detail",
|
|
2339
|
-
"description": "Define no value error detail\n\nType: `string`",
|
|
2340
|
-
"references": [
|
|
2341
|
-
{
|
|
2342
|
-
"name": "Storybook",
|
|
2343
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-combobox--docs"
|
|
2344
|
-
},
|
|
2345
|
-
{
|
|
2346
|
-
"name": "Sources",
|
|
2347
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-combobox/mg-input-combobox.tsx"
|
|
2348
|
-
}
|
|
2349
|
-
]
|
|
2350
|
-
},
|
|
2351
2326
|
{
|
|
2352
2327
|
"name": "placeholder",
|
|
2353
2328
|
"description": "Define input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help combobox.\n\nType: `string`",
|
|
@@ -3416,7 +3391,7 @@
|
|
|
3416
3391
|
},
|
|
3417
3392
|
{
|
|
3418
3393
|
"name": "mg-input-radio",
|
|
3419
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `input-vertical-list`: Define if inputs are display verticaly\n- `invalid`: Define input invalid state\n- `
|
|
3394
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `input-vertical-list`: Define if inputs are display verticaly\n- `invalid`: Define input invalid state\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if input is readonly\n- `required`: Define if input is required\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `valid`: Define input valid state\n- `value`: Component value\n\nProperties:\n- `items`: Items are the possible options to select\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emitted event when value change\n\n",
|
|
3420
3395
|
"attributes": [
|
|
3421
3396
|
{
|
|
3422
3397
|
"name": "disabled",
|
|
@@ -3558,20 +3533,6 @@
|
|
|
3558
3533
|
}
|
|
3559
3534
|
]
|
|
3560
3535
|
},
|
|
3561
|
-
{
|
|
3562
|
-
"name": "no-value-error-detail",
|
|
3563
|
-
"description": "Define no value error detail\n\nType: `string`",
|
|
3564
|
-
"references": [
|
|
3565
|
-
{
|
|
3566
|
-
"name": "Storybook",
|
|
3567
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-radio--docs"
|
|
3568
|
-
},
|
|
3569
|
-
{
|
|
3570
|
-
"name": "Sources",
|
|
3571
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-radio/mg-input-radio.tsx"
|
|
3572
|
-
}
|
|
3573
|
-
]
|
|
3574
|
-
},
|
|
3575
3536
|
{
|
|
3576
3537
|
"name": "readonly",
|
|
3577
3538
|
"description": "Define if input is readonly\n\nType: `boolean`",
|
|
@@ -3678,7 +3639,7 @@
|
|
|
3678
3639
|
},
|
|
3679
3640
|
{
|
|
3680
3641
|
"name": "mg-input-rich-text-editor",
|
|
3681
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `
|
|
3642
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `pattern`: Define input pattern to validate\nPlease refer to the Pattern section in the input documentation for detailed information on using regular expressions in components.\n- `pattern-error-message`: Define input pattern error message\n- `placeholder`: Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n- `readonly`: Define if the editor is readonly\n- `required`: Define if input is required\n- `rows`: Define the number of visible text lines for the control\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `valid`: Define input valid state\n- `value`: Define the value of the editor\nCan be either HTML string or plain text\n\nProperties:\n- `modules`: Editor modules configuration\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `getHTML`: Get editor content as HTML\n- `getText`: Get editor content as plain text\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\n",
|
|
3682
3643
|
"attributes": [
|
|
3683
3644
|
{
|
|
3684
3645
|
"name": "disabled",
|
|
@@ -3954,7 +3915,7 @@
|
|
|
3954
3915
|
},
|
|
3955
3916
|
{
|
|
3956
3917
|
"name": "mg-input-select",
|
|
3957
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `
|
|
3918
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `mg-width`: Define input width\n- `name`: Input name\nIf not set the value equals the identifier\n- `placeholder`: Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n- `placeholder-disabled`: Option to disable placeholder\n- `placeholder-hide`: Option to remove placeholder\n- `readonly`: Define if input is readonly\n- `required`: Define if input is required\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `valid`: Define input valid state\n- `value`: Component value\n\nProperties:\n- `items`: Items are the possible options to select\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\n",
|
|
3958
3919
|
"attributes": [
|
|
3959
3920
|
{
|
|
3960
3921
|
"name": "disabled",
|
|
@@ -4110,20 +4071,6 @@
|
|
|
4110
4071
|
}
|
|
4111
4072
|
]
|
|
4112
4073
|
},
|
|
4113
|
-
{
|
|
4114
|
-
"name": "no-value-error-detail",
|
|
4115
|
-
"description": "Define no value error detail\n\nType: `string`",
|
|
4116
|
-
"references": [
|
|
4117
|
-
{
|
|
4118
|
-
"name": "Storybook",
|
|
4119
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-select--docs"
|
|
4120
|
-
},
|
|
4121
|
-
{
|
|
4122
|
-
"name": "Sources",
|
|
4123
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-select/mg-input-select.tsx"
|
|
4124
|
-
}
|
|
4125
|
-
]
|
|
4126
|
-
},
|
|
4127
4074
|
{
|
|
4128
4075
|
"name": "placeholder",
|
|
4129
4076
|
"description": "Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n\nType: `string`",
|
|
@@ -4272,7 +4219,7 @@
|
|
|
4272
4219
|
},
|
|
4273
4220
|
{
|
|
4274
4221
|
"name": "mg-input-text",
|
|
4275
|
-
"description": "Attributes:\n- `character-left-hide`: Define if component should display character left\n- `
|
|
4222
|
+
"description": "Attributes:\n- `character-left-hide`: Define if component should display character left\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `icon`: Input icon\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `invalid`: Define input invalid state\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `maxlength`: Input max length\n- `mg-width`: Define input width\n- `name`: Input name\nIf not set the value equals the identifier\n- `pattern`: Define input pattern to validate\nPlease refer to the Pattern section in the input documentation for detailed information on using regular expressions in components.\n- `pattern-error-message`: Define input pattern error message\n- `placeholder`: Input placeholder.\nIt should be a word or short phrase that demonstrates the expected type of data, not a replacement for labels or help text.\n- `readonly`: Define if input is readonly\n- `required`: Define if input is required\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `type`: Input type\n- `valid`: Define input valid state\n- `value`: Component value\n\nProperties:\n- `datalistoptions`: Define datalist options\n\nMethods:\n- `displayError`: Display input error if it exists.\n- `reset`: Reset value, validity and error state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\nSlots:\n- `append-input`: Content to display next to the input\n\n",
|
|
4276
4223
|
"attributes": [
|
|
4277
4224
|
{
|
|
4278
4225
|
"name": "character-left-hide",
|
|
@@ -5692,7 +5639,7 @@
|
|
|
5692
5639
|
},
|
|
5693
5640
|
{
|
|
5694
5641
|
"name": "mg-input-toggle",
|
|
5695
|
-
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `
|
|
5642
|
+
"description": "Attributes:\n- `disabled`: Define if input is disabled\n- `help-text`: Add a help text under the input, usually expected data format and example\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\n- `is-icon`: Define if toggle display icon\n- `is-on-off`: Define if toggle have on/off style\n- `label`: Input label\n- `label-hide`: Define if label is visible\n- `label-on-top`: Define if label is displayed on top\n- `name`: Input name\nIf not set the value equals the identifier\n- `readonly`: Define if input is readonly\n- `tooltip`: Add a tooltip message next to the input\n- `tooltip-position`: Define tooltip position\n- `value`: Component value\n\nProperties:\n- `items`: Items are the possible options to select\n\nMethods:\n- `reset`: Reset value, validity, error and visual state\n- `setError`: Set an error and display a custom error message.\nThis method can be used to set the component's error state from its context by passing a boolean value to the `valid` parameter.\nIt must be paired with an error message to display for the given context.\nWhen used to set validity to `false`, you should use this method again to reset the validity to `true`.\n- `setFocus`: Set focus on input.\n\nEvents:\n- `input-valid`: Emited event when checking validity\n- `value-change`: Emited event when value change\n\nSlots:\n- `item-1`: Left option toggle content\n- `item-2`: Right option toggle content\n\n",
|
|
5696
5643
|
"attributes": [
|
|
5697
5644
|
{
|
|
5698
5645
|
"name": "disabled",
|
|
@@ -5736,20 +5683,6 @@
|
|
|
5736
5683
|
}
|
|
5737
5684
|
]
|
|
5738
5685
|
},
|
|
5739
|
-
{
|
|
5740
|
-
"name": "invalid",
|
|
5741
|
-
"description": "Define input invalid state\n\nType: `boolean`",
|
|
5742
|
-
"references": [
|
|
5743
|
-
{
|
|
5744
|
-
"name": "Storybook",
|
|
5745
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs"
|
|
5746
|
-
},
|
|
5747
|
-
{
|
|
5748
|
-
"name": "Sources",
|
|
5749
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-toggle/mg-input-toggle.tsx"
|
|
5750
|
-
}
|
|
5751
|
-
]
|
|
5752
|
-
},
|
|
5753
5686
|
{
|
|
5754
5687
|
"name": "is-icon",
|
|
5755
5688
|
"description": "Define if toggle display icon\n\nType: `boolean`",
|
|
@@ -5848,20 +5781,6 @@
|
|
|
5848
5781
|
}
|
|
5849
5782
|
]
|
|
5850
5783
|
},
|
|
5851
|
-
{
|
|
5852
|
-
"name": "no-value-error-detail",
|
|
5853
|
-
"description": "Define no value error detail\n\nType: `string`",
|
|
5854
|
-
"references": [
|
|
5855
|
-
{
|
|
5856
|
-
"name": "Storybook",
|
|
5857
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs"
|
|
5858
|
-
},
|
|
5859
|
-
{
|
|
5860
|
-
"name": "Sources",
|
|
5861
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-toggle/mg-input-toggle.tsx"
|
|
5862
|
-
}
|
|
5863
|
-
]
|
|
5864
|
-
},
|
|
5865
5784
|
{
|
|
5866
5785
|
"name": "readonly",
|
|
5867
5786
|
"description": "Define if input is readonly\n\nType: `boolean`",
|
|
@@ -5912,20 +5831,6 @@
|
|
|
5912
5831
|
}
|
|
5913
5832
|
]
|
|
5914
5833
|
},
|
|
5915
|
-
{
|
|
5916
|
-
"name": "valid",
|
|
5917
|
-
"description": "Define input valid state\n\nType: `boolean`",
|
|
5918
|
-
"references": [
|
|
5919
|
-
{
|
|
5920
|
-
"name": "Storybook",
|
|
5921
|
-
"url": "http://core.pages.mgdis.fr/core-ui/core-ui/storybook/?path=/docs/molecules-inputs-mg-input-toggle--docs"
|
|
5922
|
-
},
|
|
5923
|
-
{
|
|
5924
|
-
"name": "Sources",
|
|
5925
|
-
"url": "https://gitlab.mgdis.fr/core/core-ui/core-ui/-/tree/master/packages/mg-components/src/components/molecules/inputs/mg-input-toggle/mg-input-toggle.tsx"
|
|
5926
|
-
}
|
|
5927
|
-
]
|
|
5928
|
-
},
|
|
5929
5834
|
{
|
|
5930
5835
|
"name": "value",
|
|
5931
5836
|
"description": "Component value\n\nType: `any`",
|
|
@@ -5998,7 +5903,7 @@
|
|
|
5998
5903
|
},
|
|
5999
5904
|
{
|
|
6000
5905
|
"name": "mg-menu",
|
|
6001
|
-
"description": "Attributes:\n- `direction`: Component display direction.\n- `
|
|
5906
|
+
"description": "Attributes:\n- `direction`: Component display direction.\n- `label`: Menu label. Include short menu description.\nRequired to define accessibility required attribute `aria-label`\n- `size`: Define mg-menu size\n\nProperties:\n- `itemmore`: Customize \"mg-item-more\" element\nUsed with direction: 'vertical' to manage overflow\n\nListeners:\n- `item-loaded`\n\nSlots:\n- ``: Menu content\n\n",
|
|
6002
5907
|
"attributes": [
|
|
6003
5908
|
{
|
|
6004
5909
|
"name": "direction",
|
|
@@ -6363,7 +6268,7 @@
|
|
|
6363
6268
|
},
|
|
6364
6269
|
{
|
|
6365
6270
|
"name": "mg-pagination",
|
|
6366
|
-
"description": "Attributes:\n- `current-page`: Component current page\n- `hide-navigation-labels`: Hide navigation label\n- `hide-page-count`: Hide select input\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `label`: Panignation label. Is a short description.\nCustomize default value can be usefull to improve accessibility\n- `
|
|
6271
|
+
"description": "Attributes:\n- `current-page`: Component current page\n- `hide-navigation-labels`: Hide navigation label\n- `hide-page-count`: Hide select input\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `label`: Panignation label. Is a short description.\nCustomize default value can be usefull to improve accessibility\n- `total-pages`: Component total pages\n\nProperties:\n- `messages`: Define locales messages overrides\n\nEvents:\n- `current-page-change`: Emmited event when current page change\n\n",
|
|
6367
6272
|
"attributes": [
|
|
6368
6273
|
{
|
|
6369
6274
|
"name": "current-page",
|
|
@@ -6890,7 +6795,7 @@
|
|
|
6890
6795
|
},
|
|
6891
6796
|
{
|
|
6892
6797
|
"name": "mg-skip-links",
|
|
6893
|
-
"description": "
|
|
6798
|
+
"description": "Properties:\n- `links`: Skip links\n\nEvents:\n- `go-to-anchor`: Emited event when link is clicked\n\n",
|
|
6894
6799
|
"attributes": [
|
|
6895
6800
|
{
|
|
6896
6801
|
"name": "links",
|
|
@@ -6920,7 +6825,7 @@
|
|
|
6920
6825
|
},
|
|
6921
6826
|
{
|
|
6922
6827
|
"name": "mg-table",
|
|
6923
|
-
"description": "Attributes:\n- `
|
|
6828
|
+
"description": "Attributes:\n- `full-width`: Define if table fits its parent element\n- `size`: Define table size\n\nProperties:\n- `columns`: Define column properties\n\nSlots:\n- ``: Table content\n\n",
|
|
6924
6829
|
"attributes": [
|
|
6925
6830
|
{
|
|
6926
6831
|
"name": "columns",
|
|
@@ -6992,7 +6897,7 @@
|
|
|
6992
6897
|
},
|
|
6993
6898
|
{
|
|
6994
6899
|
"name": "mg-tabs",
|
|
6995
|
-
"description": "Attributes:\n- `active-tab`: Active tab number\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `
|
|
6900
|
+
"description": "Attributes:\n- `active-tab`: Active tab number\n- `identifier`: Identifier is used for the element ID (id is a reserved prop in Stencil.js)\nIf not set, it will be created.\n- `label`: Tabs label. Include short tabs description.\nRequired for accessibility\n- `size`: Define tabs size\n\nProperties:\n- `items`: Tabs items\n\nEvents:\n- `active-tab-change`: Emited event when active tab change\n\nSlots:\n- `tab_content-n`: Tab content, where `n` represents the position of the tab content. It starts at 1.\n\n",
|
|
6996
6901
|
"attributes": [
|
|
6997
6902
|
{
|
|
6998
6903
|
"name": "active-tab",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mgdis/mg-components",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.17.0",
|
|
4
4
|
"description": "MG Components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -34,37 +34,37 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@popperjs/core": "2.11.8",
|
|
37
|
-
"@stencil/core": "4.
|
|
37
|
+
"@stencil/core": "4.38.0",
|
|
38
38
|
"quill": "2.0.3",
|
|
39
|
-
"@mgdis/core-ui-helpers": "1.0.
|
|
40
|
-
"@mgdis/img": "2.5.
|
|
41
|
-
"@mgdis/styles": "2.
|
|
39
|
+
"@mgdis/core-ui-helpers": "1.0.5",
|
|
40
|
+
"@mgdis/img": "2.5.1",
|
|
41
|
+
"@mgdis/styles": "2.12.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@playwright/test": "1.
|
|
45
|
-
"@storybook/addon-a11y": "9.
|
|
46
|
-
"@storybook/addon-docs": "9.
|
|
47
|
-
"@storybook/addon-links": "9.
|
|
48
|
-
"@storybook/html": "9.
|
|
49
|
-
"@storybook/html-vite": "9.
|
|
44
|
+
"@playwright/test": "1.55.0",
|
|
45
|
+
"@storybook/addon-a11y": "9.1.10",
|
|
46
|
+
"@storybook/addon-docs": "9.1.10",
|
|
47
|
+
"@storybook/addon-links": "9.1.10",
|
|
48
|
+
"@storybook/html": "9.1.10",
|
|
49
|
+
"@storybook/html-vite": "9.1.10",
|
|
50
50
|
"@types/jest": "29.5.14",
|
|
51
|
-
"@types/node": "22.
|
|
52
|
-
"chromatic": "13.
|
|
51
|
+
"@types/node": "22.18.8",
|
|
52
|
+
"chromatic": "13.3.0",
|
|
53
53
|
"eslint": "8.57.1",
|
|
54
|
-
"eslint-plugin-storybook": "9.
|
|
54
|
+
"eslint-plugin-storybook": "9.1.10",
|
|
55
55
|
"jest": "29.7.0",
|
|
56
56
|
"jest-cli": "29.7.0",
|
|
57
57
|
"jest-junit": "16.0.0",
|
|
58
58
|
"jest-transform-stub": "2.0.0",
|
|
59
|
-
"react": "19.
|
|
60
|
-
"react-dom": "19.
|
|
61
|
-
"sass": "1.
|
|
62
|
-
"storybook": "9.
|
|
63
|
-
"storybook-addon-tag-badges": "2.0.
|
|
64
|
-
"typescript": "5.
|
|
65
|
-
"vite": "7.
|
|
59
|
+
"react": "19.2.0",
|
|
60
|
+
"react-dom": "19.2.0",
|
|
61
|
+
"sass": "1.93.2",
|
|
62
|
+
"storybook": "9.1.10",
|
|
63
|
+
"storybook-addon-tag-badges": "2.0.2",
|
|
64
|
+
"typescript": "5.9.3",
|
|
65
|
+
"vite": "7.1.9",
|
|
66
66
|
"@core-ui/jest-config": "1.0.9",
|
|
67
|
-
"@mgdis/linting-stencil": "1.3.
|
|
67
|
+
"@mgdis/linting-stencil": "1.3.10"
|
|
68
68
|
},
|
|
69
69
|
"license": "BSD-3-Clause",
|
|
70
70
|
"scripts": {
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var index = require('./index-CpENFzEo.js');
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Keyboard keys
|
|
7
|
-
*/
|
|
8
|
-
const Keys = {
|
|
9
|
-
TAB: 'Tab',
|
|
10
|
-
ENTER: 'Enter',
|
|
11
|
-
DOWN: 'Down',
|
|
12
|
-
UP: 'Up',
|
|
13
|
-
LEFT: 'Left',
|
|
14
|
-
RIGHT: 'Right',
|
|
15
|
-
ARROWDOWN: 'ArrowDown',
|
|
16
|
-
ARROWUP: 'ArrowUp',
|
|
17
|
-
ARROWRIGHT: 'ArrowRight',
|
|
18
|
-
ARROWLEFT: 'ArrowLeft',
|
|
19
|
-
HOME: 'Home',
|
|
20
|
-
END: 'End',
|
|
21
|
-
ESC: 'Esc',
|
|
22
|
-
ESCAPE: 'Escape',
|
|
23
|
-
NUMPADENTER: 'NumpadEnter',
|
|
24
|
-
SPACE: 'Space',
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Define error message
|
|
29
|
-
* @param message - message to display
|
|
30
|
-
* @param details - message detail to display
|
|
31
|
-
* @returns formated MgInput["errorMessage"]
|
|
32
|
-
*/
|
|
33
|
-
const defineErrorMessage = (message, details) => {
|
|
34
|
-
if (index.isValidString(message) && index.isValidString(details)) {
|
|
35
|
-
return {
|
|
36
|
-
summary: message,
|
|
37
|
-
details,
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
else if (index.isValidString(message)) {
|
|
41
|
-
return message;
|
|
42
|
-
}
|
|
43
|
-
else {
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
exports.Keys = Keys;
|
|
49
|
-
exports.defineErrorMessage = defineErrorMessage;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { isValidString } from "@mgdis/core-ui-helpers/dist/utils";
|
|
2
|
-
/**
|
|
3
|
-
* Define error message
|
|
4
|
-
* @param message - message to display
|
|
5
|
-
* @param details - message detail to display
|
|
6
|
-
* @returns formated MgInput["errorMessage"]
|
|
7
|
-
*/
|
|
8
|
-
export const defineErrorMessage = (message, details) => {
|
|
9
|
-
if (isValidString(message) && isValidString(details)) {
|
|
10
|
-
return {
|
|
11
|
-
summary: message,
|
|
12
|
-
details,
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
else if (isValidString(message)) {
|
|
16
|
-
return message;
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
};
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
|
|
2
|
-
import { i as isValidString } from './index2.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './mg-icon2.js';
|
|
4
|
-
|
|
5
|
-
const mgDetailsCss = ".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:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}/*!\n * @prop --mg-c-details-spacing: Defines the spacing between the summary and the details. Default value: `--mg-b-size-8`.\n */.mg-c-details summary{display:inline-flex;align-items:baseline;cursor:pointer;gap:var(--mg-b-size-16)}.mg-c-details summary::-webkit-details-marker{display:none}.mg-c-details.mg-c-details--empty-summary summary{gap:unset}.mg-c-details__toggle{display:flex;min-height:calc(var(--mg-b-font-size)*var(--mg-b-line-height));flex-shrink:0;align-items:center;align-self:flex-start;gap:var(--mg-b-size-4)}.mg-c-details__toggle-icon.mg-c-details__toggle-icon--reverse{transform:rotate(180deg)}.mg-c-details__details{margin-top:var(--mg-c-details-spacing)}@media (width < 43.75rem){.mg-c-details:not(.mg-c-details--empty-summary) .mg-c-details__toggle>span{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}}";
|
|
6
|
-
|
|
7
|
-
const MgDetails = /*@__PURE__*/ proxyCustomElement(class MgDetails extends HTMLElement {
|
|
8
|
-
constructor() {
|
|
9
|
-
super();
|
|
10
|
-
this.__registerHost();
|
|
11
|
-
this.__attachShadow();
|
|
12
|
-
this.expandedChange = createEvent(this, "expanded-change", 7);
|
|
13
|
-
/**
|
|
14
|
-
* Hide summary element
|
|
15
|
-
*/
|
|
16
|
-
this.hideSummary = false;
|
|
17
|
-
/**
|
|
18
|
-
* Define if details are diplayed
|
|
19
|
-
*/
|
|
20
|
-
this.expanded = false;
|
|
21
|
-
/**
|
|
22
|
-
* Handle details toggle
|
|
23
|
-
*/
|
|
24
|
-
this.handleToggle = () => {
|
|
25
|
-
this.expanded = this.details.open;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
validateTitles(newValue) {
|
|
29
|
-
if (!isValidString(newValue)) {
|
|
30
|
-
throw new Error(`<mg-details> prop "toggleClosed" and "toggleOpened" is required and must be a valid string. Passed value: "toggleClosed='${this.toggleClosed}'" and "toggleOpened='${this.toggleOpened}'".`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
handleExpanded(newValue) {
|
|
34
|
-
this.expandedChange.emit(newValue);
|
|
35
|
-
}
|
|
36
|
-
/*************
|
|
37
|
-
* Lifecycle *
|
|
38
|
-
*************/
|
|
39
|
-
/**
|
|
40
|
-
* Check if component props are well configured on init
|
|
41
|
-
*/
|
|
42
|
-
componentWillLoad() {
|
|
43
|
-
this.validateTitles(this.toggleClosed);
|
|
44
|
-
this.validateTitles(this.toggleOpened);
|
|
45
|
-
// Check if summary slot is empty
|
|
46
|
-
const summarySlot = this.element.querySelector('[slot="summary"]');
|
|
47
|
-
this.isEmptySummary = summarySlot === null || !isValidString(summarySlot.textContent);
|
|
48
|
-
// Add event listener to prevent default action on summary click
|
|
49
|
-
this.element.addEventListener('click', (event) => {
|
|
50
|
-
if (event.target.closest('[slot="summary"] mg-button, mg-button[slot="summary"]') !== null) {
|
|
51
|
-
event.preventDefault();
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Render
|
|
57
|
-
* @returns HTML Element
|
|
58
|
-
*/
|
|
59
|
-
render() {
|
|
60
|
-
return (h("details", { key: '4da17afd7a964a14b5b101bcfadc241be569d55a', class: { 'mg-c-details': true, 'mg-c-details--empty-summary': this.isEmptySummary }, onToggle: this.handleToggle, open: this.expanded, ref: (el) => (this.details = el) }, h("summary", { key: '515d6c4e117b547fe80a310fb90e114900f645e8' }, h("slot", { key: '0c9c0dcc47dd418e34e541d878bfc03ca137c68d', name: "summary" }), h("span", { key: 'c94f52994843b10c1161c0d85f38f8cb917ea806', class: "mg-c-details__toggle" }, h("mg-icon", { key: '9421452572af3deb03146a8dfd189369b249ba2d', icon: "chevron-up", class: { 'mg-c-details__toggle-icon': true, 'mg-c-details__toggle-icon--reverse': !this.expanded } }), h("span", { key: 'dbfb0b34da00e37f55ec07236611c2babdd6b7c5', class: { 'mg-u-visually-hidden': this.hideSummary } }, this.expanded ? this.toggleOpened : this.toggleClosed))), h("div", { key: '1b18b65a98e39a8663fa5d7e51eef5fbe2b92f76', class: "mg-c-details__details" }, h("slot", { key: '81c213594b1b67747db439624090784eaa5e6fcd', name: "details" }))));
|
|
61
|
-
}
|
|
62
|
-
get element() { return this; }
|
|
63
|
-
static get watchers() { return {
|
|
64
|
-
"toggleClosed": ["validateTitles"],
|
|
65
|
-
"toggleOpened": ["validateTitles"],
|
|
66
|
-
"expanded": ["handleExpanded"]
|
|
67
|
-
}; }
|
|
68
|
-
static get style() { return mgDetailsCss; }
|
|
69
|
-
}, [257, "mg-details", {
|
|
70
|
-
"toggleClosed": [1, "toggle-closed"],
|
|
71
|
-
"toggleOpened": [1, "toggle-opened"],
|
|
72
|
-
"hideSummary": [4, "hide-summary"],
|
|
73
|
-
"expanded": [1028]
|
|
74
|
-
}, undefined, {
|
|
75
|
-
"toggleClosed": ["validateTitles"],
|
|
76
|
-
"toggleOpened": ["validateTitles"],
|
|
77
|
-
"expanded": ["handleExpanded"]
|
|
78
|
-
}]);
|
|
79
|
-
function defineCustomElement() {
|
|
80
|
-
if (typeof customElements === "undefined") {
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const components = ["mg-details", "mg-icon"];
|
|
84
|
-
components.forEach(tagName => { switch (tagName) {
|
|
85
|
-
case "mg-details":
|
|
86
|
-
if (!customElements.get(tagName)) {
|
|
87
|
-
customElements.define(tagName, MgDetails);
|
|
88
|
-
}
|
|
89
|
-
break;
|
|
90
|
-
case "mg-icon":
|
|
91
|
-
if (!customElements.get(tagName)) {
|
|
92
|
-
defineCustomElement$1();
|
|
93
|
-
}
|
|
94
|
-
break;
|
|
95
|
-
} });
|
|
96
|
-
}
|
|
97
|
-
defineCustomElement();
|
|
98
|
-
|
|
99
|
-
export { MgDetails as M, defineCustomElement as d };
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { i as isValidString } from './index2.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Define error message
|
|
5
|
-
* @param message - message to display
|
|
6
|
-
* @param details - message detail to display
|
|
7
|
-
* @returns formated MgInput["errorMessage"]
|
|
8
|
-
*/
|
|
9
|
-
const defineErrorMessage = (message, details) => {
|
|
10
|
-
if (isValidString(message) && isValidString(details)) {
|
|
11
|
-
return {
|
|
12
|
-
summary: message,
|
|
13
|
-
details,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
else if (isValidString(message)) {
|
|
17
|
-
return message;
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export { defineErrorMessage as d };
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { c as isValidString } from './index-WtiuOkLj.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Keyboard keys
|
|
5
|
-
*/
|
|
6
|
-
const Keys = {
|
|
7
|
-
TAB: 'Tab',
|
|
8
|
-
ENTER: 'Enter',
|
|
9
|
-
DOWN: 'Down',
|
|
10
|
-
UP: 'Up',
|
|
11
|
-
LEFT: 'Left',
|
|
12
|
-
RIGHT: 'Right',
|
|
13
|
-
ARROWDOWN: 'ArrowDown',
|
|
14
|
-
ARROWUP: 'ArrowUp',
|
|
15
|
-
ARROWRIGHT: 'ArrowRight',
|
|
16
|
-
ARROWLEFT: 'ArrowLeft',
|
|
17
|
-
HOME: 'Home',
|
|
18
|
-
END: 'End',
|
|
19
|
-
ESC: 'Esc',
|
|
20
|
-
ESCAPE: 'Escape',
|
|
21
|
-
NUMPADENTER: 'NumpadEnter',
|
|
22
|
-
SPACE: 'Space',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Define error message
|
|
27
|
-
* @param message - message to display
|
|
28
|
-
* @param details - message detail to display
|
|
29
|
-
* @returns formated MgInput["errorMessage"]
|
|
30
|
-
*/
|
|
31
|
-
const defineErrorMessage = (message, details) => {
|
|
32
|
-
if (isValidString(message) && isValidString(details)) {
|
|
33
|
-
return {
|
|
34
|
-
summary: message,
|
|
35
|
-
details,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
else if (isValidString(message)) {
|
|
39
|
-
return message;
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
return undefined;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export { Keys as K, defineErrorMessage as d };
|