@luzmo/lucero 1.0.1-alpha.23 → 1.0.1-alpha.24

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.
@@ -15,23 +15,23 @@
15
15
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
16
  * SOFTWARE.
17
17
  * */
18
- import { unsafeCSS as v, html as o, nothing as p } from "lit";
19
- import { state as m, property as l, query as y } from "lit/decorators.js";
18
+ import { unsafeCSS as m, html as o, nothing as p } from "lit";
19
+ import { state as c, property as s, query as v } from "lit/decorators.js";
20
20
  import { ifDefined as r } from "lit/directives/if-defined.js";
21
21
  import { live as f } from "lit/directives/live.js";
22
- import { luzmoIcon as c, luzmoAlert as g, luzmoCheck as $ } from "@luzmo/icons";
23
- import { F as x } from "./focusable-BjvsvVam.js";
24
- import { S as b } from "./sized-mixin-cJbo3PKR.js";
25
- import { M as S } from "./manage-help-text-C9sCHK3R.js";
26
- import { t as w } from "./text-field.module-C2KVUJcX.js";
27
- var _ = Object.defineProperty, E = Object.getOwnPropertyDescriptor, t = (h, e, s, a) => {
28
- for (var n = a > 1 ? void 0 : a ? E(e, s) : e, u = h.length - 1, d; u >= 0; u--)
29
- (d = h[u]) && (n = (a ? d(e, s, n) : d(n)) || n);
30
- return a && n && _(e, s, n), n;
22
+ import { luzmoIcon as y, luzmoAlert as g, luzmoCheck as $ } from "@luzmo/icons";
23
+ import { F as b } from "./focusable-BjvsvVam.js";
24
+ import { S as x } from "./sized-mixin-cJbo3PKR.js";
25
+ import { M as w } from "./manage-help-text-C9sCHK3R.js";
26
+ import { t as S } from "./text-field.module-C2KVUJcX.js";
27
+ var E = Object.defineProperty, _ = Object.getOwnPropertyDescriptor, t = (h, e, l, a) => {
28
+ for (var n = a > 1 ? void 0 : a ? _(e, l) : e, u = h.length - 1, d; u >= 0; u--)
29
+ (d = h[u]) && (n = (a ? d(e, l, n) : d(n)) || n);
30
+ return a && n && E(e, l, n), n;
31
31
  };
32
- const q = ["text", "url", "tel", "email", "password"];
33
- class i extends S(
34
- b(x, {
32
+ const K = ["text", "url", "tel", "email", "password"];
33
+ class i extends w(
34
+ x(b, {
35
35
  noDefaultSize: !0
36
36
  })
37
37
  ) {
@@ -39,20 +39,20 @@ class i extends S(
39
39
  super(...arguments), this.allowedKeys = "", this.focused = !1, this.invalid = !1, this.label = "", this.placeholder = "", this._type = "text", this.grows = !1, this.maxlength = -1, this.minlength = -1, this.multiline = !1, this.readonly = !1, this.rows = -1, this.valid = !1, this._value = "", this.quiet = !1, this.required = !1;
40
40
  }
41
41
  static get styles() {
42
- return [v(w)];
42
+ return [m(S)];
43
43
  }
44
44
  set type(e) {
45
- const s = this._type;
46
- this._type = e, this.requestUpdate("type", s);
45
+ const l = this._type;
46
+ this._type = e, this.requestUpdate("type", l);
47
47
  }
48
48
  get type() {
49
- return q.find((e) => e === this._type) ?? "text";
49
+ return K.find((e) => e === this._type) ?? "text";
50
50
  }
51
51
  set value(e) {
52
52
  if (e === this.value)
53
53
  return;
54
- const s = this._value;
55
- this._value = e, this.requestUpdate("value", s);
54
+ const l = this._value;
55
+ this._value = e, this.requestUpdate("value", l);
56
56
  }
57
57
  get value() {
58
58
  return this._value;
@@ -70,10 +70,10 @@ class i extends S(
70
70
  * @param [selectionDirection="none"] A string indicating the direction in which the selection is considered to
71
71
  * have been performed.
72
72
  */
73
- setSelectionRange(e, s, a = "none") {
73
+ setSelectionRange(e, l, a = "none") {
74
74
  this.inputElement.setSelectionRange(
75
75
  e,
76
- s,
76
+ l,
77
77
  a
78
78
  );
79
79
  }
@@ -105,13 +105,27 @@ class i extends S(
105
105
  onBlur(e) {
106
106
  this.focused = !this.readonly && !1;
107
107
  }
108
+ handleKeyPress(e) {
109
+ this.dispatchEvent(
110
+ new KeyboardEvent("keypress", {
111
+ bubbles: !0,
112
+ composed: !0,
113
+ key: e.key,
114
+ code: e.code,
115
+ ctrlKey: e.ctrlKey,
116
+ shiftKey: e.shiftKey,
117
+ altKey: e.altKey,
118
+ metaKey: e.metaKey
119
+ })
120
+ );
121
+ }
108
122
  handleInputElementPointerdown() {
109
123
  }
110
124
  renderStateIcons() {
111
125
  return this.invalid ? o`
112
- <div id="invalid" class="icon">${c(g)}</div>
126
+ <div id="invalid" class="icon">${y(g)}</div>
113
127
  ` : this.valid ? o`
114
- <div id="valid" class="icon">${c($)}</div>
128
+ <div id="valid" class="icon">${y($)}</div>
115
129
  ` : p;
116
130
  }
117
131
  get displayValue() {
@@ -139,6 +153,7 @@ class i extends S(
139
153
  .value=${this.displayValue}
140
154
  @change=${this.handleChange}
141
155
  @input=${this.handleInput}
156
+ @keypress=${this.handleKeyPress}
142
157
  @focus=${this.onFocus}
143
158
  @blur=${this.onBlur}
144
159
  ?disabled=${this.disabled}
@@ -167,6 +182,7 @@ class i extends S(
167
182
  .value=${f(this.displayValue)}
168
183
  @change=${this.handleChange}
169
184
  @input=${this.handleInput}
185
+ @keypress=${this.handleKeyPress}
170
186
  @pointerdown=${this.handleInputElementPointerdown}
171
187
  @focus=${this.onFocus}
172
188
  @blur=${this.onBlur}
@@ -200,89 +216,89 @@ class i extends S(
200
216
  }
201
217
  }
202
218
  t([
203
- m()
219
+ c()
204
220
  ], i.prototype, "appliedLabel", 2);
205
221
  t([
206
- l({ attribute: "allowed-keys" })
222
+ s({ attribute: "allowed-keys" })
207
223
  ], i.prototype, "allowedKeys", 2);
208
224
  t([
209
- l({ type: Boolean, reflect: !0 })
225
+ s({ type: Boolean, reflect: !0 })
210
226
  ], i.prototype, "focused", 2);
211
227
  t([
212
- y(".input:not(#sizer)")
228
+ v(".input:not(#sizer)")
213
229
  ], i.prototype, "inputElement", 2);
214
230
  t([
215
- l({ type: Boolean, reflect: !0 })
231
+ s({ type: Boolean, reflect: !0 })
216
232
  ], i.prototype, "invalid", 2);
217
233
  t([
218
- l()
234
+ s()
219
235
  ], i.prototype, "label", 2);
220
236
  t([
221
- l({ type: String, reflect: !0 })
237
+ s({ type: String, reflect: !0 })
222
238
  ], i.prototype, "name", 2);
223
239
  t([
224
- l()
240
+ s()
225
241
  ], i.prototype, "placeholder", 2);
226
242
  t([
227
- m()
243
+ c()
228
244
  ], i.prototype, "type", 1);
229
245
  t([
230
- l({ attribute: "type", reflect: !0 })
246
+ s({ attribute: "type", reflect: !0 })
231
247
  ], i.prototype, "_type", 2);
232
248
  t([
233
- l()
249
+ s()
234
250
  ], i.prototype, "pattern", 2);
235
251
  t([
236
- l({ type: Boolean, reflect: !0 })
252
+ s({ type: Boolean, reflect: !0 })
237
253
  ], i.prototype, "grows", 2);
238
254
  t([
239
- l({ type: Number })
255
+ s({ type: Number })
240
256
  ], i.prototype, "maxlength", 2);
241
257
  t([
242
- l({ type: Number })
258
+ s({ type: Number })
243
259
  ], i.prototype, "minlength", 2);
244
260
  t([
245
- l({ type: Boolean, reflect: !0 })
261
+ s({ type: Boolean, reflect: !0 })
246
262
  ], i.prototype, "multiline", 2);
247
263
  t([
248
- l({ type: Boolean, reflect: !0 })
264
+ s({ type: Boolean, reflect: !0 })
249
265
  ], i.prototype, "readonly", 2);
250
266
  t([
251
- l({ type: Number })
267
+ s({ type: Number })
252
268
  ], i.prototype, "rows", 2);
253
269
  t([
254
- l({ type: Boolean, reflect: !0 })
270
+ s({ type: Boolean, reflect: !0 })
255
271
  ], i.prototype, "valid", 2);
256
272
  t([
257
- l({ type: String })
273
+ s({ type: String })
258
274
  ], i.prototype, "value", 1);
259
275
  t([
260
- l({ type: Boolean, reflect: !0 })
276
+ s({ type: Boolean, reflect: !0 })
261
277
  ], i.prototype, "quiet", 2);
262
278
  t([
263
- l({ type: Boolean, reflect: !0 })
279
+ s({ type: Boolean, reflect: !0 })
264
280
  ], i.prototype, "required", 2);
265
281
  t([
266
- l({ type: String, reflect: !0 })
282
+ s({ type: String, reflect: !0 })
267
283
  ], i.prototype, "autocomplete", 2);
268
- class B extends i {
284
+ class q extends i {
269
285
  constructor() {
270
286
  super(...arguments), this._value = "";
271
287
  }
272
288
  set value(e) {
273
289
  if (e === this.value)
274
290
  return;
275
- const s = this._value;
276
- this._value = e, this.requestUpdate("value", s);
291
+ const l = this._value;
292
+ this._value = e, this.requestUpdate("value", l);
277
293
  }
278
294
  get value() {
279
295
  return this._value;
280
296
  }
281
297
  }
282
298
  t([
283
- l({ type: String })
284
- ], B.prototype, "value", 1);
299
+ s({ type: String })
300
+ ], q.prototype, "value", 1);
285
301
  export {
286
- B as L,
302
+ q as L,
287
303
  i as a
288
304
  };