@govbr-ds/webcomponents 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -11
- package/cem/custom-elements.json +209 -8
- package/dist/cjs/br-cookiebar-link.cjs.entry.js +2 -1
- package/dist/cjs/br-date-picker_3.cjs.entry.js +2 -1
- package/dist/cjs/br-datetime-picker.cjs.entry.js +1 -2
- package/dist/cjs/br-dropdown_2.cjs.entry.js +252 -108
- package/dist/cjs/br-header-logo.cjs.entry.js +2 -1
- package/dist/cjs/br-icon.cjs.entry.js +1 -1
- package/dist/cjs/br-item.cjs.entry.js +25 -14
- package/dist/cjs/br-link.cjs.entry.js +2 -1
- package/dist/cjs/br-magic-button.cjs.entry.js +2 -1
- package/dist/cjs/br-menu-link.cjs.entry.js +2 -1
- package/dist/cjs/br-select-input_3.cjs.entry.js +45 -11
- package/dist/cjs/br-sign-in.cjs.entry.js +2 -1
- package/dist/cjs/br-slider.cjs.entry.js +1 -2
- package/dist/cjs/br-tag.cjs.entry.js +2 -3
- package/dist/cjs/br-upload.cjs.entry.js +2 -3
- package/dist/cjs/index-CRdcutym.js +4 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/cookiebar/cookiebar-link/cookiebar-link.js +2 -1
- package/dist/collection/components/datetime-picker/datetime-input/datetime-input.js +2 -1
- package/dist/collection/components/datetime-picker/datetime-picker.js +1 -2
- package/dist/collection/components/header/header-logo/header-logo.js +2 -1
- package/dist/collection/components/icon/icon.js +1 -1
- package/dist/collection/components/item/item.js +25 -14
- package/dist/collection/components/link/link.js +2 -1
- package/dist/collection/components/magic-button/magic-button.js +2 -1
- package/dist/collection/components/menu/menu-link/menu-link.js +2 -1
- package/dist/collection/components/select/select-input/select-input.js +2 -1
- package/dist/collection/components/select/select-list/select-list.js +17 -5
- package/dist/collection/components/select/select-option/select-option.js +28 -7
- package/dist/collection/components/select/select.js +226 -109
- package/dist/collection/components/select/select.utils.js +34 -0
- package/dist/collection/components/sign-in/sign-in.js +2 -1
- package/dist/collection/components/slider/slider.js +1 -2
- package/dist/collection/components/tag/tag.js +2 -3
- package/dist/collection/components/upload/upload.js +2 -3
- package/dist/collection/pages/scripts/component-controls.js +13 -4
- package/dist/collection/pages/scripts/menu.js +11 -2
- package/dist/collection/pages/scripts/pageLoader.js +3 -1
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-breadcrumb.js +1 -1
- package/dist/components/br-carousel.js +1 -1
- package/dist/components/br-checkbox-group.js +1 -1
- package/dist/components/br-checkbox.js +1 -1
- package/dist/components/br-checkgroup.js +1 -1
- package/dist/components/br-collapse.js +1 -1
- package/dist/components/br-cookiebar-cookie.js +1 -1
- package/dist/components/br-cookiebar-group.js +1 -1
- package/dist/components/br-cookiebar-link.js +1 -1
- package/dist/components/br-cookiebar-note-group.js +1 -1
- package/dist/components/br-cookiebar.js +1 -1
- package/dist/components/br-date-picker.js +1 -1
- package/dist/components/br-datetime-input.js +1 -1
- package/dist/components/br-datetime-picker.js +1 -1
- package/dist/components/br-dropdown.js +1 -1
- package/dist/components/br-footer-category.js +1 -1
- package/dist/components/br-footer-item.js +1 -1
- package/dist/components/br-footer-social.js +1 -1
- package/dist/components/br-header-function.js +1 -1
- package/dist/components/br-header-link.js +1 -1
- package/dist/components/br-header-list.js +1 -1
- package/dist/components/br-header-logo.js +1 -1
- package/dist/components/br-header.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-item.js +1 -1
- package/dist/components/br-link.js +1 -1
- package/dist/components/br-list.js +1 -1
- package/dist/components/br-magic-button.js +1 -1
- package/dist/components/br-menu-header.js +1 -1
- package/dist/components/br-menu-item.js +1 -1
- package/dist/components/br-menu-link.js +1 -1
- package/dist/components/br-menu-list.js +1 -1
- package/dist/components/br-menu-social.js +1 -1
- package/dist/components/br-menu.js +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-modal.js +1 -1
- package/dist/components/br-notification-header.js +1 -1
- package/dist/components/br-notification-item.js +1 -1
- package/dist/components/br-pagination.js +1 -1
- package/dist/components/br-radio-group.js +1 -1
- package/dist/components/br-radio.js +1 -1
- package/dist/components/br-select-input.js +1 -1
- package/dist/components/br-select-list.js +1 -1
- package/dist/components/br-select-option.js +1 -1
- package/dist/components/br-select.js +1 -1
- package/dist/components/br-sign-in.js +1 -1
- package/dist/components/br-skip-link-item.js +1 -1
- package/dist/components/br-skip-link.js +1 -1
- package/dist/components/br-skiplink-item.js +1 -1
- package/dist/components/br-slider.js +1 -1
- package/dist/components/br-step-item.js +1 -1
- package/dist/components/br-switch.js +1 -1
- package/dist/components/br-tab.js +1 -1
- package/dist/components/br-table-cell.js +1 -1
- package/dist/components/br-table-header-cell.js +1 -1
- package/dist/components/br-tag.js +1 -1
- package/dist/components/br-textarea.js +1 -1
- package/dist/components/br-time-picker.js +1 -1
- package/dist/components/br-tooltip.js +1 -1
- package/dist/components/br-upload.js +1 -1
- package/dist/components/br-wizard.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{p-0IYmyaTi.js → p-34Jfn-U-.js} +1 -1
- package/dist/components/{p-41XwlWiS.js → p-B7Amgxkp.js} +1 -1
- package/dist/components/p-BKuMQJrQ.js +5 -0
- package/dist/components/{p-LmeJrLxH.js → p-BeE7R9nu.js} +1 -1
- package/dist/components/{p-C98-mHmV.js → p-Bo0QYHJO.js} +1 -1
- package/dist/components/{p-DYnkGWii.js → p-C2i2c_io.js} +1 -1
- package/dist/components/p-C7v0lVlX.js +5 -0
- package/dist/components/{p-D_CSvOY9.js → p-CMBsvswx.js} +1 -1
- package/dist/components/{p-Dkg2scYZ.js → p-CRrimdz6.js} +1 -1
- package/dist/components/{p-Bm0ECvfB.js → p-CWORw84-.js} +1 -1
- package/dist/components/p-CvUMXJCl.js +5 -0
- package/dist/components/{p-nJOJGpyl.js → p-DFUKDNck.js} +1 -1
- package/dist/components/p-DHicj0By.js +5 -0
- package/dist/components/{p-B-sbd1_h.js → p-DXjQyH6s.js} +1 -1
- package/dist/components/p-DmCxdB9P.js +5 -0
- package/dist/components/{p-DoXNfcTT.js → p-Dp0xy_3n.js} +1 -1
- package/dist/components/{p-DaeGwqw0.js → p-JAkkThgf.js} +1 -1
- package/dist/components/{p-aF8bGN3t.js → p-Ud-WB0hx.js} +1 -1
- package/dist/components/p-fpMNttbg.js +5 -0
- package/dist/components/{p-D9SpD3Ay.js → p-qYONSNcf.js} +1 -1
- package/dist/components/{p-CDZFuUlU.js → p-qhhHGJY1.js} +1 -1
- package/dist/components/p-ukNmfGNP.js +5 -0
- package/dist/components/p-xa8e1kSW.js +5 -0
- package/dist/esm/br-cookiebar-link.entry.js +2 -1
- package/dist/esm/br-date-picker_3.entry.js +2 -1
- package/dist/esm/br-datetime-picker.entry.js +1 -2
- package/dist/esm/br-dropdown_2.entry.js +252 -108
- package/dist/esm/br-header-logo.entry.js +2 -1
- package/dist/esm/br-icon.entry.js +1 -1
- package/dist/esm/br-item.entry.js +25 -14
- package/dist/esm/br-link.entry.js +2 -1
- package/dist/esm/br-magic-button.entry.js +2 -1
- package/dist/esm/br-menu-link.entry.js +2 -1
- package/dist/esm/br-select-input_3.entry.js +45 -11
- package/dist/esm/br-sign-in.entry.js +2 -1
- package/dist/esm/br-slider.entry.js +1 -2
- package/dist/esm/br-tag.entry.js +2 -3
- package/dist/esm/br-upload.entry.js +2 -3
- package/dist/esm/index-C2RBydfd.js +4 -4
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +356 -163
- package/dist/hydrate/index.mjs +356 -163
- package/dist/types/components/item/item.d.ts +1 -0
- package/dist/types/components/select/select-list/select-list.d.ts +1 -0
- package/dist/types/components/select/select-option/select-option.d.ts +1 -0
- package/dist/types/components/select/select.d.ts +14 -0
- package/dist/types/components/select/select.types.d.ts +2 -0
- package/dist/types/components/select/select.utils.d.ts +13 -0
- package/dist/webcomponents/p-0777c7b1.entry.js +5 -0
- package/dist/webcomponents/p-18ee6175.entry.js +5 -0
- package/dist/webcomponents/p-1c303a4e.entry.js +5 -0
- package/dist/webcomponents/{p-60cc820c.entry.js → p-4c13221a.entry.js} +1 -1
- package/dist/webcomponents/p-51ce2c31.entry.js +5 -0
- package/dist/webcomponents/p-83ff4579.entry.js +5 -0
- package/dist/webcomponents/p-8e819355.entry.js +5 -0
- package/dist/webcomponents/p-92a9b9c4.entry.js +5 -0
- package/dist/webcomponents/p-a4ae72e3.entry.js +5 -0
- package/dist/webcomponents/p-a994c190.entry.js +5 -0
- package/dist/webcomponents/p-c949d993.entry.js +5 -0
- package/dist/webcomponents/p-f26038e2.entry.js +5 -0
- package/dist/webcomponents/{p-4fe12a72.entry.js → p-f303f6b3.entry.js} +1 -1
- package/dist/webcomponents/p-f85ee01c.entry.js +5 -0
- package/dist/webcomponents/{p-5b257a4b.entry.js → p-ffe0241e.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +3 -7
- package/dist/components/p-BW0_ORNA.js +0 -5
- package/dist/components/p-C3LQSQpc.js +0 -5
- package/dist/components/p-CRfi23Rd.js +0 -5
- package/dist/components/p-CUI5zWGf.js +0 -5
- package/dist/components/p-CxviDiCr.js +0 -5
- package/dist/components/p-DvrdmqoQ.js +0 -5
- package/dist/components/p-TFWd_UBV.js +0 -5
- package/dist/components/p-cfPt-vKA.js +0 -5
- package/dist/webcomponents/p-059c3d6c.entry.js +0 -5
- package/dist/webcomponents/p-0b8f39bc.entry.js +0 -5
- package/dist/webcomponents/p-1b138f1c.entry.js +0 -5
- package/dist/webcomponents/p-22443c08.entry.js +0 -5
- package/dist/webcomponents/p-6c5f6cb6.entry.js +0 -5
- package/dist/webcomponents/p-6f1c4425.entry.js +0 -5
- package/dist/webcomponents/p-7cf9f4e5.entry.js +0 -5
- package/dist/webcomponents/p-7e1856e4.entry.js +0 -5
- package/dist/webcomponents/p-bba9fc09.entry.js +0 -5
- package/dist/webcomponents/p-cedb8eea.entry.js +0 -5
- package/dist/webcomponents/p-dba376cb.entry.js +0 -5
- package/dist/webcomponents/p-e80a1eb0.entry.js +0 -5
|
@@ -124,6 +124,7 @@ const Item = class {
|
|
|
124
124
|
this.activate();
|
|
125
125
|
}
|
|
126
126
|
};
|
|
127
|
+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: mantém em uma transação os modos standalone, controlado, radio e checkbox.
|
|
127
128
|
this.handleClick = (event) => {
|
|
128
129
|
if (this.disabled) {
|
|
129
130
|
event.preventDefault();
|
|
@@ -155,14 +156,17 @@ const Item = class {
|
|
|
155
156
|
}
|
|
156
157
|
else {
|
|
157
158
|
// Armazena o estado anterior para emitir o evento apenas se houver mudança.
|
|
158
|
-
const previousSelectedValue = this.selectedValue;
|
|
159
|
-
|
|
160
|
-
if (
|
|
161
|
-
|
|
159
|
+
const previousSelectedValue = this.hasControlledSelection ? Boolean(this.selected) : this.selectedValue;
|
|
160
|
+
const nextSelected = !previousSelectedValue;
|
|
161
|
+
if (!this.hasControlledSelection)
|
|
162
|
+
this.selectedValue = nextSelected;
|
|
163
|
+
if (previousSelectedValue !== nextSelected) {
|
|
164
|
+
const detail = { selected: nextSelected };
|
|
162
165
|
this.brDidSelect.emit(detail);
|
|
163
166
|
this.brItemSelect.emit(detail);
|
|
164
167
|
}
|
|
165
|
-
this.
|
|
168
|
+
if (!this.hasControlledSelection)
|
|
169
|
+
this.updateCheckboxes();
|
|
166
170
|
}
|
|
167
171
|
}
|
|
168
172
|
event.stopPropagation();
|
|
@@ -226,7 +230,6 @@ const Item = class {
|
|
|
226
230
|
*/
|
|
227
231
|
async setFocus() {
|
|
228
232
|
this.el?.focus();
|
|
229
|
-
this.focusableElement?.focus();
|
|
230
233
|
}
|
|
231
234
|
/**
|
|
232
235
|
* Define o tabIndex do elemento interno.
|
|
@@ -242,6 +245,9 @@ const Item = class {
|
|
|
242
245
|
get effectiveSelected() {
|
|
243
246
|
return this.selected ?? this.isSelected;
|
|
244
247
|
}
|
|
248
|
+
get hasControlledSelection() {
|
|
249
|
+
return this.selected !== undefined;
|
|
250
|
+
}
|
|
245
251
|
get effectiveInteractive() {
|
|
246
252
|
return (this.interactive ??
|
|
247
253
|
(this.isInteractive ||
|
|
@@ -264,7 +270,7 @@ const Item = class {
|
|
|
264
270
|
'br-item': true,
|
|
265
271
|
disabled: this.disabled,
|
|
266
272
|
active: this.effectiveActive,
|
|
267
|
-
selected: this.selectedValue,
|
|
273
|
+
selected: this.selected ?? this.selectedValue,
|
|
268
274
|
small: this.density === 'small',
|
|
269
275
|
medium: this.density === 'medium',
|
|
270
276
|
large: this.density === 'large',
|
|
@@ -294,21 +300,23 @@ const Item = class {
|
|
|
294
300
|
return {
|
|
295
301
|
...baseAttributes,
|
|
296
302
|
role: isInteractiveDiv ? 'button' : null,
|
|
297
|
-
'aria-pressed': isInteractiveDiv ? String(this.selectedValue) : null,
|
|
303
|
+
'aria-pressed': isInteractiveDiv ? String(this.selected ?? this.selectedValue) : null,
|
|
298
304
|
tabIndex: this.disabled || !isFocusableItem ? -1 : this.rovingTabIndex,
|
|
299
305
|
'aria-disabled': this.disabled ? 'true' : null,
|
|
300
306
|
'aria-current': this.effectiveActive ? 'true' : null,
|
|
301
307
|
'data-toggle': this.effectiveInteractive ? 'selection' : null,
|
|
302
|
-
'is-selected': this.selectedValue ? true : null,
|
|
308
|
+
'is-selected': (this.selected ?? this.selectedValue) ? true : null,
|
|
303
309
|
};
|
|
304
310
|
}
|
|
305
311
|
updateCheckboxSelectionState(emitEvent = true) {
|
|
306
312
|
if (this.hasRadios)
|
|
307
313
|
return;
|
|
308
314
|
const checkboxes = Array.from(this.el.querySelectorAll('br-checkbox'));
|
|
309
|
-
|
|
315
|
+
const nextSelected = checkboxes.some((checkbox) => checkbox.checked);
|
|
316
|
+
if (!this.hasControlledSelection)
|
|
317
|
+
this.selectedValue = nextSelected;
|
|
310
318
|
if (emitEvent && this.effectiveInteractive) {
|
|
311
|
-
const detail = { selected:
|
|
319
|
+
const detail = { selected: nextSelected };
|
|
312
320
|
this.brDidSelect.emit(detail);
|
|
313
321
|
this.brItemSelect.emit(detail);
|
|
314
322
|
}
|
|
@@ -317,9 +325,11 @@ const Item = class {
|
|
|
317
325
|
if (!this.hasRadios)
|
|
318
326
|
return;
|
|
319
327
|
const radios = Array.from(this.el.querySelectorAll('br-radio'));
|
|
320
|
-
|
|
328
|
+
const nextSelected = radios.some((radio) => radio.checked);
|
|
329
|
+
if (!this.hasControlledSelection)
|
|
330
|
+
this.selectedValue = nextSelected;
|
|
321
331
|
if (emitEvent && this.effectiveInteractive) {
|
|
322
|
-
const detail = { selected:
|
|
332
|
+
const detail = { selected: nextSelected };
|
|
323
333
|
this.brDidSelect.emit(detail);
|
|
324
334
|
this.brItemSelect.emit(detail);
|
|
325
335
|
}
|
|
@@ -339,8 +349,9 @@ const Item = class {
|
|
|
339
349
|
const TagType = this.getTagType();
|
|
340
350
|
const attributes = this.getAttributes();
|
|
341
351
|
const classList = this.getCssClassMap();
|
|
342
|
-
return (index.h(index.Host, { key: '
|
|
352
|
+
return (index.h(index.Host, { key: '0c2e8ad9198db23ff1c43bc1a48cabe478f4d207', tabindex: this.isInteractive || this.effectiveInteractive ? (this.disabled ? -1 : 0) : undefined }, index.h(TagType, { key: 'd88d1732106bba4167118f16f2a27fdf3cf0f660', class: classList, ...attributes, tabindex: this.isInteractive || this.effectiveInteractive ? (this.disabled ? -1 : 0) : undefined, onClick: this.handleClick, onKeyDown: this.handleKeydown, id: this.customId, ref: (el) => (this.focusableElement = el), onMouseDown: this.handleMouseDown, part: "item" }, this.hasSlotStart || this.hasSlotEnd ? (index.h("div", { class: "row align-items-center" }, this.hasSlotStart && (index.h("div", { class: "col-auto" }, index.h("slot", { name: "start" }))), index.h("div", { class: "col" }, index.h("slot", null)), this.hasSlotEnd && (index.h("div", { class: "col-auto" }, index.h("slot", { name: "end" }))))) : (index.h("slot", null)))));
|
|
343
353
|
}
|
|
354
|
+
static get delegatesFocus() { return true; }
|
|
344
355
|
get el() { return index.getElement(this); }
|
|
345
356
|
static get watchers() { return {
|
|
346
357
|
"isSelected": [{
|
|
@@ -118,8 +118,9 @@ const Link = class {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
render() {
|
|
121
|
-
return (index.h(index.Host, { key: '
|
|
121
|
+
return (index.h(index.Host, { key: '3a2d7f49bfafc65412524d38a964a713ee1fe526' }, index.h("a", { key: 'eddc87987df0418b5fdde03b39cadbc2db73762b', part: "anchor", class: { 'br-button': this.button }, href: this.disabled ? undefined : this.href, target: this.target, rel: this.getRel(), download: this.download, hreflang: this.hreflang, referrerPolicy: this.referrerPolicy, type: this.type, "aria-disabled": this.disabled ? 'true' : null, onClick: this.handleClick, ...this.getAnchorAttrs() }, index.h("slot", { key: '74ece0d935b97cb91fd9d8df789f709dc3c5068d' }))));
|
|
122
122
|
}
|
|
123
|
+
static get delegatesFocus() { return true; }
|
|
123
124
|
get el() { return index.getElement(this); }
|
|
124
125
|
static get watchers() { return {
|
|
125
126
|
"disabled": [{
|
|
@@ -83,8 +83,9 @@ const MagicButton = class {
|
|
|
83
83
|
*/
|
|
84
84
|
render() {
|
|
85
85
|
const effectiveAriaLabel = this.ariaLabel || this.label || (this.icon ? `Botão com ícone ${this.icon}` : 'Botão');
|
|
86
|
-
return (index.h(index.Host, { key: '
|
|
86
|
+
return (index.h(index.Host, { key: '0eec103c783b1ad5d02b3e5605b150e467dbb782', id: this.customId }, index.h("div", { key: '53dae45267a14d4785b630dd4892277e3e869f37', class: this.getCssClassMap(), part: "container" }, index.h("button", { key: 'f3e72b2e22d67473a9879c5bb6ba4912cca15be0', class: { 'br-button': true, ...this.getCircleClass() }, type: "button", "aria-label": effectiveAriaLabel, part: "button" }, this.icon && (index.h("slot", { key: '409abad9354040b75650c0b104963c945601114c', name: "icon" }, index.h("icon-base", { key: '5e8024b8568e054b8f6974bc5421db7990524c52', "attr:iconName": this.icon, class: this.getLabelIconClass() }))), this.label || index.h("slot", { key: '6c2ccb7672ae15f36d02ec8036f047b31e716e9e' })))));
|
|
87
87
|
}
|
|
88
|
+
static get delegatesFocus() { return true; }
|
|
88
89
|
get el() { return index.getElement(this); }
|
|
89
90
|
};
|
|
90
91
|
MagicButton.style = magicButtonCss();
|
|
@@ -46,8 +46,9 @@ const MenuLink = class {
|
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
render() {
|
|
49
|
-
return (index.h(index.Host, { key: '
|
|
49
|
+
return (index.h(index.Host, { key: '6c4c305cc78db8d5f5493f6b00884a475325aabd' }, index.h("a", { key: 'd47a7f201e03bf6f6b0fd6fccce39db183d43765', href: this.href, target: this.target, rel: this.target === '_blank' ? 'noopener noreferrer' : undefined, onClick: this.handleClick, part: "link" }, index.h("slot", { key: '8dca721902edbea3a7b6cd80779ec37032d78005', name: "url" }, index.h("span", { key: 'c199d67e8dd3cec1e909a3b0d1f6506f00b29196', class: "mr-1" }, this.label ?? this.titulo)), index.h("slot", { key: 'e7d1b3288faaf9af7921e11ba277ac79243b50d5', name: "icon" }, index.h("br-icon", { key: '49e8a907a204059d40342b968bc27cb9481acd99', iconName: "fa6-solid:square-arrow-up-right", width: "12", height: "12", "aria-hidden": "true" })))));
|
|
50
50
|
}
|
|
51
|
+
static get delegatesFocus() { return true; }
|
|
51
52
|
get el() { return index.getElement(this); }
|
|
52
53
|
};
|
|
53
54
|
MenuLink.style = menuLinkCss();
|
|
@@ -117,10 +117,11 @@ const SelectInput = class {
|
|
|
117
117
|
return (index.h("br-icon", { "aria-hidden": "true", iconName: this.flipped ? 'fa-solid:angle-up' : 'fa-solid:angle-down', width: "16", height: "16", slot: "action" }));
|
|
118
118
|
}
|
|
119
119
|
render() {
|
|
120
|
-
return (index.h(index.Host, { key: '
|
|
120
|
+
return (index.h(index.Host, { key: 'be737b653173bc2a31e9065989dbe44c2bdac4a7' }, index.h("div", { key: 'c2b733eb6a3973f50788019f86360b0000df9f34', class: this.getCssClassMap(), part: "container" }, index.h("br-input", { key: '72882f4a77405e2a0bf04523d0dbf36a6a4e855d', "action-tab-index": -1, "action-label": this.flipped ? 'Fechar opções' : 'Abrir opções', autocomplete: this.autocomplete, borderless: this.borderless, "control-width": this.inputWidth, readonly: !this.filterable, "is-inline": this.isInline, label: this.label, name: this.name, placeholder: this.placeholder, required: this.required, ref: (el) => {
|
|
121
121
|
this.inputElement = el;
|
|
122
122
|
}, value: this.value, disabled: this.disabled, onClick: this.handleClick, onInput: this.handleInput, onFocus: this.handleFocus, exportparts: "container:input, label:label, input:input, group:group, icon:icon, action:action, action-button:action-button" }, this.showSearchIcon && this.renderSearchIcon(), this.renderDropdownIcon()))));
|
|
123
123
|
}
|
|
124
|
+
static get delegatesFocus() { return true; }
|
|
124
125
|
static get formAssociated() { return true; }
|
|
125
126
|
get el() { return index.getElement(this); }
|
|
126
127
|
};
|
|
@@ -230,6 +231,8 @@ const SelectList = class {
|
|
|
230
231
|
this.options = this.syncSelectAllOption(this.options);
|
|
231
232
|
}
|
|
232
233
|
handleOptionStateChange(event) {
|
|
234
|
+
if (this.isControlledBySelect)
|
|
235
|
+
return;
|
|
233
236
|
const detail = event.detail;
|
|
234
237
|
if (!detail?.value)
|
|
235
238
|
return;
|
|
@@ -330,9 +333,15 @@ const SelectList = class {
|
|
|
330
333
|
*/
|
|
331
334
|
async setMultiple(isMultiple) {
|
|
332
335
|
this.isMultiple = isMultiple;
|
|
333
|
-
|
|
336
|
+
if (!this.isControlledBySelect)
|
|
337
|
+
this.options = this.normalizeOptionsForMode(this.options, isMultiple);
|
|
334
338
|
this.scheduleMeasureItemHeight();
|
|
335
339
|
}
|
|
340
|
+
get isControlledBySelect() {
|
|
341
|
+
const root = this.el.getRootNode();
|
|
342
|
+
const host = root.host;
|
|
343
|
+
return host?.tagName?.toLowerCase() === 'br-select';
|
|
344
|
+
}
|
|
336
345
|
/**
|
|
337
346
|
* Retorna uma cópia das opções atualmente controladas pela lista.
|
|
338
347
|
*
|
|
@@ -653,14 +662,18 @@ const SelectList = class {
|
|
|
653
662
|
renderOption(option, index$1) {
|
|
654
663
|
const rowHeight = this.getRowHeight();
|
|
655
664
|
const optionPart = this.isSelectAllOption(option) ? 'option select-all' : 'option';
|
|
656
|
-
return (index.h("br-select-option", { part: optionPart, active: index$1 === this.activeOptionIndex, "data-option-index": index$1, disabled: option.disabled, id: `${this.el.id || 'br-select-list'}-option-${index$1}`, indeterminate: option.indeterminate,
|
|
665
|
+
return (index.h("br-select-option", { part: optionPart, active: index$1 === this.activeOptionIndex, "data-option-index": index$1, disabled: option.disabled, id: `${this.el.id || 'br-select-list'}-option-${index$1}`, indeterminate: option.indeterminate,
|
|
666
|
+
// A seleção faz parte da identidade visual renderizada. Incluir o estado
|
|
667
|
+
// na chave evita que uma opção virtual reutilizada retenha o snapshot
|
|
668
|
+
// interno anterior do br-select-option/br-item.
|
|
669
|
+
key: `${option.value}:${option.selected ? 'selected' : 'unselected'}`, label: option.label, selected: option.selected, "show-checkbox": this.isMultiple, style: {
|
|
657
670
|
boxSizing: 'border-box',
|
|
658
671
|
height: `${rowHeight}px`,
|
|
659
672
|
position: 'absolute',
|
|
660
673
|
top: `${index$1 * rowHeight}px`,
|
|
661
674
|
left: '0',
|
|
662
675
|
right: '0',
|
|
663
|
-
}, value: option.value }, option.label ?? option.value));
|
|
676
|
+
}, value: option.value }, option.content ? index.h("span", { innerHTML: option.content }) : (option.label ?? option.value)));
|
|
664
677
|
}
|
|
665
678
|
getVirtualScrollStyle() {
|
|
666
679
|
return {
|
|
@@ -694,7 +707,7 @@ const SelectList = class {
|
|
|
694
707
|
return (index.h("div", { part: "loading", role: "status", "aria-live": "polite" }, index.h("slot", { name: "loading" }, index.h("br-loading", { size: "small", label: "Buscando op\u00E7\u00F5es" }))));
|
|
695
708
|
}
|
|
696
709
|
render() {
|
|
697
|
-
return (index.h(index.Host, { key: '
|
|
710
|
+
return (index.h(index.Host, { key: '537c7f312573570953b24e27fed7188a052c4bd5' }, index.h("div", { key: 'aac978e5664c9dee21ba7a6763125fe7daf915d3', class: this.getCssClassMap(), part: "list", ref: (el) => (this.listElement = el), onScroll: this.handleScroll, style: this.getVirtualScrollStyle() }, this.loading ? this.renderLoading() : this.renderVirtualOptions())));
|
|
698
711
|
}
|
|
699
712
|
get el() { return index.getElement(this); }
|
|
700
713
|
static get watchers() { return {
|
|
@@ -786,7 +799,10 @@ const SelectOption = class {
|
|
|
786
799
|
if (this.isRedundantCheckboxReflection(event, current)) {
|
|
787
800
|
return;
|
|
788
801
|
}
|
|
789
|
-
this.
|
|
802
|
+
if (this.isControlledBySelect)
|
|
803
|
+
this.emitStateChange(current);
|
|
804
|
+
else
|
|
805
|
+
this.applySelection(current);
|
|
790
806
|
};
|
|
791
807
|
}
|
|
792
808
|
componentDidLoad() {
|
|
@@ -824,7 +840,11 @@ const SelectOption = class {
|
|
|
824
840
|
async setSelectedState(selected) {
|
|
825
841
|
if (this.disabled)
|
|
826
842
|
return;
|
|
827
|
-
|
|
843
|
+
const nextSelected = typeof selected === 'boolean' ? selected : !this.selected;
|
|
844
|
+
if (this.isControlledBySelect)
|
|
845
|
+
this.emitStateChange(nextSelected);
|
|
846
|
+
else
|
|
847
|
+
this.applySelection(nextSelected);
|
|
828
848
|
}
|
|
829
849
|
isRedundantCheckboxReflection(event, nextSelected) {
|
|
830
850
|
if (!event)
|
|
@@ -836,11 +856,11 @@ const SelectOption = class {
|
|
|
836
856
|
return false;
|
|
837
857
|
return Boolean(nextSelected) === Boolean(this.selected);
|
|
838
858
|
}
|
|
839
|
-
emitStateChange() {
|
|
859
|
+
emitStateChange(selected = this.selected) {
|
|
840
860
|
const detail = {
|
|
841
861
|
disabled: this.disabled,
|
|
842
862
|
indeterminate: this.indeterminate,
|
|
843
|
-
selected
|
|
863
|
+
selected,
|
|
844
864
|
value: this.getResolvedValue(),
|
|
845
865
|
label: this.getResolvedLabel(),
|
|
846
866
|
};
|
|
@@ -850,6 +870,20 @@ const SelectOption = class {
|
|
|
850
870
|
this.lastStateChangeKey = nextKey;
|
|
851
871
|
this.brSelectOptionStateChange.emit(detail);
|
|
852
872
|
}
|
|
873
|
+
get isControlledBySelect() {
|
|
874
|
+
if (this.el.closest('br-select'))
|
|
875
|
+
return true;
|
|
876
|
+
let node = this.el;
|
|
877
|
+
for (;;) {
|
|
878
|
+
const root = node.getRootNode();
|
|
879
|
+
const host = root.host;
|
|
880
|
+
if (!host)
|
|
881
|
+
return false;
|
|
882
|
+
if (host.tagName.toLowerCase() === 'br-select')
|
|
883
|
+
return true;
|
|
884
|
+
node = host;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
853
887
|
/**
|
|
854
888
|
* Centraliza a transição de seleção para manter emissão e limpeza de estado consistentes.
|
|
855
889
|
*
|
|
@@ -916,7 +950,7 @@ const SelectOption = class {
|
|
|
916
950
|
return this.normalizeText(this.el.textContent || '');
|
|
917
951
|
}
|
|
918
952
|
render() {
|
|
919
|
-
return (index.h(index.Host, { key: '
|
|
953
|
+
return (index.h(index.Host, { key: '3b20b8766d73d6a862765fb890028e6ff7374d96', part: "option", exportparts: "checkbox:checkbox, checkbox:option-checkbox", "aria-disabled": this.disabled ? 'true' : 'false', "aria-selected": this.selected ? 'true' : 'false', role: "option", onMouseEnter: () => {
|
|
920
954
|
this.el.dispatchEvent(new CustomEvent('brInternalSelectOptionHover', {
|
|
921
955
|
bubbles: true,
|
|
922
956
|
composed: true,
|
|
@@ -928,7 +962,7 @@ const SelectOption = class {
|
|
|
928
962
|
composed: true,
|
|
929
963
|
detail: { label: this.getResolvedLabel(), value: this.getResolvedValue() },
|
|
930
964
|
}));
|
|
931
|
-
} }, index.h("br-item", { key: '
|
|
965
|
+
} }, index.h("br-item", { key: '7b32b68bbc5541090e24d81e55602045bdbbba47', class: this.getCssClassMap(), disabled: this.disabled, active: this.active, selected: this.selected, "is-interactive": true, ref: (el) => (this.itemElement = el), onBrItemSelect: this.handleSelect }, this.showCheckbox && (index.h("br-checkbox", { key: 'fd5426e02e229eaaa8b22d457329cce6acf59e51', exportparts: "input:checkbox, input:option-checkbox", slot: "start", checked: this.selected, disabled: this.disabled, indeterminate: this.indeterminate, name: this.getResolvedValue(), onCheckedChange: this.handleSelect })), index.h("span", { key: '6185b2e6b60bf65059c321d4118d675859f9940e', class: "br-select-option-label" }, index.h("slot", { key: 'c78020a423fe1ed34ef39f46301f71baf5b0cbd8' }, this.getResolvedLabel())))));
|
|
932
966
|
}
|
|
933
967
|
static get formAssociated() { return true; }
|
|
934
968
|
get el() { return index.getElement(this); }
|
|
@@ -116,8 +116,9 @@ const SignIn = class {
|
|
|
116
116
|
const TagType = this.getTagType();
|
|
117
117
|
const attributes = this.getAttributes();
|
|
118
118
|
const classList = this.getCssClassMap();
|
|
119
|
-
return (index.h(index.Host, { key: '
|
|
119
|
+
return (index.h(index.Host, { key: 'bf39bac1bfe99859a67ef858ca441b55e3e74e88', "aria-disabled": this.disabled ? 'true' : null }, index.h(TagType, { key: 'b414dc1085f35a1058b8b8b5490c41380c3f696b', part: "button", class: classList, id: this.customId, ...attributes, onClick: this.handleClick, onFocus: this.handleFocus }, index.h("slot", { key: '3d33a278e13e90572c6b97dbe435b7a9e3823e38', name: "icon" }, this.shape === 'circle' && index.h("br-icon", { key: '3f8a31aac9196ffb6d5b6b99fa0077950fbe4b63', iconName: "fa6-solid:user", width: "12", height: "12" })), index.h("span", { key: 'e3247ad0b75f87c162beb26dffe3f1828f477191', part: "content" }, index.h("slot", { key: 'fa12d65243f404963e16e2e964b7d33c90055e6f' })), this.hasSlotContent('image') && (index.h("span", { key: '51922b0c8786fd2d96814c6a576222330d3b7c72', part: "image" }, index.h("slot", { key: 'b7052a2db95b25ec911ccd43fe70d0d0fc38ad9e', name: "image" }))))));
|
|
120
120
|
}
|
|
121
|
+
static get delegatesFocus() { return true; }
|
|
121
122
|
get el() { return index.getElement(this); }
|
|
122
123
|
};
|
|
123
124
|
SignIn.style = signInCss();
|
|
@@ -665,9 +665,8 @@ const Slider = class {
|
|
|
665
665
|
return (index.h("div", { class: "slider-tick-labels", part: "tick-labels", "aria-hidden": "true" }, intermediateTicks.map((value) => (index.h("span", { class: "slider-tick-label", part: "tick-label", style: this.effectiveVertical ? { bottom: `${this.percentOf(value)}%` } : { left: `${this.percentOf(value)}%` } }, value)))));
|
|
666
666
|
}
|
|
667
667
|
render() {
|
|
668
|
-
return (index.h(index.Host, { key: '
|
|
668
|
+
return (index.h(index.Host, { key: '26be711ad91a867e82e35d10e86508aa5af68557' }, index.h("div", { key: '906052510af8d3a323ea8274b339ba264b745e25', class: this.getCssClassMap(), part: "base" }, index.h("div", { key: '323ee79d4a4fc4d81e4a1b43c8fa6298d0f92916', class: "slider-layout", part: "layout" }, index.h("div", { key: '113e5114161144af0466997b47108eb0e053af8e', class: "slider-body", part: "body" }, this.renderTrack(), this.renderReferences()), this.renderInput())), index.h("div", { key: 'b8ce4c3cae026492ad1db1e03f5709988b42a13e', id: `${this.customId}-feedback`, part: "feedback", hidden: !this.hasFeedbackSlot && !this.customValidationMessage && !this.validatorMessage }, index.h("slot", { key: 'e2564e6830476cb3d495807f4b15d600f5c7146e', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = slot.hasAssignedSlotContent(event.currentTarget)) }), !this.hasFeedbackSlot && (this.customValidationMessage || this.validatorMessage) ? (index.h("br-message", { state: "danger", message: this.customValidationMessage || this.validatorMessage })) : null)));
|
|
669
669
|
}
|
|
670
|
-
static get delegatesFocus() { return true; }
|
|
671
670
|
static get formAssociated() { return true; }
|
|
672
671
|
get el() { return index.getElement(this); }
|
|
673
672
|
static get watchers() { return {
|
|
@@ -465,13 +465,12 @@ const Tag = class {
|
|
|
465
465
|
}
|
|
466
466
|
render() {
|
|
467
467
|
const mainContent = this.renderMainTagContent();
|
|
468
|
-
return (index.h(index.Host, { key: '
|
|
468
|
+
return (index.h(index.Host, { key: '91853c64b346742509a16691c73e85a17fd8f45c' }, this.effectiveSelectable
|
|
469
469
|
? this.renderInteractionSelectTag()
|
|
470
470
|
: this.effectiveStatus
|
|
471
471
|
? this.renderStatusLayout(mainContent)
|
|
472
|
-
: mainContent, index.h("div", { key: '
|
|
472
|
+
: mainContent, index.h("div", { key: 'c1c56c9e60df4e728c2d3a48b3c776b951ee464a', id: `${this.customId}-feedback`, part: "feedback", hidden: !this.hasFeedbackSlot && !this.customValidationMessage && !this.validatorMessage }, index.h("slot", { key: 'cbae6fdc39ec290b40370cb532ba0d2a06a194d2', name: "feedback", onSlotchange: (event) => (this.hasFeedbackSlot = slot.hasAssignedSlotContent(event.currentTarget)) }), !this.hasFeedbackSlot && (this.customValidationMessage || this.validatorMessage) ? (index.h("br-message", { state: "danger", message: this.customValidationMessage || this.validatorMessage })) : null)));
|
|
473
473
|
}
|
|
474
|
-
static get delegatesFocus() { return true; }
|
|
475
474
|
static get formAssociated() { return true; }
|
|
476
475
|
get el() { return index.getElement(this); }
|
|
477
476
|
static get watchers() { return {
|
|
@@ -550,16 +550,15 @@ const Upload = class {
|
|
|
550
550
|
render() {
|
|
551
551
|
const hasFiles = (this.filesSelected && this.filesSelected.length > 0) ||
|
|
552
552
|
(this.parsedUploadFiles && this.parsedUploadFiles.length > 0);
|
|
553
|
-
return (index.h(index.Host, { key: '
|
|
553
|
+
return (index.h(index.Host, { key: 'b2354be16c7963909ce2939d1bd24e99475cc6ef', "aria-busy": this.uploading || this.isValidating ? 'true' : null }, index.h("div", { key: '78808e8f2c3eacce3deb6542ab5e2d9d60bd7e7e', class: this.getCssClassMap(), id: this.customId, part: "container" }, index.h("label", { key: '5881d7133d9118d3c9e1637932adfac7e58fb3b5', id: `label-${this.customId}`, class: "upload-label", htmlFor: `single-file-${this.customId}`, part: "label" }, index.h("span", { key: '7e1c9a04a4f88c06007c2d16ee2df1a7d0ca1956' }, index.h("slot", { key: '1043fac29600fdf581bf8a6fde3928a4b9140bdd', name: "label" }, this.label))), index.h("input", { key: 'acc7aeb2294edb18ff1495ae335f71420f5f55d5', ref: (el) => {
|
|
554
554
|
this.nativeInput = el;
|
|
555
555
|
el.addEventListener('input', this.handleNativeInput);
|
|
556
556
|
}, class: "upload-input", id: `single-file-${this.customId}`, type: "file", onChange: this.handleInputChange, onCancel: this.handleNativeCancel, multiple: this.multiple, disabled: this.isDisabled(), required: this.required, accept: this.accept, capture: this.capture, "aria-labelledby": `label-${this.customId}`, "aria-busy": this.uploading || this.isValidating ? 'true' : null, "aria-describedby": this.hasFeedbackSlot || this.customValidationMessage || this.validatorMessage
|
|
557
557
|
? `${this.customId}-feedback`
|
|
558
558
|
: null, "aria-errormessage": this.customValidationMessage || this.validatorMessage || this.hasFeedbackSlot
|
|
559
559
|
? `${this.customId}-feedback`
|
|
560
|
-
: null, part: "input" }), index.h("button", { key: '
|
|
560
|
+
: null, part: "input" }), index.h("button", { key: 'd52437779c26e2e41a8fa944325385dca9fab5db', class: "upload-button", type: "button", disabled: this.isDisabled(), onClick: () => this.handleFileSelection(), onDragEnter: (event) => this.handleDragEnter(event), onDragLeave: (event) => this.handleDragLeave(event), onDrop: (event) => this.handleDrop(event), onDragOver: (event) => this.handleDragOver(event), "aria-describedby": `label-${this.customId}`, part: "button" }, index.h("br-icon", { key: '5b9514f5bfdfa32c5bbf73443f215454d669a71e', iconName: "fa-solid:upload", width: "20", height: "20", "aria-hidden": "true" }), index.h("slot", { key: '00684193f001d54a684261a9dca1e5c35ba2bcba' }, index.h("span", { key: 'af97d6116a296ae574b5de7c0e26c78a783983b4' }, "Selecione o arquivo"))), index.h("div", { key: '9db7490ea790b63348952dffc52dc67dd8c54a82', class: "upload-help", part: "helper" }, index.h("slot", { key: 'f831bae068bae343d40067922c07431fce1e2295', name: "helper" }, this.multiple ? 'Clique ou arraste os arquivos para cima do componente Upload.' : null)), this.renderUploadStatus(), index.h("slot", { key: 'e6cae25855b7e30f797d51aae53448fc8be7cbf5', name: "upload-list" }, hasFiles && (index.h("br-list", { key: '90c912ba21f3dff6f9c28cf53886414aa0582c4a', id: `${this.customId}-list-files`, class: "upload-list", listRole: "list", density: "small", part: "file-list" }, this.renderFilesUploaded())))), this.renderUploadError(), this.renderFeedback()));
|
|
561
561
|
}
|
|
562
|
-
static get delegatesFocus() { return true; }
|
|
563
562
|
static get formAssociated() { return true; }
|
|
564
563
|
get el() { return index.getElement(this); }
|
|
565
564
|
static get watchers() { return {
|
|
@@ -444,10 +444,6 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
444
444
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
445
445
|
/* webpackMode: "lazy" */
|
|
446
446
|
'./br-table.cjs.entry.js')); }).then(processMod, consoleError);
|
|
447
|
-
case 'br-dropdown_2.cjs':
|
|
448
|
-
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
449
|
-
/* webpackMode: "lazy" */
|
|
450
|
-
'./br-dropdown_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
451
447
|
case 'br-scrim.cjs':
|
|
452
448
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
453
449
|
/* webpackMode: "lazy" */
|
|
@@ -468,6 +464,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
468
464
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
469
465
|
/* webpackMode: "lazy" */
|
|
470
466
|
'./br-icon.cjs.entry.js')); }).then(processMod, consoleError);
|
|
467
|
+
case 'br-dropdown_2.cjs':
|
|
468
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
469
|
+
/* webpackMode: "lazy" */
|
|
470
|
+
'./br-dropdown_2.cjs.entry.js')); }).then(processMod, consoleError);
|
|
471
471
|
case 'br-select-input_3.cjs':
|
|
472
472
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
473
473
|
/* webpackMode: "lazy" */
|