@mgdis/mg-components 6.17.0 → 6.18.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-DCZEYvlH.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/mg-action-more_37.cjs.entry.js +411 -168
- package/dist/cjs/mg-alert.cjs.entry.js +1 -1
- package/dist/cjs/mg-components.cjs.js +1 -1
- package/dist/cjs/mg-fieldset.cjs.entry.js +141 -0
- package/dist/cjs/mg-input-combobox.cjs.entry.js +71 -55
- package/dist/cjs/mg-input-rich-text-editor.cjs.entry.js +33 -20
- package/dist/cjs/{mg-input.conf-WTsvDfpC.js → mg-input.conf-HYIzRsy7.js} +5 -0
- package/dist/cjs/mg-loader.cjs.entry.js +1 -1
- package/dist/cjs/mg-progress.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.conf.js +4 -0
- package/dist/collection/components/molecules/inputs/mg-input/mg-input.js +178 -18
- 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.js +36 -16
- package/dist/collection/components/molecules/inputs/mg-input-combobox/mg-input-combobox.js +78 -55
- package/dist/collection/components/molecules/inputs/mg-input-date/mg-input-date.js +41 -22
- package/dist/collection/components/molecules/inputs/mg-input-numeric/mg-input-numeric.js +32 -12
- package/dist/collection/components/molecules/inputs/mg-input-password/mg-input-password.js +30 -12
- package/dist/collection/components/molecules/inputs/mg-input-radio/mg-input-radio.js +31 -12
- package/dist/collection/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.js +40 -20
- package/dist/collection/components/molecules/inputs/mg-input-select/mg-input-select.js +31 -12
- package/dist/collection/components/molecules/inputs/mg-input-text/mg-input-text.js +44 -25
- package/dist/collection/components/molecules/inputs/mg-input-textarea/mg-input-textarea.js +31 -13
- package/dist/collection/components/molecules/inputs/mg-input-toggle/mg-input-toggle.js +36 -11
- package/dist/collection/components/molecules/menus/mg-menu/mg-menu.js +5 -1
- package/dist/collection/components/molecules/mg-action-more/mg-action-more.js +1 -1
- package/dist/collection/components/molecules/mg-alert/mg-alert.js +1 -1
- package/dist/collection/components/molecules/mg-details/mg-details.js +1 -1
- package/dist/collection/components/molecules/mg-fieldset/mg-fieldset.js +404 -0
- package/dist/collection/components/molecules/mg-form/mg-form.js +13 -4
- package/dist/collection/components/molecules/mg-illustrated-message/mg-illustrated-message.js +1 -1
- package/dist/collection/components/molecules/mg-loader/mg-loader.js +1 -1
- package/dist/collection/components/molecules/mg-message/mg-message.js +2 -2
- package/dist/collection/components/molecules/mg-modal/mg-modal.js +2 -2
- package/dist/collection/components/molecules/mg-panel/mg-panel.js +40 -9
- package/dist/collection/components/molecules/mg-popover/mg-popover-content/mg-popover-content.js +1 -1
- package/dist/collection/components/molecules/mg-popover/mg-popover.js +1 -1
- package/dist/collection/components/molecules/mg-progress/mg-progress.js +1 -1
- package/dist/collection/components/molecules/mg-skip-links/mg-skip-links.js +1 -1
- package/dist/collection/components/molecules/mg-tabs/mg-tabs.js +1 -1
- package/dist/components/mg-action-more.js +1 -1
- package/dist/components/mg-alert.js +1 -1
- package/dist/components/mg-details.js +1 -1
- package/dist/components/mg-fieldset.d.ts +11 -0
- package/dist/components/mg-fieldset.js +209 -0
- package/dist/components/mg-form.js +4 -3
- package/dist/components/mg-illustrated-message.js +1 -1
- package/dist/components/mg-input-checkbox-paginated2.js +1 -1
- package/dist/components/mg-input-checkbox.js +28 -15
- package/dist/components/mg-input-combobox.js +71 -55
- package/dist/components/mg-input-date.js +33 -21
- package/dist/components/mg-input-numeric.js +24 -11
- package/dist/components/mg-input-password.js +22 -11
- package/dist/components/mg-input-radio.js +23 -11
- package/dist/components/mg-input-rich-text-editor.js +32 -19
- package/dist/components/mg-input-select2.js +24 -12
- package/dist/components/mg-input-text2.js +36 -24
- package/dist/components/mg-input-textarea.js +23 -12
- package/dist/components/mg-input-toggle.js +35 -10
- package/dist/components/mg-input2.js +117 -18
- package/dist/components/mg-item-more2.js +5 -1
- package/dist/components/mg-loader2.js +1 -1
- package/dist/components/mg-message2.js +2 -2
- package/dist/components/mg-modal.js +2 -2
- package/dist/components/mg-panel.js +36 -7
- package/dist/components/mg-popover-content2.js +1 -1
- package/dist/components/mg-popover2.js +1 -1
- package/dist/components/mg-progress.js +1 -1
- package/dist/components/mg-skip-links.js +1 -1
- package/dist/components/mg-tabs2.js +1 -1
- package/dist/esm/{index-WtiuOkLj.js → index-C7xjtdiw.js} +1 -1
- package/dist/esm/index-T6kOJXP1.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/mg-action-more_37.entry.js +412 -169
- package/dist/esm/mg-alert.entry.js +2 -2
- package/dist/esm/mg-components.js +1 -1
- package/dist/esm/mg-fieldset.entry.js +139 -0
- package/dist/esm/mg-input-combobox.entry.js +72 -56
- package/dist/esm/mg-input-rich-text-editor.entry.js +34 -21
- package/dist/esm/{mg-input.conf-CNgv8hc5.js → mg-input.conf-D9V2v4n2.js} +5 -1
- package/dist/esm/mg-loader.entry.js +2 -2
- package/dist/esm/mg-progress.entry.js +2 -2
- package/dist/mg-components/mg-components.esm.js +1 -1
- package/dist/mg-components/p-2bab89c2.entry.js +1 -0
- package/dist/mg-components/{p-0e6b40d6.entry.js → p-5abc77cd.entry.js} +1 -1
- package/dist/mg-components/p-7d2e43b2.entry.js +1 -0
- package/dist/mg-components/{p-5dc3a1fb.entry.js → p-92e5e5a6.entry.js} +1 -1
- package/dist/mg-components/{p-c5da335e.entry.js → p-952288bd.entry.js} +1 -1
- package/dist/mg-components/{p-WtiuOkLj.js → p-C7xjtdiw.js} +1 -1
- package/dist/mg-components/p-D9V2v4n2.js +1 -0
- package/dist/mg-components/p-f2cddd52.entry.js +1 -0
- package/dist/mg-components/{p-397bf67b.entry.js → p-f6afaeb8.entry.js} +1 -1
- package/dist/types/components/molecules/inputs/mg-input/mg-input.conf.d.ts +5 -0
- package/dist/types/components/molecules/inputs/mg-input/mg-input.d.ts +32 -1
- package/dist/types/components/molecules/inputs/mg-input-checkbox/mg-input-checkbox.d.ts +4 -3
- package/dist/types/components/molecules/inputs/mg-input-combobox/mg-input-combobox.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-date/mg-input-date.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-numeric/mg-input-numeric.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-password/mg-input-password.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-radio/mg-input-radio.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-rich-text-editor/mg-input-rich-text-editor.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-select/mg-input-select.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-text/mg-input-text.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-textarea/mg-input-textarea.d.ts +4 -2
- package/dist/types/components/molecules/inputs/mg-input-toggle/mg-input-toggle.d.ts +4 -2
- package/dist/types/components/molecules/mg-fieldset/mg-fieldset.d.ts +105 -0
- package/dist/types/components/molecules/mg-form/mg-form.d.ts +1 -1
- package/dist/types/components/molecules/mg-panel/mg-panel.d.ts +8 -1
- package/dist/types/components.d.ts +168 -18
- package/ide/intellij/web-types.json +272 -9
- package/ide/vscode/html-custom-data.json +243 -5
- package/package.json +15 -15
- package/dist/mg-components/p-8a69175b.entry.js +0 -1
- package/dist/mg-components/p-CNgv8hc5.js +0 -1
- package/dist/mg-components/p-d84d87ea.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,f as i,h as e,a}from"./p-T6kOJXP1.js";import{C as h,t as o}from"./p-
|
|
1
|
+
import{r as t,c as s,f as i,h as e,a}from"./p-T6kOJXP1.js";import{C as h,t as o}from"./p-C7xjtdiw.js";import{i as r}from"./p-CNX6lq0x.js";const n=["info","warning","success","danger"],c=["bar-left","background"],l=class{constructor(i){t(this,i),this.componentShow=s(this,"component-show",3),this.componentHide=s(this,"component-hide",3),this.componentClose=s(this,"component-close",3),this.classCloseButton="mg-c-alert--close-button",this.storedTimer=null,this.isFocused=!1,this.isHovered=!1,this.variant="info",this.variantStyle="bar-left",this.classCollection=new h(["mg-c-alert"]),this.hasActions=!1,this.setTimer=()=>{this.storedTimer=setTimeout((()=>this.element.hidden=!0),1e3*this.delay)},this.clearTimer=()=>{clearTimeout(this.storedTimer)},this.timerEvents=t=>{this.clearTimer();const s="mouseenter"===t.type;this[s?"isHovered":"isFocused"]=!0,this.element.addEventListener(s?"mouseleave":"focusout",(t=>{this["mouseleave"===t.type?"isHovered":"isFocused"]=!1,this.isFocused||this.isHovered||this.setTimer()}),{once:!0})},this.handleClose=()=>{this.element.hidden=!0,this.componentClose.emit()}}watchDelay(t){if(void 0!==t&&t<2)throw new Error(`<mg-alert> prop "delay" must be greater than 2 seconds. Passed value: ${o(t)}.`)}watchVariant(t){if(t&&!n.includes(t))throw new Error(`<mg-alert> prop "variant" must be one of: ${n.join(", ")}. Passed value: ${o(t)}.`)}watchVariantStyle(t){if(t&&!c.includes(t))throw new Error(`<mg-alert> prop "variantStyle" must be one of: ${c.join(", ")}. Passed value: ${o(t)}.`)}watchHidden(t){"string"==typeof t&&""===t&&(t=!0),t?(this.componentHide.emit(),["focusin","mouseenter"].forEach((t=>{this.element.removeEventListener(t,this.timerEvents)})),this.clearTimer()):(this.componentShow.emit(),this.delay>1&&(this.setTimer(),["focusin","mouseenter"].forEach((t=>{this.element.addEventListener(t,this.timerEvents)})))),i(this)}componentWillLoad(){this.messages=r(this.element).messages,this.watchVariant(this.variant),this.watchVariantStyle(this.variantStyle),this.watchDelay(this.delay),this.watchHidden(this.element.hidden),this.hasActions=null!==this.element.querySelector('[slot="actions"]'),this.hasActions||this.classCollection.add(this.classCloseButton)}render(){return e("mg-message",{key:"4b974a10812e527a2c481ec00f22324ab490a135",class:this.classCollection.join(),role:["info","success"].includes(this.variant)?"status":"alert",variant:this.variant,variantStyle:this.variantStyle},e("slot",{key:"9133a3cca56d67e75e8c3f018c52838c31e908f2"}),this.hasActions?e("span",{slot:"actions"},e("slot",{name:"actions"})):e("span",{class:"mg-c-alert__close-button"},e("mg-button",{"is-icon":!0,variant:"flat",label:this.messages.alert.closeButton,onClick:this.handleClose},e("mg-icon",{icon:"cross"}))))}get element(){return a(this)}static get watchers(){return{delay:["watchDelay"],variant:["watchVariant"],variantStyle:["watchVariantStyle"],hidden:["watchHidden"]}}};l.style=".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}";export{l as mg_alert}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
class t{classes;constructor(t=[]){this.classes=t}add=t=>{this.has(t)||this.classes.push(t)};delete=t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)};has=t=>this.classes.includes(t);join=()=>this.classes.join(" ")}const s=t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,e=(t,r,i)=>{if(!s(t)||"string"!=typeof r)return i;const[n,...o]=r.split(".");return o.length?e(t[n],o.join("."),i):t[n]??i},r=t=>Array.isArray(t)&&t.every((t=>"string"==typeof t)),i=t=>"string"==typeof t&&""!==t.trim(),n=t=>"object"==typeof t?JSON.stringify(t):String(t),o=t=>"string"==typeof t?t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):t,a=(t="",s=10)=>{const e=new Uint8Array(s);crypto.getRandomValues(e);const r=Array.from(e).map((t=>t.toString(16).padStart(2,"0"))).join("").slice(0,s);return""!==t?`${t}-${r}`:r},h=t=>i(t)&&null!==/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(t),f=t=>{let e;return"string"==typeof t?e=t:Boolean(t)&&"object"==typeof t&&(s(t)||Array.isArray(t))?e=JSON.stringify(t):null!=t&&"boolean"!=typeof t&&"object"!=typeof t&&(e=String(t)),e?e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((t,s)=>(s>0?"-":"")+t.toLowerCase())).replace(/[^a-z0-9-]+/g,"-").replace(/--+/g,"-").replace(/(?:^-)|(?:-$)/g,""):e},u=async t=>{if(t)return t()},c={FIRST:"first",NEXT:"next",PREVIOUS:"previous",LAST:"last"};class y{items=[];total;top=10;next;baseIndex=1;constructor(t){if(!s(t))throw new Error("Page - init must match IPage type.");Array.isArray(t.items)&&(this.items=t.items),"number"==typeof t.top&&(this.top=t.top),this.total="number"==typeof t.total?t.total:this.items.length,this.next=t.next}getIndexFromCursor=(t="first",s)=>{if(!Array.isArray(this.items)||!this.items.length)return null;const e=this.items.length-this.baseIndex;let r,i=0;if(["previous","next"].includes(t)&&s){const t=this.items.findIndex((t=>JSON.stringify(t)===JSON.stringify(s)));if(-1===t)return 0;i=t}return r="first"===t?0:"last"===t?e:"previous"===t?JSON.stringify(this.items[i])===JSON.stringify(this.items[0])?e:i-this.baseIndex:"next"===t?JSON.stringify(this.items[i])===JSON.stringify(this.items[e])?0:i+this.baseIndex:0,r}}class p{items=[];#t=10;#s;#e;constructor(t,e){Array.isArray(t)&&(this.items=t),e&&(["string","function"].includes(typeof e.next)||s(e.next)&&URL.canParse(e.next))&&(this.#s=e.next),"number"==typeof e?.top&&(this.#t=e.top),"number"==typeof e?.total&&(this.#e=e.total)}getPage=(t=0,s)=>{const e="function"==typeof s?this.items.filter(s):this.items;let r;return this.#s?r=this.#s:e.length>t+this.#t&&(r=()=>this.getPage(t+this.#t,s)),new y({items:e.slice(t,t+this.#t),total:this.#e,top:this.#t,next:r})}}const l=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,g=t=>t.toISOString().split("T")[0],b=(t,s)=>s.includes(t?.tagName.toLowerCase()),m='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',S=t=>"number"==typeof t&&!Number.isNaN(t),d=t=>[t,...x(t),...A(t)],x=(t,s=[])=>{if(t.self!==t.top)try{const e=t.parent;return e?(s.push(e),x(e,s)):s}catch(t){return console.error("Different hosts between iframes:",t),s}return s},A=(t,s=[])=>{if(t.frames.length>0)for(const e of Array.from(t.frames))s.push(e),A(e,s);return s};export{t as C,p as P,c as a,r as b,
|
|
1
|
+
class t{classes;constructor(t=[]){this.classes=t}add=t=>{this.has(t)||this.classes.push(t)};delete=t=>{const s=this.classes.indexOf(t);s>-1&&this.classes.splice(s,1)};has=t=>this.classes.includes(t);join=()=>this.classes.join(" ")}const s=t=>"object"==typeof t&&!Array.isArray(t)&&null!==t,e=(t,r,i)=>{if(!s(t)||"string"!=typeof r)return i;const[n,...o]=r.split(".");return o.length?e(t[n],o.join("."),i):t[n]??i},r=t=>Array.isArray(t)&&t.every((t=>"string"==typeof t)),i=t=>"string"==typeof t&&""!==t.trim(),n=t=>"object"==typeof t?JSON.stringify(t):String(t),o=t=>"string"==typeof t?t.toLocaleLowerCase().normalize("NFD").replaceAll(/[\u0300-\u036f]/g,""):t,a=(t="",s=10)=>{const e=new Uint8Array(s);crypto.getRandomValues(e);const r=Array.from(e).map((t=>t.toString(16).padStart(2,"0"))).join("").slice(0,s);return""!==t?`${t}-${r}`:r},h=t=>i(t)&&null!==/^([a-z][a-z0-9]*)(-[a-z0-9]+)*$/.exec(t),f=t=>{let e;return"string"==typeof t?e=t:Boolean(t)&&"object"==typeof t&&(s(t)||Array.isArray(t))?e=JSON.stringify(t):null!=t&&"boolean"!=typeof t&&"object"!=typeof t&&(e=String(t)),e?e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,((t,s)=>(s>0?"-":"")+t.toLowerCase())).replace(/[^a-z0-9-]+/g,"-").replace(/--+/g,"-").replace(/(?:^-)|(?:-$)/g,""):e},u=async t=>{if(t)return t()},c={FIRST:"first",NEXT:"next",PREVIOUS:"previous",LAST:"last"};class y{items=[];total;top=10;next;baseIndex=1;constructor(t){if(!s(t))throw new Error("Page - init must match IPage type.");Array.isArray(t.items)&&(this.items=t.items),"number"==typeof t.top&&(this.top=t.top),this.total="number"==typeof t.total?t.total:this.items.length,this.next=t.next}getIndexFromCursor=(t="first",s)=>{if(!Array.isArray(this.items)||!this.items.length)return null;const e=this.items.length-this.baseIndex;let r,i=0;if(["previous","next"].includes(t)&&s){const t=this.items.findIndex((t=>JSON.stringify(t)===JSON.stringify(s)));if(-1===t)return 0;i=t}return r="first"===t?0:"last"===t?e:"previous"===t?JSON.stringify(this.items[i])===JSON.stringify(this.items[0])?e:i-this.baseIndex:"next"===t?JSON.stringify(this.items[i])===JSON.stringify(this.items[e])?0:i+this.baseIndex:0,r}}class p{items=[];#t=10;#s;#e;constructor(t,e){Array.isArray(t)&&(this.items=t),e&&(["string","function"].includes(typeof e.next)||s(e.next)&&URL.canParse(e.next))&&(this.#s=e.next),"number"==typeof e?.top&&(this.#t=e.top),"number"==typeof e?.total&&(this.#e=e.total)}getPage=(t=0,s)=>{const e="function"==typeof s?this.items.filter(s):this.items;let r;return this.#s?r=this.#s:e.length>t+this.#t&&(r=()=>this.getPage(t+this.#t,s)),new y({items:e.slice(t,t+this.#t),total:this.#e,top:this.#t,next:r})}}const l=/^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$/,g=t=>t.toISOString().split("T")[0],b=(t,s)=>s.includes(t?.tagName.toLowerCase()),m='a[href], button, input, textarea, select, details, [tabindex]:not([tabindex="-1"]), [identifier], mg-button',S=t=>"number"==typeof t&&!Number.isNaN(t),d=t=>[t,...x(t),...A(t)],x=(t,s=[])=>{if(t.self!==t.top)try{const e=t.parent;return e?(s.push(e),x(e,s)):s}catch(t){return console.error("Different hosts between iframes:",t),s}return s},A=(t,s=[])=>{if(t.frames.length>0)for(const e of Array.from(t.frames))s.push(e),A(e,s);return s};export{t as C,p as P,c as a,r as b,s as c,y as d,S as e,f,e as g,a as h,i,h as j,b as k,o as l,l as m,u as n,g as o,d as p,m as q,n as t}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=[2,4,16,"full"],s=["input","label"],t=["h1","h2","h3","h4","h5","h6"],l="mg-c-input--fieldset",i="mg-c-input--disabled",c="mg-c-input--readonly",e="mg-c-input--vertical-list";export{i as a,l as b,c,e as d,t as l,s as t,a as w}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as i,a as s}from"./p-T6kOJXP1.js";import{C as e,i as h}from"./p-C7xjtdiw.js";import{c as a}from"./p-D9V2v4n2.js";const r=class{constructor(i){t(this,i),this.name=this.identifier,this.legendHide=!1,this.legendBorderDisplay=!1,this.readonly=!1,this.disabled=!1,this.classCollection=new e(["mg-c-input--fieldset"]),this.checkValidity=()=>{var t;this.valid=!(this.mgInputs.some((t=>t.invalid))||(null===(t=this.errorMessage)||void 0===t?void 0:t.length)>0)},this.setMgInputs=()=>{this.mgInputs=Array.from(this.element.querySelectorAll("*")).filter((t=>t.nodeName.startsWith("MG-INPUT"))),this.mgInputs.forEach((t=>{this.readonly?t.readonly=!0:this.disabled?t.disabled=!0:t.addEventListener("input-valid",this.checkValidity)}))}}watchLegendBorderDisplay(t){if(t&&!h(this.legendHeading))throw new Error('<mg-fieldset> prop "legendBorderDisplay" must not be paired with the prop "legendHeading".')}watchReadonly(t){t?this.classCollection.add(a):this.classCollection.delete(a)}handleAttributeChange(){this.setMgInputs()}async setCustomValidity(t){this.errorMessage=h(t)?t:void 0,this.checkValidity()}async displayError(){this.readonly||this.mgInputs.forEach((t=>{t.displayError()}))}componentWillLoad(){this.watchReadonly(this.readonly),this.watchLegendBorderDisplay(this.legendBorderDisplay),this.setMgInputs()}componentDidLoad(){const t={childList:!0,subtree:!0};new MutationObserver((i=>{i.some((i=>Object.keys(t).includes(i.type)))&&this.setMgInputs()})).observe(this.element,t)}render(){return i("mg-input",{key:"b8b7c203bb2ed22cc9344389af5a6ae8d85af6d5",label:this.legend,identifier:this.identifier,class:this.classCollection.join(),labelOnTop:!this.legendHide,labelHeading:this.legendHeading,labelBorderDisplay:this.legendHeading&&this.legendBorderDisplay,labelHide:this.legendHide,inputsOnBottom:void 0!==this.legendHeading,tooltip:this.tooltip,tooltipPosition:"label",helpText:this.helpText,errorMessage:!this.valid&&h(this.errorMessage)?this.errorMessage:void 0},i("span",{key:"c0e7480b14b0a8e136dd951bdce7275b65b59b48",class:"mg-c-input__input-group"},i("slot",{key:"021e7b126cef9437e64622d8ef59219b09c06e9f"})))}get element(){return s(this)}static get watchers(){return{legendBorderDisplay:["watchLegendBorderDisplay"],readonly:["watchReadonly","handleAttributeChange"],disabled:["handleAttributeChange"]}}};export{r as mg_fieldset}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,a}from"./p-T6kOJXP1.js";import{i}from"./p-CNX6lq0x.js";import{
|
|
1
|
+
import{r as t,h as e,a}from"./p-T6kOJXP1.js";import{i}from"./p-CNX6lq0x.js";import{i as r,t as s}from"./p-C7xjtdiw.js";const o=class{constructor(e){t(this,e),this.messageHide=!1}watchMessage(t){if(t&&!r(t))throw new Error(`<mg-loader> prop "message" must be a valid string. Passed value: ${s(t)}.`)}componentWillLoad(){this.messages=i(this.element).messages,this.watchMessage(this.message)}render(){return e("div",{key:"739b4cbacd8a8da056dbb1445c40fac2cf26766a",class:"mg-c-loader","aria-live":"polite"},e("mg-icon",{key:"95d3cbf26fcd6dbf0dad4853bf55aa66385f1aba",icon:"loader",spin:!0}),e("span",{key:"f6322cd3054d8976bd2ec24f86a2d6bb60ca7ae1",class:{"mg-u-visually-hidden":this.messageHide}},this.message||this.messages.loader.inProgress))}get element(){return a(this)}static get watchers(){return{message:["watchMessage"]}}};o.style=".mg-u-visually-hidden{position:absolute !important;overflow:hidden !important;width:.1rem !important;height:.1rem !important;padding:0 !important;border:0 !important;margin:-0.1rem !important;clip:rect(0.1rem, 0.1rem, 0.1rem, 0.1rem) !important;clip-path:inset(50%) !important;white-space:nowrap !important}*:focus:not(:focus-visible){outline:none}@media (prefers-reduced-motion){*{animation:none !important;transition:none !important}}:host{display:block}.mg-c-loader{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:var(--mg-b-size-4);text-align:center}";export{o as mg_loader}
|
|
@@ -8,6 +8,11 @@ export type Width = (typeof widths)[number];
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const tooltipPositions: readonly ["input", "label"];
|
|
10
10
|
export type TooltipPosition = (typeof tooltipPositions)[number];
|
|
11
|
+
/**
|
|
12
|
+
* Possible label headings
|
|
13
|
+
*/
|
|
14
|
+
export declare const labelHeadings: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
15
|
+
export type labelHeading = (typeof labelHeadings)[number];
|
|
11
16
|
/**
|
|
12
17
|
* Base interface for common methods
|
|
13
18
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type TooltipPosition } from './mg-input.conf';
|
|
1
|
+
import { type TooltipPosition, labelHeading } from './mg-input.conf';
|
|
2
2
|
/**
|
|
3
3
|
* @slot - Input content
|
|
4
4
|
*/
|
|
@@ -16,6 +16,9 @@ export declare class MgInput {
|
|
|
16
16
|
private readonly classInput;
|
|
17
17
|
private readonly classHasError;
|
|
18
18
|
private readonly classLabelOnTop;
|
|
19
|
+
private readonly classHasHeading;
|
|
20
|
+
private readonly classLabelBorderDisplay;
|
|
21
|
+
private readonly classInputsOnBottom;
|
|
19
22
|
/**************
|
|
20
23
|
* Decorators *
|
|
21
24
|
**************/
|
|
@@ -42,6 +45,18 @@ export declare class MgInput {
|
|
|
42
45
|
*/
|
|
43
46
|
labelHide: boolean;
|
|
44
47
|
watchLabelConfig(): void;
|
|
48
|
+
/**
|
|
49
|
+
* Define label heading, use to define label with associated semantic
|
|
50
|
+
* You must pair this mode with `labelOnTop`and `fieldset` class
|
|
51
|
+
*/
|
|
52
|
+
labelHeading?: labelHeading;
|
|
53
|
+
watchlabelHeading(newValue: MgInput['labelHeading']): void;
|
|
54
|
+
/**
|
|
55
|
+
* Define if label border is visible
|
|
56
|
+
* You must pair this mode with `labelOnTop`and `fieldset` class
|
|
57
|
+
*/
|
|
58
|
+
labelBorderDisplay: boolean;
|
|
59
|
+
watchLabelBorderDisplay(newValue: MgInput['labelBorderDisplay']): void;
|
|
45
60
|
/**
|
|
46
61
|
* Add a tooltip message next to the input
|
|
47
62
|
*/
|
|
@@ -65,6 +80,11 @@ export declare class MgInput {
|
|
|
65
80
|
*/
|
|
66
81
|
helpText?: string;
|
|
67
82
|
watchHelpText(newValue: MgInput['helpText']): void;
|
|
83
|
+
/**
|
|
84
|
+
* Display inputs after help-text and error message
|
|
85
|
+
*/
|
|
86
|
+
inputsOnBottom?: boolean;
|
|
87
|
+
watchInputsOnBottom(newValue: MgInput['inputsOnBottom']): void;
|
|
68
88
|
/**
|
|
69
89
|
* Define aria-describedby ids to link with
|
|
70
90
|
*/
|
|
@@ -97,6 +117,12 @@ export declare class MgInput {
|
|
|
97
117
|
/************
|
|
98
118
|
* Methods *
|
|
99
119
|
************/
|
|
120
|
+
/**
|
|
121
|
+
* Update element aria-describedby
|
|
122
|
+
* @param element - element to update
|
|
123
|
+
* @param ariaDescribedbyIDs - ariaDescribedbyIDs references
|
|
124
|
+
*/
|
|
125
|
+
private updateElementAriaDescribedby;
|
|
100
126
|
/**
|
|
101
127
|
* Render input label
|
|
102
128
|
*/
|
|
@@ -125,6 +151,11 @@ export declare class MgInput {
|
|
|
125
151
|
* @returns mg-tooltip
|
|
126
152
|
*/
|
|
127
153
|
private renderTooltip;
|
|
154
|
+
/**
|
|
155
|
+
* Get input container element
|
|
156
|
+
* @returns ordered elements
|
|
157
|
+
*/
|
|
158
|
+
private inputContainerElements;
|
|
128
159
|
/**
|
|
129
160
|
* Render
|
|
130
161
|
* @returns HTML Element
|
|
@@ -10,6 +10,7 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
10
10
|
private searchInput;
|
|
11
11
|
private messages;
|
|
12
12
|
private hasDisplayedError;
|
|
13
|
+
private customErrorMessage;
|
|
13
14
|
private mode;
|
|
14
15
|
private readonly baseClassName;
|
|
15
16
|
private readonly classTypeMulti;
|
|
@@ -179,8 +180,9 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
179
180
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
180
181
|
* @param valid - value indicating the validity
|
|
181
182
|
* @param errorMessage - the error message to display
|
|
183
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
182
184
|
*/
|
|
183
|
-
setError(valid: MgInputCheckbox['valid'], errorMessage
|
|
185
|
+
setError(valid: MgInputCheckbox['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
184
186
|
/**
|
|
185
187
|
* Reset value, validity and error state
|
|
186
188
|
*/
|
|
@@ -259,8 +261,7 @@ export declare class MgInputCheckbox implements Omit<MgInputCheckboxListProps, '
|
|
|
259
261
|
private getSelectValuesButtonMessage;
|
|
260
262
|
/**
|
|
261
263
|
* Set input error message
|
|
262
|
-
* @param
|
|
263
|
-
* @param errorMessage - errorMessage override
|
|
264
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
264
265
|
*/
|
|
265
266
|
private setErrorMessage;
|
|
266
267
|
/**
|
|
@@ -13,6 +13,7 @@ export declare class MgInputCombobox {
|
|
|
13
13
|
private popoverId;
|
|
14
14
|
private messages;
|
|
15
15
|
private hasDisplayedError;
|
|
16
|
+
private customErrorMessage;
|
|
16
17
|
private handlerInProgress;
|
|
17
18
|
private loadingAction;
|
|
18
19
|
private debounce;
|
|
@@ -226,8 +227,9 @@ export declare class MgInputCombobox {
|
|
|
226
227
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
227
228
|
* @param valid - value indicating the validity
|
|
228
229
|
* @param errorMessage - the error message to display
|
|
230
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
229
231
|
*/
|
|
230
|
-
setError(valid: MgInputCombobox['valid'], errorMessage
|
|
232
|
+
setError(valid: MgInputCombobox['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
231
233
|
/**
|
|
232
234
|
* Reset value, validity and error state
|
|
233
235
|
*/
|
|
@@ -299,7 +301,7 @@ export declare class MgInputCombobox {
|
|
|
299
301
|
private checkValidity;
|
|
300
302
|
/**
|
|
301
303
|
* Set input error message
|
|
302
|
-
* @param
|
|
304
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
303
305
|
*/
|
|
304
306
|
private setErrorMessage;
|
|
305
307
|
/**
|
|
@@ -11,6 +11,7 @@ export declare class MgInputDate {
|
|
|
11
11
|
private systemLocale;
|
|
12
12
|
private hasDisplayedError;
|
|
13
13
|
private handlerInProgress;
|
|
14
|
+
private customErrorMessage;
|
|
14
15
|
/**************
|
|
15
16
|
* Decorators *
|
|
16
17
|
**************/
|
|
@@ -126,8 +127,9 @@ export declare class MgInputDate {
|
|
|
126
127
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
127
128
|
* @param valid - value indicating the validity
|
|
128
129
|
* @param errorMessage - the error message to display
|
|
130
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
129
131
|
*/
|
|
130
|
-
setError(valid: MgInputDate['valid'], errorMessage
|
|
132
|
+
setError(valid: MgInputDate['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
131
133
|
/**
|
|
132
134
|
* Reset value, validity and error state
|
|
133
135
|
*/
|
|
@@ -173,7 +175,7 @@ export declare class MgInputDate {
|
|
|
173
175
|
private getInputError;
|
|
174
176
|
/**
|
|
175
177
|
* Check input errors
|
|
176
|
-
* @param
|
|
178
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
177
179
|
*/
|
|
178
180
|
private setErrorMessage;
|
|
179
181
|
/*************
|
|
@@ -18,6 +18,7 @@ export declare class MgInputNumeric {
|
|
|
18
18
|
private messages;
|
|
19
19
|
private hasDisplayedError;
|
|
20
20
|
private handlerInProgress;
|
|
21
|
+
private customErrorMessage;
|
|
21
22
|
/**************
|
|
22
23
|
* Decorators *
|
|
23
24
|
**************/
|
|
@@ -174,8 +175,9 @@ export declare class MgInputNumeric {
|
|
|
174
175
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
175
176
|
* @param valid - value indicating the validity
|
|
176
177
|
* @param errorMessage - the error message to display
|
|
178
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
177
179
|
*/
|
|
178
|
-
setError(valid: MgInputNumeric['valid'], errorMessage
|
|
180
|
+
setError(valid: MgInputNumeric['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
179
181
|
/**
|
|
180
182
|
* Reset value, validity and error state
|
|
181
183
|
*/
|
|
@@ -229,7 +231,7 @@ export declare class MgInputNumeric {
|
|
|
229
231
|
private formatErrorValue;
|
|
230
232
|
/**
|
|
231
233
|
* Set input error message
|
|
232
|
-
* @param
|
|
234
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
233
235
|
*/
|
|
234
236
|
private setErrorMessage;
|
|
235
237
|
/**
|
|
@@ -9,6 +9,7 @@ export declare class MgInputPassword {
|
|
|
9
9
|
private messages;
|
|
10
10
|
private hasDisplayedError;
|
|
11
11
|
private handlerInProgress;
|
|
12
|
+
private customErrorMessage;
|
|
12
13
|
/**************
|
|
13
14
|
* Decorators *
|
|
14
15
|
**************/
|
|
@@ -126,8 +127,9 @@ export declare class MgInputPassword {
|
|
|
126
127
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
127
128
|
* @param valid - value indicating the validity
|
|
128
129
|
* @param errorMessage - the error message to display
|
|
130
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
129
131
|
*/
|
|
130
|
-
setError(valid: MgInputPassword['valid'], errorMessage
|
|
132
|
+
setError(valid: MgInputPassword['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
131
133
|
/**
|
|
132
134
|
* Reset value, validity and error state
|
|
133
135
|
*/
|
|
@@ -155,7 +157,7 @@ export declare class MgInputPassword {
|
|
|
155
157
|
private checkValidity;
|
|
156
158
|
/**
|
|
157
159
|
* Set input error message
|
|
158
|
-
* @param
|
|
160
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
159
161
|
*/
|
|
160
162
|
private setErrorMessage;
|
|
161
163
|
/*************
|
|
@@ -11,6 +11,7 @@ export declare class MgInputRadio {
|
|
|
11
11
|
private messages;
|
|
12
12
|
private hasDisplayedError;
|
|
13
13
|
private handlerInProgress;
|
|
14
|
+
private customErrorMessage;
|
|
14
15
|
/**************
|
|
15
16
|
* Decorators *
|
|
16
17
|
**************/
|
|
@@ -128,8 +129,9 @@ export declare class MgInputRadio {
|
|
|
128
129
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
129
130
|
* @param valid - value indicating the validity
|
|
130
131
|
* @param errorMessage - the error message to display
|
|
132
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
131
133
|
*/
|
|
132
|
-
setError(valid: MgInputRadio['valid'], errorMessage
|
|
134
|
+
setError(valid: MgInputRadio['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
133
135
|
/**
|
|
134
136
|
* Reset value, validity and error state
|
|
135
137
|
*/
|
|
@@ -154,7 +156,7 @@ export declare class MgInputRadio {
|
|
|
154
156
|
private checkValidity;
|
|
155
157
|
/**
|
|
156
158
|
* Set input error message
|
|
157
|
-
* @param
|
|
159
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
158
160
|
*/
|
|
159
161
|
private setErrorMessage;
|
|
160
162
|
/**
|
|
@@ -10,6 +10,7 @@ export declare class MgInputRichTextEditor {
|
|
|
10
10
|
private wrapperElement;
|
|
11
11
|
private messages;
|
|
12
12
|
private hasDisplayedError;
|
|
13
|
+
private customErrorMessage;
|
|
13
14
|
private readonly classFocus;
|
|
14
15
|
/**************
|
|
15
16
|
* Decorators *
|
|
@@ -138,8 +139,9 @@ export declare class MgInputRichTextEditor {
|
|
|
138
139
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
139
140
|
* @param valid - value indicating the validity
|
|
140
141
|
* @param errorMessage - the error message to display
|
|
142
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
141
143
|
*/
|
|
142
|
-
setError(valid: MgInputRichTextEditor['valid'], errorMessage
|
|
144
|
+
setError(valid: MgInputRichTextEditor['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
143
145
|
/**
|
|
144
146
|
* Reset value, validity and error state
|
|
145
147
|
*/
|
|
@@ -170,7 +172,7 @@ export declare class MgInputRichTextEditor {
|
|
|
170
172
|
private checkValidity;
|
|
171
173
|
/**
|
|
172
174
|
* Set input error message
|
|
173
|
-
* @param
|
|
175
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
174
176
|
*/
|
|
175
177
|
private setErrorMessage;
|
|
176
178
|
/**
|
|
@@ -10,6 +10,7 @@ export declare class MgInputSelect {
|
|
|
10
10
|
private messages;
|
|
11
11
|
private hasDisplayedError;
|
|
12
12
|
private handlerInProgress;
|
|
13
|
+
private customErrorMessage;
|
|
13
14
|
/**************
|
|
14
15
|
* Decorators *
|
|
15
16
|
**************/
|
|
@@ -140,8 +141,9 @@ export declare class MgInputSelect {
|
|
|
140
141
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
141
142
|
* @param valid - value indicating the validity
|
|
142
143
|
* @param errorMessage - the error message to display
|
|
144
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
143
145
|
*/
|
|
144
|
-
setError(valid: MgInputSelect['valid'], errorMessage
|
|
146
|
+
setError(valid: MgInputSelect['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
145
147
|
/**
|
|
146
148
|
* Reset value, validity and error state
|
|
147
149
|
*/
|
|
@@ -181,7 +183,7 @@ export declare class MgInputSelect {
|
|
|
181
183
|
private checkValidity;
|
|
182
184
|
/**
|
|
183
185
|
* Set input error message
|
|
184
|
-
* @param
|
|
186
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
185
187
|
*/
|
|
186
188
|
private setErrorMessage;
|
|
187
189
|
/*************
|
|
@@ -21,6 +21,7 @@ export declare class MgInputText {
|
|
|
21
21
|
private input;
|
|
22
22
|
private messages;
|
|
23
23
|
private hasDisplayedError;
|
|
24
|
+
private customErrorMessage;
|
|
24
25
|
private handlerInProgress;
|
|
25
26
|
/**************
|
|
26
27
|
* Decorators *
|
|
@@ -165,8 +166,9 @@ export declare class MgInputText {
|
|
|
165
166
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
166
167
|
* @param valid - value indicating the validity
|
|
167
168
|
* @param errorMessage - the error message to display
|
|
169
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
168
170
|
*/
|
|
169
|
-
setError(valid: MgInputText['valid'], errorMessage
|
|
171
|
+
setError(valid: MgInputText['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
170
172
|
/**
|
|
171
173
|
* Reset value, validity and error state
|
|
172
174
|
*/
|
|
@@ -198,7 +200,7 @@ export declare class MgInputText {
|
|
|
198
200
|
private checkValidity;
|
|
199
201
|
/**
|
|
200
202
|
* Set input error message
|
|
201
|
-
* @param
|
|
203
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
202
204
|
*/
|
|
203
205
|
private setErrorMessage;
|
|
204
206
|
/**
|
|
@@ -12,6 +12,7 @@ export declare class MgInputTextarea {
|
|
|
12
12
|
private messages;
|
|
13
13
|
private hasDisplayedError;
|
|
14
14
|
private handlerInProgress;
|
|
15
|
+
private customErrorMessage;
|
|
15
16
|
/**************
|
|
16
17
|
* Decorators *
|
|
17
18
|
**************/
|
|
@@ -148,8 +149,9 @@ export declare class MgInputTextarea {
|
|
|
148
149
|
* When used to set validity to `false`, you should use this method again to reset the validity to `true`.
|
|
149
150
|
* @param valid - value indicating the validity
|
|
150
151
|
* @param errorMessage - the error message to display
|
|
152
|
+
* @param errorMessageLock - lock the error message and validity state
|
|
151
153
|
*/
|
|
152
|
-
setError(valid: MgInputTextarea['valid'], errorMessage
|
|
154
|
+
setError(valid: MgInputTextarea['valid'], errorMessage?: string, errorMessageLock?: boolean): Promise<void>;
|
|
153
155
|
/**
|
|
154
156
|
* Reset value, validity and error state
|
|
155
157
|
*/
|
|
@@ -183,7 +185,7 @@ export declare class MgInputTextarea {
|
|
|
183
185
|
private checkValidity;
|
|
184
186
|
/**
|
|
185
187
|
* Set input error message
|
|
186
|
-
* @param
|
|
188
|
+
* @param fromSetErrorContext - context come from `setError` method
|
|
187
189
|
*/
|
|
188
190
|
private setErrorMessage;
|
|
189
191
|
/*************
|
|
@@ -53,7 +53,9 @@ export declare class MgInputToggle {
|
|
|
53
53
|
*/
|
|
54
54
|
labelHide: boolean;
|
|
55
55
|
/**
|
|
56
|
-
* Define if toggle have on/off style
|
|
56
|
+
* Define if toggle have on/off style,
|
|
57
|
+
* the left icon is hidden.
|
|
58
|
+
* Only available in combination with the "isIcon" prop.
|
|
57
59
|
*/
|
|
58
60
|
isOnOff: boolean;
|
|
59
61
|
watchIsOnOff(newValue: MgInputToggle['isOnOff']): void;
|
|
@@ -125,7 +127,7 @@ export declare class MgInputToggle {
|
|
|
125
127
|
* @param valid - value indicating the validity
|
|
126
128
|
* @param errorMessage - the error message to display
|
|
127
129
|
*/
|
|
128
|
-
setError(valid: boolean, errorMessage
|
|
130
|
+
setError(valid: boolean, errorMessage?: string): Promise<void>;
|
|
129
131
|
/**
|
|
130
132
|
* Reset value, validity, error and visual state
|
|
131
133
|
*/
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { ClassList } from '@mgdis/core-ui-helpers/dist/utils';
|
|
2
|
+
import { labelHeading } from '../inputs/mg-input/mg-input.conf';
|
|
3
|
+
export declare class MgFieldset {
|
|
4
|
+
/************
|
|
5
|
+
* Internal *
|
|
6
|
+
************/
|
|
7
|
+
private mgInputs;
|
|
8
|
+
/**************
|
|
9
|
+
* Decorators *
|
|
10
|
+
**************/
|
|
11
|
+
/**
|
|
12
|
+
* Get component DOM element
|
|
13
|
+
*/
|
|
14
|
+
element: HTMLMgFieldsetElement;
|
|
15
|
+
/**
|
|
16
|
+
* Identifier is used for the element ID (id is a reserved prop in Stencil.js)
|
|
17
|
+
*/
|
|
18
|
+
identifier: string;
|
|
19
|
+
/**
|
|
20
|
+
* Fieldset name
|
|
21
|
+
* If not set the value equals the identifier
|
|
22
|
+
*/
|
|
23
|
+
name: string;
|
|
24
|
+
/**
|
|
25
|
+
* Fieldset legend
|
|
26
|
+
*/
|
|
27
|
+
legend: string;
|
|
28
|
+
/**
|
|
29
|
+
* Define if legend is visible
|
|
30
|
+
*/
|
|
31
|
+
legendHide: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Define legend heading, use to define legend with associated semantic
|
|
34
|
+
*/
|
|
35
|
+
legendHeading?: labelHeading;
|
|
36
|
+
/**
|
|
37
|
+
* Define if legend border is visible.
|
|
38
|
+
*/
|
|
39
|
+
legendBorderDisplay: boolean;
|
|
40
|
+
watchLegendBorderDisplay(newValue: MgFieldset['legendBorderDisplay']): void;
|
|
41
|
+
/**
|
|
42
|
+
* Define if inputs are readonly
|
|
43
|
+
*/
|
|
44
|
+
readonly: boolean;
|
|
45
|
+
watchReadonly(newValue: MgFieldset['readonly']): void;
|
|
46
|
+
/**
|
|
47
|
+
* Define if inputs are disabled
|
|
48
|
+
*/
|
|
49
|
+
disabled: boolean;
|
|
50
|
+
handleAttributeChange(): void;
|
|
51
|
+
/**
|
|
52
|
+
* Add a tooltip message next to the fieldset
|
|
53
|
+
*/
|
|
54
|
+
tooltip?: string;
|
|
55
|
+
/**
|
|
56
|
+
* Add a help text under the fieldset, usually expected data format and example
|
|
57
|
+
*/
|
|
58
|
+
helpText?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Define custom error message to display
|
|
61
|
+
*/
|
|
62
|
+
errorMessage?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Define fieldset valid state
|
|
65
|
+
*/
|
|
66
|
+
valid: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Component classes
|
|
69
|
+
*/
|
|
70
|
+
classCollection: ClassList;
|
|
71
|
+
/**
|
|
72
|
+
* Component is not a candidate for constraint validation.
|
|
73
|
+
* You can use this method to define the `errorMessage` and set the `valid` state to `false`.
|
|
74
|
+
* @param errorMessage - error message to display. Use a valid `string` to define an error or `undefined` to delete the error
|
|
75
|
+
*/
|
|
76
|
+
setCustomValidity(errorMessage?: string): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Display inputs error if it exists.
|
|
79
|
+
*/
|
|
80
|
+
displayError(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Check if fieldset is valid
|
|
83
|
+
*/
|
|
84
|
+
private checkValidity;
|
|
85
|
+
/**
|
|
86
|
+
* Set mgInputs
|
|
87
|
+
*/
|
|
88
|
+
private setMgInputs;
|
|
89
|
+
/*************
|
|
90
|
+
* Lifecycle *
|
|
91
|
+
*************/
|
|
92
|
+
/**
|
|
93
|
+
* Check if component props are well configured on init
|
|
94
|
+
*/
|
|
95
|
+
componentWillLoad(): void;
|
|
96
|
+
/**
|
|
97
|
+
* Add slot listeners
|
|
98
|
+
*/
|
|
99
|
+
componentDidLoad(): void;
|
|
100
|
+
/**
|
|
101
|
+
* Render
|
|
102
|
+
* @returns HTML Element
|
|
103
|
+
*/
|
|
104
|
+
render(): HTMLElement;
|
|
105
|
+
}
|
|
@@ -3,6 +3,7 @@ import { ClassList } from '@mgdis/core-ui-helpers/dist/utils';
|
|
|
3
3
|
import { type ExpandToggleDisplayType, type TitlePositionType } from './mg-panel.conf';
|
|
4
4
|
/**
|
|
5
5
|
* @slot - Panel content
|
|
6
|
+
* @slot panel-title - Panel title content (replaces panel-title prop when used)
|
|
6
7
|
* @slot header-right - Header right panel content
|
|
7
8
|
*/
|
|
8
9
|
export declare class MgPanel {
|
|
@@ -27,7 +28,7 @@ export declare class MgPanel {
|
|
|
27
28
|
/**
|
|
28
29
|
* Panel title
|
|
29
30
|
*/
|
|
30
|
-
panelTitle
|
|
31
|
+
panelTitle?: string;
|
|
31
32
|
validatePanelTitle(newValue: MgPanel['panelTitle']): void;
|
|
32
33
|
/**
|
|
33
34
|
* Panel title pattern
|
|
@@ -42,6 +43,7 @@ export declare class MgPanel {
|
|
|
42
43
|
* Define if panel title is editable
|
|
43
44
|
*/
|
|
44
45
|
titleEditable: boolean;
|
|
46
|
+
validateTitleEditable(newValue: MgPanel['titleEditable']): void;
|
|
45
47
|
/**
|
|
46
48
|
* Define title position
|
|
47
49
|
*/
|
|
@@ -88,6 +90,11 @@ export declare class MgPanel {
|
|
|
88
90
|
/************
|
|
89
91
|
* Methods *
|
|
90
92
|
************/
|
|
93
|
+
/**
|
|
94
|
+
* Check if panel-title slot is used
|
|
95
|
+
* @returns true if slot is used
|
|
96
|
+
*/
|
|
97
|
+
private hasPanelTitleSlot;
|
|
91
98
|
/**
|
|
92
99
|
* Toggle is editing state
|
|
93
100
|
*/
|