@mgdis/mg-components 6.0.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{index-08ee93bf.js → index-52d5f3d4.js} +19 -4
- package/dist/cjs/index-52d5f3d4.js.map +1 -0
- package/dist/{esm/index-cc97a562.js → cjs/index-cc11af95.js} +6 -116
- package/dist/cjs/index-cc11af95.js.map +1 -0
- package/dist/cjs/index.es-ac7c22e3.js +152 -0
- package/dist/cjs/index.es-ac7c22e3.js.map +1 -0
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mg-action-more_36.cjs.entry.js +410 -234
- package/dist/cjs/mg-action-more_36.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-alert.cjs.entry.js +7 -6
- package/dist/cjs/mg-alert.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-components.cjs.js +3 -3
- package/dist/cjs/mg-components.cjs.js.map +1 -1
- package/dist/cjs/mg-loader.cjs.entry.js +5 -4
- package/dist/cjs/mg-loader.cjs.entry.js.map +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +82 -0
- package/dist/cjs/mg-progress.cjs.entry.js.map +1 -0
- package/dist/collection/assets/icons/index.js +1 -1
- package/dist/collection/assets/icons/index.js.map +1 -1
- package/dist/collection/collection-manifest.json +3 -2
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js +11 -2
- package/dist/collection/components/atoms/internals/mg-character-left/mg-character-left.js.map +1 -1
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js +5 -2
- package/dist/collection/components/atoms/internals/mg-input-title/mg-input-title.js.map +1 -1
- package/dist/collection/components/atoms/mg-button/mg-button.js +8 -2
- package/dist/collection/components/atoms/mg-button/mg-button.js.map +1 -1
- package/dist/collection/components/atoms/mg-icon/mg-icon.js +1 -1
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js +12 -7
- package/dist/collection/components/atoms/mg-tooltip/mg-tooltip.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +14 -2
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/MgInputCheckboxList.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox-paginated/mg-input-checkbox-paginated.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js +33 -26
- package/dist/collection/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +30 -1
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +85 -4
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +29 -1
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +31 -4
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +29 -3
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +30 -3
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +29 -1
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js.map +1 -1
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +30 -3
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js.map +1 -1
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js +8 -9
- package/dist/collection/components/molecules/internals/mg-item-more/mg-item-more.js.map +1 -1
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js +12 -3
- package/dist/collection/components/molecules/menu/mg-menu-item/mg-menu-item.js.map +1 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +4 -4
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js.map +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.conf.js.map +1 -1
- package/dist/collection/components/molecules/mg-form/mg-form.js +42 -3
- package/dist/collection/components/molecules/mg-form/mg-form.js.map +1 -1
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +13 -4
- package/dist/collection/components/molecules/mg-modal/mg-modal.js.map +1 -1
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js +13 -4
- package/dist/collection/components/molecules/mg-pagination/mg-pagination.js.map +1 -1
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +11 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js.map +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +10 -5
- package/dist/collection/components/molecules/mg-popover/mg-popover.js.map +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.conf.js +5 -0
- package/dist/collection/components/molecules/mg-progress/mg-progress.conf.js.map +1 -0
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +187 -0
- package/dist/collection/components/molecules/mg-progress/mg-progress.js.map +1 -0
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +11 -2
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js.map +1 -1
- package/dist/collection/types/index.js.map +1 -1
- package/dist/components/index.es.js +36 -23
- package/dist/components/index.es.js.map +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/mg-action-more.js +8 -8
- package/dist/components/mg-action-more.js.map +1 -1
- package/dist/components/mg-alert.js +5 -5
- package/dist/components/mg-badge2.js +6 -6
- package/dist/components/mg-button2.js +13 -7
- package/dist/components/mg-button2.js.map +1 -1
- package/dist/components/mg-character-left2.js +11 -3
- package/dist/components/mg-character-left2.js.map +1 -1
- package/dist/components/mg-details.js +4 -4
- package/dist/components/mg-details.js.map +1 -1
- package/dist/components/mg-form.js +30 -8
- package/dist/components/mg-form.js.map +1 -1
- package/dist/components/mg-icon2.js +7 -7
- package/dist/components/mg-icon2.js.map +1 -1
- package/dist/components/mg-illustrated-message.js +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js +2 -2
- package/dist/components/mg-input-checkbox-paginated2.js.map +1 -1
- package/dist/components/mg-input-checkbox.js +27 -36
- package/dist/components/mg-input-checkbox.js.map +1 -1
- package/dist/components/mg-input-date.js +27 -14
- package/dist/components/mg-input-date.js.map +1 -1
- package/dist/components/mg-input-numeric.js +36 -14
- package/dist/components/mg-input-numeric.js.map +1 -1
- package/dist/components/mg-input-password.js +18 -6
- package/dist/components/mg-input-password.js.map +1 -1
- package/dist/components/mg-input-radio.js +23 -10
- package/dist/components/mg-input-radio.js.map +1 -1
- package/dist/components/mg-input-select2.js +22 -10
- package/dist/components/mg-input-select2.js.map +1 -1
- package/dist/components/mg-input-text2.js +24 -12
- package/dist/components/mg-input-text2.js.map +1 -1
- package/dist/components/mg-input-textarea.js +22 -10
- package/dist/components/mg-input-textarea.js.map +1 -1
- package/dist/components/mg-input-title2.js +6 -3
- package/dist/components/mg-input-title2.js.map +1 -1
- package/dist/components/mg-input-toggle.js +21 -8
- package/dist/components/mg-input-toggle.js.map +1 -1
- package/dist/components/mg-input2.js +18 -9
- package/dist/components/mg-input2.js.map +1 -1
- package/dist/components/mg-item-more2.js +16 -17
- package/dist/components/mg-item-more2.js.map +1 -1
- package/dist/components/mg-loader.js +3 -3
- package/dist/components/mg-menu-item2.js +17 -9
- package/dist/components/mg-menu-item2.js.map +1 -1
- package/dist/components/mg-message2.js +4 -4
- package/dist/components/mg-modal.js +17 -9
- package/dist/components/mg-modal.js.map +1 -1
- package/dist/components/mg-pagination2.js +15 -7
- package/dist/components/mg-pagination2.js.map +1 -1
- package/dist/components/mg-panel.js +16 -8
- package/dist/components/mg-panel.js.map +1 -1
- package/dist/components/mg-popover-content2.js +3 -3
- package/dist/components/mg-popover2.js +12 -7
- package/dist/components/mg-popover2.js.map +1 -1
- package/dist/components/mg-progress.d.ts +11 -0
- package/dist/components/mg-progress.js +109 -0
- package/dist/components/mg-progress.js.map +1 -0
- package/dist/components/mg-skip-links.js +4 -4
- package/dist/components/mg-skip-links.js.map +1 -1
- package/dist/components/mg-tabs.js +19 -11
- package/dist/components/mg-tabs.js.map +1 -1
- package/dist/components/mg-tag.js +4 -4
- package/dist/components/mg-tooltip2.js +18 -13
- package/dist/components/mg-tooltip2.js.map +1 -1
- package/dist/esm/{index-089d0323.js → index-81752ffe.js} +19 -4
- package/dist/esm/index-81752ffe.js.map +1 -0
- package/dist/{cjs/index-d57c96a9.js → esm/index-f3d3fb70.js} +4 -134
- package/dist/esm/index-f3d3fb70.js.map +1 -0
- package/dist/esm/index.es-940821a9.js +130 -0
- package/dist/esm/index.es-940821a9.js.map +1 -0
- package/dist/esm/loader.js +3 -3
- package/dist/esm/mg-action-more_36.entry.js +410 -234
- package/dist/esm/mg-action-more_36.entry.js.map +1 -1
- package/dist/esm/mg-alert.entry.js +7 -6
- package/dist/esm/mg-alert.entry.js.map +1 -1
- package/dist/esm/mg-components.js +4 -4
- package/dist/esm/mg-components.js.map +1 -1
- package/dist/esm/mg-loader.entry.js +5 -4
- package/dist/esm/mg-loader.entry.js.map +1 -1
- package/dist/esm/mg-progress.entry.js +78 -0
- package/dist/esm/mg-progress.entry.js.map +1 -0
- package/dist/mg-components/mg-components.css +1 -1
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/mg-components.esm.js.map +1 -1
- package/dist/mg-components/p-2298352f.js +3 -0
- package/dist/mg-components/p-2298352f.js.map +1 -0
- package/dist/mg-components/p-31e6c1a7.entry.js +2 -0
- package/dist/mg-components/{p-6f5c7ec5.entry.js.map → p-31e6c1a7.entry.js.map} +1 -1
- package/dist/mg-components/p-67c9be27.entry.js +2 -0
- package/dist/mg-components/p-67c9be27.entry.js.map +1 -0
- package/dist/mg-components/p-95895169.entry.js +2 -0
- package/dist/mg-components/{p-26b67dfd.entry.js.map → p-95895169.entry.js.map} +1 -1
- package/dist/mg-components/p-a49e2b74.js +2 -0
- package/dist/mg-components/p-a49e2b74.js.map +1 -0
- package/dist/mg-components/p-abddacc2.entry.js +2 -0
- package/dist/mg-components/p-abddacc2.entry.js.map +1 -0
- package/dist/mg-components/p-ee51ec5e.js +2 -0
- package/dist/mg-components/p-ee51ec5e.js.map +1 -0
- package/dist/types/assets/icons/index.d.ts +12 -0
- package/dist/types/components/atoms/internals/mg-character-left/mg-character-left.d.ts +1 -0
- package/dist/types/components/atoms/mg-tooltip/mg-tooltip.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +13 -11
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +4 -4
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.conf.d.ts +0 -2
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +4 -9
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.conf.d.ts +1 -1
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +12 -0
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -0
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +4 -0
- package/dist/types/components/molecules/menu/mg-menu-item/mg-menu-item.d.ts +1 -0
- package/dist/types/components/molecules/mg-form/mg-form.conf.d.ts +2 -1
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +5 -0
- package/dist/types/components/molecules/mg-modal/mg-modal.d.ts +1 -0
- package/dist/types/components/molecules/mg-pagination/mg-pagination.d.ts +1 -0
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +1 -0
- package/dist/types/components/molecules/mg-popover/mg-popover.d.ts +1 -1
- package/dist/types/components/molecules/mg-progress/mg-progress.conf.d.ts +9 -0
- package/dist/types/components/molecules/mg-progress/mg-progress.d.ts +47 -0
- package/dist/types/components/molecules/mg-tabs/mg-tabs.d.ts +1 -0
- package/dist/types/components.d.ts +111 -0
- package/dist/types/stencil-public-runtime.d.ts +6 -0
- package/dist/types/types/index.d.ts +4 -0
- package/ide/intellij/web-types.json +195 -27
- package/ide/vscode/css-custom-data.json +16 -0
- package/ide/vscode/html-custom-data.json +232 -21
- package/package.json +30 -30
- package/dist/cjs/index-08ee93bf.js.map +0 -1
- package/dist/cjs/index-d57c96a9.js.map +0 -1
- package/dist/esm/index-089d0323.js.map +0 -1
- package/dist/esm/index-cc97a562.js.map +0 -1
- package/dist/mg-components/p-26b67dfd.entry.js +0 -2
- package/dist/mg-components/p-2b89fe8b.entry.js +0 -2
- package/dist/mg-components/p-2b89fe8b.entry.js.map +0 -1
- package/dist/mg-components/p-48e033cf.js +0 -3
- package/dist/mg-components/p-48e033cf.js.map +0 -1
- package/dist/mg-components/p-6f5c7ec5.entry.js +0 -2
- package/dist/mg-components/p-898d194f.js +0 -2
- package/dist/mg-components/p-898d194f.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r as t,c as s,f as e,h as i,g as a}from"./p-2298352f.js";import{X as h,Y as n}from"./p-ee51ec5e.js";import{i as o}from"./p-a49e2b74.js";const r=["info","warning","success","danger"];const c=["bar-left","background"];const l=".mg-c-alert__close-button{position:absolute;top:0;right:0}.mg-c-alert.mg-c-alert--close-button{--mg-c-card-spacing:0 var(--mg-b-size-min-height) 0 0}";const u=l;const m=class{constructor(e){t(this,e);this.componentShow=s(this,"component-show",7);this.componentHide=s(this,"component-hide",7);this.classCloseButton="mg-c-alert--close-button";this.storedTimer=null;this.isFocused=false;this.isHovered=false;this.setTimer=()=>{this.storedTimer=setTimeout((()=>this.element.hidden=true),this.delay*1e3)};this.clearTimer=()=>{clearTimeout(this.storedTimer)};this.timerEvents=t=>{this.clearTimer();const s=t.type==="mouseenter";this[s?"isHovered":"isFocused"]=true;this.element.addEventListener(s?"mouseleave":"focusout",(t=>{this[t.type==="mouseleave"?"isHovered":"isFocused"]=false;if(!this.isFocused&&!this.isHovered)this.setTimer()}),{once:true})};this.handleClose=()=>{this.element.hidden=true};this.delay=undefined;this.variant=undefined;this.variantStyle=undefined;this.classCollection=new h(["mg-c-alert"]);this.hasActions=false}watchDelay(t){if(t!==undefined&&t<2){throw new Error(`<mg-alert> prop "delay" must be greater than 2 seconds. Passed value: ${n(t)}.`)}}watchVariant(t){if(t&&!r.includes(t)){throw new Error(`<mg-alert> prop "variant" must be one of: ${r.join(", ")}. Passed value: ${n(t)}.`)}}watchVariantStyle(t){if(t&&!c.includes(t)){throw new Error(`<mg-alert> prop "variantStyle" must be one of: ${c.join(", ")}. Passed value: ${n(t)}.`)}}watchHidden(t){if(typeof t==="string"&&t===""){t=true}if(t){this.componentHide.emit();["focusin","mouseenter"].forEach((t=>{this.element.removeEventListener(t,this.timerEvents)}));this.clearTimer()}else{this.componentShow.emit();if(this.delay>1){this.setTimer();["focusin","mouseenter"].forEach((t=>{this.element.addEventListener(t,this.timerEvents)}))}}e(this)}componentWillLoad(){this.messages=o(this.element).messages;this.watchVariant(this.variant);this.watchVariantStyle(this.variantStyle);this.watchDelay(this.delay);this.watchHidden(this.element.hidden);this.hasActions=this.element.querySelector('[slot="actions"]')!==null;if(!this.hasActions){this.classCollection.add(this.classCloseButton)}}render(){return i("mg-message",{key:"4023a825a33246b23dcacc322f7c35f14823f8ef",class:this.classCollection.join(),role:this.variant==="info"?"status":"alert",variant:this.variant,variantStyle:this.variantStyle},i("slot",{key:"cd1c9204c3a325d476cab4f1ce762bdd3662b074"}),this.hasActions?i("span",{slot:"actions"},i("slot",{name:"actions"})):i("span",{class:"mg-c-alert__close-button"},i("mg-button",{"is-icon":true,variant:"flat",label:this.messages.alert.closeButton,onClick:this.handleClose},i("mg-icon",{icon:"cross"}))))}get element(){return a(this)}static get watchers(){return{delay:["watchDelay"],variant:["watchVariant"],variantStyle:["watchVariantStyle"],hidden:["watchHidden"]}}};m.style=u;export{m as mg_alert};
|
|
2
|
+
//# sourceMappingURL=p-95895169.entry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["variants","variantStyles","mgAlertCss","MgAlertStyle0","MgAlert","this","classCloseButton","storedTimer","isFocused","isHovered","setTimer","setTimeout","element","hidden","delay","clearTimer","clearTimeout","timerEvents","event","isMouseEvent","type","addEventListener","eventOut","once","handleClose","ClassList","watchDelay","newValue","undefined","Error","toString","watchVariant","includes","join","watchVariantStyle","watchHidden","componentHide","emit","forEach","removeEventListener","componentShow","forceUpdate","componentWillLoad","messages","initLocales","variant","variantStyle","hasActions","querySelector","classCollection","add","render","h","key","class","role","slot","name","label","alert","closeButton","onClick","icon"],"sources":["src/components/molecules/mg-alert/mg-alert.conf.ts","../styles/dist/components/mg-alert.css?tag=mg-alert&encapsulation=shadow","src/components/molecules/mg-alert/mg-alert.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n",".mg-c-alert__close-button{position:absolute;top:0;right:0}.mg-c-alert.mg-c-alert--close-button{--mg-c-card-spacing: 0 var(--mg-b-size-min-height) 0 0}/*# sourceMappingURL=mg-alert.css.map */\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, forceUpdate } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-alert.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * @slot - Alert content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-alert',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-alert.css',\n shadow: true,\n})\nexport class MgAlert {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classCloseButton = 'mg-c-alert--close-button';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgAlertElement;\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds\n */\n @Prop() delay?: number;\n @Watch('delay')\n watchDelay(newValue: MgAlert['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-alert> prop \"delay\" must be greater than 2 seconds. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant\n */\n @Prop() variant?: VariantType;\n @Watch('variant')\n watchVariant(newValue: MgAlert['variant']): void {\n if (newValue && !variants.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle?: VariantStyleType;\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgAlert['variantStyle']): void {\n if (newValue && !variantStyles.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Watch hidden prop\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('hidden')\n watchHidden(newValue: boolean): void {\n if (typeof newValue === 'string' && newValue === '') {\n newValue = true;\n }\n if (newValue) {\n this.componentHide.emit();\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n forceUpdate(this);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-alert']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when alert is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when alert is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.element.hidden = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.element.hidden = true;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n this.watchDelay(this.delay);\n this.watchHidden(this.element.hidden);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n if (!this.hasActions) {\n this.classCollection.add(this.classCloseButton);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-message class={this.classCollection.join()} role={this.variant === 'info' ? 'status' : 'alert'} variant={this.variant} variantStyle={this.variantStyle}>\n <slot></slot>\n {this.hasActions ? (\n <span slot=\"actions\">\n <slot name=\"actions\"></slot>\n </span>\n ) : (\n <span class=\"mg-c-alert__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.alert.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-message>\n );\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["variants","variantStyles","mgAlertCss","MgAlertStyle0","MgAlert","this","classCloseButton","storedTimer","isFocused","isHovered","setTimer","setTimeout","element","hidden","delay","clearTimer","clearTimeout","timerEvents","event","isMouseEvent","type","addEventListener","eventOut","once","handleClose","ClassList","watchDelay","newValue","undefined","Error","toString","watchVariant","includes","join","watchVariantStyle","watchHidden","componentHide","emit","forEach","removeEventListener","componentShow","forceUpdate","componentWillLoad","messages","initLocales","variant","variantStyle","hasActions","querySelector","classCollection","add","render","h","key","class","role","slot","name","label","alert","closeButton","onClick","icon"],"sources":["src/components/molecules/mg-alert/mg-alert.conf.ts","../styles/dist/components/mg-alert.css?tag=mg-alert&encapsulation=shadow","src/components/molecules/mg-alert/mg-alert.tsx"],"sourcesContent":["import type { Variant, VariantStyle } from '../../../types';\n\n/**\n * List available variants\n */\nexport const variants = ['info', 'warning', 'success', 'danger'] as const;\n\n/**\n * Variant type\n */\nexport type VariantType = Variant & (typeof variants)[number];\n\n/**\n * List available variant styles\n */\nexport const variantStyles = ['bar-left', 'background'] as const;\n\n/**\n * VariantStyle type\n */\nexport type VariantStyleType = VariantStyle & (typeof variantStyles)[number];\n",".mg-c-alert__close-button{position:absolute;top:0;right:0}.mg-c-alert.mg-c-alert--close-button{--mg-c-card-spacing: 0 var(--mg-b-size-min-height) 0 0}/*# sourceMappingURL=mg-alert.css.map */\n","import { Component, Element, Event, EventEmitter, h, Prop, State, Watch, forceUpdate } from '@stencil/core';\nimport { ClassList, toString } from '@mgdis/stencil-helpers';\nimport { variants, variantStyles, VariantStyleType, VariantType } from './mg-alert.conf';\nimport { initLocales } from '../../../locales';\n\n/**\n * @slot - Alert content\n * @slot actions - Actions content\n */\n@Component({\n tag: 'mg-alert',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-alert.css',\n shadow: true,\n})\nexport class MgAlert {\n /************\n * Internal *\n ************/\n\n // Classes\n private readonly classCloseButton = 'mg-c-alert--close-button';\n\n // Stored timer setted when hide action is run from setTimeOut\n private storedTimer: ReturnType<typeof setTimeout> = null;\n\n // Manage hover\n private isFocused = false;\n private isHovered = false;\n\n // Locales\n private messages;\n\n /**************\n * Decorators *\n **************/\n\n /**\n * Get component DOM element\n */\n @Element() element: HTMLMgAlertElement;\n\n /**\n * Add a delay to hide/close message when it passed\n * Value is defined in seconds and must greater than 2 seconds\n */\n @Prop() delay?: number;\n @Watch('delay')\n watchDelay(newValue: MgAlert['delay']): void {\n if (newValue !== undefined && newValue < 2) {\n throw new Error(`<mg-alert> prop \"delay\" must be greater than 2 seconds. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant\n */\n @Prop() variant?: VariantType;\n @Watch('variant')\n watchVariant(newValue: MgAlert['variant']): void {\n if (newValue && !variants.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variant\" must be one of: ${variants.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define variant style\n */\n @Prop() variantStyle?: VariantStyleType;\n @Watch('variantStyle')\n watchVariantStyle(newValue: MgAlert['variantStyle']): void {\n if (newValue && !variantStyles.includes(newValue)) {\n throw new Error(`<mg-alert> prop \"variantStyle\" must be one of: ${variantStyles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Watch hidden prop\n */\n // eslint-disable-next-line @stencil-community/no-unused-watch\n @Watch('hidden')\n watchHidden(newValue: boolean): void {\n if (typeof newValue === 'string' && newValue === '') {\n newValue = true;\n }\n if (newValue) {\n this.componentHide.emit();\n // Remove event Listener\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.removeEventListener(event, this.timerEvents);\n });\n // Clear Timer\n this.clearTimer();\n } else {\n this.componentShow.emit();\n // If delay is set\n if (this.delay > 1) {\n // Start timer\n this.setTimer();\n // Stop timer when get focus or mouse enter\n ['focusin', 'mouseenter'].forEach(event => {\n this.element.addEventListener(event, this.timerEvents);\n });\n }\n }\n forceUpdate(this);\n }\n\n /**\n * Component classes\n */\n @State() classCollection: ClassList = new ClassList(['mg-c-alert']);\n\n /**\n * Define if component is using actions slot\n */\n @State() hasActions = false;\n\n /**\n * Emited event when alert is diplayed\n */\n @Event({ eventName: 'component-show' }) componentShow: EventEmitter<void>;\n\n /**\n * Emited event when alert is hidden\n */\n @Event({ eventName: 'component-hide' }) componentHide: EventEmitter<void>;\n\n /**\n * Set timer\n */\n private setTimer = (): void => {\n this.storedTimer = setTimeout(() => (this.element.hidden = true), this.delay * 1000);\n };\n\n /**\n * Clear timer\n */\n private clearTimer = (): void => {\n clearTimeout(this.storedTimer);\n };\n\n /**\n * Event to add on element\n * @param event - event\n */\n private timerEvents = (event: MouseEvent | FocusEvent): void => {\n this.clearTimer();\n const isMouseEvent: boolean = event.type === 'mouseenter';\n // Needed to ensure we don't start the timer\n this[isMouseEvent ? 'isHovered' : 'isFocused'] = true;\n\n // Restart timer when loose focus AND mouse leave\n this.element.addEventListener(\n isMouseEvent ? 'mouseleave' : 'focusout',\n eventOut => {\n this[eventOut.type === 'mouseleave' ? 'isHovered' : 'isFocused'] = false;\n // Start timer if needed\n if (!this.isFocused && !this.isHovered) this.setTimer();\n },\n { once: true },\n );\n };\n\n /**\n * Handle close button\n */\n private handleClose = (): void => {\n this.element.hidden = true;\n };\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // Get locales\n this.messages = initLocales(this.element).messages;\n // Validate\n this.watchVariant(this.variant);\n this.watchVariantStyle(this.variantStyle);\n this.watchDelay(this.delay);\n this.watchHidden(this.element.hidden);\n // Check if component has actions slot\n this.hasActions = this.element.querySelector('[slot=\"actions\"]') !== null;\n if (!this.hasActions) {\n this.classCollection.add(this.classCloseButton);\n }\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <mg-message class={this.classCollection.join()} role={this.variant === 'info' ? 'status' : 'alert'} variant={this.variant} variantStyle={this.variantStyle}>\n <slot></slot>\n {this.hasActions ? (\n <span slot=\"actions\">\n <slot name=\"actions\"></slot>\n </span>\n ) : (\n <span class=\"mg-c-alert__close-button\">\n <mg-button is-icon variant=\"flat\" label={this.messages.alert.closeButton} onClick={this.handleClose}>\n <mg-icon icon=\"cross\"></mg-icon>\n </mg-button>\n </span>\n )}\n </mg-message>\n );\n }\n}\n"],"mappings":"+IAKO,MAAMA,EAAW,CAAC,OAAQ,UAAW,UAAW,UAUhD,MAAMC,EAAgB,CAAC,WAAY,cCf1C,MAAMC,EAAa,wJACnB,MAAAC,EAAeD,E,MCaFE,EAAO,M,qHAMDC,KAAAC,iBAAmB,2BAG5BD,KAAAE,YAA6C,KAG7CF,KAAAG,UAAY,MACZH,KAAAI,UAAY,MAuGZJ,KAAAK,SAAW,KACjBL,KAAKE,YAAcI,YAAW,IAAON,KAAKO,QAAQC,OAAS,MAAOR,KAAKS,MAAQ,IAAK,EAM9ET,KAAAU,WAAa,KACnBC,aAAaX,KAAKE,YAAY,EAOxBF,KAAAY,YAAeC,IACrBb,KAAKU,aACL,MAAMI,EAAwBD,EAAME,OAAS,aAE7Cf,KAAKc,EAAe,YAAc,aAAe,KAGjDd,KAAKO,QAAQS,iBACXF,EAAe,aAAe,YAC9BG,IACEjB,KAAKiB,EAASF,OAAS,aAAe,YAAc,aAAe,MAEnE,IAAKf,KAAKG,YAAcH,KAAKI,UAAWJ,KAAKK,UAAU,GAEzD,CAAEa,KAAM,MACT,EAMKlB,KAAAmB,YAAc,KACpBnB,KAAKO,QAAQC,OAAS,IAAI,E,6FAzDU,IAAIY,EAAU,CAAC,e,gBAK/B,K,CApEtB,UAAAC,CAAWC,GACT,GAAIA,IAAaC,WAAaD,EAAW,EAAG,CAC1C,MAAM,IAAIE,MAAM,yEAAyEC,EAASH,M,EAStG,YAAAI,CAAaJ,GACX,GAAIA,IAAa3B,EAASgC,SAASL,GAAW,CAC5C,MAAM,IAAIE,MAAM,6CAA6C7B,EAASiC,KAAK,wBAAwBH,EAASH,M,EAShH,iBAAAO,CAAkBP,GAChB,GAAIA,IAAa1B,EAAc+B,SAASL,GAAW,CACjD,MAAM,IAAIE,MAAM,kDAAkD5B,EAAcgC,KAAK,wBAAwBH,EAASH,M,EAS1H,WAAAQ,CAAYR,GACV,UAAWA,IAAa,UAAYA,IAAa,GAAI,CACnDA,EAAW,I,CAEb,GAAIA,EAAU,CACZtB,KAAK+B,cAAcC,OAEnB,CAAC,UAAW,cAAcC,SAAQpB,IAChCb,KAAKO,QAAQ2B,oBAAoBrB,EAAOb,KAAKY,YAAY,IAG3DZ,KAAKU,Y,KACA,CACLV,KAAKmC,cAAcH,OAEnB,GAAIhC,KAAKS,MAAQ,EAAG,CAElBT,KAAKK,WAEL,CAAC,UAAW,cAAc4B,SAAQpB,IAChCb,KAAKO,QAAQS,iBAAiBH,EAAOb,KAAKY,YAAY,G,EAI5DwB,EAAYpC,K,CAyEd,iBAAAqC,GAEErC,KAAKsC,SAAWC,EAAYvC,KAAKO,SAAS+B,SAE1CtC,KAAK0B,aAAa1B,KAAKwC,SACvBxC,KAAK6B,kBAAkB7B,KAAKyC,cAC5BzC,KAAKqB,WAAWrB,KAAKS,OACrBT,KAAK8B,YAAY9B,KAAKO,QAAQC,QAE9BR,KAAK0C,WAAa1C,KAAKO,QAAQoC,cAAc,sBAAwB,KACrE,IAAK3C,KAAK0C,WAAY,CACpB1C,KAAK4C,gBAAgBC,IAAI7C,KAAKC,iB,EAQlC,MAAA6C,GACE,OACEC,EAAA,cAAAC,IAAA,2CAAYC,MAAOjD,KAAK4C,gBAAgBhB,OAAQsB,KAAMlD,KAAKwC,UAAY,OAAS,SAAW,QAASA,QAASxC,KAAKwC,QAASC,aAAczC,KAAKyC,cAC5IM,EAAA,QAAAC,IAAA,6CACChD,KAAK0C,WACJK,EAAA,QAAMI,KAAK,WACTJ,EAAA,QAAMK,KAAK,aAGbL,EAAA,QAAME,MAAM,4BACVF,EAAA,4BAAmBP,QAAQ,OAAOa,MAAOrD,KAAKsC,SAASgB,MAAMC,YAAaC,QAASxD,KAAKmB,aACtF4B,EAAA,WAASU,KAAK,Y","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{g as e}from"./p-ee51ec5e.js";const t={required:"This field is required.",date:{badInput:"The date format must be {pattern}",min:"The date cannot be earlier than {min}",max:"The date cannot be later than {max}",minMax:"The date must be between {min} and {max}"},numeric:{min:"The value cannot be less than {min}",max:"The value cannot be greater than {max}",minMax:"The value must be between {min} and {max}"}};const a="{counter} characters left.";const s={select:{placeholder:"Select a value"},checkbox:{selectedValues:"{nb} selected values",selectedValue:"{nb} selected value",editButton:"Edit",selectButton:"Select values",showButton:"Show",label:"Enter a value",result:"result",results:"results",searchResults:"Search result(s) list.",noResult:"No result.",sections:{selected:{title:"Selected",titlePlurial:"Selected",action:"Unselect all",tooltip:"Unselect all current search results"},notSelected:{title:"Not selected",titlePlurial:"Not selected",action:"Select all",tooltip:"Select all current search results"}}},date:{helpText:"Expected format: {pattern} (ex: {date})",pattern:{dd:"dd",mm:"mm",yyyy:"yyyy"}},password:{display:"Display password value",hide:"Hide password value"}};const n={required:'Fields with a <strong class="mg-u-is-asterisk">*</strong> are required',requiredSingle:'Field with a <strong class="mg-u-is-asterisk">*</strong> is required',allRequired:"All fields are required",allRequiredSingle:"The field is required"};const l={closeButton:"Close message"};const r={closeButton:"Close modal"};const o={label:"Pagination",page:"page",pages:"pages",nextPage:"Next page",previousPage:"Previous page",selectPage:"Select the page to display."};const i={editLabel:"Edit section title."};const c={navLabel:"Quick access"};const u={confirm:"Confirm",cancel:"Cancel",close:"Close",next:"next",previous:"previous"};const d={badgeLabel:"Include notification(s)",openNewTab:"Open link in a new tab"};const m={menuLabel:"Additional menu"};const p={label:"Actions"};const g={inProgess:"Loading in progress…"};const h={errors:t,nbCharLeft:a,input:s,form:n,alert:l,modal:r,pagination:o,panel:i,skipLinks:c,general:u,menuItem:d,itemMore:m,actionMore:p,loader:g};const b={required:"Ce champ est obligatoire.",date:{badInput:"Le format de la date doit être du type {pattern}",min:"La date ne peut pas être antérieure au {min}",max:"La date ne peut pas être postérieure au {max}",minMax:"La date doit être comprise entre le {min} et le {max}"},numeric:{min:"La valeur ne peut pas être inférieure à {min}",max:"La valeur ne peut pas être supérieure à {max}",minMax:"La valeur doit être comprise entre {min} et {max}"}};const v="{counter} caractères disponibles.";const x={select:{placeholder:"Sélectionnez une valeur"},checkbox:{selectedValues:"{nb} valeurs selectionnées",selectedValue:"{nb} valeur selectionnée",editButton:"Modifier",selectButton:"Sélectionner des valeurs",showButton:"Voir",label:"Saisissez une valeur",result:"résultat",results:"résultats",searchResults:"List de résultat(s) de la recherche.",noResult:"Aucun résultat.",sections:{selected:{title:"Sélectionné",titlePlurial:"Sélectionnés",action:"Tout désélectionner",tooltip:"Désélectionne tous les résultats de la recherche en cours"},notSelected:{title:"Non sélectionné",titlePlurial:"Non sélectionnés",action:"Tout sélectionner",tooltip:"Sélectionne tous les résultats de la recherche en cours"}}},date:{helpText:"Format attendu : {pattern} (ex : {date})",pattern:{dd:"jj",mm:"mm",yyyy:"aaaa"}},password:{display:"Afficher le mot de passe",hide:"Masquer le mot de passe"}};const f={required:'Les champs marqués d\'un <strong class="mg-u-is-asterisk">*</strong> sont obligatoires',requiredSingle:'Le champ marqué d\'un <strong class="mg-u-is-asterisk">*</strong> est obligatoire',allRequired:"Tous les champs sont obligatoires",allRequiredSingle:"Le champ est obligatoire"};const L={closeButton:"Fermer le message"};const S={closeButton:"Fermer la modale"};const q={label:"Pagination",page:"page",pages:"pages",nextPage:"Page suivante",previousPage:"Page précédente",selectPage:"Sélectionner la page à afficher."};const y={editLabel:"Modifier le titre de la section."};const P={navLabel:"Accès rapide"};const T={confirm:"Valider",cancel:"Annuler",close:"Fermer",next:"suivant",previous:"précédent"};const w={badgeLabel:"Notification(s) incluse(s)",openNewTab:"Ouvrir le lien dans un nouvel onglet"};const k={menuLabel:"Menu complémentaire"};const M={label:"Actions"};const B={inProgess:"Chargement en cours…"};const C={errors:b,nbCharLeft:v,input:x,form:f,alert:L,modal:S,pagination:q,panel:y,skipLinks:P,general:T,menuItem:w,itemMore:k,actionMore:M,loader:B};const N="en";const A={en:h,fr:C};const R=e(A,N);export{R as i};
|
|
2
|
+
//# sourceMappingURL=p-a49e2b74.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["defaultLocale","messages","en","fr","initLocales","defineLocales"],"sources":["src/locales/index.ts"],"sourcesContent":["import en from './en/messages.json';\nimport fr from './fr/messages.json';\nimport { defineLocales } from '@mgdis/stencil-helpers';\n\nconst defaultLocale = 'en';\nconst messages = { en, fr };\n\n/**\n * Get Intl object\n * @param element - element we need to get the language\n * @returns messages object\n */\nexport const initLocales = defineLocales(messages, defaultLocale);\n"],"mappings":"+iJAIA,MAAMA,EAAgB,KACtB,MAAMC,EAAW,CAAEC,KAAIC,M,MAOVC,EAAcC,EAAcJ,EAAUD,U","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{r,h as e,H as s}from"./p-2298352f.js";import{m as o,Y as a,V as i}from"./p-ee51ec5e.js";const t=["progressbar","meter"];const c="/*!\n * @prop --mg-c-progress-size: Defines the size of the progress bar. Default value is `--mg-b-size-8`.\n * @prop --mg-c-progress-border-color: Defines the color of the progress bar border. Default value is `--mg-b-color-neutral-80`.\n * @prop --mg-c-progress-bar-color-background: Defines the color of the progress bar. Default value is `--mg-b-color-neutral-30`.\n * @prop --mg-c-progress-fill-color-background: Defines the color of the progress bar fill background. Default value is `--mg-b-color-app`.\n */.mg-c-progress{min-width:calc(var(--mg-b-size-16)*4)}.mg-c-progress__bar{position:relative;overflow:hidden;height:var(--mg-c-progress-size);border-width:var(--mg-b-size-border);border-style:solid;border-color:var(--mg-c-progress-border-color);border-radius:calc((var(--mg-c-progress-size) + var(--mg-b-size-border)*2)/2);background-color:var(--mg-c-progress-bar-color-background)}.mg-c-progress__fill{height:100%;border-radius:calc((var(--mg-c-progress-size) + var(--mg-b-size-border)*2)/2);transition:width 300ms ease-in-out}.mg-c-progress__bar.mg-c-progress__bar--active .mg-c-progress__fill{background-color:var(--mg-c-progress-fill-color-background)}";const g=c;const l=class{constructor(e){r(this,e);this.label=undefined;this.ariaRole="progressbar";this.value=0;this.min=0;this.max=100}watchLabel(r){if(!o(r)){throw new Error(`<mg-progress> prop "label" must be a valid string. Passed value: ${a(r)}.`)}}watchAriaRole(r){if(r&&!t.includes(r)){throw new Error(`<mg-progress> prop "ariaRole" must be one of: ${t.join(", ")}. Passed value: ${a(r)}.`)}}watchValue(r){if(r!==undefined&&(!i(r)||!(r>=this.min&&r<=this.max)))throw new Error(`<mg-progress> prop “value” must be a number within the range ${this.min} to ${this.max}. Passed value: ${a(r)}.`)}watchMin(r){if(r!==0&&r!==undefined&&(!i(r)||r>=this.max))throw new Error(`<mg-progress> prop “min” must be a number lower than: ${this.max}. Passed value: ${a(r)}.`)}watchMax(r){if(r!==100&&r!==undefined&&(!i(r)||r<=this.min))throw new Error(`<mg-progress> prop “max” must be a number greater than: ${this.min}. Passed value: ${a(r)}.`)}componentWillLoad(){this.watchLabel(this.label);this.watchAriaRole(this.ariaRole);this.watchMin(this.min);this.watchMax(this.max);this.watchValue(this.value)}render(){return e(s,{key:"c2a8b5264af27dab4f81981a6d20d04d572321db",role:this.ariaRole,"aria-label":this.label,"aria-valuenow":this.value,"aria-valuemin":this.min,"aria-valuemax":this.max},e("div",{key:"1ab08ca9582182c7c2e9cf1041e68cfd38390e3b",class:"mg-c-progress"},e("div",{key:"95044f35b5fcc1b5eb380828acc3935ff30c6c1f",class:{"mg-c-progress__bar":true,"mg-c-progress__bar--active":this.value>this.min}},e("div",{key:"4d3588379c0b1a135dd9118fd2cb3c00c9dd31cb",class:"mg-c-progress__fill",style:{width:`${Math.round((this.value-this.min)/(this.max-this.min)*100)}%`}}))))}static get watchers(){return{label:["watchLabel"],ariaRole:["watchAriaRole"],value:["watchValue"],min:["watchMin"],max:["watchMax"]}}};l.style=g;export{l as mg_progress};
|
|
2
|
+
//# sourceMappingURL=p-abddacc2.entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["roles","mgProgressCss","MgProgressStyle0","MgProgress","watchLabel","newValue","isValidString","Error","toString","watchAriaRole","includes","join","watchValue","undefined","isValidNumber","this","min","max","watchMin","watchMax","componentWillLoad","label","ariaRole","value","render","h","Host","key","role","class","style","width","Math","round"],"sources":["src/components/molecules/mg-progress/mg-progress.conf.ts","../styles/dist/components/mg-progress.css?tag=mg-progress&encapsulation=shadow","src/components/molecules/mg-progress/mg-progress.tsx"],"sourcesContent":["import { AriaRole } from '../../../types';\n\n/**\n * List of all possibles roles\n */\nexport const roles = ['progressbar', 'meter'] as const;\n\n/**\n * Aria Role type from roles\n */\nexport type AriaRoleType = AriaRole & (typeof roles)[number];\n","/*!\n * @prop --mg-c-progress-size: Defines the size of the progress bar. Default value is `--mg-b-size-8`.\n * @prop --mg-c-progress-border-color: Defines the color of the progress bar border. Default value is `--mg-b-color-neutral-80`.\n * @prop --mg-c-progress-bar-color-background: Defines the color of the progress bar. Default value is `--mg-b-color-neutral-30`.\n * @prop --mg-c-progress-fill-color-background: Defines the color of the progress bar fill background. Default value is `--mg-b-color-app`.\n */.mg-c-progress{min-width:calc(var(--mg-b-size-16)*4)}.mg-c-progress__bar{position:relative;overflow:hidden;height:var(--mg-c-progress-size);border-width:var(--mg-b-size-border);border-style:solid;border-color:var(--mg-c-progress-border-color);border-radius:calc((var(--mg-c-progress-size) + var(--mg-b-size-border)*2)/2);background-color:var(--mg-c-progress-bar-color-background)}.mg-c-progress__fill{height:100%;border-radius:calc((var(--mg-c-progress-size) + var(--mg-b-size-border)*2)/2);transition:width 300ms ease-in-out}.mg-c-progress__bar.mg-c-progress__bar--active .mg-c-progress__fill{background-color:var(--mg-c-progress-fill-color-background)}/*# sourceMappingURL=mg-progress.css.map */\n","import { Component, h, Host, Prop, Watch } from '@stencil/core';\nimport { isValidNumber, isValidString, toString } from '@mgdis/stencil-helpers';\nimport { AriaRoleType, roles } from './mg-progress.conf';\n\n@Component({\n tag: 'mg-progress',\n styleUrl: '../../../../node_modules/@mgdis/styles/dist/components/mg-progress.css',\n shadow: true,\n})\nexport class MgProgress {\n /**************\n * Decorators *\n **************/\n\n /**\n * Define label\n */\n @Prop() label!: string;\n @Watch('label')\n watchLabel(newValue: MgProgress['label']): void {\n if (!isValidString(newValue)) {\n throw new Error(`<mg-progress> prop \"label\" must be a valid string. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define progress role\n * - `progressbar` to indicate a progress, such as loading or percent completion of a task\n * - `meter` to indicate a graphical display of a numeric value that varies within a defined range\n */\n @Prop() ariaRole?: AriaRoleType = 'progressbar';\n @Watch('ariaRole')\n watchAriaRole(newValue: MgProgress['ariaRole']): void {\n if (newValue && !roles.includes(newValue)) {\n throw new Error(`<mg-progress> prop \"ariaRole\" must be one of: ${roles.join(', ')}. Passed value: ${toString(newValue)}.`);\n }\n }\n\n /**\n * Define current value\n * By default, it will be displayed as a percentage value.\n * If you don’t specify the min and max props, the value should be a number within the range of 0 to 100.\n */\n @Prop() value?: number = 0;\n @Watch('value')\n watchValue(newValue: MgProgress['value']): void {\n if (newValue !== undefined && (!isValidNumber(newValue) || !(newValue >= this.min && newValue <= this.max)))\n throw new Error(`<mg-progress> prop “value” must be a number within the range ${this.min} to ${this.max}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define the minimum value in the range\n */\n @Prop() min?: number = 0;\n @Watch('min')\n watchMin(newValue: MgProgress['min']): void {\n if (newValue !== 0 && newValue !== undefined && (!isValidNumber(newValue) || newValue >= this.max))\n throw new Error(`<mg-progress> prop “min” must be a number lower than: ${this.max}. Passed value: ${toString(newValue)}.`);\n }\n\n /**\n * Define the maximum value in the range\n */\n @Prop() max?: number = 100;\n @Watch('max')\n watchMax(newValue: MgProgress['max']): void {\n if (newValue !== 100 && newValue !== undefined && (!isValidNumber(newValue) || newValue <= this.min))\n throw new Error(`<mg-progress> prop “max” must be a number greater than: ${this.min}. Passed value: ${toString(newValue)}.`);\n }\n\n /*************\n * Lifecycle *\n *************/\n\n /**\n * Check if component props are well configured on init\n */\n componentWillLoad(): void {\n // validate props\n this.watchLabel(this.label);\n this.watchAriaRole(this.ariaRole);\n this.watchMin(this.min);\n this.watchMax(this.max);\n this.watchValue(this.value);\n }\n\n /**\n * Render\n * @returns HTML Element\n */\n render(): HTMLElement {\n return (\n <Host role={this.ariaRole} aria-label={this.label} aria-valuenow={this.value} aria-valuemin={this.min} aria-valuemax={this.max}>\n <div class=\"mg-c-progress\">\n <div class={{ 'mg-c-progress__bar': true, 'mg-c-progress__bar--active': this.value > this.min }}>\n <div\n class=\"mg-c-progress__fill\"\n style={{\n width: `${Math.round(((this.value - this.min) / (this.max - this.min)) * 100)}%`,\n }}\n ></div>\n </div>\n </div>\n </Host>\n );\n }\n}\n"],"mappings":"+FAKO,MAAMA,EAAQ,CAAC,cAAe,SCLrC,MAAMC,EAAgB,mpCACtB,MAAAC,EAAeD,E,MCQFE,EAAU,M,4DAqBa,c,WAaT,E,SAUF,E,SAUA,G,CA5CvB,UAAAC,CAAWC,GACT,IAAKC,EAAcD,GAAW,CAC5B,MAAM,IAAIE,MAAM,oEAAoEC,EAASH,M,EAWjG,aAAAI,CAAcJ,GACZ,GAAIA,IAAaL,EAAMU,SAASL,GAAW,CACzC,MAAM,IAAIE,MAAM,iDAAiDP,EAAMW,KAAK,wBAAwBH,EAASH,M,EAWjH,UAAAO,CAAWP,GACT,GAAIA,IAAaQ,aAAeC,EAAcT,MAAeA,GAAYU,KAAKC,KAAOX,GAAYU,KAAKE,MACpG,MAAM,IAAIV,MAAM,gEAAgEQ,KAAKC,UAAUD,KAAKE,sBAAsBT,EAASH,M,CAQvI,QAAAa,CAASb,GACP,GAAIA,IAAa,GAAKA,IAAaQ,aAAeC,EAAcT,IAAaA,GAAYU,KAAKE,KAC5F,MAAM,IAAIV,MAAM,yDAAyDQ,KAAKE,sBAAsBT,EAASH,M,CAQjH,QAAAc,CAASd,GACP,GAAIA,IAAa,KAAOA,IAAaQ,aAAeC,EAAcT,IAAaA,GAAYU,KAAKC,KAC9F,MAAM,IAAIT,MAAM,2DAA2DQ,KAAKC,sBAAsBR,EAASH,M,CAUnH,iBAAAe,GAEEL,KAAKX,WAAWW,KAAKM,OACrBN,KAAKN,cAAcM,KAAKO,UACxBP,KAAKG,SAASH,KAAKC,KACnBD,KAAKI,SAASJ,KAAKE,KACnBF,KAAKH,WAAWG,KAAKQ,M,CAOvB,MAAAC,GACE,OACEC,EAACC,EAAI,CAAAC,IAAA,2CAACC,KAAMb,KAAKO,SAAQ,aAAcP,KAAKM,MAAK,gBAAiBN,KAAKQ,MAAK,gBAAiBR,KAAKC,IAAG,gBAAiBD,KAAKE,KACzHQ,EAAA,OAAAE,IAAA,2CAAKE,MAAM,iBACTJ,EAAA,OAAAE,IAAA,2CAAKE,MAAO,CAAE,qBAAsB,KAAM,6BAA8Bd,KAAKQ,MAAQR,KAAKC,MACxFS,EAAA,OAAAE,IAAA,2CACEE,MAAM,sBACNC,MAAO,CACLC,MAAO,GAAGC,KAAKC,OAAQlB,KAAKQ,MAAQR,KAAKC,MAAQD,KAAKE,IAAMF,KAAKC,KAAQ,a","ignoreList":[]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var t=Object.defineProperty;var e=(e,n,r)=>n in e?t(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var n=(t,n,r)=>e(t,typeof n!="symbol"?n+"":n,r);const r=(t="",e=10)=>{const n=new Uint8Array(e);crypto.getRandomValues(n);const r=Array.from(n).map((t=>t.toString(16).padStart(2,"0"))).join("").slice(0,e);return t!==""?`${t}-${r}`:r},s=t=>f(t)&&/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(t)!==null;class a{constructor(t=[]){n(this,"classes");n(this,"add",(t=>{this.has(t)||this.classes.push(t)}));n(this,"delete",(t=>{const e=this.classes.indexOf(t);e>-1&&this.classes.splice(e,1)}));n(this,"has",(t=>this.classes.includes(t)));n(this,"join",(()=>this.classes.join(" ")));this.classes=t}}const i=t=>Array.isArray(t)&&t.every((t=>typeof t=="string")),o=(t,e)=>e.includes(t==null?void 0:t.tagName.toLowerCase()),u='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',c=t=>{const e=l(t),n=m(t);return[t,...e,...n]},l=(t,e=[])=>{if(t.self!==t.top)try{const n=t.parent;return n?(e.push(n),l(n,e)):e}catch(t){return console.error("Different hosts between iframes:",t),e}return e},m=(t,e=[])=>{if(t.frames.length>0)for(const n of Array.from(t.frames))e.push(n),m(n,e);return e},f=t=>typeof t=="string"&&t.trim()!=="",y=t=>typeof t=="object"?JSON.stringify(t):`${t}`,g=t=>typeof t=="number"&&!Number.isNaN(t),h=t=>typeof t=="string"?t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):t,p=async t=>t();var v=Object.defineProperty,b=(t,e)=>{for(var n in e)v(t,n,{get:e[n],enumerable:!0})};var d={};b(d,{err:()=>D,map:()=>x,ok:()=>w,unwrap:()=>F,unwrapErr:()=>I});var w=t=>({isOk:!0,isErr:!1,value:t}),D=t=>({isOk:!1,isErr:!0,value:t});function x(t,e){if(t.isOk){const n=e(t.value);return n instanceof Promise?n.then((t=>w(t))):w(n)}if(t.isErr){const e=t.value;return D(e)}throw"should never get here"}var F=t=>{if(t.isOk)return t.value;throw t.value},I=t=>{if(t.isErr)return t.value;throw t.value};const O=t=>{const e={value:"2023",pattern:"yyyy"},n={value:"12",pattern:"mm"},r={value:"24",pattern:"dd"};return J([e.value,n.value,r.value].join("-"),t,{timeZone:"UTC"}).replace(e.value,e.pattern).replace(n.value,n.pattern).replace(r.value,r.pattern)},$=t=>t.toISOString().split("T")[0],j=(t,e,n)=>{const r=t.closest("[lang]"),s=Intl.NumberFormat.supportedLocalesOf(r==null?void 0:r.lang),a=s.length>0&&typeof s[0]=="string"?s[0]:navigator.language||n,i=a.split("-").shift();return Object.keys(e).length===0?{locale:a,messages:{lang:n}}:{locale:a,messages:e[i]||e[n]||{lang:n}}},z=(t,e,n)=>new Intl.NumberFormat(e,{style:"currency",currency:n}).format(t),A=(t,e,n=0)=>new Intl.NumberFormat(e,{minimumFractionDigits:n}).format(n>0?Number(t==null?void 0:t.toFixed(n)):t),N=(t,e,n=0)=>new Intl.NumberFormat(e,{style:"percent",minimumFractionDigits:n,maximumFractionDigits:n}).format(t),k=(t,e,n,r="short",s=0)=>new Intl.NumberFormat(e,{style:"unit",unit:n,unitDisplay:r,minimumFractionDigits:s,maximumFractionDigits:s}).format(t),E=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,J=(t,e,n)=>typeof t!="string"||t===""||!E.test(t)?"":new Intl.DateTimeFormat(e,n).format(new Date(t)),T=(t,e)=>n=>j(n,t,e);export{A as $,s as G,E as H,i as J,o as K,u as Q,g as V,a as X,y as Y,c as Z,O as c,N as d,h as e,$ as f,T as g,f as m,k as p,r as q,p as t,z as u,J as z};
|
|
2
|
+
//# sourceMappingURL=p-ee51ec5e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["ve","Object","defineProperty","he","e","t","s","enumerable","configurable","writable","value","g","qe","Uint8Array","crypto","getRandomValues","r","Array","from","map","o","toString","padStart","join","slice","Ge","me","exec","Xe","constructor","this","has","classes","push","indexOf","splice","includes","Je","isArray","every","Ke","tagName","toLowerCase","Qe","Ze","te","se","self","top","parent","console","error","frames","length","trim","Ye","JSON","stringify","Ve","Number","isNaN","et","toLocaleLowerCase","normalize","replaceAll","tt","async","be","Se","get","Ae","err","oe","Ee","ok","U","unwrap","je","unwrapErr","Re","isOk","isErr","Promise","then","ct","pattern","ze","timeZone","replace","ft","toISOString","split","We","closest","Intl","NumberFormat","supportedLocalesOf","lang","n","navigator","language","i","shift","keys","locale","messages","ut","style","currency","format","$t","minimumFractionDigits","toFixed","dt","maximumFractionDigits","pt","unit","unitDisplay","He","test","DateTimeFormat","Date","gt"],"sources":["../stencil-helpers/dist/index.es.js"],"sourcesContent":["var ve = Object.defineProperty;\nvar X = (e) => {\n throw TypeError(e);\n};\nvar he = (e, t, s) => t in e ? ve(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;\nvar g = (e, t, s) => he(e, typeof t != \"symbol\" ? t + \"\" : t, s), ye = (e, t, s) => t.has(e) || X(\"Cannot \" + s);\nvar k = (e, t, s) => (ye(e, t, \"read from private field\"), s ? s.call(e) : t.get(e)), P = (e, t, s) => t.has(e) ? X(\"Cannot add the same private member more than once\") : t instanceof WeakSet ? t.add(e) : t.set(e, s);\nconst qe = (e = \"\", t = 10) => {\n const s = new Uint8Array(t);\n crypto.getRandomValues(s);\n const r = Array.from(s).map((o) => o.toString(16).padStart(2, \"0\")).join(\"\").slice(0, t);\n return e !== \"\" ? `${e}-${r}` : r;\n}, Ge = (e) => me(e) && /^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(e) !== null;\nclass Xe {\n constructor(t = []) {\n /**\n * Available classes\n */\n g(this, \"classes\");\n /**\n * Add class\n * @param className - class name to add\n */\n g(this, \"add\", (t) => {\n this.has(t) || this.classes.push(t);\n });\n /**\n * Delete class\n * @param className - class name to delete\n */\n g(this, \"delete\", (t) => {\n const s = this.classes.indexOf(t);\n s > -1 && this.classes.splice(s, 1);\n });\n /**\n * Check if class exist in list\n * @param className - class name to check\n * @returns class name is in the list\n */\n g(this, \"has\", (t) => this.classes.includes(t));\n /**\n * Join classes seperated by spaces\n * @returns joined values\n */\n g(this, \"join\", () => this.classes.join(\" \"));\n this.classes = t;\n }\n}\nconst Je = (e) => Array.isArray(e) && e.every((t) => typeof t == \"string\"), Ke = (e, t) => t.includes(e == null ? void 0 : e.tagName.toLowerCase()), Qe = 'a[href], button, input, textarea, select, details, [tabindex]:not([tabindex=\"-1\"]), [identifier], mg-button', Ze = (e) => {\n const t = te(e), s = se(e);\n return [e, ...t, ...s];\n}, te = (e, t = []) => {\n if (e.self !== e.top)\n try {\n const s = e.parent;\n return s ? (t.push(s), te(s, t)) : t;\n } catch (s) {\n return console.error(\"Different hosts between iframes:\", s), t;\n }\n return t;\n}, se = (e, t = []) => {\n if (e.frames.length > 0)\n for (const s of Array.from(e.frames))\n t.push(s), se(s, t);\n return t;\n}, me = (e) => typeof e == \"string\" && e.trim() !== \"\", Ye = (e) => typeof e == \"object\" ? JSON.stringify(e) : `${e}`, Ve = (e) => typeof e == \"number\" && !Number.isNaN(e), et = (e) => typeof e == \"string\" ? e.toLocaleLowerCase().normalize(\"NFD\").replaceAll(/[\\u0300-\\u036f]/g, \"\") : e, tt = async (e) => e();\nvar E = {\n allRenderFn: !1,\n cmpDidLoad: !0,\n cmpDidUnload: !1,\n cmpDidUpdate: !0,\n cmpDidRender: !0,\n cmpWillLoad: !0,\n cmpWillUpdate: !0,\n cmpWillRender: !0,\n connectedCallback: !0,\n disconnectedCallback: !0,\n element: !0,\n event: !0,\n hasRenderFn: !0,\n lifecycle: !0,\n hostListener: !0,\n hostListenerTargetWindow: !0,\n hostListenerTargetDocument: !0,\n hostListenerTargetBody: !0,\n hostListenerTargetParent: !1,\n hostListenerTarget: !0,\n member: !0,\n method: !0,\n mode: !0,\n observeAttribute: !0,\n prop: !0,\n propMutable: !0,\n reflect: !0,\n scoped: !0,\n shadowDom: !0,\n slot: !0,\n cssAnnotations: !0,\n state: !0,\n style: !0,\n formAssociated: !1,\n svg: !0,\n updatable: !0,\n vdomAttribute: !0,\n vdomXlink: !0,\n vdomClass: !0,\n vdomFunctional: !0,\n vdomKey: !0,\n vdomListener: !0,\n vdomRef: !0,\n vdomPropOrAttr: !0,\n vdomRender: !0,\n vdomStyle: !0,\n vdomText: !0,\n watchCallback: !0,\n taskQueue: !0,\n hotModuleReplacement: !1,\n isDebug: !1,\n isDev: !1,\n isTesting: !1,\n hydrateServerSide: !1,\n hydrateClientSide: !1,\n lifecycleDOMEvents: !1,\n lazyLoad: !1,\n profile: !1,\n slotRelocation: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n appendChildSlotFix: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n cloneNodeFix: !1,\n hydratedAttribute: !1,\n hydratedClass: !0,\n // TODO(STENCIL-1305): remove this option\n scriptDataOpts: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n scopedSlotTextContentFix: !1,\n // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field\n shadowDomShim: !1,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n slotChildNodesFix: !1,\n invisiblePrehydration: !0,\n propBoolean: !0,\n propNumber: !0,\n propString: !0,\n constructableCSS: !0,\n cmpShouldUpdate: !0,\n devTools: !1,\n shadowDelegatesFocus: !0,\n initializeNextTick: !1,\n asyncLoading: !0,\n asyncQueue: !1,\n transformTagName: !1,\n attachStyles: !0,\n // TODO(STENCIL-914): remove this option when `experimentalSlotFixes` is the default behavior\n experimentalSlotFixes: !1\n}, be = Object.defineProperty, Se = (e, t) => {\n for (var s in t)\n be(e, s, { get: t[s], enumerable: !0 });\n}, J = (e, t) => t in e, K = \"http://www.w3.org/1999/xlink\", B = typeof window < \"u\" ? window : {}, M = B.document || { head: {} };\nB.HTMLElement;\nvar j = {\n $flags$: 0,\n $resourcesUrl$: \"\",\n jmp: (e) => e(),\n raf: (e) => requestAnimationFrame(e),\n ael: (e, t, s, r) => e.addEventListener(t, s, r),\n rel: (e, t, s, r) => e.removeEventListener(t, s, r),\n ce: (e, t) => new CustomEvent(e, t)\n}, Q = {}, Te = \"http://www.w3.org/2000/svg\", ke = \"http://www.w3.org/1999/xhtml\", xe = (e) => e != null, re = (e) => (e = typeof e, e === \"object\" || e === \"function\"), Ae = {};\nSe(Ae, {\n err: () => oe,\n map: () => Ee,\n ok: () => U,\n unwrap: () => je,\n unwrapErr: () => Re\n});\nvar U = (e) => ({\n isOk: !0,\n isErr: !1,\n value: e\n}), oe = (e) => ({\n isOk: !1,\n isErr: !0,\n value: e\n});\nfunction Ee(e, t) {\n if (e.isOk) {\n const s = t(e.value);\n return s instanceof Promise ? s.then((r) => U(r)) : U(s);\n }\n if (e.isErr) {\n const s = e.value;\n return oe(s);\n }\n throw \"should never get here\";\n}\nvar je = (e) => {\n if (e.isOk)\n return e.value;\n throw e.value;\n}, Re = (e) => {\n if (e.isErr)\n return e.value;\n throw e.value;\n}, Le = (e, t, ...s) => {\n let r = null, o = null, n = null, i = !1, a = !1;\n const c = [], d = (l) => {\n for (let $ = 0; $ < l.length; $++)\n r = l[$], Array.isArray(r) ? d(r) : r != null && typeof r != \"boolean\" && ((i = !re(r)) && (r = String(r)), i && a ? c[c.length - 1].$text$ += r : c.push(i ? W(null, r) : r), a = i);\n };\n d(s);\n const f = W(e, null);\n return f.$attrs$ = t, c.length > 0 && (f.$children$ = c), f.$key$ = o, f.$name$ = n, f;\n}, W = (e, t) => {\n const s = {\n $flags$: 0,\n $tag$: e,\n $text$: t,\n $elm$: null,\n $children$: null\n };\n return s.$attrs$ = null, s.$key$ = null, s.$name$ = null, s;\n}, Oe = {}, Ne = (e) => e && e.$tag$ === Oe, Z = (e, t, s, r, o, n) => {\n if (s !== r) {\n let i = J(e, t), a = t.toLowerCase();\n if (t === \"class\") {\n const c = e.classList, d = Y(s), f = Y(r);\n c.remove(...d.filter((l) => l && !f.includes(l))), c.add(...f.filter((l) => l && !d.includes(l)));\n } else if (t === \"style\") {\n for (const c in s)\n (!r || r[c] == null) && (c.includes(\"-\") ? e.style.removeProperty(c) : e.style[c] = \"\");\n for (const c in r)\n (!s || r[c] !== s[c]) && (c.includes(\"-\") ? e.style.setProperty(c, r[c]) : e.style[c] = r[c]);\n } else if (t !== \"key\") if (t === \"ref\")\n r && r(e);\n else if (!e.__lookupSetter__(t) && t[0] === \"o\" && t[1] === \"n\") {\n if (t[2] === \"-\" ? t = t.slice(3) : J(B, a) ? t = a.slice(2) : t = a[2] + t.slice(3), s || r) {\n const c = t.endsWith(ne);\n t = t.replace(Fe, \"\"), s && j.rel(e, t, s, c), r && j.ael(e, t, r, c);\n }\n } else {\n const c = re(r);\n if ((i || c && r !== null) && !o)\n try {\n if (e.tagName.includes(\"-\"))\n e[t] = r;\n else {\n const f = r ?? \"\";\n t === \"list\" ? i = !1 : (s == null || e[t] != f) && (typeof e.__lookupSetter__(t) == \"function\" ? e[t] = f : e.setAttribute(t, f));\n }\n } catch {\n }\n let d = !1;\n a !== (a = a.replace(/^xlink\\:?/, \"\")) && (t = a, d = !0), r == null || r === !1 ? (r !== !1 || e.getAttribute(t) === \"\") && (d ? e.removeAttributeNS(K, t) : e.removeAttribute(t)) : (!i || n & 4 || o) && !c && (r = r === !0 ? \"\" : r, d ? e.setAttributeNS(K, t, r) : e.setAttribute(t, r));\n }\n }\n}, Me = /\\s/, Y = (e) => e ? e.split(Me) : [], ne = \"Capture\", Fe = new RegExp(ne + \"$\"), ie = (e, t, s) => {\n const r = t.$elm$.nodeType === 11 && t.$elm$.host ? t.$elm$.host : t.$elm$, o = e && e.$attrs$ || Q, n = t.$attrs$ || Q;\n for (const i of V(Object.keys(o)))\n i in n || Z(r, i, o[i], void 0, s, t.$flags$);\n for (const i of V(Object.keys(n)))\n Z(r, i, o[i], n[i], s, t.$flags$);\n};\nfunction V(e) {\n return e.includes(\"ref\") ? (\n // we need to sort these to ensure that `'ref'` is the last attr\n [...e.filter((t) => t !== \"ref\"), \"ref\"]\n ) : (\n // no need to sort, return the original array\n e\n );\n}\nvar x, H, R, F = !1, _ = !1, I = !1, h = !1, D = (e, t, s, r) => {\n var o;\n const n = t.$children$[s];\n let i = 0, a, c, d;\n if (F || (I = !0, n.$tag$ === \"slot\" && (x && r.classList.add(x + \"-s\"), n.$flags$ |= n.$children$ ? (\n // slot element has fallback content\n // still create an element that \"mocks\" the slot element\n 2\n ) : (\n // slot element does not have fallback content\n // create an html comment we'll use to always reference\n // where actual slot content should sit next to\n 1\n ))), n.$text$ !== null)\n a = n.$elm$ = M.createTextNode(n.$text$);\n else if (n.$flags$ & 1)\n a = n.$elm$ = M.createTextNode(\"\");\n else {\n if (h || (h = n.$tag$ === \"svg\"), a = n.$elm$ = M.createElementNS(\n h ? Te : ke,\n !F && E.slotRelocation && n.$flags$ & 2 ? \"slot-fb\" : n.$tag$\n ), h && n.$tag$ === \"foreignObject\" && (h = !1), ie(null, n, h), !!a.getRootNode().querySelector(\"body\") && E.scoped && xe(x) && a[\"s-si\"] !== x && a.classList.add(a[\"s-si\"] = x), G(a, r), n.$children$)\n for (i = 0; i < n.$children$.length; ++i)\n c = D(e, n, i, a), c && a.appendChild(c);\n n.$tag$ === \"svg\" ? h = !1 : a.tagName === \"foreignObject\" && (h = !0);\n }\n return a[\"s-hn\"] = R, n.$flags$ & 3 && (a[\"s-sr\"] = !0, a[\"s-cr\"] = H, a[\"s-sn\"] = n.$name$ || \"\", a[\"s-rf\"] = (o = n.$attrs$) == null ? void 0 : o.ref, d = e && e.$children$ && e.$children$[s], d && d.$tag$ === n.$tag$ && e.$elm$ && L(e.$elm$, !1)), a;\n}, L = (e, t) => {\n j.$flags$ |= 1;\n const s = Array.from(e.childNodes);\n if (e[\"s-sr\"] && E.experimentalSlotFixes) {\n let r = e;\n for (; r = r.nextSibling; )\n r && r[\"s-sn\"] === e[\"s-sn\"] && r[\"s-sh\"] === R && s.push(r);\n }\n for (let r = s.length - 1; r >= 0; r--) {\n const o = s[r];\n o[\"s-hn\"] !== R && o[\"s-ol\"] && (T(ce(o), o, q(o)), o[\"s-ol\"].remove(), o[\"s-ol\"] = void 0, o[\"s-sh\"] = void 0, I = !0), t && L(o, t);\n }\n j.$flags$ &= -2;\n}, le = (e, t, s, r, o, n) => {\n let i = e[\"s-cr\"] && e[\"s-cr\"].parentNode || e, a;\n for (i.shadowRoot && i.tagName === R && (i = i.shadowRoot); o <= n; ++o)\n r[o] && (a = D(null, s, o, e), a && (r[o].$elm$ = a, T(i, a, q(t))));\n}, ae = (e, t, s) => {\n for (let r = t; r <= s; ++r) {\n const o = e[r];\n if (o) {\n const n = o.$elm$;\n $e(o), n && (_ = !0, n[\"s-ol\"] ? n[\"s-ol\"].remove() : L(n, !0), n.remove());\n }\n }\n}, _e = (e, t, s, r, o = !1) => {\n let n = 0, i = 0, a = 0, c = 0, d = t.length - 1, f = t[0], l = t[d], $ = r.length - 1, u = r[0], p = r[$], m, y;\n for (; n <= d && i <= $; )\n if (f == null)\n f = t[++n];\n else if (l == null)\n l = t[--d];\n else if (u == null)\n u = r[++i];\n else if (p == null)\n p = r[--$];\n else if (N(f, u, o))\n A(f, u, o), f = t[++n], u = r[++i];\n else if (N(l, p, o))\n A(l, p, o), l = t[--d], p = r[--$];\n else if (N(f, p, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(f.$elm$.parentNode, !1), A(f, p, o), T(e, f.$elm$, l.$elm$.nextSibling), f = t[++n], p = r[--$];\n else if (N(l, u, o))\n (f.$tag$ === \"slot\" || p.$tag$ === \"slot\") && L(l.$elm$.parentNode, !1), A(l, u, o), T(e, l.$elm$, f.$elm$), l = t[--d], u = r[++i];\n else {\n for (a = -1, c = n; c <= d; ++c)\n if (t[c] && t[c].$key$ !== null && t[c].$key$ === u.$key$) {\n a = c;\n break;\n }\n a >= 0 ? (y = t[a], y.$tag$ !== u.$tag$ ? m = D(t && t[i], s, a, e) : (A(y, u, o), t[a] = void 0, m = y.$elm$), u = r[++i]) : (m = D(t && t[i], s, i, e), u = r[++i]), m && T(ce(f.$elm$), m, q(f.$elm$));\n }\n n > d ? le(\n e,\n r[$ + 1] == null ? null : r[$ + 1].$elm$,\n s,\n r,\n i,\n $\n ) : i > $ && ae(t, n, d);\n}, N = (e, t, s = !1) => e.$tag$ === t.$tag$ ? e.$tag$ === \"slot\" ? (\n // The component gets hydrated and no VDOM has been initialized.\n // Here the comparison can't happen as $name$ property is not set for `leftNode`.\n \"$nodeId$\" in e && s && // `leftNode` is not from type HTMLComment which would cause many\n // hydration comments to be removed\n e.$elm$.nodeType !== 8 ? !1 : e.$name$ === t.$name$\n) : s ? !0 : e.$key$ === t.$key$ : !1, q = (e) => e && e[\"s-ol\"] || e, ce = (e) => (e[\"s-ol\"] ? e[\"s-ol\"] : e).parentNode, A = (e, t, s = !1) => {\n const r = t.$elm$ = e.$elm$, o = e.$children$, n = t.$children$, i = t.$tag$, a = t.$text$;\n let c;\n a === null ? (h = i === \"svg\" ? !0 : i === \"foreignObject\" ? !1 : h, i === \"slot\" && !F || ie(e, t, h), o !== null && n !== null ? _e(r, o, t, n, s) : n !== null ? (e.$text$ !== null && (r.textContent = \"\"), le(r, null, t, n, 0, n.length - 1)) : (\n // don't do this on initial render as it can cause non-hydrated content to be removed\n !s && E.updatable && o !== null && ae(o, 0, o.length - 1)\n ), h && i === \"svg\" && (h = !1)) : (c = r[\"s-cr\"]) ? c.parentNode.textContent = a : e.$text$ !== a && (r.data = a);\n}, fe = (e) => {\n const t = e.childNodes;\n for (const s of t)\n if (s.nodeType === 1) {\n if (s[\"s-sr\"]) {\n const r = s[\"s-sn\"];\n s.hidden = !1;\n for (const o of t)\n if (o !== s) {\n if (o[\"s-hn\"] !== s[\"s-hn\"] || r !== \"\") {\n if (o.nodeType === 1 && (r === o.getAttribute(\"slot\") || r === o[\"s-sn\"]) || o.nodeType === 3 && r === o[\"s-sn\"]) {\n s.hidden = !0;\n break;\n }\n } else if (o.nodeType === 1 || o.nodeType === 3 && o.textContent.trim() !== \"\") {\n s.hidden = !0;\n break;\n }\n }\n }\n fe(s);\n }\n}, b = [], ue = (e) => {\n let t, s, r;\n for (const o of e.childNodes) {\n if (o[\"s-sr\"] && (t = o[\"s-cr\"]) && t.parentNode) {\n s = t.parentNode.childNodes;\n const n = o[\"s-sn\"];\n for (r = s.length - 1; r >= 0; r--)\n if (t = s[r], !t[\"s-cn\"] && !t[\"s-nr\"] && t[\"s-hn\"] !== o[\"s-hn\"] && !E.experimentalSlotFixes)\n if (ee(t, n)) {\n let i = b.find((a) => a.$nodeToRelocate$ === t);\n _ = !0, t[\"s-sn\"] = t[\"s-sn\"] || n, i ? (i.$nodeToRelocate$[\"s-sh\"] = o[\"s-hn\"], i.$slotRefNode$ = o) : (t[\"s-sh\"] = o[\"s-hn\"], b.push({\n $slotRefNode$: o,\n $nodeToRelocate$: t\n })), t[\"s-sr\"] && b.map((a) => {\n ee(a.$nodeToRelocate$, t[\"s-sn\"]) && (i = b.find((c) => c.$nodeToRelocate$ === t), i && !a.$slotRefNode$ && (a.$slotRefNode$ = i.$slotRefNode$));\n });\n } else b.some((i) => i.$nodeToRelocate$ === t) || b.push({\n $nodeToRelocate$: t\n });\n }\n o.nodeType === 1 && ue(o);\n }\n}, ee = (e, t) => e.nodeType === 1 ? e.getAttribute(\"slot\") === null && t === \"\" || e.getAttribute(\"slot\") === t : e[\"s-sn\"] === t ? !0 : t === \"\", $e = (e) => {\n e.$attrs$ && e.$attrs$.ref && e.$attrs$.ref(null), e.$children$ && e.$children$.map($e);\n}, T = (e, t, s) => {\n const r = e == null ? void 0 : e.insertBefore(t, s);\n return G(t, e), r;\n}, de = (e) => {\n const t = [];\n return e && t.push(\n ...e[\"s-scs\"] || [],\n e[\"s-si\"],\n e[\"s-sc\"],\n ...de(e.parentElement)\n ), t;\n}, G = (e, t, s = !1) => {\n var r;\n if (e && t && e.nodeType === 1) {\n const o = new Set(de(t).filter(Boolean));\n if (o.size && ((r = e.classList) == null || r.add(...e[\"s-scs\"] = [...o]), e[\"s-ol\"] || s))\n for (const n of Array.from(e.childNodes))\n G(n, e, !0);\n }\n}, De = (e, t, s = !1) => {\n var r, o, n, i, a;\n const c = e.$hostElement$, d = e.$cmpMeta$, f = e.$vnode$ || W(null, null), l = Ne(t) ? t : Le(null, null, t);\n if (R = c.tagName, d.$attrsToReflect$ && (l.$attrs$ = l.$attrs$ || {}, d.$attrsToReflect$.map(\n ([$, u]) => l.$attrs$[u] = c[$]\n )), s && l.$attrs$)\n for (const $ of Object.keys(l.$attrs$))\n c.hasAttribute($) && ![\"key\", \"ref\", \"style\", \"class\"].includes($) && (l.$attrs$[$] = c[$]);\n l.$tag$ = null, l.$flags$ |= 4, e.$vnode$ = l, l.$elm$ = f.$elm$ = c.shadowRoot || c, x = c[\"s-sc\"], F = (d.$flags$ & 1) !== 0, H = c[\"s-cr\"], _ = !1, A(f, l, s);\n {\n if (j.$flags$ |= 1, I) {\n ue(l.$elm$);\n for (const $ of b) {\n const u = $.$nodeToRelocate$;\n if (!u[\"s-ol\"]) {\n const p = M.createTextNode(\"\");\n p[\"s-nr\"] = u, T(u.parentNode, u[\"s-ol\"] = p, u);\n }\n }\n for (const $ of b) {\n const u = $.$nodeToRelocate$, p = $.$slotRefNode$;\n if (p) {\n const m = p.parentNode;\n let y = p.nextSibling;\n {\n let O = (r = u[\"s-ol\"]) == null ? void 0 : r.previousSibling;\n for (; O; ) {\n let v = (o = O[\"s-nr\"]) != null ? o : null;\n if (v && v[\"s-sn\"] === u[\"s-sn\"] && m === v.parentNode) {\n for (v = v.nextSibling; v === u || v != null && v[\"s-sr\"]; )\n v = v == null ? void 0 : v.nextSibling;\n if (!v || !v[\"s-nr\"]) {\n y = v;\n break;\n }\n }\n O = O.previousSibling;\n }\n }\n (!y && m !== u.parentNode || u.nextSibling !== y) && u !== y && (!u[\"s-hn\"] && u[\"s-ol\"] && (u[\"s-hn\"] = u[\"s-ol\"].parentNode.nodeName), T(m, u, y), u.nodeType === 1 && (u.hidden = (n = u[\"s-ih\"]) != null ? n : !1)), u && typeof p[\"s-rf\"] == \"function\" && p[\"s-rf\"](u);\n } else\n u.nodeType === 1 && (s && (u[\"s-ih\"] = (i = u.hidden) != null ? i : !1), u.hidden = !0);\n }\n }\n _ && fe(l.$elm$), j.$flags$ &= -2, b.length = 0;\n }\n if (E.experimentalScopedSlotChanges && d.$flags$ & 2)\n for (const $ of l.$elm$.childNodes)\n $[\"s-hn\"] !== R && !$[\"s-sh\"] && (s && $[\"s-ih\"] == null && ($[\"s-ih\"] = (a = $.hidden) != null ? a : !1), $.hidden = !0);\n H = void 0;\n};\nconst Ce = (e, t, s) => {\n [null, void 0, \"\", !1].includes(s) || [\"innerHTML\", \"style\"].includes(t) || e.setAttribute(t, [\"object\", \"function\"].includes(typeof s) ? \"/!\\\\ Object props are not rendered in the code example\" : s);\n}, pe = (e, t, s, r, o) => {\n if (t && typeof t == \"string\") {\n const n = document.createElement(t);\n Object.keys(s || {}).forEach((i) => {\n Ce(n, i, s[i]);\n }), r == null || r.forEach((i) => {\n pe(n, i.$tag$, i.$attrs$, i.$children$, i.$text$);\n }), s != null && s.innerHTML && (n.innerHTML = s.innerHTML), e.appendChild(n);\n }\n o && (e.innerHTML = o);\n}, st = (e, t) => {\n const s = {};\n if (typeof e != \"object\")\n throw new Error(\"filterArgs - args isn't an object.\");\n for (const r in e)\n if (!r.startsWith(\"slot\")) {\n const o = e[r], n = r.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n (!t || !Object.keys(t).includes(r) || t[r] !== o) && (s[n] = o);\n }\n return s;\n}, rt = (e, t) => {\n var r, o;\n const s = document.getElementById(\"storybook-root\");\n if (s !== null)\n return (o = document.querySelector(\"[lang]\")) == null || o.setAttribute(\"lang\", ((r = t.globals) == null ? void 0 : r.locale) || \"en\"), De(\n {\n $ancestorComponent$: void 0,\n $flags$: 0,\n $modeName$: void 0,\n $cmpMeta$: {\n $flags$: 0,\n $tagName$: s.tagName\n },\n $hostElement$: s\n },\n e(t)\n ), s.children[s.children.length - 1];\n}, ot = ({ $tag$: e, $attrs$: t, $children$: s, $text$: r }) => {\n const o = document.createElement(\"div\");\n return pe(o, e, t, s, r), o.innerHTML;\n}, C = (e, t) => {\n if (!t)\n return;\n const s = t.split(\"/\");\n return `${e}${s.slice(2, s.length - 1).join(\"-\")}--docs`;\n};\nvar S, w;\nclass nt {\n constructor(t) {\n /**\n * JsonDocs\n */\n g(this, \"jsonDoc\");\n /**\n * Get component data from the jsonDoc\n * @param tagName - tag name we want to get the data from\n * @returns component data\n */\n P(this, S, (t) => this.jsonDoc.components.find((s) => s.tag === t));\n /**\n * Get the control for the given prop\n * Based on https://storybook.js.org/docs/api/arg-types#controltype\n * @param prop - prop to get control for\n * @returns control type and options if applicable\n */\n P(this, w, (t) => {\n const s = t.type.replace(/\"([^\"]+)\"/g, \"$1\").replace(/\\s/g, \"\").replace(/\\(.*?\\)/g, (r) => r.replace(/\\|/g, \" OR \")).split(\"|\").map((r) => r.trim().replace(/ OR /g, \"|\"));\n return t.type === \"string\" ? { control: { type: \"text\" } } : t.type === \"number\" ? { control: { type: \"number\" } } : t.type === \"boolean\" ? { control: { type: \"boolean\" } } : t.type.startsWith(\"{\") && t.type.endsWith(\"}\") ? { control: { type: \"object\" } } : s.length > 1 ? s.includes(\"string\") ? { control: { type: \"text\" } } : s.every((r) => r == null ? void 0 : r.includes(\"[]\")) ? { control: { type: \"object\" } } : (s.unshift(void 0), { control: { type: \"select\" }, options: s }) : { control: { type: \"object\" } };\n });\n /**\n * Extract component arg types from the component data\n * @param tagName - tag name we want to extract the arg types from\n * @returns component arg types\n */\n g(this, \"extractArgTypes\", (t) => {\n const s = k(this, S).call(this, t), r = s == null ? void 0 : s.props.reduce((f, l) => {\n const { control: $, options: u } = k(this, w).call(this, l);\n return {\n ...f,\n [l.name]: {\n name: l.attr || l.name,\n description: l.docs,\n type: { required: l.required },\n table: {\n category: \"props\",\n type: { summary: l.type },\n defaultValue: { summary: l.default }\n },\n control: $,\n options: u\n }\n };\n }, {}), o = s == null ? void 0 : s.events.reduce(\n (f, l) => ({\n ...f,\n [l.event]: {\n name: l.event,\n description: l.docs,\n table: {\n category: \"events\",\n type: { summary: l.detail }\n }\n }\n }),\n {}\n ), n = s == null ? void 0 : s.methods.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"methods\",\n type: { summary: l.signature }\n }\n }\n }),\n {}\n ), i = s == null ? void 0 : s.slots.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name !== \"\" ? l.name : \"default\",\n // default slot are unnamed\n description: l.docs,\n table: {\n category: \"slots\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), a = s == null ? void 0 : s.styles.reduce(\n (f, l) => ({\n ...f,\n [l.name]: {\n name: l.name,\n description: l.docs,\n table: {\n category: \"custom properties\",\n type: { summary: void 0 }\n }\n }\n }),\n {}\n ), c = s == null ? void 0 : s.dependencies.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"depends on\",\n type: { summary: void 0 }\n }\n }\n };\n }, {}), d = s == null ? void 0 : s.dependents.reduce((f, l) => {\n const $ = k(this, S).call(this, l);\n return {\n ...f,\n [l]: {\n name: l,\n description: `<a href=\"./?path=/docs/${C(\"\", $ == null ? void 0 : $.filePath)}\">View Component Documentation</a>`,\n table: {\n category: \"used by\",\n type: { summary: void 0 }\n }\n }\n };\n }, {});\n return {\n ...r,\n ...o,\n ...n,\n ...i,\n ...a,\n ...c,\n ...d\n };\n });\n /**\n * Extract component description from the component data\n * @param tagName - tag name we want to extract the description from\n * @returns component description\n */\n g(this, \"extractComponentDescription\", (t) => {\n const s = k(this, S).call(this, t);\n return (s == null ? void 0 : s.readme) || (s == null ? void 0 : s.docs);\n });\n this.jsonDoc = t;\n }\n}\nS = new WeakMap(), w = new WeakMap();\nconst we = (e, t) => {\n if (t)\n return `${e}${t}`;\n}, ge = (e) => {\n let t = e.overview ? `${e.overview}\n\n` : \"\";\n const s = e.props.filter(({ attr: o }) => o !== void 0);\n s.length && (t += `Attributes:\n`, t += s.map(({ attr: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`);\n const r = e.props.filter(({ attr: o }) => o === void 0);\n return r.length && (t += `Properties:\n`, t += r.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.methods.length && (t += `Methods:\n`, t += e.methods.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.events.length && (t += `Events:\n`, t += e.events.map(({ event: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), e.listeners.length && (t += `Listeners:\n`, t += e.listeners.map(({ event: o }) => `- \\`${o}\\`\n`).join(\"\"), t += `\n`), e.slots.length && (t += `Slots:\n`, t += e.slots.map(({ name: o, docs: n }) => `- \\`${o}\\`: ${n}\n`).join(\"\"), t += `\n`), t;\n}, z = (e) => `${e.docs}\n\nType: \\`${e.type}\\``, it = (e, t, s, r) => ({\n $schema: \"https://json.schemastore.org/web-types\",\n name: e,\n version: t,\n \"description-markup\": \"markdown\",\n contributions: {\n html: {\n elements: s.components.map((o) => {\n const n = C(r, o.filePath);\n return {\n name: o.tag,\n description: ge(o),\n \"doc-url\": n,\n attributes: o.props.filter((i) => i.attr).map((i) => ({\n name: i.attr,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n js: {\n properties: o.props.map((i) => ({\n name: i.name,\n description: z(i),\n \"doc-url\": n,\n value: {\n type: i.type,\n default: i.default,\n required: i.required\n }\n })),\n events: o.events.map((i) => ({\n name: i.event,\n description: i.docs\n }))\n },\n css: {\n properties: o.styles.map((i) => ({\n name: i.name,\n description: i.docs\n }))\n }\n };\n })\n }\n }\n}), Pe = (e, t, s) => [\n { name: \"Storybook\", url: C(e, s) },\n { name: \"Sources\", url: we(t, s) }\n], Ue = (e) => {\n if (!e.values.some(({ value: t }) => t === void 0))\n return e.values.map(({ value: t }) => ({ name: t }));\n}, lt = (e, t, s) => ({\n version: 1.1,\n tags: e.components.map((r) => {\n const o = Pe(t, s, r.filePath);\n return {\n name: r.tag,\n description: ge(r),\n attributes: r.props.map((n) => ({\n name: n.attr || n.name,\n description: z(n),\n values: Ue(n),\n references: o\n })),\n references: o\n };\n }),\n globalAttributes: [],\n valueSets: []\n}), at = (e) => ({\n version: 1.1,\n properties: e.components.flatMap(\n (t) => t.styles.map((s) => ({\n name: s.name,\n description: s.docs\n }))\n )\n}), ct = (e) => {\n const t = { value: \"2023\", pattern: \"yyyy\" }, s = { value: \"12\", pattern: \"mm\" }, r = { value: \"24\", pattern: \"dd\" };\n return ze([t.value, s.value, r.value].join(\"-\"), e, { timeZone: \"UTC\" }).replace(t.value, t.pattern).replace(s.value, s.pattern).replace(r.value, r.pattern);\n}, ft = (e) => e.toISOString().split(\"T\")[0], We = (e, t, s) => {\n const r = e.closest(\"[lang]\"), o = Intl.NumberFormat.supportedLocalesOf(r == null ? void 0 : r.lang), n = o.length > 0 && typeof o[0] == \"string\" ? o[0] : navigator.language || s, i = n.split(\"-\").shift();\n return Object.keys(t).length === 0 ? {\n locale: n,\n messages: { lang: s }\n } : {\n locale: n,\n messages: t[i] || t[s] || { lang: s }\n };\n}, ut = (e, t, s) => new Intl.NumberFormat(t, { style: \"currency\", currency: s }).format(e), $t = (e, t, s = 0) => new Intl.NumberFormat(t, { minimumFractionDigits: s }).format(s > 0 ? Number(e == null ? void 0 : e.toFixed(s)) : e), dt = (e, t, s = 0) => new Intl.NumberFormat(t, {\n style: \"percent\",\n minimumFractionDigits: s,\n maximumFractionDigits: s\n}).format(e), pt = (e, t, s, r = \"short\", o = 0) => new Intl.NumberFormat(t, {\n style: \"unit\",\n unit: s,\n unitDisplay: r,\n minimumFractionDigits: o,\n maximumFractionDigits: o\n}).format(e), He = /^\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\\d|3[01])$/, ze = (e, t, s) => typeof e != \"string\" || e === \"\" || !He.test(e) ? \"\" : new Intl.DateTimeFormat(t, s).format(new Date(e)), gt = (e, t) => (s) => We(s, e, t), vt = ({ disconnect: e, observe: t, takeRecords: s }) => {\n class r {\n constructor(n) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"takeRecords\", s);\n /**\n *\n */\n g(this, \"cb\");\n this.cb = n;\n }\n }\n return [window, global].forEach((o) => {\n Object.defineProperty(o, \"MutationObserver\", {\n writable: !0,\n configurable: !0,\n value: r\n });\n }), r;\n}, ht = ({ disconnect: e, observe: t }) => {\n class s {\n constructor(o) {\n /**\n *\n */\n g(this, \"disconnect\", e);\n /**\n *\n */\n g(this, \"observe\", t);\n /**\n *\n */\n g(this, \"unobserve\");\n /**\n *\n */\n g(this, \"cb\");\n this.cb = o;\n }\n }\n return [window, global].forEach((r) => {\n Object.defineProperty(r, \"ResizeObserver\", {\n writable: !0,\n configurable: !0,\n value: s\n });\n }), s;\n};\nclass Be extends Event {\n constructor() {\n super(...arguments);\n /**\n *\n */\n g(this, \"detail\");\n }\n // eslint-disable-line @typescript-eslint/no-explicit-any\n}\nconst yt = () => {\n class e extends Be {\n }\n return [window, global].forEach((t) => {\n Object.defineProperty(t, \"SubmitEvent\", {\n writable: !0,\n configurable: !0,\n value: e\n });\n }), e;\n};\nexport {\n Xe as ClassList,\n nt as StorybookPreview,\n Je as allItemsAreString,\n et as cleanString,\n qe as createID,\n He as dateRegExp,\n ft as dateToString,\n gt as defineLocales,\n st as filterArgs,\n Qe as focusableElements,\n ct as getLocaleDatePattern,\n te as getParentWindows,\n ot as getStoryHTML,\n C as getStorybookUrl,\n Ze as getWindows,\n Ke as isTagName,\n Ve as isValidNumber,\n me as isValidString,\n Ge as isValideID,\n ut as localeCurrency,\n ze as localeDate,\n $t as localeNumber,\n dt as localePercent,\n pt as localeUnit,\n tt as nextTick,\n vt as setupMutationObserverMock,\n ht as setupResizeObserverMock,\n yt as setupSubmitEventMock,\n rt as stencilWrapper,\n Ye as toString,\n at as vsCodeCssGenerator,\n lt as vsCodeGenerator,\n it as webTypesGenerator\n};\n//# sourceMappingURL=index.es.js.map\n"],"mappings":"AAAA,IAAIA,EAAKC,OAAOC,eAIhB,IAAIC,EAAK,CAACC,EAAGC,EAAGC,IAAMD,KAAKD,EAAIJ,EAAGI,EAAGC,EAAG,CAAEE,YAAa,EAAGC,cAAe,EAAGC,UAAW,EAAGC,MAAOJ,IAAOF,EAAEC,GAAKC,EAC5G,IAACK,EAAI,CAACP,EAAGC,EAAGC,IAAMH,EAAGC,SAAUC,GAAK,SAAWA,EAAI,GAAKA,EAAGC,GAEzD,MAACM,EAAK,CAACR,EAAI,GAAIC,EAAI,MACtB,MAAMC,EAAI,IAAIO,WAAWR,GACzBS,OAAOC,gBAAgBT,GACvB,MAAMU,EAAIC,MAAMC,KAAKZ,GAAGa,KAAKC,GAAMA,EAAEC,SAAS,IAAIC,SAAS,EAAG,OAAMC,KAAK,IAAIC,MAAM,EAAGnB,GACtF,OAAOD,IAAM,GAAK,GAAGA,KAAKY,IAAMA,CAAC,EAChCS,EAAMrB,GAAMsB,EAAGtB,IAAM,kCAAkCuB,KAAKvB,KAAO,KACtE,MAAMwB,EACJ,WAAAC,CAAYxB,EAAI,IAIdM,EAAEmB,KAAM,WAKRnB,EAAEmB,KAAM,OAAQzB,IACdyB,KAAKC,IAAI1B,IAAMyB,KAAKE,QAAQC,KAAK5B,EAAE,IAMrCM,EAAEmB,KAAM,UAAWzB,IACjB,MAAMC,EAAIwB,KAAKE,QAAQE,QAAQ7B,GAC/BC,GAAK,GAAKwB,KAAKE,QAAQG,OAAO7B,EAAG,EAAE,IAOrCK,EAAEmB,KAAM,OAAQzB,GAAMyB,KAAKE,QAAQI,SAAS/B,KAK5CM,EAAEmB,KAAM,QAAQ,IAAMA,KAAKE,QAAQT,KAAK,OACxCO,KAAKE,QAAU3B,CACnB,EAEK,MAACgC,EAAMjC,GAAMa,MAAMqB,QAAQlC,IAAMA,EAAEmC,OAAOlC,UAAaA,GAAK,WAAWmC,EAAK,CAACpC,EAAGC,IAAMA,EAAE+B,SAAShC,GAAK,UAAY,EAAIA,EAAEqC,QAAQC,eAAgBC,EAAK,8GAA+GC,EAAMxC,IAC7Q,MAAMC,EAAIwC,EAAGzC,GAAIE,EAAIwC,EAAG1C,GACxB,MAAO,CAACA,KAAMC,KAAMC,EAAE,EACrBuC,EAAK,CAACzC,EAAGC,EAAI,MACd,GAAID,EAAE2C,OAAS3C,EAAE4C,IACf,IACE,MAAM1C,EAAIF,EAAE6C,OACZ,OAAO3C,GAAKD,EAAE4B,KAAK3B,GAAIuC,EAAGvC,EAAGD,IAAMA,CACzC,CAAM,MAAOC,GACP,OAAO4C,QAAQC,MAAM,mCAAoC7C,GAAID,CACnE,CACE,OAAOA,CAAC,EACPyC,EAAK,CAAC1C,EAAGC,EAAI,MACd,GAAID,EAAEgD,OAAOC,OAAS,EACpB,IAAK,MAAM/C,KAAKW,MAAMC,KAAKd,EAAEgD,QAC3B/C,EAAE4B,KAAK3B,GAAIwC,EAAGxC,EAAGD,GACrB,OAAOA,CAAC,EACPqB,EAAMtB,UAAaA,GAAK,UAAYA,EAAEkD,SAAW,GAAIC,EAAMnD,UAAaA,GAAK,SAAWoD,KAAKC,UAAUrD,GAAK,GAAGA,IAAKsD,EAAMtD,UAAaA,GAAK,WAAauD,OAAOC,MAAMxD,GAAIyD,EAAMzD,UAAaA,GAAK,SAAWA,EAAE0D,oBAAoBC,UAAU,OAAOC,WAAW,mBAAoB,IAAM5D,EAAG6D,EAAKC,MAAO9D,GAAMA,IAC9S,IAyFA+D,EAAKlE,OAAOC,eAAgBkE,EAAK,CAAChE,EAAGC,KACtC,IAAK,IAAIC,KAAKD,EACZ8D,EAAG/D,EAAGE,EAAG,CAAE+D,IAAKhE,EAAEC,GAAIC,YAAa,GAAI,EAGxC,IAQuK+D,EAAK,GAC/KF,EAAGE,EAAI,CACLC,IAAK,IAAMC,EACXrD,IAAK,IAAMsD,EACXC,GAAI,IAAMC,EACVC,OAAQ,IAAMC,EACdC,UAAW,IAAMC,IAEnB,IAAIJ,EAAKvE,IAAC,CACR4E,MAAO,EACPC,OAAQ,EACRvE,MAAON,IACLoE,EAAMpE,IAAC,CACT4E,MAAO,EACPC,OAAQ,EACRvE,MAAON,IAET,SAASqE,EAAGrE,EAAGC,GACb,GAAID,EAAE4E,KAAM,CACV,MAAM1E,EAAID,EAAED,EAAEM,OACd,OAAOJ,aAAa4E,QAAU5E,EAAE6E,MAAMnE,GAAM2D,EAAE3D,KAAM2D,EAAErE,EAC1D,CACE,GAAIF,EAAE6E,MAAO,CACX,MAAM3E,EAAIF,EAAEM,MACZ,OAAO8D,EAAGlE,EACd,CACE,KAAM,uBACR,CACG,IAACuE,EAAMzE,IACR,GAAIA,EAAE4E,KACJ,OAAO5E,EAAEM,MACX,MAAMN,EAAEM,KAAK,EACZqE,EAAM3E,IACP,GAAIA,EAAE6E,MACJ,OAAO7E,EAAEM,MACX,MAAMN,EAAEM,KAAK,EAkeV,MAgHD0E,EAAMhF,IACR,MAAMC,EAAI,CAAEK,MAAO,OAAQ2E,QAAS,QAAU/E,EAAI,CAAEI,MAAO,KAAM2E,QAAS,MAAQrE,EAAI,CAAEN,MAAO,KAAM2E,QAAS,MAC9G,OAAOC,EAAG,CAACjF,EAAEK,MAAOJ,EAAEI,MAAOM,EAAEN,OAAOa,KAAK,KAAMnB,EAAG,CAAEmF,SAAU,QAASC,QAAQnF,EAAEK,MAAOL,EAAEgF,SAASG,QAAQlF,EAAEI,MAAOJ,EAAE+E,SAASG,QAAQxE,EAAEN,MAAOM,EAAEqE,QAAQ,EAC3JI,EAAMrF,GAAMA,EAAEsF,cAAcC,MAAM,KAAK,GAAIC,EAAK,CAACxF,EAAGC,EAAGC,KACxD,MAAMU,EAAIZ,EAAEyF,QAAQ,UAAWzE,EAAI0E,KAAKC,aAAaC,mBAAmBhF,GAAK,UAAY,EAAIA,EAAEiF,MAAOC,EAAI9E,EAAEiC,OAAS,UAAYjC,EAAE,IAAM,SAAWA,EAAE,GAAK+E,UAAUC,UAAY9F,EAAG+F,EAAIH,EAAEP,MAAM,KAAKW,QACrM,OAAOrG,OAAOsG,KAAKlG,GAAGgD,SAAW,EAAI,CACnCmD,OAAQN,EACRO,SAAU,CAAER,KAAM3F,IAChB,CACFkG,OAAQN,EACRO,SAAUpG,EAAEgG,IAAMhG,EAAEC,IAAM,CAAE2F,KAAM3F,GACnC,EACAoG,EAAK,CAACtG,EAAGC,EAAGC,IAAM,IAAIwF,KAAKC,aAAa1F,EAAG,CAAEsG,MAAO,WAAYC,SAAUtG,IAAKuG,OAAOzG,GAAI0G,EAAK,CAAC1G,EAAGC,EAAGC,EAAI,IAAM,IAAIwF,KAAKC,aAAa1F,EAAG,CAAE0G,sBAAuBzG,IAAKuG,OAAOvG,EAAI,EAAIqD,OAAOvD,GAAK,UAAY,EAAIA,EAAE4G,QAAQ1G,IAAMF,GAAI6G,EAAK,CAAC7G,EAAGC,EAAGC,EAAI,IAAM,IAAIwF,KAAKC,aAAa1F,EAAG,CACtRsG,MAAO,UACPI,sBAAuBzG,EACvB4G,sBAAuB5G,IACtBuG,OAAOzG,GAAI+G,EAAK,CAAC/G,EAAGC,EAAGC,EAAGU,EAAI,QAASI,EAAI,IAAM,IAAI0E,KAAKC,aAAa1F,EAAG,CAC3EsG,MAAO,OACPS,KAAM9G,EACN+G,YAAarG,EACb+F,sBAAuB3F,EACvB8F,sBAAuB9F,IACtByF,OAAOzG,GAAIkH,EAAK,gDAAiDhC,EAAK,CAAClF,EAAGC,EAAGC,WAAaF,GAAK,UAAYA,IAAM,KAAOkH,EAAGC,KAAKnH,GAAK,GAAK,IAAI0F,KAAK0B,eAAenH,EAAGC,GAAGuG,OAAO,IAAIY,KAAKrH,IAAKsH,EAAK,CAACtH,EAAGC,IAAOC,GAAMsF,EAAGtF,EAAGF,EAAGC,U","ignoreList":[]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const icons: {
|
|
2
2
|
'address-card': string;
|
|
3
|
+
'address-card-outline': string;
|
|
3
4
|
'align-center': string;
|
|
4
5
|
'align-justify': string;
|
|
5
6
|
'align-left': string;
|
|
@@ -33,6 +34,7 @@ export declare const icons: {
|
|
|
33
34
|
'briefcase-outline': string;
|
|
34
35
|
'building-outline': string;
|
|
35
36
|
calculator: string;
|
|
37
|
+
'calculator-outline': string;
|
|
36
38
|
calendar: string;
|
|
37
39
|
'calendar-euro': string;
|
|
38
40
|
'calendar-euro-outline': string;
|
|
@@ -82,7 +84,9 @@ export declare const icons: {
|
|
|
82
84
|
'exclamation-triangle': string;
|
|
83
85
|
'exclamation-triangle-outline': string;
|
|
84
86
|
eye: string;
|
|
87
|
+
'eye-outline': string;
|
|
85
88
|
'eye-slash': string;
|
|
89
|
+
'eye-slash-outline': string;
|
|
86
90
|
fax: string;
|
|
87
91
|
'fax-outline': string;
|
|
88
92
|
file: string;
|
|
@@ -117,6 +121,8 @@ export declare const icons: {
|
|
|
117
121
|
'gavel-outline': string;
|
|
118
122
|
'graduation-cap': string;
|
|
119
123
|
'graduation-cap-outline': string;
|
|
124
|
+
'hand-euro': string;
|
|
125
|
+
'hand-euro-outline': string;
|
|
120
126
|
'hand-up': string;
|
|
121
127
|
history: string;
|
|
122
128
|
home: string;
|
|
@@ -149,7 +155,9 @@ export declare const icons: {
|
|
|
149
155
|
notes: string;
|
|
150
156
|
'notes-outline': string;
|
|
151
157
|
'paper-plane': string;
|
|
158
|
+
'paper-plane-outline': string;
|
|
152
159
|
'paper-plane-slash': string;
|
|
160
|
+
'paper-plane-slash-outline': string;
|
|
153
161
|
paperclip: string;
|
|
154
162
|
pen: string;
|
|
155
163
|
'pen-circle': string;
|
|
@@ -175,7 +183,9 @@ export declare const icons: {
|
|
|
175
183
|
'star-outline': string;
|
|
176
184
|
table: string;
|
|
177
185
|
tag: string;
|
|
186
|
+
'tag-outline': string;
|
|
178
187
|
tags: string;
|
|
188
|
+
'tags-outline': string;
|
|
179
189
|
'thumb-down': string;
|
|
180
190
|
'thumb-down-outline': string;
|
|
181
191
|
'thumb-up': string;
|
|
@@ -185,6 +195,7 @@ export declare const icons: {
|
|
|
185
195
|
trash: string;
|
|
186
196
|
'trash-outline': string;
|
|
187
197
|
'universal-access': string;
|
|
198
|
+
'universal-access-outline': string;
|
|
188
199
|
unlink: string;
|
|
189
200
|
unlock: string;
|
|
190
201
|
'unlock-outline': string;
|
|
@@ -197,6 +208,7 @@ export declare const icons: {
|
|
|
197
208
|
'user-pen-fancy-outline': string;
|
|
198
209
|
'user-plus': string;
|
|
199
210
|
'user-question-outline': string;
|
|
211
|
+
'user-shield': string;
|
|
200
212
|
'user-shield-outline': string;
|
|
201
213
|
users: string;
|
|
202
214
|
'users-outline': string;
|
|
@@ -25,7 +25,7 @@ export declare class MgTooltip {
|
|
|
25
25
|
* Needed by the input for accessibility `aria-decribedby`.
|
|
26
26
|
*/
|
|
27
27
|
identifier: string;
|
|
28
|
-
watchIdentifier(): void;
|
|
28
|
+
watchIdentifier(newValue: MgTooltip['identifier']): void;
|
|
29
29
|
/**
|
|
30
30
|
* Displayed message in the tooltip
|
|
31
31
|
*/
|
|
@@ -9,24 +9,26 @@ export type Width = (typeof widths)[number];
|
|
|
9
9
|
export declare const tooltipPositions: readonly ["input", "label"];
|
|
10
10
|
export type TooltipPosition = (typeof tooltipPositions)[number];
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* Base interface for common methods
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
|
-
required:
|
|
16
|
-
invalid:
|
|
17
|
-
displayError: () => void;
|
|
14
|
+
interface InputBaseMethods {
|
|
15
|
+
required: boolean;
|
|
16
|
+
invalid: boolean;
|
|
18
17
|
labelOnTop: boolean;
|
|
19
18
|
readonly: boolean;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
displayError: () => Promise<void>;
|
|
20
|
+
reset: () => Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Possible Input types
|
|
24
|
+
*/
|
|
25
|
+
export type HTMLMgInputsElement = (HTMLMgInputElement & InputBaseMethods) | HTMLMgInputCheckboxElement | HTMLMgInputDateElement | HTMLMgInputNumericElement | HTMLMgInputPasswordElement | HTMLMgInputRadioElement | HTMLMgInputSelectElement | HTMLMgInputTextElement | HTMLMgInputTextareaElement | (HTMLMgInputToggleElement & InputBaseMethods);
|
|
25
26
|
/**
|
|
26
27
|
* Available WindowEvent types
|
|
27
28
|
*/
|
|
28
|
-
export type EventType = keyof WindowEventMap &
|
|
29
|
+
export type EventType = keyof WindowEventMap & 'blur';
|
|
29
30
|
export declare const classFieldset = "mg-c-input--fieldset";
|
|
30
31
|
export declare const classDisabled = "mg-c-input--disabled";
|
|
31
32
|
export declare const classReadonly = "mg-c-input--readonly";
|
|
32
33
|
export declare const classVerticalList = "mg-c-input--vertical-list";
|
|
34
|
+
export {};
|
|
@@ -77,10 +77,6 @@ export declare class MgInput {
|
|
|
77
77
|
* Component classes
|
|
78
78
|
*/
|
|
79
79
|
watchClass(): void;
|
|
80
|
-
/**
|
|
81
|
-
* Trigger label update
|
|
82
|
-
*/
|
|
83
|
-
watchLabel(): void;
|
|
84
80
|
/**
|
|
85
81
|
* Element is fieldset
|
|
86
82
|
*/
|
|
@@ -97,6 +93,10 @@ export declare class MgInput {
|
|
|
97
93
|
* Element is disabled
|
|
98
94
|
*/
|
|
99
95
|
isVerticalList: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Trigger label update
|
|
98
|
+
*/
|
|
99
|
+
watchLabel(): void;
|
|
100
100
|
/************
|
|
101
101
|
* Methods *
|
|
102
102
|
************/
|
|
@@ -10,7 +10,6 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
10
10
|
private searchInput;
|
|
11
11
|
private messages;
|
|
12
12
|
private hasDisplayedError;
|
|
13
|
-
private handlerInProgress;
|
|
14
13
|
private mode;
|
|
15
14
|
private readonly baseClassName;
|
|
16
15
|
private readonly classTypeMulti;
|
|
@@ -173,6 +172,10 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
173
172
|
* @param errorMessage - the error message to display
|
|
174
173
|
*/
|
|
175
174
|
setError(valid: MgInputCheckbox['valid'], errorMessage: string): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Reset value, validity and error state
|
|
177
|
+
*/
|
|
178
|
+
reset(): Promise<void>;
|
|
176
179
|
/**
|
|
177
180
|
* Method to set validity values
|
|
178
181
|
* @param newValue - valid new value
|
|
@@ -207,14 +210,6 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
207
210
|
* @param event - mass action event trigger a global select/unselect on values
|
|
208
211
|
*/
|
|
209
212
|
private handleMassAction;
|
|
210
|
-
/**
|
|
211
|
-
* Handle input label mouseenter event
|
|
212
|
-
*/
|
|
213
|
-
private handleMouseEnter;
|
|
214
|
-
/**
|
|
215
|
-
* Handle input label leave event
|
|
216
|
-
*/
|
|
217
|
-
private handleMouseLeave;
|
|
218
213
|
/**
|
|
219
214
|
* Update values
|
|
220
215
|
*/
|
|
@@ -124,6 +124,10 @@ export declare class MgInputDate {
|
|
|
124
124
|
* @param errorMessage - the error message to display
|
|
125
125
|
*/
|
|
126
126
|
setError(valid: MgInputDate['valid'], errorMessage: string): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Reset value, validity and error state
|
|
129
|
+
*/
|
|
130
|
+
reset(): Promise<void>;
|
|
127
131
|
/**
|
|
128
132
|
* Method to validate date pattern string
|
|
129
133
|
* @param value - value to test
|
|
@@ -4,6 +4,6 @@ import type { InputError } from '../../../../types';
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const types: readonly ["decimal", "integer"];
|
|
6
6
|
export type NumericType = (typeof types)[number];
|
|
7
|
-
export declare const formats: readonly ["none", "number", "currency"];
|
|
7
|
+
export declare const formats: readonly ["none", "number", "currency", "percent", "unit"];
|
|
8
8
|
export type Format = (typeof formats)[number];
|
|
9
9
|
export type InputNumericError = InputError & ('min' | 'max' | 'minMax' | 'required');
|
|
@@ -111,6 +111,14 @@ export declare class MgInputNumeric {
|
|
|
111
111
|
* Define currency
|
|
112
112
|
*/
|
|
113
113
|
currency: string;
|
|
114
|
+
/**
|
|
115
|
+
* Define unit symbol (km, L, etc.)
|
|
116
|
+
*/
|
|
117
|
+
unit?: Intl.NumberFormatOptions['unit'];
|
|
118
|
+
/**
|
|
119
|
+
* Define unit display format ('short', 'long', 'narrow')
|
|
120
|
+
*/
|
|
121
|
+
unitDisplay: Intl.NumberFormatOptions['unitDisplay'];
|
|
114
122
|
/**
|
|
115
123
|
* Override integer length
|
|
116
124
|
* integer is the number before the decimal point
|
|
@@ -164,6 +172,10 @@ export declare class MgInputNumeric {
|
|
|
164
172
|
* @param errorMessage - the error message to display
|
|
165
173
|
*/
|
|
166
174
|
setError(valid: MgInputNumeric['valid'], errorMessage: string): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Reset value, validity and error state
|
|
177
|
+
*/
|
|
178
|
+
reset(): Promise<void>;
|
|
167
179
|
/**
|
|
168
180
|
* Method to set validity values
|
|
169
181
|
* @param newValue - valid new value
|
|
@@ -124,6 +124,10 @@ export declare class MgInputPassword {
|
|
|
124
124
|
* @param errorMessage - the error message to display
|
|
125
125
|
*/
|
|
126
126
|
setError(valid: MgInputPassword['valid'], errorMessage: string): Promise<void>;
|
|
127
|
+
/**
|
|
128
|
+
* Reset value, validity and error state
|
|
129
|
+
*/
|
|
130
|
+
reset(): Promise<void>;
|
|
127
131
|
/**
|
|
128
132
|
* Method to set validity values
|
|
129
133
|
* @param newValue - valid new value
|
|
@@ -126,6 +126,10 @@ export declare class MgInputRadio {
|
|
|
126
126
|
* @param errorMessage - the error message to display
|
|
127
127
|
*/
|
|
128
128
|
setError(valid: MgInputRadio['valid'], errorMessage: string): Promise<void>;
|
|
129
|
+
/**
|
|
130
|
+
* Reset value, validity and error state
|
|
131
|
+
*/
|
|
132
|
+
reset(): Promise<void>;
|
|
129
133
|
/**
|
|
130
134
|
* Method to set validity values
|
|
131
135
|
* @param newValue - valid new value
|
|
@@ -142,6 +142,10 @@ export declare class MgInputSelect {
|
|
|
142
142
|
* @param errorMessage - the error message to display
|
|
143
143
|
*/
|
|
144
144
|
setError(valid: MgInputSelect['valid'], errorMessage: string): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Reset value, validity and error state
|
|
147
|
+
*/
|
|
148
|
+
reset(): Promise<void>;
|
|
145
149
|
/**
|
|
146
150
|
* Method to set validity values
|
|
147
151
|
* @param newValue - valid new value
|
|
@@ -165,6 +165,10 @@ export declare class MgInputText {
|
|
|
165
165
|
* @param errorMessage - the error message to display
|
|
166
166
|
*/
|
|
167
167
|
setError(valid: MgInputText['valid'], errorMessage: string): Promise<void>;
|
|
168
|
+
/**
|
|
169
|
+
* Reset value, validity and error state
|
|
170
|
+
*/
|
|
171
|
+
reset(): Promise<void>;
|
|
168
172
|
/**
|
|
169
173
|
* Method to set validity values
|
|
170
174
|
* @param newValue - valid new value
|
|
@@ -146,6 +146,10 @@ export declare class MgInputTextarea {
|
|
|
146
146
|
* @param errorMessage - the error message to display
|
|
147
147
|
*/
|
|
148
148
|
setError(valid: MgInputTextarea['valid'], errorMessage: string): Promise<void>;
|
|
149
|
+
/**
|
|
150
|
+
* Reset value, validity and error state
|
|
151
|
+
*/
|
|
152
|
+
reset(): Promise<void>;
|
|
149
153
|
/**
|
|
150
154
|
* Method to set validity values
|
|
151
155
|
* @param newValue - valid new value
|
|
@@ -126,6 +126,10 @@ export declare class MgInputToggle {
|
|
|
126
126
|
* @param errorMessage - errorMessage override
|
|
127
127
|
*/
|
|
128
128
|
private setErrorMessage;
|
|
129
|
+
/**
|
|
130
|
+
* Reset value, validity, error and visual state
|
|
131
|
+
*/
|
|
132
|
+
reset(): Promise<void>;
|
|
129
133
|
/**
|
|
130
134
|
* Change checked value
|
|
131
135
|
*/
|
|
@@ -30,6 +30,7 @@ export declare class MgMenuItem {
|
|
|
30
30
|
* Identifier is used to control mg-popover
|
|
31
31
|
*/
|
|
32
32
|
identifier: string;
|
|
33
|
+
watchIdentifier(newValue: MgMenuItem['identifier']): void;
|
|
33
34
|
/**
|
|
34
35
|
* Define menu-item href
|
|
35
36
|
* when defined menu-item contain an anchor instead of button
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AriaRole } from '../../../types';
|
|
1
2
|
/**
|
|
2
3
|
* List of all possibles roles
|
|
3
4
|
*/
|
|
@@ -5,7 +6,7 @@ export declare const roles: readonly ["form", "search", "none", "presentation"];
|
|
|
5
6
|
/**
|
|
6
7
|
* Aria Role type from roles
|
|
7
8
|
*/
|
|
8
|
-
export type AriaRoleType = (typeof roles)[number];
|
|
9
|
+
export type AriaRoleType = AriaRole & (typeof roles)[number];
|
|
9
10
|
/**
|
|
10
11
|
* List of all possibles required message status
|
|
11
12
|
*/
|
|
@@ -26,6 +26,7 @@ export declare class MgForm {
|
|
|
26
26
|
* If not set, it will be created.
|
|
27
27
|
*/
|
|
28
28
|
identifier: string;
|
|
29
|
+
watchIdentifier(newValue: MgForm['identifier']): void;
|
|
29
30
|
/**
|
|
30
31
|
* Input name
|
|
31
32
|
* If not set the value equals the identifier
|
|
@@ -90,6 +91,10 @@ export declare class MgForm {
|
|
|
90
91
|
* Display input error if it exists.
|
|
91
92
|
*/
|
|
92
93
|
displayError(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Reset form inputs values, validity and error state
|
|
96
|
+
*/
|
|
97
|
+
reset(): Promise<void>;
|
|
93
98
|
/**
|
|
94
99
|
* Define required message based on mg-inputs required elements
|
|
95
100
|
*/
|
|
@@ -16,6 +16,7 @@ export declare class MgPagination {
|
|
|
16
16
|
* If not set, it will be created.
|
|
17
17
|
*/
|
|
18
18
|
identifier: string;
|
|
19
|
+
watchIdentifier(newValue: MgPagination['identifier']): void;
|
|
19
20
|
/**
|
|
20
21
|
* Panignation label. Is a short description.
|
|
21
22
|
* Customize default value can be usefull to improve accessibility
|