@govbr-ds/webcomponents 2.0.0-next.56 → 2.0.0-next.57
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/dist/cjs/br-checkbox.br-input.br-radio.entry.cjs.js.map +1 -1
- package/dist/cjs/br-checkbox_3.cjs.entry.js +63 -2
- package/dist/cjs/br-dropdown.br-select.entry.cjs.js.map +1 -1
- package/dist/cjs/br-dropdown_2.cjs.entry.js +95 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/components/input/input.js +87 -2
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/select/select.js +160 -8
- package/dist/collection/components/select/select.js.map +1 -1
- package/dist/collection/pages/components/select/index.js +41 -0
- package/dist/components/br-input.js +4 -4
- package/dist/components/br-pagination.js +2 -2
- package/dist/components/br-select.js +4 -4
- package/dist/components/{p-Cw0pxndP.js → p-B8JLH_ik.js} +171 -74
- package/dist/components/p-B8JLH_ik.js.map +1 -0
- package/dist/components/{p-CbnpaWFn.js → p-CkOo_SmU.js} +75 -9
- package/dist/components/p-CkOo_SmU.js.map +1 -0
- package/dist/custom-elements.json +171 -4
- package/dist/esm/br-checkbox.br-input.br-radio.entry.js.map +1 -1
- package/dist/esm/br-checkbox_3.entry.js +63 -2
- package/dist/esm/br-dropdown.br-select.entry.js.map +1 -1
- package/dist/esm/br-dropdown_2.entry.js +95 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/hydrate/index.js +167 -11
- package/dist/hydrate/index.mjs +167 -11
- package/dist/types/components/input/input.d.ts +9 -0
- package/dist/types/components/select/select.d.ts +25 -0
- package/dist/types/components.d.ts +30 -8
- package/dist/webcomponents/br-checkbox.br-input.br-radio.entry.esm.js.map +1 -1
- package/dist/webcomponents/br-dropdown.br-select.entry.esm.js.map +1 -1
- package/dist/webcomponents/{p-abfb0743.entry.js → p-6511c9cd.entry.js} +126 -64
- package/dist/webcomponents/p-6511c9cd.entry.js.map +1 -0
- package/dist/webcomponents/{p-67d88dcb.entry.js → p-a7fa8119.entry.js} +110 -18
- package/dist/webcomponents/p-a7fa8119.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +15 -15
- package/dist/webcomponents.html-custom-data.json +7 -2
- package/package.json +1 -1
- package/dist/components/p-CbnpaWFn.js.map +0 -1
- package/dist/components/p-Cw0pxndP.js.map +0 -1
- package/dist/webcomponents/p-67d88dcb.entry.js.map +0 -1
- package/dist/webcomponents/p-abfb0743.entry.js.map +0 -1
package/dist/hydrate/index.mjs
CHANGED
|
@@ -10242,7 +10242,17 @@ class Input {
|
|
|
10242
10242
|
this.hasActionSlot = false;
|
|
10243
10243
|
this.hasFeedbackSlot = false;
|
|
10244
10244
|
this.handleInput = (event) => {
|
|
10245
|
-
|
|
10245
|
+
var _a;
|
|
10246
|
+
const inputElement = event.target;
|
|
10247
|
+
let nextValue = (_a = inputElement.value) !== null && _a !== void 0 ? _a : '';
|
|
10248
|
+
if (this.hasMaskConfigured()) {
|
|
10249
|
+
const maskedValue = this.applyMask(nextValue);
|
|
10250
|
+
if (maskedValue !== nextValue) {
|
|
10251
|
+
inputElement.value = maskedValue;
|
|
10252
|
+
}
|
|
10253
|
+
nextValue = maskedValue;
|
|
10254
|
+
}
|
|
10255
|
+
this.value = nextValue;
|
|
10246
10256
|
this.valueChange.emit(this.value);
|
|
10247
10257
|
};
|
|
10248
10258
|
this.renderLabel = () => {
|
|
@@ -10295,6 +10305,7 @@ class Input {
|
|
|
10295
10305
|
this.hasActionSlot = this.hasSlotContent('action');
|
|
10296
10306
|
this.hasFeedbackSlot = this.hasSlotContent('feedback');
|
|
10297
10307
|
this.internalState = this.state;
|
|
10308
|
+
this.applyMaskToValue();
|
|
10298
10309
|
if (this.hasFeedbackSlot) {
|
|
10299
10310
|
this.initializeStateWithFeedback();
|
|
10300
10311
|
}
|
|
@@ -10347,6 +10358,18 @@ class Input {
|
|
|
10347
10358
|
warning: this.internalState === 'warning',
|
|
10348
10359
|
};
|
|
10349
10360
|
}
|
|
10361
|
+
handleValueChange(newValue) {
|
|
10362
|
+
if (!this.hasMaskConfigured()) {
|
|
10363
|
+
return;
|
|
10364
|
+
}
|
|
10365
|
+
const maskedValue = this.applyMask(newValue !== null && newValue !== void 0 ? newValue : '');
|
|
10366
|
+
if (maskedValue !== newValue) {
|
|
10367
|
+
this.value = maskedValue;
|
|
10368
|
+
}
|
|
10369
|
+
}
|
|
10370
|
+
handleMaskChange() {
|
|
10371
|
+
this.applyMaskToValue();
|
|
10372
|
+
}
|
|
10350
10373
|
hasSlotContent(slotName) {
|
|
10351
10374
|
return this.el.querySelector(`[slot="${slotName}"]`) !== null;
|
|
10352
10375
|
}
|
|
@@ -10369,11 +10392,49 @@ class Input {
|
|
|
10369
10392
|
return hAsync("slot", { name: "feedback" });
|
|
10370
10393
|
}
|
|
10371
10394
|
}
|
|
10395
|
+
applyMaskToValue() {
|
|
10396
|
+
if (!this.hasMaskConfigured() || this.value === undefined || this.value === null) {
|
|
10397
|
+
return;
|
|
10398
|
+
}
|
|
10399
|
+
const maskedValue = this.applyMask(this.value);
|
|
10400
|
+
if (this.value !== maskedValue) {
|
|
10401
|
+
this.value = maskedValue;
|
|
10402
|
+
}
|
|
10403
|
+
}
|
|
10404
|
+
applyMask(value) {
|
|
10405
|
+
if (!this.hasMaskConfigured()) {
|
|
10406
|
+
return value !== null && value !== void 0 ? value : '';
|
|
10407
|
+
}
|
|
10408
|
+
const digits = (value !== null && value !== void 0 ? value : '').replace(/\D/g, '');
|
|
10409
|
+
if (digits.length === 0) {
|
|
10410
|
+
return '';
|
|
10411
|
+
}
|
|
10412
|
+
let maskedValue = '';
|
|
10413
|
+
let digitIndex = 0;
|
|
10414
|
+
for (let i = 0; i < this.mask.length && digitIndex < digits.length; i++) {
|
|
10415
|
+
const maskChar = this.mask[i];
|
|
10416
|
+
if (maskChar === '#') {
|
|
10417
|
+
maskedValue += digits[digitIndex];
|
|
10418
|
+
digitIndex++;
|
|
10419
|
+
}
|
|
10420
|
+
else {
|
|
10421
|
+
maskedValue += maskChar;
|
|
10422
|
+
}
|
|
10423
|
+
}
|
|
10424
|
+
return maskedValue;
|
|
10425
|
+
}
|
|
10426
|
+
hasMaskConfigured() {
|
|
10427
|
+
return typeof this.mask === 'string' && this.mask.length > 0;
|
|
10428
|
+
}
|
|
10372
10429
|
render() {
|
|
10373
|
-
return (hAsync(Host, { key: '
|
|
10430
|
+
return (hAsync(Host, { key: '251164fce4650bd0fa1a1b9189537b11c2ebe6b6' }, hAsync("div", { key: '7b2f561f2cc1d767ba75b483e3d2b93bccd30901', class: this.getInputCssClassMap() }, this.renderLabel(), this.isInline ? this.renderInlineInputContent() : this.renderInputContent(), this.renderFeedback())));
|
|
10374
10431
|
}
|
|
10375
10432
|
static get formAssociated() { return true; }
|
|
10376
10433
|
get el() { return getElement(this); }
|
|
10434
|
+
static get watchers() { return {
|
|
10435
|
+
"value": ["handleValueChange"],
|
|
10436
|
+
"mask": ["handleMaskChange"]
|
|
10437
|
+
}; }
|
|
10377
10438
|
static get style() { return inputCss; }
|
|
10378
10439
|
static get cmpMeta() { return {
|
|
10379
10440
|
"$flags$": 329,
|
|
@@ -10403,6 +10464,7 @@ class Input {
|
|
|
10403
10464
|
"maxlength": [514],
|
|
10404
10465
|
"multiple": [516],
|
|
10405
10466
|
"pattern": [513],
|
|
10467
|
+
"mask": [513],
|
|
10406
10468
|
"step": [514],
|
|
10407
10469
|
"actionLabel": [513, "action-label"],
|
|
10408
10470
|
"isPasswordVisible": [32],
|
|
@@ -10413,7 +10475,7 @@ class Input {
|
|
|
10413
10475
|
},
|
|
10414
10476
|
"$listeners$": undefined,
|
|
10415
10477
|
"$lazyBundleId$": "-",
|
|
10416
|
-
"$attrsToReflect$": [["type", "type"], ["autocomplete", "autocomplete"], ["density", "density"], ["disabled", "disabled"], ["isInline", "is-inline"], ["isHighlight", "is-highlight"], ["state", "state"], ["label", "label"], ["customId", "custom-id"], ["name", "name"], ["placeholder", "placeholder"], ["readonly", "readonly"], ["required", "required"], ["value", "value"], ["controlWidth", "control-width"], ["borderless", "borderless"], ["helpText", "help-text"], ["autocorrect", "autocorrect"], ["min", "min"], ["max", "max"], ["minlength", "minlength"], ["maxlength", "maxlength"], ["multiple", "multiple"], ["pattern", "pattern"], ["step", "step"], ["actionLabel", "action-label"]]
|
|
10478
|
+
"$attrsToReflect$": [["type", "type"], ["autocomplete", "autocomplete"], ["density", "density"], ["disabled", "disabled"], ["isInline", "is-inline"], ["isHighlight", "is-highlight"], ["state", "state"], ["label", "label"], ["customId", "custom-id"], ["name", "name"], ["placeholder", "placeholder"], ["readonly", "readonly"], ["required", "required"], ["value", "value"], ["controlWidth", "control-width"], ["borderless", "borderless"], ["helpText", "help-text"], ["autocorrect", "autocorrect"], ["min", "min"], ["max", "max"], ["minlength", "minlength"], ["maxlength", "maxlength"], ["multiple", "multiple"], ["pattern", "pattern"], ["mask", "mask"], ["step", "step"], ["actionLabel", "action-label"]]
|
|
10417
10479
|
}; }
|
|
10418
10480
|
}
|
|
10419
10481
|
let inputId = 0;
|
|
@@ -12568,8 +12630,12 @@ class Select {
|
|
|
12568
12630
|
// Representa as opções do select disponíveis para renderização.
|
|
12569
12631
|
// Cada opção contém `label`, `value` e o estado de seleção (`selected`).
|
|
12570
12632
|
this.parsedOptions = [];
|
|
12633
|
+
// Opções filtradas de acordo com o termo de busca digitado.
|
|
12634
|
+
this.filteredOptions = [];
|
|
12571
12635
|
// Valor exibido no input, refletindo as opções selecionadas.
|
|
12572
12636
|
this.inputValue = '';
|
|
12637
|
+
// Termo digitado no input (modo busca).
|
|
12638
|
+
this.searchTerm = '';
|
|
12573
12639
|
// Indica se todas as opções estão selecionadas. Comportamento do checkbox "Selecionar Todos".
|
|
12574
12640
|
this.isAllSelected = false;
|
|
12575
12641
|
// Controla se a lista de opções do select está expandida (aberta) ou colapsada (fechada).
|
|
@@ -12618,6 +12684,8 @@ class Select {
|
|
|
12618
12684
|
}
|
|
12619
12685
|
// Sanitiza as opções (remove opções inválidas, etc.)
|
|
12620
12686
|
this.parsedOptions = parsedOptions;
|
|
12687
|
+
// Atualiza lista filtrada considerando o termo atual
|
|
12688
|
+
this.filteredOptions = this.getFilteredOptions(this.searchTerm);
|
|
12621
12689
|
// Atualiza o estado do componente
|
|
12622
12690
|
this.updateSelectedOptions();
|
|
12623
12691
|
this.updateSelectedAllState();
|
|
@@ -12634,6 +12702,7 @@ class Select {
|
|
|
12634
12702
|
this.selectedValue = newVal;
|
|
12635
12703
|
this.updateSelectedOptions(); // mantém inputValue coeso
|
|
12636
12704
|
this.updateSelectedAllState();
|
|
12705
|
+
this.filteredOptions = this.getFilteredOptions(this.searchTerm);
|
|
12637
12706
|
}
|
|
12638
12707
|
componentWillLoad() {
|
|
12639
12708
|
this.isExpanded = this.isOpen;
|
|
@@ -12736,17 +12805,23 @@ class Select {
|
|
|
12736
12805
|
}
|
|
12737
12806
|
handleSelection(index) {
|
|
12738
12807
|
var _a, _b;
|
|
12739
|
-
if (index < 0 || index >= this.
|
|
12808
|
+
if (index < 0 || index >= this.filteredOptions.length) {
|
|
12809
|
+
return;
|
|
12810
|
+
}
|
|
12811
|
+
// Localiza opção original a partir da lista filtrada
|
|
12812
|
+
const selectedOption = this.filteredOptions[index];
|
|
12813
|
+
const originalIndex = this.parsedOptions.findIndex((o) => o.value === selectedOption.value);
|
|
12814
|
+
if (originalIndex === -1) {
|
|
12740
12815
|
return;
|
|
12741
12816
|
}
|
|
12742
12817
|
if (this.isMultiple) {
|
|
12743
12818
|
const updatedOptions = [...this.parsedOptions];
|
|
12744
|
-
updatedOptions[
|
|
12819
|
+
updatedOptions[originalIndex].selected = !updatedOptions[originalIndex].selected;
|
|
12745
12820
|
this.parsedOptions = updatedOptions;
|
|
12746
12821
|
}
|
|
12747
12822
|
else {
|
|
12748
12823
|
const updatedOptions = this.parsedOptions.map((option) => (Object.assign(Object.assign({}, option), { selected: false })));
|
|
12749
|
-
updatedOptions[
|
|
12824
|
+
updatedOptions[originalIndex].selected = true;
|
|
12750
12825
|
this.parsedOptions = updatedOptions;
|
|
12751
12826
|
this.isExpanded = false;
|
|
12752
12827
|
}
|
|
@@ -12759,6 +12834,7 @@ class Select {
|
|
|
12759
12834
|
this.valueChange.emit(this.selectedValue);
|
|
12760
12835
|
this.updateSelectedOptions();
|
|
12761
12836
|
this.updateSelectedAllState();
|
|
12837
|
+
this.filteredOptions = this.getFilteredOptions(this.searchTerm);
|
|
12762
12838
|
try {
|
|
12763
12839
|
this.elementInternals.setFormValue(JSON.stringify((_b = this.selectedValue) !== null && _b !== void 0 ? _b : []));
|
|
12764
12840
|
}
|
|
@@ -12769,6 +12845,23 @@ class Select {
|
|
|
12769
12845
|
updateSelectedOptions() {
|
|
12770
12846
|
this.inputValue = this.getStringValue(this.parsedOptions.filter((option) => option.selected));
|
|
12771
12847
|
}
|
|
12848
|
+
normalizeText(text) {
|
|
12849
|
+
return (text || '')
|
|
12850
|
+
.normalize('NFD')
|
|
12851
|
+
.replace(/[\u0300-\u036f]/g, '')
|
|
12852
|
+
.toLowerCase();
|
|
12853
|
+
}
|
|
12854
|
+
getFilteredOptions(term) {
|
|
12855
|
+
if (!term) {
|
|
12856
|
+
return this.parsedOptions;
|
|
12857
|
+
}
|
|
12858
|
+
const normalizedTerm = this.normalizeText(term);
|
|
12859
|
+
return this.parsedOptions.filter((option) => {
|
|
12860
|
+
const normalizedLabel = this.normalizeText(option.label || option.value);
|
|
12861
|
+
const normalizedValue = this.normalizeText(option.value);
|
|
12862
|
+
return normalizedLabel.includes(normalizedTerm) || normalizedValue.includes(normalizedTerm);
|
|
12863
|
+
});
|
|
12864
|
+
}
|
|
12772
12865
|
getStringValue(options) {
|
|
12773
12866
|
if (options.length > 0) {
|
|
12774
12867
|
const firstSelected = options[0].label || options[0].value;
|
|
@@ -12822,13 +12915,16 @@ class Select {
|
|
|
12822
12915
|
}
|
|
12823
12916
|
}
|
|
12824
12917
|
renderInput() {
|
|
12825
|
-
return (hAsync("br-input", { exportparts: "label", value: this.inputValue, label: this.label, isInline: this.isInline, controlWidth: this.inputWidth, borderless: this.borderless, placeholder: this.placeholder, actionLabel: this.isExpanded ? 'Recolher lista de opções' : 'Exibir lista de opções', readonly:
|
|
12918
|
+
return (hAsync("br-input", { exportparts: "label", value: this.searchTerm || this.inputValue, label: this.label, isInline: this.isInline, controlWidth: this.inputWidth, borderless: this.borderless, placeholder: this.placeholder, actionLabel: this.isExpanded ? 'Recolher lista de opções' : 'Exibir lista de opções', readonly: false, onClick: () => this.toggleOpen(), onInput: (event) => this.handleSearchInput(event), onFocus: () => this.handleSearchFocus(), onBlur: () => this.handleSearchBlur(), onKeyDown: (event) => this.handleKeydownOnInput(event) }, this.showSearchIcon && hAsync("br-icon", { slot: "icon", "icon-name": "fa-solid:search", "aria-hidden": "true" }), hAsync("br-icon", { slot: "action", "icon-name": this.isExpanded ? 'fa-solid:angle-up' : 'fa-solid:angle-down', height: "16", "aria-hidden": "true" })));
|
|
12826
12919
|
}
|
|
12827
12920
|
renderSelectAllCheckbox() {
|
|
12828
12921
|
return (hAsync("div", { class: `br-item highlighted ${this.isAllSelected ? 'selected' : ''}`, "data-all": "data-all", tabindex: "-1", role: "option", "aria-selected": this.isAllSelected, onKeyDown: (event) => this.handleSelectAllKeyDown(event), onClick: () => this.toggleSelectAll() }, hAsync("br-checkbox", { name: `checkbox-${this.customId}`, label: this.isAllSelected ? this.unselectAllLabel : this.selectAllLabel, checked: this.isAllSelected, onCheckedChange: () => this.toggleSelectAll() })));
|
|
12829
12922
|
}
|
|
12830
12923
|
renderOptions() {
|
|
12831
|
-
|
|
12924
|
+
if (this.filteredOptions.length === 0) {
|
|
12925
|
+
return (hAsync("div", { class: "br-item empty", role: "option", "aria-selected": "false", tabindex: -1 }, "Nenhum resultado encontrado"));
|
|
12926
|
+
}
|
|
12927
|
+
return this.filteredOptions.map((option, index) => (hAsync("div", { class: `br-item ${option.selected ? 'selected' : ''}`, key: `${option.label}-${this.customId}`, role: "option", tabindex: this.focusedIndex === index ? 0 : -1, "aria-selected": option.selected, onClick: () => this.handleSelection(index), onKeyDown: (event) => this.handleKeydownOnItem(event, index) }, this.isMultiple ? (hAsync("br-checkbox", { name: `checkbox-${index}-${this.customId}`, label: option.label || option.value, checked: option.selected === true, onCheckedChange: () => this.handleSelection(index) })) : (hAsync("br-radio", { exportparts: "radio-input, radio-label", name: `radio-${index}-${this.customId}`, label: option.label || option.value, checked: option.selected === true, onCheckedChange: () => this.handleSelection(index) })))));
|
|
12832
12928
|
}
|
|
12833
12929
|
/**
|
|
12834
12930
|
* Determina um id para o radio.
|
|
@@ -12845,13 +12941,68 @@ class Select {
|
|
|
12845
12941
|
this.isExpanded = !this.isExpanded;
|
|
12846
12942
|
});
|
|
12847
12943
|
}
|
|
12944
|
+
/**
|
|
12945
|
+
* Limpa todas as opções selecionadas.
|
|
12946
|
+
*/
|
|
12947
|
+
clear() {
|
|
12948
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12949
|
+
const updatedOptions = this.parsedOptions.map((option) => (Object.assign(Object.assign({}, option), { selected: false })));
|
|
12950
|
+
this.parsedOptions = updatedOptions;
|
|
12951
|
+
const newValue = this.isMultiple ? [] : undefined;
|
|
12952
|
+
this.selectedValue = newValue;
|
|
12953
|
+
this.value = newValue;
|
|
12954
|
+
this.updateSelectedOptions();
|
|
12955
|
+
this.updateSelectedAllState();
|
|
12956
|
+
this.valueChange.emit(newValue);
|
|
12957
|
+
try {
|
|
12958
|
+
this.elementInternals.setFormValue(JSON.stringify(newValue !== null && newValue !== void 0 ? newValue : (this.isMultiple ? [] : null)));
|
|
12959
|
+
}
|
|
12960
|
+
catch (_a) {
|
|
12961
|
+
// Ignora erro em testes onde setFormValue não é implementado
|
|
12962
|
+
}
|
|
12963
|
+
});
|
|
12964
|
+
}
|
|
12965
|
+
/**
|
|
12966
|
+
* Retorna o valor selecionado.
|
|
12967
|
+
* @returns {Promise<string | string[]>} O valor atual.
|
|
12968
|
+
*/
|
|
12969
|
+
getValue() {
|
|
12970
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12971
|
+
return this.value;
|
|
12972
|
+
});
|
|
12973
|
+
}
|
|
12974
|
+
/**
|
|
12975
|
+
* Define o valor do componente.
|
|
12976
|
+
* @param {string | string[]} newValue O novo valor a ser definido.
|
|
12977
|
+
*/
|
|
12978
|
+
setValue(newValue) {
|
|
12979
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
12980
|
+
this.value = newValue;
|
|
12981
|
+
// O @Watch('value') cuidará da sincronização
|
|
12982
|
+
});
|
|
12983
|
+
}
|
|
12848
12984
|
getCssClassMap() {
|
|
12849
12985
|
return {
|
|
12850
12986
|
'br-select': true,
|
|
12851
12987
|
};
|
|
12852
12988
|
}
|
|
12989
|
+
handleSearchInput(event) {
|
|
12990
|
+
var _a;
|
|
12991
|
+
const value = (_a = event.target.value) !== null && _a !== void 0 ? _a : '';
|
|
12992
|
+
this.searchTerm = value;
|
|
12993
|
+
this.filteredOptions = this.getFilteredOptions(value);
|
|
12994
|
+
this.isExpanded = true;
|
|
12995
|
+
}
|
|
12996
|
+
handleSearchFocus() {
|
|
12997
|
+
this.filteredOptions = this.getFilteredOptions(this.searchTerm);
|
|
12998
|
+
}
|
|
12999
|
+
handleSearchBlur() {
|
|
13000
|
+
// Ao sair do campo, volta a exibir o resumo das seleções
|
|
13001
|
+
this.searchTerm = '';
|
|
13002
|
+
this.filteredOptions = this.getFilteredOptions('');
|
|
13003
|
+
}
|
|
12853
13004
|
render() {
|
|
12854
|
-
return (hAsync("div", { key: '
|
|
13005
|
+
return (hAsync("div", { key: '0cc55b88b7a17c5e930f76db97f9edb7e4a2948d', class: this.getCssClassMap(), id: this.getComputedId() }, this.renderInput(), this.isExpanded && (hAsync("br-list", { key: '55af5ca9de920524dcf05091e2c9369fd199c67f', tabindex: -1, onKeyDown: (event) => this.handleKeydownOnList(event) }, this.isMultiple && this.renderSelectAllCheckbox(), this.renderOptions()))));
|
|
12855
13006
|
}
|
|
12856
13007
|
static get formAssociated() { return true; }
|
|
12857
13008
|
get el() { return getElement(this); }
|
|
@@ -12876,14 +13027,19 @@ class Select {
|
|
|
12876
13027
|
"inputWidth": [513, "input-width"],
|
|
12877
13028
|
"borderless": [516],
|
|
12878
13029
|
"customId": [513, "custom-id"],
|
|
12879
|
-
"value": [
|
|
13030
|
+
"value": [1025],
|
|
12880
13031
|
"parsedOptions": [32],
|
|
13032
|
+
"filteredOptions": [32],
|
|
12881
13033
|
"inputValue": [32],
|
|
13034
|
+
"searchTerm": [32],
|
|
12882
13035
|
"selectedValue": [32],
|
|
12883
13036
|
"isAllSelected": [32],
|
|
12884
13037
|
"isExpanded": [32],
|
|
12885
13038
|
"focusedIndex": [32],
|
|
12886
|
-
"toggleOpen": [64]
|
|
13039
|
+
"toggleOpen": [64],
|
|
13040
|
+
"clear": [64],
|
|
13041
|
+
"getValue": [64],
|
|
13042
|
+
"setValue": [64]
|
|
12887
13043
|
},
|
|
12888
13044
|
"$listeners$": undefined,
|
|
12889
13045
|
"$lazyBundleId$": "-",
|
|
@@ -136,6 +136,10 @@ export declare class Input {
|
|
|
136
136
|
* Define o padrão de entrada para validação.
|
|
137
137
|
*/
|
|
138
138
|
readonly pattern: string;
|
|
139
|
+
/**
|
|
140
|
+
* Máscara aplicada ao valor digitado (use `#` para marcar posições numéricas).
|
|
141
|
+
*/
|
|
142
|
+
readonly mask?: string;
|
|
139
143
|
/**
|
|
140
144
|
* Define o valor do passo para campos de entrada numéricos.
|
|
141
145
|
*/
|
|
@@ -159,6 +163,8 @@ export declare class Input {
|
|
|
159
163
|
* Valor atualizado do input
|
|
160
164
|
*/
|
|
161
165
|
valueChange: EventEmitter<string>;
|
|
166
|
+
protected handleValueChange(newValue: string): void;
|
|
167
|
+
protected handleMaskChange(): void;
|
|
162
168
|
private readonly handleInput;
|
|
163
169
|
private readonly renderLabel;
|
|
164
170
|
private hasSlotContent;
|
|
@@ -173,5 +179,8 @@ export declare class Input {
|
|
|
173
179
|
private readonly renderInputWithIcon;
|
|
174
180
|
private readonly renderInputWithoutIcon;
|
|
175
181
|
private renderFeedback;
|
|
182
|
+
private applyMaskToValue;
|
|
183
|
+
private applyMask;
|
|
184
|
+
private hasMaskConfigured;
|
|
176
185
|
render(): any;
|
|
177
186
|
}
|
|
@@ -87,7 +87,13 @@ export declare class Select {
|
|
|
87
87
|
value: string;
|
|
88
88
|
selected?: boolean;
|
|
89
89
|
}[];
|
|
90
|
+
filteredOptions: {
|
|
91
|
+
label: string;
|
|
92
|
+
value: string;
|
|
93
|
+
selected?: boolean;
|
|
94
|
+
}[];
|
|
90
95
|
inputValue: string;
|
|
96
|
+
searchTerm: string;
|
|
91
97
|
/** Valor selecionado (string para single, string[] para multiple) */
|
|
92
98
|
value?: string | string[];
|
|
93
99
|
selectedValue?: string | string[];
|
|
@@ -126,6 +132,8 @@ export declare class Select {
|
|
|
126
132
|
private closeSelect;
|
|
127
133
|
private handleSelection;
|
|
128
134
|
private updateSelectedOptions;
|
|
135
|
+
private normalizeText;
|
|
136
|
+
private getFilteredOptions;
|
|
129
137
|
private getStringValue;
|
|
130
138
|
private emitSelectedOptions;
|
|
131
139
|
private updateSelectedAllState;
|
|
@@ -141,6 +149,23 @@ export declare class Select {
|
|
|
141
149
|
* Inverte o valor da prop `isOpen`
|
|
142
150
|
*/
|
|
143
151
|
toggleOpen(): Promise<void>;
|
|
152
|
+
/**
|
|
153
|
+
* Limpa todas as opções selecionadas.
|
|
154
|
+
*/
|
|
155
|
+
clear(): Promise<void>;
|
|
156
|
+
/**
|
|
157
|
+
* Retorna o valor selecionado.
|
|
158
|
+
* @returns {Promise<string | string[]>} O valor atual.
|
|
159
|
+
*/
|
|
160
|
+
getValue(): Promise<string | string[]>;
|
|
161
|
+
/**
|
|
162
|
+
* Define o valor do componente.
|
|
163
|
+
* @param {string | string[]} newValue O novo valor a ser definido.
|
|
164
|
+
*/
|
|
165
|
+
setValue(newValue: string | string[]): Promise<void>;
|
|
144
166
|
private getCssClassMap;
|
|
167
|
+
private handleSearchInput;
|
|
168
|
+
private handleSearchFocus;
|
|
169
|
+
private handleSearchBlur;
|
|
145
170
|
render(): any;
|
|
146
171
|
}
|
|
@@ -748,6 +748,10 @@ export namespace Components {
|
|
|
748
748
|
* Texto exibido como rótulo do input.
|
|
749
749
|
*/
|
|
750
750
|
"label": string;
|
|
751
|
+
/**
|
|
752
|
+
* Máscara aplicada ao valor digitado (use `#` para marcar posições numéricas).
|
|
753
|
+
*/
|
|
754
|
+
"mask"?: string;
|
|
751
755
|
/**
|
|
752
756
|
* Define o valor máximo para campos de entrada numéricos.
|
|
753
757
|
*/
|
|
@@ -1308,11 +1312,20 @@ export namespace Components {
|
|
|
1308
1312
|
* @default false
|
|
1309
1313
|
*/
|
|
1310
1314
|
"borderless": boolean;
|
|
1315
|
+
/**
|
|
1316
|
+
* Limpa todas as opções selecionadas.
|
|
1317
|
+
*/
|
|
1318
|
+
"clear": () => Promise<void>;
|
|
1311
1319
|
/**
|
|
1312
1320
|
* Identificador único. Caso não seja fornecido, um ID gerado automaticamente será usado.
|
|
1313
1321
|
* @default `br-select-${selectId++}`
|
|
1314
1322
|
*/
|
|
1315
1323
|
"customId": string;
|
|
1324
|
+
/**
|
|
1325
|
+
* Retorna o valor selecionado.
|
|
1326
|
+
* @returns O valor atual.
|
|
1327
|
+
*/
|
|
1328
|
+
"getValue": () => Promise<string | string[]>;
|
|
1316
1329
|
/**
|
|
1317
1330
|
* Largura do campo de entrada interno (por exemplo, '88px'). Quando definido, sobrescreve a largura padrão de 100% do input.
|
|
1318
1331
|
*/
|
|
@@ -1342,10 +1355,10 @@ export namespace Components {
|
|
|
1342
1355
|
*/
|
|
1343
1356
|
"options": | string
|
|
1344
1357
|
| {
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1358
|
+
label: string
|
|
1359
|
+
value: string
|
|
1360
|
+
selected?: boolean
|
|
1361
|
+
}[];
|
|
1349
1362
|
/**
|
|
1350
1363
|
* Texto auxiliar exibido antes de uma seleção.
|
|
1351
1364
|
* @default ''
|
|
@@ -1356,6 +1369,11 @@ export namespace Components {
|
|
|
1356
1369
|
* @default 'Selecionar todos'
|
|
1357
1370
|
*/
|
|
1358
1371
|
"selectAllLabel": string;
|
|
1372
|
+
/**
|
|
1373
|
+
* Define o valor do componente.
|
|
1374
|
+
* @param newValue O novo valor a ser definido.
|
|
1375
|
+
*/
|
|
1376
|
+
"setValue": (newValue: string | string[]) => Promise<void>;
|
|
1359
1377
|
/**
|
|
1360
1378
|
* Exibe o ícone de busca no campo de entrada.
|
|
1361
1379
|
* @default false
|
|
@@ -3565,6 +3583,10 @@ declare namespace LocalJSX {
|
|
|
3565
3583
|
* Texto exibido como rótulo do input.
|
|
3566
3584
|
*/
|
|
3567
3585
|
"label"?: string;
|
|
3586
|
+
/**
|
|
3587
|
+
* Máscara aplicada ao valor digitado (use `#` para marcar posições numéricas).
|
|
3588
|
+
*/
|
|
3589
|
+
"mask"?: string;
|
|
3568
3590
|
/**
|
|
3569
3591
|
* Define o valor máximo para campos de entrada numéricos.
|
|
3570
3592
|
*/
|
|
@@ -4171,10 +4193,10 @@ declare namespace LocalJSX {
|
|
|
4171
4193
|
*/
|
|
4172
4194
|
"options"?: | string
|
|
4173
4195
|
| {
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4196
|
+
label: string
|
|
4197
|
+
value: string
|
|
4198
|
+
selected?: boolean
|
|
4199
|
+
}[];
|
|
4178
4200
|
/**
|
|
4179
4201
|
* Texto auxiliar exibido antes de uma seleção.
|
|
4180
4202
|
* @default ''
|