@govbr-ds/webcomponents 2.0.0-next.8 → 2.0.0-next.9
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-avatar.cjs.entry.js +46 -37
- package/dist/cjs/br-avatar.cjs.entry.js.map +1 -1
- package/dist/cjs/br-button_2.cjs.entry.js +21 -24
- package/dist/cjs/br-button_2.cjs.entry.js.map +1 -1
- package/dist/cjs/br-checkbox.cjs.entry.js +11 -12
- package/dist/cjs/br-checkbox.cjs.entry.js.map +1 -1
- package/dist/cjs/br-input.cjs.entry.js +12 -13
- package/dist/cjs/br-input.cjs.entry.js.map +1 -1
- package/dist/cjs/br-item.cjs.entry.js +12 -15
- package/dist/cjs/br-item.cjs.entry.js.map +1 -1
- package/dist/cjs/br-loading.cjs.entry.js +11 -12
- package/dist/cjs/br-loading.cjs.entry.js.map +1 -1
- package/dist/cjs/br-message.cjs.entry.js +11 -12
- package/dist/cjs/br-message.cjs.entry.js.map +1 -1
- package/dist/cjs/br-radio.cjs.entry.js +11 -12
- package/dist/cjs/br-radio.cjs.entry.js.map +1 -1
- package/dist/cjs/br-switch.cjs.entry.js +11 -12
- package/dist/cjs/br-switch.cjs.entry.js.map +1 -1
- package/dist/cjs/{index-c3888765.js → index-af20d91d.js} +20 -14
- package/dist/cjs/index-af20d91d.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/cjs/webcomponents.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/avatar/avatar.js +66 -57
- package/dist/collection/components/avatar/avatar.js.map +1 -1
- package/dist/collection/components/button/button.js +30 -31
- package/dist/collection/components/button/button.js.map +1 -1
- package/dist/collection/components/checkbox/checkbox.js +30 -31
- package/dist/collection/components/checkbox/checkbox.js.map +1 -1
- package/dist/collection/components/icon/icon.js +28 -30
- package/dist/collection/components/icon/icon.js.map +1 -1
- package/dist/collection/components/input/input.css +7 -0
- package/dist/collection/components/input/input.js +30 -31
- package/dist/collection/components/input/input.js.map +1 -1
- package/dist/collection/components/item/item.js +31 -34
- package/dist/collection/components/item/item.js.map +1 -1
- package/dist/collection/components/loading/loading.js +28 -29
- package/dist/collection/components/loading/loading.js.map +1 -1
- package/dist/collection/components/message/message.js +28 -29
- package/dist/collection/components/message/message.js.map +1 -1
- package/dist/collection/components/radio/radio.js +30 -31
- package/dist/collection/components/radio/radio.js.map +1 -1
- package/dist/collection/components/switch/switch.js +30 -31
- package/dist/collection/components/switch/switch.js.map +1 -1
- package/dist/components/br-avatar.js +49 -40
- package/dist/components/br-avatar.js.map +1 -1
- package/dist/components/br-button.js +1 -1
- package/dist/components/br-checkbox.js +13 -14
- package/dist/components/br-checkbox.js.map +1 -1
- package/dist/components/br-icon.js +1 -1
- package/dist/components/br-input.js +17 -18
- package/dist/components/br-input.js.map +1 -1
- package/dist/components/br-item.js +13 -16
- package/dist/components/br-item.js.map +1 -1
- package/dist/components/br-loading.js +13 -14
- package/dist/components/br-loading.js.map +1 -1
- package/dist/components/br-message.js +15 -16
- package/dist/components/br-message.js.map +1 -1
- package/dist/components/br-radio.js +13 -14
- package/dist/components/br-radio.js.map +1 -1
- package/dist/components/br-switch.js +14 -15
- package/dist/components/br-switch.js.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/{v4.js → p-14616bce.js} +1 -1
- package/dist/components/p-14616bce.js.map +1 -0
- package/dist/components/p-1b06f3d9.js +1438 -0
- package/dist/components/p-1b06f3d9.js.map +1 -0
- package/dist/components/{icon.js → p-75879137.js} +14 -16
- package/dist/components/p-75879137.js.map +1 -0
- package/dist/components/{inherited-attributes.js → p-ee6f4f3f.js} +1 -1
- package/dist/components/p-ee6f4f3f.js.map +1 -0
- package/dist/components/{button.js → p-f3ca1c10.js} +14 -15
- package/dist/components/p-f3ca1c10.js.map +1 -0
- package/dist/esm/br-avatar.entry.js +46 -37
- package/dist/esm/br-avatar.entry.js.map +1 -1
- package/dist/esm/br-button_2.entry.js +21 -24
- package/dist/esm/br-button_2.entry.js.map +1 -1
- package/dist/esm/br-checkbox.entry.js +11 -12
- package/dist/esm/br-checkbox.entry.js.map +1 -1
- package/dist/esm/br-input.entry.js +12 -13
- package/dist/esm/br-input.entry.js.map +1 -1
- package/dist/esm/br-item.entry.js +12 -15
- package/dist/esm/br-item.entry.js.map +1 -1
- package/dist/esm/br-loading.entry.js +11 -12
- package/dist/esm/br-loading.entry.js.map +1 -1
- package/dist/esm/br-message.entry.js +11 -12
- package/dist/esm/br-message.entry.js.map +1 -1
- package/dist/esm/br-radio.entry.js +11 -12
- package/dist/esm/br-radio.entry.js.map +1 -1
- package/dist/esm/br-switch.entry.js +11 -12
- package/dist/esm/br-switch.entry.js.map +1 -1
- package/dist/esm/{index-c26b44a5.js → index-4f7580f8.js} +20 -14
- package/dist/esm/index-4f7580f8.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/dist/esm/webcomponents.js +3 -3
- package/dist/esm/webcomponents.js.map +1 -1
- package/dist/types/components/avatar/avatar.d.ts +13 -10
- package/dist/types/components/button/button.d.ts +10 -10
- package/dist/types/components/checkbox/checkbox.d.ts +10 -10
- package/dist/types/components/icon/icon.d.ts +9 -9
- package/dist/types/components/input/input.d.ts +10 -10
- package/dist/types/components/item/item.d.ts +10 -10
- package/dist/types/components/loading/loading.d.ts +9 -9
- package/dist/types/components/message/message.d.ts +9 -9
- package/dist/types/components/radio/radio.d.ts +10 -10
- package/dist/types/components/switch/switch.d.ts +10 -10
- package/dist/types/components.d.ts +194 -194
- package/dist/webcomponents/p-104a47a9.js +3 -0
- package/dist/webcomponents/p-104a47a9.js.map +1 -0
- package/dist/webcomponents/{p-eaca93a8.entry.js → p-194d749e.entry.js} +2 -2
- package/dist/webcomponents/p-194d749e.entry.js.map +1 -0
- package/dist/webcomponents/{p-746d2dae.entry.js → p-563e73f4.entry.js} +2 -2
- package/dist/webcomponents/p-563e73f4.entry.js.map +1 -0
- package/dist/webcomponents/{p-c8fd38c6.entry.js → p-786e07d7.entry.js} +3 -3
- package/dist/webcomponents/p-786e07d7.entry.js.map +1 -0
- package/dist/webcomponents/{p-0dd14da5.entry.js → p-8d69ee5a.entry.js} +2 -2
- package/dist/webcomponents/p-8d69ee5a.entry.js.map +1 -0
- package/dist/webcomponents/{p-dd2d3c16.entry.js → p-b771d400.entry.js} +2 -2
- package/dist/webcomponents/p-b771d400.entry.js.map +1 -0
- package/dist/webcomponents/{p-1d1429c8.entry.js → p-c0a45bc7.entry.js} +2 -2
- package/dist/webcomponents/p-c0a45bc7.entry.js.map +1 -0
- package/dist/webcomponents/{p-c6aa14f5.entry.js → p-d671a100.entry.js} +2 -2
- package/dist/webcomponents/p-d671a100.entry.js.map +1 -0
- package/dist/webcomponents/{p-89f87c47.entry.js → p-e0e51b05.entry.js} +2 -2
- package/dist/webcomponents/p-e0e51b05.entry.js.map +1 -0
- package/dist/webcomponents/{p-28e6ccf9.entry.js → p-ed6a071a.entry.js} +2 -2
- package/dist/webcomponents/p-ed6a071a.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/hydrate/index.d.ts +4 -4
- package/hydrate/index.js +162 -154
- package/hydrate/index.mjs +162 -154
- package/package.json +7 -7
- package/vscode-data.json +1 -12
- package/dist/cjs/index-c3888765.js.map +0 -1
- package/dist/collection/utils/events-global.js +0 -80
- package/dist/collection/utils/events-global.js.map +0 -1
- package/dist/components/button.js.map +0 -1
- package/dist/components/icon.js.map +0 -1
- package/dist/components/inherited-attributes.js.map +0 -1
- package/dist/components/v4.js.map +0 -1
- package/dist/esm/index-c26b44a5.js.map +0 -1
- package/dist/types/utils/events-global.d.ts +0 -73
- package/dist/webcomponents/p-0dd14da5.entry.js.map +0 -1
- package/dist/webcomponents/p-1d1429c8.entry.js.map +0 -1
- package/dist/webcomponents/p-28e6ccf9.entry.js.map +0 -1
- package/dist/webcomponents/p-746d2dae.entry.js.map +0 -1
- package/dist/webcomponents/p-89f87c47.entry.js.map +0 -1
- package/dist/webcomponents/p-c6aa14f5.entry.js.map +0 -1
- package/dist/webcomponents/p-c8fd38c6.entry.js.map +0 -1
- package/dist/webcomponents/p-ccfb45d3.js +0 -3
- package/dist/webcomponents/p-ccfb45d3.js.map +0 -1
- package/dist/webcomponents/p-dd2d3c16.entry.js.map +0 -1
- package/dist/webcomponents/p-eaca93a8.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input.js","sourceRoot":"","sources":["../../../src/components/input/input.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAC9G,OAAO,EAAE,EAAE,IAAI,MAAM,EAAE,MAAM,MAAM,CAAA;AACnC,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGpF;;;;;;;GAOG;AAOH,MAAM,OAAO,KAAK;;QA+RR,wBAAmB,GAAe,EAAE,CAAA;QAY5C,gBAAW,GAAG,GAAG,EAAE;YACjB,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CACL,aAAO,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,aAAa,IAChD,IAAI,CAAC,KAAK,CACL,CACT,CAAA;YACH,CAAC;YACD,OAAO,CACL,aAAO,OAAO,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,EAAC,aAAa;gBACjD,YAAM,IAAI,EAAC,OAAO,GAAQ,CACpB,CACT,CAAA;QACH,CAAC,CAAA;QAED,6BAAwB,GAAG,GAAG,EAAE;YAC9B,MAAM,KAAK,GAAG,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;YACvD,KAAK,CAAC,IAAI,GAAG,KAAK,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["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 *\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: HTMLElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único do campo de entrada.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true }) defaultID: 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 | '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 * Se definido como verdadeiro, o input receberá foco automaticamente ao ser renderizado.\n */\n @Prop({ reflect: true }) autofocus: boolean = false\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 exibirá um ícone. Utilize o slot `icon` para definir o ícone.\n */\n @Prop({ reflect: true }) hasIcon: boolean = false\n\n /**\n * Se verdadeiro, um botão será exibido à direita do input.\n */\n @Prop({ reflect: true }) hasRightButton: boolean = false\n\n /**\n * Se verdadeiro, o input terá destaque visual.\n */\n @Prop({ reflect: true }) isHighlight: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de validação bem-sucedido.\n */\n @Prop({ reflect: true }) success: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de validação com erro.\n */\n @Prop({ reflect: true }) danger: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado informativo.\n */\n @Prop({ reflect: true }) info: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de alerta.\n */\n @Prop({ reflect: true }) warning: boolean = false\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() _showIconTextPassword: boolean = false\n\n /**\n * Emite um evento quando o componente é conectado ao DOM.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes.\n */\n @Event() brDidConnect: EventEmitter<this>\n connectedCallback() {\n this.brDidConnect.emit(this)\n }\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<this>\n componentWillLoad() {\n this.brWillLoad.emit(this)\n this.inheritedAttributes = inheritAriaAttributes(this.el)\n }\n\n /**\n * Emite um evento após o componente ter sido carregado pela primeira vez.\n * Utilize este evento para realizar ações que devem ocorrer depois que o componente foi totalmente carregado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes.\n */\n @Event() brDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brDidLoad.emit(this)\n }\n\n /**\n * Emite um evento antes do componente ser renderizado.\n * Utilize este evento para preparar o componente antes de sua renderização.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes.\n */\n @Event() brWillRender: EventEmitter<this>\n componentWillRender() {\n this.brWillRender.emit(this)\n }\n\n /**\n * Emite um evento após o componente ter sido renderizado.\n * Utilize este evento para executar ações que devem ocorrer após a renderização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes.\n */\n @Event() brDidRender: EventEmitter<this>\n componentDidRender() {\n this.brDidRender.emit(this)\n }\n\n /**\n * Emite um evento para indicar se o componente deve ser atualizado ou não.\n * Este evento é chamado antes de qualquer atualização do componente para decidir se a atualização deve prosseguir.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes.\n */\n @Event() brShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brShouldUpdate.emit(this)\n }\n\n /**\n * Emite um evento antes de o componente ser atualizado.\n * Utilize este evento para realizar ações preparatórias antes da atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes.\n */\n @Event() brWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brWillUpdate.emit(this)\n }\n\n /**\n * Emite um evento após o componente ter sido atualizado.\n * Utilize este evento para realizar ações após a atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes.\n */\n @Event() brDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brDidUpdate.emit(this)\n }\n\n /**\n * Emite um evento quando o componente é desconectado do DOM.\n * Utilize este evento para realizar a limpeza ou outras ações necessárias quando o componente é removido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes.\n */\n @Event() brDidDisconnect: EventEmitter<this>\n disconnectedCallback() {\n if (this.el.isConnected) this.brDidDisconnect.emit(this)\n }\n\n /**\n * Emite um evento quando o componente é associado ou removido de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formassociatedcallback) para mais detalhes.\n *\n * @param form - Dados do formulário associado.\n */\n @Event() brFormAssociatedCallback: EventEmitter<FormData>\n formAssociatedCallback(form: FormData) {\n this.brFormAssociatedCallback.emit(form)\n }\n\n /**\n * Emite um evento quando o estado `disabled` do componente muda dentro de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formdisabledcallback) para mais informações.\n *\n * @param disabled - Novo estado `disabled` do componente dentro do formulário.\n */\n @Event() brFormDisabledCallback: EventEmitter<boolean>\n formDisabledCallback(disabled: boolean) {\n this.brFormDisabledCallback.emit(disabled)\n }\n\n /**\n * Emite um evento quando um `<form>` é resetado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formresetcallback) para mais detalhes.\n */\n @Event() brFormResetCallback: EventEmitter\n formResetCallback() {\n this.brFormResetCallback.emit()\n }\n\n /**\n * Emite um evento quando o navegador preenche automaticamente os campos de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formstaterestorecallback) para mais informações.\n *\n * @param state - Estado restaurado do formulário.\n * @param _mode - Modo de preenchimento automático do navegador.\n */\n @Event() brFormStateRestoreCallback: EventEmitter<[state: string, _mode: string]>\n formStateRestoreCallback(state: string, _mode: string) {\n this.brFormStateRestoreCallback.emit([state, _mode])\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.hasRightButton,\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.success,\n danger: this.danger,\n info: this.info,\n warning: this.warning,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /**\n * Valor atualizado do input\n */\n @Event() valueChange!: EventEmitter<string>\n\n private handleInput(event: Event) {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n renderLabel = () => {\n if (this.label) {\n return (\n <label htmlFor={this.defaultID} class=\"text-nowrap\">\n {this.label}\n </label>\n )\n }\n return (\n <label htmlFor={this.defaultID} class=\"text-nowrap\">\n <slot name=\"label\"></slot>\n </label>\n )\n }\n\n togglePasswordVisibility = () => {\n const input = this.el.shadowRoot.querySelector('input')\n input.type = input.type === 'password' ? 'text' : 'password'\n this._showIconTextPassword = input.type === 'password'\n }\n\n private hasSlotContent(slotName: string): boolean {\n return !!this.el.querySelector(`[slot=\"${slotName}\"]`)\n }\n\n renderInput = () => {\n return (\n <input\n id={this.defaultID}\n autocomplete={this.autocomplete}\n autofocus={this.autofocus}\n disabled={this.disabled}\n onInput={this.handleInput.bind(this)}\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 renderHelpText = () => {\n if (this.helpText) {\n return <p>{this.helpText}</p>\n }\n\n return <slot name=\"help-text\"></slot>\n }\n\n renderIconPassword = () => {\n const showPassword = !this._showIconTextPassword\n return <br-icon icon-name={showPassword ? 'fa-solid:eye' : 'fa-solid:eye-slash'}></br-icon>\n }\n\n renderIconSlot() {\n if (this.hasSlotContent('hasIcon')) {\n return <slot name=\"icon\"></slot>\n } else if (this.hasSlotContent('action')) {\n return <slot name=\"action\"></slot>\n } else {\n return this.renderIconPassword()\n }\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n <div class={`input-label ${this.isInline ? 'inline-label' : ''}`}>{this.renderLabel()}</div>\n {this.hasIcon ? (\n <div class=\"input-group\">\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n {this.renderInput()}\n </div>\n ) : (\n this.renderInput()\n )}\n\n {this.hasRightButton && (\n <br-button\n class=\"br-button\"\n shape=\"circle\"\n aria-label=\"botão de ação do ícone\"\n onClick={this.type === 'password' ? this.togglePasswordVisibility : undefined}\n >\n {!this.hasIcon && <div>{this.renderIconSlot()}</div>}\n </br-button>\n )}\n {this.renderHelpText()}\n </div>\n </Host>\n )\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"input.js","sourceRoot":"","sources":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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 *\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: HTMLElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Identificador único do campo de entrada.\n * Caso não seja fornecido, um ID gerado automaticamente será usado.\n */\n @Prop({ reflect: true }) defaultID: 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 | '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 * Se definido como verdadeiro, o input receberá foco automaticamente ao ser renderizado.\n */\n @Prop({ reflect: true }) autofocus: boolean = false\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 exibirá um ícone. Utilize o slot `icon` para definir o ícone.\n */\n @Prop({ reflect: true }) hasIcon: boolean = false\n\n /**\n * Se verdadeiro, um botão será exibido à direita do input.\n */\n @Prop({ reflect: true }) hasRightButton: boolean = false\n\n /**\n * Se verdadeiro, o input terá destaque visual.\n */\n @Prop({ reflect: true }) isHighlight: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de validação bem-sucedido.\n */\n @Prop({ reflect: true }) success: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de validação com erro.\n */\n @Prop({ reflect: true }) danger: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado informativo.\n */\n @Prop({ reflect: true }) info: boolean = false\n\n /**\n * Se verdadeiro, o input indica um estado de alerta.\n */\n @Prop({ reflect: true }) warning: boolean = false\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() _showIconTextPassword: boolean = false\n\n /**\n * Emite um evento quando o componente é conectado ao DOM.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes.\n */\n @Event() brDidConnect: EventEmitter<void>\n connectedCallback() {\n this.brDidConnect.emit()\n }\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 /**\n * Emite um evento após o componente ter sido carregado pela primeira vez.\n * Utilize este evento para realizar ações que devem ocorrer depois que o componente foi totalmente carregado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes.\n */\n @Event() brDidLoad: EventEmitter<void>\n componentDidLoad() {\n this.brDidLoad.emit()\n }\n\n /**\n * Emite um evento antes do componente ser renderizado.\n * Utilize este evento para preparar o componente antes de sua renderização.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes.\n */\n @Event() brWillRender: EventEmitter<void>\n componentWillRender() {\n this.brWillRender.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido renderizado.\n * Utilize este evento para executar ações que devem ocorrer após a renderização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes.\n */\n @Event() brDidRender: EventEmitter<void>\n componentDidRender() {\n this.brDidRender.emit()\n }\n\n /**\n * Emite um evento para indicar se o componente deve ser atualizado ou não.\n * Este evento é chamado antes de qualquer atualização do componente para decidir se a atualização deve prosseguir.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes.\n */\n @Event() brShouldUpdate: EventEmitter<void>\n componentShouldUpdate() {\n this.brShouldUpdate.emit()\n }\n\n /**\n * Emite um evento antes de o componente ser atualizado.\n * Utilize este evento para realizar ações preparatórias antes da atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes.\n */\n @Event() brWillUpdate: EventEmitter<void>\n componentWillUpdate() {\n this.brWillUpdate.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido atualizado.\n * Utilize este evento para realizar ações após a atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes.\n */\n @Event() brDidUpdate: EventEmitter<void>\n componentDidUpdate() {\n this.brDidUpdate.emit()\n }\n\n /**\n * Emite um evento quando o componente é desconectado do DOM.\n * Utilize este evento para realizar a limpeza ou outras ações necessárias quando o componente é removido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes.\n */\n @Event() brDidDisconnect: EventEmitter<void>\n disconnectedCallback() {\n this.brDidDisconnect.emit()\n }\n\n /**\n * Emite um evento quando o componente é associado ou removido de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formassociatedcallback) para mais detalhes.\n *\n * @param form - Dados do formulário associado.\n */\n @Event() brFormAssociatedCallback: EventEmitter<FormData>\n formAssociatedCallback(form: FormData) {\n this.brFormAssociatedCallback.emit(form)\n }\n\n /**\n * Emite um evento quando o estado `disabled` do componente muda dentro de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formdisabledcallback) para mais informações.\n *\n * @param disabled - Novo estado `disabled` do componente dentro do formulário.\n */\n @Event() brFormDisabledCallback: EventEmitter<boolean>\n formDisabledCallback(disabled: boolean) {\n this.brFormDisabledCallback.emit(disabled)\n }\n\n /**\n * Emite um evento quando um `<form>` é resetado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formresetcallback) para mais detalhes.\n */\n @Event() brFormResetCallback: EventEmitter<void>\n formResetCallback() {\n this.brFormResetCallback.emit()\n }\n\n /**\n * Emite um evento quando o navegador preenche automaticamente os campos de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formstaterestorecallback) para mais informações.\n *\n * @param state - Estado restaurado do formulário.\n * @param _mode - Modo de preenchimento automático do navegador.\n */\n @Event() brFormStateRestoreCallback: EventEmitter<[state: string, _mode: string]>\n formStateRestoreCallback(state: string, _mode: string) {\n this.brFormStateRestoreCallback.emit([state, _mode])\n }\n\n private getInputCssClassMap(): CssClassMap {\n return {\n 'br-input': true,\n 'input-button': this.hasRightButton,\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.success,\n danger: this.danger,\n info: this.info,\n warning: this.warning,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n /**\n * Valor atualizado do input\n */\n @Event() valueChange!: EventEmitter<string>\n\n private handleInput(event: Event) {\n this.value = (event.target as HTMLInputElement).value\n this.valueChange.emit(this.value)\n }\n\n renderLabel = () => {\n if (this.label) {\n return (\n <label htmlFor={this.defaultID} class=\"text-nowrap\">\n {this.label}\n </label>\n )\n }\n return (\n <label htmlFor={this.defaultID} class=\"text-nowrap\">\n <slot name=\"label\"></slot>\n </label>\n )\n }\n\n togglePasswordVisibility = () => {\n const input = this.el.shadowRoot.querySelector('input')\n input.type = input.type === 'password' ? 'text' : 'password'\n this._showIconTextPassword = input.type === 'password'\n }\n\n private hasSlotContent(slotName: string): boolean {\n return !!this.el.querySelector(`[slot=\"${slotName}\"]`)\n }\n\n renderInput = () => {\n return (\n <input\n id={this.defaultID}\n autocomplete={this.autocomplete}\n autofocus={this.autofocus}\n disabled={this.disabled}\n onInput={this.handleInput.bind(this)}\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 renderHelpText = () => {\n if (this.helpText) {\n return <p>{this.helpText}</p>\n }\n\n return <slot name=\"help-text\"></slot>\n }\n\n renderIconPassword = () => {\n const showPassword = !this._showIconTextPassword\n return <br-icon icon-name={showPassword ? 'fa-solid:eye' : 'fa-solid:eye-slash'}></br-icon>\n }\n\n renderIconSlot() {\n if (this.hasSlotContent('hasIcon')) {\n return <slot name=\"icon\"></slot>\n } else if (this.hasSlotContent('action')) {\n return <slot name=\"action\"></slot>\n } else {\n return this.renderIconPassword()\n }\n }\n\n render() {\n return (\n <Host>\n <div class={this.getInputCssClassMap()}>\n <div class={`input-label ${this.isInline ? 'inline-label' : ''}`}>{this.renderLabel()}</div>\n {this.hasIcon ? (\n <div class=\"input-group\">\n <div class=\"input-icon\">\n <slot name=\"icon\"></slot>\n </div>\n {this.renderInput()}\n </div>\n ) : (\n this.renderInput()\n )}\n\n {this.hasRightButton && (\n <br-button\n class=\"br-button\"\n shape=\"circle\"\n aria-label=\"botão de ação do ícone\"\n onClick={this.type === 'password' ? this.togglePasswordVisibility : undefined}\n >\n {!this.hasIcon && <div>{this.renderIconSlot()}</div>}\n </br-button>\n )}\n {this.renderHelpText()}\n </div>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -20,7 +20,7 @@ export class Item {
|
|
|
20
20
|
this._selectedValue = false;
|
|
21
21
|
}
|
|
22
22
|
connectedCallback() {
|
|
23
|
-
this.brDidConnect.emit(
|
|
23
|
+
this.brDidConnect.emit();
|
|
24
24
|
}
|
|
25
25
|
componentWillLoad() {
|
|
26
26
|
this.hasSlotContentDefault();
|
|
@@ -28,29 +28,28 @@ export class Item {
|
|
|
28
28
|
if (this.isButton) {
|
|
29
29
|
this.type = this.type || 'button';
|
|
30
30
|
}
|
|
31
|
-
this.brWillLoad.emit(
|
|
31
|
+
this.brWillLoad.emit();
|
|
32
32
|
}
|
|
33
33
|
componentDidLoad() {
|
|
34
|
-
this.brDidLoad.emit(
|
|
34
|
+
this.brDidLoad.emit();
|
|
35
35
|
}
|
|
36
36
|
componentWillRender() {
|
|
37
|
-
this.brWillRender.emit(
|
|
37
|
+
this.brWillRender.emit();
|
|
38
38
|
}
|
|
39
39
|
componentDidRender() {
|
|
40
|
-
this.brDidRender.emit(
|
|
40
|
+
this.brDidRender.emit();
|
|
41
41
|
}
|
|
42
42
|
componentShouldUpdate() {
|
|
43
|
-
this.brShouldUpdate.emit(
|
|
43
|
+
this.brShouldUpdate.emit();
|
|
44
44
|
}
|
|
45
45
|
componentWillUpdate() {
|
|
46
|
-
this.brWillUpdate.emit(
|
|
46
|
+
this.brWillUpdate.emit();
|
|
47
47
|
}
|
|
48
48
|
componentDidUpdate() {
|
|
49
|
-
this.brDidUpdate.emit(
|
|
49
|
+
this.brDidUpdate.emit();
|
|
50
50
|
}
|
|
51
51
|
disconnectedCallback() {
|
|
52
|
-
|
|
53
|
-
this.brDidDisconnect.emit(this);
|
|
52
|
+
this.brDidDisconnect.emit();
|
|
54
53
|
}
|
|
55
54
|
formAssociatedCallback(form) {
|
|
56
55
|
this.brFormAssociatedCallback.emit(form);
|
|
@@ -86,9 +85,7 @@ export class Item {
|
|
|
86
85
|
}
|
|
87
86
|
getAttributes() {
|
|
88
87
|
const TagType = this.getTagType();
|
|
89
|
-
const baseAttributes = TagType === 'button'
|
|
90
|
-
? { type: this.type, value: this.value }
|
|
91
|
-
: { href: this.href, target: this.target };
|
|
88
|
+
const baseAttributes = TagType === 'button' ? { type: this.type, value: this.value } : { href: this.href, target: this.target };
|
|
92
89
|
return Object.assign(Object.assign(Object.assign({}, baseAttributes), { 'aria-disabled': this.disabled ? 'true' : null, 'aria-selected': this._selectedValue ? 'true' : null, 'aria-current': this.isActive ? 'true' : null, 'data-toggle': this.isInteractive }), this.inheritedAttributes);
|
|
93
90
|
}
|
|
94
91
|
handleClick(event) {
|
|
@@ -108,7 +105,7 @@ export class Item {
|
|
|
108
105
|
const TagType = this.getTagType();
|
|
109
106
|
const attributes = this.getAttributes();
|
|
110
107
|
const classList = this.getCssClassMap();
|
|
111
|
-
return (h(Host, { key: '
|
|
108
|
+
return (h(Host, { key: '8815a909fd53970f09583f4f627bc5481df0ae26' }, h(TagType, Object.assign({ key: '1a1754034eec33d5e18a1e79f6efd6401594ad56', class: classList }, attributes, { onClick: (event) => this.handleClick(event) }), h("slot", { key: '5a18ca36d3dd9d5f79850fbb1f975ec014747449' }))));
|
|
112
109
|
}
|
|
113
110
|
static get is() { return "br-item"; }
|
|
114
111
|
static get encapsulation() { return "shadow"; }
|
|
@@ -333,8 +330,8 @@ export class Item {
|
|
|
333
330
|
"text": "Emite um evento quando o componente \u00E9 conectado ao DOM.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes."
|
|
334
331
|
},
|
|
335
332
|
"complexType": {
|
|
336
|
-
"original": "
|
|
337
|
-
"resolved": "
|
|
333
|
+
"original": "void",
|
|
334
|
+
"resolved": "void",
|
|
338
335
|
"references": {}
|
|
339
336
|
}
|
|
340
337
|
}, {
|
|
@@ -348,8 +345,8 @@ export class Item {
|
|
|
348
345
|
"text": "Emite um evento antes que o componente seja carregado pela primeira vez.\nUtilize este evento para realizar tarefas de inicializa\u00E7\u00E3o antes do componente ser exibido.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillload) para mais detalhes."
|
|
349
346
|
},
|
|
350
347
|
"complexType": {
|
|
351
|
-
"original": "
|
|
352
|
-
"resolved": "
|
|
348
|
+
"original": "void",
|
|
349
|
+
"resolved": "void",
|
|
353
350
|
"references": {}
|
|
354
351
|
}
|
|
355
352
|
}, {
|
|
@@ -363,8 +360,8 @@ export class Item {
|
|
|
363
360
|
"text": "Emite um evento ap\u00F3s o componente ter sido carregado pela primeira vez.\nUtilize este evento para realizar a\u00E7\u00F5es que devem ocorrer depois que o componente foi totalmente carregado.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes."
|
|
364
361
|
},
|
|
365
362
|
"complexType": {
|
|
366
|
-
"original": "
|
|
367
|
-
"resolved": "
|
|
363
|
+
"original": "void",
|
|
364
|
+
"resolved": "void",
|
|
368
365
|
"references": {}
|
|
369
366
|
}
|
|
370
367
|
}, {
|
|
@@ -378,8 +375,8 @@ export class Item {
|
|
|
378
375
|
"text": "Emite um evento antes do componente ser renderizado.\nUtilize este evento para preparar o componente antes de sua renderiza\u00E7\u00E3o.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes."
|
|
379
376
|
},
|
|
380
377
|
"complexType": {
|
|
381
|
-
"original": "
|
|
382
|
-
"resolved": "
|
|
378
|
+
"original": "void",
|
|
379
|
+
"resolved": "void",
|
|
383
380
|
"references": {}
|
|
384
381
|
}
|
|
385
382
|
}, {
|
|
@@ -393,8 +390,8 @@ export class Item {
|
|
|
393
390
|
"text": "Emite um evento ap\u00F3s o componente ter sido renderizado.\nUtilize este evento para executar a\u00E7\u00F5es que devem ocorrer ap\u00F3s a renderiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes."
|
|
394
391
|
},
|
|
395
392
|
"complexType": {
|
|
396
|
-
"original": "
|
|
397
|
-
"resolved": "
|
|
393
|
+
"original": "void",
|
|
394
|
+
"resolved": "void",
|
|
398
395
|
"references": {}
|
|
399
396
|
}
|
|
400
397
|
}, {
|
|
@@ -408,8 +405,8 @@ export class Item {
|
|
|
408
405
|
"text": "Emite um evento para indicar se o componente deve ser atualizado ou n\u00E3o.\nEste evento \u00E9 chamado antes de qualquer atualiza\u00E7\u00E3o do componente para decidir se a atualiza\u00E7\u00E3o deve prosseguir.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes."
|
|
409
406
|
},
|
|
410
407
|
"complexType": {
|
|
411
|
-
"original": "
|
|
412
|
-
"resolved": "
|
|
408
|
+
"original": "void",
|
|
409
|
+
"resolved": "void",
|
|
413
410
|
"references": {}
|
|
414
411
|
}
|
|
415
412
|
}, {
|
|
@@ -423,8 +420,8 @@ export class Item {
|
|
|
423
420
|
"text": "Emite um evento antes de o componente ser atualizado.\nUtilize este evento para realizar a\u00E7\u00F5es preparat\u00F3rias antes da atualiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes."
|
|
424
421
|
},
|
|
425
422
|
"complexType": {
|
|
426
|
-
"original": "
|
|
427
|
-
"resolved": "
|
|
423
|
+
"original": "void",
|
|
424
|
+
"resolved": "void",
|
|
428
425
|
"references": {}
|
|
429
426
|
}
|
|
430
427
|
}, {
|
|
@@ -438,8 +435,8 @@ export class Item {
|
|
|
438
435
|
"text": "Emite um evento ap\u00F3s o componente ter sido atualizado.\nUtilize este evento para realizar a\u00E7\u00F5es ap\u00F3s a atualiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes."
|
|
439
436
|
},
|
|
440
437
|
"complexType": {
|
|
441
|
-
"original": "
|
|
442
|
-
"resolved": "
|
|
438
|
+
"original": "void",
|
|
439
|
+
"resolved": "void",
|
|
443
440
|
"references": {}
|
|
444
441
|
}
|
|
445
442
|
}, {
|
|
@@ -453,8 +450,8 @@ export class Item {
|
|
|
453
450
|
"text": "Emite um evento quando o componente \u00E9 desconectado do DOM.\nUtilize este evento para realizar a limpeza ou outras a\u00E7\u00F5es necess\u00E1rias quando o componente \u00E9 removido.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes."
|
|
454
451
|
},
|
|
455
452
|
"complexType": {
|
|
456
|
-
"original": "
|
|
457
|
-
"resolved": "
|
|
453
|
+
"original": "void",
|
|
454
|
+
"resolved": "void",
|
|
458
455
|
"references": {}
|
|
459
456
|
}
|
|
460
457
|
}, {
|
|
@@ -509,8 +506,8 @@ export class Item {
|
|
|
509
506
|
"text": "Emite um evento quando um `<form>` \u00E9 resetado.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/form-associated#formresetcallback) para mais detalhes."
|
|
510
507
|
},
|
|
511
508
|
"complexType": {
|
|
512
|
-
"original": "
|
|
513
|
-
"resolved": "
|
|
509
|
+
"original": "void",
|
|
510
|
+
"resolved": "void",
|
|
514
511
|
"references": {}
|
|
515
512
|
}
|
|
516
513
|
}, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../src/components/item/item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAI1G;;;;GAIG;AAOH,MAAM,OAAO,IAAI;;QA2OP,wBAAmB,GAAe,EAAE,CAAA;wBA/NC,KAAK;wBAMU,KAAK;0BAMH,KAAK;6BAKF,KAAK;;;wBAmBzB,KAAK;;;4BAgBjB,KAAK;8BAGH,KAAK;;IAuBxC,iBAAiB;QACf,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC9B,CAAC;IAQD,iBAAiB;QACf,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAA;QACrC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAC;QACpC,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC;IAQD,gBAAgB;QACd,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAQD,mBAAmB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI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AE,CAAC,CAAA;QAC1D,CAAC;QACD,KAAK,CAAC,eAAe,EAAE,CAAA;IACzB,CAAC;IAED,MAAM;QACJ,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,EAAE,CAAA;QACjC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACvC,OAAO,CACL,EAAC,IAAI;YACH,EAAC,OAAO,mEAAC,KAAK,EAAE,SAAS,IAAM,UAAU,IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;gBACpF,8DAAa,CACL,CACL,CACR,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core'\nimport { Attributes } 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/item?tab=designer).\n *\n * @slot default - Área de conteúdo, podendo conter qualquer componente, exceto botões primários e componentes relacionados à navegação (como carrosséis, paginações, abas, menus, etc.).\n */\n @Component({\n tag: 'br-item',\n styleUrl: 'item.scss',\n shadow: true,\n formAssociated: true,\n })\n export class Item {\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: HTMLElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Desativa o item, tornando-o não interativo.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /**\n * Indica se o item está no estado ativo.\n * Se definido como verdadeiro, o item será exibido como ativo.\n */\n @Prop({ reflect: true, mutable: true }) isActive: boolean = false\n\n /**\n * Indica se o item está no estado selecionado.\n * Se definido como verdadeiro, o item será exibido como selecionado.\n */\n @Prop({ reflect: true, mutable: true }) isSelected: boolean = false\n\n /**\n * Marca o item como interativo, permitindo que toda a superfície do item seja clicável.\n */\n @Prop({ reflect: true, mutable: true }) isInteractive: boolean = false\n\n /**\n * URL ou caminho para o qual o usuário será direcionado ao clicar no item. Quando definido, o item será renderizado como um link.\n */\n @Prop({ reflect: true }) href?: string\n\n /**\n * Define o alvo do link quando `href` está presente. Pode ser:\n * - `_blank` para abrir em uma nova aba,\n * - `_self` para abrir na mesma aba,\n * - `_parent` para abrir na aba pai,\n * - `_top` para abrir na aba superior.\n */\n @Prop({ reflect: true }) target?: '_blank' | '_self' | '_parent' | '_top'\n\n /**\n * Quando definido como `true`, o item será tratado como um botão.\n */\n @Prop({ reflect: true }) isButton: boolean = false\n\n /**\n * Tipo do botão, aplicável apenas se `isButton` for `true`. Pode ser:\n * - `'submit'` para enviar um formulário,\n * - `'reset'` para redefinir um formulário,\n * - `'button'` para um botão padrão.\n */\n @Prop({ reflect: true, mutable: true }) type: 'submit' | 'reset' | 'button'\n\n /**\n * Define um valor associado ao br-item quando renderizado como um botão, utilizado em contextos de formulário.\n */\n @Prop({ reflect: true }) value?: string\n\n // Propriedade interna para verificar a presença de conteúdo no slot default\n @State() _slotDefault: boolean = false\n\n // Propriedade interna para armazenar o valor selecionado\n @State() _selectedValue: boolean = false\n\n /**\n * Evento customizado emitido quando o item é clicado, aplicável apenas se o item for um botão (`<button>`).\n * Pode ser utilizado para ações personalizadas, exceto quando o item está desativado.\n */\n @Event({\n eventName: 'brDidClick',\n composed: true,\n cancelable: true,\n bubbles: true,\n }) brDidClick: EventEmitter\n\n /**\n * Evento customizado aplicável para todos os tipos de elementos (`div`, `button`, `a`), emitido quando o item é selecionado e desde que a propriedade `isInteractive` esteja presente.\n */\n @Event({ bubbles: true, composed: true }) brDidSelect: EventEmitter<{ selected: boolean }>\n\n /**\n * Emite um evento quando o componente é conectado ao DOM.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes.\n */\n @Event() brDidConnect: EventEmitter<this>\n connectedCallback() {\n this.brDidConnect.emit(this)\n }\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<this>\n componentWillLoad() {\n this.hasSlotContentDefault()\n this._selectedValue = this.isSelected\n if (this.isButton) {\n this.type = this.type || 'button';\n }\n this.brWillLoad.emit(this)\n }\n\n /**\n * Emite um evento após o componente ter sido carregado pela primeira vez.\n * Utilize este evento para realizar ações que devem ocorrer depois que o componente foi totalmente carregado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes.\n */\n @Event() brDidLoad: EventEmitter<this>\n componentDidLoad() {\n this.brDidLoad.emit(this)\n }\n\n /**\n * Emite um evento antes do componente ser renderizado.\n * Utilize este evento para preparar o componente antes de sua renderização.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes.\n */\n @Event() brWillRender: EventEmitter<this>\n componentWillRender() {\n this.brWillRender.emit(this)\n }\n\n /**\n * Emite um evento após o componente ter sido renderizado.\n * Utilize este evento para executar ações que devem ocorrer após a renderização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes.\n */\n @Event() brDidRender: EventEmitter<this>\n componentDidRender() {\n this.brDidRender.emit(this)\n }\n\n /**\n * Emite um evento para indicar se o componente deve ser atualizado ou não.\n * Este evento é chamado antes de qualquer atualização do componente para decidir se a atualização deve prosseguir.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes.\n */\n @Event() brShouldUpdate: EventEmitter<this>\n componentShouldUpdate() {\n this.brShouldUpdate.emit(this)\n }\n\n /**\n * Emite um evento antes de o componente ser atualizado.\n * Utilize este evento para realizar ações preparatórias antes da atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes.\n */\n @Event() brWillUpdate: EventEmitter<this>\n componentWillUpdate() {\n this.brWillUpdate.emit(this)\n }\n\n /**\n * Emite um evento após o componente ter sido atualizado.\n * Utilize este evento para realizar ações após a atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes.\n */\n @Event() brDidUpdate: EventEmitter<this>\n componentDidUpdate() {\n this.brDidUpdate.emit(this)\n }\n\n /**\n * Emite um evento quando o componente é desconectado do DOM.\n * Utilize este evento para realizar a limpeza ou outras ações necessárias quando o componente é removido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes.\n */\n @Event() brDidDisconnect: EventEmitter<this>\n disconnectedCallback() {\n if (this.el.isConnected) this.brDidDisconnect.emit(this)\n }\n\n /**\n * Emite um evento quando o componente é associado ou removido de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formassociatedcallback) para mais detalhes.\n *\n * @param form - Dados do formulário associado.\n */\n @Event() brFormAssociatedCallback: EventEmitter<FormData>\n formAssociatedCallback(form: FormData) {\n this.brFormAssociatedCallback.emit(form)\n }\n\n /**\n * Emite um evento quando o estado `disabled` do componente muda dentro de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formdisabledcallback) para mais informações.\n *\n * @param disabled - Novo estado `disabled` do componente dentro do formulário.\n */\n @Event() brFormDisabledCallback: EventEmitter<boolean>\n formDisabledCallback(disabled: boolean) {\n this.brFormDisabledCallback.emit(disabled)\n }\n\n /**\n * Emite um evento quando um `<form>` é resetado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formresetcallback) para mais detalhes.\n */\n @Event() brFormResetCallback: EventEmitter\n formResetCallback() {\n this.brFormResetCallback.emit()\n }\n\n /**\n * Emite um evento quando o navegador preenche automaticamente os campos de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formstaterestorecallback) para mais informações.\n *\n * @param state - Estado restaurado do formulário.\n * @param _mode - Modo de preenchimento automático do navegador.\n */\n @Event() brFormStateRestoreCallback: EventEmitter<[state: string, _mode: string]>\n formStateRestoreCallback(state: string, _mode: string) {\n this.brFormStateRestoreCallback.emit([state, _mode])\n }\n\n private hasSlotContentDefault(): any {\n this._slotDefault = this.el.innerHTML !== ''\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-item': true,\n disabled: this.disabled,\n active: this.isActive,\n selected: this._selectedValue,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n private getTagType(): string {\n if (this.isButton) {\n return 'button'\n }\n if (this.href) {\n return 'a'\n }\n return 'div'\n }\n\n private getAttributes() {\n const TagType = this.getTagType()\n const baseAttributes = TagType === 'button'\n ? { type: this.type, value: this.value }\n : { href: this.href, target: this.target }\n\n return {\n ...baseAttributes,\n 'aria-disabled': this.disabled ? 'true' : null,\n 'aria-selected': this._selectedValue ? 'true' : null,\n 'aria-current': this.isActive ? 'true' : null,\n 'data-toggle': this.isInteractive,\n ...this.inheritedAttributes,\n }\n }\n\n private handleClick(event: MouseEvent) {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n\n if (this.isButton) {\n this.brDidClick.emit()\n } else if (this.isInteractive) {\n this.brDidSelect.emit({ selected: this._selectedValue })\n }\n event.stopPropagation()\n }\n\n render() {\n const TagType = this.getTagType()\n const attributes = this.getAttributes()\n const classList = this.getCssClassMap()\n return (\n <Host>\n <TagType class={classList} {...attributes} onClick={(event) => this.handleClick(event)}>\n <slot></slot>\n </TagType>\n </Host>\n )\n }\n }\n"]}
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../src/components/item/item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAI9G;;;;GAIG;AAOH,MAAM,OAAO,IAAI;;QA4OP,wBAAmB,GAAe,EAAE,CAAA;wBAhOC,KAAK;wBAMU,KAAK;0BAMH,KAAK;6BAKF,KAAK;;;wBAmBzB,KAAK;;;4BAgBjB,KAAK;8BAGH,KAAK;;IAwBxC,iBAAiB;QACf,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;IAQD,iBAAiB;QACf,IAAI,CAAC,qBAAqB,EAAE,CAAA;QAC5B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAA;QACrC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,QAAQ,CAAA;QACnC,CAAC;QACD,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAA;IACxB,CAAC;IAQD,gBAAgB;QACd,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,CAAA;IACvB,CAAC;IAQD,mBAAmB;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;IAQD,kBAAk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jC,MAAM,UAAU,GAAG,IAAI,CAAC,aAAa,EAAE,CAAA;QACvC,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;QACvC,OAAO,CACL,EAAC,IAAI;YACH,EAAC,OAAO,mEAAC,KAAK,EAAE,SAAS,IAAM,UAAU,IAAE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;gBACpF,8DAAa,CACL,CACL,CACR,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Element, Event, EventEmitter, Host, Prop, State, h } from '@stencil/core'\nimport { Attributes } 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/item?tab=designer).\n *\n * @slot default - Área de conteúdo, podendo conter qualquer componente, exceto botões primários e componentes relacionados à navegação (como carrosséis, paginações, abas, menus, etc.).\n */\n@Component({\n tag: 'br-item',\n styleUrl: 'item.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Item {\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: HTMLElement\n\n @AttachInternals() elementInternals: ElementInternals\n\n /**\n * Desativa o item, tornando-o não interativo.\n */\n @Prop({ reflect: true }) disabled: boolean = false\n\n /**\n * Indica se o item está no estado ativo.\n * Se definido como verdadeiro, o item será exibido como ativo.\n */\n @Prop({ reflect: true, mutable: true }) isActive: boolean = false\n\n /**\n * Indica se o item está no estado selecionado.\n * Se definido como verdadeiro, o item será exibido como selecionado.\n */\n @Prop({ reflect: true, mutable: true }) isSelected: boolean = false\n\n /**\n * Marca o item como interativo, permitindo que toda a superfície do item seja clicável.\n */\n @Prop({ reflect: true, mutable: true }) isInteractive: boolean = false\n\n /**\n * URL ou caminho para o qual o usuário será direcionado ao clicar no item. Quando definido, o item será renderizado como um link.\n */\n @Prop({ reflect: true }) href?: string\n\n /**\n * Define o alvo do link quando `href` está presente. Pode ser:\n * - `_blank` para abrir em uma nova aba,\n * - `_self` para abrir na mesma aba,\n * - `_parent` para abrir na aba pai,\n * - `_top` para abrir na aba superior.\n */\n @Prop({ reflect: true }) target?: '_blank' | '_self' | '_parent' | '_top'\n\n /**\n * Quando definido como `true`, o item será tratado como um botão.\n */\n @Prop({ reflect: true }) isButton: boolean = false\n\n /**\n * Tipo do botão, aplicável apenas se `isButton` for `true`. Pode ser:\n * - `'submit'` para enviar um formulário,\n * - `'reset'` para redefinir um formulário,\n * - `'button'` para um botão padrão.\n */\n @Prop({ reflect: true, mutable: true }) type: 'submit' | 'reset' | 'button'\n\n /**\n * Define um valor associado ao br-item quando renderizado como um botão, utilizado em contextos de formulário.\n */\n @Prop({ reflect: true }) value?: string\n\n // Propriedade interna para verificar a presença de conteúdo no slot default\n @State() _slotDefault: boolean = false\n\n // Propriedade interna para armazenar o valor selecionado\n @State() _selectedValue: boolean = false\n\n /**\n * Evento customizado emitido quando o item é clicado, aplicável apenas se o item for um botão (`<button>`).\n * Pode ser utilizado para ações personalizadas, exceto quando o item está desativado.\n */\n @Event({\n eventName: 'brDidClick',\n composed: true,\n cancelable: true,\n bubbles: true,\n })\n brDidClick: EventEmitter\n\n /**\n * Evento customizado aplicável para todos os tipos de elementos (`div`, `button`, `a`), emitido quando o item é selecionado e desde que a propriedade `isInteractive` esteja presente.\n */\n @Event({ bubbles: true, composed: true }) brDidSelect: EventEmitter<{ selected: boolean }>\n\n /**\n * Emite um evento quando o componente é conectado ao DOM.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes.\n */\n @Event() brDidConnect: EventEmitter<void>\n connectedCallback() {\n this.brDidConnect.emit()\n }\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.hasSlotContentDefault()\n this._selectedValue = this.isSelected\n if (this.isButton) {\n this.type = this.type || 'button'\n }\n this.brWillLoad.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido carregado pela primeira vez.\n * Utilize este evento para realizar ações que devem ocorrer depois que o componente foi totalmente carregado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes.\n */\n @Event() brDidLoad: EventEmitter<void>\n componentDidLoad() {\n this.brDidLoad.emit()\n }\n\n /**\n * Emite um evento antes do componente ser renderizado.\n * Utilize este evento para preparar o componente antes de sua renderização.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes.\n */\n @Event() brWillRender: EventEmitter<void>\n componentWillRender() {\n this.brWillRender.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido renderizado.\n * Utilize este evento para executar ações que devem ocorrer após a renderização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes.\n */\n @Event() brDidRender: EventEmitter<void>\n componentDidRender() {\n this.brDidRender.emit()\n }\n\n /**\n * Emite um evento para indicar se o componente deve ser atualizado ou não.\n * Este evento é chamado antes de qualquer atualização do componente para decidir se a atualização deve prosseguir.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes.\n */\n @Event() brShouldUpdate: EventEmitter<void>\n componentShouldUpdate() {\n this.brShouldUpdate.emit()\n }\n\n /**\n * Emite um evento antes de o componente ser atualizado.\n * Utilize este evento para realizar ações preparatórias antes da atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes.\n */\n @Event() brWillUpdate: EventEmitter<void>\n componentWillUpdate() {\n this.brWillUpdate.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido atualizado.\n * Utilize este evento para realizar ações após a atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes.\n */\n @Event() brDidUpdate: EventEmitter<void>\n componentDidUpdate() {\n this.brDidUpdate.emit()\n }\n\n /**\n * Emite um evento quando o componente é desconectado do DOM.\n * Utilize este evento para realizar a limpeza ou outras ações necessárias quando o componente é removido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes.\n */\n @Event() brDidDisconnect: EventEmitter<void>\n disconnectedCallback() {\n this.brDidDisconnect.emit()\n }\n\n /**\n * Emite um evento quando o componente é associado ou removido de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formassociatedcallback) para mais detalhes.\n *\n * @param form - Dados do formulário associado.\n */\n @Event() brFormAssociatedCallback: EventEmitter<FormData>\n formAssociatedCallback(form: FormData) {\n this.brFormAssociatedCallback.emit(form)\n }\n\n /**\n * Emite um evento quando o estado `disabled` do componente muda dentro de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formdisabledcallback) para mais informações.\n *\n * @param disabled - Novo estado `disabled` do componente dentro do formulário.\n */\n @Event() brFormDisabledCallback: EventEmitter<boolean>\n formDisabledCallback(disabled: boolean) {\n this.brFormDisabledCallback.emit(disabled)\n }\n\n /**\n * Emite um evento quando um `<form>` é resetado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formresetcallback) para mais detalhes.\n */\n @Event() brFormResetCallback: EventEmitter<void>\n formResetCallback() {\n this.brFormResetCallback.emit()\n }\n\n /**\n * Emite um evento quando o navegador preenche automaticamente os campos de um `<form>`.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/form-associated#formstaterestorecallback) para mais informações.\n *\n * @param state - Estado restaurado do formulário.\n * @param _mode - Modo de preenchimento automático do navegador.\n */\n @Event() brFormStateRestoreCallback: EventEmitter<[state: string, _mode: string]>\n formStateRestoreCallback(state: string, _mode: string) {\n this.brFormStateRestoreCallback.emit([state, _mode])\n }\n\n private hasSlotContentDefault(): any {\n this._slotDefault = this.el.innerHTML !== ''\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-item': true,\n disabled: this.disabled,\n active: this.isActive,\n selected: this._selectedValue,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n private getTagType(): string {\n if (this.isButton) {\n return 'button'\n }\n if (this.href) {\n return 'a'\n }\n return 'div'\n }\n\n private getAttributes() {\n const TagType = this.getTagType()\n const baseAttributes =\n TagType === 'button' ? { type: this.type, value: this.value } : { href: this.href, target: this.target }\n\n return {\n ...baseAttributes,\n 'aria-disabled': this.disabled ? 'true' : null,\n 'aria-selected': this._selectedValue ? 'true' : null,\n 'aria-current': this.isActive ? 'true' : null,\n 'data-toggle': this.isInteractive,\n ...this.inheritedAttributes,\n }\n }\n\n private handleClick(event: MouseEvent) {\n if (this.disabled) {\n event.preventDefault()\n event.stopPropagation()\n }\n\n if (this.isButton) {\n this.brDidClick.emit()\n } else if (this.isInteractive) {\n this.brDidSelect.emit({ selected: this._selectedValue })\n }\n event.stopPropagation()\n }\n\n render() {\n const TagType = this.getTagType()\n const attributes = this.getAttributes()\n const classList = this.getCssClassMap()\n return (\n <Host>\n <TagType class={classList} {...attributes} onClick={(event) => this.handleClick(event)}>\n <slot></slot>\n </TagType>\n </Host>\n )\n }\n}\n"]}
|
|
@@ -12,33 +12,32 @@ export class Loading {
|
|
|
12
12
|
this.label = '';
|
|
13
13
|
}
|
|
14
14
|
connectedCallback() {
|
|
15
|
-
this.brDidConnect.emit(
|
|
15
|
+
this.brDidConnect.emit();
|
|
16
16
|
}
|
|
17
17
|
componentWillLoad() {
|
|
18
|
-
this.brWillLoad.emit(
|
|
18
|
+
this.brWillLoad.emit();
|
|
19
19
|
this.inheritedAttributes = inheritAriaAttributes(this.el);
|
|
20
20
|
}
|
|
21
21
|
componentDidLoad() {
|
|
22
|
-
this.brDidLoad.emit(
|
|
22
|
+
this.brDidLoad.emit();
|
|
23
23
|
}
|
|
24
24
|
componentWillRender() {
|
|
25
|
-
this.brWillRender.emit(
|
|
25
|
+
this.brWillRender.emit();
|
|
26
26
|
}
|
|
27
27
|
componentDidRender() {
|
|
28
|
-
this.brDidRender.emit(
|
|
28
|
+
this.brDidRender.emit();
|
|
29
29
|
}
|
|
30
30
|
componentShouldUpdate() {
|
|
31
|
-
this.brShouldUpdate.emit(
|
|
31
|
+
this.brShouldUpdate.emit();
|
|
32
32
|
}
|
|
33
33
|
componentWillUpdate() {
|
|
34
|
-
this.brWillUpdate.emit(
|
|
34
|
+
this.brWillUpdate.emit();
|
|
35
35
|
}
|
|
36
36
|
componentDidUpdate() {
|
|
37
|
-
this.brDidUpdate.emit(
|
|
37
|
+
this.brDidUpdate.emit();
|
|
38
38
|
}
|
|
39
39
|
disconnectedCallback() {
|
|
40
|
-
|
|
41
|
-
this.brDidDisconnect.emit(this);
|
|
40
|
+
this.brDidDisconnect.emit();
|
|
42
41
|
}
|
|
43
42
|
getCssClassMap() {
|
|
44
43
|
return {
|
|
@@ -47,7 +46,7 @@ export class Loading {
|
|
|
47
46
|
};
|
|
48
47
|
}
|
|
49
48
|
render() {
|
|
50
|
-
return (h(Host, { key: '
|
|
49
|
+
return (h(Host, { key: '20af168376f3bd05e3a3c266de2f46c959a4416b' }, this.isProgress ? (h("div", Object.assign({}, this.inheritedAttributes, { class: this.getCssClassMap(), role: "progressbar", "data-progress": this.progressPercent, "aria-label": "Carregando exemplo com porcentagem", "aria-valuemin": "0", "aria-valuenow": this.progressPercent, "aria-valuemax": "100" }), h("div", { class: "br-loading-mask full" }, h("div", { class: "br-loading-fill" })), h("div", { class: "br-loading-mask" }, h("div", { class: "br-loading-fill" })))) : (h("div", { class: "loading-progress-alignment" }, h("div", { class: this.getCssClassMap(), role: "progressbar", "aria-label": "Carregando exemplo indeterminado pequeno" }), h("span", { class: "rotulo" }, this.label)))));
|
|
51
50
|
}
|
|
52
51
|
static get is() { return "br-loading"; }
|
|
53
52
|
static get encapsulation() { return "shadow"; }
|
|
@@ -150,8 +149,8 @@ export class Loading {
|
|
|
150
149
|
"text": "Emite um evento quando o componente \u00E9 conectado ao DOM.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes."
|
|
151
150
|
},
|
|
152
151
|
"complexType": {
|
|
153
|
-
"original": "
|
|
154
|
-
"resolved": "
|
|
152
|
+
"original": "void",
|
|
153
|
+
"resolved": "void",
|
|
155
154
|
"references": {}
|
|
156
155
|
}
|
|
157
156
|
}, {
|
|
@@ -165,8 +164,8 @@ export class Loading {
|
|
|
165
164
|
"text": "Emite um evento antes que o componente seja carregado pela primeira vez.\nUtilize este evento para realizar tarefas de inicializa\u00E7\u00E3o antes do componente ser exibido.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillload) para mais detalhes."
|
|
166
165
|
},
|
|
167
166
|
"complexType": {
|
|
168
|
-
"original": "
|
|
169
|
-
"resolved": "
|
|
167
|
+
"original": "void",
|
|
168
|
+
"resolved": "void",
|
|
170
169
|
"references": {}
|
|
171
170
|
}
|
|
172
171
|
}, {
|
|
@@ -180,8 +179,8 @@ export class Loading {
|
|
|
180
179
|
"text": "Emite um evento ap\u00F3s o componente ter sido carregado pela primeira vez.\nUtilize este evento para realizar a\u00E7\u00F5es que devem ocorrer depois que o componente foi totalmente carregado.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes."
|
|
181
180
|
},
|
|
182
181
|
"complexType": {
|
|
183
|
-
"original": "
|
|
184
|
-
"resolved": "
|
|
182
|
+
"original": "void",
|
|
183
|
+
"resolved": "void",
|
|
185
184
|
"references": {}
|
|
186
185
|
}
|
|
187
186
|
}, {
|
|
@@ -195,8 +194,8 @@ export class Loading {
|
|
|
195
194
|
"text": "Emite um evento antes do componente ser renderizado.\nUtilize este evento para preparar o componente antes de sua renderiza\u00E7\u00E3o.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes."
|
|
196
195
|
},
|
|
197
196
|
"complexType": {
|
|
198
|
-
"original": "
|
|
199
|
-
"resolved": "
|
|
197
|
+
"original": "void",
|
|
198
|
+
"resolved": "void",
|
|
200
199
|
"references": {}
|
|
201
200
|
}
|
|
202
201
|
}, {
|
|
@@ -210,8 +209,8 @@ export class Loading {
|
|
|
210
209
|
"text": "Emite um evento ap\u00F3s o componente ter sido renderizado.\nUtilize este evento para executar a\u00E7\u00F5es que devem ocorrer ap\u00F3s a renderiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes."
|
|
211
210
|
},
|
|
212
211
|
"complexType": {
|
|
213
|
-
"original": "
|
|
214
|
-
"resolved": "
|
|
212
|
+
"original": "void",
|
|
213
|
+
"resolved": "void",
|
|
215
214
|
"references": {}
|
|
216
215
|
}
|
|
217
216
|
}, {
|
|
@@ -225,8 +224,8 @@ export class Loading {
|
|
|
225
224
|
"text": "Emite um evento para indicar se o componente deve ser atualizado ou n\u00E3o.\nEste evento \u00E9 chamado antes de qualquer atualiza\u00E7\u00E3o do componente para decidir se a atualiza\u00E7\u00E3o deve prosseguir.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes."
|
|
226
225
|
},
|
|
227
226
|
"complexType": {
|
|
228
|
-
"original": "
|
|
229
|
-
"resolved": "
|
|
227
|
+
"original": "void",
|
|
228
|
+
"resolved": "void",
|
|
230
229
|
"references": {}
|
|
231
230
|
}
|
|
232
231
|
}, {
|
|
@@ -240,8 +239,8 @@ export class Loading {
|
|
|
240
239
|
"text": "Emite um evento antes de o componente ser atualizado.\nUtilize este evento para realizar a\u00E7\u00F5es preparat\u00F3rias antes da atualiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes."
|
|
241
240
|
},
|
|
242
241
|
"complexType": {
|
|
243
|
-
"original": "
|
|
244
|
-
"resolved": "
|
|
242
|
+
"original": "void",
|
|
243
|
+
"resolved": "void",
|
|
245
244
|
"references": {}
|
|
246
245
|
}
|
|
247
246
|
}, {
|
|
@@ -255,8 +254,8 @@ export class Loading {
|
|
|
255
254
|
"text": "Emite um evento ap\u00F3s o componente ter sido atualizado.\nUtilize este evento para realizar a\u00E7\u00F5es ap\u00F3s a atualiza\u00E7\u00E3o do componente.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes."
|
|
256
255
|
},
|
|
257
256
|
"complexType": {
|
|
258
|
-
"original": "
|
|
259
|
-
"resolved": "
|
|
257
|
+
"original": "void",
|
|
258
|
+
"resolved": "void",
|
|
260
259
|
"references": {}
|
|
261
260
|
}
|
|
262
261
|
}, {
|
|
@@ -270,8 +269,8 @@ export class Loading {
|
|
|
270
269
|
"text": "Emite um evento quando o componente \u00E9 desconectado do DOM.\nUtilize este evento para realizar a limpeza ou outras a\u00E7\u00F5es necess\u00E1rias quando o componente \u00E9 removido.\nConsulte a documenta\u00E7\u00E3o do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes."
|
|
271
270
|
},
|
|
272
271
|
"complexType": {
|
|
273
|
-
"original": "
|
|
274
|
-
"resolved": "
|
|
272
|
+
"original": "void",
|
|
273
|
+
"resolved": "void",
|
|
275
274
|
"references": {}
|
|
276
275
|
}
|
|
277
276
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../src/components/loading/loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGpF;;GAEG;AAOH,MAAM,OAAO,OAAO;;QAgIV,wBAAmB,GAAe,EAAE,CAAA;0BApHG,KAAK;+BAMD,IAAI;wBAKV,KAAK;qBAMT,EAAE;;IAO3C,iBAAiB;QACf,IAAI,CAAC,YAAY,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"loading.js","sourceRoot":"","sources":["../../../src/components/loading/loading.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACtF,OAAO,EAAc,qBAAqB,EAAE,MAAM,kCAAkC,CAAA;AAGpF;;GAEG;AAOH,MAAM,OAAO,OAAO;;QAgIV,wBAAmB,GAAe,EAAE,CAAA;0BApHG,KAAK;+BAMD,IAAI;wBAKV,KAAK;qBAMT,EAAE;;IAO3C,iBAAiB;QACf,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAA;IAC1B,CAAC;IAQD,iBAAiB;QACf,IAAI,CA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AK,EAAC,4BAA4B;YACrC,WACE,KAAK,EAAE,IAAI,CAAC,cAAc,EAAE,EAC5B,IAAI,EAAC,aAAa,gBACP,0CAA0C,GAChD;YACP,YAAM,KAAK,EAAC,QAAQ,IAAE,IAAI,CAAC,KAAK,CAAQ,CACpC,CACP,CACI,CACR,CAAA;IACH,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Event, EventEmitter, h, Host, Prop } from '@stencil/core'\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/loading?tab=designer).\n */\n@Component({\n tag: 'br-loading',\n styleUrl: 'loading.scss',\n shadow: true,\n formAssociated: true,\n})\nexport class Loading {\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: HTMLElement\n\n /**\n * Determina o tipo de indicador a ser exibido:\n * - Se verdadeiro, exibirá uma barra de progresso com a porcentagem de progresso.\n * - Se falso, exibirá um indicador de carregamento indeterminado.\n */\n @Prop({ reflect: true }) isProgress: boolean = false\n\n /**\n * Define a porcentagem de progresso a ser exibida na barra de progresso.\n * Deve ser um valor numérico entre 0 e 100. Ignorado se `isProgress` estiver definido como falso.\n */\n @Prop({ reflect: true }) progressPercent: number = null\n\n /**\n * Se verdadeiro, ajusta o tamanho do indicador de carregamento para o tamanho médio.\n */\n @Prop({ reflect: true }) isMedium: boolean = false\n\n /**\n * Texto a ser exibido abaixo do indicador de carregamento.\n * Pode ser usado para fornecer informações adicionais ou descritivas sobre o estado do carregamento.\n */\n @Prop({ reflect: true }) label: string = ''\n\n /**\n * Emite um evento quando o componente é conectado ao DOM.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#connectedcallback) para mais detalhes.\n */\n @Event() brDidConnect: EventEmitter<void>\n connectedCallback() {\n this.brDidConnect.emit()\n }\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 /**\n * Emite um evento após o componente ter sido carregado pela primeira vez.\n * Utilize este evento para realizar ações que devem ocorrer depois que o componente foi totalmente carregado.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidload) para mais detalhes.\n */\n @Event() brDidLoad: EventEmitter<void>\n componentDidLoad() {\n this.brDidLoad.emit()\n }\n\n /**\n * Emite um evento antes do componente ser renderizado.\n * Utilize este evento para preparar o componente antes de sua renderização.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillrender) para mais detalhes.\n */\n @Event() brWillRender: EventEmitter<void>\n componentWillRender() {\n this.brWillRender.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido renderizado.\n * Utilize este evento para executar ações que devem ocorrer após a renderização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidrender) para mais detalhes.\n */\n @Event() brDidRender: EventEmitter<void>\n componentDidRender() {\n this.brDidRender.emit()\n }\n\n /**\n * Emite um evento para indicar se o componente deve ser atualizado ou não.\n * Este evento é chamado antes de qualquer atualização do componente para decidir se a atualização deve prosseguir.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentshouldupdate) para mais detalhes.\n */\n @Event() brShouldUpdate: EventEmitter<void>\n componentShouldUpdate() {\n this.brShouldUpdate.emit()\n }\n\n /**\n * Emite um evento antes de o componente ser atualizado.\n * Utilize este evento para realizar ações preparatórias antes da atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentwillupdate) para mais detalhes.\n */\n @Event() brWillUpdate: EventEmitter<void>\n componentWillUpdate() {\n this.brWillUpdate.emit()\n }\n\n /**\n * Emite um evento após o componente ter sido atualizado.\n * Utilize este evento para realizar ações após a atualização do componente.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#componentdidupdate) para mais detalhes.\n */\n @Event() brDidUpdate: EventEmitter<void>\n componentDidUpdate() {\n this.brDidUpdate.emit()\n }\n\n /**\n * Emite um evento quando o componente é desconectado do DOM.\n * Utilize este evento para realizar a limpeza ou outras ações necessárias quando o componente é removido.\n * Consulte a documentação do [Stencil](https://stenciljs.com/docs/component-lifecycle#disconnectedcallback) para mais detalhes.\n */\n @Event() brDidDisconnect: EventEmitter<void>\n disconnectedCallback() {\n this.brDidDisconnect.emit()\n }\n\n private getCssClassMap(): CssClassMap {\n return {\n 'br-loading': true,\n medium: this.isMedium,\n }\n }\n\n private inheritedAttributes: Attributes = {}\n\n render() {\n return (\n <Host>\n {this.isProgress ? (\n <div\n {...this.inheritedAttributes}\n class={this.getCssClassMap()}\n role=\"progressbar\"\n data-progress={this.progressPercent}\n aria-label=\"Carregando exemplo com porcentagem\"\n aria-valuemin=\"0\"\n aria-valuenow={this.progressPercent}\n aria-valuemax=\"100\"\n >\n <div class=\"br-loading-mask full\">\n <div class=\"br-loading-fill\"></div>\n </div>\n <div class=\"br-loading-mask\">\n <div class=\"br-loading-fill\"></div>\n </div>\n </div>\n ) : (\n <div class=\"loading-progress-alignment\">\n <div\n class={this.getCssClassMap()}\n role=\"progressbar\"\n aria-label=\"Carregando exemplo indeterminado pequeno\"\n ></div>\n <span class=\"rotulo\">{this.label}</span>\n </div>\n )}\n </Host>\n )\n }\n}\n"]}
|