@riverty/web-components 6.0.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +44 -0
- package/custom-elements.json +259 -2
- package/dist/cjs/{index-DJ4H_bFj.js → index-BnETQtSf.js} +9 -382
- package/dist/cjs/loader.cjs.js +2 -2
- 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 +1 -1
- package/dist/cjs/r-accordion.cjs.entry.js +1 -1
- package/dist/cjs/r-alert.cjs.entry.js +9 -6
- package/dist/cjs/r-badge.cjs.entry.js +1 -1
- package/dist/cjs/r-button.cjs.entry.js +6 -2
- package/dist/cjs/r-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/r-checkbox.cjs.entry.js +4 -4
- package/dist/cjs/r-design-system-devtools.cjs.entry.js +1 -1
- package/dist/cjs/r-dialog.cjs.entry.js +1 -1
- package/dist/cjs/r-hint_2.cjs.entry.js +3 -3
- package/dist/cjs/r-icon-button_2.cjs.entry.js +27 -7
- package/dist/cjs/r-icon.cjs.entry.js +2 -2
- package/dist/cjs/r-illustration.cjs.entry.js +396 -0
- package/dist/cjs/r-input-code.cjs.entry.js +34 -12
- package/dist/cjs/r-input-date.cjs.entry.js +7 -7
- package/dist/cjs/r-input-password.cjs.entry.js +3 -3
- package/dist/cjs/r-input-phone-number.cjs.entry.js +4 -4
- package/dist/cjs/r-input.cjs.entry.js +8 -5
- package/dist/cjs/r-list-item.cjs.entry.js +17 -16
- package/dist/cjs/r-pagination.cjs.entry.js +56 -50
- package/dist/cjs/r-panel.cjs.entry.js +6 -6
- package/dist/cjs/r-popover-action.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-content.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-headline.cjs.entry.js +2 -2
- package/dist/cjs/r-popover-trigger.cjs.entry.js +2 -2
- package/dist/cjs/r-popover.cjs.entry.js +46 -5
- package/dist/cjs/r-progress-bar.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-description.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-leading.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-title.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button-trailing.cjs.entry.js +2 -2
- package/dist/cjs/r-radio-button.cjs.entry.js +8 -7
- package/dist/cjs/r-radio-group.cjs.entry.js +83 -10
- package/dist/cjs/r-select-option.cjs.entry.js +2 -2
- package/dist/cjs/r-select.cjs.entry.js +6 -4
- package/dist/cjs/r-skip-link.cjs.entry.js +2 -2
- package/dist/cjs/r-stepper-item.cjs.entry.js +19 -4
- package/dist/cjs/r-stepper.cjs.entry.js +76 -3
- package/dist/cjs/r-tab-panel.cjs.entry.js +2 -2
- package/dist/cjs/r-tab.cjs.entry.js +7 -3
- package/dist/cjs/r-tabs-list.cjs.entry.js +161 -3
- package/dist/cjs/r-tabs.cjs.entry.js +35 -7
- package/dist/cjs/r-textarea.cjs.entry.js +2 -2
- package/dist/cjs/r-toast-group.cjs.entry.js +13 -4
- package/dist/cjs/r-toast.cjs.entry.js +104 -15
- package/dist/cjs/web-components.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/alert/alert.css +6 -6
- package/dist/collection/components/alert/alert.js +7 -4
- package/dist/collection/components/button/button.js +30 -1
- package/dist/collection/components/button/exports.js +1 -0
- package/dist/collection/components/checkbox/checkbox.js +3 -3
- package/dist/collection/components/icon/exports.js +1 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/icon/riverty-kit.js +1 -1
- package/dist/collection/components/icon-button/icon-button.js +22 -3
- package/dist/collection/components/illustration/data.js +112 -0
- package/dist/collection/components/illustration/exports.js +3 -0
- package/dist/collection/components/illustration/illustration.js +540 -0
- package/dist/collection/components/illustration/illustration.scss +56 -0
- package/dist/collection/components/illustration/illustrations-ui-kit.js +2 -0
- package/dist/collection/components/input/exports.js +3 -0
- package/dist/collection/components/input/input.css +3 -0
- package/dist/collection/components/input/input.js +100 -3
- package/dist/collection/components/input-code/exports.js +2 -2
- package/dist/collection/components/input-code/input-code.css +6 -0
- package/dist/collection/components/input-code/input-code.js +54 -16
- package/dist/collection/components/input-date/input-date.js +6 -6
- package/dist/collection/components/input-password/input-password.js +2 -2
- package/dist/collection/components/input-phone-number/input-phone-number.js +3 -3
- package/dist/collection/components/label/label.js +2 -2
- package/dist/collection/components/list-item/list-item/list-item.css +46 -12
- package/dist/collection/components/list-item/list-item/list-item.js +34 -14
- package/dist/collection/components/pagination/pagination.css +33 -72
- package/dist/collection/components/pagination/pagination.js +194 -48
- package/dist/collection/components/panel/panel.css +40 -17
- package/dist/collection/components/panel/panel.js +6 -6
- package/dist/collection/components/popover/popover.css +0 -1
- package/dist/collection/components/popover/popover.js +44 -3
- 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 +7 -6
- 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.css +4 -1
- package/dist/collection/components/radio-group/radio-group.js +100 -8
- package/dist/collection/components/select/select.js +5 -3
- 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.css +5 -2
- package/dist/collection/components/stepper/stepper.js +125 -1
- package/dist/collection/components/stepper-item/stepper-item.css +25 -12
- package/dist/collection/components/stepper-item/stepper-item.js +36 -2
- package/dist/collection/components/tab/tab.css +29 -29
- package/dist/collection/components/tab/tab.js +5 -1
- package/dist/collection/components/tab-panel/tab-panel.js +1 -1
- package/dist/collection/components/tabs/tabs.js +34 -6
- package/dist/collection/components/tabs-list/exports.js +2 -0
- package/dist/collection/components/tabs-list/tabs-list.css +43 -2
- package/dist/collection/components/tabs-list/tabs-list.js +277 -1
- package/dist/collection/components/textarea/textarea.css +1 -1
- package/dist/collection/components/toast/toast.css +37 -11
- package/dist/collection/components/toast/toast.js +140 -18
- package/dist/collection/components/toast-group/toast-group.css +5 -11
- package/dist/collection/components/toast-group/toast-group.js +12 -3
- package/dist/collection/components/tooltip/tooltip.js +24 -4
- package/dist/esm/{index-Da7qOBFr.js → index-CTxpqopm.js} +9 -382
- package/dist/esm/loader.js +3 -3
- 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 +1 -1
- package/dist/esm/r-accordion.entry.js +1 -1
- package/dist/esm/r-alert.entry.js +9 -6
- package/dist/esm/r-badge.entry.js +1 -1
- package/dist/esm/r-button.entry.js +6 -2
- package/dist/esm/r-checkbox-group.entry.js +1 -1
- package/dist/esm/r-checkbox.entry.js +4 -4
- package/dist/esm/r-design-system-devtools.entry.js +1 -1
- package/dist/esm/r-dialog.entry.js +1 -1
- package/dist/esm/r-hint_2.entry.js +3 -3
- package/dist/esm/r-icon-button_2.entry.js +27 -7
- package/dist/esm/r-icon.entry.js +2 -2
- package/dist/esm/r-illustration.entry.js +394 -0
- package/dist/esm/r-input-code.entry.js +34 -12
- package/dist/esm/r-input-date.entry.js +7 -7
- package/dist/esm/r-input-password.entry.js +3 -3
- package/dist/esm/r-input-phone-number.entry.js +4 -4
- package/dist/esm/r-input.entry.js +8 -5
- package/dist/esm/r-list-item.entry.js +17 -16
- package/dist/esm/r-pagination.entry.js +56 -50
- package/dist/esm/r-panel.entry.js +6 -6
- package/dist/esm/r-popover-action.entry.js +2 -2
- package/dist/esm/r-popover-content.entry.js +2 -2
- package/dist/esm/r-popover-headline.entry.js +2 -2
- package/dist/esm/r-popover-trigger.entry.js +2 -2
- package/dist/esm/r-popover.entry.js +46 -5
- package/dist/esm/r-progress-bar.entry.js +2 -2
- package/dist/esm/r-radio-button-description.entry.js +2 -2
- package/dist/esm/r-radio-button-leading.entry.js +2 -2
- package/dist/esm/r-radio-button-title.entry.js +2 -2
- package/dist/esm/r-radio-button-trailing.entry.js +2 -2
- package/dist/esm/r-radio-button.entry.js +8 -7
- package/dist/esm/r-radio-group.entry.js +83 -10
- package/dist/esm/r-select-option.entry.js +2 -2
- package/dist/esm/r-select.entry.js +6 -4
- package/dist/esm/r-skip-link.entry.js +2 -2
- package/dist/esm/r-stepper-item.entry.js +19 -4
- package/dist/esm/r-stepper.entry.js +76 -3
- package/dist/esm/r-tab-panel.entry.js +2 -2
- package/dist/esm/r-tab.entry.js +7 -3
- package/dist/esm/r-tabs-list.entry.js +161 -3
- package/dist/esm/r-tabs.entry.js +35 -7
- package/dist/esm/r-textarea.entry.js +2 -2
- package/dist/esm/r-toast-group.entry.js +13 -4
- package/dist/esm/r-toast.entry.js +104 -15
- package/dist/esm/web-components.js +3 -3
- package/dist/types/components/alert/alert.d.ts +1 -0
- package/dist/types/components/button/button.d.ts +8 -1
- package/dist/types/components/button/exports.d.ts +2 -0
- package/dist/types/components/icon/{icon-data.d.ts → data.d.ts} +2 -1
- package/dist/types/components/icon/exports.d.ts +2 -1
- package/dist/types/components/icon/riverty-kit.d.ts +2 -1
- package/dist/types/components/icon-button/icon-button.d.ts +4 -0
- package/dist/types/components/illustration/data.d.ts +52 -0
- package/dist/types/components/illustration/exports.d.ts +23 -0
- package/dist/types/components/illustration/illustration.d.ts +51 -0
- package/dist/types/components/illustration/illustrations-ui-kit.d.ts +21 -0
- package/dist/types/components/input/exports.d.ts +6 -0
- package/dist/types/components/input/input.d.ts +31 -1
- package/dist/types/components/input-code/exports.d.ts +4 -4
- package/dist/types/components/input-code/input-code.d.ts +18 -4
- package/dist/types/components/list-item/list-item/list-item.d.ts +5 -3
- package/dist/types/components/pagination/pagination.d.ts +19 -0
- package/dist/types/components/popover/popover.d.ts +9 -0
- package/dist/types/components/radio-group/radio-group.d.ts +16 -0
- package/dist/types/components/stepper/stepper.d.ts +11 -0
- package/dist/types/components/stepper-item/stepper-item.d.ts +7 -0
- package/dist/types/components/tabs/tabs.d.ts +1 -0
- package/dist/types/components/tabs-list/exports.d.ts +4 -0
- package/dist/types/components/tabs-list/tabs-list.d.ts +38 -0
- package/dist/types/components/toast/toast.d.ts +20 -3
- package/dist/types/components/tooltip/tooltip.d.ts +5 -0
- package/dist/types/components.d.ts +360 -17
- package/dist/web-components/p-02b22f8e.entry.js +1 -0
- package/dist/web-components/{p-d054eb4d.entry.js → p-075a8dc8.entry.js} +1 -1
- package/dist/web-components/{p-8a66d20c.entry.js → p-0a34d33b.entry.js} +1 -1
- package/dist/web-components/{p-8c31cbd5.entry.js → p-10cc9983.entry.js} +1 -1
- package/dist/web-components/{p-d7726e46.entry.js → p-253068b9.entry.js} +1 -1
- package/dist/web-components/{p-3884c6e7.entry.js → p-3b8c8951.entry.js} +1 -1
- package/dist/web-components/{p-550e2237.entry.js → p-3beacdab.entry.js} +1 -1
- package/dist/web-components/{p-e2188953.entry.js → p-4214867d.entry.js} +1 -1
- package/dist/web-components/{p-3f60c6c0.entry.js → p-42c857e9.entry.js} +1 -1
- package/dist/web-components/{p-7fed6f4d.entry.js → p-44f87e16.entry.js} +1 -1
- package/dist/web-components/p-477614c5.entry.js +1 -0
- package/dist/web-components/{p-1da75540.entry.js → p-495ba3d2.entry.js} +1 -1
- package/dist/web-components/p-4de76291.entry.js +1 -0
- package/dist/web-components/{p-05738503.entry.js → p-55600d47.entry.js} +1 -1
- package/dist/web-components/p-562051aa.entry.js +1 -0
- package/dist/web-components/p-5b850e0f.entry.js +1 -0
- package/dist/web-components/p-6013dfc8.entry.js +1 -0
- package/dist/web-components/{p-6cc2ea2c.entry.js → p-62e7ae04.entry.js} +1 -1
- package/dist/web-components/p-71519d37.entry.js +1 -0
- package/dist/web-components/p-88f7b47f.entry.js +1 -0
- package/dist/web-components/p-8975a6a3.entry.js +1 -0
- package/dist/web-components/p-8e125826.entry.js +1 -0
- package/dist/web-components/p-91cc0bde.entry.js +1 -0
- package/dist/web-components/{p-0347feff.entry.js → p-93435fcd.entry.js} +1 -1
- package/dist/web-components/p-947969d7.entry.js +1 -0
- package/dist/web-components/p-95396b5c.entry.js +1 -0
- package/dist/web-components/p-9de3a1a5.entry.js +1 -0
- package/dist/web-components/p-9f583ed1.entry.js +1 -0
- package/dist/web-components/p-CTxpqopm.js +2 -0
- package/dist/web-components/{p-e5945c01.entry.js → p-a1086abe.entry.js} +1 -1
- package/dist/web-components/{p-f9d5004c.entry.js → p-bbba6d79.entry.js} +1 -1
- package/dist/web-components/{p-c478712b.entry.js → p-bde44ec4.entry.js} +1 -1
- package/dist/web-components/p-bfc7e6c0.entry.js +1 -0
- package/dist/web-components/p-c1030394.entry.js +1 -0
- package/dist/web-components/p-c1f59ed1.entry.js +1 -0
- package/dist/web-components/{p-26ef77d6.entry.js → p-c80a5541.entry.js} +1 -1
- package/dist/web-components/{p-9ef1bbee.entry.js → p-c96ee61a.entry.js} +1 -1
- package/dist/web-components/{p-8dac326b.entry.js → p-caf8f067.entry.js} +1 -1
- package/dist/web-components/p-cc363c3d.entry.js +1 -0
- package/dist/web-components/p-cf4ff357.entry.js +1 -0
- package/dist/web-components/p-d0310ed4.entry.js +1 -0
- package/dist/web-components/p-d1412932.entry.js +1 -0
- package/dist/web-components/{p-62b788bf.entry.js → p-d2447e30.entry.js} +1 -1
- package/dist/web-components/p-dc9cca06.entry.js +1 -0
- package/dist/web-components/p-e5b943a2.entry.js +1 -0
- package/dist/web-components/{p-4cc58c6a.entry.js → p-e67b13df.entry.js} +1 -1
- package/dist/web-components/p-efec231a.entry.js +1 -0
- package/dist/web-components/{p-4595fa8e.entry.js → p-f867e4c3.entry.js} +1 -1
- package/dist/web-components/web-components.esm.js +1 -1
- package/package.json +5 -2
- package/dist/collection/components/icon/bundled-icons/all-kit.json +0 -1
- package/dist/collection/components/icon/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/bundled-icons/all-kit.json +0 -1
- package/dist/web-components/bundled-icons/riverty-kit.json +0 -1
- package/dist/web-components/p-0e4c8bf1.entry.js +0 -1
- package/dist/web-components/p-3a5a67e7.entry.js +0 -1
- package/dist/web-components/p-4254a383.entry.js +0 -1
- package/dist/web-components/p-5441b746.entry.js +0 -1
- package/dist/web-components/p-589baaf9.entry.js +0 -1
- package/dist/web-components/p-60341de2.entry.js +0 -1
- package/dist/web-components/p-60ca994e.entry.js +0 -1
- package/dist/web-components/p-6303b9fe.entry.js +0 -1
- package/dist/web-components/p-63fd817d.entry.js +0 -1
- package/dist/web-components/p-673dbfd0.entry.js +0 -1
- package/dist/web-components/p-67fa3f84.entry.js +0 -1
- package/dist/web-components/p-6a4f3836.entry.js +0 -1
- package/dist/web-components/p-70784685.entry.js +0 -1
- package/dist/web-components/p-8b4d2448.entry.js +0 -1
- package/dist/web-components/p-Da7qOBFr.js +0 -2
- package/dist/web-components/p-a0dbde7c.entry.js +0 -1
- package/dist/web-components/p-a71485d8.entry.js +0 -1
- package/dist/web-components/p-a7d22c76.entry.js +0 -1
- package/dist/web-components/p-ae251d2f.entry.js +0 -1
- package/dist/web-components/p-b98ab649.entry.js +0 -1
- package/dist/web-components/p-b9e3b3d6.entry.js +0 -1
- package/dist/web-components/p-c1e748f2.entry.js +0 -1
- package/dist/web-components/p-d433a828.entry.js +0 -1
- package/dist/web-components/p-d819c8e5.entry.js +0 -1
- package/dist/web-components/p-f7adb875.entry.js +0 -1
- /package/dist/collection/components/icon/{icon-data.js → data.js} +0 -0
|
@@ -282,7 +282,6 @@ export class RInput {
|
|
|
282
282
|
const regex = new RegExp(this.pattern, 'u');
|
|
283
283
|
return regex.test(this.value);
|
|
284
284
|
}
|
|
285
|
-
;
|
|
286
285
|
componentWillLoad() {
|
|
287
286
|
this.initial['value'] = this.value;
|
|
288
287
|
this.initial['invalid'] = this.invalid;
|
|
@@ -315,7 +314,7 @@ export class RInput {
|
|
|
315
314
|
this.setValue(this.nativeElement.value);
|
|
316
315
|
}
|
|
317
316
|
render() {
|
|
318
|
-
const { name, placeholder, required, fieldIndicator, maxlength, minlength, min, max, value, disabled, form, pattern, invalid, valid, hint, label, internal, uniqueId, autocomplete, readonly, autofocus, passwordrules, validityMarker } = this;
|
|
317
|
+
const { name, placeholder, required, fieldIndicator, maxlength, minlength, min, max, value, disabled, form, pattern, invalid, valid, hint, label, internal, uniqueId, autocomplete, readonly, autofocus, passwordrules, enterkeyhint, spellcheck, autocapitalize, validityMarker } = this;
|
|
319
318
|
const inputAttrs = {
|
|
320
319
|
disabled,
|
|
321
320
|
readonly,
|
|
@@ -332,6 +331,10 @@ export class RInput {
|
|
|
332
331
|
autocomplete,
|
|
333
332
|
autofocus: autofocus || null,
|
|
334
333
|
passwordrules,
|
|
334
|
+
enterkeyhint,
|
|
335
|
+
autocapitalize,
|
|
336
|
+
spellcheck,
|
|
337
|
+
inputmode: this.inputmode || null,
|
|
335
338
|
id: uniqueId,
|
|
336
339
|
'data-value': value,
|
|
337
340
|
'aria-placeholder': placeholder,
|
|
@@ -358,7 +361,7 @@ export class RInput {
|
|
|
358
361
|
return null;
|
|
359
362
|
const iconName = shouldShowInvalidMarker ? icons.invalid : icons.valid;
|
|
360
363
|
const iconColor = shouldShowInvalidMarker ? colors.invalid : colors.valid;
|
|
361
|
-
return h("r-icon", { class: "r-input--validation-icon", "aria-hidden": true, size: "s", name: iconName, color: iconColor });
|
|
364
|
+
return h("r-icon", { class: "r-input--validation-icon", "aria-hidden": "true", size: "s", name: iconName, color: iconColor });
|
|
362
365
|
};
|
|
363
366
|
// Filter out event listener properties based on naming convention.
|
|
364
367
|
// Pass them to native element.
|
|
@@ -1031,6 +1034,75 @@ export class RInput {
|
|
|
1031
1034
|
"setter": false,
|
|
1032
1035
|
"reflect": false
|
|
1033
1036
|
},
|
|
1037
|
+
"enterkeyhint": {
|
|
1038
|
+
"type": "string",
|
|
1039
|
+
"attribute": "enterkeyhint",
|
|
1040
|
+
"mutable": false,
|
|
1041
|
+
"complexType": {
|
|
1042
|
+
"original": "EnterKeyHint",
|
|
1043
|
+
"resolved": "\"done\" | \"enter\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\"",
|
|
1044
|
+
"references": {
|
|
1045
|
+
"EnterKeyHint": {
|
|
1046
|
+
"location": "import",
|
|
1047
|
+
"path": "./exports",
|
|
1048
|
+
"id": "src/components/input/exports.ts::EnterKeyHint"
|
|
1049
|
+
}
|
|
1050
|
+
}
|
|
1051
|
+
},
|
|
1052
|
+
"required": false,
|
|
1053
|
+
"optional": true,
|
|
1054
|
+
"docs": {
|
|
1055
|
+
"tags": [],
|
|
1056
|
+
"text": "Hint for the action label/icon on the virtual keyboard's enter key.\nUse cases:\n- `enter`: Default, generic newline/submit action\n- `done`: Finishes current input session (e.g., last field in a form)\n- `go`: Navigates to URL input target (e.g., URL bar)\n- `next`: Advances to next input field in a sequence\n- `previous`: Goes back to previous input field\n- `search`: Submits a search query\n- `send`: Sends a message (e.g., chat, email)"
|
|
1057
|
+
},
|
|
1058
|
+
"getter": false,
|
|
1059
|
+
"setter": false,
|
|
1060
|
+
"reflect": false
|
|
1061
|
+
},
|
|
1062
|
+
"spellcheck": {
|
|
1063
|
+
"type": "boolean",
|
|
1064
|
+
"attribute": "spellcheck",
|
|
1065
|
+
"mutable": true,
|
|
1066
|
+
"complexType": {
|
|
1067
|
+
"original": "boolean",
|
|
1068
|
+
"resolved": "boolean",
|
|
1069
|
+
"references": {}
|
|
1070
|
+
},
|
|
1071
|
+
"required": false,
|
|
1072
|
+
"optional": true,
|
|
1073
|
+
"docs": {
|
|
1074
|
+
"tags": [],
|
|
1075
|
+
"text": "Controls browser spell-checking for text input.\nWhen true, enables spell-checking; when false, disables it.\nBrowser default behavior applies when not specified."
|
|
1076
|
+
},
|
|
1077
|
+
"getter": false,
|
|
1078
|
+
"setter": false,
|
|
1079
|
+
"reflect": true
|
|
1080
|
+
},
|
|
1081
|
+
"autocapitalize": {
|
|
1082
|
+
"type": "string",
|
|
1083
|
+
"attribute": "autocapitalize",
|
|
1084
|
+
"mutable": false,
|
|
1085
|
+
"complexType": {
|
|
1086
|
+
"original": "AutocapitalizeType",
|
|
1087
|
+
"resolved": "\"characters\" | \"none\" | \"off\" | \"on\" | \"sentences\" | \"words\"",
|
|
1088
|
+
"references": {
|
|
1089
|
+
"AutocapitalizeType": {
|
|
1090
|
+
"location": "import",
|
|
1091
|
+
"path": "./exports",
|
|
1092
|
+
"id": "src/components/input/exports.ts::AutocapitalizeType"
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
},
|
|
1096
|
+
"required": false,
|
|
1097
|
+
"optional": true,
|
|
1098
|
+
"docs": {
|
|
1099
|
+
"tags": [],
|
|
1100
|
+
"text": "Controls automatic capitalization of text input on mobile devices.\n- `off` or `none`: No automatic capitalization\n- `on` or `sentences`: Capitalize first letter of each sentence (default for most text inputs)\n- `words`: Capitalize first letter of each word\n- `characters`: Capitalize all characters"
|
|
1101
|
+
},
|
|
1102
|
+
"getter": false,
|
|
1103
|
+
"setter": false,
|
|
1104
|
+
"reflect": false
|
|
1105
|
+
},
|
|
1034
1106
|
"passwordrules": {
|
|
1035
1107
|
"type": "string",
|
|
1036
1108
|
"attribute": "passwordrules",
|
|
@@ -1088,6 +1160,31 @@ export class RInput {
|
|
|
1088
1160
|
"setter": false,
|
|
1089
1161
|
"reflect": true
|
|
1090
1162
|
},
|
|
1163
|
+
"inputmode": {
|
|
1164
|
+
"type": "string",
|
|
1165
|
+
"attribute": "inputmode",
|
|
1166
|
+
"mutable": false,
|
|
1167
|
+
"complexType": {
|
|
1168
|
+
"original": "InputMode",
|
|
1169
|
+
"resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
|
|
1170
|
+
"references": {
|
|
1171
|
+
"InputMode": {
|
|
1172
|
+
"location": "import",
|
|
1173
|
+
"path": "./exports",
|
|
1174
|
+
"id": "src/components/input/exports.ts::InputMode"
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
},
|
|
1178
|
+
"required": false,
|
|
1179
|
+
"optional": true,
|
|
1180
|
+
"docs": {
|
|
1181
|
+
"tags": [],
|
|
1182
|
+
"text": "Hint to the browser about which keyboard to display on mobile devices."
|
|
1183
|
+
},
|
|
1184
|
+
"getter": false,
|
|
1185
|
+
"setter": false,
|
|
1186
|
+
"reflect": false
|
|
1187
|
+
},
|
|
1091
1188
|
"validityMarker": {
|
|
1092
1189
|
"type": "boolean",
|
|
1093
1190
|
"attribute": "validity-marker",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
1
|
+
export const InputCodeInputModeArray = ['none', 'text', 'tel', 'url', 'email', 'numeric', 'decimal', 'search'];
|
|
2
|
+
export const InputCodeEnterKeyHintArray = ['enter', 'done', 'go', 'next', 'previous', 'search', 'send'];
|
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
margin-left: auto;
|
|
13
13
|
}
|
|
14
|
+
:host .r-form-field {
|
|
15
|
+
display: flex;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: start;
|
|
18
|
+
gap: 1rem;
|
|
19
|
+
}
|
|
14
20
|
|
|
15
21
|
:host([readonly]:not([readonly=false])) {
|
|
16
22
|
--r-input-code--container--background-color: var(--r-background-soft, #f3f1f0);
|
|
@@ -28,11 +28,35 @@ export class InputCode {
|
|
|
28
28
|
this.autocomplete = 'one-time-code';
|
|
29
29
|
/** Holds the current values of each input box */
|
|
30
30
|
this.values = [];
|
|
31
|
+
/** Tracks whether the component was previously in a complete state */
|
|
32
|
+
this.wasComplete = false;
|
|
33
|
+
/** Tracks the last completed value to detect changes */
|
|
34
|
+
this.lastCompletedValue = '';
|
|
31
35
|
/** Validity state passed from validateFormElement function after validation */
|
|
32
36
|
this.validityState = '';
|
|
33
37
|
/** Validity message passed from validateFormElement function after validation */
|
|
34
38
|
this.validityMessage = '';
|
|
35
39
|
this.inputs = [];
|
|
40
|
+
/**
|
|
41
|
+
* Checks if all segments are filled and emits rComplete event when:
|
|
42
|
+
* 1. Transitioning from incomplete to complete
|
|
43
|
+
* 2. Complete and value has changed from previous completed value
|
|
44
|
+
*/
|
|
45
|
+
this.checkAndEmitCompletion = () => {
|
|
46
|
+
const isFullLength = this.value.length === this.length;
|
|
47
|
+
const isNoEmptySegments = this.values.every(val => val !== '');
|
|
48
|
+
const isComplete = isFullLength && isNoEmptySegments;
|
|
49
|
+
// Emit when transitioning to complete OR when complete with a different value
|
|
50
|
+
if (isComplete && (!this.wasComplete || this.value !== this.lastCompletedValue)) {
|
|
51
|
+
this.wasComplete = true;
|
|
52
|
+
this.lastCompletedValue = this.value;
|
|
53
|
+
this.rComplete.emit({ value: this.value, isComplete: true });
|
|
54
|
+
}
|
|
55
|
+
else if (!isComplete && this.wasComplete) {
|
|
56
|
+
// Reset the flag when becoming incomplete
|
|
57
|
+
this.wasComplete = false;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
36
60
|
this.handleInput = (index, event) => {
|
|
37
61
|
var _a;
|
|
38
62
|
if (this.readonly)
|
|
@@ -277,6 +301,7 @@ export class InputCode {
|
|
|
277
301
|
}
|
|
278
302
|
handleValuesChange() {
|
|
279
303
|
this.value = this.values.join('');
|
|
304
|
+
this.checkAndEmitCompletion();
|
|
280
305
|
}
|
|
281
306
|
handleLengthChange(newLength) {
|
|
282
307
|
// Adjust values array when length changes
|
|
@@ -356,9 +381,6 @@ export class InputCode {
|
|
|
356
381
|
return `${uniqueId}-hint`;
|
|
357
382
|
return null;
|
|
358
383
|
}
|
|
359
|
-
get hasTrailingSlot() {
|
|
360
|
-
return !!this.host.querySelector('[slot="trailing"]');
|
|
361
|
-
}
|
|
362
384
|
componentWillLoad() {
|
|
363
385
|
this.setValue(this.value);
|
|
364
386
|
}
|
|
@@ -380,15 +402,14 @@ export class InputCode {
|
|
|
380
402
|
id: `${uniqueId}-label`,
|
|
381
403
|
fieldIndicator
|
|
382
404
|
} : {};
|
|
383
|
-
return (h(Host, { key: '
|
|
405
|
+
return (h(Host, { key: 'c7e8e45bf54b060eaeec903857ec842f5f5909ff', value: this.value, onClick: this.onHostClick }, h("div", { key: '965e94721f83a4e0c2a21d6ead371085b5faefef', class: "r-input-code--label-container" }, h("label", { key: '4a24884c394cbdf28f98f71dd166c7f02fd6b240', htmlFor: uniqueId }, label ?
|
|
384
406
|
h("r-label", Object.assign({}, labelAttr), label)
|
|
385
407
|
:
|
|
386
|
-
h("slot", { name: "label" })), h("slot", { key: '
|
|
387
|
-
h("r-hint", { key: '
|
|
388
|
-
h("r-icon", { key: '
|
|
389
|
-
h("slot", { key: '
|
|
390
|
-
|
|
391
|
-
h("r-hint", { key: '39e47e0fdf23b1ebab5a0384447a965a8890d77f', "aria-live": "polite", id: `${uniqueId}-message`, variant: "error" }, this.message))));
|
|
408
|
+
h("slot", { name: "label" })), h("slot", { key: '471642b0c4c01243fb26eacec958418ef09af962', name: "popover" })), hint &&
|
|
409
|
+
h("r-hint", { key: 'efdb3d68d72666260bce9d6e9e6ba9853225a473', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '2dc16569529ac0ec9e95cfef8f353efbf2f0e929', class: "r-form-field" }, h("slot", { key: '7e3d7abc1931537ce66f6bd1c716f4046f2ca06e', name: "prefix" }), h("div", { key: '0e29ba435fe9de7b87cad793be8dc11301bf552e', class: "r-input-code--container", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.groupDescribedby }, h("slot", { key: 'eef6bda22af5d2e21f442bb010d79a60a05b4d69', 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: 'a2185f3e1b5f83e55fa5997662b55002bb251b4c', type: "hidden" }, inputAttrs, { value: this.values.join(''), ref: el => this.nativeElement = el })), h("div", { key: '7586c976c27a2c42e9d76c1cf6724ad93beac0ae', class: "r-input-code--trailing" }, this.readonly &&
|
|
410
|
+
h("r-icon", { key: 'b2829cc59cd037f62e33f980fa65887e80059984', class: "r-input-code--readonly-icon", name: "pen-disabled", size: "s" }), h("slot", { key: 'e7b996a710b4f2f5f867295518b96952d6d60444', name: "trailing" }, valid &&
|
|
411
|
+
h("r-icon", { key: '3064219d8e6846df86dc934027a561f265fcc82f', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" })))), h("slot", { key: 'de7164a83a2d8c6b8bf97583d4407cc7be7e0db4', name: "suffix" })), h("slot", { key: 'e12c343b123421fec18546f60ccdb2e4d6ceab5b', name: "message" }, this.hasMessage &&
|
|
412
|
+
h("r-hint", { key: '7fcfab6c47d841a0b695805b61f4a12a164fca3c', "aria-live": "polite", id: `${uniqueId}-message`, variant: "error" }, this.message))));
|
|
392
413
|
}
|
|
393
414
|
static get is() { return "r-input-code"; }
|
|
394
415
|
static get encapsulation() { return "shadow"; }
|
|
@@ -780,13 +801,13 @@ export class InputCode {
|
|
|
780
801
|
"attribute": "inputmode",
|
|
781
802
|
"mutable": false,
|
|
782
803
|
"complexType": {
|
|
783
|
-
"original": "
|
|
804
|
+
"original": "InputCodeInputMode",
|
|
784
805
|
"resolved": "\"decimal\" | \"email\" | \"none\" | \"numeric\" | \"search\" | \"tel\" | \"text\" | \"url\"",
|
|
785
806
|
"references": {
|
|
786
|
-
"
|
|
807
|
+
"InputCodeInputMode": {
|
|
787
808
|
"location": "import",
|
|
788
809
|
"path": "./exports",
|
|
789
|
-
"id": "src/components/input-code/exports.ts::
|
|
810
|
+
"id": "src/components/input-code/exports.ts::InputCodeInputMode"
|
|
790
811
|
}
|
|
791
812
|
}
|
|
792
813
|
},
|
|
@@ -809,13 +830,13 @@ export class InputCode {
|
|
|
809
830
|
"attribute": "enterkeyhint",
|
|
810
831
|
"mutable": false,
|
|
811
832
|
"complexType": {
|
|
812
|
-
"original": "
|
|
833
|
+
"original": "InputCodeEnterKeyHint",
|
|
813
834
|
"resolved": "\"done\" | \"enter\" | \"go\" | \"next\" | \"previous\" | \"search\" | \"send\"",
|
|
814
835
|
"references": {
|
|
815
|
-
"
|
|
836
|
+
"InputCodeEnterKeyHint": {
|
|
816
837
|
"location": "import",
|
|
817
838
|
"path": "./exports",
|
|
818
|
-
"id": "src/components/input-code/exports.ts::
|
|
839
|
+
"id": "src/components/input-code/exports.ts::InputCodeEnterKeyHint"
|
|
819
840
|
}
|
|
820
841
|
}
|
|
821
842
|
},
|
|
@@ -861,6 +882,8 @@ export class InputCode {
|
|
|
861
882
|
static get states() {
|
|
862
883
|
return {
|
|
863
884
|
"values": {},
|
|
885
|
+
"wasComplete": {},
|
|
886
|
+
"lastCompletedValue": {},
|
|
864
887
|
"validityState": {},
|
|
865
888
|
"validityMessage": {}
|
|
866
889
|
};
|
|
@@ -916,6 +939,21 @@ export class InputCode {
|
|
|
916
939
|
}
|
|
917
940
|
}
|
|
918
941
|
}
|
|
942
|
+
}, {
|
|
943
|
+
"method": "rComplete",
|
|
944
|
+
"name": "rComplete",
|
|
945
|
+
"bubbles": true,
|
|
946
|
+
"cancelable": true,
|
|
947
|
+
"composed": true,
|
|
948
|
+
"docs": {
|
|
949
|
+
"tags": [],
|
|
950
|
+
"text": "Emits when all segments are filled with values"
|
|
951
|
+
},
|
|
952
|
+
"complexType": {
|
|
953
|
+
"original": "{ value: string, isComplete: boolean }",
|
|
954
|
+
"resolved": "{ value: string; isComplete: boolean; }",
|
|
955
|
+
"references": {}
|
|
956
|
+
}
|
|
919
957
|
}];
|
|
920
958
|
}
|
|
921
959
|
static get methods() {
|
|
@@ -451,14 +451,14 @@ export class InputDate {
|
|
|
451
451
|
id: `${uniqueId}-label`,
|
|
452
452
|
fieldIndicator
|
|
453
453
|
} : {};
|
|
454
|
-
return (h(Host, { key: '
|
|
454
|
+
return (h(Host, { key: '1fe0cc5598857ca719ef334807da6e2540c4a399', onClick: this.onHostClick, "data-touched": `${this.touched}`, "data-dirty": `${this.dirty}` }, h("fieldset", Object.assign({ key: 'a7ad4075376fc3d08cc59be2f4340c9327e05f82', class: "r-input-date" }, groupAttrs), h("div", { key: 'ec18205fad6069d54715807529a145d03f8bdebb', class: "r-input-date--legend-container" }, h("legend", { key: '59c4384b37a3a845eb5cb0c2955b8a12777b2320', class: "r-input-date--legend" }, h("label", { key: '8b5502aeb26daa26d3f32d3669406b87e2eb29ca', htmlFor: uniqueId }, label ?
|
|
455
455
|
h("r-label", Object.assign({}, labelAttr), label)
|
|
456
456
|
:
|
|
457
|
-
h("slot", { name: "label" }))), h("slot", { key: '
|
|
458
|
-
h("r-hint", { key: '
|
|
459
|
-
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: '
|
|
460
|
-
h("r-icon", { key: '
|
|
461
|
-
h("r-icon", { key: '
|
|
457
|
+
h("slot", { name: "label" }))), h("slot", { key: '7a5b5ad6401bb8199d94c36383e4219fd3556db5', name: "popover" })), hint &&
|
|
458
|
+
h("r-hint", { key: '1226c6002eb581811e419db7518e02d5fbc18b5b', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: '5581e3cbb731a4a23a243118f2840563352e6df1', class: "r-input-date--container" }, h("r-icon", { key: 'e8b52fc6fcb1d4f22fd24e7e26e55218a1b6ee80', name: "calendar", size: "s", class: "r-input-date--calendar-icon" }), h("div", { key: '4b97bab9a65f4a9d1958287f23940b7ee4d7143e', 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 &&
|
|
459
|
+
h("span", { "aria-hidden": "true", class: "r-input-date--delimiter" }, this.delimiter)))), h("input", Object.assign({ key: 'fdebeb8a48fd0fc10233166db94e928fc4b424de', type: "hidden" }, dateInputAttrs, { value: this.value, ref: (el) => this.nativeElement = el }))), h("div", { key: '4324ae4593512d0bd16f843e60c2058859cc1ba1', class: "r-input-date--trailing" }, this.readonly &&
|
|
460
|
+
h("r-icon", { key: '673fb144899c62d9b5d9267b35ce1f197b1f6549', class: "r-input-date--readonly-icon", name: "pen-disabled", size: "s" }), valid &&
|
|
461
|
+
h("r-icon", { key: '26828285dad4ccae6ebc8d29a2f4e1e6a5d92a6d', name: "circled-check", size: "s", color: "var(--r-status-success-regular)" }), this.hasTrailingSlot && h("slot", { key: 'bda392fa837a8fba6917fed22ff356c4e6f15b85', name: "trailing" }))), h("div", { key: 'a6d891a2f2bf3456d5cbb3ec27c6cef0bce7d434', id: `${uniqueId}-message`, "aria-live": "polite", class: "r-input-date--message" }, this.hasMessage && h("r-hint", { key: '8a3316ce851bfa02b9ca1a1fad8fde6f48a7fab6', variant: "error" }, this.message)))));
|
|
462
462
|
}
|
|
463
463
|
static get is() { return "r-input-date"; }
|
|
464
464
|
static get encapsulation() { return "shadow"; }
|
|
@@ -244,8 +244,8 @@ export class InputPassword {
|
|
|
244
244
|
tooShortMessage,
|
|
245
245
|
patternMismatchMessage
|
|
246
246
|
};
|
|
247
|
-
return (h(Host, { key: '
|
|
248
|
-
h("r-hint", { key: '
|
|
247
|
+
return (h(Host, { key: 'c4f877854375e558677df5f33682e37e048382be' }, h("r-input", Object.assign({ key: '97941b514a5f4f48b7c043ea0641cc5f26ab2ced' }, 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: '6c59c76305a41bcd4c0bfc109f7e207a871118e5', name: "padlock-closed", size: "s", slot: "leading" }), h("slot", { key: '921c7c3309a362a0e1d273e382bc43fe9a627257', name: "popover", slot: "popover" }), h("r-icon-button", { key: 'cd258b86fec5b52818fe711b078514feee825866', slot: "trailing", name: showed ? 'eye-crossed-out' : 'eye', size: "s", disabled: disabled, label: showed ? hidePasswordAriaLabel : showPasswordAriaLabel, onClick: this.onShowClick }), this.hasMessage &&
|
|
248
|
+
h("r-hint", { key: '667984f03375ec43be01732309020c45c81d9306', slot: "message", variant: "error" }, this.hasError && this.error, this.hasValidationError && (this.customErrorMessage || this.validityMessage))), h("div", { key: '6d950d7eb59905342e328047f45f9b5ae3f6f8cb', class: "visually-hidden", ref: el => this.passwordVisibilityChangeAlertContainer = el, "aria-live": "polite" })));
|
|
249
249
|
}
|
|
250
250
|
static get is() { return "r-input-password"; }
|
|
251
251
|
static get encapsulation() { return "shadow"; }
|
|
@@ -284,9 +284,9 @@ export class InputPhoneNumber {
|
|
|
284
284
|
disabled,
|
|
285
285
|
'aria-describedby': this.ariaDescribedBy
|
|
286
286
|
};
|
|
287
|
-
return (h(Host, { key: '
|
|
288
|
-
h("r-label", Object.assign({ key: '
|
|
289
|
-
h("r-hint", { key: '
|
|
287
|
+
return (h(Host, { key: '609e5cd2c326c30866617a238f7c92bb8b2d5e8d' }, h("div", { key: '44eaa8f48fddbdc9dfe43700b4b68650345e1352', class: "r-input-phone-number--label-container" }, h("label", { key: 'fd55a14c4491ed6cad0885aaa5add8d827ae4215', id: `${uniqueId}-label` }, label &&
|
|
288
|
+
h("r-label", Object.assign({ key: 'bdeb1325cefaf4ac82628e497133c3eabfa685d3' }, labelAttr), label)), h("slot", { key: '38a4fd3c1f5ed0748ef9df0e2f6cd93ff8d1d39f', name: "popover" })), hint &&
|
|
289
|
+
h("r-hint", { key: '9fddd5b8053220e2339fe073cf1d897d0c34c23e', id: `${uniqueId}-hint`, role: "note" }, hint), h("div", { key: 'c493d4fe2f75cfa25fc404e985800175dfc75603', class: "r-input-phone-number", role: "group", "aria-labelledby": `${uniqueId}-label`, "aria-describedby": this.ariaDescribedBy }, h("slot", { key: 'ee98939143432df877ac2b7c2bbb7d87fd01f0a7' }), h("r-input", { key: '552c038f9225dd60b3b1957aaa1ceb3587c5f64d', 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: '11edb8cd2f8d6459ffbdef96263016ee25818fc0', type: "hidden" }, inputAttrs, { readonly: this.readonly, value: fullPhoneNumber, ref: el => this.nativeElement = el })), h("r-hint", { key: '809dbf93afc32271fd6d4930c0f547d8464b4db0', "aria-live": "polite", "aria-atomic": "true", id: `${uniqueId}-message`, class: !this.hasMessage && 'visually-hidden', variant: "error" }, this.hasMessage ? (this.hasError ? this.error : this.validityMessage) : '')));
|
|
290
290
|
}
|
|
291
291
|
static get is() { return "r-input-phone-number"; }
|
|
292
292
|
static get encapsulation() { return "shadow"; }
|
|
@@ -6,8 +6,8 @@ import { Host, h } from "@stencil/core";
|
|
|
6
6
|
export class RLabel {
|
|
7
7
|
render() {
|
|
8
8
|
const { fieldIndicator } = this;
|
|
9
|
-
return (h(Host, { key: '
|
|
10
|
-
h("span", { key: '
|
|
9
|
+
return (h(Host, { key: '4a8c827bf39bac03424a1caefeb8795871b08276' }, h("div", { key: '212ea6fc9e2476361083610c6b8801ea3a4d79e9', class: "r-label" }, h("span", { key: '0bf0a1fc635553165fe02937626cba8a44854f3d', class: "r-label--slot" }, h("slot", { key: '16165450aeffd754cbcac5640297ab4efe94bf4c' }), fieldIndicator &&
|
|
10
|
+
h("span", { key: '34e19397cff4fa69839475ece1077c4271d9ceb4', class: "r-label--marker" }, fieldIndicator)))));
|
|
11
11
|
}
|
|
12
12
|
static get is() { return "r-label"; }
|
|
13
13
|
static get encapsulation() { return "shadow"; }
|
|
@@ -53,12 +53,6 @@
|
|
|
53
53
|
--r-list-item--background-color: var(--r-background-interactive-pressed, rgba(40, 40, 40, 0.12));
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
:host(:focus-visible:not(:active)) .r-list-item {
|
|
57
|
-
--r-list-item--box-shadow: 0 0 0 6px var(--r-border-focused-outlined, #fff);
|
|
58
|
-
--r-list-item--outline: 2px solid var(--r-border-focused, #0071e3);
|
|
59
|
-
--r-list-item--outline-offset: 2px;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
56
|
:host(:focus-within) .r-list-item[href] {
|
|
63
57
|
--r-list-item--box-shadow: 0 0 0 6px var(--r-border-focused-outlined, #fff);
|
|
64
58
|
--r-list-item--outline: 2px solid var(--r-border-focused, #0071e3);
|
|
@@ -92,9 +86,9 @@
|
|
|
92
86
|
display: var(--r-list-item--display, flex);
|
|
93
87
|
align-items: var(--r-list-item--align-items, center);
|
|
94
88
|
justify-content: var(--r-list-item--justify-content, center);
|
|
95
|
-
gap: var(--r-list-item--gap,
|
|
89
|
+
gap: var(--r-list-item--gap, var(--r-spacing-100, 1rem));
|
|
96
90
|
width: var(--r-list-item--width, inherit);
|
|
97
|
-
padding: var(--r-list-item--padding,
|
|
91
|
+
padding: var(--r-list-item--padding, var(--r-spacing-100, 1rem));
|
|
98
92
|
margin-left: var(--r-list-item--margin-left, 0);
|
|
99
93
|
opacity: var(--r-list-item--opacity, 1);
|
|
100
94
|
color: var(--r-list-item--color, inherit);
|
|
@@ -102,15 +96,23 @@
|
|
|
102
96
|
outline: var(--r-list-item--outline, none);
|
|
103
97
|
outline-offset: var(--r-list-item--outline-offset, 0);
|
|
104
98
|
text-decoration: var(--r-list-item--text-decoration, none);
|
|
99
|
+
text-align: var(--r-list-item--text-align, left);
|
|
105
100
|
background-color: var(--r-list-item--background-color, transparent);
|
|
106
101
|
border-style: var(--r-list-item--border-style, solid);
|
|
107
102
|
border-width: var(--r-list-item--border-width, 0);
|
|
108
103
|
border-color: var(--r-list-item--border-color, transparent);
|
|
109
104
|
cursor: var(--r-list-item--cursor, inherit);
|
|
110
105
|
font-weight: var(--r-list-item--font-weight, var(--r-font-weight-regular, 400));
|
|
111
|
-
|
|
106
|
+
font-family: var(--r-list-item--font-family, var(--r-font-family-text, system-ui));
|
|
107
|
+
}
|
|
108
|
+
.r-list-item:focus-visible {
|
|
109
|
+
--r-list-item--box-shadow: 0 0 0 6px var(--r-border-focused-outlined, #fff);
|
|
110
|
+
--r-list-item--outline: 2px solid var(--r-border-focused, #0071e3);
|
|
111
|
+
--r-list-item--outline-offset: 2px;
|
|
112
112
|
}
|
|
113
113
|
.r-list-item--leading {
|
|
114
|
+
display: var(--r-list-item--leading--display, flex);
|
|
115
|
+
align-items: var(--r-list-item--leading--align-items, center);
|
|
114
116
|
color: var(--r-list-item--leading--color, var(--r-icon-soft, #686868));
|
|
115
117
|
}
|
|
116
118
|
.r-list-item--leading-icon {
|
|
@@ -119,7 +121,7 @@
|
|
|
119
121
|
.r-list-item--trailing {
|
|
120
122
|
display: var(--r-list-item--trailing--display, flex);
|
|
121
123
|
align-self: var(--r-list-item--trailing--align-self, center);
|
|
122
|
-
gap: var(--r-list-item--trailing--gap,
|
|
124
|
+
gap: var(--r-list-item--trailing--gap, var(--r-spacing-050, 0.5rem));
|
|
123
125
|
color: var(--r-list-item--trailing--color, inherit);
|
|
124
126
|
}
|
|
125
127
|
.r-list-item--trailing-icon {
|
|
@@ -133,18 +135,21 @@
|
|
|
133
135
|
}
|
|
134
136
|
.r-list-item--trailing ::slotted(*) {
|
|
135
137
|
display: var(--r-list-item--trailing-slotted--display, flex);
|
|
136
|
-
gap: var(--r-list-item--trailing-slotted--display,
|
|
138
|
+
gap: var(--r-list-item--trailing-slotted--display, var(--r-spacing-050, 0.5rem));
|
|
137
139
|
}
|
|
138
140
|
.r-list-item--text {
|
|
139
141
|
display: var(--r-list-item--text--display, flex);
|
|
140
142
|
flex-grow: var(--r-list-item--text--flex-grow, 1);
|
|
141
143
|
flex-direction: var(--r-list-item--text--flex-direction, column);
|
|
142
|
-
gap: var(--r-list-item--text--gap,
|
|
144
|
+
gap: var(--r-list-item--text--gap, 0.125rem);
|
|
143
145
|
white-space: var(--r-list-item--text--white-space, normal);
|
|
144
146
|
overflow: var(--r-list-item--text--overflow, hidden);
|
|
145
147
|
text-overflow: var(--r-list-item--text--text-overflow, ellipsis);
|
|
146
148
|
font-weight: var(--r-list-item--trailing-text--font-weight, inherit);
|
|
147
149
|
}
|
|
150
|
+
.r-list-item--sr-text {
|
|
151
|
+
display: var(--r-list-item--sr-text--display, none);
|
|
152
|
+
}
|
|
148
153
|
.r-list-item--headline {
|
|
149
154
|
font-size: var(--r-list-item--headline--font-size, 1rem);
|
|
150
155
|
font-weight: var(--r-list-item--headline--font-weight, 600);
|
|
@@ -163,3 +168,32 @@
|
|
|
163
168
|
.r-list-item--description ::slotted(a) {
|
|
164
169
|
color: var(--r-list-item--description--color, inherit);
|
|
165
170
|
}
|
|
171
|
+
|
|
172
|
+
.r-list-item-wrapper {
|
|
173
|
+
width: var(--r-list-item-wrapper--width, 100%);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.sub-items {
|
|
177
|
+
margin: var(--r-sub-items--margin, 0);
|
|
178
|
+
padding: var(--r-sub-items--padding, 0);
|
|
179
|
+
list-style-type: var(--r-sub-items--list-style-type, "");
|
|
180
|
+
}
|
|
181
|
+
.sub-items[aria-hidden=true] {
|
|
182
|
+
display: none;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.visually-hidden {
|
|
186
|
+
position: absolute;
|
|
187
|
+
width: 0.0625rem;
|
|
188
|
+
height: 0.0625rem;
|
|
189
|
+
clip: rect(0 0 0 0);
|
|
190
|
+
clip-path: inset(50%);
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
white-space: nowrap;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@media (prefers-reduced-motion) {
|
|
196
|
+
.r-list-item--trailing-icon {
|
|
197
|
+
transition: none;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
@@ -5,6 +5,8 @@ export class RListItem {
|
|
|
5
5
|
this.variant = 'list-item';
|
|
6
6
|
/** Determines whether the list item is expanded to show its subitems. It can be toggled programmatically or through user interaction. */
|
|
7
7
|
this.expanded = false;
|
|
8
|
+
/** Unique id for each subItem list */
|
|
9
|
+
this.uniqueSubmitemsId = `r-list-item-subitems-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
8
10
|
this.isEl = (selector) => {
|
|
9
11
|
return this.host.querySelector(selector) !== null;
|
|
10
12
|
};
|
|
@@ -46,6 +48,10 @@ export class RListItem {
|
|
|
46
48
|
get isDescriptionSlot() {
|
|
47
49
|
return this.isEl('[slot="description"]');
|
|
48
50
|
}
|
|
51
|
+
get headlineContent() {
|
|
52
|
+
var _a;
|
|
53
|
+
return ((_a = this.host.querySelector('[slot="headline"]')) === null || _a === void 0 ? void 0 : _a.textContent) || this.headline;
|
|
54
|
+
}
|
|
49
55
|
get hasSubitems() {
|
|
50
56
|
return this.isEl('[variant="subitem"]');
|
|
51
57
|
}
|
|
@@ -53,20 +59,12 @@ export class RListItem {
|
|
|
53
59
|
var _a;
|
|
54
60
|
return (_a = this.host) === null || _a === void 0 ? void 0 : _a.querySelectorAll('[variant="subitem"]');
|
|
55
61
|
}
|
|
56
|
-
handleKeyDown(event) {
|
|
57
|
-
if (event.key !== 'Enter' && event.key !== ' ')
|
|
58
|
-
return;
|
|
59
|
-
this.toggleSubitems();
|
|
60
|
-
}
|
|
61
|
-
/** Prevent the click from toggling the parent **/
|
|
62
|
-
handleSubitemClick(event) {
|
|
63
|
-
event.stopPropagation();
|
|
64
|
-
}
|
|
65
62
|
/** Function to set tabindex for sub-items */
|
|
66
63
|
setTabIndexOnSubItems() {
|
|
67
64
|
if (this.hasSubitems) {
|
|
68
65
|
this.subItems.forEach((element) => {
|
|
69
|
-
|
|
66
|
+
var _a;
|
|
67
|
+
(_a = element.shadowRoot.querySelector('a.r-list-item')) === null || _a === void 0 ? void 0 : _a.setAttribute('tabindex', this.disabled ? '-1' : null);
|
|
70
68
|
});
|
|
71
69
|
}
|
|
72
70
|
}
|
|
@@ -74,26 +72,29 @@ export class RListItem {
|
|
|
74
72
|
this.setTabIndexOnSubItems();
|
|
75
73
|
}
|
|
76
74
|
get tagName() {
|
|
75
|
+
if (this.hasSubitems) {
|
|
76
|
+
return 'button';
|
|
77
|
+
}
|
|
77
78
|
return this.href && !this.disabled ? 'a' : 'div';
|
|
78
79
|
}
|
|
79
80
|
render() {
|
|
80
81
|
const { leadingIcon, leadingIconSrc, trailingIcon, trailingIconSrc, headline, trailingText, description } = this;
|
|
81
82
|
const TagName = this.tagName;
|
|
82
|
-
const itemAttrs = Object.assign({ href: TagName === 'a' ? this.href : null }, (this.disabled ? { role: 'link', 'aria-disabled': 'true' } : null));
|
|
83
|
-
const ListItemContent = (h(TagName, Object.assign({ class: "r-list-item" }, itemAttrs), this.isLeading &&
|
|
83
|
+
const itemAttrs = Object.assign(Object.assign(Object.assign({ href: TagName === 'a' ? this.href : null, 'aria-current': this.active && TagName === 'a' ? 'page' : null }, (this.disabled ? { role: 'link', 'aria-disabled': 'true' } : null)), (this.hasSubitems ? { 'aria-expanded': `${this.expanded}` } : null)), (this.hasSubitems ? { 'aria-controls': `${this.uniqueSubmitemsId}` } : null));
|
|
84
|
+
const ListItemContent = (h(TagName, Object.assign({ class: "r-list-item" }, itemAttrs, { onClick: () => this.hasSubitems && this.toggleSubitems() }), this.isLeading &&
|
|
84
85
|
h("span", { class: "r-list-item--leading" }, h("slot", { name: "leading" }, this.isLeadingIcon && !this.hideLeadingIcon &&
|
|
85
86
|
h("r-icon", { class: "r-list-item--leading-icon", name: leadingIcon, src: leadingIconSrc }))), h("span", { class: "r-list-item--text" }, !this.isTextSlot ?
|
|
86
87
|
h(Fragment, null, (this.isHeadlineSlot || headline) &&
|
|
87
88
|
h("span", { class: "r-list-item--headline" }, h("slot", { name: "headline" }, headline)), (description || this.isDescriptionSlot) &&
|
|
88
89
|
h("span", { class: "r-list-item--description" }, h("slot", { name: "description" }, description)))
|
|
89
90
|
:
|
|
90
|
-
h("slot", { name: "text" })), this.isTrailing &&
|
|
91
|
+
h("slot", { name: "text" })), h("span", { class: "r-list-item--sr-text visually-hidden" }, this.headlineContent), this.isTrailing &&
|
|
91
92
|
h("span", { class: "r-list-item--trailing" }, h("slot", { name: "trailing" }, this.isTrailingIcon && !trailingText &&
|
|
92
93
|
h("r-icon", { class: "r-list-item--trailing-icon", name: trailingIcon, src: trailingIconSrc }), trailingText && !this.isTrailingIcon &&
|
|
93
94
|
h("span", { class: "r-list-item--trailing-text" }, trailingText)))));
|
|
94
95
|
if (!this.hasSubitems)
|
|
95
96
|
return h(Host, null, ListItemContent);
|
|
96
|
-
return (h(Host,
|
|
97
|
+
return (h(Host, null, h("div", { class: "r-list-item-wrapper" }, ListItemContent, h("ul", { "aria-hidden": `${!this.expanded}`, id: this.uniqueSubmitemsId, class: "sub-items" }, h("slot", null)))));
|
|
97
98
|
}
|
|
98
99
|
static get is() { return "r-list-item"; }
|
|
99
100
|
static get encapsulation() { return "shadow"; }
|
|
@@ -419,6 +420,25 @@ export class RListItem {
|
|
|
419
420
|
"setter": false,
|
|
420
421
|
"reflect": true,
|
|
421
422
|
"defaultValue": "false"
|
|
423
|
+
},
|
|
424
|
+
"active": {
|
|
425
|
+
"type": "boolean",
|
|
426
|
+
"attribute": "active",
|
|
427
|
+
"mutable": false,
|
|
428
|
+
"complexType": {
|
|
429
|
+
"original": "boolean",
|
|
430
|
+
"resolved": "boolean",
|
|
431
|
+
"references": {}
|
|
432
|
+
},
|
|
433
|
+
"required": false,
|
|
434
|
+
"optional": true,
|
|
435
|
+
"docs": {
|
|
436
|
+
"tags": [],
|
|
437
|
+
"text": "Indicates whether the list item is currently active (e.g., represents the current page)."
|
|
438
|
+
},
|
|
439
|
+
"getter": false,
|
|
440
|
+
"setter": false,
|
|
441
|
+
"reflect": true
|
|
422
442
|
}
|
|
423
443
|
};
|
|
424
444
|
}
|