@govbr-ds/webcomponents 2.0.0-next.19 → 2.0.0-next.20
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-button_2.cjs.entry.js +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/br-input.cjs.entry.js +13 -9
- package/dist/cjs/br-input.cjs.entry.js.map +1 -1
- package/dist/cjs/br-tag.cjs.entry.js +88 -0
- package/dist/cjs/br-tag.cjs.entry.js.map +1 -0
- package/dist/cjs/br-textarea.cjs.entry.js +1 -1
- package/dist/cjs/br-upload.cjs.entry.js +1 -1
- package/dist/cjs/index-81c11ce2.js +4 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/icon/icon.css +1 -1
- package/dist/collection/components/input/input.js +152 -10
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/tag/tag.css +643 -0
- package/dist/collection/components/tag/tag.js +256 -0
- package/dist/collection/components/tag/tag.js.map +1 -0
- package/dist/collection/components/textarea/textarea.js +1 -1
- package/dist/collection/components/upload/upload.js +1 -1
- package/dist/collection/pages/components/input/index.js +9 -0
- package/dist/collection/pages/components/tag/index.js +18 -0
- package/dist/collection/pages/scripts/menu.js +22 -22
- package/dist/collection/scripts/menu.js +146 -0
- package/dist/components/br-avatar.js +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +1 -1
- package/dist/components/br-input.js.map +1 -1
- package/dist/components/br-message.js +1 -1
- package/dist/components/br-tag.d.ts +11 -0
- package/dist/components/br-tag.js +6 -0
- package/dist/components/br-tag.js.map +1 -0
- package/dist/components/br-textarea.js +1 -1
- package/dist/components/br-upload.js +1 -1
- package/dist/components/{p-a23c3f6b.js → p-64831033.js} +2 -2
- package/dist/components/{p-a23c3f6b.js.map → p-64831033.js.map} +1 -1
- package/dist/esm/br-button_2.entry.js +1 -1
- package/dist/esm/br-button_2.entry.js.map +1 -1
- package/dist/esm/br-input.entry.js +13 -9
- package/dist/esm/br-input.entry.js.map +1 -1
- package/dist/esm/br-tag.entry.js +84 -0
- package/dist/esm/br-tag.entry.js.map +1 -0
- package/dist/esm/br-textarea.entry.js +1 -1
- package/dist/esm/br-upload.entry.js +1 -1
- package/dist/esm/index-aab4a630.js +4 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/webcomponents.js +1 -1
- package/dist/esm-es5/br-button_2.entry.js +1 -1
- package/dist/esm-es5/br-button_2.entry.js.map +1 -1
- package/dist/esm-es5/br-input.entry.js +1 -1
- package/dist/esm-es5/br-input.entry.js.map +1 -1
- package/dist/esm-es5/br-tag.entry.js +6 -0
- package/dist/esm-es5/br-tag.entry.js.map +1 -0
- package/dist/esm-es5/br-textarea.entry.js +2 -2
- package/dist/esm-es5/br-upload.entry.js +1 -1
- package/dist/esm-es5/index-aab4a630.js +1 -1
- package/dist/esm-es5/index-aab4a630.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/webcomponents.js +1 -1
- package/dist/esm-es5/webcomponents.js.map +1 -1
- package/dist/types/components/input/input.d.ts +32 -0
- package/dist/types/components/tag/tag.d.ts +73 -0
- package/dist/types/components.d.ts +172 -0
- package/dist/webcomponents/{p-2cc63872.system.entry.js → p-28476b17.system.entry.js} +2 -2
- package/dist/webcomponents/p-447c8036.entry.js +6 -0
- package/dist/webcomponents/p-447c8036.entry.js.map +1 -0
- package/dist/webcomponents/p-55604b7f.system.entry.js +6 -0
- package/dist/webcomponents/p-55604b7f.system.entry.js.map +1 -0
- package/dist/webcomponents/{p-fd6c166e.entry.js → p-61523bc9.entry.js} +2 -2
- package/dist/webcomponents/{p-28aa7e4d.system.entry.js → p-8f156fc4.system.entry.js} +2 -2
- package/dist/webcomponents/p-8f156fc4.system.entry.js.map +1 -0
- package/dist/webcomponents/{p-3c4dea67.entry.js → p-9f0d01d1.entry.js} +2 -2
- package/dist/webcomponents/p-9f0d01d1.entry.js.map +1 -0
- package/dist/webcomponents/p-b88a5d9a.system.js +2 -2
- package/dist/webcomponents/p-b88a5d9a.system.js.map +1 -1
- package/dist/webcomponents/{p-34cec0b3.system.entry.js → p-baad00f8.system.entry.js} +2 -2
- package/dist/webcomponents/{p-155191ea.entry.js → p-d174c8cd.entry.js} +2 -2
- package/dist/webcomponents/{p-2cef0b07.system.entry.js → p-d83e2172.system.entry.js} +2 -2
- package/dist/webcomponents/{p-2cef0b07.system.entry.js.map → p-d83e2172.system.entry.js.map} +1 -1
- package/dist/webcomponents/{p-66b81760.entry.js → p-e6d921ef.entry.js} +2 -2
- package/dist/webcomponents/{p-66b81760.entry.js.map → p-e6d921ef.entry.js.map} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/hydrate/index.js +123 -13
- package/hydrate/index.mjs +123 -13
- package/package.json +2 -2
- package/vscode-data.json +103 -0
- package/dist/webcomponents/p-28aa7e4d.system.entry.js.map +0 -1
- package/dist/webcomponents/p-3c4dea67.entry.js.map +0 -1
- /package/dist/webcomponents/{p-2cc63872.system.entry.js.map → p-28476b17.system.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-fd6c166e.entry.js.map → p-61523bc9.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-34cec0b3.system.entry.js.map → p-baad00f8.system.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-155191ea.entry.js.map → p-d174c8cd.entry.js.map} +0 -0
|
@@ -41,7 +41,7 @@ const Input = class {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
this.renderInput = () => {
|
|
44
|
-
return (index.h("input", Object.assign({ class: this.isHighlight ? 'input-highlight' : null, id: this.customId, autocomplete: this.autocomplete, disabled: this.disabled, onInput: this.handleInput, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)));
|
|
44
|
+
return (index.h("input", Object.assign({ class: this.isHighlight ? 'input-highlight' : null, id: this.customId, autocomplete: this.autocomplete, disabled: this.disabled, autoCorrect: this.autocorrect, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, step: this.step, onInput: this.handleInput, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)));
|
|
45
45
|
};
|
|
46
46
|
this.renderHelpText = () => {
|
|
47
47
|
var _a;
|
|
@@ -58,10 +58,10 @@ const Input = class {
|
|
|
58
58
|
};
|
|
59
59
|
this.renderInlineInputContent = () => {
|
|
60
60
|
if (this.hasIconSlot) {
|
|
61
|
-
return
|
|
61
|
+
return index.h("div", { class: "input-content" }, this.renderInputWithIcon());
|
|
62
62
|
}
|
|
63
63
|
else {
|
|
64
|
-
return
|
|
64
|
+
return index.h("div", { class: "input-content" }, this.renderInputWithoutIcon());
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
this.renderInputContent = () => {
|
|
@@ -71,11 +71,7 @@ const Input = class {
|
|
|
71
71
|
return (index.h("div", { class: "input-group" }, this.renderIconSlot(), this.renderInput(), this.renderButton(), this.renderHelpText()));
|
|
72
72
|
};
|
|
73
73
|
this.renderInputWithoutIcon = () => {
|
|
74
|
-
return [
|
|
75
|
-
this.renderInput(),
|
|
76
|
-
this.renderButton(),
|
|
77
|
-
this.renderHelpText()
|
|
78
|
-
];
|
|
74
|
+
return [this.renderInput(), this.renderButton(), this.renderHelpText()];
|
|
79
75
|
};
|
|
80
76
|
this.customId = `br-input-${v4.v4()}`;
|
|
81
77
|
this.type = 'text';
|
|
@@ -92,6 +88,14 @@ const Input = class {
|
|
|
92
88
|
this.required = false;
|
|
93
89
|
this.value = undefined;
|
|
94
90
|
this.helpText = undefined;
|
|
91
|
+
this.autocorrect = 'off';
|
|
92
|
+
this.min = undefined;
|
|
93
|
+
this.max = undefined;
|
|
94
|
+
this.minlength = undefined;
|
|
95
|
+
this.maxlength = undefined;
|
|
96
|
+
this.multiple = false;
|
|
97
|
+
this.pattern = undefined;
|
|
98
|
+
this.step = undefined;
|
|
95
99
|
this.isPasswordVisible = false;
|
|
96
100
|
this.hasIconSlot = false;
|
|
97
101
|
this.hasActionSlot = false;
|
|
@@ -134,7 +138,7 @@ const Input = class {
|
|
|
134
138
|
return null;
|
|
135
139
|
}
|
|
136
140
|
render() {
|
|
137
|
-
return (index.h(index.Host, { key: '
|
|
141
|
+
return (index.h(index.Host, { key: 'd5e8fec1c09589e9c9e9aa206b3c1669ef1f04f8' }, index.h("div", { key: '431430f8d91e3086b114d4bc7fa3b43e9b5b9eab', class: this.getInputCssClassMap() }, this.renderLabel(), this.isInline ? this.renderInlineInputContent() : this.renderInputContent())));
|
|
138
142
|
}
|
|
139
143
|
static get formAssociated() { return true; }
|
|
140
144
|
get el() { return index.getElement(this); }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"br-input.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,23fAA23f,CAAC;AAC74f,sBAAe,QAAQ;;MCkBV,KAAK;;;;;;;;;;;QA6IR,wBAAmB,GAAe,EAAE,CAAA;QAM3B,gBAAW,GAAG,CAAC,KAAY;YAC1C,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAA;YACrD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAClC,CAAA;QAEgB,gBAAW,GAAG;;YAC7B,IAAI,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,IAAG,CAAC,EAAE;gBAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,QACEA,iBAAK,KAAK,EAAC,aAAa,IACtBA,mBAAO,KAAK,EAAC,aAAa,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,I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AGnCA,kBAAM,IAAI,EAAC,QAAQ,GAAQ,CACjB,EACb;SACF;QACD,OAAO,IAAI,CAAA;KACZ;IAyCD,MAAM;QACJ,QACEA,QAACG,UAAI,uDACHH,kEAAK,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,IACnC,IAAI,CAAC,WAAW,EAAE,EAElB,IAAI,CAAC,QAAQ,IACZ,IAAI,CAAC,wBAAwB,EAAE,KAE/B,IAAI,CAAC,kBAAkB,EAAE,CAC5B,CACK,CACD,EACR;KACF;;;;;;;;","names":["h","uuidv4","inheritAriaAttributes","Host"],"sources":["src/components/input/input.scss?tag=br-input&encapsulation=shadow","src/components/input/input.tsx"],"sourcesContent":["@import \"../../../../../node_modules/@govbr-ds/core/src/components/input/input.scss\";\n\n:host {\n display: block;\n\n .br-input .input-icon {\n margin-top: 0.1em;\n margin-left: var(--spacing-scale-base);\n }\n\n .br-input .input-icon + input {\n padding-left: calc(var(--input-padding-icon) + 3px);\n }\n}\n\n\n.br-input br-button {\n float: right;\n margin-right: var(--input-button-margin);\n margin-top: calc((var(--input-size) + var(--spacing-scale-half)) * -1);\n padding: 0;\n position: relative;\n}\n\n .button-transform{\n transform: translateY(calc((var(--input-size) - 32px) * 0.5));\n }\n","import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core'\nimport { v4 as uuidv4 } from 'uuid'\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n *\n * Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/input?tab=designer).\n *\n * @slot action - Botão à direita do input.\n * @slot icon - Ícone à esquerda do input.\n * @slot help-text - Personalização do texto de ajuda.\n */\n@Component({\n tag: 'br-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input {\n /**\n * Referência ao elemento host do componente.\n * Utilize esta propriedade para acessar e manipular o elemento do DOM associado ao componente.\n */\n @Element() el: HTMLBrInputElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único do input.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true, attribute: 'id' }) customId: string = `br-input-${uuidv4()}`\n\n /**\n * Especifica o tipo de entrada do campo. Pode ser um dos seguintes:\n * - 'color': Seletor de cor\n * - 'email': Campo para e-mail\n * - 'hidden': Campo oculto\n * - 'password': Campo para senha\n * - 'range': Controle deslizante\n * - 'search': Campo de pesquisa\n * - 'number': Campo para números\n * - 'tel': Campo para números de telefone\n * - 'text': Campo de texto padrão\n * - 'url': Campo para URLs\n */\n @Prop({ reflect: true }) type:\n | 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'file'\n | 'url' = 'text'\n\n /**\n * Controla o comportamento de preenchimento automático do navegador para o input.\n */\n @Prop({ reflect: true }) autocomplete: 'on' | 'off'\n\n /**\n * Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.\n */\n @Prop({ reflect: true }) density: 'large' | 'medium' | 'small' = 'medium'\n\n /**\n * Desativa o input, tornando-o não interativo.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) isInline: boolean = false\n\n /**\n * Se verdadeiro, o input terá destaque visual.\n */\n @Prop({ reflect: true }) isHighlight: boolean = false\n\n /**\n * Define o estado do input\n * Os possíveis valores são:\n * - 'info': Mensagem informativa.\n * - 'warning': Mensagem de aviso.\n * - 'danger': Mensagem de erro ou alerta.\n * - 'success': Mensagem de sucesso.\n * O valor padrão é 'info'.\n */\n @Prop({ reflect: true }) state: 'info' | 'warning' | 'danger' | 'success'\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) label: string\n\n /**\n * Nome do input, utilizado para identificação em formulários.\n */\n @Prop({ reflect: true }) name: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) placeholder: string\n\n /**\n * Se verdadeiro, o valor do input é exibido, mas não pode ser editado pelo usuário.\n */\n @Prop({ reflect: true }) readonly: boolean = false\n\n /**\n * Se verdadeiro, o input é obrigatório e deve ser preenchido antes que o formulário possa ser enviado.\n */\n @Prop({ reflect: true }) required: boolean = false\n\n /**\n * Valor inicial exibido no input.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ reflect: true, mutable: true }) value: string\n\n /**\n * Texto adicional que fornece ajuda ou informações sobre o input.\n */\n @Prop({ reflect: true }) helpText: string\n\n @State() isPasswordVisible: boolean = false\n\n @State() hasIconSlot: boolean = false\n\n @State() hasActionSlot: boolean = false\n\n componentWillLoad() {\n this.hasIconSlot = this.hasSlotContent('icon')\n this.hasActionSlot = this.hasSlotContent('action')\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.hasActionSlot,\n small: this.density === 'small',\n large: this.density === 'large',\n medium: this.density === 'medium',\n 'input-inline': this.isInline,\n 'input-highlight': this.isHighlight,\n success: this.state === 'success',\n danger: this.state === 'danger',\n info: this.state === 'info',\n warning: this.state === 'warning',\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /**\n * Valor atualizado do input\n */\n @Event() valueChange!: EventEmitter<string>\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n private readonly renderLabel = () => {\n if (this.label?.length > 0) {\n if (this.isInline) {\n return (\n <div class=\"input-label\">\n <label class=\"text-nowrap\" htmlFor={this.customId}>\n {this.label}\n </label>\n </div>\n )\n } else {\n return <label htmlFor={this.customId}>{this.label}</label>\n }\n }\n }\n\n private hasSlotContent(slotName: string): boolean {\n return this.el.querySelector(`[slot=\"${slotName}\"]`) !== null\n }\n\n private readonly renderInput = () => {\n return (\n <input\n class={this.isHighlight ? 'input-highlight' : null}\n id={this.customId}\n autocomplete={this.autocomplete}\n disabled={this.disabled}\n onInput={this.handleInput}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n title={this.el.title}\n type={this.type}\n value={this.value}\n {...this.inheritedAttributes}\n />\n )\n }\n\n private readonly renderHelpText = () => {\n return this.helpText?.length > 0 ? <p>{this.helpText}</p> : <slot name=\"help-text\"></slot>\n }\n\n private readonly renderIconPassword = () => {\n const iconName = this.isPasswordVisible ? 'fa-solid:eye-slash' : 'fa-solid:eye';\n return <br-icon icon-name={iconName}></br-icon>;\n }\n\n private readonly togglePasswordVisibility = () => {\n const input = this.el.shadowRoot.querySelector('input')\n this.isPasswordVisible = !this.isPasswordVisible\n input.type = this.isPasswordVisible ? 'text' : 'password'\n }\n\n private renderIconSlot() {\n if (this.hasSlotContent('icon')) {\n return (\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n )\n }\n }\n\n private renderButton() {\n if (this.type === 'password') {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n onClick={this.togglePasswordVisibility}\n >\n {this.renderIconPassword()}\n </br-button>\n )\n } else if (this.hasSlotContent('action')) {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n // onClick={this.onIconAction}\n >\n <slot name=\"action\"></slot>\n </br-button>\n )\n }\n return null\n }\n\n private readonly renderInlineInputContent = () => {\n if (this.hasIconSlot) {\n return (\n <div class=\"input-content\">\n {this.renderInputWithIcon()}\n </div>\n );\n } else {\n return (\n <div class=\"input-content\">\n {this.renderInputWithoutIcon()}\n </div>\n );\n }\n };\n\n private readonly renderInputContent = () => {\n return this.hasIconSlot ? this.renderInputWithIcon() : this.renderInputWithoutIcon()\n }\n\n private readonly renderInputWithIcon = () => {\n return (\n <div class=\"input-group\">\n {this.renderIconSlot()}\n {this.renderInput()}\n {this.renderButton()}\n {this.renderHelpText()}\n </div>\n );\n };\n\n private readonly renderInputWithoutIcon = () => {\n return [\n this.renderInput(),\n this.renderButton(),\n this.renderHelpText()\n ]\n };\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n {this.renderLabel()}\n\n {this.isInline ? (\n this.renderInlineInputContent()\n ) : (\n this.renderInputContent()\n )}\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
|
|
1
|
+
{"file":"br-input.entry.cjs.js","mappings":";;;;;;;;;;;;AAAA,MAAM,QAAQ,GAAG,23fAA23f,CAAC;AAC74f,sBAAe,QAAQ;;MCmBV,KAAK;;;;;;;;;;;QAqLR,wBAAmB,GAAe,EAAE,CAAA;QAM3B,gBAAW,GAAG,CAAC,KAAY;YAC1C,IAAI,CAAC,KAAK,GAAI,KAAK,CAAC,MAA2B,CAAC,KAAK,CAAA;YACrD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;SAClC,CAAA;QAEgB,gBAAW,GAAG;;YAC7B,IAAI,CAAA,MAAA,IAAI,CAAC,KAAK,0CAAE,MAAM,IAAG,CAAC,EAAE;gBAC1B,IAAI,IAAI,CAAC,QAAQ,EAAE;oBACjB,QACEA,iBAAK,KAAK,EAAC,aAAa,IACtBA,mBAAO,KAAK,EAAC,aAAa,EAAC,OAAO,EAAE,IAAI,CAAC,QAAQ,IAC9C,IAAI,CAAC,KAAK,CACL,CACJ,EACP;iBACF;qBAAM;oBACL,OAAOA,mBAAO,OAAO,EAAE,IAAI,CAAC,QAAQ,IAAG,IAAI,CAAC,KAAK,CAAS,CAAA;iBAC3D;aACF;SACF,CAAA;QAMgB,gBAAW,GAAG;YAC7B,QACEA,iCACE,KAAK,EAAE,IAAI,CAAC,WAAW,GAAG,iBAAiB,GAAG,IAAI,EAClD,EAAE,EAAE,IAAI,CAAC,QAAQ,EACjB,YAAY,EAAE,IAAI,CAAC,YAAY,EAC/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AAC,OAAO,gBACJ,4CAAwB,IAGnCA,kBAAM,IAAI,EAAC,QAAQ,GAAQ,CACjB,EACb;SACF;QACD,OAAO,IAAI,CAAA;KACZ;IA6BD,MAAM;QACJ,QACEA,QAACG,UAAI,uDACHH,kEAAK,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,IACnC,IAAI,CAAC,WAAW,EAAE,EAElB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,wBAAwB,EAAE,GAAG,IAAI,CAAC,kBAAkB,EAAE,CACxE,CACD,EACR;KACF;;;;;;;;","names":["h","uuidv4","inheritAriaAttributes","Host"],"sources":["src/components/input/input.scss?tag=br-input&encapsulation=shadow","src/components/input/input.tsx"],"sourcesContent":["@import \"../../../../../node_modules/@govbr-ds/core/src/components/input/input.scss\";\n\n:host {\n display: block;\n\n .br-input .input-icon {\n margin-top: 0.1em;\n margin-left: var(--spacing-scale-base);\n }\n\n .br-input .input-icon + input {\n padding-left: calc(var(--input-padding-icon) + 3px);\n }\n}\n\n\n.br-input br-button {\n float: right;\n margin-right: var(--input-button-margin);\n margin-top: calc((var(--input-size) + var(--spacing-scale-half)) * -1);\n padding: 0;\n position: relative;\n}\n\n .button-transform{\n transform: translateY(calc((var(--input-size) - 32px) * 0.5));\n }\n","import { AttachInternals, Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n *\n * Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/input?tab=designer).\n *\n * @slot action - Botão à direita do input.\n * @slot icon - Ícone à esquerda do input.\n * @slot help-text - Personalização do texto de ajuda.\n */\n@Component({\n tag: 'br-input',\n styleUrl: 'input.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Input {\n /**\n * Referência ao elemento host do componente.\n * Utilize esta propriedade para acessar e manipular o elemento do DOM associado ao componente.\n */\n @Element() el: HTMLBrInputElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único do input.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true, attribute: 'id' }) customId: string = `br-input-${uuidv4()}`\n\n /**\n * Especifica o tipo de entrada do campo. Pode ser um dos seguintes:\n * - 'color': Seletor de cor\n * - 'email': Campo para e-mail\n * - 'hidden': Campo oculto\n * - 'password': Campo para senha\n * - 'range': Controle deslizante\n * - 'search': Campo de pesquisa\n * - 'number': Campo para números\n * - 'tel': Campo para números de telefone\n * - 'text': Campo de texto padrão\n * - 'url': Campo para URLs\n */\n @Prop({ reflect: true }) type:\n | 'color'\n | 'email'\n | 'hidden'\n | 'password'\n | 'range'\n | 'search'\n | 'number'\n | 'tel'\n | 'text'\n | 'file'\n | 'url' = 'text'\n\n /**\n * Controla o comportamento de preenchimento automático do navegador para o input.\n */\n @Prop({ reflect: true }) autocomplete: 'on' | 'off'\n\n /**\n * Ajusta a densidade, alterando o espaçamento interno para um visual mais compacto ou mais expandido.\n */\n @Prop({ reflect: true }) density: 'large' | 'medium' | 'small' = 'medium'\n\n /**\n * Desativa o input, tornando-o não interativo.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /**\n * Se verdadeiro, o rótulo e o input estarão na mesma linha (layout inline).\n */\n @Prop({ reflect: true }) isInline: boolean = false\n\n /**\n * Se verdadeiro, o input terá destaque visual.\n */\n @Prop({ reflect: true }) isHighlight: boolean = false\n\n /**\n * Define o estado do input\n * Os possíveis valores são:\n * - 'info': Mensagem informativa.\n * - 'warning': Mensagem de aviso.\n * - 'danger': Mensagem de erro ou alerta.\n * - 'success': Mensagem de sucesso.\n * O valor padrão é 'info'.\n */\n @Prop({ reflect: true }) state: 'info' | 'warning' | 'danger' | 'success'\n\n /**\n * Texto exibido como rótulo do input.\n */\n @Prop({ reflect: true }) label: string\n\n /**\n * Nome do input, utilizado para identificação em formulários.\n */\n @Prop({ reflect: true }) name: string\n\n /**\n * Texto exibido dentro do input quando está vazio, fornecendo uma dica ou sugestão ao usuário.\n */\n @Prop({ reflect: true }) placeholder: string\n\n /**\n * Se verdadeiro, o valor do input é exibido, mas não pode ser editado pelo usuário.\n */\n @Prop({ reflect: true }) readonly: boolean = false\n\n /**\n * Se verdadeiro, o input é obrigatório e deve ser preenchido antes que o formulário possa ser enviado.\n */\n @Prop({ reflect: true }) required: boolean = false\n\n /**\n * Valor inicial exibido no input.\n * Pode ser alterado pelo usuário se a propriedade `readonly` não estiver ativa.\n */\n @Prop({ reflect: true, mutable: true }) value: string\n\n /**\n * Texto adicional que fornece ajuda ou informações sobre o input.\n */\n @Prop({ reflect: true }) helpText: string\n\n /**\n * Controla a correção automática do texto.\n */\n @Prop({ reflect: true }) autocorrect: 'off' | 'on' = 'off'\n\n /**\n * Define o valor mínimo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) min: number\n\n /**\n * Define o valor máximo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) max: number\n\n /**\n * Define o comprimento mínimo do valor do campo de entrada.\n */\n @Prop({ reflect: true }) minlength: number\n\n /**\n * Define o comprimento máximo do valor do campo de entrada.\n */\n @Prop({ reflect: true }) maxlength: number\n\n /**\n * Se verdadeiro, permite a seleção de múltiplos arquivos.\n */\n @Prop({ reflect: true }) multiple: boolean = false\n\n /**\n * Define o padrão de entrada para validação.\n */\n @Prop({ reflect: true }) pattern: string\n\n /**\n * Define o valor do passo para campos de entrada numéricos.\n */\n @Prop({ reflect: true }) step: number\n\n @State() isPasswordVisible: boolean = false\n\n @State() hasIconSlot: boolean = false\n\n @State() hasActionSlot: boolean = false\n\n componentWillLoad() {\n this.hasIconSlot = this.hasSlotContent('icon')\n this.hasActionSlot = this.hasSlotContent('action')\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.hasActionSlot,\n small: this.density === 'small',\n large: this.density === 'large',\n medium: this.density === 'medium',\n 'input-inline': this.isInline,\n 'input-highlight': this.isHighlight,\n success: this.state === 'success',\n danger: this.state === 'danger',\n info: this.state === 'info',\n warning: this.state === 'warning',\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /**\n * Valor atualizado do input\n */\n @Event() valueChange!: EventEmitter<string>\n private readonly handleInput = (event: Event) => {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n private readonly renderLabel = () => {\n if (this.label?.length > 0) {\n if (this.isInline) {\n return (\n <div class=\"input-label\">\n <label class=\"text-nowrap\" htmlFor={this.customId}>\n {this.label}\n </label>\n </div>\n )\n } else {\n return <label htmlFor={this.customId}>{this.label}</label>\n }\n }\n }\n\n private hasSlotContent(slotName: string): boolean {\n return this.el.querySelector(`[slot=\"${slotName}\"]`) !== null\n }\n\n private readonly renderInput = () => {\n return (\n <input\n class={this.isHighlight ? 'input-highlight' : null}\n id={this.customId}\n autocomplete={this.autocomplete}\n disabled={this.disabled}\n autoCorrect={this.autocorrect}\n min={this.min}\n max={this.max}\n minLength={this.minlength}\n maxLength={this.maxlength}\n multiple={this.multiple}\n name={this.name}\n pattern={this.pattern}\n step={this.step}\n onInput={this.handleInput}\n placeholder={this.placeholder}\n readonly={this.readonly}\n required={this.required}\n title={this.el.title}\n type={this.type}\n value={this.value}\n {...this.inheritedAttributes}\n />\n )\n }\n\n private readonly renderHelpText = () => {\n return this.helpText?.length > 0 ? <p>{this.helpText}</p> : <slot name=\"help-text\"></slot>\n }\n\n private readonly renderIconPassword = () => {\n const iconName = this.isPasswordVisible ? 'fa-solid:eye-slash' : 'fa-solid:eye'\n return <br-icon icon-name={iconName}></br-icon>\n }\n\n private readonly togglePasswordVisibility = () => {\n const input = this.el.shadowRoot.querySelector('input')\n this.isPasswordVisible = !this.isPasswordVisible\n input.type = this.isPasswordVisible ? 'text' : 'password'\n }\n\n private renderIconSlot() {\n if (this.hasSlotContent('icon')) {\n return (\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n )\n }\n }\n\n private renderButton() {\n if (this.type === 'password') {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n onClick={this.togglePasswordVisibility}\n >\n {this.renderIconPassword()}\n </br-button>\n )\n } else if (this.hasSlotContent('action')) {\n return (\n <br-button\n class=\"button-transform\"\n shape=\"circle\"\n density=\"small\"\n aria-label=\"botão de ação do ícone\"\n // onClick={this.onIconAction}\n >\n <slot name=\"action\"></slot>\n </br-button>\n )\n }\n return null\n }\n\n private readonly renderInlineInputContent = () => {\n if (this.hasIconSlot) {\n return <div class=\"input-content\">{this.renderInputWithIcon()}</div>\n } else {\n return <div class=\"input-content\">{this.renderInputWithoutIcon()}</div>\n }\n }\n\n private readonly renderInputContent = () => {\n return this.hasIconSlot ? this.renderInputWithIcon() : this.renderInputWithoutIcon()\n }\n\n private readonly renderInputWithIcon = () => {\n return (\n <div class=\"input-group\">\n {this.renderIconSlot()}\n {this.renderInput()}\n {this.renderButton()}\n {this.renderHelpText()}\n </div>\n )\n }\n\n private readonly renderInputWithoutIcon = () => {\n return [this.renderInput(), this.renderButton(), this.renderHelpText()]\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n {this.renderLabel()}\n\n {this.isInline ? this.renderInlineInputContent() : this.renderInputContent()}\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Construído com @govbr-ds/webcomponents
|
|
3
|
+
* Padrão Digital de Governo.
|
|
4
|
+
*/
|
|
5
|
+
'use strict';
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
8
|
+
|
|
9
|
+
const index = require('./index-81c11ce2.js');
|
|
10
|
+
const inheritedAttributes = require('./inherited-attributes-16f7d388.js');
|
|
11
|
+
|
|
12
|
+
const tagCss = "*,*::before,*::after{-webkit-box-sizing:border-box;box-sizing:border-box}html{line-height:var(--font-line-height-medium);-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;-ms-text-size-adjust:100%;text-size-adjust:100%}body{margin:0}a{background-color:transparent}strong{font-weight:bolder}small{font-size:80%}img{border-style:none}button,input,textarea{font-family:inherit;font-size:100%;line-height:var(--font-line-height-medium);margin:0}button,input{overflow:visible}button{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;-moz-appearance:button;appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none;appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;appearance:button;font:inherit}[hidden]{display:none}.d-flex{display:-ms-flexbox !important;display:flex !important}.align-items-center{-ms-flex-align:center !important;align-items:center !important}.col,[class*=col-]{padding-left:calc(var(--grid-gutter) * 0.5);padding-right:calc(var(--grid-gutter) * 0.5);width:100%}.col{-ms-flex:1 0 0%;flex:1 0 0%;min-width:8.3333333333%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto}.container{--grid-margin:var(--grid-portrait-margin);--grid-maxwidth:var(--grid-portrait-maxwidth);margin-left:auto;margin-right:auto;max-width:var(--grid-maxwidth);padding-left:var(--grid-margin);padding-right:var(--grid-margin);width:100%}.row{--grid-gutter:var(--grid-portrait-gutter);display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-left:calc(var(--grid-gutter) * -0.5);margin-right:calc(var(--grid-gutter) * -0.5)}@media (min-width: 576px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-sm) - var(--grid-tablet-margin))}}@media (min-width: 992px){.container{--grid-margin:var(--grid-tablet-margin)}.row{--grid-gutter:var(--grid-tablet-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-md) - var(--grid-tablet-margin))}}@media (min-width: 1280px){.container{--grid-margin:var(--grid-desktop-margin)}.row{--grid-gutter:var(--grid-desktop-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-lg) - var(--grid-desktop-margin))}}@media (min-width: 1600px){.container{--grid-margin:var(--grid-tv-margin)}.row{--grid-gutter:var(--grid-tv-gutter)}.container{--grid-maxwidth:calc(var(--grid-breakpoint-xl) - var(--grid-tv-margin))}}.mt-1{margin-top:var(--spacing-scale-half) !important}.mr-1{margin-right:var(--spacing-scale-half) !important}.mr-2{margin-right:var(--spacing-scale-base) !important}.mr-n2{margin-right:calc(var(--spacing-scale-base) * -1) !important}.mb-3{margin-bottom:var(--spacing-scale-2x) !important}.mr-auto{margin-right:auto !important}.pt-half{padding-top:var(--spacing-scale-half) !important}.py-3{padding-bottom:var(--spacing-scale-2x) !important;padding-top:var(--spacing-scale-2x) !important}.py-4{padding-bottom:var(--spacing-scale-3x) !important;padding-top:var(--spacing-scale-3x) !important}body{--bg-color:var(--background);--bg-color-rgb:var(--background-rgb);--bg-color-hsl:var(--background-hsl);--font-size:var(--font-size-scale-base);--font-weight:var(--font-weight-regular);--link-color:var(--interactive);--link-color-rgb:var(--interactive-rgb);--link-color-hsl:var(--interactive-hsl);--line-height:var(--font-line-height-medium);--text-color:var(--color);--text-color-rgb:var(--color-rgb);--text-color-hsl:var(--color-hsl);background:var(--bg-color);color:var(--text-color);font-family:var(--font-family-base);font-size:var(--font-size);font-weight:var(--font-weight);line-height:var(--line-height)}p{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-2x);margin-top:0}p a{text-decoration:underline}@media (min-width: 576px){p{font-size:var(--font-size-scale-up-01)}}a{--focus-offset:var(--spacing-scale-half);color:var(--interactive);text-decoration:none}a:focus{outline:none}a:focus-visible{outline-color:var(--focus);outline-offset:var(--focus-offset);outline-style:var(--focus-style);outline-width:var(--focus-width)}a:not(:disabled):hover{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}a:not(:disabled):active{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}button{cursor:pointer}img{max-width:100%;vertical-align:middle}ul{margin-bottom:var(--spacing-scale-2x);margin-top:0;padding:0 0 0 var(--spacing-scale-5x)}label,.label{color:var(--color);font-size:var(--font-size-scale-base);font-weight:var(--font-weight-semi-bold);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half)}::-moz-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-webkit-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}:-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::-ms-input-placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}::placeholder,.placeholder{color:var(--color-light);font-size:var(--font-size-scale-base);font-style:italic;font-weight:var(--font-weight-regular);line-height:var(--font-line-height-medium);margin-bottom:var(--spacing-scale-half);margin-top:var(--spacing-scale-half);opacity:1}input,textarea,.input{color:var(--color-light);font-size:var(--font-size-scale-up-01);font-weight:var(--font-weight-medium);line-height:var(--font-line-height-low);margin-bottom:var(--spacing-scale-half)}.text-pure-0{color:var(--pure-0) !important}.text-primary-default{color:var(--color-primary-default) !important}.bg-support-01{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark);background:var(--color-support-01) !important}.text-nowrap{white-space:nowrap !important}.text-base{font-size:var(--font-size-scale-base) !important}.highlight{background:var(--status-highlight-background) -webkit-gradient(linear, left top, left bottom, from(var(--status-highlight-overlay)), to(var(--status-highlight-overlay)));background:var(--status-highlight-background) linear-gradient(var(--status-highlight-overlay), var(--status-highlight-overlay));color:var(--status-highlight-text);padding:0 var(--spacing-scale-half)}[disabled],.disabled{cursor:not-allowed;opacity:var(--disabled)}[disabled] *,.disabled *{pointer-events:none}[data-toggle=dropdown]+*{position:absolute}.dropdown{position:relative}.dropdown [data-toggle=dropdown]+*{-webkit-box-shadow:var(--surface-shadow-sm);box-shadow:var(--surface-shadow-sm);left:0;position:absolute;top:100%}.dropdown .br-item{--color:var(--color-light);--color-rgb:var(--color-light-rgb);--text-color:var(--color-light);--interactive:var(--interactive-light);--interactive-rgb:var(--color-rgb);--visited:var(--visited-light);--hover:var(--hover-light);--pressed:var(--pressed-light);--focus-color:var(--focus-color-light);--focus:var(--focus-color-light);--item-padding-y:var(--spacing-scale-2x);background-color:var(--background-light);color:var(--color)}.dropdown .br-item:not(:last-child){border-bottom:1px solid var(--border-color)}.dropdown .br-item.selected{--color:var(--color-dark);--color-rgb:var(--color-dark-rgb);--text-color:var(--color-dark);--interactive:var(--interactive-dark);--interactive-rgb:var(--interactive-dark-rgb);--visited:var(--visited-dark);--hover:var(--hover-dark);--pressed:var(--pressed-dark);--focus-color:var(--focus-color-dark);--focus:var(--focus-color-dark)}.br-tag{--tag-size:var(--tag-medium);--tag-small:var(--spacing-scale-2xh);--tag-medium:var(--spacing-scale-3xh);--tag-large:var(--spacing-scale-4xh);-ms-flex-align:center;align-items:center;background:var(--background-dark);border-radius:var(--surface-rounder-sm);color:var(--color-dark);display:-ms-inline-flexbox;display:inline-flex;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);-ms-flex-pack:center;justify-content:center;margin:0;min-height:var(--tag-size);padding:0 var(--spacing-scale-baseh);align-items:center;background:var(--background-dark);border-radius:var(--surface-rounder-sm);color:var(--color-dark);display:inline-flex;font-size:var(--font-size-scale-base);font-weight:var(--font-weight-medium);justify-content:center;margin:0;min-height:var(--tag-size);padding:0 var(--spacing-scale-baseh)}.br-tag+.br-tag{margin-left:var(--spacing-scale-half)}.br-tag.interaction{--tag-small:var(--spacing-scale-4x);--tag-medium:var(--spacing-scale-5x);--tag-large:var(--spacing-scale-5xh);font-size:var(--font-size-scale-up-01)}.br-tag.interaction{background:var(--interactive)}.br-tag.interaction .br-button{--button-size:var(--spacing-scale-3xh);--focus:var(--focus-color-dark);--hover:var(--hover-dark);--interactive-rgb:var(--color-dark-rgb);background-color:var(--interactive-light);border-radius:50%;color:var(--color-dark);margin-left:var(--spacing-scale-baseh);padding:0;width:var(--button-size)}.br-tag.interaction:hover .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-tag.interaction:active .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}.br-tag.disabled input{cursor:not-allowed}.br-tag.status{--tag-small:var(--spacing-scale-baseh);--tag-medium:var(--spacing-scale-2x);--tag-large:var(--spacing-scale-3x);border:1px solid var(--background-light);border-radius:50%;min-width:var(--tag-size);padding:0}.br-tag.count{--tag-small:var(--spacing-scale-2xh);--tag-medium:var(--spacing-scale-3x);--tag-large:var(--spacing-scale-3xh);border:1px solid var(--background-light);border-radius:100em;min-width:var(--tag-size);padding-left:var(--spacing-scale-base);padding-right:var(--spacing-scale-base)}.br-tag.icon{--tag-small:var(--spacing-scale-3xh);--tag-medium:var(--spacing-scale-4x);--tag-large:var(--spacing-scale-5xh);border-radius:50%;min-width:var(--tag-size);padding:0}.br-tag.small{--tag-size:var(--tag-small)}.br-tag.medium{--tag-size:var(--tag-medium)}.br-tag.large{--tag-size:var(--tag-large)}.br-tag.interaction{--tag-small:var(--spacing-scale-4x);--tag-medium:var(--spacing-scale-5x);--tag-large:var(--spacing-scale-5xh);font-size:var(--font-size-scale-up-01)}.br-tag.interaction{background:var(--interactive)}.br-tag.interaction .br-button{--button-size:var(--spacing-scale-3xh);--focus:var(--focus-color-dark);--hover:var(--hover-dark);--interactive-rgb:var(--color-dark-rgb);background-color:var(--interactive-light);border-radius:50%;color:var(--color-dark);margin-left:var(--spacing-scale-baseh);padding:0;width:var(--button-size)}.br-tag.interaction:hover .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-tag.interaction:active .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}.br-tag.disabled input{cursor:not-allowed}.br-tag.interaction{--tag-small:var(--spacing-scale-4x);--tag-medium:var(--spacing-scale-5x);--tag-large:var(--spacing-scale-5xh);font-size:var(--font-size-scale-up-01)}.br-tag.interaction{background:var(--interactive)}.br-tag.interaction .br-button{--button-size:var(--spacing-scale-3xh);--focus:var(--focus-color-dark);--hover:var(--hover-dark);--interactive-rgb:var(--color-dark-rgb);background-color:var(--interactive-light);border-radius:50%;color:var(--color-dark);margin-left:var(--spacing-scale-baseh);padding:0;width:var(--button-size)}.br-tag.interaction:hover .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--hover))), to(rgba(var(--interactive-rgb), var(--hover))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--hover)), rgba(var(--interactive-rgb), var(--hover)))}.br-tag.interaction:active .br-button{background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(var(--interactive-rgb), var(--pressed))), to(rgba(var(--interactive-rgb), var(--pressed))));background-image:linear-gradient(rgba(var(--interactive-rgb), var(--pressed)), rgba(var(--interactive-rgb), var(--pressed)))}.br-tag.disabled input{cursor:not-allowed}.br-tag+.br-tag{margin-left:var(--spacing-scale-half)}.br-tag.small{--tag-size:var(--tag-small)}.br-tag.medium{--tag-size:var(--tag-medium)}.br-tag.large{--tag-size:var(--tag-large)}.br-tag.is-highlight,.br-tag.highlight,.br-tag[highlight]{background-color:#268744}.br-tag.success,.br-tag[success]{background-color:var(--success)}.br-tag.danger,.br-tag[danger]{background-color:var(--danger)}.br-tag.warning,.br-tag[warning]{background-color:var(--warning)}.br-tag.info,.br-tag[info]{background-color:var(--info)}:host{display:block}:host .tag-position{display:-ms-flexbox;display:flex;-ms-flex-pack:distribute;justify-content:space-around;-ms-flex-align:center;align-items:center}:host .tag-spacing-status{margin-left:var(--spacing-scale-half) !important}";
|
|
13
|
+
const BrTagStyle0 = tagCss;
|
|
14
|
+
|
|
15
|
+
const Tag = class {
|
|
16
|
+
constructor(hostRef) {
|
|
17
|
+
index.registerInstance(this, hostRef);
|
|
18
|
+
this.brWillLoad = index.createEvent(this, "brWillLoad", 7);
|
|
19
|
+
if (hostRef.$hostElement$["s-ei"]) {
|
|
20
|
+
this.elementInternals = hostRef.$hostElement$["s-ei"];
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
this.elementInternals = hostRef.$hostElement$.attachInternals();
|
|
24
|
+
hostRef.$hostElement$["s-ei"] = this.elementInternals;
|
|
25
|
+
}
|
|
26
|
+
this.inheritedAttributes = {};
|
|
27
|
+
this.handleClose = () => {
|
|
28
|
+
this.el.remove();
|
|
29
|
+
};
|
|
30
|
+
this.label = '';
|
|
31
|
+
this.iconName = '';
|
|
32
|
+
this.color = '';
|
|
33
|
+
this.density = 'small';
|
|
34
|
+
this.shape = 'default';
|
|
35
|
+
this.status = false;
|
|
36
|
+
this.interaction = false;
|
|
37
|
+
this.disabled = false;
|
|
38
|
+
this.stateIconName = 'fa-solid:car';
|
|
39
|
+
}
|
|
40
|
+
componentWillLoad() {
|
|
41
|
+
this.brWillLoad.emit();
|
|
42
|
+
this.inheritedAttributes = inheritedAttributes.inheritAriaAttributes(this.el);
|
|
43
|
+
}
|
|
44
|
+
getCssClassMap() {
|
|
45
|
+
const classes = {
|
|
46
|
+
'br-tag': true,
|
|
47
|
+
interaction: this.interaction,
|
|
48
|
+
[this.color]: this.color !== '',
|
|
49
|
+
small: this.density === 'small',
|
|
50
|
+
medium: this.density === 'medium',
|
|
51
|
+
large: this.density === 'large',
|
|
52
|
+
count: this.shape === 'rounded' ? true : false,
|
|
53
|
+
icon: this.shape === 'circle' ? true : false,
|
|
54
|
+
status: this.status,
|
|
55
|
+
};
|
|
56
|
+
return classes;
|
|
57
|
+
}
|
|
58
|
+
renderIcon() {
|
|
59
|
+
if (this.iconName.trim().length === 0)
|
|
60
|
+
return null;
|
|
61
|
+
return index.h("br-icon", { style: { fontSize: 'var(--icon-size-base)' }, "icon-name": this.iconName, "aria-hidden": "true" });
|
|
62
|
+
}
|
|
63
|
+
renderLabel() {
|
|
64
|
+
if (this.shape === 'circle' || this.status)
|
|
65
|
+
return null;
|
|
66
|
+
return (index.h("span", { id: "interactivetag1", "aria-label": this.label }, this.label));
|
|
67
|
+
}
|
|
68
|
+
renderCloseButton() {
|
|
69
|
+
if (!this.interaction)
|
|
70
|
+
return null;
|
|
71
|
+
return (index.h("br-button", { type: "button", shape: "circle", emphasis: !this.interaction ? 'tertiary' : 'primary', "aria-label": "Fechar", colorMode: !this.interaction ? 'dark' : null, "aria-describedby": "interactivetag1", onClick: this.handleClose, disabled: this.disabled }, index.h("br-icon", { "icon-name": "fa-solid:times" })));
|
|
72
|
+
}
|
|
73
|
+
renderStatusLabel() {
|
|
74
|
+
if (!this.status)
|
|
75
|
+
return null;
|
|
76
|
+
return (index.h("span", { class: "tag-spacing-status", id: "interactivetag1", "aria-label": this.label }, this.label));
|
|
77
|
+
}
|
|
78
|
+
render() {
|
|
79
|
+
return (index.h(index.Host, { key: '2ae1b9e249097b66fb02e0c903e294f73aad6bc0' }, index.h("div", { key: '65f39b80147b977231e8bb9566f2aa1797597646', class: "tag-position" }, index.h("span", Object.assign({ key: '452777774bfdba4a5eed2af6bb429f02f8dd9ed3', class: this.getCssClassMap() }, this.inheritedAttributes, { role: "alert", "aria-live": "assertive" }), this.renderIcon(), this.renderLabel(), this.renderCloseButton(), index.h("slot", { key: 'c3cad61c4e5d7b683c9b4a6b66fbf0b62a56ac8a' })), this.renderStatusLabel())));
|
|
80
|
+
}
|
|
81
|
+
static get formAssociated() { return true; }
|
|
82
|
+
get el() { return index.getElement(this); }
|
|
83
|
+
};
|
|
84
|
+
Tag.style = BrTagStyle0;
|
|
85
|
+
|
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,CAAC,WAAW,EAAE,EAClB,IAAI,CAAC,iBAAiB,EAAE,EACzBA,oEAAa,CACR,EACN,IAAI,CAAC,iBAAiB,EAAE,CACrB,CACD,EACR;KACF;;;;;;;;","names":["inheritAriaAttributes","h","Host"],"sources":["src/components/tag/tag.scss?tag=br-tag&encapsulation=shadow","src/components/tag/tag.tsx"],"sourcesContent":["@import \"../../../../../node_modules/@govbr-ds/core/src/components/tag/tag.scss\";\n\n:host {\n display: block;\n\n .tag-position {\n display: flex;\n justify-content: space-around;\n align-items: center;\n }\n .tag-spacing-status {\n margin-left: var(--spacing-scale-half) !important;\n }\n}\n","import { AttachInternals, Component, Element, Event, EventEmitter, h, Host, Prop, State } from '@stencil/core'\n\nimport { Attributes, inheritAriaAttributes } from '../../utils/inherited-attributes'\nimport { CssClassMap } from '../../utils/interfaces'\n\n/**\n * Para uma descrição detalhada, consulte a [documentação do GovBR-DS](https://www.gov.br/ds/components/tag?tab=designer).\n *\n * @slot default - Slot utilizado para inserir conteúdo adicional na tag, como texto ou elementos HTML extras.\n */\n@Component({\n tag: 'br-tag',\n styleUrl: 'tag.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Tag {\n /**\n * Referência ao elemento host do componente.\n * Utilize esta propriedade para acessar e manipular o elemento do DOM associado ao componente.\n */\n @Element() el: HTMLBrTagElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * A propriedade 'label' é uma string que representa o texto a ser exibido no componente.\n * Ela é refletida no DOM, permitindo que alterações no valor sejam refletidas no elemento HTML correspondente.\n */\n @Prop({ reflect: true }) label: string = ''\n\n /**\n * A propriedade 'iconName' define o nome do ícone que será exibido ao lado do texto.\n * O valor padrão é 'fa-solid:car', que corresponde a um ícone de carro da biblioteca Font Awesome.\n */\n @Prop({ reflect: true }) iconName: string = ''\n\n /**\n * A propriedade 'color' permite definir a cor do componente.\n * Aceita valores como 'red', 'blue', entre outros, e é refletida no DOM.\n */\n @Prop({ reflect: true }) color: string = ''\n\n /**\n * A propriedade 'density' permite definir a densidade do componente.\n * Aceita valores como 'small', 'medium' e 'large', e é refletida no DOM.\n */\n @Prop({ reflect: true }) density: 'small' | 'medium' | 'large' = 'small'\n\n /**\n * A propriedade 'shape' define o formato do componente.\n * Valores possíveis:\n * - 'circle': Componente com formato circular.\n * - 'rounded': Componente com bordas arredondadas.\n * - 'default': Componente com formato padrão.\n */\n @Prop({ reflect: true }) shape: 'circle' | 'rounded' | 'default' = 'default'\n\n /**\n * A propriedade 'status' é um booleano que indica se o status deve ser exibido.\n * Se definido como true, o status será mostrado ao lado do texto.\n */\n @Prop({ reflect: true }) status: boolean = false\n\n /**\n * A propriedade 'interaction' é um booleano que indica se a interação deve ser habilitada.\n * Se definido como true, o componente permitirá interações do usuário.\n */\n @Prop({ reflect: true }) interaction: boolean = false\n\n /**\n * A propriedade 'disabled' é um booleano que indica se o componente deve estar desabilitado.\n * Se definido como true, o componente não permitirá interações do usuário.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n @State() stateIconName: string = 'fa-solid:car'\n\n /**\n * Emite um evento antes que o componente seja carregado pela primeira vez.\n * Utilize este evento para realizar tarefas de inicialização antes do componente ser exibido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillload) para mais detalhes.\n */\n @Event() brWillLoad: EventEmitter<void>\n componentWillLoad() {\n this.brWillLoad.emit()\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n private getCssClassMap(): CssClassMap {\n const classes: CssClassMap = {\n 'br-tag': true,\n interaction: this.interaction,\n [this.color]: this.color !== '',\n small: this.density === 'small',\n medium: this.density === 'medium',\n large: this.density === 'large',\n count: this.shape === 'rounded' ? true : false,\n icon: this.shape === 'circle' ? true : false,\n status: this.status,\n }\n\n return classes\n }\n\n private inheritedAttributes: Attributes = {}\n\n private renderIcon() {\n if (this.iconName.trim().length === 0) return null\n return <br-icon style={{ fontSize: 'var(--icon-size-base)' }} icon-name={this.iconName} aria-hidden=\"true\" />\n }\n\n private renderLabel() {\n if (this.shape === 'circle' || this.status) return null\n return (\n <span id=\"interactivetag1\" aria-label={this.label}>\n {this.label}\n </span>\n )\n }\n\n private renderCloseButton() {\n if (!this.interaction) return null\n return (\n <br-button\n type=\"button\"\n shape=\"circle\"\n emphasis={!this.interaction ? 'tertiary' : 'primary'}\n aria-label=\"Fechar\"\n colorMode={!this.interaction ? 'dark' : null}\n aria-describedby=\"interactivetag1\"\n onClick={this.handleClose}\n disabled={this.disabled}\n >\n <br-icon icon-name=\"fa-solid:times\"></br-icon>\n </br-button>\n )\n }\n\n private renderStatusLabel() {\n if (!this.status) return null\n return (\n <span class=\"tag-spacing-status\" id=\"interactivetag1\" aria-label={this.label}>\n {this.label}\n </span>\n )\n }\n\n private handleClose = () => {\n this.el.remove()\n }\n\n render() {\n return (\n <Host>\n <div class=\"tag-position\">\n <span class={this.getCssClassMap()} {...this.inheritedAttributes} role=\"alert\" aria-live=\"assertive\">\n {this.renderIcon()}\n {this.renderLabel()}\n {this.renderCloseButton()}\n <slot></slot>\n </span>\n {this.renderStatusLabel()}\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
|
|
@@ -87,7 +87,7 @@ const Textarea = class {
|
|
|
87
87
|
render() {
|
|
88
88
|
const caracteresRestantes = this.maxlength - this.currentLength;
|
|
89
89
|
const mostrarLimite = this.currentLength > 0;
|
|
90
|
-
return (index.h(index.Host, { key: '
|
|
90
|
+
return (index.h(index.Host, { key: '8bb5ea9efb0e2ee82d1c4074d7f9a8332fcfb635' }, index.h("div", Object.assign({ key: 'cedcc004557860b4b2724c5180f2c012a109fcc1', class: this.getCssClassMap() }, this.inheritedAttributes), index.h("div", { key: '3998a88b69f3dddc63ea41d08db7de96af28d25d', class: this.isInline ? 'row' : '' }, this.isInline ? (index.h("div", { class: "col-auto pt-half" }, index.h("label", { htmlFor: this.customId }, this.label))) : (index.h("label", { htmlFor: this.customId }, this.label)), index.h("div", { key: '8f94f9c2aaf2758e5ee9be6938be50ce8c82db7c', class: this.isInline ? 'col' : '' }, index.h("textarea", Object.assign({ key: 'a642046a4dd9da93ac051eb6bf0ecfe711433680', id: this.customId, value: this.value, placeholder: this.placeholder, disabled: this.disabled, onInput: this.handleChange }, (this.maxlength > 0 ? { maxLength: this.maxlength } : {}))), index.h("div", { key: 'b859da1b3f48ed513e32374251a31ad3fc0f108f', class: "text-base mt-1" }, this.maxlength > 0 && (index.h("div", { key: '0aaebed51ac98b00c4fca6e7d857664d117b0d74' }, mostrarLimite ? (index.h("span", { class: "restantes", "aria-live": "polite", role: "status", id: "limitmax" }, "Restam ", index.h("strong", null, caracteresRestantes), " caracteres")) : (index.h("span", { class: "limit", "aria-live": "polite" }, "Limite m\u00E1ximo de ", index.h("strong", null, this.maxlength), " caracteres"))))), index.h("slot", { key: 'e24c4673cc638ce9e37acf05d2d80fea32b7f8fa' }))))));
|
|
91
91
|
}
|
|
92
92
|
static get formAssociated() { return true; }
|
|
93
93
|
get el() { return index.getElement(this); }
|
|
@@ -156,7 +156,7 @@ const Upload = class {
|
|
|
156
156
|
fileInput.click();
|
|
157
157
|
}
|
|
158
158
|
render() {
|
|
159
|
-
return (index.h(index.Host, { key: '
|
|
159
|
+
return (index.h(index.Host, { key: 'aab6988f0879747fdb594e3810704e497718635c' }, index.h("div", { key: '274726af605123e4be46cd995b295c8eb147cbf4', class: this.getCssClassMap() }, index.h("label", { key: '40753e4671f13bd2daab5c823284e64dd104214b', class: "upload-label", form: "single-file" }, index.h("span", { key: 'd49a6054c231e556bb40ee4c8b06f0c8ff950507' }, this.label)), index.h("button", { key: 'dafa2d9c447bb65f01e9b5dbd81f63dde33d38d2', class: "upload-button", type: "button", "aria-hidden": "true", tabIndex: this.disabled ? -1 : 0, disabled: this.disabled, "aria-label": "Selecionar arquivo para upload", onClick: () => this.handleFileSelection(), onDrop: (event) => this.handleDrop(event), onDragOver: (event) => this.handleDragOver(event) }, index.h("br-icon", { key: '22b4bf3b4618ecdff30cdcb8db2185db6da0af5f', "icon-name": "fa-solid:upload", height: "16", "aria-hidden": "true" }), index.h("span", { key: 'f8a3fbc9629d7a8cd85eb434d922356b5c61ab22' }, "Selecione o arquivo")), index.h("input", Object.assign({ key: '83b65e6e1a55db70d42c6075bea037d58b86c457', class: "upload-input", id: "single-file", type: "file", "aria-hidden": "null", "aria-label": "enviar arquivo", onChange: ($event) => this.onInputChange($event.target.files) }, this.inheritedAttributes, { multiple: this.multiple, disabled: this.disabled, accept: this.accept })), index.h("div", { key: '0a7a7f508c8379986a56d1a2aa5773b0f0709c17', id: "list-files", class: "upload-list" }, this.filesSelected ? this.renderFilesUploaded() : null))));
|
|
160
160
|
}
|
|
161
161
|
static get formAssociated() { return true; }
|
|
162
162
|
get el() { return index.getElement(this); }
|
|
@@ -118,6 +118,10 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
118
118
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
119
119
|
/* webpackMode: "lazy" */
|
|
120
120
|
'./br-switch.cjs.entry.js')); }).then(processMod, consoleError);
|
|
121
|
+
case 'br-tag.cjs':
|
|
122
|
+
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
123
|
+
/* webpackMode: "lazy" */
|
|
124
|
+
'./br-tag.cjs.entry.js')); }).then(processMod, consoleError);
|
|
121
125
|
case 'br-textarea.cjs':
|
|
122
126
|
return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
|
|
123
127
|
/* webpackMode: "lazy" */
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -12,7 +12,7 @@ const appGlobals = require('./app-globals-77a217c6.js');
|
|
|
12
12
|
const defineCustomElements = async (win, options) => {
|
|
13
13
|
if (typeof window === 'undefined') return undefined;
|
|
14
14
|
await appGlobals.globalScripts();
|
|
15
|
-
return index.bootstrapLazy([["br-input.cjs",[[65,"br-input",{"customId":[513,"id"],"type":[513],"autocomplete":[513],"density":[513],"disabled":[516],"isInline":[516,"is-inline"],"isHighlight":[516,"is-highlight"],"state":[513],"label":[513],"name":[513],"placeholder":[513],"readonly":[516],"required":[516],"value":[1537],"helpText":[513,"help-text"],"isPasswordVisible":[32],"hasIconSlot":[32],"hasActionSlot":[32]}]]],["br-message.cjs",[[65,"br-message",{"messageTitle":[513,"message-title"],"message":[513],"isInline":[516,"is-inline"],"isClosable":[516,"is-closable"],"showIcon":[516,"show-icon"],"isFeedback":[516,"is-feedback"],"state":[513]}]]],["br-upload.cjs",[[65,"br-upload",{"accept":[1],"label":[1],"disabled":[516],"state":[513],"multiple":[4],"filesSelected":[32],"file":[32]}]]],["br-avatar.cjs",[[1,"br-avatar",{"density":[1],"image":[1],"imageAlt":[1,"image-alt"],"isIconic":[4,"is-iconic"],"text":[1],"iconWidth":[1,"icon-width"],"iconHeight":[1,"icon-height"],"marginTop":[1,"margin-top"]}]]],["br-checkbox.cjs",[[65,"br-checkbox",{"indeterminate":[516],"checked":[1540],"customId":[513,"id"],"disabled":[516],"hasHiddenLabel":[516,"has-hidden-label"],"label":[513],"name":[513],"state":[513],"value":[520],"_slotDefault":[32],"toggleChecked":[64]}]]],["br-dropdown.cjs",[[65,"br-dropdown",{"isOpen":[1540,"is-open"],"open":[64],"hide":[64]},null,{"isOpen":["isOpenChanged"]}]]],["br-item.cjs",[[65,"br-item",{"disabled":[516],"isActive":[516,"is-active"],"isSelected":[516,"is-selected"],"isInteractive":[516,"is-interactive"],"href":[513],"target":[513],"isButton":[516,"is-button"],"type":[1537],"value":[513],"density":[513],"hasSlotDefault":[32],"hasSlotStart":[32],"hasSlotEnd":[32],"selectedValue":[32]},[[4,"brDidCheckedChange","handleChange"]]]]],["br-list.cjs",[[65,"br-list",{"header":[513],"isHorizontal":[516,"is-horizontal"],"hideHeaderDivider":[516,"hide-header-divider"]}]]],["br-loading.cjs",[[65,"br-loading",{"isProgress":[516,"is-progress"],"progressPercent":[514,"progress-percent"],"isMedium":[516,"is-medium"],"label":[513]}]]],["br-radio.cjs",[[65,"br-radio",{"checked":[1540],"disabled":[516],"state":[513],"hasHiddenLabel":[516,"has-hidden-label"],"name":[513],"label":[513],"value":[520],"customId":[513,"id"]},[[8,"brDidChange","onBrDidChange"]]]]],["br-switch.cjs",[[65,"br-switch",{"disabled":[516],"checked":[516],"customId":[513,"id"],"label":[1],"labelPosition":[513,"label-position"],"labelOn":[513,"label-on"],"labelOff":[513,"label-off"],"hasIcon":[516,"has-icon"],"name":[513],"value":[513],"density":[513],"_slotDefault":[32],"_checkedValue":[32],"toggleChecked":[64]}]]],["br-textarea.cjs",[[65,"br-textarea",{"value":[1537],"label":[513],"placeholder":[513],"disabled":[516],"maxlength":[514],"state":[513],"density":[513],"isInline":[516,"is-inline"],"customId":[513,"id"],"currentLength":[32],"setValue":[64]},null,{"value":["valueChanged"]}]]],["br-button_2.cjs",[[65,"br-button",{"colorMode":[513,"color-mode"],"density":[513],"disabled":[516],"emphasis":[513],"isActive":[516,"is-active"],"isLoading":[516,"is-loading"],"shape":[513],"type":[513],"value":[513]}],[1,"br-icon",{"iconName":[513,"icon-name"],"height":[513],"width":[513],"cssClasses":[513,"css-classes"],"isInline":[516,"is-inline"],"rotate":[513],"flip":[513]}]]]], options);
|
|
15
|
+
return index.bootstrapLazy([["br-input.cjs",[[65,"br-input",{"customId":[513,"id"],"type":[513],"autocomplete":[513],"density":[513],"disabled":[516],"isInline":[516,"is-inline"],"isHighlight":[516,"is-highlight"],"state":[513],"label":[513],"name":[513],"placeholder":[513],"readonly":[516],"required":[516],"value":[1537],"helpText":[513,"help-text"],"autocorrect":[513],"min":[514],"max":[514],"minlength":[514],"maxlength":[514],"multiple":[516],"pattern":[513],"step":[514],"isPasswordVisible":[32],"hasIconSlot":[32],"hasActionSlot":[32]}]]],["br-message.cjs",[[65,"br-message",{"messageTitle":[513,"message-title"],"message":[513],"isInline":[516,"is-inline"],"isClosable":[516,"is-closable"],"showIcon":[516,"show-icon"],"isFeedback":[516,"is-feedback"],"state":[513]}]]],["br-tag.cjs",[[65,"br-tag",{"label":[513],"iconName":[513,"icon-name"],"color":[513],"density":[513],"shape":[513],"status":[516],"interaction":[516],"disabled":[516],"stateIconName":[32]}]]],["br-upload.cjs",[[65,"br-upload",{"accept":[1],"label":[1],"disabled":[516],"state":[513],"multiple":[4],"filesSelected":[32],"file":[32]}]]],["br-avatar.cjs",[[1,"br-avatar",{"density":[1],"image":[1],"imageAlt":[1,"image-alt"],"isIconic":[4,"is-iconic"],"text":[1],"iconWidth":[1,"icon-width"],"iconHeight":[1,"icon-height"],"marginTop":[1,"margin-top"]}]]],["br-checkbox.cjs",[[65,"br-checkbox",{"indeterminate":[516],"checked":[1540],"customId":[513,"id"],"disabled":[516],"hasHiddenLabel":[516,"has-hidden-label"],"label":[513],"name":[513],"state":[513],"value":[520],"_slotDefault":[32],"toggleChecked":[64]}]]],["br-dropdown.cjs",[[65,"br-dropdown",{"isOpen":[1540,"is-open"],"open":[64],"hide":[64]},null,{"isOpen":["isOpenChanged"]}]]],["br-item.cjs",[[65,"br-item",{"disabled":[516],"isActive":[516,"is-active"],"isSelected":[516,"is-selected"],"isInteractive":[516,"is-interactive"],"href":[513],"target":[513],"isButton":[516,"is-button"],"type":[1537],"value":[513],"density":[513],"hasSlotDefault":[32],"hasSlotStart":[32],"hasSlotEnd":[32],"selectedValue":[32]},[[4,"brDidCheckedChange","handleChange"]]]]],["br-list.cjs",[[65,"br-list",{"header":[513],"isHorizontal":[516,"is-horizontal"],"hideHeaderDivider":[516,"hide-header-divider"]}]]],["br-loading.cjs",[[65,"br-loading",{"isProgress":[516,"is-progress"],"progressPercent":[514,"progress-percent"],"isMedium":[516,"is-medium"],"label":[513]}]]],["br-radio.cjs",[[65,"br-radio",{"checked":[1540],"disabled":[516],"state":[513],"hasHiddenLabel":[516,"has-hidden-label"],"name":[513],"label":[513],"value":[520],"customId":[513,"id"]},[[8,"brDidChange","onBrDidChange"]]]]],["br-switch.cjs",[[65,"br-switch",{"disabled":[516],"checked":[516],"customId":[513,"id"],"label":[1],"labelPosition":[513,"label-position"],"labelOn":[513,"label-on"],"labelOff":[513,"label-off"],"hasIcon":[516,"has-icon"],"name":[513],"value":[513],"density":[513],"_slotDefault":[32],"_checkedValue":[32],"toggleChecked":[64]}]]],["br-textarea.cjs",[[65,"br-textarea",{"value":[1537],"label":[513],"placeholder":[513],"disabled":[516],"maxlength":[514],"state":[513],"density":[513],"isInline":[516,"is-inline"],"customId":[513,"id"],"currentLength":[32],"setValue":[64]},null,{"value":["valueChanged"]}]]],["br-button_2.cjs",[[65,"br-button",{"colorMode":[513,"color-mode"],"density":[513],"disabled":[516],"emphasis":[513],"isActive":[516,"is-active"],"isLoading":[516,"is-loading"],"shape":[513],"type":[513],"value":[513]}],[1,"br-icon",{"iconName":[513,"icon-name"],"height":[513],"width":[513],"cssClasses":[513,"css-classes"],"isInline":[516,"is-inline"],"rotate":[513],"flip":[513]}]]]], options);
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
exports.setNonce = index.setNonce;
|
|
@@ -44,7 +44,7 @@ var patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
|
44
44
|
|
|
45
45
|
patchBrowser().then(async (options) => {
|
|
46
46
|
await appGlobals.globalScripts();
|
|
47
|
-
return index.bootstrapLazy([["br-input.cjs",[[65,"br-input",{"customId":[513,"id"],"type":[513],"autocomplete":[513],"density":[513],"disabled":[516],"isInline":[516,"is-inline"],"isHighlight":[516,"is-highlight"],"state":[513],"label":[513],"name":[513],"placeholder":[513],"readonly":[516],"required":[516],"value":[1537],"helpText":[513,"help-text"],"isPasswordVisible":[32],"hasIconSlot":[32],"hasActionSlot":[32]}]]],["br-message.cjs",[[65,"br-message",{"messageTitle":[513,"message-title"],"message":[513],"isInline":[516,"is-inline"],"isClosable":[516,"is-closable"],"showIcon":[516,"show-icon"],"isFeedback":[516,"is-feedback"],"state":[513]}]]],["br-upload.cjs",[[65,"br-upload",{"accept":[1],"label":[1],"disabled":[516],"state":[513],"multiple":[4],"filesSelected":[32],"file":[32]}]]],["br-avatar.cjs",[[1,"br-avatar",{"density":[1],"image":[1],"imageAlt":[1,"image-alt"],"isIconic":[4,"is-iconic"],"text":[1],"iconWidth":[1,"icon-width"],"iconHeight":[1,"icon-height"],"marginTop":[1,"margin-top"]}]]],["br-checkbox.cjs",[[65,"br-checkbox",{"indeterminate":[516],"checked":[1540],"customId":[513,"id"],"disabled":[516],"hasHiddenLabel":[516,"has-hidden-label"],"label":[513],"name":[513],"state":[513],"value":[520],"_slotDefault":[32],"toggleChecked":[64]}]]],["br-dropdown.cjs",[[65,"br-dropdown",{"isOpen":[1540,"is-open"],"open":[64],"hide":[64]},null,{"isOpen":["isOpenChanged"]}]]],["br-item.cjs",[[65,"br-item",{"disabled":[516],"isActive":[516,"is-active"],"isSelected":[516,"is-selected"],"isInteractive":[516,"is-interactive"],"href":[513],"target":[513],"isButton":[516,"is-button"],"type":[1537],"value":[513],"density":[513],"hasSlotDefault":[32],"hasSlotStart":[32],"hasSlotEnd":[32],"selectedValue":[32]},[[4,"brDidCheckedChange","handleChange"]]]]],["br-list.cjs",[[65,"br-list",{"header":[513],"isHorizontal":[516,"is-horizontal"],"hideHeaderDivider":[516,"hide-header-divider"]}]]],["br-loading.cjs",[[65,"br-loading",{"isProgress":[516,"is-progress"],"progressPercent":[514,"progress-percent"],"isMedium":[516,"is-medium"],"label":[513]}]]],["br-radio.cjs",[[65,"br-radio",{"checked":[1540],"disabled":[516],"state":[513],"hasHiddenLabel":[516,"has-hidden-label"],"name":[513],"label":[513],"value":[520],"customId":[513,"id"]},[[8,"brDidChange","onBrDidChange"]]]]],["br-switch.cjs",[[65,"br-switch",{"disabled":[516],"checked":[516],"customId":[513,"id"],"label":[1],"labelPosition":[513,"label-position"],"labelOn":[513,"label-on"],"labelOff":[513,"label-off"],"hasIcon":[516,"has-icon"],"name":[513],"value":[513],"density":[513],"_slotDefault":[32],"_checkedValue":[32],"toggleChecked":[64]}]]],["br-textarea.cjs",[[65,"br-textarea",{"value":[1537],"label":[513],"placeholder":[513],"disabled":[516],"maxlength":[514],"state":[513],"density":[513],"isInline":[516,"is-inline"],"customId":[513,"id"],"currentLength":[32],"setValue":[64]},null,{"value":["valueChanged"]}]]],["br-button_2.cjs",[[65,"br-button",{"colorMode":[513,"color-mode"],"density":[513],"disabled":[516],"emphasis":[513],"isActive":[516,"is-active"],"isLoading":[516,"is-loading"],"shape":[513],"type":[513],"value":[513]}],[1,"br-icon",{"iconName":[513,"icon-name"],"height":[513],"width":[513],"cssClasses":[513,"css-classes"],"isInline":[516,"is-inline"],"rotate":[513],"flip":[513]}]]]], options);
|
|
47
|
+
return index.bootstrapLazy([["br-input.cjs",[[65,"br-input",{"customId":[513,"id"],"type":[513],"autocomplete":[513],"density":[513],"disabled":[516],"isInline":[516,"is-inline"],"isHighlight":[516,"is-highlight"],"state":[513],"label":[513],"name":[513],"placeholder":[513],"readonly":[516],"required":[516],"value":[1537],"helpText":[513,"help-text"],"autocorrect":[513],"min":[514],"max":[514],"minlength":[514],"maxlength":[514],"multiple":[516],"pattern":[513],"step":[514],"isPasswordVisible":[32],"hasIconSlot":[32],"hasActionSlot":[32]}]]],["br-message.cjs",[[65,"br-message",{"messageTitle":[513,"message-title"],"message":[513],"isInline":[516,"is-inline"],"isClosable":[516,"is-closable"],"showIcon":[516,"show-icon"],"isFeedback":[516,"is-feedback"],"state":[513]}]]],["br-tag.cjs",[[65,"br-tag",{"label":[513],"iconName":[513,"icon-name"],"color":[513],"density":[513],"shape":[513],"status":[516],"interaction":[516],"disabled":[516],"stateIconName":[32]}]]],["br-upload.cjs",[[65,"br-upload",{"accept":[1],"label":[1],"disabled":[516],"state":[513],"multiple":[4],"filesSelected":[32],"file":[32]}]]],["br-avatar.cjs",[[1,"br-avatar",{"density":[1],"image":[1],"imageAlt":[1,"image-alt"],"isIconic":[4,"is-iconic"],"text":[1],"iconWidth":[1,"icon-width"],"iconHeight":[1,"icon-height"],"marginTop":[1,"margin-top"]}]]],["br-checkbox.cjs",[[65,"br-checkbox",{"indeterminate":[516],"checked":[1540],"customId":[513,"id"],"disabled":[516],"hasHiddenLabel":[516,"has-hidden-label"],"label":[513],"name":[513],"state":[513],"value":[520],"_slotDefault":[32],"toggleChecked":[64]}]]],["br-dropdown.cjs",[[65,"br-dropdown",{"isOpen":[1540,"is-open"],"open":[64],"hide":[64]},null,{"isOpen":["isOpenChanged"]}]]],["br-item.cjs",[[65,"br-item",{"disabled":[516],"isActive":[516,"is-active"],"isSelected":[516,"is-selected"],"isInteractive":[516,"is-interactive"],"href":[513],"target":[513],"isButton":[516,"is-button"],"type":[1537],"value":[513],"density":[513],"hasSlotDefault":[32],"hasSlotStart":[32],"hasSlotEnd":[32],"selectedValue":[32]},[[4,"brDidCheckedChange","handleChange"]]]]],["br-list.cjs",[[65,"br-list",{"header":[513],"isHorizontal":[516,"is-horizontal"],"hideHeaderDivider":[516,"hide-header-divider"]}]]],["br-loading.cjs",[[65,"br-loading",{"isProgress":[516,"is-progress"],"progressPercent":[514,"progress-percent"],"isMedium":[516,"is-medium"],"label":[513]}]]],["br-radio.cjs",[[65,"br-radio",{"checked":[1540],"disabled":[516],"state":[513],"hasHiddenLabel":[516,"has-hidden-label"],"name":[513],"label":[513],"value":[520],"customId":[513,"id"]},[[8,"brDidChange","onBrDidChange"]]]]],["br-switch.cjs",[[65,"br-switch",{"disabled":[516],"checked":[516],"customId":[513,"id"],"label":[1],"labelPosition":[513,"label-position"],"labelOn":[513,"label-on"],"labelOff":[513,"label-off"],"hasIcon":[516,"has-icon"],"name":[513],"value":[513],"density":[513],"_slotDefault":[32],"_checkedValue":[32],"toggleChecked":[64]}]]],["br-textarea.cjs",[[65,"br-textarea",{"value":[1537],"label":[513],"placeholder":[513],"disabled":[516],"maxlength":[514],"state":[513],"density":[513],"isInline":[516,"is-inline"],"customId":[513,"id"],"currentLength":[32],"setValue":[64]},null,{"value":["valueChanged"]}]]],["br-button_2.cjs",[[65,"br-button",{"colorMode":[513,"color-mode"],"density":[513],"disabled":[516],"emphasis":[513],"isActive":[516,"is-active"],"isLoading":[516,"is-loading"],"shape":[513],"type":[513],"value":[513]}],[1,"br-icon",{"iconName":[513,"icon-name"],"height":[513],"width":[513],"cssClasses":[513,"css-classes"],"isInline":[516,"is-inline"],"rotate":[513],"flip":[513]}]]]], options);
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
exports.setNonce = index.setNonce;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Construído com @govbr-ds/webcomponents
|
|
3
3
|
* Padrão Digital de Governo.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { h, Host } from "@stencil/core";
|
|
6
6
|
import { v4 as uuidv4 } from "uuid";
|
|
7
7
|
import { inheritAriaAttributes } from "../../utils/inherited-attributes";
|
|
8
8
|
/**
|
|
@@ -32,7 +32,7 @@ export class Input {
|
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
34
|
this.renderInput = () => {
|
|
35
|
-
return (h("input", Object.assign({ class: this.isHighlight ? 'input-highlight' : null, id: this.customId, autocomplete: this.autocomplete, disabled: this.disabled, onInput: this.handleInput, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)));
|
|
35
|
+
return (h("input", Object.assign({ class: this.isHighlight ? 'input-highlight' : null, id: this.customId, autocomplete: this.autocomplete, disabled: this.disabled, autoCorrect: this.autocorrect, min: this.min, max: this.max, minLength: this.minlength, maxLength: this.maxlength, multiple: this.multiple, name: this.name, pattern: this.pattern, step: this.step, onInput: this.handleInput, placeholder: this.placeholder, readonly: this.readonly, required: this.required, title: this.el.title, type: this.type, value: this.value }, this.inheritedAttributes)));
|
|
36
36
|
};
|
|
37
37
|
this.renderHelpText = () => {
|
|
38
38
|
var _a;
|
|
@@ -49,10 +49,10 @@ export class Input {
|
|
|
49
49
|
};
|
|
50
50
|
this.renderInlineInputContent = () => {
|
|
51
51
|
if (this.hasIconSlot) {
|
|
52
|
-
return
|
|
52
|
+
return h("div", { class: "input-content" }, this.renderInputWithIcon());
|
|
53
53
|
}
|
|
54
54
|
else {
|
|
55
|
-
return
|
|
55
|
+
return h("div", { class: "input-content" }, this.renderInputWithoutIcon());
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
58
|
this.renderInputContent = () => {
|
|
@@ -62,11 +62,7 @@ export class Input {
|
|
|
62
62
|
return (h("div", { class: "input-group" }, this.renderIconSlot(), this.renderInput(), this.renderButton(), this.renderHelpText()));
|
|
63
63
|
};
|
|
64
64
|
this.renderInputWithoutIcon = () => {
|
|
65
|
-
return [
|
|
66
|
-
this.renderInput(),
|
|
67
|
-
this.renderButton(),
|
|
68
|
-
this.renderHelpText()
|
|
69
|
-
];
|
|
65
|
+
return [this.renderInput(), this.renderButton(), this.renderHelpText()];
|
|
70
66
|
};
|
|
71
67
|
this.customId = `br-input-${uuidv4()}`;
|
|
72
68
|
this.type = 'text';
|
|
@@ -83,6 +79,14 @@ export class Input {
|
|
|
83
79
|
this.required = false;
|
|
84
80
|
this.value = undefined;
|
|
85
81
|
this.helpText = undefined;
|
|
82
|
+
this.autocorrect = 'off';
|
|
83
|
+
this.min = undefined;
|
|
84
|
+
this.max = undefined;
|
|
85
|
+
this.minlength = undefined;
|
|
86
|
+
this.maxlength = undefined;
|
|
87
|
+
this.multiple = false;
|
|
88
|
+
this.pattern = undefined;
|
|
89
|
+
this.step = undefined;
|
|
86
90
|
this.isPasswordVisible = false;
|
|
87
91
|
this.hasIconSlot = false;
|
|
88
92
|
this.hasActionSlot = false;
|
|
@@ -125,7 +129,7 @@ export class Input {
|
|
|
125
129
|
return null;
|
|
126
130
|
}
|
|
127
131
|
render() {
|
|
128
|
-
return (h(Host, { key: '
|
|
132
|
+
return (h(Host, { key: 'd5e8fec1c09589e9c9e9aa206b3c1669ef1f04f8' }, h("div", { key: '431430f8d91e3086b114d4bc7fa3b43e9b5b9eab', class: this.getInputCssClassMap() }, this.renderLabel(), this.isInline ? this.renderInlineInputContent() : this.renderInputContent())));
|
|
129
133
|
}
|
|
130
134
|
static get is() { return "br-input"; }
|
|
131
135
|
static get encapsulation() { return "shadow"; }
|
|
@@ -404,6 +408,144 @@ export class Input {
|
|
|
404
408
|
},
|
|
405
409
|
"attribute": "help-text",
|
|
406
410
|
"reflect": true
|
|
411
|
+
},
|
|
412
|
+
"autocorrect": {
|
|
413
|
+
"type": "string",
|
|
414
|
+
"mutable": false,
|
|
415
|
+
"complexType": {
|
|
416
|
+
"original": "'off' | 'on'",
|
|
417
|
+
"resolved": "\"off\" | \"on\"",
|
|
418
|
+
"references": {}
|
|
419
|
+
},
|
|
420
|
+
"required": false,
|
|
421
|
+
"optional": false,
|
|
422
|
+
"docs": {
|
|
423
|
+
"tags": [],
|
|
424
|
+
"text": "Controla a corre\u00E7\u00E3o autom\u00E1tica do texto."
|
|
425
|
+
},
|
|
426
|
+
"attribute": "autocorrect",
|
|
427
|
+
"reflect": true,
|
|
428
|
+
"defaultValue": "'off'"
|
|
429
|
+
},
|
|
430
|
+
"min": {
|
|
431
|
+
"type": "number",
|
|
432
|
+
"mutable": false,
|
|
433
|
+
"complexType": {
|
|
434
|
+
"original": "number",
|
|
435
|
+
"resolved": "number",
|
|
436
|
+
"references": {}
|
|
437
|
+
},
|
|
438
|
+
"required": false,
|
|
439
|
+
"optional": false,
|
|
440
|
+
"docs": {
|
|
441
|
+
"tags": [],
|
|
442
|
+
"text": "Define o valor m\u00EDnimo para campos de entrada num\u00E9ricos."
|
|
443
|
+
},
|
|
444
|
+
"attribute": "min",
|
|
445
|
+
"reflect": true
|
|
446
|
+
},
|
|
447
|
+
"max": {
|
|
448
|
+
"type": "number",
|
|
449
|
+
"mutable": false,
|
|
450
|
+
"complexType": {
|
|
451
|
+
"original": "number",
|
|
452
|
+
"resolved": "number",
|
|
453
|
+
"references": {}
|
|
454
|
+
},
|
|
455
|
+
"required": false,
|
|
456
|
+
"optional": false,
|
|
457
|
+
"docs": {
|
|
458
|
+
"tags": [],
|
|
459
|
+
"text": "Define o valor m\u00E1ximo para campos de entrada num\u00E9ricos."
|
|
460
|
+
},
|
|
461
|
+
"attribute": "max",
|
|
462
|
+
"reflect": true
|
|
463
|
+
},
|
|
464
|
+
"minlength": {
|
|
465
|
+
"type": "number",
|
|
466
|
+
"mutable": false,
|
|
467
|
+
"complexType": {
|
|
468
|
+
"original": "number",
|
|
469
|
+
"resolved": "number",
|
|
470
|
+
"references": {}
|
|
471
|
+
},
|
|
472
|
+
"required": false,
|
|
473
|
+
"optional": false,
|
|
474
|
+
"docs": {
|
|
475
|
+
"tags": [],
|
|
476
|
+
"text": "Define o comprimento m\u00EDnimo do valor do campo de entrada."
|
|
477
|
+
},
|
|
478
|
+
"attribute": "minlength",
|
|
479
|
+
"reflect": true
|
|
480
|
+
},
|
|
481
|
+
"maxlength": {
|
|
482
|
+
"type": "number",
|
|
483
|
+
"mutable": false,
|
|
484
|
+
"complexType": {
|
|
485
|
+
"original": "number",
|
|
486
|
+
"resolved": "number",
|
|
487
|
+
"references": {}
|
|
488
|
+
},
|
|
489
|
+
"required": false,
|
|
490
|
+
"optional": false,
|
|
491
|
+
"docs": {
|
|
492
|
+
"tags": [],
|
|
493
|
+
"text": "Define o comprimento m\u00E1ximo do valor do campo de entrada."
|
|
494
|
+
},
|
|
495
|
+
"attribute": "maxlength",
|
|
496
|
+
"reflect": true
|
|
497
|
+
},
|
|
498
|
+
"multiple": {
|
|
499
|
+
"type": "boolean",
|
|
500
|
+
"mutable": false,
|
|
501
|
+
"complexType": {
|
|
502
|
+
"original": "boolean",
|
|
503
|
+
"resolved": "boolean",
|
|
504
|
+
"references": {}
|
|
505
|
+
},
|
|
506
|
+
"required": false,
|
|
507
|
+
"optional": false,
|
|
508
|
+
"docs": {
|
|
509
|
+
"tags": [],
|
|
510
|
+
"text": "Se verdadeiro, permite a sele\u00E7\u00E3o de m\u00FAltiplos arquivos."
|
|
511
|
+
},
|
|
512
|
+
"attribute": "multiple",
|
|
513
|
+
"reflect": true,
|
|
514
|
+
"defaultValue": "false"
|
|
515
|
+
},
|
|
516
|
+
"pattern": {
|
|
517
|
+
"type": "string",
|
|
518
|
+
"mutable": false,
|
|
519
|
+
"complexType": {
|
|
520
|
+
"original": "string",
|
|
521
|
+
"resolved": "string",
|
|
522
|
+
"references": {}
|
|
523
|
+
},
|
|
524
|
+
"required": false,
|
|
525
|
+
"optional": false,
|
|
526
|
+
"docs": {
|
|
527
|
+
"tags": [],
|
|
528
|
+
"text": "Define o padr\u00E3o de entrada para valida\u00E7\u00E3o."
|
|
529
|
+
},
|
|
530
|
+
"attribute": "pattern",
|
|
531
|
+
"reflect": true
|
|
532
|
+
},
|
|
533
|
+
"step": {
|
|
534
|
+
"type": "number",
|
|
535
|
+
"mutable": false,
|
|
536
|
+
"complexType": {
|
|
537
|
+
"original": "number",
|
|
538
|
+
"resolved": "number",
|
|
539
|
+
"references": {}
|
|
540
|
+
},
|
|
541
|
+
"required": false,
|
|
542
|
+
"optional": false,
|
|
543
|
+
"docs": {
|
|
544
|
+
"tags": [],
|
|
545
|
+
"text": "Define o valor do passo para campos de entrada num\u00E9ricos."
|
|
546
|
+
},
|
|
547
|
+
"attribute": "step",
|
|
548
|
+
"reflect": true
|
|
407
549
|
}
|
|
408
550
|
};
|
|
409
551
|
}
|