@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
|
@@ -11,14 +11,15 @@ const Checkbox = class {
|
|
|
11
11
|
this.rChange = index.createEvent(this, "rChange");
|
|
12
12
|
this.rReset = index.createEvent(this, "rReset");
|
|
13
13
|
this.rValidate = index.createEvent(this, "rValidate");
|
|
14
|
-
/**
|
|
15
|
-
|
|
16
|
-
* Controls the visibility of validation indicators for the field.
|
|
17
|
-
* */
|
|
18
|
-
this.showValid = false;
|
|
14
|
+
/** Automatically focus the checkbox when the component is mounted. Note: Only one element per page should have autofocus set to true, following browser standard behavior. */
|
|
15
|
+
this.autofocus = false;
|
|
19
16
|
this.validityState = '';
|
|
20
17
|
this.validityMessage = '';
|
|
18
|
+
this.touched = false;
|
|
19
|
+
// Private properties
|
|
21
20
|
this.initial = {};
|
|
21
|
+
this.uniqueId = `r-checkbox-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
22
|
+
// Private methods
|
|
22
23
|
this.getValidityStateData = (element) => {
|
|
23
24
|
let validityState = '';
|
|
24
25
|
let validityMessage = '';
|
|
@@ -52,9 +53,6 @@ const Checkbox = class {
|
|
|
52
53
|
message: this.validityMessage
|
|
53
54
|
});
|
|
54
55
|
};
|
|
55
|
-
/** Unique id */
|
|
56
|
-
this.uniqueId = `r-checkbox-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
57
|
-
this.touched = false;
|
|
58
56
|
this.handleClick = (event) => {
|
|
59
57
|
if (this.disabled)
|
|
60
58
|
return;
|
|
@@ -86,18 +84,13 @@ const Checkbox = class {
|
|
|
86
84
|
this.contributeToFormData = (event) => {
|
|
87
85
|
formData.appendControlToFormData(this.nativeElement || this.host, event.formData);
|
|
88
86
|
};
|
|
87
|
+
this.applyAutofocus = () => {
|
|
88
|
+
queueMicrotask(() => {
|
|
89
|
+
this.setFocus();
|
|
90
|
+
});
|
|
91
|
+
};
|
|
89
92
|
}
|
|
90
|
-
|
|
91
|
-
get parentFormEl() {
|
|
92
|
-
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
93
|
-
}
|
|
94
|
-
/** Determine whether this element should be ignored during Constraint Validation API validation. */
|
|
95
|
-
get isNoValidate() {
|
|
96
|
-
var _a;
|
|
97
|
-
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
98
|
-
this.novalidate ||
|
|
99
|
-
false);
|
|
100
|
-
}
|
|
93
|
+
// Public Methods
|
|
101
94
|
/**
|
|
102
95
|
* Asynchronously retrieves the validity state of the checkbox.
|
|
103
96
|
*
|
|
@@ -118,50 +111,6 @@ const Checkbox = class {
|
|
|
118
111
|
message: this.validityMessage
|
|
119
112
|
};
|
|
120
113
|
}
|
|
121
|
-
async handleCheckedChange() {
|
|
122
|
-
// Only proceed if checkbox has been interacted with
|
|
123
|
-
if (!this.touched)
|
|
124
|
-
return;
|
|
125
|
-
if (this.disabled)
|
|
126
|
-
return;
|
|
127
|
-
const { host, value, checked } = this;
|
|
128
|
-
this.rChange.emit({ element: host, value, checked });
|
|
129
|
-
// Update native element checked state
|
|
130
|
-
if (this.nativeElement) {
|
|
131
|
-
this.nativeElement.checked = checked;
|
|
132
|
-
}
|
|
133
|
-
// Validate if required
|
|
134
|
-
if (this.required && !this.isNoValidate) {
|
|
135
|
-
this.validateFormElement(this.nativeElement);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
connectFormEventListeners() {
|
|
139
|
-
var _a, _b, _c;
|
|
140
|
-
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('formdata', this.contributeToFormData);
|
|
141
|
-
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
142
|
-
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.addEventListener('reset', this.onResetForm);
|
|
143
|
-
}
|
|
144
|
-
disconnectFormEventListeners() {
|
|
145
|
-
var _a, _b, _c;
|
|
146
|
-
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('formdata', this.contributeToFormData);
|
|
147
|
-
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('submit', this.onSubmitForm);
|
|
148
|
-
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('reset', this.onResetForm);
|
|
149
|
-
}
|
|
150
|
-
componentWillLoad() {
|
|
151
|
-
this.initial['checked'] = this.checked;
|
|
152
|
-
this.initial['invalid'] = this.invalid;
|
|
153
|
-
}
|
|
154
|
-
componentDidLoad() {
|
|
155
|
-
if (this.nativeElement) {
|
|
156
|
-
this.nativeElement.indeterminate = this.indeterminate;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
connectedCallback() {
|
|
160
|
-
this.connectFormEventListeners();
|
|
161
|
-
}
|
|
162
|
-
disconnectedCallback() {
|
|
163
|
-
this.disconnectFormEventListeners();
|
|
164
|
-
}
|
|
165
114
|
/**
|
|
166
115
|
* Sets focus on the checkbox element.
|
|
167
116
|
*/
|
|
@@ -215,6 +164,36 @@ const Checkbox = class {
|
|
|
215
164
|
const { validityState } = this.getValidityStateData(this.nativeElement);
|
|
216
165
|
return validityState === 'valid';
|
|
217
166
|
}
|
|
167
|
+
// Watchers
|
|
168
|
+
async handleCheckedChange() {
|
|
169
|
+
// Only proceed if checkbox has been interacted with
|
|
170
|
+
if (!this.touched)
|
|
171
|
+
return;
|
|
172
|
+
if (this.disabled)
|
|
173
|
+
return;
|
|
174
|
+
const { host, value, checked } = this;
|
|
175
|
+
this.rChange.emit({ element: host, value, checked });
|
|
176
|
+
// Update native element checked state
|
|
177
|
+
if (this.nativeElement) {
|
|
178
|
+
this.nativeElement.checked = checked;
|
|
179
|
+
}
|
|
180
|
+
// Validate if required
|
|
181
|
+
if (this.required && !this.isNoValidate) {
|
|
182
|
+
this.validateFormElement(this.nativeElement);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Getters
|
|
186
|
+
/** Identify wrapping form element */
|
|
187
|
+
get parentFormEl() {
|
|
188
|
+
return this.host.closest('form') || document.querySelector(`#${this.form}`) || null;
|
|
189
|
+
}
|
|
190
|
+
/** Determine whether this element should be ignored during Constraint Validation API validation. */
|
|
191
|
+
get isNoValidate() {
|
|
192
|
+
var _a;
|
|
193
|
+
return (((_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.hasAttribute('novalidate')) ||
|
|
194
|
+
this.novalidate ||
|
|
195
|
+
false);
|
|
196
|
+
}
|
|
218
197
|
get hasErrorMessage() {
|
|
219
198
|
var _a;
|
|
220
199
|
return typeof this.error === 'string' && ((_a = this.error) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
@@ -232,31 +211,53 @@ const Checkbox = class {
|
|
|
232
211
|
return false;
|
|
233
212
|
return this.hasErrorMessage || this.hasCustomErrorMessage || this.hasValidationError;
|
|
234
213
|
}
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
214
|
+
connectFormEventListeners() {
|
|
215
|
+
var _a, _b, _c;
|
|
216
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.addEventListener('formdata', this.contributeToFormData);
|
|
217
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.addEventListener('submit', this.onSubmitForm, { capture: true });
|
|
218
|
+
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.addEventListener('reset', this.onResetForm);
|
|
219
|
+
}
|
|
220
|
+
disconnectFormEventListeners() {
|
|
221
|
+
var _a, _b, _c;
|
|
222
|
+
(_a = this.parentFormEl) === null || _a === void 0 ? void 0 : _a.removeEventListener('formdata', this.contributeToFormData);
|
|
223
|
+
(_b = this.parentFormEl) === null || _b === void 0 ? void 0 : _b.removeEventListener('submit', this.onSubmitForm);
|
|
224
|
+
(_c = this.parentFormEl) === null || _c === void 0 ? void 0 : _c.removeEventListener('reset', this.onResetForm);
|
|
225
|
+
}
|
|
226
|
+
// Lifecycle methods
|
|
227
|
+
componentWillLoad() {
|
|
228
|
+
this.initial['checked'] = this.checked;
|
|
229
|
+
this.initial['invalid'] = this.invalid;
|
|
230
|
+
}
|
|
231
|
+
componentDidLoad() {
|
|
232
|
+
if (this.nativeElement) {
|
|
233
|
+
this.nativeElement.indeterminate = this.indeterminate;
|
|
234
|
+
}
|
|
235
|
+
if (this.autofocus)
|
|
236
|
+
this.applyAutofocus();
|
|
237
|
+
}
|
|
238
|
+
connectedCallback() {
|
|
239
|
+
this.connectFormEventListeners();
|
|
239
240
|
}
|
|
240
|
-
|
|
241
|
-
|
|
241
|
+
disconnectedCallback() {
|
|
242
|
+
this.disconnectFormEventListeners();
|
|
242
243
|
}
|
|
243
244
|
render() {
|
|
244
|
-
const { error, name, value, disabled, required, uniqueId, checked, indeterminate } = this;
|
|
245
|
+
const { error, name, value, disabled, required, uniqueId, checked, indeterminate, autofocus } = this;
|
|
245
246
|
const inputAttrs = {
|
|
246
247
|
name,
|
|
247
248
|
value,
|
|
248
249
|
disabled,
|
|
249
250
|
required,
|
|
250
251
|
checked,
|
|
251
|
-
indeterminate
|
|
252
|
+
indeterminate,
|
|
253
|
+
autofocus
|
|
252
254
|
};
|
|
253
|
-
return (index.h(index.Host, { key: '
|
|
255
|
+
return (index.h(index.Host, { key: '54a5b4a38fd2e9c2a94a95d9ad7d47cd91123d0f', onClick: this.handleClick }, index.h("div", { key: '089747b6032bfc4e0de581eed060558dc73a1118', class: "r-checkbox" }, index.h("input", Object.assign({ key: 'fa2b9640c25d4f0d1e1781f885a27f1b24c906b4', class: "r-checkbox--input", type: "checkbox" }, inputAttrs, { id: `${uniqueId}-input`, ref: el => this.nativeElement = el, "aria-describedby": this.hasInvalidMessage ? `${uniqueId}-message` : null, "aria-required": `${this.required || false}`, "aria-invalid": `${this.invalid || false}` })), index.h("div", { key: '49e514969fa11eccba18658d275462c8c705f8e2', class: "r-checkbox--box", "aria-hidden": "true" }, this.checked ?
|
|
254
256
|
index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M8.80019 15.8988L4.6002 11.6988L3.2002 13.0988L8.80019 18.6988L20.8002 6.69883L19.4002 5.29883L8.80019 15.8988Z", fill: "currentColor" }))
|
|
255
257
|
: this.indeterminate ?
|
|
256
258
|
index.h("svg", { viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("rect", { x: "4", y: "11", width: "16", height: "2", fill: "currentColor" }))
|
|
257
|
-
: null), index.h("div", { key: '
|
|
258
|
-
index.h("r-hint", { key: '
|
|
259
|
-
index.h("r-hint", { key: 'cdaaad06d4f0cd0e880a3f327c0eb8d2058eb91b', variant: "success" }, this.validMessage))))));
|
|
259
|
+
: null), index.h("div", { key: '96090e0dc6dcf564a73e061a7e75ad0a4ec0b1cb', class: "r-checkbox--description" }, index.h("label", { key: '524a1cba2f9ef69863c48ca536921411be743ec5', class: "r-checkbox--label", id: `${uniqueId}-label`, htmlFor: `${uniqueId}-input` }, index.h("slot", { key: 'cda4f61e27a86b988746465d14567f49f09eabd0' })), index.h("div", { key: 'be4d6ba741c2580fd1d5a6dc3e2f71716df55d71', id: `${uniqueId}-message`, class: !this.hasInvalidMessage ? 'visually-hidden' : 'r-checkbox--message', "aria-live": "polite", "aria-atomic": "true" }, this.hasInvalidMessage &&
|
|
260
|
+
index.h("r-hint", { key: '05b0c0d5ee3c603d19faa11006e9e3501dc8be82', variant: "error" }, error || this.customErrorMessage || this.validityMessage))))));
|
|
260
261
|
}
|
|
261
262
|
get host() { return index.getElement(this); }
|
|
262
263
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DJ4H_bFj.js');
|
|
4
4
|
|
|
5
|
-
const dialogCss = ":host([size=small]){--r-dialog--width:23.4375rem;--r-dialog--max-height:15.625rem}:host([size=medium]){--r-dialog--width:37.5rem;--r-dialog--max-height:37.5rem}:host([size=large]){--r-dialog--width:50rem;--r-dialog--max-height:45rem}@media (max-width: 50rem){:host([size=large]){--r-dialog--width:100%;--right:0;--left:0;--r-dialog--footer--flex-wrap:wrap}}@media (max-height: 48.75rem){:host([size=large]){--r-dialog--margin:18px auto;--top:0;--bottom:0}}@media (max-width: 37.5rem){:host([size=medium]){--r-dialog--width:100%;--right:0;--left:0;--r-dialog--footer--flex-wrap:wrap}}@media (max-height: 43.75rem){:host([size=medium]){--r-dialog--margin:18px auto;--top:0;--bottom:0}}:host{top:var(--top, auto);right:var(--right, auto);bottom:var(--bottom, auto);left:var(--left, auto)}.r-dialog{border:var(--r-dialog--border, none);padding:var(--r-dialog--padding, 24px 0);box-sizing:var(--r-dialog--box-sizing, border-box);overflow:var(--r-dialog--overflow, hidden);width:var(--r-dialog--width, auto);height:var(--r-dialog--height, auto);background-color:var(--r-dialog--background-color, var(--r-background-softest));margin:var(--r-dialog--margin, auto);max-height:var(--r-dialog--max-height, auto)}.r-dialog--content{display:var(--r-dialog--content--display, flex);flex-direction:var(--r-dialog--content--flex-direction, column);gap:var(--r-dialog--content--gap, var(--r-spacing-150, 1.5rem));color:var(--r-dialog--content--color, var(--r-text-regular));height:var(--r-dialog--content--height, 100%)}.r-dialog ::slotted([slot=header]),.r-dialog--headline{font-family:var(--r-dialog--headline--font-family, var(--r-font-family-heading, sans-serif));font-size:var(--r-dialog--headline--font-size, var(--r-font-size-500));font-weight:var(--r-dialog--headline--font-weight, var(--r-font-weight-light));margin:var(--r-dialog--headline--margin, 0);flex:var(--r-dialog--headline--flex, 1)}.r-dialog--close{--r-button--display:var(--r-dialog--close--dispaly, flex);--r-button--padding:var(--r-dialog--close--padding, 0)}.r-dialog--header{display:var(--r-dialog--header--display, flex);justify-content:var(--r-dialog--header--justify-content, space-between);align-items:var(--r-dialog--header--align-items, start);gap:var(--r-dialog--header--gap, 32px);padding:var(--r-dialog--header--padding, 0 24px)}.r-dialog--body{font-family:var(--r-dialog--body--font-family, var(--r-font-family-text));font-size:var(--r-dialog--body--font-size, var(--r-font-size-desktop-400));line-height:var(--r-dialog--body--line-height, var(--r-line-height-m));flex-grow:var(--r-dialog--body--flex-grow, 1);overflow-y:var(--r-dialog--body--overflow, auto);justify-self:var(--r-dialog--body--justify-self, stretch);padding:var(--r-dialog--body--padding, 0 24px)}.r-dialog--body{scrollbar-width:auto;scrollbar-color:var(--r-border-softer) #ffffff}.r-dialog--body::-webkit-scrollbar{width:var(--r-spacing-100, 1rem)}.r-dialog--body::-webkit-scrollbar-track{background:#ffffff}.r-dialog--body::-webkit-scrollbar-thumb{background-color:var(--r-border-softer);border-radius:10px;border:3px solid #ffffff}.r-dialog
|
|
5
|
+
const dialogCss = ":host([size=small]){--r-dialog--width:23.4375rem;--r-dialog--max-height:15.625rem}:host([size=medium]){--r-dialog--width:37.5rem;--r-dialog--max-height:37.5rem}:host([size=large]){--r-dialog--width:50rem;--r-dialog--max-height:45rem}@media (max-width: 50rem){:host([size=large]){--r-dialog--width:100%;--right:0;--left:0;--r-dialog--footer--flex-wrap:wrap}}@media (max-height: 48.75rem){:host([size=large]){--r-dialog--margin:18px auto;--top:0;--bottom:0}}@media (max-width: 37.5rem){:host([size=medium]){--r-dialog--width:100%;--right:0;--left:0;--r-dialog--footer--flex-wrap:wrap}}@media (max-height: 43.75rem){:host([size=medium]){--r-dialog--margin:18px auto;--top:0;--bottom:0}}:host{top:var(--top, auto);right:var(--right, auto);bottom:var(--bottom, auto);left:var(--left, auto)}.r-dialog{border:var(--r-dialog--border, none);padding:var(--r-dialog--padding, 24px 0);box-sizing:var(--r-dialog--box-sizing, border-box);overflow:var(--r-dialog--overflow, hidden);width:var(--r-dialog--width, auto);height:var(--r-dialog--height, auto);background-color:var(--r-dialog--background-color, var(--r-background-softest));margin:var(--r-dialog--margin, auto);max-height:var(--r-dialog--max-height, auto)}.r-dialog--content{display:var(--r-dialog--content--display, flex);flex-direction:var(--r-dialog--content--flex-direction, column);gap:var(--r-dialog--content--gap, var(--r-spacing-150, 1.5rem));color:var(--r-dialog--content--color, var(--r-text-regular));height:var(--r-dialog--content--height, 100%)}.r-dialog ::slotted([slot=header]),.r-dialog--headline{font-family:var(--r-dialog--headline--font-family, var(--r-font-family-heading, sans-serif));font-size:var(--r-dialog--headline--font-size, var(--r-font-size-500));font-weight:var(--r-dialog--headline--font-weight, var(--r-font-weight-light));margin:var(--r-dialog--headline--margin, 0);flex:var(--r-dialog--headline--flex, 1)}.r-dialog--close{--r-button--display:var(--r-dialog--close--dispaly, flex);--r-button--padding:var(--r-dialog--close--padding, 0)}.r-dialog--header{display:var(--r-dialog--header--display, flex);justify-content:var(--r-dialog--header--justify-content, space-between);align-items:var(--r-dialog--header--align-items, start);gap:var(--r-dialog--header--gap, 32px);padding:var(--r-dialog--header--padding, 0 24px)}.r-dialog--body{font-family:var(--r-dialog--body--font-family, var(--r-font-family-text));font-size:var(--r-dialog--body--font-size, var(--r-font-size-desktop-400));line-height:var(--r-dialog--body--line-height, var(--r-line-height-m));flex-grow:var(--r-dialog--body--flex-grow, 1);overflow-y:var(--r-dialog--body--overflow, auto);justify-self:var(--r-dialog--body--justify-self, stretch);padding:var(--r-dialog--body--padding, 0 24px)}.r-dialog--body{scrollbar-width:auto;scrollbar-color:var(--r-border-softer) #ffffff}.r-dialog--body::-webkit-scrollbar{width:var(--r-spacing-100, 1rem)}.r-dialog--body::-webkit-scrollbar-track{background:#ffffff}.r-dialog--body::-webkit-scrollbar-thumb{background-color:var(--r-border-softer);border-radius:10px;border:3px solid #ffffff}.r-dialog ::slotted([slot=footer]){margin-top:var(--r-dialog--footer--margin-top, auto);display:var(--r-dialog--footer--display, flex);flex-direction:var(--r-dialog--footer--flex-direction, row);flex-wrap:var(--r-dialog--footer--flex-wrap, nowrap);justify-content:var(--r-dialog--footer--justify-content, flex-start);gap:var(--r-dialog--footer--gap, var(--r-spacing-100, 1rem));align-items:var(--r-dialog--footer--align-items, end);padding:var(--r-dialog--header--padding, 0 24px)}.r-dialog::backdrop{background:var(--backdrop--background-color, rgba(0, 0, 0, 0.25))}";
|
|
6
6
|
|
|
7
7
|
const Dialog = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -25,10 +25,6 @@ const Dialog = class {
|
|
|
25
25
|
* */
|
|
26
26
|
this.isOpen = this.open;
|
|
27
27
|
this.uniqueId = `r-dialog-${Date.now().toString(32)}${Math.random().toString(32)}`.replace(/\./g, '');
|
|
28
|
-
this.isElContent = (selector) => {
|
|
29
|
-
const el = this.host.querySelector(selector);
|
|
30
|
-
return el !== null && (el === null || el === void 0 ? void 0 : el.textContent.trim().length) > 0;
|
|
31
|
-
};
|
|
32
28
|
this.onTriggerClick = () => {
|
|
33
29
|
this.close();
|
|
34
30
|
};
|
|
@@ -43,9 +39,6 @@ const Dialog = class {
|
|
|
43
39
|
if (this.open && !this.isOpen)
|
|
44
40
|
this.showModal();
|
|
45
41
|
}
|
|
46
|
-
get isFooterSlot() {
|
|
47
|
-
return this.isElContent('[slot="footer"]');
|
|
48
|
-
}
|
|
49
42
|
get dialogLabel() {
|
|
50
43
|
var _a, _b;
|
|
51
44
|
return this.headline || ((_b = (_a = this.host.querySelector('[slot="header"]')) === null || _a === void 0 ? void 0 : _a.textContent) === null || _b === void 0 ? void 0 : _b.trim());
|
|
@@ -101,9 +94,8 @@ const Dialog = class {
|
|
|
101
94
|
}
|
|
102
95
|
}
|
|
103
96
|
render() {
|
|
104
|
-
return (index.h(index.Host, { key: '
|
|
105
|
-
index.h("h2", { key: '
|
|
106
|
-
index.h("div", { key: '02c6c9ee41bb7893955b492f4fd171e498041777', class: "r-dialog--footer" }, index.h("slot", { key: 'bcf48fd3ecc2378fa82ffb48aa3739ea65477dcd', name: "footer" }))))));
|
|
97
|
+
return (index.h(index.Host, { key: '6f042592347577f063f6a80d2152b1149eadcb21', open: this.isOpen }, index.h("dialog", { key: 'fd3f19cf69a9077585bceccebaf0d0c9bccbaa86', class: "r-dialog", "aria-label": this.dialogLabel, ref: el => this.dialogElement = el, style: { '--r-dialog--body--height': this.bodyHeight } }, index.h("div", { key: '974e33afe5e96d3a67501d10a4ecd0486900ed64', class: "r-dialog--content" }, index.h("div", { key: '57bccc4346d7234564dc22c179a7e10051bd3af7', class: "r-dialog--header", id: `${this.uniqueId}-header` }, index.h("slot", { key: '0a59d6a775f11378f17be41665b2c71aecb17ff9', name: "header" }, (this.headline) &&
|
|
98
|
+
index.h("h2", { key: '6dd6970be5bde3f92d87bef1cbbd7152ba72f88f', class: "r-dialog--headline" }, this.headline)), index.h("r-icon-button", { key: '37ad4f5b3366ae057240e5bcf2c7443aac3faa9b', class: "r-dialog--close", name: "cross", size: "s", onRClick: this.onTriggerClick, label: this.closeAriaLabel })), index.h("div", { key: '951dec5b1da5b13196916ed6b64fee89cad83a0e', class: "r-dialog--body" }, this.bodyText, index.h("slot", { key: '1797cb38116d9818aec51e2dc6982dad1a01cf02' }), index.h("slot", { key: '0f091bf0e6f6fdd16b79c69aca9814a0d76d7ee6', name: "form" })), index.h("slot", { key: '2b5a1cadfa9e7a13d8fc4ddca4cf69a1e4a1cb5e', name: "footer" })))));
|
|
107
99
|
}
|
|
108
100
|
get host() { return index.getElement(this); }
|
|
109
101
|
static get watchers() { return {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('./index-DJ4H_bFj.js');
|
|
4
|
+
|
|
5
|
+
const hintCss = ":host{--r-hint--text--flex:1}:host([variant=information]){--r-hint--color:var(--r-text-soft, #686868)}:host([variant=success]),:host([success]){--r-hint--color:var(--r-status-success-regular, #298535)}:host([variant=warning]),:host([warning]){--r-hint--color:var(--r-status-warning-strong, #89411a)}:host([variant=error]),:host([invalid]){--r-hint--color:var(--r-status-error-regular, #b00c15)}:host([icon-position=end]){--r-hint--flex-direction:row-reverse}:host{display:block}.r-hint{display:var(--r-hint--display, flex);flex-direction:var(--r-hint--flex-direction, row);gap:var(--r-hint--gap, var(--r-spacing-050, 0.5rem));font-family:var(--r-hint--font-family, var(--r-font-family-text, system-ui));font-size:var(--r-hint--font-size, var(--r-font-size-300, 0.875rem));line-height:var(--r-hint--line-height, var(--r-line-height-m, 1.5));color:var(--r-hint--color, var(--r-text-soft, #686868));font-weight:var(--r-hint--font-weight, var(--r-font-weight-regular, 400));margin-top:var(--r-hint--margin-top, 0);margin-bottom:var(--r-hint--margin-bottom, 0)}.r-hint--icon{display:var(--r-hint--icon--display, flex);align-items:var(--r-hint--icon--align-items, start);min-width:var(--r-hint--icon--min-width, 1rem);margin-top:var(--r-hint--icon--margin-top, 0.15rem)}.r-hint--text{flex:var(--r-hint--text--flex, 1)}.visually-hidden{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}";
|
|
6
|
+
|
|
7
|
+
const Hint = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
index.registerInstance(this, hostRef);
|
|
10
|
+
}
|
|
11
|
+
get iconName() {
|
|
12
|
+
if (this.icon)
|
|
13
|
+
return this.icon;
|
|
14
|
+
const variantIcons = {
|
|
15
|
+
'error': 'circled-exclamation-mark',
|
|
16
|
+
'warning': 'circled-cross',
|
|
17
|
+
'success': 'circled-check'
|
|
18
|
+
};
|
|
19
|
+
return (this.variant in variantIcons) ? variantIcons[this.variant] : null;
|
|
20
|
+
}
|
|
21
|
+
get hasIconSlot() {
|
|
22
|
+
return !!this.host.querySelector('[slot="icon"]');
|
|
23
|
+
}
|
|
24
|
+
get hasIcon() {
|
|
25
|
+
return this.hasIconSlot || this.iconName !== null;
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return (index.h(index.Host, { key: '1cbe08b7b3b01fc7d870416a1b14e3b1b8525797' }, index.h("div", { key: '17494f3ae8bdf394858e2f9337e54bd844a467d0', class: "r-hint" }, this.hasIcon &&
|
|
29
|
+
index.h("div", { key: 'ed406c6ae45ea4c25e6735752ced3a988c2f2274', class: "r-hint--icon" }, index.h("slot", { key: '9e93b83d3f9e71f722ffdb813d46b667eec556a5', name: "icon" }, this.iconName && index.h("r-icon", { key: '841c3e53381a21e1341191eb7a0b32fdd696c47f', name: this.iconName, size: "s" }))), index.h("div", { key: '946d0813297923053452519b9871cd9a0d04679f', class: "r-hint--text" }, index.h("slot", { key: 'f7343fcc6a4cbe9f5584f8d94feff33cfd8f2560' })))));
|
|
30
|
+
}
|
|
31
|
+
get host() { return index.getElement(this); }
|
|
32
|
+
};
|
|
33
|
+
Hint.style = hintCss;
|
|
34
|
+
|
|
35
|
+
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)}";
|
|
36
|
+
|
|
37
|
+
const RLabel = class {
|
|
38
|
+
constructor(hostRef) {
|
|
39
|
+
index.registerInstance(this, hostRef);
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const { fieldIndicator } = this;
|
|
43
|
+
return (index.h(index.Host, { key: 'd823556813a282022aa18e138a3ac89d7f22af2a' }, index.h("div", { key: '1cea58412a4599e009080eb224d17324d5cad0b3', class: "r-label" }, index.h("span", { key: 'c0ade32425b07866b7a3096f203c7848eaa83e55', class: "r-label--slot" }, index.h("slot", { key: '9c782ed621889966189bba0d4c46de620315c9c4' }), fieldIndicator &&
|
|
44
|
+
index.h("span", { key: 'c4a4fcbed3e744bed679d8e9c6416a51407a686a', class: "r-label--marker" }, fieldIndicator)))));
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
RLabel.style = labelCss;
|
|
48
|
+
|
|
49
|
+
exports.r_hint = Hint;
|
|
50
|
+
exports.r_label = RLabel;
|
|
@@ -2,67 +2,81 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-DJ4H_bFj.js');
|
|
4
4
|
|
|
5
|
-
const
|
|
5
|
+
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}";
|
|
6
6
|
|
|
7
|
-
const
|
|
7
|
+
const IconButton = class {
|
|
8
8
|
constructor(hostRef) {
|
|
9
9
|
index.registerInstance(this, hostRef);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
this.rClick = index.createEvent(this, "rClick");
|
|
11
|
+
/**
|
|
12
|
+
* Defines the size of the icon used within the button.
|
|
13
|
+
*/
|
|
14
|
+
this.size = 'm';
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated Use the `<r-tooltip>` component as a wrapper instead.
|
|
17
|
+
* Sets position for the tooltip.
|
|
18
|
+
* - `top`: Tooltip appears above the button.
|
|
19
|
+
* - `bottom`: Tooltip appears below the button.
|
|
20
|
+
* - `left`: Tooltip appears to the left of the button.
|
|
21
|
+
* - `right`: Tooltip appears to the right of the button.
|
|
22
|
+
*/
|
|
23
|
+
this.tooltipPosition = 'top';
|
|
24
|
+
/**
|
|
25
|
+
* Defines the visual style of the button.
|
|
26
|
+
* - `standard`: Default button style.
|
|
27
|
+
* - `contained`: Button with a contained background.
|
|
28
|
+
*/
|
|
29
|
+
this.variant = 'standard';
|
|
30
|
+
this._handleClick = (event) => {
|
|
31
|
+
if (this.disabled) {
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
this.rClick.emit();
|
|
36
|
+
};
|
|
37
|
+
this.onFocus = () => {
|
|
38
|
+
this.setFocus();
|
|
39
|
+
};
|
|
40
|
+
this.onBlur = () => {
|
|
41
|
+
this.setBlur();
|
|
18
42
|
};
|
|
19
|
-
return (this.variant in variantIcons) ? variantIcons[this.variant] : null;
|
|
20
|
-
}
|
|
21
|
-
get hasIconSlot() {
|
|
22
|
-
return !!this.host.querySelector('[slot="icon"]');
|
|
23
43
|
}
|
|
24
|
-
|
|
25
|
-
|
|
44
|
+
/** Simulate a button click */
|
|
45
|
+
async triggerClick() {
|
|
46
|
+
var _a;
|
|
47
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.click();
|
|
26
48
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
49
|
+
/** Set focus on the button */
|
|
50
|
+
async setFocus() {
|
|
51
|
+
var _a;
|
|
52
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.focus();
|
|
30
53
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
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)}";
|
|
36
|
-
|
|
37
|
-
const RLabel = class {
|
|
38
|
-
constructor(hostRef) {
|
|
39
|
-
index.registerInstance(this, hostRef);
|
|
40
|
-
/**
|
|
41
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
42
|
-
* Defines preferable position of the tooltip */
|
|
43
|
-
this.tooltipPosition = 'right';
|
|
44
|
-
/**
|
|
45
|
-
* _DEPRECATED_ (This property will be removed in November 2025 release.)
|
|
46
|
-
* Icon tooltip trigger by name from the set */
|
|
47
|
-
this.tooltipIcon = 'circled-question-mark';
|
|
54
|
+
/** Remove focus from the button */
|
|
55
|
+
async setBlur() {
|
|
56
|
+
var _a;
|
|
57
|
+
(_a = this.nativeElement) === null || _a === void 0 ? void 0 : _a.blur();
|
|
48
58
|
}
|
|
49
59
|
render() {
|
|
50
|
-
const {
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
position: tooltipPosition
|
|
60
|
+
const { name, size, disabled, tooltipText, tooltipPosition } = this;
|
|
61
|
+
const buttonAttrs = {
|
|
62
|
+
disabled,
|
|
54
63
|
};
|
|
55
|
-
const
|
|
56
|
-
name
|
|
57
|
-
size
|
|
58
|
-
color: tooltipIconColor
|
|
64
|
+
const iconAttrs = {
|
|
65
|
+
name,
|
|
66
|
+
size
|
|
59
67
|
};
|
|
60
|
-
|
|
61
|
-
index.h("
|
|
62
|
-
|
|
68
|
+
const buttonTemplate = () => (index.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 ?
|
|
69
|
+
index.h("r-icon", Object.assign({}, iconAttrs))
|
|
70
|
+
:
|
|
71
|
+
index.h("r-icon", { size: size, class: "r-icon-button--icon" }, index.h("slot", null)), index.h("span", { key: '2306cd32340a99653bb02c86de43324a2c0ca35b', class: "r-icon-button--label visually-hidden" }, this.label), index.h("span", { key: '9cb523d0c82caf25d472b8969a0afee41ad776aa', class: "r-icon-button--target-area" })));
|
|
72
|
+
return (index.h(index.Host, { key: '2710af0c77ea56a4cf69e29c09221ba7d913bc9d' }, !disabled && tooltipText ?
|
|
73
|
+
index.h("r-tooltip", { text: tooltipText, position: tooltipPosition }, buttonTemplate())
|
|
74
|
+
:
|
|
75
|
+
buttonTemplate()));
|
|
63
76
|
}
|
|
77
|
+
get host() { return index.getElement(this); }
|
|
64
78
|
};
|
|
65
|
-
|
|
79
|
+
IconButton.style = iconButtonCss;
|
|
66
80
|
|
|
67
81
|
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)}";
|
|
68
82
|
|
|
@@ -420,7 +434,7 @@ const Tooltip = class {
|
|
|
420
434
|
role: 'tooltip',
|
|
421
435
|
'aria-hidden': `${!isShown}`
|
|
422
436
|
};
|
|
423
|
-
return (index.h(index.Host, Object.assign({ key: '
|
|
437
|
+
return (index.h(index.Host, Object.assign({ key: '1b2ce4ee1a9f9ca227b96e567fb61b560858734e' }, hostAttrs, { onMouseenter: this.handleHover, onMouseleave: this.removeTooltip }), index.h("div", { key: '1379aefd4bf69b312a9ce3ef443f5e9fe970f09e', class: "r-tooltip" }, index.h("div", Object.assign({ key: '80f00e66c8f01bb0df9107943c15d6616e4e7197', class: "r-tooltip--trigger", onFocus: this.handleFocus, onBlur: this.removeTooltip }, triggerAttrs), index.h("slot", { key: '42e1453731bdd404083e11d3d2f0ae4603e4c57b' })), index.h("div", Object.assign({ key: '00aa4f22f9c3e40d1c8e86cdd950ef1d160e29cf', class: "r-tooltip--content", ref: (el) => this.tooltip = el }, contentAttrs), text), index.h("div", { key: 'b717d5e45d3f970ee87f409d61a6353fb138fc7b', ref: (el) => this.arrow = el, class: "r-tooltip--arrow" }))));
|
|
424
438
|
}
|
|
425
439
|
get element() { return index.getElement(this); }
|
|
426
440
|
static get watchers() { return {
|
|
@@ -429,6 +443,5 @@ const Tooltip = class {
|
|
|
429
443
|
};
|
|
430
444
|
Tooltip.style = tooltipCss;
|
|
431
445
|
|
|
432
|
-
exports.
|
|
433
|
-
exports.r_label = RLabel;
|
|
446
|
+
exports.r_icon_button = IconButton;
|
|
434
447
|
exports.r_tooltip = Tooltip;
|