niris-public-community-components 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,17 +1,50 @@
1
- import{c as r,i as o,n as e,l as t,s as i,t as a,a as n,x as s,m as d}from"./locale-codes-c2f86156.js";var l=function(r,o,e,t){for(var i,a=arguments.length,n=a<3?o:null===t?t=Object.getOwnPropertyDescriptor(o,e):t,s=r.length-1;s>=0;s--)(i=r[s])&&(n=(a<3?i(n):a>3?i(o,e,n):i(o,e))||n);return a>3&&n&&Object.defineProperty(o,e,n),n};const{getLocale:c,setLocale:p}=r({sourceLocale:i,targetLocales:a,loadLocale:r=>import(`./generated/locales/${r}.js`)});let f=class extends n{constructor(){super(),this.formAction="",this.keywords="",this.locale="es",p(this.locale)}updateShownValue(r){this.keywords=r.target?.value}closePopover(r){r.preventDefault(),(this.shadowRoot?.getElementById("popover")).hidePopover()}render(){return s`
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css } from 'lit';
8
+ import { property } from 'lit/decorators.js';
9
+ import { msg, localized } from '@lit/localize';
10
+ import { configureLocalization } from '@lit/localize';
11
+ // Generated via output.localeCodesModule
12
+ import { sourceLocale, targetLocales } from './generated/locale-codes.js';
13
+ export const { getLocale, setLocale } = configureLocalization({
14
+ sourceLocale,
15
+ targetLocales,
16
+ loadLocale: (locale) => import(`./generated/locales/${locale}.js`),
17
+ });
18
+ let TextareaToNiris = class TextareaToNiris extends LitElement {
19
+ constructor() {
20
+ super();
21
+ this.formAction = '';
22
+ this.keywords = '';
23
+ this.locale = 'es';
24
+ // setLocale(this.locale);
25
+ }
26
+ updateShownValue(event) {
27
+ this.keywords = event.target?.value;
28
+ }
29
+ closePopover(event) {
30
+ event.preventDefault();
31
+ (this.shadowRoot?.getElementById('popover')).hidePopover();
32
+ }
33
+ render() {
34
+ return html `
2
35
  <div id="popover-container">
3
36
  <button id="button-popover" popovertarget="popover">
4
- ${d("Atención en línea")}
37
+ ${msg('Atención en línea')}
5
38
  </button>
6
39
 
7
40
  <div popover id="popover">
8
41
  <header>
9
- <h2>${d("Atención en línea Niris")}</h2>
42
+ <h2>${msg('Atención en línea Niris')}</h2>
10
43
  </header>
11
44
  <main>
12
- <form action="${this.formAction}&keywords=${this.keywords}">
45
+ <form action="${this.formAction}&keywords=${this.keywords}" method="get">
13
46
  <label for="niris-input">
14
- ${d("Información, Consultas, Quejas y Sugerencias:")}
47
+ ${msg('Información, Consultas, Quejas y Sugerencias:')}
15
48
  </label>
16
49
  <textarea
17
50
  id="niris-input"
@@ -19,17 +52,20 @@ import{c as r,i as o,n as e,l as t,s as i,t as a,a as n,x as s,m as d}from"./loc
19
52
  name="keywords"
20
53
  required
21
54
  minlength="4"
22
- placeholder="${d("Escribe tu consulta aquí")}"
55
+ placeholder="${msg('Escribe tu consulta aquí')}"
23
56
  ></textarea>
24
- <button type="submit">${d("Enviar")}</button>
57
+ <button type="submit">${msg('Enviar')}</button>
25
58
  <button type="button" @click="${this.closePopover}">
26
- ${d("Cerrar")}
59
+ ${msg('Cerrar')}
27
60
  </button>
28
61
  </form>
29
62
  </main>
30
63
  </div>
31
64
  </div>
32
- `}};f.styles=o`
65
+ `;
66
+ }
67
+ };
68
+ TextareaToNiris.styles = css `
33
69
  :host {
34
70
  --primary-color: #03599d;
35
71
  --background-color: #d4d4d4;
@@ -186,4 +222,19 @@ import{c as r,i as o,n as e,l as t,s as i,t as a,a as n,x as s,m as d}from"./loc
186
222
  width: 60%;
187
223
  }
188
224
  }
189
- `,l([e({type:String})],f.prototype,"formAction",void 0),l([e({type:String})],f.prototype,"keywords",void 0),l([e({type:String})],f.prototype,"locale",void 0),f=l([t()],f),customElements.define("textarea-to-niris",f);export{f as TextareaToNiris,c as getLocale,p as setLocale};
225
+ `;
226
+ __decorate([
227
+ property({ type: String })
228
+ ], TextareaToNiris.prototype, "formAction", void 0);
229
+ __decorate([
230
+ property({ type: String })
231
+ ], TextareaToNiris.prototype, "keywords", void 0);
232
+ __decorate([
233
+ property({ type: String })
234
+ ], TextareaToNiris.prototype, "locale", void 0);
235
+ TextareaToNiris = __decorate([
236
+ localized()
237
+ ], TextareaToNiris);
238
+ export { TextareaToNiris };
239
+ customElements.define('textarea-to-niris', TextareaToNiris);
240
+ //# sourceMappingURL=textarea-to-niris.js.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "niris-public-community-components",
3
3
  "private": false,
4
- "version": "0.0.4",
4
+ "version": "0.0.5",
5
5
  "homepage": "https://iris.apsl.net",
6
6
  "description": "Web components for the NIRIS project developed with the Lit library",
7
7
  "main": "dist/index.js",
@@ -23,7 +23,7 @@ export class TextareaToNiris extends LitElement {
23
23
  this.formAction = '';
24
24
  this.keywords = '';
25
25
  this.locale = 'es'
26
- setLocale(this.locale);
26
+ // setLocale(this.locale);
27
27
  }
28
28
 
29
29
  updateShownValue(event: Event) {