@felleslosninger/minid-elements 0.0.140 → 0.1.1
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/README.md +69 -4
- package/dist/components/alert.component.d.ts +6 -4
- package/dist/components/alert.component.d.ts.map +1 -1
- package/dist/components/alert.js +33 -61
- package/dist/components/alert.js.map +1 -1
- package/dist/components/button.component.d.ts +1 -1
- package/dist/components/checkbox.component.d.ts +1 -2
- package/dist/components/checkbox.component.d.ts.map +1 -1
- package/dist/components/checkbox.js +25 -55
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/code-input-old.component.d.ts +1 -1
- package/dist/components/code-input-old.js +1 -1
- package/dist/components/code-input.component.d.ts +1 -1
- package/dist/components/code-input.component.d.ts.map +1 -1
- package/dist/components/code-input.js +232 -94
- package/dist/components/code-input.js.map +1 -1
- package/dist/components/combobox.component.d.ts +1 -1
- package/dist/components/countdown.component.d.ts +1 -1
- package/dist/components/dialog.component.d.ts +7 -1
- package/dist/components/dialog.component.d.ts.map +1 -1
- package/dist/components/dialog.js +19 -2
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/dropdown.component.d.ts +1 -1
- package/dist/components/heading.component.d.ts +1 -1
- package/dist/components/heading.component.d.ts.map +1 -1
- package/dist/components/heading.js +1 -11
- package/dist/components/heading.js.map +1 -1
- package/dist/components/helptext.component.d.ts +1 -1
- package/dist/components/label.component.d.ts +1 -1
- package/dist/components/label.component.d.ts.map +1 -1
- package/dist/components/label.js +3 -12
- package/dist/components/label.js.map +1 -1
- package/dist/components/link.component.d.ts +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/link.js.map +1 -1
- package/dist/components/menu-item.component.d.ts +1 -1
- package/dist/components/menu.component.d.ts +1 -1
- package/dist/components/paragraph.component.d.ts +1 -1
- package/dist/components/paragraph.component.d.ts.map +1 -1
- package/dist/components/paragraph.js +2 -8
- package/dist/components/paragraph.js.map +1 -1
- package/dist/components/phone-input.component.d.ts +15 -3
- package/dist/components/phone-input.component.d.ts.map +1 -1
- package/dist/components/phone-input.js +37 -6
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/popup.component.d.ts +1 -1
- package/dist/components/qr-code.component.d.ts +1 -1
- package/dist/components/radio-button.component.d.ts +1 -1
- package/dist/components/radio-group.component.d.ts +1 -1
- package/dist/components/radio.component.d.ts +1 -1
- package/dist/components/radio.component.d.ts.map +1 -1
- package/dist/components/radio.js +12 -16
- package/dist/components/radio.js.map +1 -1
- package/dist/components/search.component.d.ts +11 -4
- package/dist/components/search.component.d.ts.map +1 -1
- package/dist/components/search.js +75 -31
- package/dist/components/search.js.map +1 -1
- package/dist/components/spinner.component.d.ts +1 -1
- package/dist/components/step-indicator.component.d.ts +1 -1
- package/dist/components/textfield.component.d.ts +5 -3
- package/dist/components/textfield.component.d.ts.map +1 -1
- package/dist/components/textfield.js +76 -84
- package/dist/components/textfield.js.map +1 -1
- package/dist/components/tooltip.component.d.ts +1 -1
- package/dist/components/validation-message.component.d.ts +1 -1
- package/dist/controllers/lang.controller.d.ts +14 -0
- package/dist/controllers/lang.controller.d.ts.map +1 -0
- package/dist/designsystemet-tailwind.css +355 -297
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/lang.controller-P4W-9ipy.js +32 -0
- package/dist/lang.controller-P4W-9ipy.js.map +1 -0
- package/dist/mixins/validators.d.ts +1 -0
- package/dist/mixins/validators.d.ts.map +1 -1
- package/dist/mixins/validators.js +18 -1
- package/dist/mixins/validators.js.map +1 -1
- package/dist/styles.css +5 -0
- package/dist/theme.css +1155 -0
- package/dist/utilities/lang.d.ts +6 -0
- package/dist/utilities/lang.d.ts.map +1 -0
- package/dist/utilities/lang.js +18 -0
- package/dist/utilities/lang.js.map +1 -0
- package/dist/utilities/translations.d.ts +43 -0
- package/dist/utilities/translations.d.ts.map +1 -0
- package/dist/utilities/translations.js +49 -0
- package/dist/utilities/translations.js.map +1 -0
- package/package.json +34 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dialog.js","sources":["../../src/components/dialog.component.ts"],"sourcesContent":["import { css, html, LitElement } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport { styled } from '../mixins/tailwind.mixin';\nimport './icon/icon.component';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../internal/scroll';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-dialog': MinidDialog;\n }\n}\n\nconst styles = [\n css`\n :host {\n --width: 40rem;\n display: block;\n }\n `,\n];\n\n/**\n *\n * @event mid-show - Emitted when the dialog opens.\n * @event mid-after-show - Emitted after the dialog opens and all animations are complete.\n * @event mid-hide - Emitted when the dialog closes.\n * @event mid-after-hide - Emitted after the dialog closes and all animations are complete.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} mid-request-close - Emitted when the user attempts to\n * close the dialog by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the dialog open. Avoid using this unless closing the dialog will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - Select the base `dialog` element\n * @csspart header - Select the `header` element\n * @csspart body - Select the `article` element\n * @csspart footer - Select the `footer` element\n *\n * @slot -- The default slot for the body content of the dialog\n * @slot heading - The content inside the `h2` element\n * @slot footer - The content inside the `footer` element\n *\n * @animation dialog.show - The animation to use when showing the dialog.\n * @animation dialog.hide - The animation to use when hiding the dialog.\n * @animation dialog.denyClose - The animation to use when closing the dialog is prevented.\n *\n */\n@customElement('mid-dialog')\nexport class MinidDialog extends styled(LitElement, styles) {\n @query('#dialog')\n dialog!: HTMLDialogElement;\n\n /**\n * Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ reflect: true })\n heading = '';\n\n private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const requestCloseEvent = new CustomEvent('mid-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: { source },\n });\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n const { keyframes, options } = getAnimation(this, 'dialog.denyClose');\n animateTo(this.dialog, keyframes, options);\n return;\n }\n\n this.hide();\n }\n\n handleDialogCancel = (event: Event) => {\n event.preventDefault();\n\n if (event.defaultPrevented) {\n this.requestClose('keyboard');\n } else {\n this.hide();\n }\n };\n\n private handleBackdropClick({ target }: Event) {\n // if the target is the dialog, the backdrop was clicked\n if (target === this.dialog) {\n this.requestClose('overlay');\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.dispatchEvent(\n new Event('mid-show', { composed: true, bubbles: true })\n );\n // this.addOpenListeners();\n this.dialog.showModal();\n\n lockBodyScrolling(this);\n\n const panelAnimation = getAnimation(this, 'dialog.show');\n await animateTo(\n this.dialog,\n panelAnimation.keyframes,\n panelAnimation.options\n ),\n this.dispatchEvent(\n new Event('mid-after-show', { bubbles: true, composed: true })\n );\n } else {\n // Hide\n this.dispatchEvent(\n new Event('mid-hide', { bubbles: true, composed: true })\n );\n\n await Promise.all([stopAnimations(this.dialog)]);\n const panelAnimation = getAnimation(this, 'dialog.hide');\n\n // The backdrop can only be animated with css because it's a pseudo element\n // so we add a animation class to trigger it at the same time as the dialog animation\n this.dialog.classList.add('backdrop:animate-fade-out');\n await animateTo(\n this.dialog,\n panelAnimation.keyframes,\n panelAnimation.options\n );\n this.dialog.classList.remove('backdrop:animate-fade-out');\n this.dialog.close();\n this.dialog.hidden = false;\n unlockBodyScrolling(this);\n this.dispatchEvent(\n new Event('mid-after-hide', { composed: true, bubbles: true })\n );\n }\n }\n\n /**\n * Shows the dialog.\n */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'mid-after-show');\n }\n\n /**\n * Hides the dialog\n */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'mid-after-hide');\n }\n\n override render() {\n return html`\n <dialog\n part=\"base\"\n id=\"dialog\"\n class=\"text-neutral m-auto max-h-[calc(100%---spacing(8))] w-(--width) max-w-[calc(100%---spacing(8))] flex-col rounded-lg p-6 shadow-xl backdrop:bg-black/50 open:flex open:animate-none\"\n @cancel=${this.handleDialogCancel}\n @click=${this.handleBackdropClick}\n >\n <header part=\"header\" class=\"text-heading-sm flex justify-between\">\n <slot name=\"heading\"></slot>\n <div class=\"h-0\">\n <button\n autofocus\n @click=\"${() => this.requestClose('close-button')}\"\n class=\"text-body-md focus-visible:focus-ring text-neutral hover:bg-neutral-surface-hover float-right flex size-12 translate-x-3 -translate-y-3 items-center justify-center rounded\"\n >\n <mid-icon class=\"size-6\" name=\"xmark\"></mid-icon>\n </button>\n </div>\n </header>\n <div part=\"body\" class=\"overflow-auto\">\n <slot> </slot>\n </div>\n <footer part=\"footer\">\n <slot name=\"footer\"> </slot>\n </footer>\n </dialog>\n `;\n }\n}\n\nsetDefaultAnimation('dialog.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 },\n ],\n options: { duration: 250, easing: 'ease' },\n});\n\nsetDefaultAnimation('dialog.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 },\n ],\n options: { duration: 250, easing: 'ease' },\n});\n\nsetDefaultAnimation('dialog.denyClose', {\n keyframes: [{ scale: 1 }, { scale: 1.03 }, { scale: 1 }],\n options: { duration: 100 },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AA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AAS,EAAE,MAAM,SAAS,SAAS,MAAM;AAAA,GAR/B,YASX,WAAA,QAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,SAAS,KAAA,CAAM;AAAA,GAfhB,YAgBX,WAAA,WAAA,CAAA;AAsCM,gBAAA;AAAA,EADL,MAAM,QAAQ,EAAE,sBAAsB,MAAM;AAAA,GArDlC,YAsDL,WAAA,oBAAA,CAAA;AAtDK,cAAN,gBAAA;AAAA,EADN,cAAc,YAAY;AAAA,GACd,WAAA;AA6Jb,oBAAoB,eAAe;AAAA,EACjC,WAAW;AAAA,IACT,EAAE,SAAS,GAAG,OAAO,IAAA;AAAA,IACrB,EAAE,SAAS,GAAG,OAAO,EAAA;AAAA,EAAE;AAAA,EAEzB,SAAS,EAAE,UAAU,KAAK,QAAQ,OAAA;AACpC,CAAC;AAED,oBAAoB,eAAe;AAAA,EACjC,WAAW;AAAA,IACT,EAAE,SAAS,GAAG,OAAO,EAAA;AAAA,IACrB,EAAE,SAAS,GAAG,OAAO,IAAA;AAAA,EAAI;AAAA,EAE3B,SAAS,EAAE,UAAU,KAAK,QAAQ,OAAA;AACpC,CAAC;AAED,oBAAoB,oBAAoB;AAAA,EACtC,WAAW,CAAC,EAAE,OAAO,KAAK,EAAE,OAAO,QAAQ,EAAE,OAAO,GAAG;AAAA,EACvD,SAAS,EAAE,UAAU,IAAA;AACvB,CAAC;"}
|
|
1
|
+
{"version":3,"file":"dialog.js","sources":["../../src/components/dialog.component.ts"],"sourcesContent":["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { getLang } from '../utilities/lang';\nimport { getTranslations } from '../utilities/translations';\nimport { LangController } from '../controllers/lang.controller.js';\nimport { waitForEvent } from '../internal/event';\nimport { watch } from '../internal/watch';\nimport { styled } from '../mixins/tailwind.mixin';\nimport './icon/icon.component';\nimport {\n getAnimation,\n setDefaultAnimation,\n} from '../utilities/animation-registry';\nimport { animateTo, stopAnimations } from '../internal/animate';\nimport { lockBodyScrolling, unlockBodyScrolling } from '../internal/scroll';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-dialog': MinidDialog;\n }\n}\n\nconst styles = [\n css`\n :host {\n --width: 40rem;\n display: block;\n }\n `,\n];\n\n/**\n *\n * @event mid-show - Emitted when the dialog opens.\n * @event mid-after-show - Emitted after the dialog opens and all animations are complete.\n * @event mid-hide - Emitted when the dialog closes.\n * @event mid-after-hide - Emitted after the dialog closes and all animations are complete.\n * @event {{ source: 'close-button' | 'keyboard' | 'overlay' }} mid-request-close - Emitted when the user attempts to\n * close the dialog by clicking the close button, clicking the overlay, or pressing escape. Calling\n * `event.preventDefault()` will keep the dialog open. Avoid using this unless closing the dialog will result in\n * destructive behavior such as data loss.\n *\n * @csspart base - Select the base `dialog` element\n * @csspart header - Select the `header` element\n * @csspart body - Select the `article` element\n * @csspart footer - Select the `footer` element\n *\n * @slot -- The default slot for the body content of the dialog\n * @slot heading - The content inside the `h2` element\n * @slot footer - The content inside the `footer` element\n *\n * @animation dialog.show - The animation to use when showing the dialog.\n * @animation dialog.hide - The animation to use when hiding the dialog.\n * @animation dialog.denyClose - The animation to use when closing the dialog is prevented.\n *\n */\n@customElement('mid-dialog')\nexport class MinidDialog extends styled(LitElement, styles) {\n @query('#dialog')\n dialog!: HTMLDialogElement;\n\n /**\n * Indicates whether or not the dialog is open. You can toggle this attribute to show and hide the dialog, or you can\n * use the `show()` and `hide()` methods and this attribute will reflect the dialog's open state.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * The dialog's label as displayed in the header. You should always include a relevant label even when using\n * `no-header`, as it is required for proper accessibility. If you need to display HTML, use the `label` slot instead.\n */\n @property({ reflect: true })\n heading = '';\n\n /**\n * When set, the dialog uses `role=\"alertdialog\"` instead of `role=\"dialog\"`, signalling urgency to screen readers.\n * Use this for blocking dialogs that require immediate user attention.\n */\n @property({ type: Boolean, reflect: true })\n alertdialog = false;\n\n private requestClose(source: 'close-button' | 'keyboard' | 'overlay') {\n const requestCloseEvent = new CustomEvent('mid-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: { source },\n });\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n const { keyframes, options } = getAnimation(this, 'dialog.denyClose');\n animateTo(this.dialog, keyframes, options);\n return;\n }\n\n this.hide();\n }\n\n handleDialogCancel = (event: Event) => {\n event.preventDefault();\n\n if (event.defaultPrevented) {\n this.requestClose('keyboard');\n } else {\n this.hide();\n }\n };\n\n private handleBackdropClick({ target }: Event) {\n // if the target is the dialog, the backdrop was clicked\n if (target === this.dialog) {\n this.requestClose('overlay');\n }\n }\n\n @watch('open', { waitUntilFirstUpdate: true })\n async handleOpenChange() {\n if (this.open) {\n // Show\n this.dispatchEvent(\n new Event('mid-show', { composed: true, bubbles: true })\n );\n // this.addOpenListeners();\n this.dialog.showModal();\n\n if (this.alertdialog) {\n this.dialog.focus();\n }\n\n lockBodyScrolling(this);\n\n const panelAnimation = getAnimation(this, 'dialog.show');\n await animateTo(\n this.dialog,\n panelAnimation.keyframes,\n panelAnimation.options\n ),\n this.dispatchEvent(\n new Event('mid-after-show', { bubbles: true, composed: true })\n );\n } else {\n // Hide\n this.dispatchEvent(\n new Event('mid-hide', { bubbles: true, composed: true })\n );\n\n await Promise.all([stopAnimations(this.dialog)]);\n const panelAnimation = getAnimation(this, 'dialog.hide');\n\n // The backdrop can only be animated with css because it's a pseudo element\n // so we add a animation class to trigger it at the same time as the dialog animation\n this.dialog.classList.add('backdrop:animate-fade-out');\n await animateTo(\n this.dialog,\n panelAnimation.keyframes,\n panelAnimation.options\n );\n this.dialog.classList.remove('backdrop:animate-fade-out');\n this.dialog.close();\n this.dialog.hidden = false;\n unlockBodyScrolling(this);\n this.dispatchEvent(\n new Event('mid-after-hide', { composed: true, bubbles: true })\n );\n }\n }\n\n /**\n * Shows the dialog.\n */\n async show() {\n if (this.open) {\n return undefined;\n }\n\n this.open = true;\n return waitForEvent(this, 'mid-after-show');\n }\n\n /**\n * Hides the dialog\n */\n async hide() {\n if (!this.open) {\n return undefined;\n }\n\n this.open = false;\n return waitForEvent(this, 'mid-after-hide');\n }\n\n constructor() {\n super();\n new LangController(this);\n }\n\n override render() {\n const t = getTranslations(getLang(this));\n\n return html`\n <dialog\n part=\"base\"\n id=\"dialog\"\n tabindex=\"-1\"\n role=${this.alertdialog ? 'alertdialog' : 'dialog'}\n aria-label=${this.heading || nothing}\n aria-modal=\"true\"\n class=\"text-neutral m-auto max-h-[calc(100%---spacing(8))] w-(--width) max-w-[calc(100%---spacing(8))] flex-col rounded-lg p-6 shadow-xl backdrop:bg-black/50 open:flex open:animate-none\"\n @cancel=${this.handleDialogCancel}\n @click=${this.handleBackdropClick}\n >\n <header part=\"header\" class=\"text-heading-sm flex justify-between\">\n <slot name=\"heading\"></slot>\n <div class=\"h-0\">\n <button\n autofocus\n aria-label=${t.close}\n @click=\"${() => this.requestClose('close-button')}\"\n class=\"text-body-md focus-visible:focus-ring text-neutral hover:bg-neutral-surface-hover float-right flex size-12 translate-x-3 -translate-y-3 items-center justify-center rounded\"\n >\n <mid-icon class=\"size-6\" name=\"xmark\"></mid-icon>\n </button>\n </div>\n </header>\n <div part=\"body\" class=\"overflow-auto\">\n <slot> </slot>\n </div>\n <footer part=\"footer\">\n <slot name=\"footer\"> </slot>\n </footer>\n </dialog>\n `;\n }\n}\n\nsetDefaultAnimation('dialog.show', {\n keyframes: [\n { opacity: 0, scale: 0.8 },\n { opacity: 1, scale: 1 },\n ],\n options: { duration: 250, easing: 'ease' },\n});\n\nsetDefaultAnimation('dialog.hide', {\n keyframes: [\n { opacity: 1, scale: 1 },\n { opacity: 0, scale: 0.8 },\n ],\n options: { duration: 250, easing: 'ease' },\n});\n\nsetDefaultAnimation('dialog.denyClose', {\n keyframes: [{ scale: 1 }, { scale: 1.03 }, { scale: 1 }],\n options: { duration: 100 },\n});\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAsB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86,7 @@ export declare class MinidDropdown extends MinidDropdown_base {
|
|
|
86
86
|
addOpenListeners(): void;
|
|
87
87
|
removeOpenListeners(): void;
|
|
88
88
|
handleOpenChange(): Promise<void>;
|
|
89
|
-
render(): import('lit
|
|
89
|
+
render(): import('lit').TemplateResult<1>;
|
|
90
90
|
}
|
|
91
91
|
export {};
|
|
92
92
|
//# sourceMappingURL=dropdown.component.d.ts.map
|
|
@@ -19,7 +19,7 @@ export declare class MinidHeading extends MinidHeading_base {
|
|
|
19
19
|
* @default false
|
|
20
20
|
*/
|
|
21
21
|
spacing: boolean;
|
|
22
|
-
render(): import('lit
|
|
22
|
+
render(): import('lit').TemplateResult;
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
25
25
|
//# sourceMappingURL=heading.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.component.d.ts","sourceRoot":"","sources":["../../src/components/heading.component.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"heading.component.d.ts","sourceRoot":"","sources":["../../src/components/heading.component.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAEjC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,YAAY,CAAC;KAC7B;CACF;;AAED,qBACa,YAAa,SAAQ,iBAAkB;IAClD;;OAEG;IAEH,KAAK,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAK;IAEjC;;OAEG;IAEH,IAAI,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAQ;IAE9D;;;OAGG;IAEH,OAAO,UAAS;IAEP,MAAM;CAgBhB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { literal, html } from "lit/static-html.js";
|
|
2
2
|
import { property, customElement } from "lit/decorators.js";
|
|
3
3
|
import { styled } from "../mixins/tailwind.mixin.js";
|
|
4
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
5
4
|
import { LitElement } from "lit";
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
7
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -22,16 +21,7 @@ let MinidHeading = class extends styled(LitElement) {
|
|
|
22
21
|
}
|
|
23
22
|
render() {
|
|
24
23
|
const tag = this.level === 1 ? literal`h1` : this.level === 2 ? literal`h2` : this.level === 3 ? literal`h3` : this.level === 4 ? literal`h4` : this.level === 5 ? literal`h5` : literal`h6`;
|
|
25
|
-
return html`<${tag} class="
|
|
26
|
-
"mb-2": this.spacing,
|
|
27
|
-
"text-heading-2xs": this.size === "2xs",
|
|
28
|
-
"text-heading-xs": this.size === "xs",
|
|
29
|
-
"text-heading-sm": this.size === "sm",
|
|
30
|
-
"text-heading-md": this.size === "md",
|
|
31
|
-
"text-heading-lg": this.size === "lg",
|
|
32
|
-
"text-heading-xl": this.size === "xl",
|
|
33
|
-
"text-heading-2xl": this.size === "2xl"
|
|
34
|
-
})}"><slot></slot></${tag}>`;
|
|
24
|
+
return html`<${tag} class="ds-heading" data-size=${this.size}><slot></slot></${tag}>`;
|
|
35
25
|
}
|
|
36
26
|
};
|
|
37
27
|
__decorateClass([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heading.js","sources":["../../src/components/heading.component.ts"],"sourcesContent":["import { html, literal } from 'lit/static-html.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styled } from '../mixins/tailwind.mixin';\nimport {
|
|
1
|
+
{"version":3,"file":"heading.js","sources":["../../src/components/heading.component.ts"],"sourcesContent":["import { html, literal } from 'lit/static-html.js';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styled } from '../mixins/tailwind.mixin';\nimport { LitElement } from 'lit';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-heading': MinidHeading;\n }\n}\n\n@customElement('mid-heading')\nexport class MinidHeading extends styled(LitElement) {\n /**\n * @default 1\n */\n @property({ type: Number })\n level: 1 | 2 | 3 | 4 | 5 | 6 = 1;\n\n /**\n * @default 'md'\n */\n @property()\n size: '2xs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' = 'md';\n\n /**\n *\n * @default false\n */\n @property({ type: Boolean })\n spacing = false;\n\n override render() {\n const tag =\n this.level === 1\n ? literal`h1`\n : this.level === 2\n ? literal`h2`\n : this.level === 3\n ? literal`h3`\n : this.level === 4\n ? literal`h4`\n : this.level === 5\n ? literal`h5`\n : literal`h6`;\n\n return html`<${tag} class=\"ds-heading\" data-size=${this.size}><slot></slot></${tag}>`;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAYO,IAAM,eAAN,cAA2B,OAAO,UAAU,EAAE;AAAA,EAA9C,cAAA;AAAA,UAAA,GAAA,SAAA;AAKL,SAAA,QAA+B;AAM/B,SAAA,OAAyD;AAOzD,SAAA,UAAU;AAAA,EAAA;AAAA,EAED,SAAS;AAChB,UAAM,MACJ,KAAK,UAAU,IACX,cACA,KAAK,UAAU,IACb,cACA,KAAK,UAAU,IACb,cACA,KAAK,UAAU,IACb,cACA,KAAK,UAAU,IACb,cACA;AAEd,WAAO,QAAQ,GAAG,iCAAiC,KAAK,IAAI,mBAAmB,GAAG;AAAA,EACpF;AACF;AA/BE,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,OAAA,CAAQ;AAAA,GAJf,aAKX,WAAA,SAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAA;AAAS,GAVC,aAWX,WAAA,QAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAjBhB,aAkBX,WAAA,WAAA,CAAA;AAlBW,eAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,YAAA;"}
|
|
@@ -64,7 +64,7 @@ export declare class MinidHelptext extends MinidHelptext_base {
|
|
|
64
64
|
* Hides the helptext
|
|
65
65
|
*/
|
|
66
66
|
hide(): Promise<void>;
|
|
67
|
-
render(): import('lit
|
|
67
|
+
render(): import('lit').TemplateResult<1>;
|
|
68
68
|
}
|
|
69
69
|
export {};
|
|
70
70
|
//# sourceMappingURL=helptext.component.d.ts.map
|
|
@@ -22,7 +22,7 @@ export declare class MinidLabel extends MinidLabel_base {
|
|
|
22
22
|
* @default 'medium'
|
|
23
23
|
*/
|
|
24
24
|
weight: 'medium' | 'normal' | 'semibold';
|
|
25
|
-
render(): import('lit
|
|
25
|
+
render(): import('lit').TemplateResult<1>;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
28
28
|
//# sourceMappingURL=label.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.component.d.ts","sourceRoot":"","sources":["../../src/components/label.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"label.component.d.ts","sourceRoot":"","sources":["../../src/components/label.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAKvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,UAAU,CAAC;KACzB;CACF;;AAED,qBACa,UAAW,SAAQ,eAAkB;IAChD;;;OAGG;IAEH,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAGvC,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb;;;OAGG;IAEH,OAAO,UAAS;IAEhB;;;OAGG;IAEH,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAY;IAE3C,MAAM;CAYhB"}
|
package/dist/components/label.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { property, customElement } from "lit/decorators.js";
|
|
3
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
4
3
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
4
|
import { styled } from "../mixins/tailwind.mixin.js";
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
@@ -24,17 +23,9 @@ let MinidLabel = class extends styled(LitElement) {
|
|
|
24
23
|
return html`
|
|
25
24
|
<label
|
|
26
25
|
for=${ifDefined(this.for)}
|
|
27
|
-
class
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"fds-label--xs": this.size === "xs",
|
|
31
|
-
"fds-label--sm": this.size === "sm",
|
|
32
|
-
"fds-label--md": this.size === "md",
|
|
33
|
-
"fds-label--lg": this.size === "lg",
|
|
34
|
-
"fds-label--medium-weight": this.weight === "medium",
|
|
35
|
-
"fds-label--regular-weight": this.weight === "normal",
|
|
36
|
-
"fds-label--semibold-weight": this.weight === "semibold"
|
|
37
|
-
})}
|
|
26
|
+
class="ds-label"
|
|
27
|
+
data-weight=${this.weight}
|
|
28
|
+
data-size=${this.size}
|
|
38
29
|
>
|
|
39
30
|
<slot></slot>
|
|
40
31
|
</label>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"label.js","sources":["../../src/components/label.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {
|
|
1
|
+
{"version":3,"file":"label.js","sources":["../../src/components/label.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styled } from '../mixins/tailwind.mixin';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-label': MinidLabel;\n }\n}\n\n@customElement('mid-label')\nexport class MinidLabel extends styled(LitElement) {\n /**\n * Font size\n * @default 'md'\n */\n @property()\n size: 'xs' | 'sm' | 'md' | 'lg' = 'md';\n\n @property()\n for?: string;\n\n /**\n * Add margin below element\n * @default false\n */\n @property({ type: Boolean })\n spacing = false;\n\n /**\n * Font weight\n * @default 'medium'\n */\n @property()\n weight: 'medium' | 'normal' | 'semibold' = 'medium';\n\n override render() {\n return html`\n <label\n for=${ifDefined(this.for)}\n class=\"ds-label\"\n data-weight=${this.weight}\n data-size=${this.size}\n >\n <slot></slot>\n </label>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAYO,IAAM,aAAN,cAAyB,OAAO,UAAU,EAAE;AAAA,EAA5C,cAAA;AAAA,UAAA,GAAA,SAAA;AAML,SAAA,OAAkC;AAUlC,SAAA,UAAU;AAOV,SAAA,SAA2C;AAAA,EAAA;AAAA,EAElC,SAAS;AAChB,WAAO;AAAA;AAAA,cAEG,UAAU,KAAK,GAAG,CAAC;AAAA;AAAA,sBAEX,KAAK,MAAM;AAAA,oBACb,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA,EAK3B;AACF;AA/BE,gBAAA;AAAA,EADC,SAAA;AAAS,GALC,WAMX,WAAA,QAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAA;AAAS,GARC,WASX,WAAA,OAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAfhB,WAgBX,WAAA,WAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAA;AAAS,GAtBC,WAuBX,WAAA,UAAA,CAAA;AAvBW,aAAN,gBAAA;AAAA,EADN,cAAc,WAAW;AAAA,GACb,UAAA;"}
|
|
@@ -8,7 +8,7 @@ declare const MinidLink_base: typeof LitElement;
|
|
|
8
8
|
export declare class MinidLink extends MinidLink_base {
|
|
9
9
|
href?: string;
|
|
10
10
|
target?: string;
|
|
11
|
-
render(): import('lit
|
|
11
|
+
render(): import('lit').TemplateResult<1>;
|
|
12
12
|
}
|
|
13
13
|
export {};
|
|
14
14
|
//# sourceMappingURL=link.component.d.ts.map
|
package/dist/components/link.js
CHANGED
|
@@ -16,7 +16,7 @@ let MinidLink = class extends styled(LitElement) {
|
|
|
16
16
|
render() {
|
|
17
17
|
return html`
|
|
18
18
|
<a
|
|
19
|
-
class="
|
|
19
|
+
class="ds-link"
|
|
20
20
|
href=${ifDefined(this.href)}
|
|
21
21
|
target=${ifDefined(this.target)}
|
|
22
22
|
>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../src/components/link.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styled } from '../mixins/tailwind.mixin';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-link': MinidLink;\n }\n}\n\n@customElement('mid-link')\nexport class MinidLink extends styled(LitElement) {\n @property()\n href?: string;\n\n @property()\n target?: string;\n\n override render() {\n return html`\n <a\n class=\"
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../src/components/link.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styled } from '../mixins/tailwind.mixin';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-link': MinidLink;\n }\n}\n\n@customElement('mid-link')\nexport class MinidLink extends styled(LitElement) {\n @property()\n href?: string;\n\n @property()\n target?: string;\n\n override render() {\n return html`\n <a\n class=\"ds-link\"\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n >\n <slot></slot>\n </a>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAYO,IAAM,YAAN,cAAwB,OAAO,UAAU,EAAE;AAAA,EAOvC,SAAS;AAChB,WAAO;AAAA;AAAA;AAAA,eAGI,UAAU,KAAK,IAAI,CAAC;AAAA,iBAClB,UAAU,KAAK,MAAM,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA,EAKrC;AACF;AAhBE,gBAAA;AAAA,EADC,SAAA;AAAS,GADC,UAEX,WAAA,QAAA,CAAA;AAGA,gBAAA;AAAA,EADC,SAAA;AAAS,GAJC,UAKX,WAAA,UAAA,CAAA;AALW,YAAN,gBAAA;AAAA,EADN,cAAc,UAAU;AAAA,GACZ,SAAA;"}
|
|
@@ -30,7 +30,7 @@ export declare class MinidMenuItem extends MinidMenuItem_base {
|
|
|
30
30
|
handleHostFocus(): void;
|
|
31
31
|
focus(): void;
|
|
32
32
|
setActive(active: boolean): void;
|
|
33
|
-
render(): import('lit
|
|
33
|
+
render(): import('lit').TemplateResult<1>;
|
|
34
34
|
}
|
|
35
35
|
export {};
|
|
36
36
|
//# sourceMappingURL=menu-item.component.d.ts.map
|
|
@@ -52,7 +52,7 @@ export declare class MinidMenu extends MinidMenu_base {
|
|
|
52
52
|
*/
|
|
53
53
|
setCurrentItem(item: MinidMenuItem): void;
|
|
54
54
|
focusSearchField(): void;
|
|
55
|
-
render(): import('lit
|
|
55
|
+
render(): import('lit').TemplateResult<1>;
|
|
56
56
|
}
|
|
57
57
|
export {};
|
|
58
58
|
//# sourceMappingURL=menu.component.d.ts.map
|
|
@@ -22,7 +22,7 @@ export declare class MinidParagraph extends MinidParagraph_base {
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
spacing: boolean;
|
|
25
|
-
render(): import('lit
|
|
25
|
+
render(): import('lit').TemplateResult<1>;
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
28
28
|
//# sourceMappingURL=paragraph.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.component.d.ts","sourceRoot":"","sources":["../../src/components/paragraph.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"paragraph.component.d.ts","sourceRoot":"","sources":["../../src/components/paragraph.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAIvC,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,eAAe,EAAE,cAAc,CAAC;KACjC;CACF;;AAED;;GAEG;AACH,qBACa,cAAe,SAAQ,mBAAkB;IACpD;;;;;;OAMG;IAEH,IAAI,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAQ;IAEvC;;;OAGG;IAEH,OAAO,UAAS;IAEP,MAAM;CAQhB"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement, html } from "lit";
|
|
2
2
|
import { property, customElement } from "lit/decorators.js";
|
|
3
|
-
import { classMap } from "lit/directives/class-map.js";
|
|
4
3
|
import { styled } from "../mixins/tailwind.mixin.js";
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
6
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,13 +19,8 @@ let MinidParagraph = class extends styled(LitElement) {
|
|
|
20
19
|
}
|
|
21
20
|
render() {
|
|
22
21
|
return html`<p
|
|
23
|
-
class="
|
|
24
|
-
|
|
25
|
-
"text-body-xs": this.size === "xs",
|
|
26
|
-
"text-body-sm": this.size === "sm",
|
|
27
|
-
"text-body-md": this.size === "md",
|
|
28
|
-
"text-body-lg": this.size === "lg"
|
|
29
|
-
})}"
|
|
22
|
+
class="ds-paragraph"
|
|
23
|
+
data-size=${this.size}
|
|
30
24
|
>
|
|
31
25
|
<slot></slot>
|
|
32
26
|
</p> `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.js","sources":["../../src/components/paragraph.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport {
|
|
1
|
+
{"version":3,"file":"paragraph.js","sources":["../../src/components/paragraph.component.ts"],"sourcesContent":["import { html, LitElement } from 'lit';\nimport { customElement, property } from 'lit/decorators.js';\nimport { styled } from '../mixins/tailwind.mixin';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-paragraph': MinidParagraph;\n }\n}\n\n/**\n * A paragraph\n */\n@customElement('mid-paragraph')\nexport class MinidParagraph extends styled(LitElement) {\n /**\n * `'xs' = 14px`\n * `'sm' = 16px`\n * `'md' = 18px`\n * `'lg' = 21px`\n * @default 'md'\n */\n @property()\n size: 'xs' | 'sm' | 'md' | 'lg' = 'md';\n\n /**\n * Add margin below element\n * @default false\n */\n @property({ type: Boolean })\n spacing = false;\n\n override render() {\n return html`<p\n class=\"ds-paragraph\"\n data-size=${this.size}\n >\n <slot></slot>\n </p> `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;AAcO,IAAM,iBAAN,cAA6B,OAAO,UAAU,EAAE;AAAA,EAAhD,cAAA;AAAA,UAAA,GAAA,SAAA;AASL,SAAA,OAAkC;AAOlC,SAAA,UAAU;AAAA,EAAA;AAAA,EAED,SAAS;AAChB,WAAO;AAAA;AAAA,kBAEO,KAAK,IAAI;AAAA;AAAA;AAAA;AAAA,EAIzB;AACF;AAjBE,gBAAA;AAAA,EADC,SAAA;AAAS,GARC,eASX,WAAA,QAAA,CAAA;AAOA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAfhB,eAgBX,WAAA,WAAA,CAAA;AAhBW,iBAAN,gBAAA;AAAA,EADN,cAAc,eAAe;AAAA,GACjB,cAAA;"}
|
|
@@ -5,7 +5,8 @@ declare global {
|
|
|
5
5
|
'mid-phone-input': MinidPhoneInput;
|
|
6
6
|
}
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
type PhoneAutocomplete = 'tel' | 'tel-national';
|
|
9
|
+
declare const MinidPhoneInput_base: import('../types/mixin-constructor.js').Constructor<import('../types/form-control.js').FormControlInterface> & typeof LitElement;
|
|
9
10
|
/**
|
|
10
11
|
* @event {Event} mid-country-click - Emitted when the country button is clicked
|
|
11
12
|
* @event {Event} mid-change - Emitted when the value is modified by the user
|
|
@@ -55,6 +56,15 @@ export declare class MinidPhoneInput extends MinidPhoneInput_base {
|
|
|
55
56
|
* The country selected. A two letter ISO country code like: `"NO"`
|
|
56
57
|
*/
|
|
57
58
|
country?: CountryCode;
|
|
59
|
+
/**
|
|
60
|
+
* Controls the native browser autofill token used for the phone number input.
|
|
61
|
+
*
|
|
62
|
+
* `tel` expects a full phone number, including country code when available.
|
|
63
|
+
* If a value without a country code matches the selected country, the country
|
|
64
|
+
* prefix is added.
|
|
65
|
+
* `tel-national` expects the national number and prefixes the selected country.
|
|
66
|
+
*/
|
|
67
|
+
autocomplete: PhoneAutocomplete;
|
|
58
68
|
/**
|
|
59
69
|
* Activates invalid styling
|
|
60
70
|
*/
|
|
@@ -72,7 +82,7 @@ export declare class MinidPhoneInput extends MinidPhoneInput_base {
|
|
|
72
82
|
*/
|
|
73
83
|
readonly: boolean;
|
|
74
84
|
hasFocus: boolean;
|
|
75
|
-
static get formControlValidators(): import('../types/validator.type').Validator[];
|
|
85
|
+
static get formControlValidators(): import('../types/validator.type.js').Validator[];
|
|
76
86
|
constructor();
|
|
77
87
|
get validationTarget(): HTMLInputElement;
|
|
78
88
|
validationMessageCallback(message: string): void;
|
|
@@ -86,13 +96,15 @@ export declare class MinidPhoneInput extends MinidPhoneInput_base {
|
|
|
86
96
|
private handleChange;
|
|
87
97
|
private handleKeydown;
|
|
88
98
|
private handleInput;
|
|
99
|
+
private getCountryCodePrefix;
|
|
100
|
+
private applyAutocompletePrefix;
|
|
89
101
|
private handleNewValue;
|
|
90
102
|
private valueChangeCallback;
|
|
91
103
|
private handleFocus;
|
|
92
104
|
private removePhonePrefix;
|
|
93
105
|
focus(options?: FocusOptions): void;
|
|
94
106
|
handleCountryChange(): void;
|
|
95
|
-
render(): import('lit
|
|
107
|
+
render(): import('lit').TemplateResult<1>;
|
|
96
108
|
}
|
|
97
109
|
export {};
|
|
98
110
|
//# sourceMappingURL=phone-input.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.component.d.ts","sourceRoot":"","sources":["../../src/components/phone-input.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAW,MAAM,KAAK,CAA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DAE/B;;IAUD,IAAI,gBAAgB,qBAEnB;IAED,yBAAyB,CAAC,OAAO,EAAE,MAAM;IAIzC,gBAAgB;IAIhB,kBAAkB;IAMlB,oBAAoB,CAAC,KAAK,EAAE,aAAa;IAQzC,iBAAiB,IAAI,IAAI;IAmBzB,IAAI,aAAa,yCAEhB;IAED,IAAI,cAAc,0CAEjB;IAED,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;IAiCrB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,oBAAoB;IAQ5B,OAAO,CAAC,uBAAuB;IAsB/B,OAAO,CAAC,cAAc;IAiBtB,OAAO,CAAC,mBAAmB,CAqBzB;IAEF,OAAO,CAAC,WAAW;IAOnB,OAAO,CAAC,iBAAiB;IAUzB,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAKnC,mBAAmB;IAmBV,MAAM;CAmHhB"}
|
|
@@ -3,13 +3,16 @@ import { query, property, state, customElement } from "lit/decorators.js";
|
|
|
3
3
|
import { classMap } from "lit/directives/class-map.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
|
5
5
|
import { styled } from "../mixins/tailwind.mixin.js";
|
|
6
|
-
import { AsYouType, getCountryCallingCode, formatIncompletePhoneNumber, parsePhoneNumberCharacter } from "libphonenumber-js";
|
|
6
|
+
import { AsYouType, getCountryCallingCode, formatIncompletePhoneNumber, parsePhoneNumberCharacter, parsePhoneNumberFromString } from "libphonenumber-js";
|
|
7
7
|
import "./icon/icon.js";
|
|
8
8
|
import { templateParser, templateFormatter, onKeyDown, onChange } from "input-format";
|
|
9
9
|
import { watch } from "../internal/watch.js";
|
|
10
10
|
import { HasSlotController } from "../internal/slot.js";
|
|
11
11
|
import { FormControlMixin } from "../mixins/form-control.mixin.js";
|
|
12
12
|
import { requiredValidator } from "../mixins/validators.js";
|
|
13
|
+
import { L as LangController } from "../lang.controller-P4W-9ipy.js";
|
|
14
|
+
import { getLang } from "../utilities/lang.js";
|
|
15
|
+
import { getTranslations } from "../utilities/translations.js";
|
|
13
16
|
var __defProp = Object.defineProperty;
|
|
14
17
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
18
|
var __decorateClass = (decorators, target, key, kind) => {
|
|
@@ -44,6 +47,7 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
44
47
|
this.countrycode = "";
|
|
45
48
|
this.label = "";
|
|
46
49
|
this.hidelabel = false;
|
|
50
|
+
this.autocomplete = "tel";
|
|
47
51
|
this.invalid = false;
|
|
48
52
|
this.invalidmessage = "";
|
|
49
53
|
this.required = false;
|
|
@@ -63,6 +67,7 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
63
67
|
}
|
|
64
68
|
this.dispatchEvent(this.currentEvent);
|
|
65
69
|
};
|
|
70
|
+
new LangController(this);
|
|
66
71
|
nextUniqueId++;
|
|
67
72
|
this.inputId = `mid-phone-input-input-${nextUniqueId}`;
|
|
68
73
|
this.validationId = `mid-phone-input-validation-${nextUniqueId}`;
|
|
@@ -152,11 +157,32 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
152
157
|
});
|
|
153
158
|
this.handleNewValue(event);
|
|
154
159
|
}
|
|
160
|
+
getCountryCodePrefix() {
|
|
161
|
+
if (this.country) {
|
|
162
|
+
return `+${getCountryCallingCode(this.country)}`;
|
|
163
|
+
}
|
|
164
|
+
return this.countrycode;
|
|
165
|
+
}
|
|
166
|
+
applyAutocompletePrefix(value) {
|
|
167
|
+
if (value.startsWith("+")) {
|
|
168
|
+
return value;
|
|
169
|
+
}
|
|
170
|
+
const countryCodePrefix = this.getCountryCodePrefix();
|
|
171
|
+
if (this.autocomplete === "tel-national" && countryCodePrefix) {
|
|
172
|
+
return `${countryCodePrefix}${value}`;
|
|
173
|
+
}
|
|
174
|
+
if (this.autocomplete === "tel" && this.country) {
|
|
175
|
+
const phoneNumber = parsePhoneNumberFromString(value, this.country);
|
|
176
|
+
const valueWithPlus = `+${value.replaceAll(/\D/g, "")}`;
|
|
177
|
+
if (phoneNumber?.isValid() && phoneNumber.number !== valueWithPlus) {
|
|
178
|
+
return phoneNumber.number;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return `+${value}`;
|
|
182
|
+
}
|
|
155
183
|
handleNewValue(event) {
|
|
156
184
|
this.formatter.reset();
|
|
157
|
-
|
|
158
|
-
this.input.value = `+${this.input.value}`;
|
|
159
|
-
}
|
|
185
|
+
this.input.value = this.applyAutocompletePrefix(this.input.value);
|
|
160
186
|
this.formatter.input(this.input.value);
|
|
161
187
|
this.currentTemplate = this.formatter.getTemplate();
|
|
162
188
|
onChange(
|
|
@@ -203,6 +229,8 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
203
229
|
const lg = false;
|
|
204
230
|
const md = true;
|
|
205
231
|
const sm = false;
|
|
232
|
+
const lang = getLang(this);
|
|
233
|
+
const t = getTranslations(lang);
|
|
206
234
|
const hasLabelSlot = this.hasSlotControler.test("label");
|
|
207
235
|
const hasLabel = !!this.label || !!hasLabelSlot;
|
|
208
236
|
const hasError = this.invalid || !!this.invalidmessage;
|
|
@@ -238,7 +266,7 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
238
266
|
<div part="base" class="flex h-12">
|
|
239
267
|
<button
|
|
240
268
|
part="country-button"
|
|
241
|
-
aria-label
|
|
269
|
+
aria-label=${t.openCountrySelector}
|
|
242
270
|
class="${classMap({
|
|
243
271
|
"border-neutral": !this.readonly,
|
|
244
272
|
"border-neutral-subtle": this.readonly,
|
|
@@ -276,7 +304,7 @@ let MinidPhoneInput = class extends FormControlMixin(
|
|
|
276
304
|
})} focus-visible:focus-ring grow rounded-r px-3"
|
|
277
305
|
part="phone-number"
|
|
278
306
|
type="tel"
|
|
279
|
-
autocomplete
|
|
307
|
+
autocomplete=${this.autocomplete}
|
|
280
308
|
?readonly=${this.readonly}
|
|
281
309
|
value=${this.value}
|
|
282
310
|
aria-describedby=${ifDefined(describedBy)}
|
|
@@ -328,6 +356,9 @@ __decorateClass([
|
|
|
328
356
|
__decorateClass([
|
|
329
357
|
property({ reflect: true })
|
|
330
358
|
], MinidPhoneInput.prototype, "country", 2);
|
|
359
|
+
__decorateClass([
|
|
360
|
+
property()
|
|
361
|
+
], MinidPhoneInput.prototype, "autocomplete", 2);
|
|
331
362
|
__decorateClass([
|
|
332
363
|
property({ type: Boolean })
|
|
333
364
|
], MinidPhoneInput.prototype, "invalid", 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.js","sources":["../../src/components/phone-input.component.ts"],"sourcesContent":["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styled } from '../mixins/tailwind.mixin';\nimport {\n AsYouType,\n formatIncompletePhoneNumber,\n getCountryCallingCode,\n type CountryCode,\n parsePhoneNumberCharacter,\n} from 'libphonenumber-js';\nimport './icon/icon.component';\nimport {\n onChange,\n onKeyDown,\n templateFormatter,\n templateParser,\n} from 'input-format';\nimport { watch } from '../internal/watch';\nimport { HasSlotController } from '../internal/slot';\nimport { FormControlMixin } from '../mixins/form-control.mixin';\nimport { requiredValidator } from '../mixins/validators';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-phone-input': MinidPhoneInput;\n }\n}\n\nconst styles = [\n css`\n :host {\n display: block;\n }\n `,\n];\n\nlet nextUniqueId = 0;\n\n/**\n * @event {Event} mid-country-click - Emitted when the country button is clicked\n * @event {Event} mid-change - Emitted when the value is modified by the user\n * @event {Event} mid-input - Emitted after a new user input\n * @event {Event} mid-blur - Emitted after focus is moved away from input\n * @event {Event} mid-focus - Emitted after input gains focus\n *\n * @part base - Select the container outside the country button and phone number input\n * @part field - Select the container around the label and the inputs\n * @part label - Select the label element\n * @part country-button - Select the country button\n * @part input - Select the phone number input\n */\n@customElement('mid-phone-input')\nexport class MinidPhoneInput extends FormControlMixin(\n styled(LitElement, styles)\n) {\n private readonly inputId: string;\n private readonly validationId: string;\n private readonly labelId = `mid-code-input-label-${nextUniqueId++}`;\n private formatter = new AsYouType();\n private skipCountryUpdate = false; // avoids unwanted update loop\n private currentEvent = new Event(''); // the event to be emitted after value is set\n private currentTemplate = '';\n private hasSlotControler = new HasSlotController(this, 'label');\n\n @query('input')\n input!: HTMLInputElement;\n\n /**\n * The value of the phone number in E.164 format. Example: `\"+4799999999\"`\n *\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * The phone number without the country code prefix. Example: `\"99999999\"`\n */\n @property({ reflect: true })\n nationalnumber = '';\n\n /**\n * The country code of the current phone number value. Example: `\"+47\"`\n */\n @property({ reflect: true })\n countrycode = '';\n\n /**\n * Label for the phone input.\n * Passed label will be encapsulated by a label element.\n */\n @property()\n label = '';\n\n /**\n * Hide label visually. Still available for screen readers\n */\n @property({ type: Boolean })\n hidelabel = false;\n\n /**\n * The country selected. A two letter ISO country code like: `\"NO\"`\n */\n @property({ reflect: true })\n country?: CountryCode;\n\n /**\n * Activates invalid styling\n */\n @property({ type: Boolean })\n invalid = false;\n\n /**\n * Error message to display when the input is invalid, also activates invalid styling\n */\n @property()\n invalidmessage = '';\n\n /**\n * Makes the input required\n */\n @property({ type: Boolean })\n required = false;\n\n /**\n * Makes the input read-only, meaning the user cannot change the value.\n */\n @property({ type: Boolean })\n readonly = false;\n\n @state()\n hasFocus = false;\n\n static get formControlValidators() {\n return [requiredValidator];\n }\n\n constructor() {\n super();\n nextUniqueId++;\n this.inputId = `mid-phone-input-input-${nextUniqueId}`;\n this.validationId = `mid-phone-input-validation-${nextUniqueId}`;\n }\n\n get validationTarget() {\n return this.input;\n }\n\n validationMessageCallback(message: string) {\n this.invalidmessage = message;\n }\n\n resetFormControl() {\n this.invalidmessage = '';\n }\n\n handleCountryClick() {\n this.dispatchEvent(\n new CustomEvent('mid-country-click', { composed: true, bubbles: true })\n );\n }\n\n handleCountryKeyDown(event: KeyboardEvent) {\n if ([' ', 'Enter'].includes(event.key)) {\n this.dispatchEvent(\n new CustomEvent('mid-country-click', { composed: true, bubbles: true })\n );\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.formatter.input(this.value);\n this.country = this.formatter.getCountry() ?? this.country;\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n\n this.value = formatIncompletePhoneNumber(this.value);\n this.value ||= this.countrycode;\n this.nationalnumber = this.removePhonePrefix(this.value);\n this.setValue(this.value.replaceAll(' ', ''));\n\n setTimeout(() => {\n this.input.value = `${this.countrycode} ${this.nationalnumber}`;\n });\n }\n\n get parseTemplate() {\n return templateParser(this.currentTemplate, parsePhoneNumberCharacter);\n }\n\n get formatTemplate() {\n return templateFormatter(this.currentTemplate);\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.dispatchEvent(\n new Event('mid-blur', { bubbles: true, composed: true })\n );\n }\n\n private handleChange(event: Event) {\n // Event is dispatched after value is set\n this.currentEvent = new Event('mid-change', {\n bubbles: true,\n composed: true,\n });\n\n this.handleNewValue(event);\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && this.input.selectionStart === 1) {\n // don't remove '+' symbol which is the first character\n event.preventDefault();\n return;\n }\n\n const hasModifier =\n event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n\n // Pressing enter when focused on an input should submit the form like a native input, but we wait a tick before\n // submitting to allow users to cancel the keydown event if they need to\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n //\n // When using an Input Method Editor (IME), pressing enter will cause the form to submit unexpectedly. One way\n // to check for this is to look at event.isComposing, which will be true when the IME is open.\n if (!event.defaultPrevented && !event.isComposing) {\n this.form.requestSubmit();\n }\n });\n return;\n }\n\n onKeyDown(\n event as any,\n this.input,\n this.parseTemplate,\n this.formatTemplate,\n this.valueChangeCallback\n );\n }\n\n private handleInput(event: InputEvent) {\n // Event is dispatched after value is set\n this.currentEvent = new Event('mid-input', {\n composed: true,\n bubbles: true,\n });\n this.handleNewValue(event);\n }\n\n private handleNewValue(event: Event) {\n this.formatter.reset();\n\n if (!this.input.value.startsWith('+')) {\n this.input.value = `+${this.input.value}`;\n }\n this.formatter.input(this.input.value);\n this.currentTemplate = this.formatter.getTemplate();\n\n onChange(\n event as any,\n this.input,\n this.parseTemplate,\n this.formatTemplate,\n this.valueChangeCallback\n );\n }\n\n private valueChangeCallback = (value: string) => {\n const country =\n value.length < 2\n ? undefined\n : (this.formatter.getCountry() ?? this.country);\n\n if (country !== this.country) {\n this.country = country;\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n this.skipCountryUpdate = true;\n }\n\n if (value !== this.value) {\n this.value = value;\n this.setValue(this.value.replaceAll(' ', ''));\n this.nationalnumber = this.removePhonePrefix(value);\n }\n\n this.dispatchEvent(this.currentEvent);\n };\n\n private handleFocus() {\n this.hasFocus = true;\n this.dispatchEvent(\n new Event('mid-focus', { composed: true, bubbles: true })\n );\n }\n\n private removePhonePrefix(value: string) {\n if (this.countrycode) {\n value = value.slice(this.countrycode.length);\n if (value[0] === ' ') {\n value = value.slice(1);\n }\n }\n return value;\n }\n\n focus(options?: FocusOptions): void {\n this.input.focus(options);\n }\n\n @watch('country', { waitUntilFirstUpdate: true })\n handleCountryChange() {\n if (this.skipCountryUpdate) {\n this.skipCountryUpdate = false;\n return;\n }\n\n this.formatter = new AsYouType(this.country);\n this.nationalnumber = this.removePhonePrefix(this.input.value);\n\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n this.input.value = formatIncompletePhoneNumber(\n `${this.countrycode}${this.nationalnumber}`\n );\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n override render() {\n const lg = false;\n const md = true;\n const sm = false;\n\n const hasLabelSlot = this.hasSlotControler.test('label');\n const hasLabel = !!this.label || !!hasLabelSlot;\n const hasError = this.invalid || !!this.invalidmessage;\n const describedBy = this.invalidmessage ? this.validationId : undefined;\n\n return html`\n <label\n id=\"${this.labelId}\"\n class=\"${classMap({\n 'sr-only': this.hidelabel || !hasLabel,\n })} mb-2 block items-center gap-1 font-medium\"\n > \n <div\n part=\"field\"\n class=\"${classMap({\n 'text-body-sm': sm,\n 'text-body-md': md,\n 'text-body-lg': lg,\n })}\"\n >\n <label\n for=\"${this.inputId}\"\n class=\"${classMap({\n 'sr-only': this.hidelabel || !hasLabel,\n })} mb-2 inline-flex items-center gap-1 font-medium\"\n >\n ${this.readonly\n ? html`<mid-icon\n class=\"size-5\"\n library=\"system\"\n name=\"padlock-locked-fill\"\n ></mid-icon>`\n : nothing}\n <slot name=\"label\"> ${this.label} </slot>\n </label>\n <div part=\"base\" class=\"flex h-12\">\n <button\n part=\"country-button\"\n aria-label=\"Open country selector\"\n class=\"${classMap({\n 'border-neutral': !this.readonly,\n 'border-neutral-subtle': this.readonly,\n 'bg-neutral-surface-tinted': this.readonly,\n 'bg-neutral-surface': !this.readonly,\n })} focus-visible:focus-ring flex h-full items-center rounded-l border border-r-0 pl-3\"\n iconstyled\n variant=\"tertiary\"\n ?disabled=${this.readonly}\n @click=${this.handleCountryClick}\n @keydown=${this.handleCountryKeyDown}\n >\n ${this.country\n ? html`\n <mid-icon\n class=\"h-4 w-6 overflow-hidden rounded\"\n library=\"country\"\n name=\"${this.country}\"\n ></mid-icon>\n `\n : html`<div\n class=\"bg-neutral-surface-active h-4 w-6 overflow-hidden rounded\"\n ></div>`}\n <mid-icon name=\"chevron-down\"></mid-icon>\n </button>\n\n <input\n id=\"${this.inputId}\"\n class=\"${classMap({\n 'border-neutral': !hasError && !this.readonly,\n 'border-danger': hasError && !this.readonly,\n 'border-neutral-subtle': this.readonly,\n 'bg-neutral-surface-tinted': this.readonly,\n 'bg-neutral-surface': !this.readonly,\n 'border-2': hasError,\n border: !hasError,\n })} focus-visible:focus-ring grow rounded-r px-3\"\n part=\"phone-number\"\n type=\"tel\"\n autocomplete=\"tel\"\n ?readonly=${this.readonly}\n value=${this.value}\n aria-describedby=${ifDefined(describedBy)}\n aria-invalid=${hasError ? 'true' : 'false'}\n aria-errormessage=${ifDefined(\n this.invalidmessage ? this.validationId : undefined\n )}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @keydown=${this.handleKeydown}\n @change=${this.handleChange}\n />\n </div>\n <div\n class=\"text-danger-subtle mt-2 flex gap-1\"\n id=\"${this.validationId}\"\n aria-live=\"polite\"\n ?hidden=${!this.invalidmessage}\n >\n <mid-icon\n name=\"xmark-octagon-fill\"\n class=\"mt-1 min-h-5 min-w-5\"\n ></mid-icon>\n ${this.invalidmessage}\n </div>\n </div>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,SAAS;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAKF;AAEA,IAAI,eAAe;AAgBZ,IAAM,kBAAN,cAA8B;AAAA,EACnC,OAAO,YAAY,MAAM;AAC3B,EAAE;AAAA,EAkFA,cAAc;AACZ,UAAA;AAhFF,SAAiB,UAAU,wBAAwB,cAAc;AACjE,SAAQ,YAAY,IAAI,UAAA;AACxB,SAAQ,oBAAoB;AAC5B,SAAQ,eAAe,IAAI,MAAM,EAAE;AACnC,SAAQ,kBAAkB;AAC1B,SAAQ,mBAAmB,IAAI,kBAAkB,MAAM,OAAO;AAU9D,SAAA,QAAQ;AAMR,SAAA,iBAAiB;AAMjB,SAAA,cAAc;AAOd,SAAA,QAAQ;AAMR,SAAA,YAAY;AAYZ,SAAA,UAAU;AAMV,SAAA,iBAAiB;AAMjB,SAAA,WAAW;AAMX,SAAA,WAAW;AAGX,SAAA,WAAW;AA+IX,SAAQ,sBAAsB,CAAC,UAAkB;AAC/C,YAAM,UACJ,MAAM,SAAS,IACX,SACC,KAAK,UAAU,gBAAgB,KAAK;AAE3C,UAAI,YAAY,KAAK,SAAS;AAC5B,aAAK,UAA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AA,aAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAS,EAAE,SAAS,KAAA,CAAM;AAAA,GAlDhB,gBAmDX,WAAA,WAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GAxDhB,gBAyDX,WAAA,WAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAA;AAAS,GA9DC,gBA+DX,WAAA,kBAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GApEhB,gBAqEX,WAAA,YAAA,CAAA;AAMA,gBAAA;AAAA,EADC,SAAS,EAAE,MAAM,QAAA,CAAS;AAAA,GA1EhB,gBA2EX,WAAA,YAAA,CAAA;AAGA,gBAAA;AAAA,EADC,MAAA;AAAM,GA7EI,gBA8EX,WAAA,YAAA,CAAA;AA4LA,gBAAA;AAAA,EADC,MAAM,WAAW,EAAE,sBAAsB,MAAM;AAAA,GAzQrC,gBA0QX,WAAA,uBAAA,CAAA;AA1QW,kBAAN,gBAAA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,eAAA;"}
|
|
1
|
+
{"version":3,"file":"phone-input.js","sources":["../../src/components/phone-input.component.ts"],"sourcesContent":["import { css, html, LitElement, nothing } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { styled } from '../mixins/tailwind.mixin';\nimport {\n AsYouType,\n formatIncompletePhoneNumber,\n getCountryCallingCode,\n type CountryCode,\n parsePhoneNumberFromString,\n parsePhoneNumberCharacter,\n} from 'libphonenumber-js';\nimport './icon/icon.component';\nimport {\n onChange,\n onKeyDown,\n templateFormatter,\n templateParser,\n} from 'input-format';\nimport { watch } from '../internal/watch';\nimport { HasSlotController } from '../internal/slot';\nimport { FormControlMixin } from '../mixins/form-control.mixin';\nimport { requiredValidator } from '../mixins/validators';\nimport { LangController } from '../controllers/lang.controller.js';\nimport { getLang } from '../utilities/lang';\nimport { getTranslations } from '../utilities/translations';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'mid-phone-input': MinidPhoneInput;\n }\n}\n\ntype PhoneAutocomplete = 'tel' | 'tel-national';\n\nconst styles = [\n css`\n :host {\n display: block;\n }\n `,\n];\n\nlet nextUniqueId = 0;\n\n/**\n * @event {Event} mid-country-click - Emitted when the country button is clicked\n * @event {Event} mid-change - Emitted when the value is modified by the user\n * @event {Event} mid-input - Emitted after a new user input\n * @event {Event} mid-blur - Emitted after focus is moved away from input\n * @event {Event} mid-focus - Emitted after input gains focus\n *\n * @part base - Select the container outside the country button and phone number input\n * @part field - Select the container around the label and the inputs\n * @part label - Select the label element\n * @part country-button - Select the country button\n * @part input - Select the phone number input\n */\n@customElement('mid-phone-input')\nexport class MinidPhoneInput extends FormControlMixin(\n styled(LitElement, styles)\n) {\n private readonly inputId: string;\n private readonly validationId: string;\n private readonly labelId = `mid-code-input-label-${nextUniqueId++}`;\n private formatter = new AsYouType();\n private skipCountryUpdate = false; // avoids unwanted update loop\n private currentEvent = new Event(''); // the event to be emitted after value is set\n private currentTemplate = '';\n private hasSlotControler = new HasSlotController(this, 'label');\n\n @query('input')\n input!: HTMLInputElement;\n\n /**\n * The value of the phone number in E.164 format. Example: `\"+4799999999\"`\n *\n */\n @property({ reflect: true })\n value = '';\n\n /**\n * The phone number without the country code prefix. Example: `\"99999999\"`\n */\n @property({ reflect: true })\n nationalnumber = '';\n\n /**\n * The country code of the current phone number value. Example: `\"+47\"`\n */\n @property({ reflect: true })\n countrycode = '';\n\n /**\n * Label for the phone input.\n * Passed label will be encapsulated by a label element.\n */\n @property()\n label = '';\n\n /**\n * Hide label visually. Still available for screen readers\n */\n @property({ type: Boolean })\n hidelabel = false;\n\n /**\n * The country selected. A two letter ISO country code like: `\"NO\"`\n */\n @property({ reflect: true })\n country?: CountryCode;\n\n /**\n * Controls the native browser autofill token used for the phone number input.\n *\n * `tel` expects a full phone number, including country code when available.\n * If a value without a country code matches the selected country, the country\n * prefix is added.\n * `tel-national` expects the national number and prefixes the selected country.\n */\n @property()\n autocomplete: PhoneAutocomplete = 'tel';\n\n /**\n * Activates invalid styling\n */\n @property({ type: Boolean })\n invalid = false;\n\n /**\n * Error message to display when the input is invalid, also activates invalid styling\n */\n @property()\n invalidmessage = '';\n\n /**\n * Makes the input required\n */\n @property({ type: Boolean })\n required = false;\n\n /**\n * Makes the input read-only, meaning the user cannot change the value.\n */\n @property({ type: Boolean })\n readonly = false;\n\n @state()\n hasFocus = false;\n\n static get formControlValidators() {\n return [requiredValidator];\n }\n\n constructor() {\n super();\n new LangController(this);\n nextUniqueId++;\n this.inputId = `mid-phone-input-input-${nextUniqueId}`;\n this.validationId = `mid-phone-input-validation-${nextUniqueId}`;\n }\n\n get validationTarget() {\n return this.input;\n }\n\n validationMessageCallback(message: string) {\n this.invalidmessage = message;\n }\n\n resetFormControl() {\n this.invalidmessage = '';\n }\n\n handleCountryClick() {\n this.dispatchEvent(\n new CustomEvent('mid-country-click', { composed: true, bubbles: true })\n );\n }\n\n handleCountryKeyDown(event: KeyboardEvent) {\n if ([' ', 'Enter'].includes(event.key)) {\n this.dispatchEvent(\n new CustomEvent('mid-country-click', { composed: true, bubbles: true })\n );\n }\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.formatter.input(this.value);\n this.country = this.formatter.getCountry() ?? this.country;\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n\n this.value = formatIncompletePhoneNumber(this.value);\n this.value ||= this.countrycode;\n this.nationalnumber = this.removePhonePrefix(this.value);\n this.setValue(this.value.replaceAll(' ', ''));\n\n setTimeout(() => {\n this.input.value = `${this.countrycode} ${this.nationalnumber}`;\n });\n }\n\n get parseTemplate() {\n return templateParser(this.currentTemplate, parsePhoneNumberCharacter);\n }\n\n get formatTemplate() {\n return templateFormatter(this.currentTemplate);\n }\n\n private handleBlur() {\n this.hasFocus = false;\n this.dispatchEvent(\n new Event('mid-blur', { bubbles: true, composed: true })\n );\n }\n\n private handleChange(event: Event) {\n // Event is dispatched after value is set\n this.currentEvent = new Event('mid-change', {\n bubbles: true,\n composed: true,\n });\n\n this.handleNewValue(event);\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (event.key === 'Backspace' && this.input.selectionStart === 1) {\n // don't remove '+' symbol which is the first character\n event.preventDefault();\n return;\n }\n\n const hasModifier =\n event.metaKey || event.ctrlKey || event.shiftKey || event.altKey;\n\n // Pressing enter when focused on an input should submit the form like a native input, but we wait a tick before\n // submitting to allow users to cancel the keydown event if they need to\n if (event.key === 'Enter' && !hasModifier) {\n setTimeout(() => {\n //\n // When using an Input Method Editor (IME), pressing enter will cause the form to submit unexpectedly. One way\n // to check for this is to look at event.isComposing, which will be true when the IME is open.\n if (!event.defaultPrevented && !event.isComposing) {\n this.form.requestSubmit();\n }\n });\n return;\n }\n\n onKeyDown(\n event as any,\n this.input,\n this.parseTemplate,\n this.formatTemplate,\n this.valueChangeCallback\n );\n }\n\n private handleInput(event: InputEvent) {\n // Event is dispatched after value is set\n this.currentEvent = new Event('mid-input', {\n composed: true,\n bubbles: true,\n });\n this.handleNewValue(event);\n }\n\n private getCountryCodePrefix() {\n if (this.country) {\n return `+${getCountryCallingCode(this.country)}`;\n }\n\n return this.countrycode;\n }\n\n private applyAutocompletePrefix(value: string) {\n if (value.startsWith('+')) {\n return value;\n }\n\n const countryCodePrefix = this.getCountryCodePrefix();\n if (this.autocomplete === 'tel-national' && countryCodePrefix) {\n return `${countryCodePrefix}${value}`;\n }\n\n if (this.autocomplete === 'tel' && this.country) {\n const phoneNumber = parsePhoneNumberFromString(value, this.country);\n const valueWithPlus = `+${value.replaceAll(/\\D/g, '')}`;\n\n if (phoneNumber?.isValid() && phoneNumber.number !== valueWithPlus) {\n return phoneNumber.number;\n }\n }\n\n return `+${value}`;\n }\n\n private handleNewValue(event: Event) {\n this.formatter.reset();\n\n this.input.value = this.applyAutocompletePrefix(this.input.value);\n\n this.formatter.input(this.input.value);\n this.currentTemplate = this.formatter.getTemplate();\n\n onChange(\n event as any,\n this.input,\n this.parseTemplate,\n this.formatTemplate,\n this.valueChangeCallback\n );\n }\n\n private valueChangeCallback = (value: string) => {\n const country =\n value.length < 2\n ? undefined\n : (this.formatter.getCountry() ?? this.country);\n\n if (country !== this.country) {\n this.country = country;\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n this.skipCountryUpdate = true;\n }\n\n if (value !== this.value) {\n this.value = value;\n this.setValue(this.value.replaceAll(' ', ''));\n this.nationalnumber = this.removePhonePrefix(value);\n }\n\n this.dispatchEvent(this.currentEvent);\n };\n\n private handleFocus() {\n this.hasFocus = true;\n this.dispatchEvent(\n new Event('mid-focus', { composed: true, bubbles: true })\n );\n }\n\n private removePhonePrefix(value: string) {\n if (this.countrycode) {\n value = value.slice(this.countrycode.length);\n if (value[0] === ' ') {\n value = value.slice(1);\n }\n }\n return value;\n }\n\n focus(options?: FocusOptions): void {\n this.input.focus(options);\n }\n\n @watch('country', { waitUntilFirstUpdate: true })\n handleCountryChange() {\n if (this.skipCountryUpdate) {\n this.skipCountryUpdate = false;\n return;\n }\n\n this.formatter = new AsYouType(this.country);\n this.nationalnumber = this.removePhonePrefix(this.input.value);\n\n this.countrycode = this.country\n ? `+${getCountryCallingCode(this.country)}`\n : '+';\n this.input.value = formatIncompletePhoneNumber(\n `${this.countrycode}${this.nationalnumber}`\n );\n this.input.dispatchEvent(new Event('input', { bubbles: true }));\n this.input.dispatchEvent(new Event('change', { bubbles: true }));\n }\n\n override render() {\n const lg = false;\n const md = true;\n const sm = false;\n\n const lang = getLang(this);\n const t = getTranslations(lang);\n const hasLabelSlot = this.hasSlotControler.test('label');\n const hasLabel = !!this.label || !!hasLabelSlot;\n const hasError = this.invalid || !!this.invalidmessage;\n const describedBy = this.invalidmessage ? this.validationId : undefined;\n\n return html`\n <label\n id=\"${this.labelId}\"\n class=\"${classMap({\n 'sr-only': this.hidelabel || !hasLabel,\n })} mb-2 block items-center gap-1 font-medium\"\n > \n <div\n part=\"field\"\n class=\"${classMap({\n 'text-body-sm': sm,\n 'text-body-md': md,\n 'text-body-lg': lg,\n })}\"\n >\n <label\n for=\"${this.inputId}\"\n class=\"${classMap({\n 'sr-only': this.hidelabel || !hasLabel,\n })} mb-2 inline-flex items-center gap-1 font-medium\"\n >\n ${this.readonly\n ? html`<mid-icon\n class=\"size-5\"\n library=\"system\"\n name=\"padlock-locked-fill\"\n ></mid-icon>`\n : nothing}\n <slot name=\"label\"> ${this.label} </slot>\n </label>\n <div part=\"base\" class=\"flex h-12\">\n <button\n part=\"country-button\"\n aria-label=${t.openCountrySelector}\n class=\"${classMap({\n 'border-neutral': !this.readonly,\n 'border-neutral-subtle': this.readonly,\n 'bg-neutral-surface-tinted': this.readonly,\n 'bg-neutral-surface': !this.readonly,\n })} focus-visible:focus-ring flex h-full items-center rounded-l border border-r-0 pl-3\"\n iconstyled\n variant=\"tertiary\"\n ?disabled=${this.readonly}\n @click=${this.handleCountryClick}\n @keydown=${this.handleCountryKeyDown}\n >\n ${this.country\n ? html`\n <mid-icon\n class=\"h-4 w-6 overflow-hidden rounded\"\n library=\"country\"\n name=\"${this.country}\"\n ></mid-icon>\n `\n : html`<div\n class=\"bg-neutral-surface-active h-4 w-6 overflow-hidden rounded\"\n ></div>`}\n <mid-icon name=\"chevron-down\"></mid-icon>\n </button>\n\n <input\n id=\"${this.inputId}\"\n class=\"${classMap({\n 'border-neutral': !hasError && !this.readonly,\n 'border-danger': hasError && !this.readonly,\n 'border-neutral-subtle': this.readonly,\n 'bg-neutral-surface-tinted': this.readonly,\n 'bg-neutral-surface': !this.readonly,\n 'border-2': hasError,\n border: !hasError,\n })} focus-visible:focus-ring grow rounded-r px-3\"\n part=\"phone-number\"\n type=\"tel\"\n autocomplete=${this.autocomplete}\n ?readonly=${this.readonly}\n value=${this.value}\n aria-describedby=${ifDefined(describedBy)}\n aria-invalid=${hasError ? 'true' : 'false'}\n aria-errormessage=${ifDefined(\n this.invalidmessage ? this.validationId : undefined\n )}\n @input=${this.handleInput}\n @focus=${this.handleFocus}\n @blur=${this.handleBlur}\n @keydown=${this.handleKeydown}\n @change=${this.handleChange}\n />\n </div>\n <div\n class=\"text-danger-subtle mt-2 flex gap-1\"\n id=\"${this.validationId}\"\n aria-live=\"polite\"\n ?hidden=${!this.invalidmessage}\n >\n <mid-icon\n name=\"xmark-octagon-fill\"\n class=\"mt-1 min-h-5 min-w-5\"\n ></mid-icon>\n ${this.invalidmessage}\n </div>\n </div>\n `;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoCA,MAAM,SAAS;AAAA,EACb;AAAA;AAAA;AAAA;AAAA;AAKF;AAEA,IAAI,eAAe;AAgBZ,IAAM,kBAAN,cAA8B;AAAA,EACnC,OAAO,YAAY,MAAM;AAC3B,EAAE;AAAA,EA6FA,cAAc;AACZ,UAAA;AA3FF,SAAiB,UAAU,wBAAwB,cAAc;AACjE,SAAQ,YAAY,IAAI,UAAA;AACxB,SAAQ,oBAAoB;AAC5B,SAAQ,eAAe,IAAI,MAAM,EAAE;AACnC,SAAQ,kBAAkB;AAC1B,SAAQ,mBAAmB,IAAI,kBAAkB,MAAM,OAAO;AAU9D,SAAA,QAAQ;AAMR,SAAA,iBAAiB;AAMjB,SAAA,cAAc;AAOd,SAAA,QAAQ;AAMR,SAAA,YAAY;AAiBZ,SAAA,eAAkC;AAMlC,SAAA,UAAU;AAMV,SAAA,iBAAiB;AAMjB,SAAA,WAAW;AAMX,SAAA,WAAW;AAGX,SAAA,WAAW;AA6KX,SAAQ,sBAAsB,CAAC,UAAkB;AAC/C,YAAM,UACJ,MAAM,SAAS,IACX,SACC,KAAK,UAAU,gBAAgB,KAAK;AAE3C,UAAI,YAAY,KAAK,SAAS;AAC5B,aAAK,UAAU;AACf,aAAK,cAAc,KAAK,UACpB,IAAI,sBAAsB,KAAK,OAAO,CAAC,KACvC;AACJ,aAAK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gBAAA;AAAA,EADC,MAAM,WAAW,EAAE,sBAAsB,MAAM;AAAA,GAlTrC,gBAmTX,WAAA,uBAAA,CAAA;AAnTW,kBAAN,gBAAA;AAAA,EADN,cAAc,iBAAiB;AAAA,GACnB,eAAA;"}
|
|
@@ -166,7 +166,7 @@ export declare class MinidPopup extends MinidPopup_base {
|
|
|
166
166
|
/** Forces the popup to recalculate and reposition itself. */
|
|
167
167
|
reposition(): void;
|
|
168
168
|
private updateHoverBridge;
|
|
169
|
-
render(): import('lit
|
|
169
|
+
render(): import('lit').TemplateResult<1>;
|
|
170
170
|
}
|
|
171
171
|
export {};
|
|
172
172
|
//# sourceMappingURL=popup.component.d.ts.map
|
|
@@ -35,7 +35,7 @@ export declare class MinidQrCode extends MinidQrCode_base {
|
|
|
35
35
|
background: string;
|
|
36
36
|
margin: number;
|
|
37
37
|
protected updated(): void;
|
|
38
|
-
render(): import('lit
|
|
38
|
+
render(): import('lit').TemplateResult<1>;
|
|
39
39
|
}
|
|
40
40
|
export {};
|
|
41
41
|
//# sourceMappingURL=qr-code.component.d.ts.map
|
|
@@ -46,7 +46,7 @@ export declare class MinidRadioButton extends MinidRadioButton_base {
|
|
|
46
46
|
* Removes focus from the radio button.
|
|
47
47
|
*/
|
|
48
48
|
blur(): void;
|
|
49
|
-
render(): import('lit
|
|
49
|
+
render(): import('lit').TemplateResult<1>;
|
|
50
50
|
}
|
|
51
51
|
export {};
|
|
52
52
|
//# sourceMappingURL=radio-button.component.d.ts.map
|
|
@@ -55,7 +55,7 @@ export declare class MinidRadioGroup extends MinidRadioGroup_base {
|
|
|
55
55
|
* Sets focus on the radio-group.
|
|
56
56
|
*/
|
|
57
57
|
focus(options?: FocusOptions): void;
|
|
58
|
-
render(): import('lit
|
|
58
|
+
render(): import('lit').TemplateResult<1>;
|
|
59
59
|
}
|
|
60
60
|
export {};
|
|
61
61
|
//# sourceMappingURL=radio-group.component.d.ts.map
|