niris-public-community-components 0.0.1 → 0.0.3

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.
Files changed (54) hide show
  1. package/README.md +59 -8
  2. package/dev/form-niris.html +29 -0
  3. package/dev/text-area-niris.html +8 -5
  4. package/dist/form-niris.d.ts +70 -0
  5. package/dist/form-niris.d.ts.map +1 -0
  6. package/dist/form-niris.js +1127 -0
  7. package/dist/form-niris.js.map +1 -0
  8. package/dist/form-to-niris.js +847 -0
  9. package/dist/generated/locale-codes.d.ts +14 -0
  10. package/dist/generated/locale-codes.d.ts.map +1 -0
  11. package/dist/generated/locale-codes.js +23 -0
  12. package/dist/generated/locale-codes.js.map +1 -0
  13. package/dist/generated/locales/ca.d.ts +61 -0
  14. package/dist/generated/locales/ca.d.ts.map +1 -0
  15. package/dist/generated/locales/ca.js +65 -0
  16. package/dist/generated/locales/ca.js.map +1 -0
  17. package/dist/generated/locales/en.d.ts +61 -0
  18. package/dist/generated/locales/en.d.ts.map +1 -0
  19. package/dist/generated/locales/en.js +65 -0
  20. package/dist/generated/locales/en.js.map +1 -0
  21. package/dist/index.js +2 -0
  22. package/dist/locale-codes-c2f86156.js +72 -0
  23. package/dist/map-niris.d.ts +25 -0
  24. package/dist/map-niris.d.ts.map +1 -0
  25. package/dist/map-niris.js +200 -0
  26. package/dist/map-niris.js.map +1 -0
  27. package/dist/styles/globalStyles.d.ts +2 -0
  28. package/dist/styles/globalStyles.d.ts.map +1 -0
  29. package/dist/styles/globalStyles.js +170 -0
  30. package/dist/styles/globalStyles.js.map +1 -0
  31. package/dist/test/my-element_test.d.ts +7 -0
  32. package/dist/test/my-element_test.d.ts.map +1 -0
  33. package/dist/test/my-element_test.js +47 -0
  34. package/dist/test/my-element_test.js.map +1 -0
  35. package/dist/types.d.ts +85 -0
  36. package/dist/types.d.ts.map +1 -0
  37. package/dist/types.js +9 -0
  38. package/dist/types.js.map +1 -0
  39. package/index.html +5 -3
  40. package/package.json +27 -5
  41. package/rollup.config.js +6 -2
  42. package/src/form-niris.ts +1203 -0
  43. package/src/generated/locale-codes.ts +25 -0
  44. package/src/generated/locales/ca.ts +71 -0
  45. package/src/generated/locales/en.ts +71 -0
  46. package/src/lit-localize.json +15 -0
  47. package/src/map-niris.ts +215 -0
  48. package/src/styles/globalStyles.ts +170 -0
  49. package/src/textarea-to-niris.ts +33 -12
  50. package/src/types.ts +90 -0
  51. package/src/xliff/ca.xlf +239 -0
  52. package/src/xliff/en.xlf +239 -0
  53. package/tsconfig.json +1 -1
  54. package/my-element.js +0 -79
@@ -0,0 +1,200 @@
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 { html, css, LitElement } from 'lit';
8
+ import { property, state } from 'lit/decorators.js';
9
+ import { globalStyles } from './styles/globalStyles';
10
+ // https://github.com/Leaflet/Leaflet/issues/7055
11
+ // https://github.com/Leaflet/Leaflet/pull/7174
12
+ // https://github.com/Leaflet/Leaflet/pull/6239
13
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
14
+ // @ts-ignore
15
+ import * as L from 'leaflet/dist/leaflet-src.esm.js';
16
+ class MapNiris extends LitElement {
17
+ constructor() {
18
+ super();
19
+ this.domain = 'https://iris2-backend-demo-iris-community.labs.apsl.io/services/iris/api-public';
20
+ // TODO property for lat and lon
21
+ this.street = '';
22
+ this.streetNumber = '';
23
+ this.latitude = '';
24
+ this.longitude = '';
25
+ L.Icon.Default.imagePath = `https://unpkg.com/leaflet@${L.version}/dist/images/`;
26
+ this._markerIcon = new L.Icon({
27
+ iconUrl: 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-blue.png',
28
+ shadowUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',
29
+ iconSize: [25, 41],
30
+ iconAnchor: [12, 41],
31
+ popupAnchor: [1, -34],
32
+ shadowSize: [41, 41],
33
+ });
34
+ }
35
+ render() {
36
+ return html `
37
+ <link
38
+ rel="stylesheet"
39
+ href="https://cdn.skypack.dev/leaflet/dist/leaflet.css"
40
+ />
41
+ <div id="map"></div>
42
+ <form id="form2">
43
+ <section class="map-form">
44
+ <div>
45
+ <label for="map-address">Calle*:</label>
46
+ <input
47
+ id="map-address"
48
+ required
49
+ type="text"
50
+ @keyup="${(event) => (this.street = event.target.value)}"
51
+ .value="${this.street}"
52
+ name="address"
53
+ />
54
+ <input name="location[lat]" hidden .value="${this.latitude}" />
55
+ <input name="location[lon]" hidden .value="${this.longitude}" />
56
+ </div>
57
+
58
+ <div>
59
+ <label for="map-number">Número*:</label>
60
+ <input
61
+ id="map-number"
62
+ @keyup="${(event) => (this.streetNumber = event.target.value)}"
63
+ .value="${this.streetNumber}"
64
+ required
65
+ type="text"
66
+ name="location[number]"
67
+ />
68
+ </div>
69
+
70
+ <div>
71
+ <button
72
+ .disabled="${!Boolean(this.street.length)}"
73
+ @click="${this.searchAddress}"
74
+ >
75
+ Buscar
76
+ </button>
77
+ </div>
78
+ </section>
79
+
80
+ <section class="map-form-grid">
81
+ <div>
82
+ <label for="map-floor">Piso:</label>
83
+ <input id="map-floor" required type="text" name="location[floor]" />
84
+ </div>
85
+
86
+ <div>
87
+ <label for="map-stair">Escalera:</label>
88
+ <input id="map-stair" required type="text" name="location[stair]" />
89
+ </div>
90
+
91
+ <div>
92
+ <label for="map-door">Puerta:</label>
93
+ <input id="map-door" required type="text" name="location[door]" />
94
+ </div>
95
+ </section>
96
+ </form>
97
+ `;
98
+ }
99
+ async onMapClick(e) {
100
+ if (this._marker) {
101
+ this._map.removeLayer(this._marker);
102
+ }
103
+ this._marker = new L.marker([e.latlng.lat, e.latlng.lng], {
104
+ icon: this._markerIcon,
105
+ }).addTo(this._map);
106
+ try {
107
+ const response = await fetch(`${this.domain}/geo_proxy/ubication/reverse/?lat=${e.latlng.lat}&lon=${e.latlng.lng}`);
108
+ if (!response.ok) {
109
+ throw new Error(response.statusText);
110
+ }
111
+ else {
112
+ debugger;
113
+ const ubi = await response.json();
114
+ this.street = ubi.street;
115
+ this.streetNumber = ubi.street2;
116
+ this.latitude = ubi.latitude;
117
+ this.longitude = ubi.longitude;
118
+ }
119
+ }
120
+ catch (error) {
121
+ console.info(error);
122
+ }
123
+ }
124
+ async searchAddress() {
125
+ try {
126
+ const response = await fetch(`${this.domain}/geo_proxy/ubication/search/?q=${this.street}, ${this.streetNumber}`);
127
+ if (this._marker) {
128
+ this._map.removeLayer(this._marker);
129
+ }
130
+ const data = await response.json();
131
+ this._marker = new L.marker([data[0].lat, data[0].lon]).addTo(this._map);
132
+ this._map.setView([data[0].lat, data[0].lon], 15);
133
+ }
134
+ catch (error) {
135
+ console.error(error);
136
+ }
137
+ }
138
+ firstUpdated() {
139
+ const mapEl = this.shadowRoot?.querySelector('#map');
140
+ this._map = L.map(mapEl, {
141
+ markerZoomAnimation: false,
142
+ attributionControl: false,
143
+ }).setView([39.7189879, 2.8634595], 15);
144
+ L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
145
+ attribution: '&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
146
+ }).addTo(this._map);
147
+ this._map.on('click', (e) => this.onMapClick(e));
148
+ }
149
+ }
150
+ MapNiris.styles = [
151
+ globalStyles,
152
+ css `
153
+ #map {
154
+ margin-bottom: 2rem;
155
+ width: 100%;
156
+ height: 30vh;
157
+ border: 1px solid #676774;
158
+ }
159
+ .map-form {
160
+ display: flex;
161
+ justify-content: space-between;
162
+ align-items: flex-end;
163
+ gap: 1rem;
164
+ }
165
+
166
+ .map-form div:nth-child(1) {
167
+ flex-basis: 60%;
168
+ }
169
+ .map-form div:nth-child(2) {
170
+ flex-basis: 30%;
171
+ }
172
+ .map-form button {
173
+ flex-basis: 20%;
174
+ margin-bottom: 0.5rem;
175
+ }
176
+
177
+ .map-form-grid {
178
+ display: grid;
179
+ grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
180
+ gap: 1rem;
181
+ }
182
+ `,
183
+ ];
184
+ __decorate([
185
+ property({ type: String })
186
+ ], MapNiris.prototype, "domain", void 0);
187
+ __decorate([
188
+ state()
189
+ ], MapNiris.prototype, "street", void 0);
190
+ __decorate([
191
+ state()
192
+ ], MapNiris.prototype, "streetNumber", void 0);
193
+ __decorate([
194
+ state()
195
+ ], MapNiris.prototype, "latitude", void 0);
196
+ __decorate([
197
+ state()
198
+ ], MapNiris.prototype, "longitude", void 0);
199
+ customElements.define('map-niris', MapNiris);
200
+ //# sourceMappingURL=map-niris.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map-niris.js","sourceRoot":"","sources":["../src/map-niris.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,GAAG,EAAE,UAAU,EAAC,MAAM,KAAK,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,YAAY,EAAC,MAAM,uBAAuB,CAAC;AAGnD,iDAAiD;AACjD,+CAA+C;AAC/C,+CAA+C;AAC/C,6DAA6D;AAC7D,aAAa;AACb,OAAO,KAAK,CAAC,MAAM,iCAAiC,CAAC;AAErD,MAAM,QAAS,SAAQ,UAAU;IAqB/B;QACE,KAAK,EAAE,CAAC;QAjBgB,WAAM,GAC9B,iFAAiF,CAAC;QACpF,gCAAgC;QAGxB,WAAM,GAAW,EAAE,CAAC;QAGpB,iBAAY,GAAW,EAAE,CAAC;QAG1B,aAAQ,GAAW,EAAE,CAAC;QAGtB,cAAS,GA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AM,EAAC,CAAC;wCAC2D;AAI5E;IADP,KAAK,EAAE;wCACoB;AAGpB;IADP,KAAK,EAAE;8CAC0B;AAG1B;IADP,KAAK,EAAE;0CACsB;AAGtB;IADP,KAAK,EAAE;2CACuB;AAiLjC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC","sourcesContent":["import {html, css, LitElement} from 'lit';\nimport {property, state} from 'lit/decorators.js';\nimport {globalStyles} from './styles/globalStyles';\nimport {Icon, LeafletMouseEvent, Map, Marker} from 'leaflet';\n\n// https://github.com/Leaflet/Leaflet/issues/7055\n// https://github.com/Leaflet/Leaflet/pull/7174\n// https://github.com/Leaflet/Leaflet/pull/6239\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport * as L from 'leaflet/dist/leaflet-src.esm.js';\n\nclass MapNiris extends LitElement {\n private _marker!: Marker | null;\n private _map!: Map;\n private _markerIcon!: Icon;\n\n @property({type: String}) domain: string =\n 'https://iris2-backend-demo-iris-community.labs.apsl.io/services/iris/api-public';\n // TODO property for lat and lon\n\n @state()\n private street: string = '';\n\n @state()\n private streetNumber: string = '';\n\n @state()\n private latitude: string = '';\n\n @state()\n private longitude: string = '';\n\n constructor() {\n super();\n L.Icon.Default.imagePath = `https://unpkg.com/leaflet@${L.version}/dist/images/`;\n this._markerIcon = new L.Icon({\n iconUrl:\n 'https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-blue.png',\n shadowUrl:\n 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/images/marker-shadow.png',\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n shadowSize: [41, 41],\n });\n }\n\n override render() {\n return html`\n <link\n rel=\"stylesheet\"\n href=\"https://cdn.skypack.dev/leaflet/dist/leaflet.css\"\n />\n <div id=\"map\"></div>\n <form id=\"form2\">\n <section class=\"map-form\">\n <div>\n <label for=\"map-address\">Calle*:</label>\n <input\n id=\"map-address\"\n required\n type=\"text\"\n @keyup=\"${(event: KeyboardEvent) =>\n (this.street = (event.target as HTMLInputElement).value)}\"\n .value=\"${this.street}\"\n name=\"address\"\n />\n <input name=\"location[lat]\" hidden .value=\"${this.latitude}\" />\n <input name=\"location[lon]\" hidden .value=\"${this.longitude}\" />\n </div>\n\n <div>\n <label for=\"map-number\">Número*:</label>\n <input\n id=\"map-number\"\n @keyup=\"${(event: KeyboardEvent) =>\n (this.streetNumber = (event.target as HTMLInputElement).value)}\"\n .value=\"${this.streetNumber}\"\n required\n type=\"text\"\n name=\"location[number]\"\n />\n </div>\n\n <div>\n <button\n .disabled=\"${!Boolean(this.street.length)}\"\n @click=\"${this.searchAddress}\"\n >\n Buscar\n </button>\n </div>\n </section>\n\n <section class=\"map-form-grid\">\n <div>\n <label for=\"map-floor\">Piso:</label>\n <input id=\"map-floor\" required type=\"text\" name=\"location[floor]\" />\n </div>\n\n <div>\n <label for=\"map-stair\">Escalera:</label>\n <input id=\"map-stair\" required type=\"text\" name=\"location[stair]\" />\n </div>\n\n <div>\n <label for=\"map-door\">Puerta:</label>\n <input id=\"map-door\" required type=\"text\" name=\"location[door]\" />\n </div>\n </section>\n </form>\n `;\n }\n\n async onMapClick(e: LeafletMouseEvent) {\n if (this._marker) {\n this._map.removeLayer(this._marker);\n }\n this._marker = new L.marker([e.latlng.lat, e.latlng.lng], {\n icon: this._markerIcon,\n }).addTo(this._map);\n try {\n const response = await fetch(\n `${this.domain}/geo_proxy/ubication/reverse/?lat=${e.latlng.lat}&lon=${e.latlng.lng}`\n );\n if (!response.ok) {\n throw new Error(response.statusText);\n } else {\n debugger;\n const ubi = await response.json();\n this.street = ubi.street;\n this.streetNumber = ubi.street2;\n this.latitude = ubi.latitude;\n this.longitude = ubi.longitude;\n }\n } catch (error) {\n console.info(error);\n }\n }\n\n async searchAddress() {\n try {\n const response = await fetch(\n `${this.domain}/geo_proxy/ubication/search/?q=${this.street}, ${this.streetNumber}`\n );\n if (this._marker) {\n this._map.removeLayer(this._marker);\n }\n const data = await response.json();\n this._marker = new L.marker([data[0].lat, data[0].lon]).addTo(this._map);\n this._map.setView([data[0].lat, data[0].lon], 15);\n } catch (error) {\n console.error(error);\n }\n }\n\n override firstUpdated() {\n const mapEl = this.shadowRoot?.querySelector('#map');\n this._map = L.map(mapEl, {\n markerZoomAnimation: false,\n attributionControl: false,\n }).setView([39.7189879, 2.8634595], 15);\n\n L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {\n attribution:\n '&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors',\n }).addTo(this._map);\n\n this._map.on('click', (e) => this.onMapClick(e));\n }\n\n static override styles = [\n globalStyles,\n css`\n #map {\n margin-bottom: 2rem;\n width: 100%;\n height: 30vh;\n border: 1px solid #676774;\n }\n .map-form {\n display: flex;\n justify-content: space-between;\n align-items: flex-end;\n gap: 1rem;\n }\n\n .map-form div:nth-child(1) {\n flex-basis: 60%;\n }\n .map-form div:nth-child(2) {\n flex-basis: 30%;\n }\n .map-form button {\n flex-basis: 20%;\n margin-bottom: 0.5rem;\n }\n\n .map-form-grid {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n gap: 1rem;\n }\n `,\n ];\n}\n\ncustomElements.define('map-niris', MapNiris);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'map-niris': MapNiris;\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export declare const globalStyles: import("lit").CSSResult;
2
+ //# sourceMappingURL=globalStyles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalStyles.d.ts","sourceRoot":"","sources":["../../src/styles/globalStyles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,yBAuKxB,CAAC"}
@@ -0,0 +1,170 @@
1
+ import { css } from 'lit';
2
+ export const globalStyles = css `
3
+ /* Base */
4
+ h1 {
5
+ font-size: 2rem;
6
+ line-height: 2.5rem;
7
+ color: var(--primary-color);
8
+ margin: 2rem 0;
9
+ }
10
+
11
+ h2 {
12
+ font-size: 1.5rem;
13
+ line-height: 2rem;
14
+ margin: 3rem 0;
15
+ color: var(--primary-color);
16
+ filter: opacity(80%);
17
+ }
18
+
19
+ h3 {
20
+ font-size: 1.3rem;
21
+ line-height: 2rem;
22
+ margin: 2rem 0;
23
+ color: var(--primary-color);
24
+ filter: opacity(70%);
25
+ }
26
+
27
+ * {
28
+ font-family: 'Brush Script MT', cursive, sans-serif; /* This is fallback font for old browsers */
29
+ font-family: var(--font-family);
30
+ box-sizing: border-box;
31
+ color: #676774;
32
+ }
33
+
34
+ /* Buttons */
35
+ button,
36
+ .btn {
37
+ min-width: 120px;
38
+ background-color: var(--primary-color);
39
+ border: none;
40
+ cursor: pointer;
41
+ color: var(--color-button);
42
+ padding: var(--padding);
43
+ font-size: var(--font-size);
44
+ border-radius: var(--border-radius);
45
+ transition: 0.3s;
46
+ }
47
+
48
+ button:hover,
49
+ .btn:hover {
50
+ filter: brightness(120%);
51
+ }
52
+
53
+ button:focus-visible {
54
+ background-color: var(--primary-color);
55
+ outline: 3px solid var(--primary-color);
56
+ outline-offset: 2px;
57
+ }
58
+
59
+ button[type='submit'] {
60
+ margin: 2rem auto;
61
+ display: block;
62
+ }
63
+
64
+ button:disabled {
65
+ filter: contrast(50%);
66
+ cursor: not-allowed;
67
+ }
68
+
69
+ .btn-error {
70
+ background-color: var(--error-color);
71
+ }
72
+
73
+ .text-error {
74
+ color: var(--error-color);
75
+ }
76
+
77
+ /* Forms */
78
+ input,
79
+ textarea,
80
+ select {
81
+ border-radius: var(--border-radius);
82
+ padding: 0.5rem;
83
+ border-width: 2px;
84
+ border-color: rgb(209 213 219 / 1);
85
+ width: 100%;
86
+ font-size: 0.875rem;
87
+ margin: 0.5rem 0;
88
+ border-style: solid;
89
+ min-height: 2.5rem;
90
+ }
91
+ textarea {
92
+ resize: none;
93
+ height: 8rem;
94
+ }
95
+
96
+ input:focus,
97
+ textarea:focus,
98
+ select:focus {
99
+ outline: 2px solid transparent;
100
+ outline-offset: 2px;
101
+ --tw-ring-inset: var(--tw-empty, /*!*/ /*!*/);
102
+ --tw-ring-offset-width: 0px;
103
+ --tw-ring-offset-color: #fff;
104
+ --tw-ring-color: var(--primary-color);
105
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0
106
+ var(--tw-ring-offset-width) var(--tw-ring-offset-color);
107
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0
108
+ calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
109
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),
110
+ var(--tw-shadow);
111
+ border-color: var(--primary-color);
112
+ }
113
+
114
+ input::file-selector-button {
115
+ color: white;
116
+ background-color: var(--primary-color);
117
+ border-width: 0px;
118
+ padding: var(--padding);
119
+ border-radius: var(--border-radius);
120
+ }
121
+ input::file-selector-button:hover {
122
+ filter: brightness(120%);
123
+ cursor: pointer;
124
+ }
125
+
126
+ input.invalid,
127
+ textarea.invalid,
128
+ select.invalid {
129
+ border: 1px solid red;
130
+ }
131
+
132
+ input:user-invalid,
133
+ textarea:user-invalid,
134
+ select:user-invalid {
135
+ border: 1px solid red;
136
+ }
137
+
138
+ [multiple]:focus,
139
+ [type='date']:focus,
140
+ [type='datetime-local']:focus,
141
+ [type='email']:focus,
142
+ [type='month']:focus,
143
+ [type='number']:focus,
144
+ [type='password']:focus,
145
+ [type='search']:focus,
146
+ [type='tel']:focus,
147
+ [type='text']:focus,
148
+ [type='time']:focus,
149
+ [type='url']:focus,
150
+ [type='week']:focus,
151
+ input:where(:not([type])):focus,
152
+ select:focus,
153
+ textarea:focus {
154
+ outline: 2px solid transparent;
155
+ outline-offset: 2px;
156
+ --tw-empty: 1;
157
+ --tw-ring-inset: var(--tw-empty);
158
+ --tw-ring-offset-width: 0px;
159
+ --tw-ring-offset-color: #fff;
160
+ --tw-ring-color: var(--primary-color);
161
+ --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0
162
+ var(--tw-ring-offset-width) var(--tw-ring-offset-color);
163
+ --tw-ring-shadow: var(--tw-ring-inset) 0 0 0
164
+ calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);
165
+ border-color: var(--primary-color);
166
+ box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),
167
+ var(--tw-shadow);
168
+ }
169
+ `;
170
+ //# sourceMappingURL=globalStyles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"globalStyles.js","sourceRoot":"","sources":["../../src/styles/globalStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuK9B,CAAC","sourcesContent":["import {css} from 'lit';\n\nexport const globalStyles = css`\n /* Base */\n h1 {\n font-size: 2rem;\n line-height: 2.5rem;\n color: var(--primary-color);\n margin: 2rem 0;\n }\n\n h2 {\n font-size: 1.5rem;\n line-height: 2rem;\n margin: 3rem 0;\n color: var(--primary-color);\n filter: opacity(80%);\n }\n\n h3 {\n font-size: 1.3rem;\n line-height: 2rem;\n margin: 2rem 0;\n color: var(--primary-color);\n filter: opacity(70%);\n }\n\n * {\n font-family: 'Brush Script MT', cursive, sans-serif; /* This is fallback font for old browsers */\n font-family: var(--font-family);\n box-sizing: border-box;\n color: #676774;\n }\n\n /* Buttons */\n button,\n .btn {\n min-width: 120px;\n background-color: var(--primary-color);\n border: none;\n cursor: pointer;\n color: var(--color-button);\n padding: var(--padding);\n font-size: var(--font-size);\n border-radius: var(--border-radius);\n transition: 0.3s;\n }\n\n button:hover,\n .btn:hover {\n filter: brightness(120%);\n }\n\n button:focus-visible {\n background-color: var(--primary-color);\n outline: 3px solid var(--primary-color);\n outline-offset: 2px;\n }\n\n button[type='submit'] {\n margin: 2rem auto;\n display: block;\n }\n\n button:disabled {\n filter: contrast(50%);\n cursor: not-allowed;\n }\n\n .btn-error {\n background-color: var(--error-color);\n }\n\n .text-error {\n color: var(--error-color);\n }\n\n /* Forms */\n input,\n textarea,\n select {\n border-radius: var(--border-radius);\n padding: 0.5rem;\n border-width: 2px;\n border-color: rgb(209 213 219 / 1);\n width: 100%;\n font-size: 0.875rem;\n margin: 0.5rem 0;\n border-style: solid;\n min-height: 2.5rem;\n }\n textarea {\n resize: none;\n height: 8rem;\n }\n\n input:focus,\n textarea:focus,\n select:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-ring-inset: var(--tw-empty, /*!*/ /*!*/);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: var(--primary-color);\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0\n var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0\n calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),\n var(--tw-shadow);\n border-color: var(--primary-color);\n }\n\n input::file-selector-button {\n color: white;\n background-color: var(--primary-color);\n border-width: 0px;\n padding: var(--padding);\n border-radius: var(--border-radius);\n }\n input::file-selector-button:hover {\n filter: brightness(120%);\n cursor: pointer;\n }\n\n input.invalid,\n textarea.invalid,\n select.invalid {\n border: 1px solid red;\n }\n\n input:user-invalid,\n textarea:user-invalid,\n select:user-invalid {\n border: 1px solid red;\n }\n\n [multiple]:focus,\n [type='date']:focus,\n [type='datetime-local']:focus,\n [type='email']:focus,\n [type='month']:focus,\n [type='number']:focus,\n [type='password']:focus,\n [type='search']:focus,\n [type='tel']:focus,\n [type='text']:focus,\n [type='time']:focus,\n [type='url']:focus,\n [type='week']:focus,\n input:where(:not([type])):focus,\n select:focus,\n textarea:focus {\n outline: 2px solid transparent;\n outline-offset: 2px;\n --tw-empty: 1;\n --tw-ring-inset: var(--tw-empty);\n --tw-ring-offset-width: 0px;\n --tw-ring-offset-color: #fff;\n --tw-ring-color: var(--primary-color);\n --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0\n var(--tw-ring-offset-width) var(--tw-ring-offset-color);\n --tw-ring-shadow: var(--tw-ring-inset) 0 0 0\n calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);\n border-color: var(--primary-color);\n box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow),\n var(--tw-shadow);\n }\n`;\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ export {};
7
+ //# sourceMappingURL=my-element_test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"my-element_test.d.ts","sourceRoot":"","sources":["../../src/test/my-element_test.ts"],"names":[],"mappings":"AAAA;;;;GAIG"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ * SPDX-License-Identifier: BSD-3-Clause
5
+ */
6
+ import { MyElement } from '../my-element.js';
7
+ import { fixture, assert } from '@open-wc/testing';
8
+ import { html } from 'lit/static-html.js';
9
+ suite('my-element', () => {
10
+ test('is defined', () => {
11
+ const el = document.createElement('my-element');
12
+ assert.instanceOf(el, MyElement);
13
+ });
14
+ test('renders with default values', async () => {
15
+ const el = await fixture(html `<my-element></my-element>`);
16
+ assert.shadowDom.equal(el, `
17
+ <h1>Hello, World!</h1>
18
+ <button part="button">Click Count: 0</button>
19
+ <slot></slot>
20
+ `);
21
+ });
22
+ test('renders with a set name', async () => {
23
+ const el = await fixture(html `<my-element name="Test"></my-element>`);
24
+ assert.shadowDom.equal(el, `
25
+ <h1>Hello, Test!</h1>
26
+ <button part="button">Click Count: 0</button>
27
+ <slot></slot>
28
+ `);
29
+ });
30
+ test('handles a click', async () => {
31
+ const el = (await fixture(html `<my-element></my-element>`));
32
+ const button = el.shadowRoot.querySelector('button');
33
+ button.click();
34
+ await el.updateComplete;
35
+ assert.shadowDom.equal(el, `
36
+ <h1>Hello, World!</h1>
37
+ <button part="button">Click Count: 1</button>
38
+ <slot></slot>
39
+ `);
40
+ });
41
+ test('styling applied', async () => {
42
+ const el = (await fixture(html `<my-element></my-element>`));
43
+ await el.updateComplete;
44
+ assert.equal(getComputedStyle(el).paddingTop, '16px');
45
+ });
46
+ });
47
+ //# sourceMappingURL=my-element_test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"my-element_test.js","sourceRoot":"","sources":["../../src/test/my-element_test.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAC,IAAI,EAAC,MAAM,oBAAoB,CAAC;AAExC,KAAK,CAAC,YAAY,EAAE,GAAG,EAAE;IACvB,IAAI,CAAC,YAAY,EAAE,GAAG,EAAE;QACtB,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,CAAC,UAAU,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,6BAA6B,EAAE,KAAK,IAAI,EAAE;QAC7C,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA,2BAA2B,CAAC,CAAC;QAC1D,MAAM,CAAC,SAAS,CAAC,KAAK,CACpB,EAAE,EACF;;;;KAID,CACA,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,yBAAyB,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,EAAE,GAAG,MAAM,OAAO,CAAC,IAAI,CAAA,uCAAuC,CAAC,CAAC;QACtE,MAAM,CAAC,SAAS,CAAC,KAAK,CACpB,EAAE,EACF;;;;KAID,CACA,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA,2BAA2B,CAAC,CAAc,CAAC;QACzE,MAAM,MAAM,GAAG,EAAE,CAAC,UAAW,CAAC,aAAa,CAAC,QAAQ,CAAE,CAAC;QACvD,MAAM,CAAC,KAAK,EAAE,CAAC;QACf,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,MAAM,CAAC,SAAS,CAAC,KAAK,CACpB,EAAE,EACF;;;;KAID,CACA,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,IAAI,CAAC,iBAAiB,EAAE,KAAK,IAAI,EAAE;QACjC,MAAM,EAAE,GAAG,CAAC,MAAM,OAAO,CAAC,IAAI,CAAA,2BAA2B,CAAC,CAAc,CAAC;QACzE,MAAM,EAAE,CAAC,cAAc,CAAC;QACxB,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {MyElement} from '../my-element.js';\n\nimport {fixture, assert} from '@open-wc/testing';\nimport {html} from 'lit/static-html.js';\n\nsuite('my-element', () => {\n test('is defined', () => {\n const el = document.createElement('my-element');\n assert.instanceOf(el, MyElement);\n });\n\n test('renders with default values', async () => {\n const el = await fixture(html`<my-element></my-element>`);\n assert.shadowDom.equal(\n el,\n `\n <h1>Hello, World!</h1>\n <button part=\"button\">Click Count: 0</button>\n <slot></slot>\n `\n );\n });\n\n test('renders with a set name', async () => {\n const el = await fixture(html`<my-element name=\"Test\"></my-element>`);\n assert.shadowDom.equal(\n el,\n `\n <h1>Hello, Test!</h1>\n <button part=\"button\">Click Count: 0</button>\n <slot></slot>\n `\n );\n });\n\n test('handles a click', async () => {\n const el = (await fixture(html`<my-element></my-element>`)) as MyElement;\n const button = el.shadowRoot!.querySelector('button')!;\n button.click();\n await el.updateComplete;\n assert.shadowDom.equal(\n el,\n `\n <h1>Hello, World!</h1>\n <button part=\"button\">Click Count: 1</button>\n <slot></slot>\n `\n );\n });\n\n test('styling applied', async () => {\n const el = (await fixture(html`<my-element></my-element>`)) as MyElement;\n await el.updateComplete;\n assert.equal(getComputedStyle(el).paddingTop, '16px');\n });\n});\n"]}
@@ -0,0 +1,85 @@
1
+ export interface FormDataIncidents {
2
+ door?: string | undefined;
3
+ stair?: string | undefined;
4
+ floor?: string | undefined;
5
+ longitude?: string | undefined;
6
+ latitude?: string | undefined;
7
+ number?: string | undefined;
8
+ address?: string | undefined;
9
+ detailId?: number;
10
+ comments?: string;
11
+ transaction?: string;
12
+ device?: number;
13
+ applicant?: number;
14
+ nameCitizen?: string;
15
+ firstSurname?: string;
16
+ secondSurname?: string;
17
+ typeDocument?: number;
18
+ numberDocument?: string;
19
+ birthYear?: number;
20
+ sex?: string;
21
+ socialReason?: string;
22
+ contactPerson?: string;
23
+ cif?: string;
24
+ authorization?: boolean;
25
+ origin?: string;
26
+ district?: number;
27
+ language?: string;
28
+ email?: string;
29
+ telephone?: string;
30
+ characteristics?: CharacteristicElement[];
31
+ location?: Location;
32
+ pictures?: Picture[];
33
+ file?: any[];
34
+ }
35
+ export interface CharacteristicElement {
36
+ readonly id: number;
37
+ readonly value: string;
38
+ }
39
+ export interface Location {
40
+ id?: number;
41
+ latitude?: string;
42
+ longitude?: string;
43
+ geocode?: number;
44
+ via_type?: string;
45
+ address?: string;
46
+ number?: string;
47
+ stair?: string;
48
+ floor?: string;
49
+ door?: string;
50
+ district?: number;
51
+ }
52
+ export interface Picture {
53
+ readonly filename: string;
54
+ }
55
+ export declare enum CharacteristicTypeEnum {
56
+ Number = "Number",
57
+ Text = "Text",
58
+ Options = "Options",
59
+ Date = "Date",
60
+ Time = "Time"
61
+ }
62
+ export type Characteristic = {
63
+ readonly id: number;
64
+ readonly type: CharacteristicTypeEnum;
65
+ readonly mandatory: boolean;
66
+ readonly title: string;
67
+ readonly special: boolean;
68
+ readonly mask: number;
69
+ readonly desc_mask: string;
70
+ readonly options: string[];
71
+ readonly explanatory_text: string;
72
+ readonly order: number;
73
+ readonly codename: string;
74
+ readonly editable_for_citizen: boolean;
75
+ readonly options_proxy: any[];
76
+ readonly description_es: string;
77
+ readonly description_en: string;
78
+ readonly description_ca: string;
79
+ readonly description_gl: string;
80
+ };
81
+ export type Districte = {
82
+ id: number;
83
+ name: string;
84
+ };
85
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAA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risticTypeEnum["Options"] = "Options";
6
+ CharacteristicTypeEnum["Date"] = "Date";
7
+ CharacteristicTypeEnum["Time"] = "Time";
8
+ })(CharacteristicTypeEnum || (CharacteristicTypeEnum = {}));
9
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AA0DA,MAAM,CAAN,IAAY,sBAMX;AAND,WAAY,sBAAsB;IAChC,2CAAiB,CAAA;IACjB,uCAAa,CAAA;IACb,6CAAmB,CAAA;IACnB,uCAAa,CAAA;IACb,uCAAa,CAAA;AACf,CAAC,EANW,sBAAsB,KAAtB,sBAAsB,QAMjC","sourcesContent":["export interface FormDataIncidents {\n door?: string | undefined;\n stair?: string | undefined;\n floor?: string | undefined;\n longitude?: string | undefined;\n latitude?: string | undefined;\n number?: string | undefined;\n address?: string | undefined;\n detailId?: number;\n comments?: string;\n transaction?: string;\n device?: number;\n applicant?: number;\n nameCitizen?: string;\n firstSurname?: string;\n secondSurname?: string;\n typeDocument?: number;\n numberDocument?: string;\n birthYear?: number;\n sex?: string;\n socialReason?: string;\n contactPerson?: string;\n cif?: string;\n authorization?: boolean;\n origin?: string;\n district?: number;\n language?: string;\n email?: string;\n telephone?: string;\n characteristics?: CharacteristicElement[];\n location?: Location;\n pictures?: Picture[];\n file?: any[];\n}\n\nexport interface CharacteristicElement {\n readonly id: number;\n readonly value: string;\n}\n\nexport interface Location {\n id?: number;\n latitude?: string;\n longitude?: string;\n geocode?: number;\n via_type?: string;\n address?: string;\n number?: string;\n stair?: string;\n floor?: string;\n door?: string;\n district?: number;\n}\n\nexport interface Picture {\n readonly filename: string;\n}\n\nexport enum CharacteristicTypeEnum {\n Number = 'Number',\n Text = 'Text',\n Options = 'Options',\n Date = 'Date',\n Time = 'Time',\n}\n\nexport type Characteristic = {\n readonly id: number;\n readonly type: CharacteristicTypeEnum;\n readonly mandatory: boolean;\n readonly title: string;\n readonly special: boolean;\n readonly mask: number;\n readonly desc_mask: string;\n readonly options: string[];\n readonly explanatory_text: string;\n readonly order: number;\n readonly codename: string;\n readonly editable_for_citizen: boolean;\n readonly options_proxy: any[];\n readonly description_es: string;\n readonly description_en: string;\n readonly description_ca: string;\n readonly description_gl: string;\n};\n\nexport type Districte = {\n id: number;\n name: string;\n};\n"]}
package/index.html CHANGED
@@ -10,8 +10,10 @@
10
10
 
11
11
  <br />
12
12
 
13
- <a href="/dev/text-area-niris.html">
14
- &lt;textarea-to-iris&gt;&lt;/textarea-to-iris&gt;
15
- </a>
13
+ <a href="/dev/text-area-niris.html"> Component TextAreaNiris </a>
14
+
15
+ <br />
16
+
17
+ <a href="/dev/form-niris.html"> Component FormNiris </a>
16
18
  </body>
17
19
  </html>