@riverty/web-components 5.8.0 → 6.0.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/CHANGELOG.md +86 -0
- package/custom-elements.json +124 -369
- package/dist/cjs/index-DJ4H_bFj.js +6 -10
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/r-accordion-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-section.cjs.entry.js +1 -1
- package/dist/cjs/r-accordion-trigger.cjs.entry.js +5 -35
- package/dist/cjs/r-accordion.cjs.entry.js +3 -7
- package/dist/cjs/r-alert.cjs.entry.js +26 -11
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -11
- package/dist/cjs/r-checkbox.cjs.entry.js +76 -75
- package/dist/cjs/r-dialog.cjs.entry.js +3 -11
- package/dist/cjs/r-hint_2.cjs.entry.js +50 -0
- package/dist/cjs/{r-hint_3.cjs.entry.js → r-icon-button_2.cjs.entry.js} +64 -51
- package/dist/cjs/r-input-code.cjs.entry.js +112 -17
- package/dist/cjs/r-input-date.cjs.entry.js +8 -14
- package/dist/cjs/r-input-password.cjs.entry.js +16 -8
- package/dist/cjs/r-input-phone-number.cjs.entry.js +7 -12
- package/dist/cjs/r-input.cjs.entry.js +87 -41
- package/dist/cjs/r-list-item.cjs.entry.js +5 -5
- package/dist/cjs/r-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-action.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-content.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-headline.cjs.entry.js +1 -1
- package/dist/cjs/r-popover-trigger.cjs.entry.js +1 -1
- package/dist/cjs/r-popover.cjs.entry.js +3 -3
- package/dist/cjs/r-progress-bar.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-description.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-title.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +1 -1
- package/dist/cjs/r-radio-button.cjs.entry.js +29 -12
- package/dist/cjs/r-radio-group.cjs.entry.js +18 -22
- package/dist/cjs/r-select-option.cjs.entry.js +1 -1
- package/dist/cjs/r-select.cjs.entry.js +6 -24
- package/dist/cjs/r-skip-link.cjs.entry.js +1 -1
- package/dist/cjs/r-stepper-item.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper.cjs.entry.js +1 -1
- package/dist/cjs/r-tab-panel.cjs.entry.js +1 -1
- package/dist/cjs/r-tab.cjs.entry.js +1 -1
- package/dist/cjs/r-tabs-list.cjs.entry.js +1 -1
- package/dist/cjs/r-tabs.cjs.entry.js +1 -1
- package/dist/cjs/r-textarea.cjs.entry.js +6 -18
- package/dist/cjs/r-toast-group.cjs.entry.js +1 -1
- package/dist/cjs/r-toast.cjs.entry.js +9 -9
- package/dist/cjs/web-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +0 -1
- package/dist/collection/components/accordion/accordion.css +0 -2
- package/dist/collection/components/accordion/accordion.js +4 -8
- package/dist/collection/components/accordion/exports.js +1 -1
- package/dist/collection/components/accordion-panel/accordion-panel.js +1 -1
- package/dist/collection/components/accordion-section/accordion-section.js +1 -1
- package/dist/collection/components/accordion-trigger/accordion-trigger.css +0 -4
- package/dist/collection/components/accordion-trigger/accordion-trigger.js +4 -215
- package/dist/collection/components/alert/alert.css +6 -0
- package/dist/collection/components/alert/alert.js +48 -10
- package/dist/collection/components/badge/badge.js +1 -1
- package/dist/collection/components/button/button.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +80 -98
- package/dist/collection/components/checkbox-group/checkbox-group.js +1 -50
- package/dist/collection/components/dialog/dialog.css +1 -3
- package/dist/collection/components/dialog/dialog.js +2 -10
- package/dist/collection/components/hint/hint.js +2 -2
- package/dist/collection/components/icon-button/icon-button.js +3 -3
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +180 -370
- package/dist/collection/components/input-code/exports.js +2 -0
- package/dist/collection/components/input-code/input-code.js +294 -26
- package/dist/collection/components/input-date/input-date.js +8 -77
- package/dist/collection/components/input-password/exports.js +1 -0
- package/dist/collection/components/input-password/input-password.css +1 -0
- package/dist/collection/components/input-password/input-password.js +195 -70
- package/dist/collection/components/input-phone-number/input-phone-number.js +7 -75
- package/dist/collection/components/label/label.js +3 -113
- package/dist/collection/components/list-item/list-item/list-item.css +7 -7
- package/dist/collection/components/list-item/list-item/list-item.js +4 -26
- package/dist/collection/components/panel/panel.js +2 -2
- package/dist/collection/components/popover/exports.js +0 -1
- package/dist/collection/components/popover/popover.css +2 -10
- package/dist/collection/components/popover/popover.js +2 -55
- package/dist/collection/components/popover-action/popover-action.js +1 -1
- package/dist/collection/components/popover-content/popover-content.js +1 -1
- package/dist/collection/components/popover-headline/popover-headline.js +1 -1
- package/dist/collection/components/popover-trigger/popover-trigger.js +1 -1
- package/dist/collection/components/progress-bar/progress-bar.js +1 -1
- package/dist/collection/components/radio-button/radio-button.js +49 -12
- package/dist/collection/components/radio-button-description/radio-button-description.js +1 -1
- package/dist/collection/components/radio-button-leading/radio-button-leading.js +1 -1
- package/dist/collection/components/radio-button-title/radio-button-title.js +1 -1
- package/dist/collection/components/radio-button-trailing/radio-button-trailing.js +1 -1
- package/dist/collection/components/radio-group/radio-group.js +38 -124
- package/dist/collection/components/select/select.js +6 -330
- package/dist/collection/components/select-option/select-option.js +1 -1
- package/dist/collection/components/skip-link/skip-link.js +1 -1
- package/dist/collection/components/stepper/stepper.js +1 -1
- package/dist/collection/components/stepper-item/stepper-item.js +2 -2
- package/dist/collection/components/tab/tab.js +1 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +1 -1
- package/dist/collection/components/tabs-list/tabs-list.js +1 -1
- package/dist/collection/components/textarea/textarea.js +6 -158
- package/dist/collection/components/toast/toast.js +9 -31
- package/dist/collection/components/toast-group/toast-group.js +1 -1
- package/dist/collection/components/tooltip/tooltip.js +1 -1
- package/dist/esm/index-Da7qOBFr.js +6 -10
- package/dist/esm/loader.js +1 -1
- package/dist/esm/r-accordion-panel.entry.js +1 -1
- package/dist/esm/r-accordion-section.entry.js +1 -1
- package/dist/esm/r-accordion-trigger.entry.js +5 -35
- package/dist/esm/r-accordion.entry.js +3 -7
- package/dist/esm/r-alert.entry.js +26 -11
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +1 -1
- package/dist/esm/r-checkbox-group.entry.js +1 -11
- package/dist/esm/r-checkbox.entry.js +76 -75
- package/dist/esm/r-dialog.entry.js +3 -11
- package/dist/esm/r-hint_2.entry.js +47 -0
- package/dist/esm/{r-hint_3.entry.js → r-icon-button_2.entry.js} +65 -51
- package/dist/esm/r-input-code.entry.js +112 -17
- package/dist/esm/r-input-date.entry.js +8 -14
- package/dist/esm/r-input-password.entry.js +16 -8
- package/dist/esm/r-input-phone-number.entry.js +7 -12
- package/dist/esm/r-input.entry.js +87 -41
- package/dist/esm/r-list-item.entry.js +5 -5
- package/dist/esm/r-panel.entry.js +2 -2
- package/dist/esm/r-popover-action.entry.js +1 -1
- package/dist/esm/r-popover-content.entry.js +1 -1
- package/dist/esm/r-popover-headline.entry.js +1 -1
- package/dist/esm/r-popover-trigger.entry.js +1 -1
- package/dist/esm/r-popover.entry.js +3 -3
- package/dist/esm/r-progress-bar.entry.js +1 -1
- package/dist/esm/r-radio-button-description.entry.js +1 -1
- package/dist/esm/r-radio-button-leading.entry.js +1 -1
- package/dist/esm/r-radio-button-title.entry.js +1 -1
- package/dist/esm/r-radio-button-trailing.entry.js +1 -1
- package/dist/esm/r-radio-button.entry.js +29 -12
- package/dist/esm/r-radio-group.entry.js +18 -22
- package/dist/esm/r-select-option.entry.js +1 -1
- package/dist/esm/r-select.entry.js +6 -24
- package/dist/esm/r-skip-link.entry.js +1 -1
- package/dist/esm/r-stepper-item.entry.js +2 -2
- package/dist/esm/r-stepper.entry.js +1 -1
- package/dist/esm/r-tab-panel.entry.js +1 -1
- package/dist/esm/r-tab.entry.js +1 -1
- package/dist/esm/r-tabs-list.entry.js +1 -1
- package/dist/esm/r-tabs.entry.js +1 -1
- package/dist/esm/r-textarea.entry.js +6 -18
- package/dist/esm/r-toast-group.entry.js +1 -1
- package/dist/esm/r-toast.entry.js +9 -9
- package/dist/esm/web-components.js +1 -1
- package/dist/types/components/accordion/accordion.d.ts +1 -5
- package/dist/types/components/accordion/exports.d.ts +1 -1
- package/dist/types/components/accordion-trigger/accordion-trigger.d.ts +0 -36
- package/dist/types/components/alert/alert.d.ts +6 -1
- package/dist/types/components/checkbox/checkbox.d.ts +24 -34
- package/dist/types/components/checkbox-group/checkbox-group.d.ts +0 -11
- package/dist/types/components/dialog/dialog.d.ts +0 -2
- package/dist/types/components/input/input.d.ts +30 -72
- package/dist/types/components/input-code/exports.d.ts +4 -0
- package/dist/types/components/input-code/input-code.d.ts +49 -7
- package/dist/types/components/input-date/input-date.d.ts +0 -16
- package/dist/types/components/input-password/exports.d.ts +1 -0
- package/dist/types/components/input-password/input-password.d.ts +48 -16
- package/dist/types/components/input-phone-number/input-phone-number.d.ts +0 -16
- package/dist/types/components/label/label.d.ts +0 -18
- package/dist/types/components/list-item/list-item/list-item.d.ts +0 -6
- package/dist/types/components/popover/exports.d.ts +0 -2
- package/dist/types/components/popover/popover.d.ts +1 -14
- package/dist/types/components/radio-button/radio-button.d.ts +5 -0
- package/dist/types/components/radio-group/radio-group.d.ts +5 -26
- package/dist/types/components/select/select.d.ts +0 -50
- package/dist/types/components/textarea/textarea.d.ts +0 -32
- package/dist/types/components/toast/toast.d.ts +0 -5
- package/dist/types/components.d.ts +201 -636
- package/dist/web-components/p-0347feff.entry.js +1 -0
- package/dist/web-components/p-05738503.entry.js +1 -0
- package/dist/web-components/p-0e4c8bf1.entry.js +1 -0
- package/dist/web-components/{p-5744d75c.entry.js → p-1da75540.entry.js} +1 -1
- package/dist/web-components/p-26ef77d6.entry.js +1 -0
- package/dist/web-components/p-3884c6e7.entry.js +1 -0
- package/dist/web-components/p-3a5a67e7.entry.js +1 -0
- package/dist/web-components/p-3f60c6c0.entry.js +1 -0
- package/dist/web-components/p-4254a383.entry.js +1 -0
- package/dist/web-components/{p-87f39749.entry.js → p-4595fa8e.entry.js} +1 -1
- package/dist/web-components/{p-4e3df002.entry.js → p-4cc58c6a.entry.js} +1 -1
- package/dist/web-components/p-5441b746.entry.js +1 -0
- package/dist/web-components/{p-72fa1fd1.entry.js → p-550e2237.entry.js} +1 -1
- package/dist/web-components/p-589baaf9.entry.js +1 -0
- package/dist/web-components/p-60341de2.entry.js +1 -0
- package/dist/web-components/{p-4bd3e077.entry.js → p-60ca994e.entry.js} +1 -1
- package/dist/web-components/{p-44ae9f33.entry.js → p-62b788bf.entry.js} +1 -1
- package/dist/web-components/{p-2b2f581a.entry.js → p-6303b9fe.entry.js} +1 -1
- package/dist/web-components/p-63fd817d.entry.js +1 -0
- package/dist/web-components/{p-e0e2f2b2.entry.js → p-673dbfd0.entry.js} +1 -1
- package/dist/web-components/p-67fa3f84.entry.js +1 -0
- package/dist/web-components/p-6cc2ea2c.entry.js +1 -0
- package/dist/web-components/p-70784685.entry.js +1 -0
- package/dist/web-components/{p-429213ea.entry.js → p-7fed6f4d.entry.js} +1 -1
- package/dist/web-components/p-8a66d20c.entry.js +1 -0
- package/dist/web-components/{p-0bb04d79.entry.js → p-8b4d2448.entry.js} +1 -1
- package/dist/web-components/{p-c7f8e59b.entry.js → p-8c31cbd5.entry.js} +1 -1
- package/dist/web-components/p-8dac326b.entry.js +1 -0
- package/dist/web-components/{p-1c2497de.entry.js → p-9ef1bbee.entry.js} +1 -1
- package/dist/web-components/p-a0dbde7c.entry.js +1 -0
- package/dist/web-components/{p-755cc697.entry.js → p-a71485d8.entry.js} +1 -1
- package/dist/web-components/p-a7d22c76.entry.js +1 -0
- package/dist/web-components/{p-85a9af42.entry.js → p-ae251d2f.entry.js} +1 -1
- package/dist/web-components/p-b9e3b3d6.entry.js +1 -0
- package/dist/web-components/p-c1e748f2.entry.js +1 -0
- package/dist/web-components/{p-5bbd6e3c.entry.js → p-c478712b.entry.js} +1 -1
- package/dist/web-components/{p-3078b2b8.entry.js → p-d054eb4d.entry.js} +1 -1
- package/dist/web-components/{p-8563a1ab.entry.js → p-d433a828.entry.js} +1 -1
- package/dist/web-components/p-d7726e46.entry.js +1 -0
- package/dist/web-components/p-d819c8e5.entry.js +1 -0
- package/dist/web-components/p-e2188953.entry.js +1 -0
- package/dist/web-components/{p-3b4e3faf.entry.js → p-e5945c01.entry.js} +1 -1
- package/dist/web-components/{p-d1379ac6.entry.js → p-f9d5004c.entry.js} +1 -1
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/r-accordion-item.cjs.entry.js +0 -78
- package/dist/cjs/r-icon-button.cjs.entry.js +0 -81
- package/dist/collection/components/accordion-item/accordion-item.css +0 -121
- package/dist/collection/components/accordion-item/accordion-item.js +0 -138
- package/dist/esm/r-accordion-item.entry.js +0 -76
- package/dist/esm/r-icon-button.entry.js +0 -79
- package/dist/types/components/accordion-item/accordion-item.d.ts +0 -26
- package/dist/web-components/p-00ca474f.entry.js +0 -1
- package/dist/web-components/p-15ac0fdd.entry.js +0 -1
- package/dist/web-components/p-1c956370.entry.js +0 -1
- package/dist/web-components/p-2a512983.entry.js +0 -1
- package/dist/web-components/p-2e18e762.entry.js +0 -1
- package/dist/web-components/p-3bc93d65.entry.js +0 -1
- package/dist/web-components/p-51a5804b.entry.js +0 -1
- package/dist/web-components/p-56da04d8.entry.js +0 -1
- package/dist/web-components/p-5e6aabd8.entry.js +0 -1
- package/dist/web-components/p-656229de.entry.js +0 -1
- package/dist/web-components/p-7775228c.entry.js +0 -1
- package/dist/web-components/p-7ad8e78b.entry.js +0 -1
- package/dist/web-components/p-9e50120b.entry.js +0 -1
- package/dist/web-components/p-a022f356.entry.js +0 -1
- package/dist/web-components/p-a7e7f8fa.entry.js +0 -1
- package/dist/web-components/p-ad9b2a48.entry.js +0 -1
- package/dist/web-components/p-b2f03016.entry.js +0 -1
- package/dist/web-components/p-b87ad83b.entry.js +0 -1
- package/dist/web-components/p-c937bd92.entry.js +0 -1
- package/dist/web-components/p-cbcd7699.entry.js +0 -1
- package/dist/web-components/p-dbe579e8.entry.js +0 -1
- package/dist/web-components/p-e4b66277.entry.js +0 -1
- package/dist/web-components/p-e6a31881.entry.js +0 -1
- package/dist/web-components/p-f2577a3c.entry.js +0 -1
- package/dist/web-components/p-f6a92287.entry.js +0 -1
|
@@ -1,66 +1,80 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-Da7qOBFr.js';
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const iconButtonCss = ":host{display:inline-flex;vertical-align:top;--r-icon-button--color:inherit}:host(:hover:not([disabled]:not([disabled=false])):not(:active)){--r-icon-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host(:active:not([disabled]:not([disabled=false]))){--r-icon-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host(:focus-within:not(:active):not([disabled]:not([disabled=false]))){box-shadow:0 0 0 6px var(--r-border-focused-outlined, #fff);outline:2px solid var(--r-border-focused, #0071e3);outline-offset:2px}:host([disabled]:not([disabled=false])){opacity:0.4;--r-icon-button--cursor:not-allowed;--r-icon-button--box-shadow:none;--r-icon-button--background-color:transparent}:host([variant=contained]){--r-icon-button--color:var(--r-icon-inverse, #fff);--r-icon-button--background-color:var(--r-background-interactive-regular, #282828);--r-icon-button--box-shadow:none}:host([variant=contained]:hover:not([disabled]:not([disabled=false]))){--r-icon-button--color:var(--r-icon-regular, #282828);--r-icon-button--background-color:var(--r-background-interactive-hovered, rgba(40, 40, 40, 0.04))}:host([variant=contained]:active:not([disabled]:not([disabled=false]))){--r-icon-button--color:var(--r-icon-regular, #282828);--r-icon-button--background-color:var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12))}:host([variant=contained][disabled]:not([disabled=false])){--r-icon-button--color:var(--r-icon-inverse, #fff);--r-icon-button--background-color:var(--r-background-interactive-regular, #282828)}:host([size=s]){--r-icon-button--height:1.5rem;--r-icon-button--width:1.5rem}:host([size=m]){--r-icon-button--height:2.25rem;--r-icon-button--width:2.25rem}:host([size=l]){--r-icon-button--height:2.75rem;--r-icon-button--width:2.75rem}.r-icon-button{display:var(--r-icon-button--display, inline-flex);align-items:var(--r-icon-button--align-items, center);justify-content:var(--r-icon-button--justify-content, center);outline:var(--r-icon-button--outline, none);cursor:var(--r-icon-button--cursor, pointer);pointer-events:var(--r-icon-button--pointer-events, initial);padding:var(--r-icon-button--padding, 0);border:var(--r-icon-button--border, none);color:var(--r-icon-button--color, inherit);background-color:var(--r-icon-button--background-color, transparent);box-sizing:var(--r-icon-button--box-sizing, border-box);border-width:var(--r-icon-button--border-width, 1px);border-style:var(--r-icon-button--border-style, solid);border-color:var(--r-icon-button--border-color, transparent);border-radius:var(--r-icon-button--border-radius, 50%);z-index:var(--r-icon-button--z-index, initial);width:var(--r-icon-button--width, 2.25rem);height:var(--r-icon-button--height, 2.25rem)}.r-icon-button--target-area{position:var(--r-icon-button--target-area--position, absolute);background:var(--r-icon-button--target-area--background, rgba(0, 0, 0, 0));width:var(--r-icon-button--target-area--width, 2.75rem);height:var(--r-icon-button--target-area--height, 2.75rem);z-index:var(--r-icon-button--target-area--z-index, 1)}.r-icon-button--icon{display:flex;align-items:center;justify-content:center}.visually-hidden{position:absolute;width:1px;height:1px;clip:rect(0 0 0 0);clip-path:inset(50%);overflow:hidden;white-space:nowrap}";
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
const IconButton = class {
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
this.rClick = createEvent(this, "rClick");
|
|
9
|
+
/**
|
|
10
|
+
* Defines the size of the icon used within the button.
|
|
11
|
+
*/
|
|
12
|
+
this.size = 'm';
|
|
13
|
+
/**
|
|
14
|
+
* @deprecated Use the `<r-tooltip>` component as a wrapper instead.
|
|
15
|
+
* Sets position for the tooltip.
|
|
16
|
+
* - `top`: Tooltip appears above the button.
|
|
17
|
+
* - `bottom`: Tooltip appears below the button.
|
|
18
|
+
* - `left`: Tooltip appears to the left of the button.
|
|
19
|
+
* - `right`: Tooltip appears to the right of the button.
|
|
20
|
+
*/
|
|
21
|
+
this.tooltipPosition = 'top';
|
|
22
|
+
/**
|
|
23
|
+
* Defines the visual style of the button.
|
|
24
|
+
* - `standard`: Default button style.
|
|
25
|
+
* - `contained`: Button with a contained background.
|
|
26
|
+
*/
|
|
27
|
+
this.variant = 'standard';
|
|
28
|
+
this._handleClick = (event) => {
|
|
29
|
+
if (this.disabled) {
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
this.rClick.emit();
|
|
34
|
+
};
|
|
35
|
+
this.onFocus = () => {
|
|
36
|
+
this.setFocus();
|
|
37
|
+
};
|
|
38
|
+
this.onBlur = () => {
|
|
39
|
+
this.setBlur();
|
|
16
40
|
};
|
|
17
|
-
return (this.variant in variantIcons) ? variantIcons[this.variant] : null;
|
|
18
|
-
}
|
|
19
|
-
get hasIconSlot() {
|
|
20
|
-
return !!this.host.querySelector('[slot="icon"]');
|
|
21
41
|
}
|
|
22
|
-
|
|
23
|
-
|
|
42
|
+
/** Simulate a button click */
|
|
43
|
+
async triggerClick() {
|
|
44
|
+
var _a;
|
|
45
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.click();
|
|
24
46
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
47
|
+
/** Set focus on the button */
|
|
48
|
+
async setFocus() {
|
|
49
|
+
var _a;
|
|
50
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
28
51
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
const labelCss = "@charset \"UTF-8\";:host([field-indicator]){--r-label--marker--display:inline}.r-label{display:var(--r-label--display, flex);flex-direction:var(--r-label--flex-direction, row);gap:var(--r-label--gap, var(--r-spacing-100, 1rem));cursor:var(--r-label--cursor, default);color:var(--r-label--color, var(--r-text-regular, #282828));margin-bottom:var(--r-label--margin-bottom, 0)}.r-label--slot{flex:var(--r-label--slot--flex, 1);line-height:var(--r-label--line-height, var(--r-line-height-m, 1.5));font-family:var(--r-label--font-family, var(--r-font-family-text, system-ui));font-size:var(--r-label--font-size, var(--r-font-size-regular, 1rem));font-weight:var(--r-label--font-weight, var(--r-font-weight-regular, 400))}.r-label--marker{display:var(--r-label--marker--display, none);color:var(--r-label--marker--color, var(--r-text-soft, #686868));font-size:var(--r-label--marker--font-size, var(--r-font-size-300, 0.875rem));font-style:var(--r-label--marker--font-style, normal);font-weight:var(--r-label--marker--font-weight, var(--r-font-weight-regular, 400));margin-left:var(--r-label--marker--margin-left, var(--r-spacing-075, 0.75rem))}.r-label--marker::before{content:var(--r-label--marker--before--content, \"– \")}.r-label--tooltip-icon{color:var(--r-label--tooltip-icon--color, var(--r-text-regular, inherit));display:var(--r-label--tooltip-icon--display, inline-flex);line-height:var(--r-label--tooltip-icon--line-height, 1);align-items:var(--r-label--tooltip-icon--align-items, center);justify-content:var(--r-label--tooltip-icon--justify-content, center)}";
|
|
34
|
-
|
|
35
|
-
const RLabel = class {
|
|
36
|
-
constructor(hostRef) {
|
|
37
|
-
registerInstance(this, hostRef);
|
|
38
|
-
/**
|
|
39
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
40
|
-
* Defines preferable position of the tooltip */
|
|
41
|
-
this.tooltipPosition = 'right';
|
|
42
|
-
/**
|
|
43
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
44
|
-
* Icon tooltip trigger by name from the set */
|
|
45
|
-
this.tooltipIcon = 'circled-question-mark';
|
|
52
|
+
/** Remove focus from the button */
|
|
53
|
+
async setBlur() {
|
|
54
|
+
var _a;
|
|
55
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
46
56
|
}
|
|
47
57
|
render() {
|
|
48
|
-
const {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
position: tooltipPosition
|
|
58
|
+
const { name, size, disabled, tooltipText, tooltipPosition } = this;
|
|
59
|
+
const buttonAttrs = {
|
|
60
|
+
disabled,
|
|
52
61
|
};
|
|
53
|
-
const
|
|
54
|
-
name
|
|
55
|
-
size
|
|
56
|
-
color: tooltipIconColor
|
|
62
|
+
const iconAttrs = {
|
|
63
|
+
name,
|
|
64
|
+
size
|
|
57
65
|
};
|
|
58
|
-
|
|
59
|
-
h("
|
|
60
|
-
|
|
66
|
+
const buttonTemplate = () => (h("button", Object.assign({ key: '911b0a6390b2dfa0084bda96e12f0968859a31e4', type: "button", class: "r-icon-button", "aria-label": this.host.getAttribute('aria-label') || null }, buttonAttrs, { onClick: this._handleClick, onFocus: this.onFocus, onBlur: this.onBlur, ref: (el) => (this.nativeElement = el) }), name ?
|
|
67
|
+
h("r-icon", Object.assign({}, iconAttrs))
|
|
68
|
+
:
|
|
69
|
+
h("r-icon", { size: size, class: "r-icon-button--icon" }, h("slot", null)), h("span", { key: '2306cd32340a99653bb02c86de43324a2c0ca35b', class: "r-icon-button--label visually-hidden" }, this.label), h("span", { key: '9cb523d0c82caf25d472b8969a0afee41ad776aa', class: "r-icon-button--target-area" })));
|
|
70
|
+
return (h(Host, { key: '2710af0c77ea56a4cf69e29c09221ba7d913bc9d' }, !disabled && tooltipText ?
|
|
71
|
+
h("r-tooltip", { text: tooltipText, position: tooltipPosition }, buttonTemplate())
|
|
72
|
+
:
|
|
73
|
+
buttonTemplate()));
|
|
61
74
|
}
|
|
75
|
+
get host() { return getElement(this); }
|
|
62
76
|
};
|
|
63
|
-
|
|
77
|
+
IconButton.style = iconButtonCss;
|
|
64
78
|
|
|
65
79
|
const tooltipCss = ":host{display:inline-block;--r-tooltip--position:relative;--r-tooltip--content--position:fixed;--r-tooltip--content--display:none;--r-tooltip--content--color:var(--r-text-inverse);--r-tooltip--content--background-color:var(--r-background-inverse);--r-tooltip--content--font-family:var(--r-font-family-text);--r-tooltip--content--font-weight:var(--r-font-weight-regular);--r-tooltip--content--font-size:var(--r-font-size-200);--r-tooltip--content--line-height:var(--r-line-height-s);--r-tooltip--content--min-width:32px;--r-tooltip--content--max-width:300px;--r-tooltip--content--min-height:32px;--r-tooltip--content--padding:var(--r-spacing-050) var(--r-spacing-100);--r-tooltip--content--width:max-width;--r-tooltip--content--word-break:break-word;--r-tooltip--content--box-sizing:border-box;--r-tooltip--content--justify-content:center;--r-tooltip--content--align-items:center;--r-tooltip--content--z-index:0;--r-tooltip--arrow--display:none;--r-tooltip--arrow--position:fixed;--r-tooltip--arrow--width:12px;--r-tooltip--arrow--height:12px;--r-tooltip--arrow--transform:rotate(180deg);--r-tooltip--arrow--inner-content:\"\";--r-tooltip--arrow--inner--width:12px;--r-tooltip--arrow--inner--height:6px;--r-tooltip--arrow--inner--background-color:var(--r-tooltip--content--background-color);--r-tooltip--arrow--inner--clip-path:polygon(50% 0%, 0% 100%, 100% 100%);--r-tooltip--arrow--inner--border-radius:0;--r-tooltip--arrow--inner--align-self:flex-end}:host slot{display:contents}:host([data-position=bottom]){--r-tooltip--arrow--transform:rotate(0)}:host([data-position=right]){--r-tooltip--arrow--transform:rotate(270deg)}:host([data-position=left]){--r-tooltip--arrow--transform:rotate(90deg)}.r-tooltip{position:var(--r-tooltip--position)}.r-tooltip:has(.r-tooltip--content--visible){--r-tooltip--content--width:max-content;--r-tooltip--content--display:flex;--r-tooltip--content--z-index:1060;--r-tooltip--arrow--display:flex;--r-tooltip--arrow--inner--display:block}.r-tooltip--trigger{color:var(--r-tooltip--trigger--color, inherit);box-shadow:var(--r-tooltip--trigger--box-shadow, none);outline:var(--r-tooltip--trigger--outline, none);outline-offset:var(--r-tooltip--trigger--outline-offset, 0)}.r-tooltip--trigger:focus{--r-tooltip--trigger--box-shadow:0 0 0 6px var(--r-border-focused-outlined);--r-tooltip--trigger--outline:2px solid var(--r-border-focused);--r-tooltip--trigger--outline-offset:2px}.r-tooltip--content{position:var(--r-tooltip--content--position);display:var(--r-tooltip--content--display);color:var(--r-tooltip--content--color);background-color:var(--r-tooltip--content--background-color);font-family:var(--r-tooltip--content--font-family);font-weight:var(--r-tooltip--content--font-weight);font-size:var(--r-tooltip--content--font-size);line-height:var(--r-tooltip--content--line-height);min-width:var(--r-tooltip--content--min-width);max-width:var(--r-tooltip--content--max-width);min-height:var(--r-tooltip--content--min-height);padding:var(--r-tooltip--content--padding);width:var(--r-tooltip--content--width);word-break:var(--r-tooltip--content--word-break);box-sizing:var(--r-tooltip--content--box-sizing);z-index:var(--r-tooltip--content--z-index)}.r-tooltip--arrow{display:var(--r-tooltip--arrow--display);position:var(--r-tooltip--arrow--position);width:var(--r-tooltip--arrow--width);height:var(--r-tooltip--arrow--height);transform:var(--r-tooltip--arrow--transform)}.r-tooltip--arrow:after{content:var(--r-tooltip--arrow--inner-content);display:var(--r-tooltip--arrow--inner--display);width:var(--r-tooltip--arrow--inner--width);height:var(--r-tooltip--arrow--inner--height);background-color:var(--r-tooltip--arrow--inner--background-color);clip-path:var(--r-tooltip--arrow--inner--clip-path);border-radius:var(--r-tooltip--arrow--inner--border-radius);align-self:var(--r-tooltip--arrow--inner--align-self)}";
|
|
66
80
|
|
|
@@ -418,7 +432,7 @@ const Tooltip = class {
|
|
|
418
432
|
role: 'tooltip',
|
|
419
433
|
'aria-hidden': `${!isShown}`
|
|
420
434
|
};
|
|
421
|
-
return (h(Host, Object.assign({ key: '
|
|
435
|
+
return (h(Host, Object.assign({ key: '1b2ce4ee1a9f9ca227b96e567fb61b560858734e' }, hostAttrs, { onMouseenter: this.handleHover, onMouseleave: this.removeTooltip }), h("div", { key: '1379aefd4bf69b312a9ce3ef443f5e9fe970f09e', class: "r-tooltip" }, h("div", Object.assign({ key: '80f00e66c8f01bb0df9107943c15d6616e4e7197', class: "r-tooltip--trigger", onFocus: this.handleFocus, onBlur: this.removeTooltip }, triggerAttrs), h("slot", { key: '42e1453731bdd404083e11d3d2f0ae4603e4c57b' })), h("div", Object.assign({ key: '00aa4f22f9c3e40d1c8e86cdd950ef1d160e29cf', class: "r-tooltip--content", ref: (el) => this.tooltip = el }, contentAttrs), text), h("div", { key: 'b717d5e45d3f970ee87f409d61a6353fb138fc7b', ref: (el) => this.arrow = el, class: "r-tooltip--arrow" }))));
|
|
422
436
|
}
|
|
423
437
|
get element() { return getElement(this); }
|
|
424
438
|
static get watchers() { return {
|
|
@@ -427,4 +441,4 @@ const Tooltip = class {
|
|
|
427
441
|
};
|
|
428
442
|
Tooltip.style = tooltipCss;
|
|
429
443
|
|
|
430
|
-
export {
|
|
444
|
+
export { IconButton as r_icon_button, Tooltip as r_tooltip };
|
|
@@ -9,18 +9,32 @@ const InputCode = class {
|
|
|
9
9
|
this.rChange = createEvent(this, "rChange");
|
|
10
10
|
this.rValidate = createEvent(this, "rValidate");
|
|
11
11
|
this.rReset = createEvent(this, "rReset");
|
|
12
|
-
/** Specifies a name for an input for
|
|
12
|
+
/** Specifies a name for an input for submission within formData object. */
|
|
13
13
|
this.name = 'input-code';
|
|
14
|
-
/** Number of digits (typically 4–6)
|
|
14
|
+
/** Number of digits (typically 4–6).
|
|
15
|
+
* @default: 4
|
|
16
|
+
*/
|
|
15
17
|
this.length = 4;
|
|
16
|
-
/** Label for accessibility
|
|
18
|
+
/** Label for accessibility.
|
|
19
|
+
* @default: 'Verification code'
|
|
20
|
+
*/
|
|
17
21
|
this.label = 'Verification code';
|
|
18
|
-
/** Set custom message for `tooShort` property of a ValidityState object (set by `minlength`) within Constrain Validation API */
|
|
19
|
-
this.tooShortMessage = `All ${this.length} characters must be filled.`;
|
|
20
22
|
/** Defines initial value */
|
|
21
23
|
this.value = '';
|
|
24
|
+
/** Specifies the input mode for the virtual keyboard on mobile devices. Default is 'numeric' for OTP codes.
|
|
25
|
+
* @default: 'numeric'
|
|
26
|
+
*/
|
|
27
|
+
this.inputmode = 'numeric';
|
|
28
|
+
/** Specifies the enter key hint for the virtual keyboard. Default is 'done' for OTP completion.
|
|
29
|
+
* @default: 'done'
|
|
30
|
+
*/
|
|
31
|
+
this.enterkeyhint = 'done';
|
|
32
|
+
/** Specifies the autocomplete behavior. Default is 'one-time-code' for SMS OTP autofill.
|
|
33
|
+
* @default: 'one-time-code'
|
|
34
|
+
*/
|
|
35
|
+
this.autocomplete = 'one-time-code';
|
|
22
36
|
/** Holds the current values of each input box */
|
|
23
|
-
this.values =
|
|
37
|
+
this.values = [];
|
|
24
38
|
/** Validity state passed from validateFormElement function after validation */
|
|
25
39
|
this.validityState = '';
|
|
26
40
|
/** Validity message passed from validateFormElement function after validation */
|
|
@@ -107,6 +121,10 @@ const InputCode = class {
|
|
|
107
121
|
this.getValidityStateData = (element) => {
|
|
108
122
|
let validityState = '';
|
|
109
123
|
let validityMessage = '';
|
|
124
|
+
if (!element) {
|
|
125
|
+
validityState = 'valid';
|
|
126
|
+
return { validityState, validityMessage };
|
|
127
|
+
}
|
|
110
128
|
if (this.required && element.value.length === 0) {
|
|
111
129
|
validityState = 'valueMissing';
|
|
112
130
|
validityMessage = this.valueMissingMessage;
|
|
@@ -114,7 +132,7 @@ const InputCode = class {
|
|
|
114
132
|
}
|
|
115
133
|
if (element.value.length > 0 && element.value.length < this.length) {
|
|
116
134
|
validityState = 'tooShort';
|
|
117
|
-
validityMessage = this.tooShortMessage
|
|
135
|
+
validityMessage = this.tooShortMessage || `All ${this.length} characters must be filled.`;
|
|
118
136
|
return { validityState, validityMessage };
|
|
119
137
|
}
|
|
120
138
|
validityState = 'valid';
|
|
@@ -139,7 +157,7 @@ const InputCode = class {
|
|
|
139
157
|
this.onResetForm = async () => {
|
|
140
158
|
if (this.readonly)
|
|
141
159
|
return;
|
|
142
|
-
this.reset();
|
|
160
|
+
await this.reset();
|
|
143
161
|
this.validityState = null;
|
|
144
162
|
this.validityMessage = null;
|
|
145
163
|
this.invalid = null;
|
|
@@ -162,6 +180,19 @@ const InputCode = class {
|
|
|
162
180
|
appendControlToFormData(this.nativeElement || this.host, event.formData);
|
|
163
181
|
};
|
|
164
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Validates segment index and throws descriptive errors if invalid.
|
|
185
|
+
* @param index - The index to validate
|
|
186
|
+
* @throws Error if index is not an integer or out of bounds
|
|
187
|
+
*/
|
|
188
|
+
validateSegmentIndex(index) {
|
|
189
|
+
if (typeof index !== 'number' || !Number.isInteger(index)) {
|
|
190
|
+
throw new Error('Index must be an integer');
|
|
191
|
+
}
|
|
192
|
+
if (index < 0 || index >= this.length) {
|
|
193
|
+
throw new Error(`Index out of bounds: must be between 0 and ${this.length - 1}`);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
165
196
|
/**
|
|
166
197
|
* Gets the current complete code value by joining all individual digit values.
|
|
167
198
|
* @returns Promise that resolves to the complete code string
|
|
@@ -189,6 +220,10 @@ const InputCode = class {
|
|
|
189
220
|
return;
|
|
190
221
|
}
|
|
191
222
|
const valueArray = Array.from(value).slice(0, this.length).map(char => String(char));
|
|
223
|
+
// Pad with empty strings if value is shorter than length
|
|
224
|
+
while (valueArray.length < this.length) {
|
|
225
|
+
valueArray.push('');
|
|
226
|
+
}
|
|
192
227
|
this.values = valueArray;
|
|
193
228
|
this.rChange.emit({ value: this.values.join('') });
|
|
194
229
|
}
|
|
@@ -200,9 +235,68 @@ const InputCode = class {
|
|
|
200
235
|
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
201
236
|
return validityState === 'valid';
|
|
202
237
|
}
|
|
238
|
+
/**
|
|
239
|
+
* Focuses a specific segment (input) by index.
|
|
240
|
+
* @param index - The zero-based index of the segment to focus (0 to length-1)
|
|
241
|
+
* @returns Promise that resolves when focus is set, or rejects if index is invalid
|
|
242
|
+
*/
|
|
243
|
+
async focusSegment(index) {
|
|
244
|
+
this.validateSegmentIndex(index);
|
|
245
|
+
const input = this.inputs[index];
|
|
246
|
+
if (input) {
|
|
247
|
+
input.focus();
|
|
248
|
+
// Select the content if it exists
|
|
249
|
+
if (this.values[index]) {
|
|
250
|
+
setTimeout(() => {
|
|
251
|
+
// Check if setSelectionRange exists (not available in some test environments)
|
|
252
|
+
if (typeof input.setSelectionRange === 'function') {
|
|
253
|
+
input.setSelectionRange(0, 1);
|
|
254
|
+
}
|
|
255
|
+
}, 0);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Gets the value of a specific segment by index.
|
|
261
|
+
* @param index - The zero-based index of the segment (0 to length-1)
|
|
262
|
+
* @returns Promise that resolves to the segment value (single character string or empty string)
|
|
263
|
+
*/
|
|
264
|
+
async getSegmentValue(index) {
|
|
265
|
+
this.validateSegmentIndex(index);
|
|
266
|
+
return this.values[index] || '';
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Sets the value of a specific segment by index.
|
|
270
|
+
* @param index - The zero-based index of the segment (0 to length-1)
|
|
271
|
+
* @param value - The value to set (will be truncated to first character if longer)
|
|
272
|
+
*/
|
|
273
|
+
async setSegmentValue(index, value) {
|
|
274
|
+
this.validateSegmentIndex(index);
|
|
275
|
+
// Take only the first character, or empty string if value is empty
|
|
276
|
+
const newValue = value ? value.charAt(0) : '';
|
|
277
|
+
this.values[index] = newValue;
|
|
278
|
+
this.values = [...this.values];
|
|
279
|
+
// Update the input element's value to reflect the change
|
|
280
|
+
const input = this.inputs[index];
|
|
281
|
+
if (input) {
|
|
282
|
+
input.value = newValue;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
203
285
|
handleValuesChange() {
|
|
204
286
|
this.value = this.values.join('');
|
|
205
287
|
}
|
|
288
|
+
handleLengthChange(newLength) {
|
|
289
|
+
// Adjust values array when length changes
|
|
290
|
+
if (this.values.length !== newLength) {
|
|
291
|
+
const newValues = new Array(newLength).fill('');
|
|
292
|
+
// Copy existing values up to the new length
|
|
293
|
+
for (let i = 0; i < Math.min(this.values.length, newLength); i++) {
|
|
294
|
+
newValues[i] = this.values[i];
|
|
295
|
+
}
|
|
296
|
+
this.values = newValues;
|
|
297
|
+
this.inputs = [];
|
|
298
|
+
}
|
|
299
|
+
}
|
|
206
300
|
get firstEmptyInput() {
|
|
207
301
|
return this.inputs.find(input => !input.value) || null;
|
|
208
302
|
}
|
|
@@ -215,7 +309,7 @@ const InputCode = class {
|
|
|
215
309
|
return null;
|
|
216
310
|
}
|
|
217
311
|
return (this.validityState && this.validityState !== 'valid' ?
|
|
218
|
-
(this.customErrorMessage || this.validityMessage)
|
|
312
|
+
(this.customErrorMessage || this.validityMessage || `All ${this.length} characters must be filled.`)
|
|
219
313
|
: null);
|
|
220
314
|
}
|
|
221
315
|
get ariaDescribedBy() {
|
|
@@ -293,19 +387,20 @@ const InputCode = class {
|
|
|
293
387
|
id: `${uniqueId}-label`,
|
|
294
388
|
fieldIndicator
|
|
295
389
|
} : {};
|
|
296
|
-
return (h(Host, { key: '
|
|
390
|
+
return (h(Host, { key: '4d744320f4bf03760e4b11dd38934c0f7ce05223', value: this.value, onClick: this.onHostClick }, h("div", { key: 'f047f6669b243f301a2a462188d24721ccb565a5', class: "r-input-code--label-container" }, h("label", { key: 'a5acdd7308cca3981a78619c480d79c499ebc58a', htmlFor: uniqueId }, label ?
|
|
297
391
|
h("r-label", Object.assign({}, labelAttr), label)
|
|
298
392
|
:
|
|
299
|
-
h("slot", { name: "label" })), h("slot", { key: '
|
|
300
|
-
h("r-hint", { key: '
|
|
301
|
-
h("r-icon", { key: '
|
|
302
|
-
h("slot", { key: '
|
|
303
|
-
h("r-icon", { key: '
|
|
304
|
-
h("r-hint", { key: '
|
|
393
|
+
h("slot", { name: "label" })), h("slot", { key: '696554954e2b29b49a8d639aa79d80abeaa6a729', name: "popover" })), hint &&
|
|
394
|
+
h("r-hint", { key: '58b3e011e49b4a3bd4dd31050ab554483fba0fc4', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '6f4668b5bda975b59ff269759e2d3ae3306b09c4', class: "r-input-code--container", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.groupDescribedby }, h("slot", { key: '59206e0ed6e335735b610c44a925ea70b137ffe0', name: "leading" }), Array.from({ length: this.length }).map((_, i) => (h("input", { class: "r-input-code--input", key: i, id: `${uniqueId}-input-section-${i}`, "aria-label": `${this.ariaCharacterLabel || 'Character'}: ${i + 1}`, "aria-invalid": `${this.invalid || false}`, value: this.values[i], ref: el => this.inputs[i] = el, maxlength: 1, disabled: this.disabled, required: this.required, readonly: readonly, inputmode: this.inputmode, enterkeyhint: this.enterkeyhint, autocomplete: this.autocomplete, onInput: this.createInputHandler(i), onKeyDown: this.createKeyDownHandler(i), onPaste: this.handlePaste }))), h("input", Object.assign({ key: '815da7a7566b0cefdbdfda32c990637385eba304', type: "hidden" }, inputAttrs, { value: this.values.join(''), ref: el => this.nativeElement = el })), h("div", { key: 'b03d7e03bd6c91d441f4377d53bb7d845edf498d', class: "r-input-code--trailing" }, this.readonly &&
|
|
395
|
+
h("r-icon", { key: '53796d1b572ff2eac8297a0fad8e22d3a95f1bee', class: "r-input-code--readonly-icon", name: "pen-disabled", size: "s" }), this.hasTrailingSlot &&
|
|
396
|
+
h("slot", { key: '9becd49e7d79f824fcd79e7afbc3040a1b0f33a3', name: "trailing" }, valid &&
|
|
397
|
+
h("r-icon", { key: 'a31379d7e8eb6ad66bbf1567d4cd4f9526962226', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" })))), h("slot", { key: 'a38ac5d9dda2017a443ec2b58cffbdd0db952239', name: "message" }, this.hasMessage &&
|
|
398
|
+
h("r-hint", { key: '39e47e0fdf23b1ebab5a0384447a965a8890d77f', "aria-live": "polite", id: `${uniqueId}-message`, variant: "error" }, this.message))));
|
|
305
399
|
}
|
|
306
400
|
get host() { return getElement(this); }
|
|
307
401
|
static get watchers() { return {
|
|
308
|
-
"values": ["handleValuesChange"]
|
|
402
|
+
"values": ["handleValuesChange"],
|
|
403
|
+
"length": ["handleLengthChange"]
|
|
309
404
|
}; }
|
|
310
405
|
};
|
|
311
406
|
InputCode.style = inputCodeCss;
|
|
@@ -479,7 +479,7 @@ const InputDate = class {
|
|
|
479
479
|
this.disconnectFormEventListeners();
|
|
480
480
|
}
|
|
481
481
|
render() {
|
|
482
|
-
const { form, name, required, disabled, label, fieldIndicator, hint,
|
|
482
|
+
const { form, name, required, disabled, label, fieldIndicator, hint, uniqueId, invalid, valid, readonly } = this;
|
|
483
483
|
const groupAttrs = {
|
|
484
484
|
'aria-invalid': `${invalid || false}`,
|
|
485
485
|
'aria-describedby': this.ariaDescribedBy
|
|
@@ -493,24 +493,18 @@ const InputDate = class {
|
|
|
493
493
|
readonly,
|
|
494
494
|
'aria-describedby': this.ariaDescribedBy
|
|
495
495
|
};
|
|
496
|
-
// DEPRECATED: will be removed in November 2025 release.
|
|
497
|
-
const tooltipAttrs = tooltip ? {
|
|
498
|
-
tooltip,
|
|
499
|
-
'tooltip-icon': tooltipIcon,
|
|
500
|
-
'tooltip-icon-color': tooltipIconColor,
|
|
501
|
-
} : {};
|
|
502
496
|
const labelAttr = label ? {
|
|
503
497
|
id: `${uniqueId}-label`,
|
|
504
498
|
fieldIndicator
|
|
505
499
|
} : {};
|
|
506
|
-
return (h(Host, { key: '
|
|
507
|
-
h("r-label", Object.assign({}, labelAttr
|
|
500
|
+
return (h(Host, { key: '1a8a9175148f43758ec6b9d905c4bd2f619ffd7f', onClick: this.onHostClick, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, h("fieldset", Object.assign({ key: 'fb004332d8578b8da74df643bd93f93d062973bb', class: "r-input-date" }, groupAttrs), h("div", { key: '128e65638dc21d95c8b4b92669b0bd6733a653f6', class: "r-input-date--legend-container" }, h("legend", { key: '63e7e858c38930fecbe71d819f1a0b49bf711911', class: "r-input-date--legend" }, h("label", { key: 'ccd6a5434f5df91bf9b2c121bb182c152302d864', htmlFor: uniqueId }, label ?
|
|
501
|
+
h("r-label", Object.assign({}, labelAttr), label)
|
|
508
502
|
:
|
|
509
|
-
h("slot", { name: "label" }))), h("slot", { key: '
|
|
510
|
-
h("r-hint", { key: '
|
|
511
|
-
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: '
|
|
512
|
-
h("r-icon", { key: '
|
|
513
|
-
h("r-icon", { key: '
|
|
503
|
+
h("slot", { name: "label" }))), h("slot", { key: '4be5c643d1b0532d27f4b82692cb6ca937291d6b', name: "popover" })), hint &&
|
|
504
|
+
h("r-hint", { key: '07a912c146dff97ef991a6e375f4aeb8cd0ba45e', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '386dfb87cface9333c93d5fe8165cbe52a9a83c4', class: "r-input-date--container" }, h("r-icon", { key: '9ff075723ac54f6d7c2325ba59f833422404bee6', name: "calendar", size: "s", class: "r-input-date--calendar-icon" }), h("div", { key: 'ebcb76a92ab1591c3128a60d6620bea5b0c517ec', class: "r-input-date--inputs" }, this.inputOrder.map((input, i) => (h(Fragment, null, h("input", Object.assign({ class: "r-input-date--input" }, this.getInputAttrs(input), { key: input, value: this.getDateComponent(input), onInput: this.createInputHandler(input, i), onChange: this.createChangeHandler(input), onClick: this.onInputClick, onBlur: this.handleBlur, onKeyDown: this.createKeyDownHandler(i), onPaste: this.handlePaste })), i < this.inputOrder.length - 1 &&
|
|
505
|
+
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: 'e5736ffa215662436c539332be1414cc409ce448', type: "hidden" }, dateInputAttrs, { value: this.value, ref: (el) => this.nativeElement = el }))), h("div", { key: '45ccffbb4111f2fd906d9b687f62f4adc83b62aa', class: "r-input-date--trailing" }, this.readonly &&
|
|
506
|
+
h("r-icon", { key: '3a5433e3d601a83154687bdd55feeeef0ef04215', class: "r-input-date--readonly-icon", name: "pen-disabled", size: "s" }), valid &&
|
|
507
|
+
h("r-icon", { key: '03de3e49b8b51690e4fb6c2edbb7a53ca1a71f76', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }), this.hasTrailingSlot && h("slot", { key: 'db4911a4421b296effdd37ca08c96d8a0096e5e6', name: "trailing" }))), h("div", { key: 'd21f19188462be93812487702eb8a07fd3a91cea', id: `${uniqueId}-message`, "aria-live": "polite", class: "r-input-date--message" }, this.hasMessage && h("r-hint", { key: '6937f2d48a634308c97d33e59daa0a7242bd39fd', variant: "error" }, this.message)))));
|
|
514
508
|
}
|
|
515
509
|
get host() { return getElement(this); }
|
|
516
510
|
static get watchers() { return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-Da7qOBFr.js';
|
|
2
2
|
import { a as appendControlToFormData } from './formData-DvLT8-y3.js';
|
|
3
3
|
|
|
4
|
-
const inputPasswordCss = ":host{display:inline-flex;flex-direction:column;vertical-align:top}:host([full-width]:not([full-width=false])){display:block}:host([disabled]:not([disabled=false])) r-icon-button{opacity:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
4
|
+
const inputPasswordCss = ":host{display:inline-flex;flex-direction:column;vertical-align:top;--r-input--validation-icon--display:none}:host([full-width]:not([full-width=false])){display:block}:host([disabled]:not([disabled=false])) r-icon-button{opacity:1}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
5
5
|
|
|
6
6
|
const InputPassword = class {
|
|
7
7
|
constructor(hostRef) {
|
|
@@ -10,6 +10,7 @@ const InputPassword = class {
|
|
|
10
10
|
this.rInput = createEvent(this, "rInput");
|
|
11
11
|
this.rChange = createEvent(this, "rChange");
|
|
12
12
|
this.rReset = createEvent(this, "rReset");
|
|
13
|
+
this.rVisibilityChange = createEvent(this, "rVisibilityChange");
|
|
13
14
|
/** The value of the password input */
|
|
14
15
|
this.value = '';
|
|
15
16
|
/**
|
|
@@ -150,6 +151,7 @@ const InputPassword = class {
|
|
|
150
151
|
async showPassword() {
|
|
151
152
|
this.showed = true;
|
|
152
153
|
this.alertOnPasswordVisibilityChange();
|
|
154
|
+
this.rVisibilityChange.emit({ element: this.host, visible: true });
|
|
153
155
|
}
|
|
154
156
|
/**
|
|
155
157
|
* Hide password text.
|
|
@@ -157,6 +159,7 @@ const InputPassword = class {
|
|
|
157
159
|
async hidePassword() {
|
|
158
160
|
this.showed = false;
|
|
159
161
|
this.alertOnPasswordVisibilityChange();
|
|
162
|
+
this.rVisibilityChange.emit({ element: this.host, visible: false });
|
|
160
163
|
}
|
|
161
164
|
/** Get the input value */
|
|
162
165
|
async getValue() {
|
|
@@ -225,11 +228,14 @@ const InputPassword = class {
|
|
|
225
228
|
this.disconnectFormEventListeners();
|
|
226
229
|
}
|
|
227
230
|
render() {
|
|
228
|
-
const { name, placeholder, required, fieldIndicator, value, disabled, form, invalid, valid, hint, label,
|
|
231
|
+
const { name, placeholder, required, minlength, maxlength, pattern, fieldIndicator, value, disabled, form, invalid, valid, hint, label, fullWidth, showPasswordAriaLabel, hidePasswordAriaLabel, showed, readonly, passwordrules, autocomplete, tooLongMessage, tooShortMessage, patternMismatchMessage } = this;
|
|
229
232
|
const inputAttrs = {
|
|
230
233
|
name,
|
|
231
234
|
placeholder,
|
|
232
235
|
required,
|
|
236
|
+
minlength,
|
|
237
|
+
maxlength,
|
|
238
|
+
pattern,
|
|
233
239
|
fieldIndicator,
|
|
234
240
|
value,
|
|
235
241
|
disabled,
|
|
@@ -238,15 +244,17 @@ const InputPassword = class {
|
|
|
238
244
|
valid,
|
|
239
245
|
hint,
|
|
240
246
|
label,
|
|
241
|
-
tooltip,
|
|
242
|
-
tooltipIcon,
|
|
243
|
-
tooltipIconColor,
|
|
244
247
|
fullWidth,
|
|
245
248
|
novalidate: true,
|
|
246
|
-
readonly
|
|
249
|
+
readonly,
|
|
250
|
+
passwordrules,
|
|
251
|
+
autocomplete,
|
|
252
|
+
tooLongMessage,
|
|
253
|
+
tooShortMessage,
|
|
254
|
+
patternMismatchMessage
|
|
247
255
|
};
|
|
248
|
-
return (h(Host, { key: '
|
|
249
|
-
h("r-hint", { key: '
|
|
256
|
+
return (h(Host, { key: '15d9cac9269a816de47d1ae4d3818a99f6229979' }, h("r-input", Object.assign({ key: 'eea64612b319eae93c0fc6591c22020bf2e3d4fb' }, inputAttrs, { ref: (el) => this.nativeElement = el, type: showed ? 'text' : 'password', onRInput: this.onInput, onRChange: this.onChange, onKeyUp: this.handleKeyup, onRBlur: this.handleBlur }), h("r-icon", { key: 'd7a425d45f7897d7f6f11b7bf37595e25da3295b', name: "padlock-closed", size: "s", slot: "leading" }), h("slot", { key: '6ae8e4dc4633e692ae4280d9cd1420bf7e02d0c0', name: "popover", slot: "popover" }), h("r-icon-button", { key: 'e51d43f5966477dc1c35bf6a8114d5b206a58187', slot: "trailing", name: showed ? 'eye-crossed-out' : 'eye', size: "s", disabled: disabled, label: showed ? hidePasswordAriaLabel : showPasswordAriaLabel, onClick: this.onShowClick }), this.hasMessage &&
|
|
257
|
+
h("r-hint", { key: 'bcee0a5b7f75a4ddd2e2fa6a2dd44cd0392170dc', slot: "message", variant: "error" }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage))), h("div", { key: '995e229dfab56b03e0a177c6952c2135777f7899', class: "visually-hidden", ref: el => this.passwordVisibilityChangeAlertContainer = el, "aria-live": "polite" })));
|
|
250
258
|
}
|
|
251
259
|
get host() { return getElement(this); }
|
|
252
260
|
};
|
|
@@ -2492,14 +2492,10 @@ const InputPhoneNumber = class {
|
|
|
2492
2492
|
this.disconnectEventListeners();
|
|
2493
2493
|
}
|
|
2494
2494
|
render() {
|
|
2495
|
-
const { label, fieldIndicator, hint, name, form, inputLabel,
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
'tooltip-icon': tooltipIcon,
|
|
2500
|
-
'tooltip-icon-color': tooltipIconColor,
|
|
2501
|
-
} : {};
|
|
2502
|
-
const labelAttr = Object.assign({ fieldIndicator }, tooltipAttrs);
|
|
2495
|
+
const { label, fieldIndicator, hint, name, form, inputLabel, disabled, uniqueId, required, valid, invalid, novalidate, phoneNumber, fullPhoneNumber, fullWidth } = this;
|
|
2496
|
+
const labelAttr = {
|
|
2497
|
+
fieldIndicator
|
|
2498
|
+
};
|
|
2503
2499
|
const inputAttrs = {
|
|
2504
2500
|
id: uniqueId,
|
|
2505
2501
|
form,
|
|
@@ -2509,10 +2505,9 @@ const InputPhoneNumber = class {
|
|
|
2509
2505
|
disabled,
|
|
2510
2506
|
'aria-describedby': this.ariaDescribedBy
|
|
2511
2507
|
};
|
|
2512
|
-
return (h(Host, { key: '
|
|
2513
|
-
h("r-label", Object.assign({ key: '
|
|
2514
|
-
h("r-hint", { key: '
|
|
2515
|
-
h("r-icon", { key: '09c721cb014d6d7ece724bcf7de9ec5928624dac', slot: "trailing", name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }))), h("input", Object.assign({ key: 'e2eef2512f9125f0dd3d1b09120cbb77955350bd', type: "hidden" }, inputAttrs, { readonly: this.readonly, value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: 'a12e9640bcf2df7b754de4e54b111e4ead2d023e', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasMessage ? (this.hasError ? this.error : this.validityMessage) : '')));
|
|
2508
|
+
return (h(Host, { key: '97edc0f9bbc4a3823e628bb08be3b3abbbcfe6ec' }, h("div", { key: '8a5236c58655d47368bfaa9bcea6bde3c39c6a22', class: "r-input-phone-number--label-container" }, h("label", { key: 'ae6e6e72381864d67d98f4429856cf5b1943943c', id: `${uniqueId}-label` }, label &&
|
|
2509
|
+
h("r-label", Object.assign({ key: 'd760960dbf5806084b0a10d14fef218ca5e4cd79' }, labelAttr), label)), h("slot", { key: '4f9bcaba34f2f49592a3167958bd091eeac9f6be', name: "popover" })), hint &&
|
|
2510
|
+
h("r-hint", { key: '0c3f402b7f9369dcea2c84478e12ed0ea241fd0a', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '43e5dbd9ca897cfc2ca05e6ab020c321871f3961', class: "r-input-phone-number", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.ariaDescribedBy }, h("slot", { key: '4e3f891eb21f15927d6a33e7ba6728c09d20e981' }), h("r-input", { key: '6bd6e929e396bf515511fdd978d00df9de54cc37', label: inputLabel, value: phoneNumber, internal: true, valid: valid, invalid: invalid, required: required, readonly: this.readonly, novalidate: true, fullWidth: fullWidth, type: "tel", error: this.errorMessage || '', onRInput: this.handleOnInput, onRChange: this.handleInputOnChange, disabled: disabled })), h("input", Object.assign({ key: 'f113123ef2fa2096b686d132ce11ca11970ab1be', type: "hidden" }, inputAttrs, { readonly: this.readonly, value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: 'd00477c3a27f999c4a3079710c34266ed47e0e57', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasMessage ? (this.hasError ? this.error : this.validityMessage) : '')));
|
|
2516
2511
|
}
|
|
2517
2512
|
get host() { return getElement(this); }
|
|
2518
2513
|
static get watchers() { return {
|